[Libreoffice-commits] core.git: sw/source

Bjoern Michaelsen bjoern.michaelsen at canonical.com
Fri Dec 23 07:46:18 UTC 2016


 sw/source/core/text/porfly.cxx |   38 ++++++++++++++++++--------------------
 sw/source/core/text/porfly.hxx |    3 +--
 2 files changed, 19 insertions(+), 22 deletions(-)

New commits:
commit ed40f5bbfa89d0957bb274e2f9448f4bf265048f
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Mon Dec 19 05:55:14 2016 +0100

    GetFlyFrame() const isnt called anymore
    
    Change-Id: Ie04afe86c165b72f54791e46209aa37196318c82
    Reviewed-on: https://gerrit.libreoffice.org/32152
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>

diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index 0e211ec..8081c78 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 7e173f9..475e4b2 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;


More information about the Libreoffice-commits mailing list