[Libreoffice-commits] .: sal/inc svl/source xmloff/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Dec 6 12:41:13 PST 2012


 sal/inc/rtl/ustrbuf.hxx          |    4 ++--
 svl/source/numbers/zformat.cxx   |   14 +++++++-------
 xmloff/source/style/xmlnumfi.cxx |    2 +-
 3 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit eafb82821386e4c14f4a072e4b541dc60f4d7af2
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Thu Dec 6 18:48:15 2012 +0100

    OUStringBuffer::remove( int ) -> truncate( int )
    
    Although this may seem consistent with remove( int, int ), it is
    in fact rather misleading API. The biggest offender is most probably
    buffer.remove( 'a' ) , which definitely does not do what it suggests
    to do.
    
    Change-Id: I287619cd4b953228b93fa68fb381d66c344c3865
    Reviewed-on: https://gerrit.libreoffice.org/1256
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Norbert Thiebaud <nthiebaud at gmail.com>
    Reviewed-by: Norbert Thiebaud <nthiebaud at gmail.com>

diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
index c5c6f5d..1397a18 100644
--- a/sal/inc/rtl/ustrbuf.hxx
+++ b/sal/inc/rtl/ustrbuf.hxx
@@ -986,7 +986,7 @@ public:
 
         @since LibreOffice 4.0
      */
-    OUStringBuffer & remove( sal_Int32 start = 0)
+    OUStringBuffer & truncate( sal_Int32 start = 0 )
     {
         rtl_uStringbuffer_remove( &pData, start, getLength() - start );
         return *this;
@@ -1240,7 +1240,7 @@ public:
         }
         if(index < getLength())
         {
-            remove(index);
+            truncate(index);
         }
         return result - getLength();
     }
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 1d86c92..3f47265 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -2625,7 +2625,7 @@ bool SvNumberformat::ImpGetScientificOutput(double fNumber,
             break;
         }
         ExpStr = sStr.toString().copy( nExpStart );    // part following the "E+"
-        sStr.remove( nExPos );
+        sStr.truncate( nExPos );
         // cut any decimal delimiter
         sal_Int32 index = 0;
 
@@ -2692,7 +2692,7 @@ bool SvNumberformat::ImpGetScientificOutput(double fNumber,
     // weiter Hauptzahl:
     if ( !bCont )
     {
-        sStr.remove();
+        sStr.truncate();
     }
     else
     {
@@ -2739,7 +2739,7 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber,
     if (rInfo.nCntExp == 0)
     {
         SAL_WARN( "svl.numbers", "SvNumberformat:: Bruch, nCntExp == 0");
-        sBuff.remove();
+        sBuff.truncate();
         return false;
     }
 
@@ -2944,7 +2944,7 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber,
     }
     if (rInfo.nCntPre > 0 && nFrac == 0)
     {
-        sDiv.remove();
+        sDiv.truncate();
     }
     else
     {
@@ -2980,7 +2980,7 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber,
     // weiter Zaehler:
     if ( !bCont )
     {
-        sFrac.remove();
+        sFrac.truncate();
     }
     else
     {
@@ -3001,7 +3001,7 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber,
     // weiter Hauptzahl
     if ( !bCont )
     {
-        sStr.remove();
+        sStr.truncate();
     }
     else
     {
@@ -4376,7 +4376,7 @@ bool SvNumberformat::ImpGetNumberOutput(double fNumber,
         sal_Int32 nLen = rDecSep.getLength();
         if ( sStr.getLength() > nLen && ( sStr.indexOf( rDecSep, sStr.getLength() - nLen) == sStr.getLength() - nLen) )
         {
-            sStr.remove( sStr.getLength() - nLen );        // no decimals => strip DecSep
+            sStr.truncate( sStr.getLength() - nLen );        // no decimals => strip DecSep
         }
     }
     if (bSign)
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index d53e004..28a4ec6 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -906,7 +906,7 @@ static void lcl_EnquoteIfNecessary( rtl::OUStringBuffer& rContent, const SvXMLNu
                  rContent[nLen - 1] == (sal_Unicode) '"' &&
                  rContent[nLen - 2] == (sal_Unicode) '"' )
             {
-                rContent.remove(nLen - 2);
+                rContent.truncate(nLen - 2);
             }
         }
     }


More information about the Libreoffice-commits mailing list