summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cui/source/dialogs/hlinettp.cxx11
-rw-r--r--cui/source/dialogs/hyphen.cxx10
-rw-r--r--editeng/source/misc/svxacorr.cxx6
-rw-r--r--fpicker/source/office/iodlg.cxx12
-rw-r--r--include/tools/string.hxx1
-rw-r--r--padmin/source/adddlg.cxx9
-rw-r--r--padmin/source/helper.cxx6
-rw-r--r--padmin/source/helper.hxx2
-rw-r--r--padmin/source/newppdlg.cxx2
-rw-r--r--sc/source/core/tool/address.cxx4
-rw-r--r--sc/source/filter/excel/xlroot.cxx2
-rw-r--r--sc/source/filter/inc/xlroot.hxx4
-rw-r--r--sw/source/filter/html/htmlgrin.cxx8
-rw-r--r--sw/source/filter/html/htmlsect.cxx46
-rw-r--r--sw/source/filter/html/wrthtml.cxx10
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx8
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx25
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.cxx10
-rw-r--r--tools/source/string/tustring.cxx21
-rw-r--r--vcl/aqua/source/window/salmenu.cxx12
20 files changed, 93 insertions, 116 deletions
diff --git a/cui/source/dialogs/hlinettp.cxx b/cui/source/dialogs/hlinettp.cxx
index bbd51e242a91..520b7f4d4f12 100644
--- a/cui/source/dialogs/hlinettp.cxx
+++ b/cui/source/dialogs/hlinettp.cxx
@@ -467,16 +467,15 @@ void SvxHyperlinkInternetTp::RefreshMarkWindow()
void SvxHyperlinkInternetTp::SetMarkStr ( const String& aStrMark )
{
- String aStrURL ( maCbbTarget.GetText() );
+ OUString aStrURL ( maCbbTarget.GetText() );
const sal_Unicode sUHash = '#';
- xub_StrLen nPos = aStrURL.SearchBackward( sUHash );
+ sal_Int32 nPos = aStrURL.lastIndexOf( sUHash );
- if( nPos != STRING_NOTFOUND )
- aStrURL.Erase ( nPos );
+ if( nPos != -1 )
+ aStrURL = aStrURL.copy(0, nPos);
- aStrURL += sUHash;
- aStrURL += aStrMark;
+ aStrURL += OUString(sUHash) + aStrMark;
maCbbTarget.SetText ( aStrURL );
}
diff --git a/cui/source/dialogs/hyphen.cxx b/cui/source/dialogs/hyphen.cxx
index 734a9e97405a..6572614f75eb 100644
--- a/cui/source/dialogs/hyphen.cxx
+++ b/cui/source/dialogs/hyphen.cxx
@@ -151,7 +151,7 @@ String SvxHyphenWordDialog::EraseUnusableHyphens_Impl(
// find position nIdx after which all hyphen positions are unusable
xub_StrLen nIdx = STRING_NOTFOUND;
- xub_StrLen nPos = 0, nPos1 = 0, nPos2 = 0;
+ xub_StrLen nPos = 0, nPos1 = 0;
if (nLen)
{
xub_StrLen nStart = 0;
@@ -185,11 +185,11 @@ String SvxHyphenWordDialog::EraseUnusableHyphens_Impl(
nPos = aTxt.SearchAndReplace( aTmp, aEmpty, nPos + 1 );
// 2) remove all hyphenation positions from the start that are not considered by the core
- const String aSearchRange( aTxt.Copy( 0, nPos1 ) );
- nPos2 = aSearchRange.SearchBackward( '-' ); // the '-' position the core will use by default
- if (nPos2 != STRING_NOTFOUND)
+ const OUString aSearchRange( aTxt.Copy( 0, nPos1 ) );
+ sal_Int32 nPos2 = aSearchRange.lastIndexOf( '-' ); // the '-' position the core will use by default
+ if (nPos2 != -1 )
{
- String aLeft( aSearchRange.Copy( 0, nPos2 ) );
+ String aLeft( aSearchRange.copy( 0, nPos2 ) );
nPos = 0;
while (nPos != STRING_NOTFOUND)
{
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 3176db9d87ee..1cccc7bfa633 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -2349,10 +2349,10 @@ void SvxAutoCorrectLanguageLists::MakeUserStorage_Impl()
{
try
{
- String sMain(aDest.GetMainURL( INetURLObject::DECODE_TO_IURI ));
+ OUString sMain(aDest.GetMainURL( INetURLObject::DECODE_TO_IURI ));
sal_Unicode cSlash = '/';
- xub_StrLen nSlashPos = sMain.SearchBackward(cSlash);
- sMain.Erase(nSlashPos);
+ sal_Int32 nSlashPos = sMain.lastIndexOf(cSlash);
+ sMain = sMain.copy(0, nSlashPos);
::ucbhelper::Content aNewContent( sMain, uno::Reference< XCommandEnvironment >(), comphelper::getProcessComponentContext() );
Any aAny;
TransferInfo aInfo;
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index cf8d179b1ebf..c26bd0ba05d9 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -837,13 +837,13 @@ sal_Bool SvtFileDialog::createNewUserFilter( const String& _rNewFilter, sal_Bool
// if the former is not allowed (_bAllowUserDefExt = <FALSE/>), we have to use the ext of the current filter
// (if possible)
sal_Bool bUseCurFilterExt = sal_True;
- String sUserFilter = _pImp->_pUserFilter->GetType();
- xub_StrLen nSepPos = sUserFilter.SearchBackward( '.' );
- if ( STRING_NOTFOUND != nSepPos )
+ OUString sUserFilter = _pImp->_pUserFilter->GetType();
+ sal_Int32 nSepPos = sUserFilter.lastIndexOf( '.' );
+ if ( nSepPos != -1 )
{
- String sUserExt = sUserFilter.Copy( nSepPos + 1 );
- if ( ( STRING_NOTFOUND == sUserExt.Search( '*' ) )
- && ( STRING_NOTFOUND == sUserExt.Search( '?' ) )
+ OUString sUserExt = sUserFilter.copy( nSepPos + 1 );
+ if ( ( -1 == sUserExt.indexOf( '*' ) )
+ && ( -1 == sUserExt.indexOf( '?' ) )
)
bUseCurFilterExt = sal_False;
}
diff --git a/include/tools/string.hxx b/include/tools/string.hxx
index a8448e6bd49c..f962823f033b 100644
--- a/include/tools/string.hxx
+++ b/include/tools/string.hxx
@@ -240,7 +240,6 @@ public:
xub_StrLen Search( sal_Unicode c, xub_StrLen nIndex = 0 ) const;
xub_StrLen Search( const UniString& rStr, xub_StrLen nIndex = 0 ) const;
xub_StrLen SearchAscii( const sal_Char* pAsciiStr, xub_StrLen nIndex = 0 ) const;
- xub_StrLen SearchBackward( sal_Unicode c, xub_StrLen nIndex = STRING_LEN ) const;
xub_StrLen SearchAndReplace( sal_Unicode c, sal_Unicode cRep,
xub_StrLen nIndex = 0 );
diff --git a/padmin/source/adddlg.cxx b/padmin/source/adddlg.cxx
index 852c7555dbef..d87d7dbb2ca9 100644
--- a/padmin/source/adddlg.cxx
+++ b/padmin/source/adddlg.cxx
@@ -265,8 +265,8 @@ IMPL_LINK( APChooseDriverPage, ClickBtnHdl, PushButton*, pButton )
std::list< OUString >::iterator dir;
for( dir = aDirs.begin(); dir != aDirs.end(); ++dir )
{
- ::std::list< String > aFiles;
- ::std::list< String >::iterator file;
+ ::std::list< OUString > aFiles;
+ ::std::list< OUString >::iterator file;
OUStringBuffer aDir( *dir );
aDir.append( sal_Unicode( '/' ) );
aDir.appendAscii( PRINTER_PPDDIR );
@@ -279,8 +279,9 @@ IMPL_LINK( APChooseDriverPage, ClickBtnHdl, PushButton*, pButton )
aFile += "/";
aFile += *file;
- int nPos = file->SearchBackward( '.' );
- if( file->Copy( 0, nPos ) == String( aPPD ) )
+ sal_Int32 nPos = file->lastIndexOf( '.' );
+ OUString sCopy = nPos == -1 ? *file : file->copy(0, nPos);
+ if( sCopy == aPPD )
{
OString aSysPath(OUStringToOString(aFile, aEncoding));
if (unlink(aSysPath.getStr()))
diff --git a/padmin/source/helper.cxx b/padmin/source/helper.cxx
index 1ca8803d7635..a4a72d2d2c73 100644
--- a/padmin/source/helper.cxx
+++ b/padmin/source/helper.cxx
@@ -79,7 +79,7 @@ ResId padmin::PaResId( sal_uInt32 nId )
* FindFiles
*/
-void padmin::FindFiles( const OUString& rDirectory, ::std::list< String >& rResult, const OUString& rSuffixes, bool bRecursive )
+void padmin::FindFiles( const OUString& rDirectory, ::std::list< OUString >& rResult, const OUString& rSuffixes, bool bRecursive )
{
rResult.clear();
@@ -121,9 +121,9 @@ void padmin::FindFiles( const OUString& rDirectory, ::std::list< String >& rResu
OUStringBuffer aSubDir( rDirectory );
aSubDir.appendAscii( "/", 1 );
aSubDir.append( aStatus.getFileName() );
- std::list< String > subfiles;
+ std::list< OUString > subfiles;
FindFiles( aSubDir.makeStringAndClear(), subfiles, rSuffixes, bRecursive );
- for( std::list< String >::const_iterator it = subfiles.begin(); it != subfiles.end(); ++it )
+ for( std::list< OUString >::const_iterator it = subfiles.begin(); it != subfiles.end(); ++it )
{
OUStringBuffer aSubFile( aStatus.getFileName() );
aSubFile.appendAscii( "/", 1 );
diff --git a/padmin/source/helper.hxx b/padmin/source/helper.hxx
index ce4c40986e0f..0e7b6270df3a 100644
--- a/padmin/source/helper.hxx
+++ b/padmin/source/helper.hxx
@@ -103,7 +103,7 @@ sal_Bool AreYouSure( Window*, int nRid = -1 );
ResId PaResId( sal_uInt32 nId );
-void FindFiles( const OUString& rDirectory, ::std::list< String >& rResult, const OUString& rSuffixes, bool bRecursive = false );
+void FindFiles( const OUString& rDirectory, ::std::list< OUString >& rResult, const OUString& rSuffixes, bool bRecursive = false );
Config& getPadminRC();
void freePadminRC();
diff --git a/padmin/source/newppdlg.cxx b/padmin/source/newppdlg.cxx
index 56c2cbd2bc7c..74a303507477 100644
--- a/padmin/source/newppdlg.cxx
+++ b/padmin/source/newppdlg.cxx
@@ -122,7 +122,7 @@ void PPDImportDialog::Import()
ProgressDialog aProgress( Application::GetFocusWindow() );
aProgress.startOperation( m_aLoadingPPD );
- ::std::list< String > aFiles;
+ ::std::list< OUString > aFiles;
FindFiles( aImportPath, aFiles, OUString( "PS;PPD;PS.GZ;PPD.GZ" ), true );
int i = 0;
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index 3a8aed3640bf..bf6beb374c12 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -1056,8 +1056,8 @@ lcl_ScAddress_Parse_OOo( const sal_Unicode* p, ScDocument* pDoc, ScAddress& rAdd
{
// Specified table name is not found in this document. Assume this is an external document.
aDocName = aTab;
- xub_StrLen n = aTab.SearchBackward('.');
- if (n != STRING_NOTFOUND && n > 0)
+ sal_Int32 n = aDocName.lastIndexOf('.');
+ if (n != -1 && n > 0)
{
// Extension found. Strip it.
aTab.Erase(n);
diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx
index 6e6d3e16a47d..b21bb240d20f 100644
--- a/sc/source/filter/excel/xlroot.cxx
+++ b/sc/source/filter/excel/xlroot.cxx
@@ -130,7 +130,7 @@ XclRootData::XclRootData( XclBiff eBiff, SfxMedium& rMedium,
if( const SfxItemSet* pItemSet = mrMedium.GetItemSet() )
if( const SfxStringItem* pItem = static_cast< const SfxStringItem* >( pItemSet->GetItem( SID_FILE_NAME ) ) )
maDocUrl = pItem->GetValue();
- maBasePath = maDocUrl.Copy( 0, maDocUrl.SearchBackward( '/' ) + 1 );
+ maBasePath = maDocUrl.copy( 0, maDocUrl.lastIndexOf( '/' ) + 1 );
// extended document options - always own object, try to copy existing data from document
if( const ScExtDocOptions* pOldDocOpt = mrDoc.GetExtDocOptions() )
diff --git a/sc/source/filter/inc/xlroot.hxx b/sc/source/filter/inc/xlroot.hxx
index 2f1726d39485..f2cf2d33aaea 100644
--- a/sc/source/filter/inc/xlroot.hxx
+++ b/sc/source/filter/inc/xlroot.hxx
@@ -82,7 +82,7 @@ struct XclRootData
SfxMedium& mrMedium; /// The medium to import from.
SotStorageRef mxRootStrg; /// The root OLE storage of imported/exported file.
ScDocument& mrDoc; /// The source or destination document.
- String maDocUrl; /// Document URL of imported/exported file.
+ OUString maDocUrl; /// Document URL of imported/exported file.
String maBasePath; /// Base path of imported/exported file (path of maDocUrl).
String maUserName; /// Current user name.
const String maDefPassword; /// The default password used for stream encryption.
@@ -178,7 +178,7 @@ public:
/** Returns the medium to import from. */
inline SfxMedium& GetMedium() const { return mrData.mrMedium; }
/** Returns the document URL of the imported/exported file. */
- inline const String& GetDocUrl() const { return mrData.maDocUrl; }
+ inline const OUString& GetDocUrl() const { return mrData.maDocUrl; }
/** Returns the base path of the imported/exported file. */
inline const String& GetBasePath() const { return mrData.maBasePath; }
/** Returns the current user name. */
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx
index fe22a33499ba..94b35052f498 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -1116,13 +1116,13 @@ ANCHOR_SETEVENT:
// wir hier ganz rigoros raus.
if( aName.Len() )
{
- String sDecoded( INetURLObject::decode( aName, INET_HEX_ESCAPE,
+ OUString sDecoded( INetURLObject::decode( aName, INET_HEX_ESCAPE,
INetURLObject::DECODE_UNAMBIGUOUS,
RTL_TEXTENCODING_UTF8 ));
- xub_StrLen nPos = sDecoded.SearchBackward( cMarkSeparator );
- if( STRING_NOTFOUND != nPos )
+ sal_Int32 nPos = sDecoded.lastIndexOf( cMarkSeparator );
+ if( nPos != -1 )
{
- OUString sCmp(comphelper::string::remove(sDecoded.Copy(nPos+1), ' '));
+ OUString sCmp(comphelper::string::remove(sDecoded.copy(nPos+1), ' '));
if( !sCmp.isEmpty() )
{
sCmp = sCmp.toAsciiLowerCase();
diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx
index bb4cce1d7a42..fcf206ee3f51 100644
--- a/sw/source/filter/html/htmlsect.cxx
+++ b/sw/source/filter/html/htmlsect.cxx
@@ -64,8 +64,8 @@ using namespace ::com::sun::star;
void SwHTMLParser::NewDivision( int nToken )
{
- OUString aId;
- String aHRef, aStyle, aLang, aDir;
+ OUString aId, aHRef;
+ String aStyle, aLang, aDir;
OUString aClass;
SvxAdjust eAdjust = HTML_CENTER_ON==nToken ? SVX_ADJUST_CENTER
: SVX_ADJUST_END;
@@ -114,7 +114,7 @@ void SwHTMLParser::NewDivision( int nToken )
sal_Bool bAppended = sal_False;
if( pPam->GetPoint()->nContent.GetIndex() )
{
- AppendTxtNode( bHeader||bFooter||!aId.isEmpty()||aHRef.Len() ? AM_NORMAL
+ AppendTxtNode( bHeader||bFooter||!aId.isEmpty()|| !aHRef.isEmpty() ? AM_NORMAL
: AM_NOSPACE );
bAppended = sal_True;
}
@@ -242,7 +242,7 @@ void SwHTMLParser::NewDivision( int nToken )
}
// Bereiche fuegen wir in Rahmen nur dann ein, wenn der Bereich gelinkt ist.
- if( (!aId.isEmpty() && !bPositioned) || aHRef.Len() )
+ if( (!aId.isEmpty() && !bPositioned) || !aHRef.isEmpty() )
{
// Bereich einfuegen (muss vor dem Setzten von Attributen erfolgen,
// weil die Section vor der PaM-Position eingefuegt.
@@ -266,49 +266,49 @@ void SwHTMLParser::NewDivision( int nToken )
// Namen der Section eindeutig machen
const OUString aName( pDoc->GetUniqueSectionName( !aId.isEmpty() ? &aId : 0 ) );
- if( aHRef.Len() )
+ if( !aHRef.isEmpty() )
{
sal_Unicode cDelim = 255U;
- String aURL;
- xub_StrLen nPos = aHRef.SearchBackward( cDelim );
- xub_StrLen nPos2 = STRING_NOTFOUND;
- if( STRING_NOTFOUND != nPos )
+ sal_Int32 nPos = aHRef.lastIndexOf( cDelim );
+ sal_Int32 nPos2 = -1;
+ if( nPos != -1 )
{
- nPos2 = aHRef.SearchBackward( cDelim, nPos );
- if( STRING_NOTFOUND != nPos2 )
+ nPos2 = aHRef.lastIndexOf( cDelim, nPos );
+ if( nPos2 != -1 )
{
- xub_StrLen nTmp = nPos;
+ sal_Int32 nTmp = nPos;
nPos = nPos2;
nPos2 = nTmp;
}
}
- if( STRING_NOTFOUND == nPos )
+ OUString aURL;
+ if( nPos == -1 )
{
aURL = URIHelper::SmartRel2Abs(INetURLObject( sBaseURL ), aHRef, Link(), false);
}
else
{
- aURL = URIHelper::SmartRel2Abs(INetURLObject( sBaseURL ), aHRef.Copy( 0, nPos ), Link(), false );
- aURL += sfx2::cTokenSeparator;
- if( STRING_NOTFOUND == nPos2 )
+ aURL = URIHelper::SmartRel2Abs(INetURLObject( sBaseURL ), aHRef.copy( 0, nPos ), Link(), false );
+ aURL += OUString(sfx2::cTokenSeparator);
+ if( nPos2 == -1 )
{
- aURL += aHRef.Copy( nPos+1 );
+ aURL += aHRef.copy( nPos+1 );
}
else
{
- aURL += aHRef.Copy( nPos+1, nPos2 - (nPos+1) );
- aURL += sfx2::cTokenSeparator;
- aURL += String(rtl::Uri::decode( aHRef.Copy( nPos2+1 ),
+ aURL += aHRef.copy( nPos+1, nPos2 - (nPos+1) );
+ aURL += OUString(sfx2::cTokenSeparator);
+ aURL += rtl::Uri::decode( aHRef.copy( nPos2+1 ),
rtl_UriDecodeWithCharset,
- RTL_TEXTENCODING_ISO_8859_1 ));
+ RTL_TEXTENCODING_ISO_8859_1 );
}
}
aHRef = aURL;
}
- SwSectionData aSection( (aHRef.Len()) ? FILE_LINK_SECTION
+ SwSectionData aSection( (!aHRef.isEmpty()) ? FILE_LINK_SECTION
: CONTENT_SECTION, aName );
- if( aHRef.Len() )
+ if( !aHRef.isEmpty() )
{
aSection.SetLinkFileName( aHRef );
aSection.SetProtectFlag(true);
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index df047779ab89..6e5b6ab5e187 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -1085,11 +1085,11 @@ void SwHTMLWriter::OutImplicitMark( const String& rMark,
void SwHTMLWriter::OutHyperlinkHRefValue( const String& rURL )
{
- String sURL( rURL );
- xub_StrLen nPos = sURL.SearchBackward( cMarkSeparator );
- if( STRING_NOTFOUND != nPos )
+ OUString sURL( rURL );
+ sal_Int32 nPos = sURL.lastIndexOf( cMarkSeparator );
+ if( nPos != -1 )
{
- OUString sCmp(comphelper::string::remove(sURL.Copy(nPos+1), ' '));
+ OUString sCmp(comphelper::string::remove(sURL.copy(nPos+1), ' '));
if( !sCmp.isEmpty() )
{
sCmp = sCmp.toAsciiLowerCase();
@@ -1101,7 +1101,7 @@ void SwHTMLWriter::OutHyperlinkHRefValue( const String& rURL )
sCmp == "outline" ||
sCmp == "text" )
{
- sURL.SearchAndReplaceAll( '?', '_' ); // '?' causes problems in IE/Netscape 5
+ sURL = sURL.replace( '?', '_' ); // '?' causes problems in IE/Netscape 5
}
}
}
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 1c3ab9584877..e0029d9ed91f 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2854,13 +2854,13 @@ void MSWordExportBase::AddLinkTarget(const String& rURL)
if( !rURL.Len() || rURL.GetChar(0) != INET_MARK_TOKEN )
return;
- String aURL( BookmarkToWriter( rURL.Copy( 1 ) ) );
- xub_StrLen nPos = aURL.SearchBackward( cMarkSeparator );
+ OUString aURL( BookmarkToWriter( rURL.Copy( 1 ) ) );
+ sal_Int32 nPos = aURL.lastIndexOf( cMarkSeparator );
if( nPos < 2 )
return;
- OUString sCmp(comphelper::string::remove(aURL.Copy(nPos+1), ' '));
+ OUString sCmp(comphelper::string::remove(aURL.copy(nPos+1), ' '));
if( sCmp.isEmpty() )
return;
@@ -2869,7 +2869,7 @@ void MSWordExportBase::AddLinkTarget(const String& rURL)
if( sCmp == "outline" )
{
SwPosition aPos( *pCurPam->GetPoint() );
- String aOutline( BookmarkToWriter(aURL.Copy( 0, nPos )) );
+ String aOutline( BookmarkToWriter(aURL.copy( 0, nPos )) );
// If we can find the outline this bookmark refers to
// save the name of the bookmark and the
// node index number of where it points to
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 82ea7a4f8146..e3defb4369b8 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -2483,27 +2483,26 @@ void SwWW8ImplReader::Read_SubF_Ruby( WW8ReadFieldParams& rReadParam)
{
if (-2 == rReadParam.SkipToNextToken())
{
- String sPart = rReadParam.GetResult();
- xub_StrLen nBegin = sPart.Search('(');
+ OUString sPart = rReadParam.GetResult();
+ sal_Int32 nBegin = sPart.indexOf('(');
//Word disallows brackets in this field,
- xub_StrLen nEnd = sPart.Search(')');
+ sal_Int32 nEnd = sPart.indexOf(')');
- if ((nBegin != STRING_NOTFOUND) &&
- (nEnd != STRING_NOTFOUND))
+ if ((nBegin != -1) &&
+ (nEnd != -1))
{
- sRuby = sPart.Copy(nBegin+1,nEnd-nBegin-1);
+ sRuby = sPart.copy(nBegin+1,nEnd-nBegin-1);
}
- if (STRING_NOTFOUND ==
- (nBegin = sPart.Search(',',nEnd)))
+ if (-1 ==
+ (nBegin = sPart.indexOf(',',nEnd)))
{
- nBegin = sPart.Search(';',nEnd);
+ nBegin = sPart.indexOf(';',nEnd);
}
- nEnd = sPart.SearchBackward(')');
- if ((nBegin != STRING_NOTFOUND) &&
- (nEnd != STRING_NOTFOUND))
+ nEnd = sPart.lastIndexOf(')');
+ if ((nBegin != -1) && (nEnd != -1))
{
- sText = sPart.Copy(nBegin+1,nEnd-nBegin-1);
+ sText = sPart.copy(nBegin+1,nEnd-nBegin-1);
}
}
}
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index dcd6b8fc85c4..8cfec103e39c 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -1484,12 +1484,12 @@ void AddressMultiLineEdit::MoveCurrentItem(sal_uInt16 nMove)
{
//go left to find a predecessor or simple text
--nIndex;
- String sPara = pTextEngine->GetText( nPara );
- xub_StrLen nSearchIndex = sPara.SearchBackward( '>', nIndex+1 );
- if( nSearchIndex != STRING_NOTFOUND && nSearchIndex == nIndex )
+ OUString sPara = pTextEngine->GetText( nPara );
+ sal_Int32 nSearchIndex = sPara.lastIndexOf( '>', nIndex+1 );
+ if( nSearchIndex != -1 && nSearchIndex == nIndex )
{
- nSearchIndex = sPara.SearchBackward( '<', nIndex );
- if( nSearchIndex != STRING_NOTFOUND )
+ nSearchIndex = sPara.lastIndexOf( '<', nIndex );
+ if( nSearchIndex != -1 )
nIndex = nSearchIndex;
}
}
diff --git a/tools/source/string/tustring.cxx b/tools/source/string/tustring.cxx
index 2a73396929b0..5d1d7e4e9cfd 100644
--- a/tools/source/string/tustring.cxx
+++ b/tools/source/string/tustring.cxx
@@ -235,27 +235,6 @@ xub_StrLen STRING::Match( const STRING& rStr ) const
return STRING_MATCH;
}
-xub_StrLen STRING::SearchBackward( STRCODE c, xub_StrLen nIndex ) const
-{
- DBG_CHKTHIS( STRING, DBGCHECKSTRING );
-
- if ( nIndex > mpData->mnLen )
- nIndex = (xub_StrLen)mpData->mnLen;
-
- const STRCODE* pStr = mpData->maStr;
- pStr += nIndex;
-
- while ( nIndex )
- {
- nIndex--;
- pStr--;
- if ( *pStr == c )
- return nIndex;
- }
-
- return STRING_NOTFOUND;
-}
-
void STRING::SearchAndReplaceAll( const STRING& rStr, const STRING& rRepStr )
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
diff --git a/vcl/aqua/source/window/salmenu.cxx b/vcl/aqua/source/window/salmenu.cxx
index 350be25eed40..5d29c2358ca7 100644
--- a/vcl/aqua/source/window/salmenu.cxx
+++ b/vcl/aqua/source/window/salmenu.cxx
@@ -676,19 +676,19 @@ void AquaSalMenu::SetItemText( unsigned /*i_nPos*/, SalMenuItem* i_pSalMenuItem,
AquaSalMenuItem *pAquaSalMenuItem = (AquaSalMenuItem *) i_pSalMenuItem;
// Delete mnemonics
- String aText( comphelper::string::remove(i_rText, '~') );
+ OUString aText( comphelper::string::remove(i_rText, '~') );
/* #i90015# until there is a correct solution
strip out any appended (.*) in menubar entries
*/
if( mbMenuBar )
{
- xub_StrLen nPos = aText.SearchBackward( sal_Unicode( '(' ) );
- if( nPos != STRING_NOTFOUND )
+ sal_Int32 nPos = aText.lastIndexOf( sal_Unicode( '(' ) );
+ if( nPos != -1 )
{
- xub_StrLen nPos2 = aText.Search( sal_Unicode( ')' ) );
- if( nPos2 != STRING_NOTFOUND )
- aText.Erase( nPos, nPos2-nPos+1 );
+ sal_Int32 nPos2 = aText.indexOf( sal_Unicode( ')' ) );
+ if( nPos2 != -1 )
+ aText = aText.replaceAt( nPos, nPos2-nPos+1, "" );
}
}