Kaydet (Commit) c1758889 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Heavily simplified utl::ConfigManager.

üst 4ffcc73f
......@@ -1717,13 +1717,9 @@ void SvxConfigPage::Reset( const SfxItemSet& )
if ( pModuleData != NULL )
{
OUString label;
utl::ConfigManager::GetDirectConfigProperty(
utl::ConfigManager::PRODUCTNAME ) >>= label;
label += OUString(RTL_CONSTASCII_USTRINGPARAM( " " ));
label += aModuleName;
nPos = aSaveInListBox.InsertEntry( label );
nPos = aSaveInListBox.InsertEntry(
utl::ConfigManager::getProductName() +
OUString( RTL_CONSTASCII_USTRINGPARAM( " " ) ) + aModuleName );
aSaveInListBox.SetEntryData( nPos, pModuleData );
}
......
......@@ -101,10 +101,8 @@ SvxEventConfigPage::SvxEventConfigPage( Window *pParent, const SfxItemSet& rSet,
if ( xSupplier.is() )
{
m_xAppEvents = xSupplier->getEvents();
OUString label;
utl::ConfigManager::GetDirectConfigProperty(
utl::ConfigManager::PRODUCTNAME ) >>= label;
nPos = aSaveInListBox.InsertEntry( label );
nPos = aSaveInListBox.InsertEntry(
utl::ConfigManager::getProductName() );
aSaveInListBox.SetEntryData( nPos, new bool(true) );
aSaveInListBox.SelectEntryPos( nPos, sal_True );
}
......
......@@ -114,9 +114,6 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId) :
m_aLinkStr(ResId( ABOUT_STR_LINK, *rId.GetResMgr())),
m_sBuildStr(ResId(ABOUT_STR_BUILD, *rId.GetResMgr()))
{
rtl::OUString sProduct;
utl::ConfigManager::GetDirectConfigProperty(utl::ConfigManager::PRODUCTNAME) >>= sProduct;
// load image from module path
aAppLogo = SfxApplication::GetApplicationLogo();
......@@ -162,8 +159,10 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId) :
rtl::OUStringBuffer sText(m_aVendorTextStr);
sText.appendAscii(RTL_CONSTASCII_STRINGPARAM("\n\n"));
sal_uInt32 nCopyrightId = sProduct.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("LibreOffice" )) ?
ABOUT_STR_COPYRIGHT : ABOUT_STR_COPYRIGHT_DERIVED;
sal_uInt32 nCopyrightId =
utl::ConfigManager::getProductName().equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM("LibreOffice"))
? ABOUT_STR_COPYRIGHT : ABOUT_STR_COPYRIGHT_DERIVED;
String aProductCopyrightTextStr(ResId(nCopyrightId, *rId.GetResMgr()));
sText.append(aProductCopyrightTextStr);
sText.appendAscii(RTL_CONSTASCII_STRINGPARAM("\n\n"));
......
......@@ -2586,7 +2586,7 @@ short OfaTreeOptionsDialog::Execute()
ApplyItemSets();
if( mpColorPage )
mpColorPage->SaveToViewFrame( SfxViewFrame::Current() );
utl::ConfigManager::GetConfigManager().StoreConfigItems();
utl::ConfigManager::storeConfigItems();
}
return nRet;
......
......@@ -34,18 +34,17 @@
#include <osl/diagnose.h>
#include <i18npool/mslangid.hxx>
#include <unotools/configmgr.hxx>
#include <comphelper/types.hxx>
using namespace ::utl;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
//--------------------------------------------------------------------------
UserInformation::UserInformation()
{
Any aValue = ConfigManager::GetDirectConfigProperty(ConfigManager::LOCALE);
LanguageType eLanguage = MsLangId::convertIsoStringToLanguage(comphelper::getString(aValue),'-');
m_aUserLocale = MsLangId::convertLanguageToLocale(eLanguage);
}
UserInformation::UserInformation():
m_aUserLocale(
MsLangId::convertLanguageToLocale(
MsLangId::convertIsoStringToLanguage(
ConfigManager::getLocale(), '-')))
{}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -456,13 +456,6 @@ struct SQLMessageBox_Impl
//------------------------------------------------------------------------------
namespace
{
::rtl::OUString lcl_getProductName()
{
::rtl::OUString sProductName;
OSL_VERIFY( ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME ) >>= sProductName );
return sProductName;
}
void lcl_positionInAppFont( const Window& _rParent, Window& _rChild, long _nX, long _nY, long _Width, long _Height )
{
Point aPos = _rParent.LogicToPixel( Point( _nX, _nY ), MAP_APPFONT );
......@@ -694,9 +687,9 @@ void OSQLMessageBox::impl_addDetailsButton()
//------------------------------------------------------------------------------
void OSQLMessageBox::Construct( WinBits _nStyle, MessageType _eImage )
{
// Changed as per BugID 79541 Branding/Configuration
String sDialogTitle( lcl_getProductName() );
SetText( sDialogTitle.AppendAscii( " Base" ) );
SetText(
utl::ConfigManager::getProductName() +
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " Base" ) ) );
// position and size the controls and the dialog, depending on whether we have one or two texts to display
impl_positionControls();
......
......@@ -1246,13 +1246,6 @@ void fillAutoIncrementValue(const Reference<XConnection>& _xConnection,
// -----------------------------------------------------------------------------
void AppendConfigToken( ::rtl::OUString& _rURL, sal_Bool _bQuestionMark )
{
Any aLocale =
::utl::ConfigManager::GetConfigManager().GetDirectConfigProperty( ::utl::ConfigManager::LOCALE );
::rtl::OUString sLocaleStr;
if ( !( aLocale >>= sLocaleStr ) )
// fallback is english
sLocaleStr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en"));
// query part exists?
if ( _bQuestionMark )
// no, so start with '?'
......@@ -1263,7 +1256,7 @@ void AppendConfigToken( ::rtl::OUString& _rURL, sal_Bool _bQuestionMark )
// set parameters
_rURL += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Language="));
_rURL += sLocaleStr;
_rURL += utl::ConfigManager::getLocale();
_rURL += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("&System="));
_rURL += SvtHelpOptions().GetSystem();
}
......
......@@ -133,7 +133,6 @@
#include <rtl/strbuf.hxx>
#include <rtl/bootstrap.hxx>
#include <rtl/instance.hxx>
#include <unotools/configmgr.hxx>
#include <vcl/help.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/bitmap.hxx>
......@@ -359,41 +358,24 @@ void ReplaceStringHookProc( UniString& rStr )
nAll++;
if ( rStr.SearchAscii( "%PRODUCT" ) != STRING_NOTFOUND )
{
String &rBrandName = BrandName::get();
String &rVersion = Version::get();
String &rAboutBoxVersion = AboutBoxVersion::get();
String &rExtension = Extension::get();
String &rXMLFileFormatName = XMLFileFormatName::get();
String &rXMLFileFormatVersion = XMLFileFormatVersion::get();
String rBrandName = BrandName::get();
String rVersion = Version::get();
String rAboutBoxVersion = AboutBoxVersion::get();
String rExtension = Extension::get();
String rXMLFileFormatName = XMLFileFormatName::get();
String rXMLFileFormatVersion = XMLFileFormatVersion::get();
if ( !rBrandName.Len() )
{
rtl::OUString aTmp;
Any aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME );
aRet >>= aTmp;
rBrandName = aTmp;
aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTXMLFILEFORMATNAME );
aRet >>= aTmp;
rXMLFileFormatName = aTmp;
aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTXMLFILEFORMATVERSION );
aRet >>= aTmp;
rXMLFileFormatVersion = aTmp;
aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTVERSION );
aRet >>= aTmp;
rVersion = aTmp;
aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::ABOUTBOXPRODUCTVERSION );
aRet >>= aTmp;
rAboutBoxVersion = aTmp;
rBrandName = utl::ConfigManager::getProductName();
rXMLFileFormatName = utl::ConfigManager::getProductXmlFileFormat();
rXMLFileFormatVersion =
utl::ConfigManager::getProductXmlFileFormatVersion();
rVersion = utl::ConfigManager::getProductVersion();
rAboutBoxVersion = utl::ConfigManager::getAboutBoxProductVersion();
if ( !rExtension.Len() )
{
aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTEXTENSION );
aRet >>= aTmp;
rExtension = aTmp;
rExtension = utl::ConfigManager::getProductExtension();
}
}
......@@ -407,30 +389,22 @@ void ReplaceStringHookProc( UniString& rStr )
}
if ( rStr.SearchAscii( "%OOOVENDOR" ) != STRING_NOTFOUND )
{
String &rOOOVendor = OOOVendor::get();
String rOOOVendor = OOOVendor::get();
if ( !rOOOVendor.Len() )
{
rtl::OUString aTmp;
Any aRet = ::utl::ConfigManager::GetDirectConfigProperty(
::utl::ConfigManager::OOOVENDOR );
aRet >>= aTmp;
rOOOVendor = aTmp;
rOOOVendor = utl::ConfigManager::getVendor();
}
rStr.SearchAndReplaceAllAscii( "%OOOVENDOR" ,rOOOVendor );
}
if ( rStr.SearchAscii( "%WRITERCOMPATIBILITYVERSIONOOO11" ) != STRING_NOTFOUND )
{
String &rWriterCompatibilityVersionOOo11 = WriterCompatibilityVersionOOo11::get();
String rWriterCompatibilityVersionOOo11 = WriterCompatibilityVersionOOo11::get();
if ( !rWriterCompatibilityVersionOOo11.Len() )
{
rtl::OUString aTmp;
Any aRet = ::utl::ConfigManager::GetDirectConfigProperty(
::utl::ConfigManager::WRITERCOMPATIBILITYVERSIONOOO11 );
aRet >>= aTmp;
rWriterCompatibilityVersionOOo11 = aTmp;
rWriterCompatibilityVersionOOo11 =
utl::ConfigManager::getWriterCompatibilityVersionOOo_1_1();
}
rStr.SearchAndReplaceAllAscii( "%WRITERCOMPATIBILITYVERSIONOOO11",
......@@ -792,7 +766,7 @@ void Desktop::DeInit()
try {
// instead of removing of the configManager just let it commit all the changes
RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- store config items" );
utl::ConfigManager::GetConfigManager().StoreConfigItems();
utl::ConfigManager::storeConfigItems();
FlushConfiguration();
RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- store config items" );
......@@ -822,7 +796,7 @@ sal_Bool Desktop::QueryExit()
try
{
RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- store config items" );
utl::ConfigManager::GetConfigManager().StoreConfigItems();
utl::ConfigManager::storeConfigItems();
RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- store config items" );
}
catch ( RuntimeException& )
......@@ -2065,18 +2039,14 @@ sal_Bool Desktop::InitializeConfiguration()
void Desktop::FlushConfiguration()
{
Reference < XFlushable > xCFGFlush( ::utl::ConfigManager::GetConfigManager().GetConfigurationProvider(), UNO_QUERY );
if (xCFGFlush.is())
{
xCFGFlush->flush();
}
else
{
// because there is no method to flush the condiguration data, we must dispose the ConfigManager
Reference < XComponent > xCFGDispose( ::utl::ConfigManager::GetConfigManager().GetConfigurationProvider(), UNO_QUERY );
if (xCFGDispose.is())
xCFGDispose->dispose();
}
css::uno::Reference< css::util::XFlushable >(
(css::uno::Reference< css::lang::XMultiServiceFactory >(
comphelper::getProcessServiceFactory(), css::uno::UNO_SET_THROW)->
createInstance(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.configuration.ConfigurationProvider")))),
css::uno::UNO_QUERY_THROW)->flush();
}
sal_Bool Desktop::shouldLaunchQuickstart()
......@@ -2620,19 +2590,15 @@ void Desktop::OpenClients()
aHelpURLBuffer.appendAscii("vnd.sun.star.help://smath/start");
}
if (bShowHelp) {
Help *pHelp = Application::GetHelp();
Any aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::LOCALE );
rtl::OUString aTmp;
aRet >>= aTmp;
aHelpURLBuffer.appendAscii("?Language=");
aHelpURLBuffer.append(aTmp);
aHelpURLBuffer.append(utl::ConfigManager::getLocale());
#if defined UNX
aHelpURLBuffer.appendAscii("&System=UNX");
#elif defined WNT
aHelpURLBuffer.appendAscii("&System=WIN");
#endif
pHelp->Start(aHelpURLBuffer.makeStringAndClear(), NULL);
Application::GetHelp()->Start(
aHelpURLBuffer.makeStringAndClear(), NULL);
return;
}
}
......
......@@ -826,11 +826,8 @@ void SAL_CALL OfficeIPCThread::run()
aHelpURLBuffer.appendAscii("vnd.sun.star.help://smath/start");
}
if (bShowHelp) {
Any aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::LOCALE );
rtl::OUString aTmp;
aRet >>= aTmp;
aHelpURLBuffer.appendAscii("?Language=");
aHelpURLBuffer.append(aTmp);
aHelpURLBuffer.append(utl::ConfigManager::getLocale());
#if defined UNX
aHelpURLBuffer.appendAscii("&System=UNX");
#elif defined WNT
......
......@@ -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
......
......@@ -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 );
}
}
......
......@@ -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:
......
......@@ -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);
......
......@@ -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;
}
......
......@@ -539,11 +539,6 @@ static FileBase::RC _checkAndCreateDirectory(INetURLObject& dirURL)
install_info MigrationImpl::findInstallation(const strings_v& rVersions)
{
rtl::OUString aProductName;
uno::Any aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME );
aRet >>= aProductName;
aProductName = aProductName.toAsciiLowerCase();
install_info aInfo;
strings_v::const_iterator i_ver = rVersions.begin();
while (i_ver != rVersions.end())
......@@ -556,9 +551,10 @@ install_info MigrationImpl::findInstallation(const strings_v& rVersions)
aProfileName = (*i_ver).copy( nSeparatorIndex+1 );
}
if ( aVersion.getLength() && aProfileName.getLength() &&
( !aInfo.userdata.getLength() || !aProfileName.toAsciiLowerCase().compareTo( aProductName, aProductName.getLength() ) )
)
if ( !aVersion.isEmpty() && !aProfileName.isEmpty() &&
( aInfo.userdata.isEmpty() ||
aProfileName.equalsIgnoreAsciiCase(
utl::ConfigManager::getProductName() ) ) )
{
::rtl::OUString aUserInst;
osl::Security().getConfigDir( aUserInst );
......
......@@ -65,18 +65,6 @@ using ::rtl::OUString;
namespace {
//==============================================================================
struct OfficeLocale :
public rtl::StaticWithInit<lang::Locale, OfficeLocale> {
const lang::Locale operator () () {
OUString slang;
if (! (::utl::ConfigManager::GetDirectConfigProperty(
::utl::ConfigManager::LOCALE ) >>= slang))
throw RuntimeException( OUSTR("Cannot determine language!"), 0 );
return toLocale(slang);
}
};
//==============================================================================
class CommandEnvironmentImpl
: public ::cppu::WeakImplHelper3< XCommandEnvironment,
......@@ -189,7 +177,8 @@ void CommandEnvironmentImpl::printLicense(
->createInstanceWithContext(
OUSTR("com.sun.star.i18n.Collator"),m_xComponentContext),
UNO_QUERY_THROW );
xCollator->loadDefaultCollator(OfficeLocale::get(),
xCollator->loadDefaultCollator(
toLocale(utl::ConfigManager::getLocale()),
css::i18n::CollatorOptions::CollatorOptions_IGNORE_CASE);
do
......
......@@ -511,8 +511,7 @@ Reference<XComponentContext> getUNO(
NULL );
{
WarningBox warn(NULL, WB_OK | WB_DEF_OK, sMsg);
warn.SetText(::utl::ConfigManager::GetDirectConfigProperty(
::utl::ConfigManager::PRODUCTNAME).get<OUString>());
warn.SetText(utl::ConfigManager::getProductName());
warn.SetIcon(0);
warn.Execute();
}
......
......@@ -54,24 +54,11 @@ namespace unopkg {
return locale;
}
struct OfficeLocale :
public rtl::StaticWithInit<css::lang::Locale, OfficeLocale> {
const css::lang::Locale operator () () {
::rtl::OUString slang;
if (! (::utl::ConfigManager::GetDirectConfigProperty(
::utl::ConfigManager::LOCALE ) >>= slang))
throw css::uno::RuntimeException( OUSTR("Cannot determine language!"), 0 );
if (slang.getLength() == 0)
slang = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en-US"));
return toLocale(slang);
}
};
struct DeploymentResMgr : public rtl::StaticWithInit< ResMgr *, DeploymentResMgr >
{
ResMgr * operator () () {
return ResMgr::CreateResMgr( "deployment", OfficeLocale::get());
return ResMgr::CreateResMgr(
"deployment", toLocale( utl::ConfigManager::getLocale() ) );
}
};
......
......@@ -484,15 +484,9 @@ void PSWriter::ImplWriteProlog( const Graphic* pPreview )
ImplWriteLine( "%%Pages: 0" );
::rtl::OUStringBuffer aCreator;
aCreator.appendAscii( RTL_CONSTASCII_STRINGPARAM( "%%Creator: " ) );
::utl::ConfigManager& rMgr = ::utl::ConfigManager::GetConfigManager();
Any aProductName = rMgr.GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME );
::rtl::OUString sProductName;
aProductName >>= sProductName;
aCreator.append( sProductName );
aProductName = rMgr.GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTVERSION );
aProductName >>= sProductName;
aCreator.append( utl::ConfigManager::getProductName() );
aCreator.appendAscii( RTL_CONSTASCII_STRINGPARAM( " " ) );
aCreator.append( sProductName );
aCreator.append( utl::ConfigManager::getProductVersion() );
ImplWriteLine( ::rtl::OUStringToOString( aCreator.makeStringAndClear(), RTL_TEXTENCODING_UTF8 ).getStr() );
ImplWriteLine( "%%Title: none" );
ImplWriteLine( "%%CreationDate: none" );
......
......@@ -444,19 +444,10 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
}
}
// getting the string for the producer
String aProducer;
{
::utl::ConfigManager& cMgr = ::utl::ConfigManager::GetConfigManager();
Any aProductName = cMgr.GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME );
::rtl::OUString sProductName;
aProductName >>= sProductName;
aProducer = sProductName;
aProductName = cMgr.GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTVERSION );
aProductName >>= sProductName;
aProducer.AppendAscii(" ");
aProducer += String( sProductName );
}
aContext.DocumentInfo.Producer = aProducer;
aContext.DocumentInfo.Producer =
utl::ConfigManager::getProductName() +
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ")) +
utl::ConfigManager::getProductVersion();
aContext.DocumentInfo.Creator = aCreator;
for( sal_Int32 nData = 0, nDataCount = rFilterData.getLength(); nData < nDataCount; ++nData )
......
......@@ -542,28 +542,23 @@ void TitleHelper::impl_appendComponentTitle ( ::rtl::OUStringBuffer&
//*****************************************************************************************************************
void TitleHelper::impl_appendProductName (::rtl::OUStringBuffer& sTitle)
{
::rtl::OUString sProductName;
::utl::ConfigManager::GetDirectConfigProperty(::utl::ConfigManager::PRODUCTNAME) >>= sProductName;
if (sProductName.getLength ())