reportdesign/qa/unit/data/roundTrip.odb |binary sw/source/core/attr/calbck.cxx | 1 sw/source/core/layout/flyincnt.cxx | 10 +++-- sw/source/core/layout/pagechg.cxx | 8 ++++ sw/source/core/txtnode/atrfld.cxx | 5 ++ sw/source/core/txtnode/ndtxt.cxx | 63 +++++++++++++++----------------- 6 files changed, 51 insertions(+), 36 deletions(-)
New commits: commit 9ba5977c8f92fb130851b87d405029ec7ea0be36 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Aug 21 14:23:05 2025 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Aug 21 17:58:54 2025 +0200 tdf#167774 Writer shows font of defined style with 10,8 pt instead of 9 pt regression from commit ca65ed8a37847b334868b8cbf05f1ba77665d5aa Author: Noel Grandin <noelgran...@gmail.com> Date: Tue Dec 24 12:28:29 2024 +0200 move RES_FMT_CHG to SfxHint The important fix is in SwModify::SwClientNotify. The other changes are small things I picked up when going over the original patch, which likely don't make much different, but better safe than sorry. Change-Id: I65c79b60740dc7f1b711522db8d8682c69d632e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189998 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Jenkins diff --git a/reportdesign/qa/unit/data/roundTrip.odb b/reportdesign/qa/unit/data/roundTrip.odb index 8ab8306646bc..c3e818ec9e32 100644 Binary files a/reportdesign/qa/unit/data/roundTrip.odb and b/reportdesign/qa/unit/data/roundTrip.odb differ diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx index 8eeae58276ec..06200a7c0f6a 100644 --- a/sw/source/core/attr/calbck.cxx +++ b/sw/source/core/attr/calbck.cxx @@ -253,6 +253,7 @@ void SwModify::SwClientNotify(const SwModify&, const SfxHint& rHint) { if (rHint.GetId() != SfxHintId::SwLegacyModify && rHint.GetId() != SfxHintId::SwRemoveUnoObject + && rHint.GetId() != SfxHintId::SwFormatChange && rHint.GetId() != SfxHintId::SwAttrSetChange && rHint.GetId() != SfxHintId::SwObjectDying && rHint.GetId() != SfxHintId::SwUpdateAttr) diff --git a/sw/source/core/layout/flyincnt.cxx b/sw/source/core/layout/flyincnt.cxx index 4e5bc7e37c63..8098111b58d7 100644 --- a/sw/source/core/layout/flyincnt.cxx +++ b/sw/source/core/layout/flyincnt.cxx @@ -102,9 +102,13 @@ void SwFlyInContentFrame::SwClientNotify(const SwModify& rMod, const SfxHint& rH } if (rHint.GetId() == SfxHintId::SwFormatChange) { - SwFlyFrame::SwClientNotify(rMod, rHint); - if(GetAnchorFrame()) - AnchorFrame()->Prepare(PrepareHint::FlyFrameAttributesChanged, GetFormat()); + auto pFormatChangeHint = static_cast<const SwFormatChangeHint*>(&rHint); + if (pFormatChangeHint->m_pNewFormat) + { + SwFlyFrame::SwClientNotify(rMod, rHint); + if(GetAnchorFrame()) + AnchorFrame()->Prepare(PrepareHint::FlyFrameAttributesChanged, GetFormat()); + } return; } if (rHint.GetId() == SfxHintId::SwAttrSetChange) diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 30ef41e0f87c..070b8b8ccf32 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -630,6 +630,14 @@ void SwPageFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pNew, } else if (pNew) { + const SwFormatFrameSize &rSz = static_cast<const SwFormatFrameSize&>(*pNew); + + { + SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this); + aFrm.Height( std::max( rSz.GetHeight(), tools::Long(MINLAY) ) ); + aFrm.Width ( std::max( rSz.GetWidth(), tools::Long(MINLAY) ) ); + } + if ( GetUpper() ) { static_cast<SwRootFrame*>(GetUpper())->CheckViewLayout( nullptr, nullptr ); diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx index 9eb5aa2a9a6e..3e62a1e5a7ff 100644 --- a/sw/source/core/txtnode/atrfld.cxx +++ b/sw/source/core/txtnode/atrfld.cxx @@ -441,6 +441,11 @@ void SwFormatField::UpdateTextNode(const SfxHint& rHint) else if (rHint.GetId() == SfxHintId::SwFormatChange) { auto pChangeHint = static_cast<const SwFormatChangeHint*>(&rHint); + if (pChangeHint->m_pOldFormat == nullptr && pChangeHint->m_pNewFormat == nullptr) + { + ForceUpdateTextNode(); + return; + } if (!IsFieldInDoc()) return; diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 91edfd7ee129..759f97c772e2 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -5719,46 +5719,43 @@ void SwTextNode::TriggerNodeUpdate(const sw::AttrSetChangeHint& rHint) void SwTextNode::TriggerNodeUpdate(const SwFormatChangeHint& rHint) { - assert(!rHint.m_pOldFormat || dynamic_cast<const SwTextFormatColl*>(rHint.m_pOldFormat)); - assert(!rHint.m_pNewFormat || dynamic_cast<const SwTextFormatColl*>(rHint.m_pNewFormat)); - const SwTextFormatColl* pTxtFmtColOld = static_cast<const SwTextFormatColl*>( - rHint.m_pOldFormat); - const SwTextFormatColl* pTxtFmtColNew = static_cast<const SwTextFormatColl*>( - rHint.m_pNewFormat); - { - sw::TextNodeNotificationSuppressor(*this); + sw::TextNodeNotificationSuppressor(*this); - // Override Modify so that deleting styles works properly (outline - // numbering!). - // Never call ChgTextCollUpdateNum for Nodes in Undo. - if( GetRegisteredIn() == rHint.m_pNewFormat - && GetNodes().IsDocNodes() ) + // Override Modify so that deleting styles works properly (outline + // numbering!). + // Never call ChgTextCollUpdateNum for Nodes in Undo. + if( rHint.m_pOldFormat + && rHint.m_pNewFormat + && GetRegisteredIn() == rHint.m_pNewFormat + && GetNodes().IsDocNodes() ) + { + assert(dynamic_cast<const SwTextFormatColl*>(rHint.m_pNewFormat)); + if (const SwTextFormatColl* pTxtFmtColOld = dynamic_cast<const SwTextFormatColl*>(rHint.m_pOldFormat)) { - if (pTxtFmtColOld) - { - ChgTextCollUpdateNum(pTxtFmtColOld, pTxtFmtColNew); - } + ChgTextCollUpdateNum( + pTxtFmtColOld, static_cast<const SwTextFormatColl*>(rHint.m_pNewFormat)); } + } - // reset fill information - if (maFillAttributes) - { - maFillAttributes.reset(); - } + // reset fill information + if (maFillAttributes && rHint.m_pNewFormat) + { + // ..on format change (e.g. style changed) + maFillAttributes.reset(); + } - if ( !mbInSetOrResetAttr ) - { - HandleModifyAtTextNodeFormatChange( *this ); - } + if ( !mbInSetOrResetAttr ) + { + HandleModifyAtTextNodeFormatChange( *this ); + } - SwContentNode::SwClientNotify(*this, rHint); + SwContentNode::SwClientNotify(*this, rHint); - SwDoc& rDoc = GetDoc(); - // #125329# - assure that text node is in document nodes array - if ( !rDoc.IsInDtor() && &rDoc.GetNodes() == &GetNodes() ) - { - rDoc.GetNodes().UpdateOutlineNode(*this); - } + SwDoc& rDoc = GetDoc(); + // #125329# - assure that text node is in document nodes array + if ( !rDoc.IsInDtor() && &rDoc.GetNodes() == &GetNodes() ) + { + rDoc.GetNodes().UpdateOutlineNode(*this); } }