[Libreoffice-commits] .: 2 commits - cppu/source vcl/source

Caolán McNamara caolan at kemper.freedesktop.org
Thu Apr 26 03:42:35 PDT 2012


 cppu/source/typelib/typelib.cxx |    2 +-
 vcl/source/control/field.cxx    |   23 +++++++++++------------
 2 files changed, 12 insertions(+), 13 deletions(-)

New commits:
commit df6d495f2abfeceea439e909649fab23b34f2410
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Apr 26 11:41:59 2012 +0100

    fix OSL_DEBUG_LEVEL > 1 build

diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx
index b47bc23..19851a3 100644
--- a/cppu/source/typelib/typelib.cxx
+++ b/cppu/source/typelib/typelib.cxx
@@ -729,7 +729,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
             pRet = (typelib_TypeDescription *)pTmp;
 #if OSL_DEBUG_LEVEL > 1
             osl_incrementInterlockedCount(
-                &Init::get()->nInterfaceMethodTypeDescriptionCount );
+                &Init::get().nInterfaceMethodTypeDescriptionCount );
 #endif
             pTmp->aBase.pMemberName = 0;
             pTmp->pReturnTypeRef = 0;
commit 6db29ba6b068e213254ede53e3092ddabeecfafe
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Apr 26 11:39:58 2012 +0100

    XubString->rtl::OUString[Buffer]

diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index 7a7092d..03fdc09 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -1035,22 +1035,22 @@ static sal_Bool ImplMetricProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
 
 // -----------------------------------------------------------------------
 
-static XubString ImplMetricGetUnitText( const XubString& rStr )
+static rtl::OUString ImplMetricGetUnitText(const rtl::OUString& rStr)
 {
     // Einheitentext holen
-    XubString aStr;
-    for ( short i = rStr.Len()-1; i >= 0; i-- )
+    rtl::OUStringBuffer aStr;
+    for (sal_Int32 i = rStr.getLength()-1; i >= 0; --i)
     {
-        xub_Unicode c = rStr.GetChar( i );
+        xub_Unicode c = rStr[i];
         if ( (c == '\'') || (c == '\"') || (c == '%' ) || unicode::isAlpha(c) || unicode::isControl(c) )
-            aStr.Insert( c, 0 );
+            aStr.insert(0, c);
         else
         {
-            if ( aStr.Len() )
+            if (aStr.getLength())
                 break;
         }
     }
-    return aStr;
+    return aStr.makeStringAndClear();
 }
 
 // -----------------------------------------------------------------------
@@ -1073,14 +1073,13 @@ static const String& ImplMetricToString( FieldUnit rUnit )
     return String::EmptyString();
 }
 
-static FieldUnit ImplStringToMetric( const String &rMetricString )
+static FieldUnit ImplStringToMetric(const rtl::OUString &rMetricString)
 {
     FieldUnitStringList* pList = ImplGetCleanedFieldUnits();
     if( pList )
     {
         // return FieldUnit
-        rtl::OUString aStr( rMetricString );
-        aStr = aStr.toAsciiLowerCase();
+        rtl::OUString aStr(rMetricString.toAsciiLowerCase());
         aStr = comphelper::string::remove(aStr, ' ');
         for( FieldUnitStringList::const_iterator it = pList->begin(); it != pList->end(); ++it )
         {
@@ -1094,9 +1093,9 @@ static FieldUnit ImplStringToMetric( const String &rMetricString )
 
 // -----------------------------------------------------------------------
 
-static FieldUnit ImplMetricGetUnit( const XubString& rStr )
+static FieldUnit ImplMetricGetUnit(const rtl::OUString& rStr)
 {
-    XubString aStr = ImplMetricGetUnitText( rStr );
+    rtl::OUString aStr = ImplMetricGetUnitText( rStr );
     return ImplStringToMetric( aStr );
 }
 


More information about the Libreoffice-commits mailing list