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

Caolán McNamara caolanm at redhat.com
Thu Oct 17 08:52:39 PDT 2013


 include/tools/string.hxx      |    5 +++--
 sw/source/core/doc/docnum.cxx |    9 ++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit d1563b818d335495a5591f5fd491fee77b47c93d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 17 09:21:50 2013 +0100

    Related: fdo#38838 make String::CompareTo private
    
    Change-Id: Ibb17bb9e5df9fa9cf9abc4c05dc6ae8fa15b4058

diff --git a/include/tools/string.hxx b/include/tools/string.hxx
index f8a9d88..ed3f42e 100644
--- a/include/tools/string.hxx
+++ b/include/tools/string.hxx
@@ -105,6 +105,9 @@ private:
     TOOLS_DLLPRIVATE inline void ImplCopyData();
     TOOLS_DLLPRIVATE inline sal_Unicode * ImplCopyStringData(sal_Unicode *);
 
+    StringCompare       CompareTo( const UniString& rStr,
+                                   xub_StrLen nLen = STRING_LEN ) const;
+
                         UniString( const int* pDummy );    // not implemented: to prevent UniString( NULL )
                         UniString(int); // not implemented; to detect misuses of
                                         // UniString(sal_Unicode)
@@ -222,8 +225,6 @@ public:
     UniString&          Erase( xub_StrLen nIndex = 0, xub_StrLen nCount = STRING_LEN );
     UniString           Copy( xub_StrLen nIndex = 0, xub_StrLen nCount = STRING_LEN ) const;
 
-    StringCompare       CompareTo( const UniString& rStr,
-                                   xub_StrLen nLen = STRING_LEN ) const;
     sal_Bool            Equals( const UniString& rStr ) const;
     sal_Bool            Equals( const UniString& rStr,
                                 xub_StrLen nIndex, xub_StrLen nLen ) const;
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index cc5b272..5a142ec 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -562,7 +562,7 @@ bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset )
     return MoveParagraph( aPam, nOffs, true );
 }
 
-static sal_uInt16 lcl_FindOutlineName( const SwNodes& rNds, const String& rName,
+static sal_uInt16 lcl_FindOutlineName( const SwNodes& rNds, const OUString& rName,
                             bool bExact )
 {
     sal_uInt16 nSavePos = USHRT_MAX;
@@ -570,15 +570,14 @@ static sal_uInt16 lcl_FindOutlineName( const SwNodes& rNds, const String& rName,
     for( sal_uInt16 n = 0; n < rOutlNds.size(); ++n )
     {
         SwTxtNode* pTxtNd = rOutlNds[ n ]->GetTxtNode();
-        String sTxt( pTxtNd->GetExpandTxt() );
-        if( sTxt.Equals( rName ) )
+        OUString sTxt( pTxtNd->GetExpandTxt() );
+        if (sTxt == rName)
         {
             // Found "exact", set Pos to the Node
             nSavePos = n;
             break;
         }
-        else if( !bExact && USHRT_MAX == nSavePos &&
-                    COMPARE_EQUAL == sTxt.CompareTo( rName, rName.Len()) )
+        else if( !bExact && USHRT_MAX == nSavePos && sTxt.startsWith(rName) )
         {
             // maybe we just found the text's first part
             nSavePos = n;


More information about the Libreoffice-commits mailing list