diff options
author | Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org> | 2020-12-30 00:47:52 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org> | 2020-12-31 21:15:08 +0100 |
commit | 5a94a20229a1bd82a39006012694cdc9f02ffa31 (patch) | |
tree | 331d0126377c4197cbe9215698b84f1720ae26e1 | |
parent | d06cb471ecab814c29c3b8948933fc17b63ec21e (diff) |
SwFlyFrame: Modify no more
Also, make the uitest output a bit more explicit.
Change-Id: I41fa08a6fc02d95ad3337129eb93f8a569cf3cbd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108491
Tested-by: Jenkins
Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
-rw-r--r-- | sw/Module_sw.mk | 2 | ||||
-rw-r--r-- | sw/qa/uitest/writer_tests4/spellDialog.py | 2 | ||||
-rw-r--r-- | sw/source/core/inc/flyfrm.hxx | 1 | ||||
-rw-r--r-- | sw/source/core/layout/fly.cxx | 126 | ||||
-rw-r--r-- | sw/source/core/layout/flycnt.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/layout/flylay.cxx | 4 |
6 files changed, 67 insertions, 72 deletions
diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk index 65acc6c7b744..85a0a7a23e13 100644 --- a/sw/Module_sw.mk +++ b/sw/Module_sw.mk @@ -164,6 +164,7 @@ $(eval $(call gb_Module_add_screenshot_targets,sw,\ )) $(eval $(call gb_Module_add_uicheck_targets,sw,\ + UITest_librelogo \ UITest_writer_tests \ UITest_writer_tests2 \ UITest_writer_tests3 \ @@ -176,7 +177,6 @@ $(eval $(call gb_Module_add_uicheck_targets,sw,\ UITest_sw_findReplace \ UITest_sw_findSimilarity \ UITest_chapterNumbering \ - UITest_librelogo \ UITest_sw_navigator \ UITest_sw_options \ UITest_sw_styleInspector \ diff --git a/sw/qa/uitest/writer_tests4/spellDialog.py b/sw/qa/uitest/writer_tests4/spellDialog.py index 3b9e4c31f3da..560bbb76e227 100644 --- a/sw/qa/uitest/writer_tests4/spellDialog.py +++ b/sw/qa/uitest/writer_tests4/spellDialog.py @@ -129,5 +129,5 @@ frog, dogg, catt""" # "good" is an insertion by fixing the first misspelling), # but now "goood" is not a misspelling because it is accepted # correctly without the redline containing a deleted "o" - self.assertTrue(output_text == 'goood baaadbaaed eeend') + self.assertEqual(output_text, 'goood baaadbaaed eeend') diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx index 52295f340c28..13629ecfed14 100644 --- a/sw/source/core/inc/flyfrm.hxx +++ b/sw/source/core/inc/flyfrm.hxx @@ -141,7 +141,6 @@ protected: virtual bool SetObjLeft_( const SwTwips _nLeft ) override; virtual SwRect GetObjBoundRect() const override; - virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ) override; virtual void SwClientNotify(const SwModify& rMod, const SfxHint& rHint) override; virtual const IDocumentDrawModelAccess& getIDocumentDrawModelAccess( ) override; diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index b45509d295de..02b7c724eaef 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -657,8 +657,67 @@ bool SwFlyFrame::FrameSizeChg( const SwFormatFrameSize &rFrameSize ) void SwFlyFrame::SwClientNotify(const SwModify& rMod, const SfxHint& rHint) { - SwFrame::SwClientNotify(rMod, rHint); - if (auto pGetZOrdnerHint = dynamic_cast<const sw::GetZOrderHint*>(&rHint)) + if(auto pLegacy = dynamic_cast<const sw::LegacyModifyHint*>(&rHint)) + { + sal_uInt8 nInvFlags = 0; + if(pLegacy->m_pNew && pLegacy->m_pOld && RES_ATTRSET_CHG == pLegacy->m_pNew->Which()) + { + SfxItemIter aNIter(*static_cast<const SwAttrSetChg*>(pLegacy->m_pNew)->GetChgSet()); + SfxItemIter aOIter(*static_cast<const SwAttrSetChg*>(pLegacy->m_pOld)->GetChgSet()); + const SfxPoolItem* pNItem = aNIter.GetCurItem(); + const SfxPoolItem* pOItem = aOIter.GetCurItem(); + SwAttrSetChg aOldSet(*static_cast<const SwAttrSetChg*>(pLegacy->m_pOld)); + SwAttrSetChg aNewSet(*static_cast<const SwAttrSetChg*>(pLegacy->m_pNew)); + do + { + UpdateAttr_(pOItem, pNItem, nInvFlags, &aOldSet, &aNewSet); + pNItem = aNIter.NextItem(); + pOItem = aOIter.NextItem(); + } while(pNItem); + if(aOldSet.Count() || aNewSet.Count()) + SwLayoutFrame::Modify(&aOldSet, &aNewSet); + } + else + UpdateAttr_(pLegacy->m_pOld, pLegacy->m_pNew, nInvFlags); + + if(nInvFlags == 0) + return; + + Invalidate_(); + if(nInvFlags & 0x01) + { + InvalidatePos_(); + // #i68520# + InvalidateObjRectWithSpaces(); + } + if(nInvFlags & 0x02) + { + InvalidateSize_(); + // #i68520# + InvalidateObjRectWithSpaces(); + } + if(nInvFlags & 0x04) + InvalidatePrt_(); + if(nInvFlags & 0x08) + SetNotifyBack(); + if(nInvFlags & 0x10) + SetCompletePaint(); + if((nInvFlags & 0x40) && Lower() && Lower()->IsNoTextFrame()) + ClrContourCache( GetVirtDrawObj() ); + SwRootFrame *pRoot; + if(nInvFlags & 0x20 && nullptr != (pRoot = getRootFrame())) + pRoot->InvalidateBrowseWidth(); + // #i28701# + if(nInvFlags & 0x80) + { + // update sorted object lists, the Writer fly frame is registered at. + UpdateObjInSortedList(); + } + + // #i87645# - reset flags for the layout process (only if something has been invalidated) + ResetLayoutProcessBools(); + } + else if (auto pGetZOrdnerHint = dynamic_cast<const sw::GetZOrderHint*>(&rHint)) { const auto& rFormat(dynamic_cast<const SwFrameFormat&>(rMod)); if (rFormat.Which() == RES_FLYFRMFMT && rFormat.getIDocumentLayoutAccess().GetCurrentViewShell()) // #i11176# @@ -672,69 +731,6 @@ void SwFlyFrame::SwClientNotify(const SwModify& rMod, const SfxHint& rHint) } } -void SwFlyFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew ) -{ - sal_uInt8 nInvFlags = 0; - - if (pNew && pOld && RES_ATTRSET_CHG == pNew->Which()) - { - SfxItemIter aNIter( *static_cast<const SwAttrSetChg*>(pNew)->GetChgSet() ); - SfxItemIter aOIter( *static_cast<const SwAttrSetChg*>(pOld)->GetChgSet() ); - const SfxPoolItem* pNItem = aNIter.GetCurItem(); - const SfxPoolItem* pOItem = aOIter.GetCurItem(); - SwAttrSetChg aOldSet( *static_cast<const SwAttrSetChg*>(pOld) ); - SwAttrSetChg aNewSet( *static_cast<const SwAttrSetChg*>(pNew) ); - do - { - UpdateAttr_(pOItem, pNItem, nInvFlags, &aOldSet, &aNewSet); - pNItem = aNIter.NextItem(); - pOItem = aOIter.NextItem(); - } while (pNItem); - if ( aOldSet.Count() || aNewSet.Count() ) - SwLayoutFrame::Modify( &aOldSet, &aNewSet ); - } - else - UpdateAttr_( pOld, pNew, nInvFlags ); - - if ( nInvFlags == 0 ) - return; - - Invalidate_(); - if ( nInvFlags & 0x01 ) - { - InvalidatePos_(); - // #i68520# - InvalidateObjRectWithSpaces(); - } - if ( nInvFlags & 0x02 ) - { - InvalidateSize_(); - // #i68520# - InvalidateObjRectWithSpaces(); - } - if ( nInvFlags & 0x04 ) - InvalidatePrt_(); - if ( nInvFlags & 0x08 ) - SetNotifyBack(); - if ( nInvFlags & 0x10 ) - SetCompletePaint(); - if ( ( nInvFlags & 0x40 ) && Lower() && Lower()->IsNoTextFrame() ) - ClrContourCache( GetVirtDrawObj() ); - SwRootFrame *pRoot; - if ( nInvFlags & 0x20 && nullptr != (pRoot = getRootFrame()) ) - pRoot->InvalidateBrowseWidth(); - // #i28701# - if ( nInvFlags & 0x80 ) - { - // update sorted object lists, the Writer fly frame is registered at. - UpdateObjInSortedList(); - } - - // #i87645# - reset flags for the layout process (only if something has been invalidated) - ResetLayoutProcessBools(); - -} - void SwFlyFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pNew, sal_uInt8 &rInvFlags, SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet ) diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx index 0b159ea1a743..c139bd864cfa 100644 --- a/sw/source/core/layout/flycnt.cxx +++ b/sw/source/core/layout/flycnt.cxx @@ -79,7 +79,7 @@ SwFlyAtContentFrame::SwFlyAtContentFrame( SwFlyFrameFormat *pFormat, SwFrame* pS // #i28701# -void SwFlyAtContentFrame::SwClientNotify(const SwModify&, const SfxHint& rHint) +void SwFlyAtContentFrame::SwClientNotify(const SwModify& rMod, const SfxHint& rHint) { auto pLegacy = dynamic_cast<const sw::LegacyModifyHint*>(&rHint); if(!pLegacy) @@ -87,7 +87,7 @@ void SwFlyAtContentFrame::SwClientNotify(const SwModify&, const SfxHint& rHint) const SwFormatAnchor* pAnch = pLegacy->m_pNew ? GetAnchorFromPoolItem(*pLegacy->m_pNew) : nullptr; if(!pAnch) { - SwFlyFrame::Modify(pLegacy->m_pOld, pLegacy->m_pNew); + SwFlyFrame::SwClientNotify(rMod, rHint); return; } OSL_ENSURE(pAnch->GetAnchorId() == GetFormat()->GetAnchor().GetAnchorId(), diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx index 4159be4b5617..8f58d83a138d 100644 --- a/sw/source/core/layout/flylay.cxx +++ b/sw/source/core/layout/flylay.cxx @@ -725,7 +725,7 @@ SwFlyLayFrame::SwFlyLayFrame( SwFlyFrameFormat *pFormat, SwFrame* pSib, SwFrame // #i28701# -void SwFlyLayFrame::SwClientNotify(const SwModify&, const SfxHint& rHint) +void SwFlyLayFrame::SwClientNotify(const SwModify& rMod, const SfxHint& rHint) { auto pLegacy = dynamic_cast<const sw::LegacyModifyHint*>(&rHint); if(!pLegacy || !pLegacy->m_pNew) @@ -734,7 +734,7 @@ void SwFlyLayFrame::SwClientNotify(const SwModify&, const SfxHint& rHint) if(!pAnch) { - SwFlyFrame::Modify(pLegacy->m_pOld, pLegacy->m_pNew); + SwFlyFrame::SwClientNotify(rMod, rHint); return; } SAL_WARN_IF(pAnch->GetAnchorId() == GetFormat()->GetAnchor().GetAnchorId(), "sw.core", "Invalid change of anchor type."); |