summaryrefslogtreecommitdiff
path: root/desktop/source/deployment
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/source/deployment')
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.cxx15
-rw-r--r--desktop/source/deployment/gui/dp_gui_service.cxx54
-rw-r--r--desktop/source/deployment/gui/dp_gui_shared.hxx8
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedialog.cxx5
-rw-r--r--desktop/source/deployment/misc/dp_resource.cxx17
5 files changed, 32 insertions, 67 deletions
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index a0768dd0806c..1cc397b629cf 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -64,6 +64,7 @@
#include "comphelper/processfactory.hxx"
#include "ucbhelper/content.hxx"
#include "unotools/collatorwrapper.hxx"
+#include "unotools/configmgr.hxx"
#include "com/sun/star/beans/StringPair.hpp"
@@ -577,12 +578,11 @@ ResId DialogHelper::getResId( sal_uInt16 nId )
//------------------------------------------------------------------------------
String DialogHelper::getResourceString( sal_uInt16 id )
{
- // init with non-acquired solar mutex:
- BrandName::get();
const SolarMutexGuard guard;
String ret( ResId( id, *DeploymentGuiResMgr::get() ) );
if (ret.SearchAscii( "%PRODUCTNAME" ) != STRING_NOTFOUND) {
- ret.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() );
+ ret.SearchAndReplaceAllAscii(
+ "%PRODUCTNAME", utl::ConfigManager::getProductName() );
}
return ret;
}
@@ -607,7 +607,8 @@ bool DialogHelper::continueOnSharedExtension( const uno::Reference< deployment::
const SolarMutexGuard guard;
WarningBox aInfoBox( pParent, getResId( nResID ) );
String aMsgText = aInfoBox.GetMessText();
- aMsgText.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() );
+ aMsgText.SearchAndReplaceAllAscii(
+ "%PRODUCTNAME", utl::ConfigManager::getProductName() );
aInfoBox.SetMessText( aMsgText );
bHadWarning = true;
@@ -665,7 +666,8 @@ bool DialogHelper::installForAllUsers( bool &bInstallForAll ) const
QueryBox aQuery( m_pVCLWindow, getResId( RID_QUERYBOX_INSTALL_FOR_ALL ) );
String sMsgText = aQuery.GetMessText();
- sMsgText.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() );
+ sMsgText.SearchAndReplaceAllAscii(
+ "%PRODUCTNAME", utl::ConfigManager::getProductName() );
aQuery.SetMessText( sMsgText );
sal_uInt16 nYesBtnID = aQuery.GetButtonId( 0 );
@@ -1279,7 +1281,8 @@ UpdateRequiredDialog::UpdateRequiredDialog( Window *pParent, TheExtensionManager
m_aCancelBtn.SetClickHdl( LINK( this, UpdateRequiredDialog, HandleCancelBtn ) );
String aText = m_aUpdateNeeded.GetText();
- aText.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() );
+ aText.SearchAndReplaceAllAscii(
+ "%PRODUCTNAME", utl::ConfigManager::getProductName() );
m_aUpdateNeeded.SetText( aText );
// resize update button
diff --git a/desktop/source/deployment/gui/dp_gui_service.cxx b/desktop/source/deployment/gui/dp_gui_service.cxx
index 38c081b1c3fc..71ee6c466b8a 100644
--- a/desktop/source/deployment/gui/dp_gui_service.cxx
+++ b/desktop/source/deployment/gui/dp_gui_service.cxx
@@ -107,36 +107,21 @@ void ReplaceProductNameHookProc( String& rStr )
nAll++;
if ( rStr.SearchAscii( "%PRODUCT" ) != STRING_NOTFOUND )
{
- String &rProductName = ProductName::get();
- String &rVersion = Version::get();
- String &rAboutBoxVersion = AboutBoxVersion::get();
- String &rExtension = Extension::get();
- String &rOOOVendor = OOOVendor::get();
+ String rProductName = ProductName::get();
+ String rVersion = Version::get();
+ String rAboutBoxVersion = AboutBoxVersion::get();
+ String rExtension = Extension::get();
+ String rOOOVendor = OOOVendor::get();
if ( !rProductName.Len() )
{
- rtl::OUString aTmp;
- Any aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME );
- aRet >>= aTmp;
- rProductName = aTmp;
-
- aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTVERSION );
- aRet >>= aTmp;
- rVersion = aTmp;
-
- aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::ABOUTBOXPRODUCTVERSION );
- aRet >>= aTmp;
- rAboutBoxVersion = aTmp;
-
- aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::OOOVENDOR );
- aRet >>= aTmp;
- rOOOVendor = aTmp;
-
+ rProductName = utl::ConfigManager::getProductName();
+ rVersion = utl::ConfigManager::getProductVersion();
+ rAboutBoxVersion = utl::ConfigManager::getAboutBoxProductVersion();
+ rOOOVendor = utl::ConfigManager::getVendor();
if ( !rExtension.Len() )
{
- aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTEXTENSION );
- aRet >>= aTmp;
- rExtension = aTmp;
+ rExtension = utl::ConfigManager::getProductExtension();
}
}
@@ -253,19 +238,14 @@ void ServiceImpl::startExecuteModal(
throw RuntimeException( OUSTR("Cannot initialize VCL!"),
static_cast<OWeakObject *>(this) );
AllSettings as = app->GetSettings();
- OUString slang;
- if (! (::utl::ConfigManager::GetDirectConfigProperty(
- ::utl::ConfigManager::LOCALE ) >>= slang))
- throw RuntimeException( OUSTR("Cannot determine language!"),
- static_cast<OWeakObject *>(this) );
- as.SetUILanguage( MsLangId::convertIsoStringToLanguage( slang ) );
+ as.SetUILanguage(
+ MsLangId::convertIsoStringToLanguage(
+ utl::ConfigManager::getLocale() ) );
app->SetSettings( as );
- String sTitle = ::utl::ConfigManager::GetDirectConfigProperty(
- ::utl::ConfigManager::PRODUCTNAME).get<OUString>()
- + String(static_cast<sal_Unicode>(' '))
- + ::utl::ConfigManager::GetDirectConfigProperty(
- ::utl::ConfigManager::PRODUCTVERSION).get<OUString>();
- app->SetDisplayName(sTitle);
+ app->SetDisplayName(
+ utl::ConfigManager::getProductName() +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ")) +
+ utl::ConfigManager::getProductVersion());
ExtensionCmdQueue::syncRepositories( m_xComponentContext );
}
}
diff --git a/desktop/source/deployment/gui/dp_gui_shared.hxx b/desktop/source/deployment/gui/dp_gui_shared.hxx
index 3e2db45bfdd7..bc2e08e57039 100644
--- a/desktop/source/deployment/gui/dp_gui_shared.hxx
+++ b/desktop/source/deployment/gui/dp_gui_shared.hxx
@@ -29,7 +29,6 @@
#if !defined INCLUDED_DP_GUI_SHARED_HXX
#define INCLUDED_DP_GUI_SHARED_HXX
-#include "unotools/configmgr.hxx"
#include "rtl/instance.hxx"
#include "tools/resmgr.hxx"
@@ -45,13 +44,6 @@ struct DeploymentGuiResMgr :
}
};
-struct BrandName : public ::rtl::StaticWithInit< ::rtl::OUString, BrandName > {
- const ::rtl::OUString operator () () {
- return ::utl::ConfigManager::GetDirectConfigProperty(
- ::utl::ConfigManager::PRODUCTNAME ).get< ::rtl::OUString >();
- }
-};
-
class DpGuiResId : public ResId
{
public:
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
index f0b3f41d9e09..bf31cf195ed1 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
@@ -101,6 +101,7 @@
#include "tools/resmgr.hxx"
#include "tools/solar.h"
#include "tools/string.hxx"
+#include "unotools/configmgr.hxx"
#include "vcl/button.hxx"
#include "vcl/dialog.hxx"
#include "vcl/fixed.hxx"
@@ -1288,12 +1289,12 @@ IMPL_LINK(UpdateDialog, selectionHandler, void *, EMPTYARG)
nPos = m_noDependencyCurVer.indexOf( sProductName );
if ( nPos >= 0 )
{
- m_noDependencyCurVer = m_noDependencyCurVer.replaceAt( nPos, sProductName.getLength(), BrandName::get() );
+ m_noDependencyCurVer = m_noDependencyCurVer.replaceAt( nPos, sProductName.getLength(), utl::ConfigManager::getProductName() );
}
nPos = m_noDependency.indexOf( sProductName );
if ( nPos >= 0 )
{
- m_noDependency = m_noDependency.replaceAt( nPos, sProductName.getLength(), BrandName::get() );
+ m_noDependency = m_noDependency.replaceAt( nPos, sProductName.getLength(), utl::ConfigManager::getProductName() );
}
b.append(m_noInstall);
diff --git a/desktop/source/deployment/misc/dp_resource.cxx b/desktop/source/deployment/misc/dp_resource.cxx
index a20f1b3c56d8..89d3de3ef0fb 100644
--- a/desktop/source/deployment/misc/dp_resource.cxx
+++ b/desktop/source/deployment/misc/dp_resource.cxx
@@ -48,10 +48,7 @@ namespace {
struct OfficeLocale :
public rtl::StaticWithInit<OUString, OfficeLocale> {
const OUString operator () () {
- OUString slang;
- if (! (::utl::ConfigManager::GetDirectConfigProperty(
- ::utl::ConfigManager::LOCALE ) >>= slang))
- throw RuntimeException( OUSTR("Cannot determine language!"), 0 );
+ OUString slang(utl::ConfigManager::getLocale());
//fallback, the locale is currently only set when the user starts the
//office for the first time.
if (slang.getLength() == 0)
@@ -83,16 +80,8 @@ String getResourceString( sal_uInt16 id )
{
const osl::MutexGuard guard( s_mutex );
String ret( ResId( id, *DeploymentResMgr::get() ) );
- if (ret.SearchAscii( "%PRODUCTNAME" ) != STRING_NOTFOUND) {
- static String s_brandName;
- if (s_brandName.Len() == 0) {
- OUString brandName(
- ::utl::ConfigManager::GetDirectConfigProperty(
- ::utl::ConfigManager::PRODUCTNAME ).get<OUString>() );
- s_brandName = brandName;
- }
- ret.SearchAndReplaceAllAscii( "%PRODUCTNAME", s_brandName );
- }
+ ret.SearchAndReplaceAllAscii(
+ "%PRODUCTNAME", utl::ConfigManager::getProductName() );
return ret;
}