summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basctl/source/basicide/basobj2.cxx6
-rw-r--r--basctl/source/basicide/bastypes.cxx4
-rw-r--r--basctl/source/basicide/moduldl2.cxx6
-rw-r--r--basctl/source/basicide/moduldlg.hxx4
-rw-r--r--basctl/source/basicide/scriptdocument.cxx4
-rw-r--r--cui/source/options/optpath.cxx4
-rw-r--r--fpicker/source/office/iodlg.cxx10
-rw-r--r--include/tools/string.hxx4
-rw-r--r--sc/source/filter/excel/xistyle.cxx6
-rw-r--r--sc/source/filter/html/htmlpars.cxx16
-rw-r--r--sw/source/ui/docvw/edtwin.cxx12
-rw-r--r--sw/source/ui/inc/gloslst.hxx2
-rw-r--r--sw/source/ui/uno/unoatxt.cxx8
-rw-r--r--sw/source/ui/utlui/gloslst.cxx4
-rw-r--r--tools/source/string/strascii.cxx18
-rw-r--r--tools/source/string/tustring.cxx25
16 files changed, 43 insertions, 90 deletions
diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx
index d5b7030c1215..74e7e19ea7e8 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -105,9 +105,9 @@ bool IsValidSbxName( const OUString& rName )
return true;
}
-static bool StringCompareLessThan( const String& rStr1, const String& rStr2 )
+static bool StringCompareLessThan( const OUString& rStr1, const OUString& rStr2 )
{
- return (rStr1.CompareIgnoreCaseToAscii( rStr2 ) == COMPARE_LESS);
+ return (rStr1.compareToIgnoreAsciiCase( rStr2 ) < 0);
}
//----------------------------------------------------------------------------
@@ -115,7 +115,7 @@ static bool StringCompareLessThan( const String& rStr1, const String& rStr2 )
Sequence< OUString > GetMergedLibraryNames( const Reference< script::XLibraryContainer >& xModLibContainer, const Reference< script::XLibraryContainer >& xDlgLibContainer )
{
// create a sorted list of module library names
- ::std::vector<String> aModLibList;
+ ::std::vector<OUString> aModLibList;
if ( xModLibContainer.is() )
{
Sequence< OUString > aModLibNames = xModLibContainer->getElementNames();
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx
index 41c2491a05ca..5087fdae129c 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -588,11 +588,11 @@ namespace
struct TabBarSortHelper
{
sal_uInt16 nPageId;
- String aPageText;
+ OUString aPageText;
bool operator < (TabBarSortHelper const& rComp) const
{
- return aPageText.CompareIgnoreCaseToAscii(rComp.aPageText) == COMPARE_LESS;
+ return aPageText.compareToIgnoreAsciiCase(rComp.aPageText) < 0;
}
};
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 8952742bd145..1b9e4d75140f 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -216,21 +216,21 @@ void CheckBox::SetMode (ObjectMode::Mode e)
//----------------------------------------------------------------------------
-SvTreeListEntry* CheckBox::DoInsertEntry( const String& rStr, sal_uLong nPos )
+SvTreeListEntry* CheckBox::DoInsertEntry( const OUString& rStr, sal_uLong nPos )
{
return SvTabListBox::InsertEntryToColumn( rStr, nPos, 0 );
}
//----------------------------------------------------------------------------
-SvTreeListEntry* CheckBox::FindEntry( const String& rName )
+SvTreeListEntry* CheckBox::FindEntry( const OUString& rName )
{
sal_uLong nCount = GetEntryCount();
for ( sal_uLong i = 0; i < nCount; i++ )
{
SvTreeListEntry* pEntry = GetEntry( i );
DBG_ASSERT( pEntry, "pEntry?!" );
- if ( rName.CompareIgnoreCaseToAscii( GetEntryText( pEntry, 0 ) ) == COMPARE_EQUAL )
+ if ( rName.equalsIgnoreAsciiCase( GetEntryText( pEntry, 0 ) ) )
return pEntry;
}
return 0;
diff --git a/basctl/source/basicide/moduldlg.hxx b/basctl/source/basicide/moduldlg.hxx
index 34de345f8964..8d1576beacf3 100644
--- a/basctl/source/basicide/moduldlg.hxx
+++ b/basctl/source/basicide/moduldlg.hxx
@@ -134,8 +134,8 @@ public:
CheckBox( Window* pParent, const ResId& rResId );
~CheckBox();
- SvTreeListEntry* DoInsertEntry( const String& rStr, sal_uLong nPos = LISTBOX_APPEND );
- SvTreeListEntry* FindEntry( const String& rName );
+ SvTreeListEntry* DoInsertEntry( const OUString& rStr, sal_uLong nPos = LISTBOX_APPEND );
+ SvTreeListEntry* FindEntry( const OUString& rName );
void CheckEntryPos( sal_uLong nPos );
bool IsChecked( sal_uLong nPos ) const;
diff --git a/basctl/source/basicide/scriptdocument.cxx b/basctl/source/basicide/scriptdocument.cxx
index 17cc60798a33..8851d14e7fe7 100644
--- a/basctl/source/basicide/scriptdocument.cxx
+++ b/basctl/source/basicide/scriptdocument.cxx
@@ -127,9 +127,9 @@ namespace basctl
//====================================================================
namespace
{
- static bool StringCompareLessThan( const String& lhs, const String& rhs )
+ static bool StringCompareLessThan( const OUString& lhs, const OUString& rhs )
{
- return ( lhs.CompareIgnoreCaseToAscii( rhs ) == COMPARE_LESS );
+ return ( lhs.compareToIgnoreAsciiCase( rhs ) < 0 );
}
class FilterDocuments : public docs::IDocumentDescriptorFilter
diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx
index 7a4ac8db4273..e0b5b08acfee 100644
--- a/cui/source/options/optpath.cxx
+++ b/cui/source/options/optpath.cxx
@@ -489,14 +489,14 @@ void SvxPathTabPage::ChangeCurrentEntry( const String& _rFolder )
aNewObj.removeFinalSlash();
// then the new path also an URL else system path
- String sNewPathStr = bURL ? aPathStr : aNewObj.getFSysPath( INetURLObject::FSYS_DETECT );
+ OUString sNewPathStr = bURL ? aPathStr : aNewObj.getFSysPath( INetURLObject::FSYS_DETECT );
bool bChanged =
#ifdef UNX
// Unix is case sensitive
( sNewPathStr != sWritable );
#else
- ( sNewPathStr.CompareIgnoreCaseToAscii( sWritable ) != COMPARE_EQUAL );
+ ( !sNewPathStr.equalsIgnoreAsciiCase( sWritable ) );
#endif
if ( bChanged )
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index 51ce476fa017..199a13ce045f 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -1447,19 +1447,19 @@ SvtFileDialogFilter_Impl* SvtFileDialog::FindFilter_Impl
while ( nFilter-- )
{
SvtFileDialogFilter_Impl* pFilter = &(*pList)[ nFilter ];
- const String& rType = pFilter->GetType();
- String aSingleType = rType;
+ const OUString& rType = pFilter->GetType();
+ OUString aSingleType = rType;
if ( _bMultiExt )
{
sal_Int32 nIdx = 0;
while ( !pFoundFilter && nIdx != -1 )
{
- aSingleType = rType.GetToken( 0, FILEDIALOG_DEF_EXTSEP, nIdx );
+ aSingleType = rType.getToken( 0, FILEDIALOG_DEF_EXTSEP, nIdx );
#ifdef UNX
if ( aSingleType == _rFilter )
#else
- if ( aSingleType.CompareIgnoreCaseToAscii( _rFilter ) == COMPARE_EQUAL )
+ if ( aSingleType.equalsIgnoreAsciiCase( _rFilter ) )
#endif
pFoundFilter = pFilter;
}
@@ -1467,7 +1467,7 @@ SvtFileDialogFilter_Impl* SvtFileDialog::FindFilter_Impl
#ifdef UNX
else if ( rType == _rFilter )
#else
- else if ( rType.CompareIgnoreCaseToAscii( _rFilter ) == COMPARE_EQUAL )
+ else if ( rType.equalsIgnoreAsciiCase( _rFilter ) )
#endif
pFoundFilter = pFilter;
diff --git a/include/tools/string.hxx b/include/tools/string.hxx
index eedb3bdf3077..435ca9bb9363 100644
--- a/include/tools/string.hxx
+++ b/include/tools/string.hxx
@@ -229,10 +229,6 @@ public:
xub_StrLen nLen = STRING_LEN ) const;
StringCompare CompareToAscii( const sal_Char* pAsciiStr,
xub_StrLen nLen = STRING_LEN ) const;
- StringCompare CompareIgnoreCaseToAscii( const UniString& rStr,
- xub_StrLen nLen = STRING_LEN ) const;
- StringCompare CompareIgnoreCaseToAscii( const sal_Char* pAsciiStr,
- xub_StrLen nLen = STRING_LEN ) const;
sal_Bool Equals( const UniString& rStr ) const;
sal_Bool EqualsAscii( const sal_Char* pAsciiStr ) const;
sal_Bool EqualsIgnoreCaseAscii( const UniString& rStr ) const;
diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index a22ef9b08dfb..c1d9d361fb34 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -1542,8 +1542,8 @@ namespace {
/** Functor for case-insensitive string comparison, usable in maps etc. */
struct IgnoreCaseCompare
{
- inline bool operator()( const String& rName1, const String& rName2 ) const
- { return rName1.CompareIgnoreCaseToAscii( rName2 ) == COMPARE_LESS; }
+ inline bool operator()( const OUString& rName1, const OUString& rName2 ) const
+ { return rName1.compareToIgnoreAsciiCase( rName2 ) < 0; }
};
} // namespace
@@ -1551,7 +1551,7 @@ struct IgnoreCaseCompare
void XclImpXFBuffer::CreateUserStyles()
{
// calculate final names of all styles
- typedef ::std::map< String, XclImpStyle*, IgnoreCaseCompare > CellStyleNameMap;
+ typedef ::std::map< OUString, XclImpStyle*, IgnoreCaseCompare > CellStyleNameMap;
typedef ::std::vector< XclImpStyle* > XclImpStyleVector;
CellStyleNameMap aCellStyles;
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx
index 565fc90a1a24..f28039b92baf 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -1021,12 +1021,12 @@ void ScHTMLLayoutParser::TableDataOn( ImportInfo* pInfo )
{
bHorJustifyCenterTH = false;
SvxCellHorJustify eVal;
- const String& rOptVal = rOption.GetString();
- if ( rOptVal.CompareIgnoreCaseToAscii( OOO_STRING_SVTOOLS_HTML_AL_right ) == COMPARE_EQUAL )
+ const OUString& rOptVal = rOption.GetString();
+ if ( rOptVal.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_AL_right ) )
eVal = SVX_HOR_JUSTIFY_RIGHT;
- else if ( rOptVal.CompareIgnoreCaseToAscii( OOO_STRING_SVTOOLS_HTML_AL_center ) == COMPARE_EQUAL )
+ else if ( rOptVal.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_AL_center ) )
eVal = SVX_HOR_JUSTIFY_CENTER;
- else if ( rOptVal.CompareIgnoreCaseToAscii( OOO_STRING_SVTOOLS_HTML_AL_left ) == COMPARE_EQUAL )
+ else if ( rOptVal.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_AL_left ) )
eVal = SVX_HOR_JUSTIFY_LEFT;
else
eVal = SVX_HOR_JUSTIFY_STANDARD;
@@ -1037,12 +1037,12 @@ void ScHTMLLayoutParser::TableDataOn( ImportInfo* pInfo )
case HTML_O_VALIGN:
{
SvxCellVerJustify eVal;
- const String& rOptVal = rOption.GetString();
- if ( rOptVal.CompareIgnoreCaseToAscii( OOO_STRING_SVTOOLS_HTML_VA_top ) == COMPARE_EQUAL )
+ const OUString& rOptVal = rOption.GetString();
+ if ( rOptVal.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_VA_top ) )
eVal = SVX_VER_JUSTIFY_TOP;
- else if ( rOptVal.CompareIgnoreCaseToAscii( OOO_STRING_SVTOOLS_HTML_VA_middle ) == COMPARE_EQUAL )
+ else if ( rOptVal.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_VA_middle ) )
eVal = SVX_VER_JUSTIFY_CENTER;
- else if ( rOptVal.CompareIgnoreCaseToAscii( OOO_STRING_SVTOOLS_HTML_VA_bottom ) == COMPARE_EQUAL )
+ else if ( rOptVal.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_VA_bottom ) )
eVal = SVX_VER_JUSTIFY_BOTTOM;
else
eVal = SVX_VER_JUSTIFY_STANDARD;
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index a49e789ff35b..85f4c727d7c3 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -237,7 +237,7 @@ public:
struct QuickHelpData
{
/// Strings that at least partially match an input word.
- std::vector<String> m_aHelpStrings;
+ std::vector<OUString> m_aHelpStrings;
/// Index of the current help string.
sal_uInt16 nCurArrPos;
/// Length of the input word associated with the help data.
@@ -5796,17 +5796,17 @@ namespace {
struct CompareIgnoreCaseAscii
{
- bool operator()(const String& s1, const String& s2) const
+ bool operator()(const OUString& s1, const OUString& s2) const
{
- return s1.CompareIgnoreCaseToAscii(s2) == COMPARE_LESS;
+ return s1.compareToIgnoreAsciiCase(s2) < 0;
}
};
struct EqualIgnoreCaseAscii
{
- bool operator()(const String& s1, const String& s2) const
+ bool operator()(const OUString& s1, const OUString& s2) const
{
- return s1.CompareIgnoreCaseToAscii(s2) == COMPARE_EQUAL;
+ return s1.equalsIgnoreAsciiCase(s2);
}
};
@@ -5819,7 +5819,7 @@ void QuickHelpData::SortAndFilter()
m_aHelpStrings.end(),
CompareIgnoreCaseAscii() );
- std::vector<String>::iterator it = std::unique( m_aHelpStrings.begin(),
+ std::vector<OUString>::iterator it = std::unique( m_aHelpStrings.begin(),
m_aHelpStrings.end(),
EqualIgnoreCaseAscii() );
m_aHelpStrings.erase( it, m_aHelpStrings.end() );
diff --git a/sw/source/ui/inc/gloslst.hxx b/sw/source/ui/inc/gloslst.hxx
index aa9f6d4b585c..1c83e7d43fd1 100644
--- a/sw/source/ui/inc/gloslst.hxx
+++ b/sw/source/ui/inc/gloslst.hxx
@@ -56,7 +56,7 @@ public:
SwGlossaryList();
~SwGlossaryList();
- bool HasLongName(const String& rBegin, std::vector<String> *pLongNames);
+ bool HasLongName(const OUString& rBegin, std::vector<OUString> *pLongNames);
sal_Bool GetShortName(const String& rLongName,
String& rShortName, String& rGroupName );
diff --git a/sw/source/ui/uno/unoatxt.cxx b/sw/source/ui/uno/unoatxt.cxx
index 6ffb98318925..6210faf43c18 100644
--- a/sw/source/ui/uno/unoatxt.cxx
+++ b/sw/source/ui/uno/unoatxt.cxx
@@ -600,12 +600,12 @@ sal_Bool SwXAutoTextGroup::hasByName(const OUString& rName)
else
throw uno::RuntimeException();
- for( sal_uInt16 i = 0; i < nCount; i++ )
+ for( sal_uInt16 i = 0; i < nCount; ++i )
{
- String sCompare(pGlosGroup->GetShortName(i));
- if(COMPARE_EQUAL == sCompare.CompareIgnoreCaseToAscii(String(rName)))
+ OUString sCompare(pGlosGroup->GetShortName(i));
+ if(sCompare.equalsIgnoreAsciiCase(rName))
{
- bRet = sal_True;
+ bRet = true;
break;
}
}
diff --git a/sw/source/ui/utlui/gloslst.cxx b/sw/source/ui/utlui/gloslst.cxx
index 5308845ae2d2..37ef6eb9b87f 100644
--- a/sw/source/ui/utlui/gloslst.cxx
+++ b/sw/source/ui/utlui/gloslst.cxx
@@ -378,13 +378,13 @@ void SwGlossaryList::FillGroup(AutoTextGroup* pGroup, SwGlossaries* pGlossaries)
// Give back all (not exceeding FIND_MAX_GLOS) found modules
// with matching beginning.
-bool SwGlossaryList::HasLongName(const String& rBegin, std::vector<String> *pLongNames)
+bool SwGlossaryList::HasLongName(const OUString& rBegin, std::vector<OUString> *pLongNames)
{
if(!bFilled)
Update();
sal_uInt16 nFound = 0;
sal_uInt16 nCount = aGroupArr.size();
- sal_uInt16 nBeginLen = rBegin.Len();
+ sal_Int32 nBeginLen = rBegin.getLength();
const ::utl::TransliterationWrapper& rSCmp = GetAppCmpStrIgnore();
for(sal_uInt16 i = 0; i < nCount; i++ )
diff --git a/tools/source/string/strascii.cxx b/tools/source/string/strascii.cxx
index 83094ffac273..5fcea9fa7907 100644
--- a/tools/source/string/strascii.cxx
+++ b/tools/source/string/strascii.cxx
@@ -313,24 +313,6 @@ StringCompare UniString::CompareToAscii( const sal_Char* pAsciiStr,
return COMPARE_GREATER;
}
-StringCompare UniString::CompareIgnoreCaseToAscii( const sal_Char* pAsciiStr,
- xub_StrLen nLen ) const
-{
- DBG_CHKTHIS( UniString, DbgCheckUniString );
- DBG_ASSERT( ImplDbgCheckAsciiStr( pAsciiStr, nLen ),
- "UniString::CompareIgnoreCaseToAscii() - pAsciiStr include characters > 127" );
-
- // compare strings
- sal_Int32 nCompare = ImplStringICompareAscii( mpData->maStr, pAsciiStr, nLen );
-
- if ( nCompare == 0 )
- return COMPARE_EQUAL;
- else if ( nCompare < 0 )
- return COMPARE_LESS;
- else
- return COMPARE_GREATER;
-}
-
sal_Bool UniString::EqualsAscii( const sal_Char* pAsciiStr ) const
{
DBG_CHKTHIS( UniString, DbgCheckUniString );
diff --git a/tools/source/string/tustring.cxx b/tools/source/string/tustring.cxx
index 2bc82800b0cb..4d081bd72d0e 100644
--- a/tools/source/string/tustring.cxx
+++ b/tools/source/string/tustring.cxx
@@ -172,31 +172,6 @@ sal_Bool STRING::EqualsIgnoreCaseAscii( const STRING& rStr, xub_StrLen nIndex, x
return (ImplStringICompareWithoutZero( mpData->maStr+nIndex, rStr.mpData->maStr, nLen ) == 0);
}
-StringCompare STRING::CompareIgnoreCaseToAscii( const STRING& rStr,
- xub_StrLen nLen ) const
-{
- DBG_CHKTHIS( STRING, DBGCHECKSTRING );
- DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
-
- if ( mpData == rStr.mpData )
- return COMPARE_EQUAL;
-
- // determine maximal length
- if ( mpData->mnLen < nLen )
- nLen = static_cast< xub_StrLen >(mpData->mnLen+1);
- if ( rStr.mpData->mnLen < nLen )
- nLen = static_cast< xub_StrLen >(rStr.mpData->mnLen+1);
-
- sal_Int32 nCompare = ImplStringICompareWithoutZero( mpData->maStr, rStr.mpData->maStr, nLen );
-
- if ( nCompare == 0 )
- return COMPARE_EQUAL;
- else if ( nCompare < 0 )
- return COMPARE_LESS;
- else
- return COMPARE_GREATER;
-}
-
STRING& STRING::Insert( STRCODE c, xub_StrLen nIndex )
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );