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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Oct 29 11:08:14 UTC 2018


 sw/source/core/text/txtfly.cxx |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 53c907aa2411f92059d15a961874b22a543745ed
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Mon Oct 29 10:53:11 2018 +0100
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Mon Oct 29 12:07:52 2018 +0100

    Simplify conditions a bit
    
    bOn is implied when nCount is > 0
    
    Change-Id: I77939668445603a22ae9ea56a7d272ca650c5c1c
    Reviewed-on: https://gerrit.libreoffice.org/62499
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index 535c570e0e90..31f04c376233 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -490,8 +490,8 @@ void SwTextFly::DrawTextOpaque( SwDrawTextInfo &rInf )
     OSL_ENSURE( !bTopRule, "DrawTextOpaque: Wrong TopRule" );
 
     // #i68520#
-    SwAnchoredObjList::size_type nCount( bOn ? GetAnchoredObjList()->size() : 0 );
-    if ( bOn && nCount > 0 )
+    const SwAnchoredObjList::size_type nCount( bOn ? GetAnchoredObjList()->size() : 0 );
+    if (nCount > 0)
     {
         const SdrLayerID nHellId = pPage->getRootFrame()->GetCurrShell()->getIDocumentDrawModelAccess().GetHellId();
         for( SwAnchoredObjList::size_type i = 0; i < nCount; ++i )
@@ -576,8 +576,8 @@ void SwTextFly::DrawFlyRect( OutputDevice* pOut, const SwRect &rRect )
     SwRegionRects aRegion( rRect );
     OSL_ENSURE( !bTopRule, "DrawFlyRect: Wrong TopRule" );
     // #i68520#
-    SwAnchoredObjList::size_type nCount( bOn ? GetAnchoredObjList()->size() : 0 );
-    if ( bOn && nCount > 0 )
+    const SwAnchoredObjList::size_type nCount( bOn ? GetAnchoredObjList()->size() : 0 );
+    if (nCount > 0)
     {
         const SdrLayerID nHellId = pPage->getRootFrame()->GetCurrShell()->getIDocumentDrawModelAccess().GetHellId();
         for( SwAnchoredObjList::size_type i = 0; i < nCount; ++i )
@@ -1001,8 +1001,8 @@ bool SwTextFly::ForEach( const SwRect &rRect, SwRect* pRect, bool bAvoid ) const
 
     bool bRet = false;
     // #i68520#
-    SwAnchoredObjList::size_type nCount( bOn ? GetAnchoredObjList()->size() : 0 );
-    if ( bOn && nCount > 0 )
+    const SwAnchoredObjList::size_type nCount( bOn ? GetAnchoredObjList()->size() : 0 );
+    if (nCount > 0)
     {
         for( SwAnchoredObjList::size_type i = 0; i < nCount; ++i )
         {


More information about the Libreoffice-commits mailing list