sw/source/core/inc/txtfrm.hxx | 16 +++------------- sw/source/core/text/frmpaint.cxx | 2 +- sw/source/core/text/porfld.cxx | 2 +- 3 files changed, 5 insertions(+), 15 deletions(-)
New commits: commit 1068cd163300e6e1cc2847bdd1b4eb478962a3c4 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Sun Aug 17 09:36:06 2025 +0200 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Sun Aug 17 11:06:22 2025 +0200 Make setters non-const Move const_cast to the places that actually treat const objects as non-const. Change-Id: I9a022a662b5079be0f4b2dcc0f9c9267cdde2e95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189811 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx index bb3a8bc5015c..89751c779acd 100644 --- a/sw/source/core/inc/txtfrm.hxx +++ b/sw/source/core/inc/txtfrm.hxx @@ -551,13 +551,12 @@ public: bool IsInFootnoteConnect()const { return mbInFootnoteConnect;} bool IsFieldFollow() const { return mbFieldFollow;} - inline void SetRepaint() const; - inline void ResetRepaint() const; + inline void SetRepaint() { mbRepaint = true; } + inline void ResetRepaint() { mbRepaint = false; } bool HasRepaint() const { return mbRepaint; } void SetHasRotatedPortions(bool bHasRotatedPortions); bool GetHasRotatedPortions() const { return mbHasRotatedPortions; } - void SetAnimation() const - { const_cast<SwTextFrame*>(this)->mbHasAnimation = true; } + void SetAnimation() { mbHasAnimation = true; } bool HasAnimation() const { return mbHasAnimation; } bool IsSwapped() const { return mbIsSwapped; } @@ -913,15 +912,6 @@ inline void SwTextFrame::SetOffset(TextFrameIndex const nNewOfst) SetOffset_( nNewOfst ); } -inline void SwTextFrame::SetRepaint() const -{ - const_cast<SwTextFrame*>(this)->mbRepaint = true; -} -inline void SwTextFrame::ResetRepaint() const -{ - const_cast<SwTextFrame*>(this)->mbRepaint = false; -} - class TemporarySwap { protected: explicit TemporarySwap(SwTextFrame * frame, bool swap): diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx index 5e6f0b4a369e..02e5114a9691 100644 --- a/sw/source/core/text/frmpaint.cxx +++ b/sw/source/core/text/frmpaint.cxx @@ -645,7 +645,7 @@ bool SwTextFrame::PaintEmpty( const SwRect &rRect, bool bCheck ) const void SwTextFrame::PaintSwFrame(vcl::RenderContext& rRenderContext, SwRect const& rRect, PaintFrameMode) const { - ResetRepaint(); + const_cast<SwTextFrame*>(this)->ResetRepaint(); // #i16816# tagged pdf support SwViewShell *pSh = getRootFrame()->GetCurrShell(); diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx index ad4fa9290310..0a020999d924 100644 --- a/sw/source/core/text/porfld.cxx +++ b/sw/source/core/text/porfld.cxx @@ -991,7 +991,7 @@ void SwGrfNumPortion::Paint( const SwTextPaintInfo &rInf ) const if( !m_nId ) { SetId( reinterpret_cast<sal_IntPtr>( rInf.GetTextFrame() ) ); - rInf.GetTextFrame()->SetAnimation(); + const_cast<SwTextFrame*>(rInf.GetTextFrame())->SetAnimation(); } if( aTmp.Overlaps( rInf.GetPaintRect() ) && !bDraw ) {