summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-10-17 09:21:50 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-10-17 16:52:11 +0100
commitd1563b818d335495a5591f5fd491fee77b47c93d (patch)
tree271c92c466fe0b2d0e60ae5f0be01f646999b590
parent63691a62c8695889144841abf8a32d52535ae671 (diff)
Related: fdo#38838 make String::CompareTo private
Change-Id: Ibb17bb9e5df9fa9cf9abc4c05dc6ae8fa15b4058
-rw-r--r--include/tools/string.hxx5
-rw-r--r--sw/source/core/doc/docnum.cxx9
2 files changed, 7 insertions, 7 deletions
diff --git a/include/tools/string.hxx b/include/tools/string.hxx
index f8a9d88df906..ed3f42ea80cc 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 cc5b27227dd0..5a142ecc483a 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;