[Libreoffice-commits] .: binfilter/bf_svtools binfilter/inc

Caolán McNamara caolan at kemper.freedesktop.org
Sun Feb 19 05:42:47 PST 2012


 binfilter/bf_svtools/source/misc/tl_strimp.cxx   |   46 -----------------------
 binfilter/bf_svtools/source/misc/tl_tustring.cxx |   46 +++++++++++++++++++++++
 binfilter/inc/bf_tools/string.hxx                |    6 +--
 3 files changed, 49 insertions(+), 49 deletions(-)

New commits:
commit 6c7344599885a7528a5c06a4e2a0b15e0adb35fd
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Feb 18 21:12:34 2012 +0000

    ditch extra ByteString code

diff --git a/binfilter/bf_svtools/source/misc/tl_strimp.cxx b/binfilter/bf_svtools/source/misc/tl_strimp.cxx
index b0d7279..64eef56 100644
--- a/binfilter/bf_svtools/source/misc/tl_strimp.cxx
+++ b/binfilter/bf_svtools/source/misc/tl_strimp.cxx
@@ -383,52 +383,6 @@ STRING& STRING::Assign( const STRCODE* pCharStr )
 
 // -----------------------------------------------------------------------
 
-STRING& STRING::Assign( const STRCODE* pCharStr, xub_StrLen nLen )
-{
-    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
-    DBG_ASSERT( pCharStr, "String::Assign() - pCharStr is NULL" );
-
-    if ( nLen == STRING_LEN )
-        nLen = ImplStringLen( pCharStr );
-
-#ifdef DBG_UTIL
-    if ( DbgIsAssert() )
-    {
-        for ( xub_StrLen i = 0; i < nLen; i++ )
-        {
-            if ( !pCharStr[i] )
-            {
-                OSL_FAIL( "String::Assign() : nLen is wrong" );
-            }
-        }
-    }
-#endif
-
-    if ( !nLen )
-    {
-        STRING_NEW((STRING_TYPE **)&mpData);
-    }
-    else
-    {
-        // Wenn String genauso lang ist, wie der String, dann direkt kopieren
-        if ( (nLen == mpData->mnLen) && (mpData->mnRefCount == 1) )
-            memcpy( mpData->maStr, pCharStr, nLen*sizeof( STRCODE ) );
-        else
-        {
-            // Alte Daten loeschen
-            STRING_RELEASE((STRING_TYPE *)mpData);
-
-            // Daten initialisieren und String kopieren
-            mpData = ImplAllocData( nLen );
-            memcpy( mpData->maStr, pCharStr, nLen*sizeof( STRCODE ) );
-        }
-    }
-
-    return *this;
-}
-
-// -----------------------------------------------------------------------
-
 STRING& STRING::Assign( STRCODE c )
 {
     DBG_CHKTHIS( STRING, DBGCHECKSTRING );
diff --git a/binfilter/bf_svtools/source/misc/tl_tustring.cxx b/binfilter/bf_svtools/source/misc/tl_tustring.cxx
index 4657cd8..803b36e 100644
--- a/binfilter/bf_svtools/source/misc/tl_tustring.cxx
+++ b/binfilter/bf_svtools/source/misc/tl_tustring.cxx
@@ -627,6 +627,52 @@ STRING::STRING( const ::STRING& rStr )
     mpData = temp.mpData;
 }
 
+// -----------------------------------------------------------------------
+
+STRING& STRING::Assign( const STRCODE* pCharStr, xub_StrLen nLen )
+{
+    DBG_CHKTHIS( STRING, DBGCHECKSTRING );
+    DBG_ASSERT( pCharStr, "String::Assign() - pCharStr is NULL" );
+
+    if ( nLen == STRING_LEN )
+        nLen = ImplStringLen( pCharStr );
+
+#ifdef DBG_UTIL
+    if ( DbgIsAssert() )
+    {
+        for ( xub_StrLen i = 0; i < nLen; i++ )
+        {
+            if ( !pCharStr[i] )
+            {
+                OSL_FAIL( "String::Assign() : nLen is wrong" );
+            }
+        }
+    }
+#endif
+
+    if ( !nLen )
+    {
+        STRING_NEW((STRING_TYPE **)&mpData);
+    }
+    else
+    {
+        // Wenn String genauso lang ist, wie der String, dann direkt kopieren
+        if ( (nLen == mpData->mnLen) && (mpData->mnRefCount == 1) )
+            memcpy( mpData->maStr, pCharStr, nLen*sizeof( STRCODE ) );
+        else
+        {
+            // Alte Daten loeschen
+            STRING_RELEASE((STRING_TYPE *)mpData);
+
+            // Daten initialisieren und String kopieren
+            mpData = ImplAllocData( nLen );
+            memcpy( mpData->maStr, pCharStr, nLen*sizeof( STRCODE ) );
+        }
+    }
+
+    return *this;
+}
+
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binfilter/inc/bf_tools/string.hxx b/binfilter/inc/bf_tools/string.hxx
index 872136e..6036737 100644
--- a/binfilter/inc/bf_tools/string.hxx
+++ b/binfilter/inc/bf_tools/string.hxx
@@ -125,10 +125,11 @@ private:
                                     sal_uInt32 nCvtFlags = UNISTRING_TO_BYTESTRING_CVTFLAGS ); //not implemented, to detect use of removed methods without compiler making something to fit
                         ByteString( const sal_Unicode* pUniStr, xub_StrLen nLen,
                                     rtl_TextEncoding eTextEncoding,
-                                    sal_uInt32 nCvtFlags = UNISTRING_TO_BYTESTRING_CVTFLAGS ); //not implemented, to detect use of removed methods without compiler making somethiing to fit
+                                    sal_uInt32 nCvtFlags = UNISTRING_TO_BYTESTRING_CVTFLAGS ); //not implemented, to detect use of removed methods without compiler making something to fit
                         ByteString( const UniString& rUniStr,
                                     rtl_TextEncoding eTextEncoding,
-                                    sal_uInt32 nCvtFlags = UNISTRING_TO_BYTESTRING_CVTFLAGS ); //not implemented, to detect use of removed methods without compiler making somethiing to fit
+                                    sal_uInt32 nCvtFlags = UNISTRING_TO_BYTESTRING_CVTFLAGS ); //not implemented, to detect use of removed methods without compiler making something to fit
+    ByteString&         Assign( const sal_Char* pCharStr, xub_StrLen nLen ); //not implemented, to detect use of removed methods without compiler making something to fit
     void                Assign(int); // not implemented; to detect misuses of
                                      // Assign(sal_Char)
     void                operator =(int); // not implemented; to detect misuses
@@ -160,7 +161,6 @@ public:
     ByteString&         Assign( const ByteString& rStr );
     ByteString&         Assign( const rtl::OString& rStr );
     ByteString&         Assign( const sal_Char* pCharStr );
-    ByteString&         Assign( const sal_Char* pCharStr, xub_StrLen nLen );
     ByteString&         Assign( const ::ByteString& rStr )
     {
         return Assign(rStr.GetBuffer(), rStr.Len());


More information about the Libreoffice-commits mailing list