summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-09-30 11:03:58 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-09-30 11:04:22 +0100
commit64b720dce8d3087ed62da815ecae1375b45149be (patch)
treef09933f2322c72ba3e30ea7ea1c9598fe7658eea /cui
parentcfb09f556d7bc4d7341abf86c6e61af657235432 (diff)
Related: fdo#38838 remove UniString::SearchAscii
Change-Id: Icb7850aaabe59f96ea26a665a8d25617b2741d68
Diffstat (limited to 'cui')
-rw-r--r--cui/source/customize/acccfg.cxx6
-rw-r--r--cui/source/dialogs/cuihyperdlg.cxx8
-rw-r--r--cui/source/dialogs/hldocntp.cxx2
-rw-r--r--cui/source/dialogs/hldoctp.cxx14
-rw-r--r--cui/source/dialogs/hlinettp.cxx39
-rw-r--r--cui/source/dialogs/hlmailtp.cxx16
-rw-r--r--cui/source/inc/acccfg.hxx4
-rw-r--r--cui/source/inc/hldocntp.hxx2
-rw-r--r--cui/source/inc/hldoctp.hxx2
-rw-r--r--cui/source/inc/hlinettp.hxx8
-rw-r--r--cui/source/inc/hlmailtp.hxx4
-rw-r--r--cui/source/inc/hltpbase.hxx2
12 files changed, 53 insertions, 54 deletions
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index 2ec03287ba9d..89b8df411f87 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -1485,7 +1485,7 @@ sal_uInt16 SfxAcceleratorConfigPage::MapKeyCodeToPos(const KeyCode& aKey) const
}
//-----------------------------------------------
-String SfxAcceleratorConfigPage::GetLabel4Command(const String& sCommand)
+OUString SfxAcceleratorConfigPage::GetLabel4Command(const OUString& sCommand)
{
try
{
@@ -1516,10 +1516,10 @@ String SfxAcceleratorConfigPage::GetLabel4Command(const String& sCommand)
else
{
String aRet(OUString("Symbols: "));
- xub_StrLen nPos = sCommand.SearchAscii(".uno:InsertSymbol?Symbols:string=");
+ sal_Int32 nPos = sCommand.indexOf(".uno:InsertSymbol?Symbols:string=");
if ( nPos == 0 )
{
- aRet += String( sCommand, 34, sCommand.Len()-34 );
+ aRet += sCommand.copy(34, sCommand.getLength()-34);
return aRet;
}
}
diff --git a/cui/source/dialogs/cuihyperdlg.cxx b/cui/source/dialogs/cuihyperdlg.cxx
index 2911204fbbb2..e8c33f5ebb46 100644
--- a/cui/source/dialogs/cuihyperdlg.cxx
+++ b/cui/source/dialogs/cuihyperdlg.cxx
@@ -272,8 +272,8 @@ sal_uInt16 SvxHpLinkDlg::SetPage ( SvxHyperlinkItem* pItem )
{
sal_uInt16 nPageId = RID_SVXPAGE_HYPERLINK_INTERNET;
- String aStrURL ( pItem->GetURL() );
- INetURLObject aURL ( aStrURL );
+ OUString aStrURL(pItem->GetURL());
+ INetURLObject aURL(aStrURL);
INetProtocol eProtocolTyp = aURL.GetProtocol();
switch ( eProtocolTyp )
@@ -295,12 +295,12 @@ sal_uInt16 SvxHpLinkDlg::SetPage ( SvxHyperlinkItem* pItem )
sal_Char const sNewsSrvScheme[] = "news://";
// TODO news:// is nonsense
- if ( aStrURL.SearchAscii( sNewsSrvScheme ) == 0 )
+ if (aStrURL.startsWith(sNewsSrvScheme))
nPageId = RID_SVXPAGE_HYPERLINK_DOCUMENT;
else
{
sal_Char const sHash[] = "#";
- if( aStrURL.SearchAscii( sHash ) == 0 )
+ if (aStrURL.startsWith(sHash))
nPageId = RID_SVXPAGE_HYPERLINK_DOCUMENT;
else
{
diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index f554ef00afbb..ca83ae3658c8 100644
--- a/cui/source/dialogs/hldocntp.cxx
+++ b/cui/source/dialogs/hldocntp.cxx
@@ -151,7 +151,7 @@ SvxHyperlinkNewDocTp::~SvxHyperlinkNewDocTp ()
|************************************************************************/
-void SvxHyperlinkNewDocTp::FillDlgFields ( String& /*aStrURL*/ )
+void SvxHyperlinkNewDocTp::FillDlgFields(const OUString& /*rStrURL*/)
{
}
diff --git a/cui/source/dialogs/hldoctp.cxx b/cui/source/dialogs/hldoctp.cxx
index a5ab744552c4..e8e9275e579f 100644
--- a/cui/source/dialogs/hldoctp.cxx
+++ b/cui/source/dialogs/hldoctp.cxx
@@ -92,18 +92,18 @@ SvxHyperlinkDocTp::~SvxHyperlinkDocTp ()
|*
|************************************************************************/
-void SvxHyperlinkDocTp::FillDlgFields ( String& aStrURL )
+void SvxHyperlinkDocTp::FillDlgFields(const OUString& rStrURL)
{
- INetURLObject aURL ( aStrURL );
+ INetURLObject aURL(rStrURL);
- String aStrMark;
- xub_StrLen nPos = aStrURL.SearchAscii( sHash );
+ sal_Int32 nPos = rStrURL.indexOf(sHash);
// path
- maCbbPath.SetText ( aStrURL.Copy( 0, ( nPos == STRING_NOTFOUND ? aStrURL.Len() : nPos ) ) );
+ maCbbPath.SetText ( rStrURL.copy( 0, ( nPos == -1 ? rStrURL.getLength() : nPos ) ) );
// set target in document at editfield
- if ( nPos != STRING_NOTFOUND && nPos<aStrURL.Len()-1 )
- aStrMark = aStrURL.Copy( nPos+1, aStrURL.Len() );
+ OUString aStrMark;
+ if ( nPos != -1 && nPos < rStrURL.getLength()-1 )
+ aStrMark = rStrURL.copy( nPos+1, rStrURL.getLength() );
maEdTarget.SetText ( aStrMark );
ModifiedPathHdl_Impl ( NULL );
diff --git a/cui/source/dialogs/hlinettp.cxx b/cui/source/dialogs/hlinettp.cxx
index 520b7f4d4f12..01470e57ee1b 100644
--- a/cui/source/dialogs/hlinettp.cxx
+++ b/cui/source/dialogs/hlinettp.cxx
@@ -112,13 +112,13 @@ SvxHyperlinkInternetTp::~SvxHyperlinkInternetTp ()
|*
|************************************************************************/
-void SvxHyperlinkInternetTp::FillDlgFields ( String& aStrURL )
+void SvxHyperlinkInternetTp::FillDlgFields(const OUString& rStrURL)
{
- INetURLObject aURL( aStrURL );
- String aStrScheme = GetSchemeFromURL( aStrURL );
+ INetURLObject aURL(rStrURL);
+ OUString aStrScheme(GetSchemeFromURL(rStrURL));
// set additional controls for FTP: Username / Password
- if ( aStrScheme.SearchAscii( sFTPScheme ) == 0 )
+ if (aStrScheme.startsWith(sFTPScheme))
{
if ( aURL.GetUser().toAsciiLowerCase().startsWith( sAnonymous ) )
setAnonymousFTPUser();
@@ -135,9 +135,9 @@ void SvxHyperlinkInternetTp::FillDlgFields ( String& aStrURL )
if ( aURL.GetProtocol() != INET_PROT_NOT_VALID )
maCbbTarget.SetText( aURL.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ) );
else
- maCbbTarget.SetText( aStrURL ); // #77696#
+ maCbbTarget.SetText(rStrURL); // #77696#
- SetScheme( aStrScheme );
+ SetScheme(aStrScheme);
}
void SvxHyperlinkInternetTp::setAnonymousFTPUser()
@@ -179,9 +179,9 @@ void SvxHyperlinkInternetTp::GetCurentItemData ( OUString& rStrURL, String& aStr
GetDataFromCommonFields( aStrName, aStrIntName, aStrFrame, eMode );
}
-String SvxHyperlinkInternetTp::CreateAbsoluteURL() const
+OUString SvxHyperlinkInternetTp::CreateAbsoluteURL() const
{
- String aStrURL = maCbbTarget.GetText();
+ OUString aStrURL(maCbbTarget.GetText());
INetURLObject aURL(aStrURL);
@@ -275,11 +275,10 @@ IMPL_LINK_NOARG(SvxHyperlinkInternetTp, ModifiedLoginHdl_Impl)
/*************************************************************************
|************************************************************************/
-void SvxHyperlinkInternetTp::SetScheme( const String& aScheme )
+void SvxHyperlinkInternetTp::SetScheme(const OUString& rScheme)
{
- //if aScheme is empty or unknown the default beaviour is like it where HTTP
-
- sal_Bool bFTP = aScheme.SearchAscii( sFTPScheme ) == 0;
+ //if rScheme is empty or unknown the default beaviour is like it where HTTP
+ sal_Bool bFTP = rScheme.startsWith(sFTPScheme);
sal_Bool bInternet = !(bFTP);
//update protocol button selection:
@@ -287,7 +286,7 @@ void SvxHyperlinkInternetTp::SetScheme( const String& aScheme )
maRbtLinktypInternet.Check(bInternet);
//update target:
- RemoveImproperProtocol(aScheme);
+ RemoveImproperProtocol(rScheme);
maCbbTarget.SetSmartProtocol( GetSmartProtocolFromButtons() );
//show/hide special fields for FTP:
@@ -298,7 +297,7 @@ void SvxHyperlinkInternetTp::SetScheme( const String& aScheme )
maCbAnonymous.Show( bFTP );
//update 'link target in document'-window and opening-button
- if( aScheme.SearchAscii( sHTTPScheme ) == 0 || aScheme.Len() == 0 )
+ if (rScheme.startsWith(sHTTPScheme) || rScheme.isEmpty())
{
maBtTarget.Enable();
if ( mbMarkWndOpen )
@@ -319,15 +318,15 @@ void SvxHyperlinkInternetTp::SetScheme( const String& aScheme )
|*
|************************************************************************/
-void SvxHyperlinkInternetTp::RemoveImproperProtocol(const String& aProperScheme)
+void SvxHyperlinkInternetTp::RemoveImproperProtocol(const OUString& aProperScheme)
{
String aStrURL ( maCbbTarget.GetText() );
if ( aStrURL != aEmptyStr )
{
- String aStrScheme = GetSchemeFromURL( aStrURL );
- if ( aStrScheme != aEmptyStr && aStrScheme != aProperScheme )
+ OUString aStrScheme(GetSchemeFromURL(aStrURL));
+ if ( !aStrScheme.isEmpty() && aStrScheme != aProperScheme )
{
- aStrURL.Erase ( 0, aStrScheme.Len() );
+ aStrURL.Erase ( 0, aStrScheme.getLength() );
maCbbTarget.SetText ( aStrURL );
}
}
@@ -357,8 +356,8 @@ INetProtocol SvxHyperlinkInternetTp::GetSmartProtocolFromButtons() const
IMPL_LINK_NOARG(SvxHyperlinkInternetTp, Click_SmartProtocol_Impl)
{
- String aScheme = GetSchemeFromButtons();
- SetScheme( aScheme );
+ OUString aScheme = GetSchemeFromButtons();
+ SetScheme(aScheme);
return( 0L );
}
diff --git a/cui/source/dialogs/hlmailtp.cxx b/cui/source/dialogs/hlmailtp.cxx
index ef36989d5679..fed79ae034ab 100644
--- a/cui/source/dialogs/hlmailtp.cxx
+++ b/cui/source/dialogs/hlmailtp.cxx
@@ -92,13 +92,13 @@ SvxHyperlinkMailTp::~SvxHyperlinkMailTp ()
|*
|************************************************************************/
-void SvxHyperlinkMailTp::FillDlgFields ( String& aStrURL )
+void SvxHyperlinkMailTp::FillDlgFields(const OUString& rStrURL)
{
- INetURLObject aURL( aStrURL );
- OUString aStrScheme = GetSchemeFromURL( aStrURL );
+ INetURLObject aURL(rStrURL);
+ OUString aStrScheme = GetSchemeFromURL(rStrURL);
// set URL-field and additional controls
- OUString aStrURLc ( aStrURL );
+ OUString aStrURLc (rStrURL);
// set additional controls for EMail:
if ( aStrScheme.startsWith( INET_MAILTO_SCHEME ) )
{
@@ -197,19 +197,19 @@ void SvxHyperlinkMailTp::SetInitFocus()
/*************************************************************************
|************************************************************************/
-void SvxHyperlinkMailTp::SetScheme( const String& aScheme )
+void SvxHyperlinkMailTp::SetScheme(const OUString& rScheme)
{
- //if aScheme is empty or unknown the default beaviour is like it where MAIL
+ //if rScheme is empty or unknown the default beaviour is like it where MAIL
const sal_Char sNewsScheme[] = INET_NEWS_SCHEME;
- sal_Bool bMail = aScheme.SearchAscii( sNewsScheme ) != 0;
+ bool bMail = rScheme.startsWith(sNewsScheme);
//update protocol button selection:
maRbtMail.Check(bMail);
maRbtNews.Check(!bMail);
//update target:
- RemoveImproperProtocol(aScheme);
+ RemoveImproperProtocol(rScheme);
maCbbReceiver.SetSmartProtocol( GetSmartProtocolFromButtons() );
//show/hide special fields for MAIL:
diff --git a/cui/source/inc/acccfg.hxx b/cui/source/inc/acccfg.hxx
index 417a456cdc0c..a23c50fcb48d 100644
--- a/cui/source/inc/acccfg.hxx
+++ b/cui/source/inc/acccfg.hxx
@@ -160,9 +160,9 @@ private:
DECL_LINK(LoadHdl, void *);
DECL_LINK(SaveHdl, void *);
- String GetLabel4Command(const String& sCommand);
+ OUString GetLabel4Command(const OUString& rCommand);
void InitAccCfg();
- sal_uInt16 MapKeyCodeToPos( const KeyCode &rCode ) const;
+ sal_uInt16 MapKeyCodeToPos( const KeyCode &rCode ) const;
css::uno::Reference< css::frame::XModel > SearchForAlreadyLoadedDoc(const String& sName);
void StartFileDialog( WinBits nBits, const String& rTitle );
diff --git a/cui/source/inc/hldocntp.hxx b/cui/source/inc/hldocntp.hxx
index 9ae773810a5b..67ad2c1f48e4 100644
--- a/cui/source/inc/hldocntp.hxx
+++ b/cui/source/inc/hldocntp.hxx
@@ -47,7 +47,7 @@ private:
Image GetImage( sal_uInt16 nId );
protected:
- void FillDlgFields ( String& aStrURL );
+ void FillDlgFields(const OUString& rStrURL);
void GetCurentItemData ( OUString& rStrURL, String& aStrName,
String& aStrIntName, String& aStrFrame,
SvxLinkInsertMode& eMode );
diff --git a/cui/source/inc/hldoctp.hxx b/cui/source/inc/hldoctp.hxx
index 0ef62b25e6e2..b263bc5a3068 100644
--- a/cui/source/inc/hldoctp.hxx
+++ b/cui/source/inc/hldoctp.hxx
@@ -62,7 +62,7 @@ private:
EPathType GetPathType ( const OUString& rStrPath );
protected:
- void FillDlgFields ( String& aStrURL );
+ void FillDlgFields(const OUString& rStrURL);
void GetCurentItemData ( OUString& rStrURL, String& aStrName,
String& aStrIntName, String& aStrFrame,
SvxLinkInsertMode& eMode );
diff --git a/cui/source/inc/hlinettp.hxx b/cui/source/inc/hlinettp.hxx
index 419465d455f7..ee3c8aa1ce0d 100644
--- a/cui/source/inc/hlinettp.hxx
+++ b/cui/source/inc/hlinettp.hxx
@@ -61,19 +61,19 @@ private:
DECL_LINK(TimeoutHdl_Impl , void *); ///< Handler for timer -timeout
- void SetScheme( const String& aScheme );
- void RemoveImproperProtocol(const String& aProperScheme);
+ void SetScheme(const OUString& rScheme);
+ void RemoveImproperProtocol(const OUString& rProperScheme);
String GetSchemeFromButtons() const;
INetProtocol GetSmartProtocolFromButtons() const;
- String CreateAbsoluteURL() const;
+ OUString CreateAbsoluteURL() const;
void setAnonymousFTPUser();
void setFTPUser(const String& rUser, const String& rPassword);
void RefreshMarkWindow();
protected:
- virtual void FillDlgFields ( String& aStrURL );
+ virtual void FillDlgFields(const OUString& rStrURL);
virtual void GetCurentItemData ( OUString& rStrURL, String& aStrName,
String& aStrIntName, String& aStrFrame,
SvxLinkInsertMode& eMode );
diff --git a/cui/source/inc/hlmailtp.hxx b/cui/source/inc/hlmailtp.hxx
index 0cbc6b2acbaf..d76799ecc3ad 100644
--- a/cui/source/inc/hlmailtp.hxx
+++ b/cui/source/inc/hlmailtp.hxx
@@ -43,7 +43,7 @@ private:
DECL_LINK (ClickAdrBookHdl_Impl , void * ); ///< Button : Address book
DECL_LINK (ModifiedReceiverHdl_Impl, void * ); ///< Combobox "receiver" modified
- void SetScheme( const String& aScheme );
+ void SetScheme(const OUString& rScheme);
void RemoveImproperProtocol(const String& aProperScheme);
String GetSchemeFromButtons() const;
INetProtocol GetSmartProtocolFromButtons() const;
@@ -51,7 +51,7 @@ private:
String CreateAbsoluteURL() const;
protected:
- virtual void FillDlgFields ( String& aStrURL );
+ virtual void FillDlgFields(const OUString& rStrURL);
virtual void GetCurentItemData ( OUString& rStrURL, String& aStrName,
String& aStrIntName, String& aStrFrame,
SvxLinkInsertMode& eMode );
diff --git a/cui/source/inc/hltpbase.hxx b/cui/source/inc/hltpbase.hxx
index 945c104cce29..a4b37c9a13ac 100644
--- a/cui/source/inc/hltpbase.hxx
+++ b/cui/source/inc/hltpbase.hxx
@@ -104,7 +104,7 @@ protected:
void InitStdControls ();
virtual void FillStandardDlgFields ( SvxHyperlinkItem* pHyperlinkItem );
- virtual void FillDlgFields ( String& aStrURL ) = 0;
+ virtual void FillDlgFields(const OUString& rStrURL) = 0;
virtual void GetCurentItemData ( OUString& rStrURL, String& aStrName,
String& aStrIntName, String& aStrFrame,
SvxLinkInsertMode& eMode ) = 0;