summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@libreoffice.org>2020-12-13 18:45:12 +0100
committerBjoern Michaelsen <bjoern.michaelsen@libreoffice.org>2020-12-13 20:07:27 +0100
commitaf0009ec5a60af83762e7df49e17e02f0f2be193 (patch)
tree28332e41a8ba142105105a2fc07c3b996af9c12b /sw
parentcd7c289a3365ee14496c0ec981db5a39638c2aca (diff)
tabfrm:Modify no more
Change-Id: Ie54bea8a8c60b0a74f745630f9cddfc4bd4b0ac7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107656 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/inc/tabfrm.hxx5
-rw-r--r--sw/source/core/layout/tabfrm.cxx61
2 files changed, 35 insertions, 31 deletions
diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx
index d0eb807297a1..88bd6a82b0fb 100644
--- a/sw/source/core/inc/tabfrm.hxx
+++ b/sw/source/core/inc/tabfrm.hxx
@@ -27,7 +27,7 @@ class SwBorderAttrs;
class SwAttrSetChg;
/// SwTabFrame is one table in the document layout, containing rows (which contain cells).
-class SwTabFrame: public SwLayoutFrame, public SwFlowFrame
+class SwTabFrame final: public SwLayoutFrame, public SwFlowFrame
{
friend void CalcContent( SwLayoutFrame *pLay, bool bNoColl );
@@ -105,10 +105,9 @@ class SwTabFrame: public SwLayoutFrame, public SwFlowFrame
virtual void DestroyImpl() override;
virtual ~SwTabFrame() override;
-protected:
virtual void MakeAll(vcl::RenderContext* pRenderContext) override;
virtual void Format( vcl::RenderContext* pRenderContext, const SwBorderAttrs *pAttrs = nullptr ) override;
- virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ) override;
+ virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
// only changes the Framesize, not the PrtArea size
virtual SwTwips GrowFrame ( SwTwips, bool bTst = false, bool bInfo = false ) override;
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index ed54f255c052..88033e3ee9b6 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -3257,64 +3257,69 @@ SwTwips SwTabFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo )
return nDist;
}
-void SwTabFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
+void SwTabFrame::SwClientNotify(const SwModify&, const SfxHint& rHint)
{
+ auto pLegacy = dynamic_cast<const sw::LegacyModifyHint*>(&rHint);
+ if(!pLegacy)
+ return;
sal_uInt8 nInvFlags = 0;
- bool bAttrSetChg = pNew && RES_ATTRSET_CHG == pNew->Which();
+ bool bAttrSetChg = pLegacy->m_pNew && RES_ATTRSET_CHG == pLegacy->m_pNew->Which();
- if( bAttrSetChg )
+ if(bAttrSetChg)
{
- SfxItemIter aNIter( *static_cast<const SwAttrSetChg*>(pNew)->GetChgSet() );
- SfxItemIter aOIter( *static_cast<const SwAttrSetChg*>(pOld)->GetChgSet() );
- const SfxPoolItem* pNItem = aNIter.GetCurItem();
+ auto& rOldSetChg = *static_cast<const SwAttrSetChg*>(pLegacy->m_pOld);
+ auto& rNewSetChg = *static_cast<const SwAttrSetChg*>(pLegacy->m_pNew);
+ SfxItemIter aOIter(*rOldSetChg.GetChgSet());
+ SfxItemIter aNIter(*rNewSetChg.GetChgSet());
const SfxPoolItem* pOItem = aOIter.GetCurItem();
- SwAttrSetChg aOldSet( *static_cast<const SwAttrSetChg*>(pOld) );
- SwAttrSetChg aNewSet( *static_cast<const SwAttrSetChg*>(pNew) );
+ const SfxPoolItem* pNItem = aNIter.GetCurItem();
+ SwAttrSetChg aOldSet(rOldSetChg);
+ SwAttrSetChg aNewSet(rNewSetChg);
do
{
UpdateAttr_(pOItem, pNItem, nInvFlags, &aOldSet, &aNewSet);
pNItem = aNIter.NextItem();
pOItem = aOIter.NextItem();
- } while (pNItem);
- if ( aOldSet.Count() || aNewSet.Count() )
- SwLayoutFrame::Modify( &aOldSet, &aNewSet );
+ } while(pNItem);
+ if(aOldSet.Count() || aNewSet.Count())
+ SwLayoutFrame::Modify(&aOldSet, &aNewSet);
}
else
- UpdateAttr_( pOld, pNew, nInvFlags );
+ UpdateAttr_(pLegacy->m_pOld, pLegacy->m_pNew, nInvFlags);
- if ( nInvFlags == 0 )
+ if(nInvFlags == 0)
return;
- SwPageFrame *pPage = FindPageFrame();
- InvalidatePage( pPage );
- if ( nInvFlags & 0x02 )
+ SwPageFrame* pPage = FindPageFrame();
+ InvalidatePage(pPage);
+ if(nInvFlags & 0x02)
InvalidatePrt_();
- if ( nInvFlags & 0x40 )
+ if(nInvFlags & 0x40)
InvalidatePos_();
- SwFrame *pTmp = GetIndNext();
- if ( nullptr != pTmp )
+ SwFrame* pTmp = GetIndNext();
+ if(nullptr != pTmp)
{
- if ( nInvFlags & 0x04 )
+ if(nInvFlags & 0x04)
{
pTmp->InvalidatePrt_();
- if ( pTmp->IsContentFrame() )
- pTmp->InvalidatePage( pPage );
+ if(pTmp->IsContentFrame())
+ pTmp->InvalidatePage(pPage);
}
- if ( nInvFlags & 0x10 )
+ if(nInvFlags & 0x10)
pTmp->SetCompletePaint();
}
- if ( nInvFlags & 0x08 && nullptr != (pTmp = GetPrev()) )
+ if(nInvFlags & 0x08 && nullptr != (pTmp = GetPrev()))
{
pTmp->InvalidatePrt_();
- if ( pTmp->IsContentFrame() )
+ if(pTmp->IsContentFrame())
pTmp->InvalidatePage( pPage );
}
- if ( nInvFlags & 0x20 )
+ if(nInvFlags & 0x20)
{
- if ( pPage && pPage->GetUpper() && !IsFollow() )
+ if(pPage && pPage->GetUpper() && !IsFollow())
static_cast<SwRootFrame*>(pPage->GetUpper())->InvalidateBrowseWidth();
}
- if ( nInvFlags & 0x80 )
+ if(nInvFlags & 0x80)
InvalidateNextPos();
}