summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-02-15 15:26:43 +0100
committerStephan Bergmann <sbergman@redhat.com>2012-02-15 15:41:09 +0100
commit9ab0b38e95133dab720408cc2c80093b8a201c10 (patch)
tree416dde227ed5c4ded99292feb94f36a64c327999 /basctl
parent42422f2599220b678aa41c4aadeec28df113c3ec (diff)
Various string function clean up
Added: * rtl::OString::matchL * rtl::OString::endsWith * rtl::OString::endsWithL * rtl::OString::indexOfL * rtl::OString::replaceFirst * rtl::OString::replaceAll * rtl::OString::getToken * rtl::OUString::endsWith * rtl::OUString::replaceFirst * rtl::OUString::replaceFirstAsciiL * rtl::OUString::replaceFirstAsciiLAsciiL * rtl::OUString::replaceAll * rtl::OUString::replaceAllAsciiL * rtl::OUString::replaceAllAsciiLAsciiL * rtl::OUString::getToken plus underlying C functions where necessary Deprecated: * comphelper::string::remove * comphelper::string::getToken Removed: * comphelper::string::searchAndReplaceAsciiL * comphelper::string::searchAndReplaceAllAsciiWithAscii * comphelper::string::searchAndReplaceAsciiI * comphelper::string::replace * comphelper::string::matchL * comphelper::string::matchIgnoreAsciiCaseL * comphelper::string::indexOfL Also fixed some apparent misuses of RTL_CONSTASCII_USTRINGPARAM -> RTL_CONSTASCII_STRINGPARAM.
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/basicide/baside3.cxx5
-rw-r--r--basctl/source/basicide/basides1.cxx5
-rw-r--r--basctl/source/basicide/bastypes.cxx7
-rw-r--r--basctl/source/basicide/brkdlg.cxx13
-rw-r--r--basctl/source/basicide/moduldl2.cxx14
-rw-r--r--basctl/source/dlged/managelang.cxx5
6 files changed, 28 insertions, 21 deletions
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index 7db5434d3b74..67c8b006ce93 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -58,14 +58,12 @@
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
-#include <comphelper/string.hxx>
#include <comphelper/processfactory.hxx>
#include <tools/diagnose_ex.h>
#include <tools/urlobj.hxx>
#include <vcl/msgbox.hxx>
#include <xmlscript/xmldlg_imexp.hxx>
-using namespace comphelper;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::ucb;
@@ -1065,7 +1063,8 @@ sal_Bool implImportDialog( Window* pWin, const ::rtl::OUString& rCurPath, const
{
::rtl::OUString aQueryBoxTitle(ResId::toString(IDEResId(RID_STR_DLGIMP_CLASH_TITLE)));
::rtl::OUString aQueryBoxText(ResId::toString(IDEResId(RID_STR_DLGIMP_CLASH_TEXT)));
- aQueryBoxText = ::comphelper::string::replace(aQueryBoxText, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("$(ARG1)")), aXmlDlgName);
+ aQueryBoxText = aQueryBoxText.replaceAllAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("$(ARG1)"), aXmlDlgName);
NameClashQueryBox aQueryBox( pWin, aQueryBoxTitle, aQueryBoxText );
sal_uInt16 nRet = aQueryBox.Execute();
diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx
index f404f37c83fe..63cc273de0cb 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -53,7 +53,6 @@
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/script/XLibraryContainerPassword.hpp>
#include <com/sun/star/task/XStatusIndicatorFactory.hpp>
-#include <comphelper/string.hxx>
#include <svl/visitem.hxx>
#include <svtools/xtextedt.hxx>
#include <vcl/msgbox.hxx>
@@ -178,7 +177,9 @@ void BasicIDEShell::ExecuteCurrent( SfxRequest& rReq )
nFound = ((ModulWindow*)pCurWin)->StartSearchAndReplace( (const SvxSearchItem&)rItem );
::rtl::OUString aReplStr(ResId::toString(IDEResId(RID_STR_SEARCHREPLACES)));
- aReplStr = ::comphelper::string::replace(aReplStr, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("XX")), ::rtl::OUString::valueOf(nFound));
+ aReplStr = aReplStr.replaceAllAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("XX"),
+ rtl::OUString::valueOf(nFound));
InfoBox( pCurWin, aReplStr ).Execute();
}
else
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx
index f1987d19de87..67244eac269c 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -38,7 +38,6 @@
#include <basic/basmgr.hxx>
#include <com/sun/star/script/ModuleType.hpp>
#include <com/sun/star/script/XLibraryContainerPassword.hpp>
-#include <comphelper/string.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/passwd.hxx>
#include <sfx2/viewfrm.hxx>
@@ -757,7 +756,8 @@ bool QueryDel( const ::rtl::OUString& rName, const ResId& rId, Window* pParent )
::rtl::OUStringBuffer aNameBuf( rName );
aNameBuf.append('\'');
aNameBuf.insert(sal_Int32(0), sal_Unicode('\''));
- aQuery = ::comphelper::string::replace(aQuery, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "XX")), aNameBuf.makeStringAndClear());
+ aQuery = aQuery.replaceAllAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("XX"), aNameBuf.makeStringAndClear());
QueryBox aQueryBox( pParent, WB_YES_NO | WB_DEF_YES, aQuery );
return ( aQueryBox.Execute() == RET_YES );
}
@@ -802,7 +802,8 @@ bool QueryPassword( const Reference< script::XLibraryContainer >& xLibContainer,
if ( bNewTitle )
{
::rtl::OUString aTitle(ResId::toString(IDEResId(RID_STR_ENTERPASSWORD)));
- aTitle = ::comphelper::string::replace(aTitle, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("XX")), rLibName);
+ aTitle = aTitle.replaceAllAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("XX"), rLibName);
pDlg->SetText( aTitle );
}
diff --git a/basctl/source/basicide/brkdlg.cxx b/basctl/source/basicide/brkdlg.cxx
index 3365e13897cb..917a95f6c55a 100644
--- a/basctl/source/basicide/brkdlg.cxx
+++ b/basctl/source/basicide/brkdlg.cxx
@@ -36,28 +36,29 @@
#include "basidesh.hrc"
#include "iderdll.hxx"
-#include <comphelper/string.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/viewfrm.hxx>
// FIXME Why does BreakPointDialog allow only sal_uInt16 for break-point line
// numbers, whereas BreakPoint supports sal_uLong?
-bool lcl_ParseText( const String &rText, size_t& rLineNr )
+bool lcl_ParseText(rtl::OUString const &rText, size_t& rLineNr )
{
// aText should look like "# n" where
// n > 0 && n < std::numeric_limits< sal_uInt16 >::max().
// All spaces are ignored, so there can even be spaces within the
// number n. (Maybe it would be better to ignore all whitespace instead
// of just spaces.)
- String aText = comphelper::string::remove(rText, ' ');
- sal_Unicode cFirst = aText.GetChar(0);
+ rtl::OUString aText(
+ rText.replaceAllAsciiL(
+ RTL_CONSTASCII_STRINGPARAM(" "), rtl::OUString()));
+ sal_Unicode cFirst = aText[0];
if (cFirst != '#' && !(cFirst >= '0' && cFirst <= '9'))
return false;
if (cFirst == '#')
- aText.Erase(0, 1);
+ aText = aText.copy(1);
// XXX Assumes that sal_uInt16 is contained within sal_Int32:
- sal_Int32 n = aText.ToInt32();
+ sal_Int32 n = aText.toInt32();
if ( n <= 0 )
return false;
rLineNr = static_cast< size_t >(n);
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 60f01a910d96..0f7a1ce0d65d 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -62,12 +62,10 @@
#include "com/sun/star/packages/manifest/XManifestWriter.hpp"
#include <unotools/pathoptions.hxx>
#include <comphelper/processfactory.hxx>
-#include <comphelper/string.hxx>
#include <com/sun/star/util/VetoException.hpp>
#include <com/sun/star/script/ModuleSizeExceededRequest.hpp>
-using namespace ::comphelper;
using ::rtl::OUString;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -964,7 +962,9 @@ void LibPage::InsertLib()
( xDlgLibContainer.is() && xDlgLibContainer->hasByName( aLibName ) && xDlgLibContainer->isLibraryReadOnly( aLibName ) && !xDlgLibContainer->isLibraryLink( aLibName ) ) )
{
::rtl::OUString aErrStr( ResId::toString( IDEResId( RID_STR_REPLACELIB ) ) );
- aErrStr = ::comphelper::string::replace(aErrStr, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XX" ) ), aLibName);
+ aErrStr = aErrStr.replaceAllAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("XX"),
+ aLibName);
aErrStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n"));
aErrStr += ResId::toString( IDEResId( RID_STR_LIBISREADONLY ) );
ErrorBox( this, WB_OK | WB_DEF_OK, aErrStr ).Execute();
@@ -981,7 +981,9 @@ void LibPage::InsertLib()
aErrStr = ResId::toString( IDEResId( RID_STR_REFNOTPOSSIBLE ) );
else
aErrStr = ResId::toString( IDEResId( RID_STR_IMPORTNOTPOSSIBLE ) );
- aErrStr = ::comphelper::string::replace(aErrStr, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XX" ) ), aLibName);
+ aErrStr = aErrStr.replaceAllAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("XX"),
+ aLibName);
aErrStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n"));
aErrStr += ResId::toString( IDEResId( RID_STR_SBXNAMEALLREADYUSED ) );
ErrorBox( this, WB_OK | WB_DEF_OK, aErrStr ).Execute();
@@ -1002,7 +1004,9 @@ void LibPage::InsertLib()
if ( !bOK )
{
::rtl::OUString aErrStr( ResId::toString( IDEResId( RID_STR_NOIMPORT ) ) );
- aErrStr = ::comphelper::string::replace(aErrStr, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XX" ) ), aLibName);
+ aErrStr = aErrStr.replaceAllAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("XX"),
+ aLibName);
ErrorBox( this, WB_OK | WB_DEF_OK, aErrStr ).Execute();
continue;
}
diff --git a/basctl/source/dlged/managelang.cxx b/basctl/source/dlged/managelang.cxx
index 58fd9484d25e..c224f85e0424 100644
--- a/basctl/source/dlged/managelang.cxx
+++ b/basctl/source/dlged/managelang.cxx
@@ -37,8 +37,9 @@
#include "helpid.hrc"
#include "managelang.hrc"
+#include <com/sun/star/i18n/Boundary.hpp>
#include <com/sun/star/i18n/WordType.hpp>
-#include <comphelper/string.hxx>
+#include <com/sun/star/i18n/XBreakIterator.hpp>
#include <editeng/unolingu.hxx>
#include <sfx2/bindings.hxx>
#include <svtools/langtab.hxx>
@@ -120,7 +121,7 @@ void ManageLanguageDialog::Init()
::rtl::OUString sLibName = pIDEShell->GetCurLibName();
// set dialog title with library name
::rtl::OUString sText = GetText();
- ::comphelper::string::replace(sText, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("$1")), sLibName);
+ sText = sText.replaceAllAsciiL(RTL_CONSTASCII_STRINGPARAM("$1"), sLibName);
SetText( sText );
// set handler
m_aAddPB.SetClickHdl( LINK( this, ManageLanguageDialog, AddHdl ) );