summaryrefslogtreecommitdiff
path: root/desktop/source/deployment/gui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-07-13 20:12:42 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-07-14 14:04:03 +0100
commit82937ce3d7bc2382c4da22365d1245c9f7db178c (patch)
treedbae8b3a02a1b0f21326ba2d5da41cf946d48962 /desktop/source/deployment/gui
parent46894ec48eb33dc99dab807c9fcaf0caa7c6cd84 (diff)
String::SearchAndReplaceAllAscii -> OUString::replaceAll
Change-Id: I5091835c9f71c712f15996e5c6263fc5f21f6f96
Diffstat (limited to 'desktop/source/deployment/gui')
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.cxx44
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.hxx2
-rw-r--r--desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx20
3 files changed, 33 insertions, 33 deletions
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index 5c66a3672859..493943555df5 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -573,13 +573,13 @@ ResId DialogHelper::getResId( sal_uInt16 nId )
}
//------------------------------------------------------------------------------
-String DialogHelper::getResourceString( sal_uInt16 id )
+OUString DialogHelper::getResourceString(sal_uInt16 id)
{
const SolarMutexGuard guard;
- String ret( ResId( id, *DeploymentGuiResMgr::get() ) );
- if (ret.SearchAscii( "%PRODUCTNAME" ) != STRING_NOTFOUND) {
- ret.SearchAndReplaceAllAscii(
- "%PRODUCTNAME", utl::ConfigManager::getProductName() );
+ OUString ret(ResId(id, *DeploymentGuiResMgr::get()).toString());
+ if (ret.indexOf("%PRODUCTNAME" ) != -1)
+ {
+ ret = ret.replaceAll("%PRODUCTNAME", utl::ConfigManager::getProductName());
}
return ret;
}
@@ -603,9 +603,9 @@ bool DialogHelper::continueOnSharedExtension( const uno::Reference< deployment::
{
const SolarMutexGuard guard;
WarningBox aInfoBox( pParent, getResId( nResID ) );
- String aMsgText = aInfoBox.GetMessText();
- aMsgText.SearchAndReplaceAllAscii(
- "%PRODUCTNAME", utl::ConfigManager::getProductName() );
+ OUString aMsgText = aInfoBox.GetMessText();
+ aMsgText = aMsgText.replaceAll(
+ "%PRODUCTNAME", utl::ConfigManager::getProductName());
aInfoBox.SetMessText( aMsgText );
bHadWarning = true;
@@ -649,9 +649,9 @@ bool DialogHelper::installExtensionWarn( const OUString &rExtensionName ) const
const SolarMutexGuard guard;
WarningBox aInfo( m_pVCLWindow, getResId( RID_WARNINGBOX_INSTALL_EXTENSION ) );
- String sText( aInfo.GetMessText() );
- sText.SearchAndReplaceAllAscii( "%NAME", rExtensionName );
- aInfo.SetMessText( sText );
+ OUString sText(aInfo.GetMessText());
+ sText = sText.replaceAll("%NAME", rExtensionName);
+ aInfo.SetMessText(sText);
return ( RET_OK == aInfo.Execute() );
}
@@ -662,10 +662,10 @@ bool DialogHelper::installForAllUsers( bool &bInstallForAll ) const
const SolarMutexGuard guard;
QueryBox aQuery( m_pVCLWindow, getResId( RID_QUERYBOX_INSTALL_FOR_ALL ) );
- String sMsgText = aQuery.GetMessText();
- sMsgText.SearchAndReplaceAllAscii(
- "%PRODUCTNAME", utl::ConfigManager::getProductName() );
- aQuery.SetMessText( sMsgText );
+ OUString sMsgText(aQuery.GetMessText());
+ sMsgText = sMsgText.replaceAll(
+ "%PRODUCTNAME", utl::ConfigManager::getProductName());
+ aQuery.SetMessText(sMsgText);
sal_uInt16 nYesBtnID = aQuery.GetButtonId( 0 );
sal_uInt16 nNoBtnID = aQuery.GetButtonId( 1 );
@@ -808,9 +808,9 @@ bool ExtMgrDialog::removeExtensionWarn( const OUString &rExtensionName ) const
const SolarMutexGuard guard;
WarningBox aInfo( const_cast< ExtMgrDialog* >(this), getResId( RID_WARNINGBOX_REMOVE_EXTENSION ) );
- String sText( aInfo.GetMessText() );
- sText.SearchAndReplaceAllAscii( "%NAME", rExtensionName );
- aInfo.SetMessText( sText );
+ OUString sText(aInfo.GetMessText());
+ sText = sText.replaceAll("%NAME", rExtensionName);
+ aInfo.SetMessText(sText);
return ( RET_OK == aInfo.Execute() );
}
@@ -1224,10 +1224,10 @@ UpdateRequiredDialog::UpdateRequiredDialog( Window *pParent, TheExtensionManager
m_aCloseBtn.SetClickHdl( LINK( this, UpdateRequiredDialog, HandleCloseBtn ) );
m_aCancelBtn.SetClickHdl( LINK( this, UpdateRequiredDialog, HandleCancelBtn ) );
- String aText = m_aUpdateNeeded.GetText();
- aText.SearchAndReplaceAllAscii(
- "%PRODUCTNAME", utl::ConfigManager::getProductName() );
- m_aUpdateNeeded.SetText( aText );
+ OUString aText = m_aUpdateNeeded.GetText();
+ aText = aText.replaceAll(
+ "%PRODUCTNAME", utl::ConfigManager::getProductName());
+ m_aUpdateNeeded.SetText(aText);
// resize update button
Size aBtnSize = m_aUpdateBtn.GetSizePixel();
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.hxx b/desktop/source/deployment/gui/dp_gui_dialog2.hxx
index b5a5aa430483..436879b1885f 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.hxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.hxx
@@ -81,7 +81,7 @@ public:
virtual void checkEntries() = 0;
static ResId getResId( sal_uInt16 nId );
- static String getResourceString( sal_uInt16 id );
+ static OUString getResourceString( sal_uInt16 id );
static bool IsSharedPkgMgr( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &);
static bool continueOnSharedExtension( const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > &,
Window *pParent,
diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
index c9bdf06c7844..8b2cd3369248 100644
--- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
@@ -456,7 +456,7 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
{
SolarMutexGuard guard;
WarningBox box( m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, ResId(id, *DeploymentGuiResMgr::get()));
- String s;
+ OUString s;
if (bEqualNames)
{
s = box.GetMessText();
@@ -466,20 +466,20 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
//hypothetical: requires two instances of an extension with the same
//version to have different display names. Probably the developer forgot
//to change the version.
- s = String(ResId(RID_STR_WARNINGBOX_VERSION_EQUAL_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()));
+ s = ResId(RID_STR_WARNINGBOX_VERSION_EQUAL_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()).toString();
}
else if (id == RID_WARNINGBOX_VERSION_LESS)
{
- s = String(ResId(RID_STR_WARNINGBOX_VERSION_LESS_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()));
+ s = ResId(RID_STR_WARNINGBOX_VERSION_LESS_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()).toString();
}
else if (id == RID_WARNINGBOX_VERSION_GREATER)
{
- s = String(ResId(RID_STR_WARNINGBOX_VERSION_GREATER_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()));
+ s = ResId(RID_STR_WARNINGBOX_VERSION_GREATER_DIFFERENT_NAMES, *DeploymentGuiResMgr::get()).toString();
}
- s.SearchAndReplaceAllAscii( "$NAME", verExc.NewDisplayName);
- s.SearchAndReplaceAllAscii( "$OLDNAME", verExc.Deployed->getDisplayName());
- s.SearchAndReplaceAllAscii( "$NEW", getVersion(verExc.NewVersion) );
- s.SearchAndReplaceAllAscii( "$DEPLOYED", getVersion(verExc.Deployed) );
+ s = s.replaceAll("$NAME", verExc.NewDisplayName);
+ s = s.replaceAll("$OLDNAME", verExc.Deployed->getDisplayName());
+ s = s.replaceAll("$NEW", getVersion(verExc.NewVersion));
+ s = s.replaceAll("$DEPLOYED", getVersion(verExc.Deployed));
box.SetMessText(s);
approve = box.Execute() == RET_OK;
abort = !approve;
@@ -507,8 +507,8 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
else if (request >>= platExc)
{
SolarMutexGuard guard;
- String sMsg( ResId( RID_STR_UNSUPPORTED_PLATFORM, *DeploymentGuiResMgr::get() ) );
- sMsg.SearchAndReplaceAllAscii( "%Name", platExc.package->getDisplayName() );
+ OUString sMsg(ResId(RID_STR_UNSUPPORTED_PLATFORM, *DeploymentGuiResMgr::get()).toString());
+ sMsg = sMsg.replaceAll("%Name", platExc.package->getDisplayName());
ErrorBox box( m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, WB_OK, sMsg );
box.Execute();
approve = true;