[Libreoffice-commits] core.git: vcl/inc vcl/source

Tor Lillqvist tml at collabora.com
Mon Dec 21 07:10:27 PST 2015


 vcl/inc/sallayout.hxx        |   12 ++++++------
 vcl/source/gdi/sallayout.cxx |   14 ++++++--------
 2 files changed, 12 insertions(+), 14 deletions(-)

New commits:
commit 6fe4ae9ae383d291c130c51ed7e0b69c3ee9ddb0
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Dec 21 17:00:30 2015 +0200

    These functions can be void
    
    The return values are ignored.
    
    Change-Id: Ieac07150b5cd93c32c9985e548203716c56e8700

diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx
index cf7d53f..7907f69 100644
--- a/vcl/inc/sallayout.hxx
+++ b/vcl/inc/sallayout.hxx
@@ -57,8 +57,8 @@ public:
             ImplLayoutRuns() { mnRunIndex = 0; maRuns.reserve(8); }
 
     void    Clear()             { maRuns.clear(); }
-    bool    AddPos( int nCharPos, bool bRTL );
-    bool    AddRun( int nMinRunPos, int nEndRunPos, bool bRTL );
+    void    AddPos( int nCharPos, bool bRTL );
+    void    AddRun( int nMinRunPos, int nEndRunPos, bool bRTL );
 
     bool    IsEmpty() const     { return maRuns.empty(); }
     void    ResetPos()          { mnRunIndex = 0; }
@@ -106,10 +106,10 @@ public:
     bool        GetNextPos( int* nCharPos, bool* bRTL )
                     { return maRuns.GetNextPos( nCharPos, bRTL ); }
     bool        GetNextRun( int* nMinRunPos, int* nEndRunPos, bool* bRTL );
-    bool        NeedFallback( int nCharPos, bool bRTL )
-                    { return maFallbackRuns.AddPos( nCharPos, bRTL ); }
-    bool        NeedFallback( int nMinRunPos, int nEndRunPos, bool bRTL )
-                    { return maFallbackRuns.AddRun( nMinRunPos, nEndRunPos, bRTL ); }
+    void        NeedFallback( int nCharPos, bool bRTL )
+                    { maFallbackRuns.AddPos( nCharPos, bRTL ); }
+    void        NeedFallback( int nMinRunPos, int nEndRunPos, bool bRTL )
+                    { maFallbackRuns.AddRun( nMinRunPos, nEndRunPos, bRTL ); }
     // methods used by BiDi and glyph fallback
     bool        NeedFallback() const
                     { return !maFallbackRuns.IsEmpty(); }
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 5709802..9d45ff2 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -281,7 +281,7 @@ inline bool IsControlChar( sal_UCS4 cChar )
     return false;
 }
 
-bool ImplLayoutRuns::AddPos( int nCharPos, bool bRTL )
+void ImplLayoutRuns::AddPos( int nCharPos, bool bRTL )
 {
     // check if charpos could extend current run
     int nIndex = maRuns.size();
@@ -293,25 +293,24 @@ bool ImplLayoutRuns::AddPos( int nCharPos, bool bRTL )
         {
             // extend current run by new charpos
             maRuns[ nIndex-1 ] = nCharPos + int(!bRTL);
-            return false;
+            return;
         }
         // ignore new charpos when it is in current run
         if( (nRunPos0 <= nCharPos) && (nCharPos < nRunPos1) )
-            return false;
+            return;
         if( (nRunPos1 <= nCharPos) && (nCharPos < nRunPos0) )
-            return false;
+            return;
     }
 
     // else append a new run consisting of the new charpos
     maRuns.push_back( nCharPos + (bRTL ? 1 : 0) );
     maRuns.push_back( nCharPos + (bRTL ? 0 : 1) );
-    return true;
 }
 
-bool ImplLayoutRuns::AddRun( int nCharPos0, int nCharPos1, bool bRTL )
+void ImplLayoutRuns::AddRun( int nCharPos0, int nCharPos1, bool bRTL )
 {
     if( nCharPos0 == nCharPos1 )
-        return false;
+        return;
 
     // swap if needed
     if( bRTL == (nCharPos0 < nCharPos1) )
@@ -324,7 +323,6 @@ bool ImplLayoutRuns::AddRun( int nCharPos0, int nCharPos1, bool bRTL )
     // append new run
     maRuns.push_back( nCharPos0 );
     maRuns.push_back( nCharPos1 );
-    return true;
 }
 
 bool ImplLayoutRuns::PosIsInRun( int nCharPos ) const


More information about the Libreoffice-commits mailing list