diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2016-12-19 05:55:14 +0100 |
---|---|---|
committer | Björn Michaelsen <bjoern.michaelsen@canonical.com> | 2016-12-23 07:45:58 +0000 |
commit | ed40f5bbfa89d0957bb274e2f9448f4bf265048f (patch) | |
tree | d551469b0f55e6f48027fff871d81088ddc64fd7 | |
parent | 2fc262d3a7bf3be8d318b3f194ccab2a301ade8c (diff) |
GetFlyFrame() const isnt called anymore
Change-Id: Ie04afe86c165b72f54791e46209aa37196318c82
Reviewed-on: https://gerrit.libreoffice.org/32152
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
-rw-r--r-- | sw/source/core/text/porfly.cxx | 38 | ||||
-rw-r--r-- | 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<SwVirtFlyDrawObj*>(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<vcl::RenderContext&>(*rInf.GetOut()), aRect ); + SwLayoutModeModifier aLayoutModeModifier(*rInf.GetOut()); + m_pFly->Paint(const_cast<vcl::RenderContext&>(*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; |