From ed40f5bbfa89d0957bb274e2f9448f4bf265048f Mon Sep 17 00:00:00 2001 From: Bjoern Michaelsen Date: Mon, 19 Dec 2016 05:55:14 +0100 Subject: GetFlyFrame() const isnt called anymore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie04afe86c165b72f54791e46209aa37196318c82 Reviewed-on: https://gerrit.libreoffice.org/32152 Tested-by: Jenkins Reviewed-by: Björn Michaelsen --- sw/source/core/text/porfly.cxx | 38 ++++++++++++++++++-------------------- sw/source/core/text/porfly.hxx | 3 +-- 2 files changed, 19 insertions(+), 22 deletions(-) diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx index 0e211ec355e6..8081c78c1c98 100644 --- a/sw/source/core/text/porfly.cxx +++ b/sw/source/core/text/porfly.cxx @@ -207,39 +207,37 @@ void sw::FlyContentPortion::Paint(const SwTextPaintInfo& rInf) const { // Baseline output // Re-paint everything at a CompletePaint call - SwRect aRepaintRect( rInf.GetPaintRect() ); + SwRect aRepaintRect(rInf.GetPaintRect()); - if ( rInf.GetTextFrame()->IsRightToLeft() ) - rInf.GetTextFrame()->SwitchLTRtoRTL( aRepaintRect ); + if(rInf.GetTextFrame()->IsRightToLeft()) + rInf.GetTextFrame()->SwitchLTRtoRTL(aRepaintRect); - if ( rInf.GetTextFrame()->IsVertical() ) - rInf.GetTextFrame()->SwitchHorizontalToVertical( aRepaintRect ); + if(rInf.GetTextFrame()->IsVertical()) + rInf.GetTextFrame()->SwitchHorizontalToVertical(aRepaintRect); - if( (GetFlyFrame()->IsCompletePaint() || - GetFlyFrame()->Frame().IsOver( aRepaintRect )) && - SwFlyFrame::IsPaint( const_cast(GetFlyFrame()->GetVirtDrawObj()), - GetFlyFrame()->getRootFrame()->GetCurrShell() )) + if((m_pFly->IsCompletePaint() || + m_pFly->Frame().IsOver(aRepaintRect)) && + SwFlyFrame::IsPaint(m_pFly->GetVirtDrawObj(), m_pFly->getRootFrame()->GetCurrShell())) { - SwRect aRect( GetFlyFrame()->Frame() ); - if( !GetFlyFrame()->IsCompletePaint() ) - aRect.Intersection_( aRepaintRect ); + SwRect aRect(m_pFly->Frame()); + if(!m_pFly->IsCompletePaint()) + aRect.Intersection_(aRepaintRect); // GetFlyFrame() may change the layout mode at the output device. { - SwLayoutModeModifier aLayoutModeModifier( *rInf.GetOut() ); - GetFlyFrame()->Paint( const_cast(*rInf.GetOut()), aRect ); + SwLayoutModeModifier aLayoutModeModifier(*rInf.GetOut()); + m_pFly->Paint(const_cast(*rInf.GetOut()), aRect); } - ((SwTextPaintInfo&)rInf).GetRefDev()->SetLayoutMode( - rInf.GetOut()->GetLayoutMode() ); + ((SwTextPaintInfo&)rInf).GetRefDev()->SetLayoutMode(rInf.GetOut()->GetLayoutMode()); // As the OutputDevice might be anything, the font must be re-selected. // Being in const method should not be a problem. ((SwTextPaintInfo&)rInf).SelectFont(); - OSL_ENSURE( ! rInf.GetVsh() || rInf.GetVsh()->GetOut() == rInf.GetOut(), - "SwFlyCntPortion::Paint: Outdev has changed" ); - if( rInf.GetVsh() ) - ((SwTextPaintInfo&)rInf).SetOut( rInf.GetVsh()->GetOut() ); + assert(rInf.GetVsh()); + SAL_WARN_IF(rInf.GetVsh()->GetOut() != rInf.GetOut(), "sw.core", "SwFlyCntPortion::Paint: Outdev has changed"); + if(rInf.GetVsh()) + ((SwTextPaintInfo&)rInf).SetOut(rInf.GetVsh()->GetOut()); } } diff --git a/sw/source/core/text/porfly.hxx b/sw/source/core/text/porfly.hxx index 7e173f98969e..475e4b2dde26 100644 --- a/sw/source/core/text/porfly.hxx +++ b/sw/source/core/text/porfly.hxx @@ -74,8 +74,7 @@ namespace sw public: FlyContentPortion(SwFlyInContentFrame* pFly); static FlyContentPortion* Create(const SwTextFrame& rFrame, SwFlyInContentFrame* pFly, const Point& rBase, long nAscent, long nDescent, long nFlyAsc, long nFlyDesc, AsCharFlags nFlags); - inline SwFlyInContentFrame *GetFlyFrame() { return m_pFly; } - inline const SwFlyInContentFrame *GetFlyFrame() const { return m_pFly; } + inline SwFlyInContentFrame* GetFlyFrame() { return m_pFly; } void GetFlyCursorOfst(Point& rPoint, SwPosition& rPos, SwCursorMoveState* pCMS) const { m_pFly->GetCursorOfst(&rPos, rPoint, pCMS); }; virtual void Paint(const SwTextPaintInfo& rInf) const override; virtual ~FlyContentPortion() override; -- cgit