summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-09-26 11:27:22 +0200
committerCaolán McNamara <caolanm@redhat.com>2013-09-27 11:16:11 +0200
commitb3a8056a499ca2a5cb809fcec52aebddd4e17f23 (patch)
tree176da629cc41ffba02616c8b8caf919da77eb9da /cui
parentb3c860acf3a9e0806f2e4451a6f8ceb74565f57d (diff)
Related: fdo#38838 remove UniString::SearchBackward
Change-Id: Ia474ee07b1bd411eae8cd1ddd55c4fa83dbd5f47
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/hlinettp.cxx11
-rw-r--r--cui/source/dialogs/hyphen.cxx10
2 files changed, 10 insertions, 11 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)
{