sw/source/core/attr/calbck.cxx | 2 - 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 +++++++++++++++++-------------------- 5 files changed, 51 insertions(+), 37 deletions(-)
New commits: commit 64709bc24e28591ebffca9d081be8547e41e6e8b Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Aug 21 14:23:05 2025 +0200 Commit: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> CommitDate: Thu Aug 28 18:34:22 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 Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190020 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190023 (cherry picked from commit 7f7c21b2be2af5be47149cf1dbd81f45512b13a5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190273 Tested-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx index e4a1f437cef7..6e6b9721f11b 100644 --- a/sw/source/core/attr/calbck.cxx +++ b/sw/source/core/attr/calbck.cxx @@ -289,7 +289,7 @@ sw::ClientIteratorBase* sw::ClientIteratorBase::s_pClientIters = nullptr; void SwModify::SwClientNotify(const SwModify&, const SfxHint& rHint) { - if (rHint.GetId() != SfxHintId::SwLegacyModify && rHint.GetId() != SfxHintId::SwRemoveUnoObject && rHint.GetId() != SfxHintId::SwRemoveUnoObject) + if (rHint.GetId() != SfxHintId::SwLegacyModify && rHint.GetId() != SfxHintId::SwRemoveUnoObject && rHint.GetId() != SfxHintId::SwFormatChange) return; DBG_TESTSOLARMUTEX(); diff --git a/sw/source/core/layout/flyincnt.cxx b/sw/source/core/layout/flyincnt.cxx index ed249c322bd0..2d7fb593a10f 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::SwLegacyModify) diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index bc8de8ed1f9b..89774c299d8d 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -625,6 +625,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 25b9c0287673..12d72a2cb47d 100644 --- a/sw/source/core/txtnode/atrfld.cxx +++ b/sw/source/core/txtnode/atrfld.cxx @@ -413,6 +413,11 @@ void SwFormatField::UpdateTextNode(const SfxHint& rHint) 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 7f0c05d5dfbf..cf12aaa229d1 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -5631,46 +5631,43 @@ void SwTextNode::TriggerNodeUpdate(const sw::RemoveUnoObjectHint& 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); } }