[Libreoffice-commits] .: cui/source dbaccess/source desktop/source filter/source framework/source hwpfilter/CppunitTest_hwpfilter_test_hwpfilter.mk hwpfilter/prj lotuswordpro/CppunitTest_lotuswordpro_test_lotuswordpro.mk lotuswordpro/prj padmin/source sc/CppunitTest_sc_ucalc.mk sd/CppunitTest_sd_uimpress.mk sd/prj sfx2/source svl/source svtools/CppunitTest_svtools_filters_test.mk svtools/prj svtools/source sw/CppunitTest_sw_filters_test.mk sw/CppunitTest_sw_swdoc_test.mk sw/prj sw/source tail_build/prj toolkit/source unotools/inc unotools/source uui/source vcl/source writerfilter/CppunitTest_writerfilter_rtftok.mk writerfilter/prj xmlhelp/source

Stephan Bergmann sbergmann at kemper.freedesktop.org
Fri Nov 11 13:49:47 PST 2011


 cui/source/customize/cfg.cxx                               |   10 
 cui/source/customize/eventdlg.cxx                          |    6 
 cui/source/dialogs/about.cxx                               |    9 
 cui/source/options/treeopt.cxx                             |    2 
 dbaccess/source/core/misc/userinformation.cxx              |   13 
 dbaccess/source/ui/dlg/sqlmessage.cxx                      |   13 
 dbaccess/source/ui/misc/UITools.cxx                        |    9 
 desktop/source/app/app.cxx                                 |   96 -
 desktop/source/app/officeipcthread.cxx                     |    5 
 desktop/source/deployment/gui/dp_gui_dialog2.cxx           |   15 
 desktop/source/deployment/gui/dp_gui_service.cxx           |   54 
 desktop/source/deployment/gui/dp_gui_shared.hxx            |    8 
 desktop/source/deployment/gui/dp_gui_updatedialog.cxx      |    5 
 desktop/source/deployment/misc/dp_resource.cxx             |   17 
 desktop/source/migration/migration.cxx                     |   12 
 desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx             |   15 
 desktop/source/pkgchk/unopkg/unopkg_misc.cxx               |    3 
 desktop/source/pkgchk/unopkg/unopkg_shared.h               |   17 
 filter/source/graphicfilter/eps/eps.cxx                    |   10 
 filter/source/pdf/pdfexport.cxx                            |   17 
 framework/source/fwe/helper/titlehelper.cxx                |   23 
 framework/source/helper/titlebarupdate.cxx                 |    6 
 framework/source/services/autorecovery.cxx                 |    3 
 framework/source/services/substitutepathvars.cxx           |    5 
 framework/source/uielement/uicommanddescription.cxx        |    9 
 hwpfilter/CppunitTest_hwpfilter_test_hwpfilter.mk          |    2 
 hwpfilter/prj/build.lst                                    |    2 
 lotuswordpro/CppunitTest_lotuswordpro_test_lotuswordpro.mk |    7 
 lotuswordpro/prj/build.lst                                 |    2 
 padmin/source/padialog.cxx                                 |    6 
 padmin/source/pamain.cxx                                   |   11 
 sc/CppunitTest_sc_ucalc.mk                                 |    2 
 sd/CppunitTest_sd_uimpress.mk                              |    5 
 sd/prj/build.lst                                           |    2 
 sfx2/source/appl/appinit.cxx                               |    2 
 sfx2/source/appl/sfxhelp.cxx                               |    7 
 sfx2/source/doc/doctemplates.cxx                           |    5 
 sfx2/source/view/viewfrm2.cxx                              |    5 
 svl/source/config/itemholder2.cxx                          |    1 
 svtools/CppunitTest_svtools_filters_test.mk                |    5 
 svtools/prj/build.lst                                      |    2 
 svtools/source/config/itemholder2.cxx                      |    1 
 svtools/source/dialogs/insdlg.cxx                          |   24 
 svtools/source/filter/FilterConfigItem.cxx                 |    5 
 sw/CppunitTest_sw_filters_test.mk                          |    2 
 sw/CppunitTest_sw_swdoc_test.mk                            |    2 
 sw/prj/build.lst                                           |    2 
 sw/source/filter/ww8/rtfexport.cxx                         |    4 
 sw/source/ui/config/optcomp.cxx                            |   30 
 sw/source/ui/config/optload.cxx                            |   27 
 sw/source/ui/misc/outline.cxx                              |   18 
 tail_build/prj/build.lst                                   |    2 
 toolkit/source/controls/unocontrolmodel.cxx                |    7 
 unotools/inc/unotools/configitem.hxx                       |    2 
 unotools/inc/unotools/configmgr.hxx                        |  152 +-
 unotools/source/config/configitem.cxx                      |  102 -
 unotools/source/config/configmgr.cxx                       |  786 ++-----------
 unotools/source/config/defaultoptions.cxx                  |    1 
 unotools/source/config/docinfohelper.cxx                   |   18 
 unotools/source/config/itemholder1.cxx                     |    1 
 unotools/source/config/pathoptions.cxx                     |   21 
 unotools/source/config/useroptions.cxx                     |   14 
 uui/source/iahndl.cxx                                      |   41 
 vcl/source/app/settings.cxx                                |   39 
 writerfilter/CppunitTest_writerfilter_rtftok.mk            |    2 
 writerfilter/prj/build.lst                                 |    2 
 xmlhelp/source/cxxhelp/provider/provider.cxx               |   11 
 xmlhelp/source/treeview/tvread.cxx                         |    5 
 68 files changed, 473 insertions(+), 1296 deletions(-)

New commits:
commit c1758889cbd5e8e4afb1044425c908715eb3e1cd
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Nov 11 22:48:37 2011 +0100

    Heavily simplified utl::ConfigManager.

diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 0fae48f..de19df3 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -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 );
         }
 
diff --git a/cui/source/customize/eventdlg.cxx b/cui/source/customize/eventdlg.cxx
index 7b4c04e..2fbb572 100644
--- a/cui/source/customize/eventdlg.cxx
+++ b/cui/source/customize/eventdlg.cxx
@@ -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 );
     }
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index b987b4a..0355574 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -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"));
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 89855ac..d5f4881 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -2586,7 +2586,7 @@ short OfaTreeOptionsDialog::Execute()
         ApplyItemSets();
         if( mpColorPage )
             mpColorPage->SaveToViewFrame( SfxViewFrame::Current() );
-        utl::ConfigManager::GetConfigManager().StoreConfigItems();
+        utl::ConfigManager::storeConfigItems();
     }
 
     return nRet;
diff --git a/dbaccess/source/core/misc/userinformation.cxx b/dbaccess/source/core/misc/userinformation.cxx
index 27ea6bb..03b51c9 100644
--- a/dbaccess/source/core/misc/userinformation.cxx
+++ b/dbaccess/source/core/misc/userinformation.cxx
@@ -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: */
diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx
index 80a1378..3abbc27 100644
--- a/dbaccess/source/ui/dlg/sqlmessage.cxx
+++ b/dbaccess/source/ui/dlg/sqlmessage.cxx
@@ -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();
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index 19687ae..b0d2dfc 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -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();
 }
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 1555510..38ba4db 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -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;
         }
     }
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
index d9273c0..6d42f7b 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -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
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index a0768dd..1cc397b 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 38c081b..71ee6c4 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 3e2db45..bc2e08e 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 f0b3f41..bf31cf1 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 a20f1b3..89d3de3 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;
 }
 
diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx
index 906f034..f242c34 100644
--- a/desktop/source/migration/migration.cxx
+++ b/desktop/source/migration/migration.cxx
@@ -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 );
diff --git a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
index 1732b3f..4c9bd17 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
@@ -66,18 +66,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,
                                       task::XInteractionHandler,
@@ -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
diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
index a2c9baf..84b0b0a 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
@@ -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();
                 }
diff --git a/desktop/source/pkgchk/unopkg/unopkg_shared.h b/desktop/source/pkgchk/unopkg/unopkg_shared.h
index feffd89..c8de646 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_shared.h
+++ b/desktop/source/pkgchk/unopkg/unopkg_shared.h
@@ -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() ) );
     }
 };
 
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index 369c50f..d53200c 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -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" );
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 302909f..b183108 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -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 )
diff --git a/framework/source/fwe/helper/titlehelper.cxx b/framework/source/fwe/helper/titlehelper.cxx
index 7b39cf0..2a444dd 100644
--- a/framework/source/fwe/helper/titlehelper.cxx
+++ b/framework/source/fwe/helper/titlehelper.cxx
@@ -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 ())
+    rtl::OUString name(utl::ConfigManager::getProductName());
+    if (!name.isEmpty())
     {
-        if (sTitle.getLength() > 0)
-            sTitle.appendAscii (" - ");
-
-        sTitle.append (sProductName);
+        if (sTitle.getLength() != 0)
+            sTitle.appendAscii(RTL_CONSTASCII_STRINGPARAM(" - "));
+        sTitle.append(name);
     }
 }
 
 //*****************************************************************************************************************
 void TitleHelper::impl_appendProductExtension (::rtl::OUStringBuffer& sTitle)
 {
-    ::rtl::OUString sProductExtension;
-    ::utl::ConfigManager::GetDirectConfigProperty(::utl::ConfigManager::PRODUCTEXTENSION) >>= sProductExtension;
-
-    if (sProductExtension.getLength ())
+    rtl::OUString ext(utl::ConfigManager::getProductExtension());
+    if (!ext.isEmpty())
     {
-        sTitle.appendAscii (" ");
-        sTitle.append      (sProductExtension);
+        sTitle.append(' ');
+        sTitle.append(ext);
     }
 }
 
diff --git a/framework/source/helper/titlebarupdate.cxx b/framework/source/helper/titlebarupdate.cxx
index 832c56b..ff5914a 100644
--- a/framework/source/helper/titlebarupdate.cxx
+++ b/framework/source/helper/titlebarupdate.cxx
@@ -187,9 +187,6 @@ void TitleBarUpdate::impl_updateApplicationID(const css::uno::Reference< css::fr
     ::rtl::OUString sApplicationID;
     try
     {
-        ::rtl::OUString aProductName;
-        ::utl::ConfigManager::GetDirectConfigProperty(::utl::ConfigManager::PRODUCTNAME) >>= aProductName;
-
         // SYNCHRONIZED ->
         ReadGuard aReadLock(m_aLock);
         css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
@@ -231,7 +228,8 @@ void TitleBarUpdate::impl_updateApplicationID(const css::uno::Reference< css::fr
             sDesktopName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("startcenter"));
         else
             sDesktopName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("startcenter"));
-        sApplicationID = aProductName.toAsciiLowerCase();
+        sApplicationID = utl::ConfigManager::getProductName().
+            toAsciiLowerCase();
         sApplicationID += ::rtl::OUString(sal_Unicode('-'));
         sApplicationID += sDesktopName;
     }
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index 3455daf..7d79f40 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -3621,8 +3621,7 @@ void AutoRecovery::impl_flushALLConfigChanges()
 
         // SOLAR SAFE ->
         SolarMutexGuard aGuard;
-        ::utl::ConfigManager& rCfgMgr = ::utl::ConfigManager::GetConfigManager();
-        rCfgMgr.StoreConfigItems();
+        ::utl::ConfigManager::storeConfigItems();
     }
     catch(const css::uno::Exception&)
         {}
diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx
index d7e45ef..0958fdc 100644
--- a/framework/source/services/substitutepathvars.cxx
+++ b/framework/source/services/substitutepathvars.cxx
@@ -1220,9 +1220,8 @@ void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariable
 
     // Detect the language type of the current office
     aPreDefPathVariables.m_eLanguageType = LANGUAGE_ENGLISH_US;
-    rtl::OUString aLocaleStr;
-    if ( utl::ConfigManager::GetConfigManager().GetDirectConfigProperty( utl::ConfigManager::LOCALE ) >>= aLocaleStr )
-        aPreDefPathVariables.m_eLanguageType = MsLangId::convertIsoStringToLanguage( aLocaleStr );
+    rtl::OUString aLocaleStr( utl::ConfigManager::getLocale() );
+    aPreDefPathVariables.m_eLanguageType = MsLangId::convertIsoStringToLanguage( aLocaleStr );
     // We used to have an else branch here with a LOG_ERROR, but that
     // always fired in some unit tests when this code was built with
     // debug=t, so it seems fairly pointless, especially as
diff --git a/framework/source/uielement/uicommanddescription.cxx b/framework/source/uielement/uicommanddescription.cxx
index 6702612..a57618e 100644
--- a/framework/source/uielement/uicommanddescription.cxx
+++ b/framework/source/uielement/uicommanddescription.cxx
@@ -187,7 +187,6 @@ class ConfigurationAccess_UICommand : // Order is neccessary for right initializ
         rtl::OUString                     m_aPropName;
         rtl::OUString                     m_aPropPopup;
         rtl::OUString                     m_aPropProperties;
-        rtl::OUString                     m_aBrandName;
         rtl::OUString                     m_aXMLFileFormatVersion;
         rtl::OUString                     m_aVersion;
         rtl::OUString                     m_aExtension;
@@ -236,10 +235,6 @@ ConfigurationAccess_UICommand::ConfigurationAccess_UICommand( const rtl::OUStrin
 
     m_aConfigPopupAccess += aModuleName;
     m_aConfigPopupAccess += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CONFIGURATION_POP_ELEMENT_ACCESS ));
-
-    rtl::OUString aTmp;
-    ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME ) >>= aTmp;
-    m_aBrandName = aTmp;
 }
 
 ConfigurationAccess_UICommand::~ConfigurationAccess_UICommand()
@@ -330,8 +325,8 @@ throw ( RuntimeException )
 void ConfigurationAccess_UICommand::fillInfoFromResult( CmdToInfoMap& rCmdInfo, const rtl::OUString& aLabel )
 {
     String rStr( aLabel );
-    if ( rStr.SearchAscii( "%PRODUCT" ) != STRING_NOTFOUND )
-        rStr.SearchAndReplaceAllAscii( "%PRODUCTNAME", m_aBrandName );
+    rStr.SearchAndReplaceAllAscii(
+        "%PRODUCTNAME", utl::ConfigManager::getProductName() );
     rCmdInfo.aLabel       = ::rtl::OUString( rStr );
     rStr.EraseTrailingChars( '.' ); // Remove "..." from string
     rCmdInfo.aCommandName = ::rtl::OUString( MnemonicGenerator::EraseAllMnemonicChars( rStr ));
diff --git a/hwpfilter/CppunitTest_hwpfilter_test_hwpfilter.mk b/hwpfilter/CppunitTest_hwpfilter_test_hwpfilter.mk
index bf633e4..41d82a0 100644
--- a/hwpfilter/CppunitTest_hwpfilter_test_hwpfilter.mk
+++ b/hwpfilter/CppunitTest_hwpfilter_test_hwpfilter.mk
@@ -67,12 +67,14 @@ $(eval $(call gb_CppunitTest_add_components,hwpfilter_test_hwpfilter,\
     hwpfilter/source/hwp \
 ))
 $(eval $(call gb_CppunitTest_add_old_components,hwpfilter_test_hwpfilter,\
+    configmgr \
     ucb1 \
     ucpfile1 \
 ))
 
 $(eval $(call gb_CppunitTest_set_args,hwpfilter_test_hwpfilter,\
     --protector unoexceptionprotector$(gb_Library_DLLEXT) unoexceptionprotector \
+    "-env:CONFIGURATION_LAYERS=xcsxcu:$(call gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry)" \
 ))
 
 # we need to explicitly depend on library hwp because it is not implied
diff --git a/hwpfilter/prj/build.lst b/hwpfilter/prj/build.lst
index 5eb7992..84f7864 100644
--- a/hwpfilter/prj/build.lst
+++ b/hwpfilter/prj/build.lst
@@ -1,2 +1,2 @@
-hw	hwpfilter	:	offapi cppuhelper ZLIB:zlib LIBXSLT:libxslt ucbhelper ucb ure test NULL
+hw	hwpfilter	:	offapi configmgr cppuhelper ZLIB:zlib LIBXSLT:libxslt ucbhelper ucb ure test NULL
 hw	hwpfilter\prj	nmake	-	all	hw_prj NULL
diff --git a/lotuswordpro/CppunitTest_lotuswordpro_test_lotuswordpro.mk b/lotuswordpro/CppunitTest_lotuswordpro_test_lotuswordpro.mk
index 6b55f2b..362ca4d 100644
--- a/lotuswordpro/CppunitTest_lotuswordpro_test_lotuswordpro.mk
+++ b/lotuswordpro/CppunitTest_lotuswordpro_test_lotuswordpro.mk
@@ -67,9 +67,16 @@ $(eval $(call gb_CppunitTest_add_components,lotuswordpro_test_lotuswordpro,\
     lotuswordpro/util/lwpfilter,\
 ))
 
+$(eval $(call gb_CppunitTest_add_old_components,lotuswordpro_test_lotuswordpro,\
+    configmgr \
+    ucb1 \
+    ucpfile1 \
+))
+
 $(eval $(call gb_CppunitTest_set_args,lotuswordpro_test_lotuswordpro,\
     --headless \
     --protector unoexceptionprotector$(gb_Library_DLLEXT) unoexceptionprotector \
+    "-env:CONFIGURATION_LAYERS=xcsxcu:$(call gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry)" \
 ))
 
 # we need to explicitly depend on library lwpft because it is not implied
diff --git a/lotuswordpro/prj/build.lst b/lotuswordpro/prj/build.lst
index f6c70c5..28f4d84 100644
--- a/lotuswordpro/prj/build.lst
+++ b/lotuswordpro/prj/build.lst
@@ -1,2 +1,2 @@
-wp	lotuswordpro : sfx2 sot svx comphelper BOOST:boost ure test NULL
+wp	lotuswordpro : sfx2 sot svx comphelper configmgr BOOST:boost ure test NULL
 wp	lotuswordpro\prj	nmake	-	all	lwp_prj NULL
diff --git a/padmin/source/padialog.cxx b/padmin/source/padialog.cxx
index 67b84a4..67a2bd1 100644
--- a/padmin/source/padialog.cxx
+++ b/padmin/source/padialog.cxx
@@ -417,12 +417,6 @@ void SpaPrinterController::printPage( int ) const
 
     pPrinter->SetMapMode( aMapMode );
 
-    Any aRet = utl::ConfigManager::GetDirectConfigProperty( utl::ConfigManager::PRODUCTNAME );
-    OUString aJobName;
-    aRet >>= aJobName;
-
-    aJobName = aJobName + OUString( RTL_CONSTASCII_USTRINGPARAM( " Testpage" ) );
-
     Size aPaperSize=pPrinter->GetOutputSize();
     Point aCenter( aPaperSize.Width()/2-300,
                    aPaperSize.Height() - aPaperSize.Width()/2 );
diff --git a/padmin/source/pamain.cxx b/padmin/source/pamain.cxx
index 63c46fd..71ee0e7 100644
--- a/padmin/source/pamain.cxx
+++ b/padmin/source/pamain.cxx
@@ -71,15 +71,8 @@ MyApp aMyApp;
 
 void MyApp::ReadStringHook( String& rStr )
 {
-    static String maProduct;
-    if( ! maProduct.Len() )
-    {
-        Any aRet = utl::ConfigManager::GetDirectConfigProperty( utl::ConfigManager::PRODUCTNAME );
-        OUString aProd;
-        aRet >>= aProd;
-        maProduct = String( aProd );
-    }
-    rStr.SearchAndReplaceAllAscii( "%PRODUCTNAME", maProduct );
+    rStr.SearchAndReplaceAllAscii(
+        "%PRODUCTNAME", utl::ConfigManager::getProductName() );
 };
 
 
diff --git a/sc/CppunitTest_sc_ucalc.mk b/sc/CppunitTest_sc_ucalc.mk
index 6f0f583..22eb247 100644
--- a/sc/CppunitTest_sc_ucalc.mk
+++ b/sc/CppunitTest_sc_ucalc.mk
@@ -102,6 +102,7 @@ $(eval $(call gb_CppunitTest_add_components,sc_ucalc,\
 ))
 
 $(eval $(call gb_CppunitTest_add_old_components,sc_ucalc,\
+    configmgr \
     ucb1 \
     ucpfile1 \
 ))
@@ -109,6 +110,7 @@ $(eval $(call gb_CppunitTest_add_old_components,sc_ucalc,\
 $(eval $(call gb_CppunitTest_set_args,sc_ucalc,\
     --headless \
     --protector unoexceptionprotector$(gb_Library_DLLEXT) unoexceptionprotector \
+    "-env:CONFIGURATION_LAYERS=xcsxcu:$(call gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry)" \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/sd/CppunitTest_sd_uimpress.mk b/sd/CppunitTest_sd_uimpress.mk
index 8b8d909..2b162c2 100644
--- a/sd/CppunitTest_sd_uimpress.mk
+++ b/sd/CppunitTest_sd_uimpress.mk
@@ -91,9 +91,14 @@ $(eval $(call gb_CppunitTest_add_components,sd_uimpress,\
     i18npool/util/i18npool \
 ))
 
+$(eval $(call gb_CppunitTest_add_old_components,sd_uimpress,\
+    configmgr \
+))
+
 $(eval $(call gb_CppunitTest_set_args,sd_uimpress,\
     --headless \
     --protector unoexceptionprotector$(gb_Library_DLLEXT) unoexceptionprotector \
+    "-env:CONFIGURATION_LAYERS=xcsxcu:$(call gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry)" \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/sd/prj/build.lst b/sd/prj/build.lst
index 91456d3..3b37cc6 100644
--- a/sd/prj/build.lst
+++ b/sd/prj/build.lst
@@ -1,3 +1,3 @@
-sd      sd      :    filter TRANSLATIONS:translations animations svx sfx2 stoc canvas embeddedobj LIBXSLT:libxslt oox ure test xmloff NULL
+sd      sd      :    filter TRANSLATIONS:translations animations configmgr svx sfx2 stoc canvas embeddedobj LIBXSLT:libxslt oox ure test xmloff NULL
 sd	sd										usr1	-	all	sd_mkout NULL
 sd	sd\prj									nmake		-	all	sd_prj NULL
diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx
index 598f412..6c5f7d5 100644
--- a/sfx2/source/appl/appinit.cxx
+++ b/sfx2/source/appl/appinit.cxx
@@ -127,7 +127,7 @@ void SAL_CALL SfxTerminateListener_Impl::notifyTermination( const EventObject& a
         xDesktop->removeTerminateListener( this );
 
     SolarMutexGuard aGuard;
-    utl::ConfigManager::GetConfigManager().StoreConfigItems();
+    utl::ConfigManager::storeConfigItems();
 
     SfxApplication* pApp = SFX_APP();
     pApp->Broadcast( SfxSimpleHint( SFX_HINT_DEINITIALIZING ) );
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index ff92bf9..e362382 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -123,14 +123,11 @@ static bool impl_hasHelpInstalled( const rtl::OUString &rLang );
 static rtl::OUString HelpLocaleString()
 {
     static rtl::OUString aLocaleStr;
-    if (!aLocaleStr.getLength())
+    if (aLocaleStr.isEmpty())
     {
         const rtl::OUString aEnglish( RTL_CONSTASCII_USTRINGPARAM( "en" ) );
         // detect installed locale
-        Any aLocale =
-            ::utl::ConfigManager::GetConfigManager().GetDirectConfigProperty(
-               ::utl::ConfigManager::LOCALE );
-        aLocale >>= aLocaleStr;
+        aLocaleStr = utl::ConfigManager::getLocale();
         bool bOk = aLocaleStr.getLength() != 0;
         if ( !bOk )
             aLocaleStr = aEnglish;
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index dedc88f..2e64e66 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -504,10 +504,7 @@ void SfxDocTplService_Impl::getDefaultLocale()
         ::osl::MutexGuard aGuard( maMutex );
         if ( !mbLocaleSet )
         {
-            rtl::OUString aLocale;
-            utl::ConfigManager::GetDirectConfigProperty( utl::ConfigManager::LOCALE )
-                >>= aLocale;
-
+            rtl::OUString aLocale( utl::ConfigManager::getLocale() );
             if ( aLocale.getLength() > 0 )
             {
                 sal_Int32 nPos = aLocale.indexOf( sal_Unicode( '-' ) );
diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx
index e032069..33923eb 100644
--- a/sfx2/source/view/viewfrm2.cxx
+++ b/sfx2/source/view/viewfrm2.cxx
@@ -236,11 +236,8 @@ String SfxViewFrame::UpdateTitle()
     GetBindings().Invalidate( SID_FRAMETITLE );
     GetBindings().Invalidate( SID_CURRENT_URL );
 
-    ::rtl::OUString aProductName;
-    ::utl::ConfigManager::GetDirectConfigProperty(::utl::ConfigManager::PRODUCTNAME) >>= aProductName;
-
     aTitle += String::CreateFromAscii( " - " );
-    aTitle += String(aProductName);
+    aTitle += utl::ConfigManager::getProductName();
     aTitle += ' ';
     ::rtl::OUString aDocServiceName( GetObjectShell()->GetFactory().GetDocumentServiceName() );
     aTitle += String( GetModuleName_Impl( aDocServiceName ) );
diff --git a/svl/source/config/itemholder2.cxx b/svl/source/config/itemholder2.cxx
index cf486f3..8a8549b 100644
--- a/svl/source/config/itemholder2.cxx
+++ b/svl/source/config/itemholder2.cxx
@@ -64,7 +64,6 @@ ItemHolder2::ItemHolder2()
         if (xCfg.is())
             xCfg->addEventListener(static_cast< css::lang::XEventListener* >(this));
     }
-// #i37892  got errorhandling from   ConfigManager::GetConfigurationProvider()
     catch(css::uno::RuntimeException& rREx)
     {
         throw rREx;
diff --git a/svtools/CppunitTest_svtools_filters_test.mk b/svtools/CppunitTest_svtools_filters_test.mk
index 3ccbd5d..48c39f4 100644
--- a/svtools/CppunitTest_svtools_filters_test.mk
+++ b/svtools/CppunitTest_svtools_filters_test.mk
@@ -63,9 +63,14 @@ $(eval $(call gb_CppunitTest_add_type_rdbs,svtools_filters_test,\
     types \
 ))
 
+$(eval $(call gb_CppunitTest_add_old_components,svtools_filters_test,\
+    configmgr \
+))
+
 $(eval $(call gb_CppunitTest_set_args,svtools_filters_test,\
     --headless \
     --protector unoexceptionprotector$(gb_Library_DLLEXT) unoexceptionprotector \
+    "-env:CONFIGURATION_LAYERS=xcsxcu:$(call gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry)" \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/svtools/prj/build.lst b/svtools/prj/build.lst
index d18c9f9..b18ec97 100644
--- a/svtools/prj/build.lst
+++ b/svtools/prj/build.lst
@@ -1,2 +1,2 @@
-st	svtools	:	TRANSLATIONS:translations svl offapi toolkit ucbhelper unotools JPEG:jpeg cppu cppuhelper comphelper sal salhelper sot jvmfwk LIBXSLT:libxslt ure test NULL
+st	svtools	:	TRANSLATIONS:translations svl offapi toolkit ucbhelper unotools JPEG:jpeg cppu cppuhelper comphelper configmgr sal salhelper sot jvmfwk LIBXSLT:libxslt ure test NULL
 st	svtools\prj					        nmake	-	all	st_prj NULL
diff --git a/svtools/source/config/itemholder2.cxx b/svtools/source/config/itemholder2.cxx
index 74766fa..dadb1d6 100644
--- a/svtools/source/config/itemholder2.cxx
+++ b/svtools/source/config/itemholder2.cxx
@@ -71,7 +71,6 @@ ItemHolder2::ItemHolder2()
         if (xCfg.is())
             xCfg->addEventListener(static_cast< css::lang::XEventListener* >(this));
     }
-// #i37892  got errorhandling from   ConfigManager::GetConfigurationProvider()
     catch(css::uno::RuntimeException& rREx)
     {
         throw rREx;
diff --git a/svtools/source/dialogs/insdlg.cxx b/svtools/source/dialogs/insdlg.cxx
index 7d6bcb9..79e5a6f 100644
--- a/svtools/source/dialogs/insdlg.cxx
+++ b/svtools/source/dialogs/insdlg.cxx
@@ -157,22 +157,6 @@ void SvObjectServerList::FillInsertObjects()
                 ::rtl::OUString aStringProductVersion( RTL_CONSTASCII_USTRINGPARAM( "%PRODUCTVERSION" ) );
                 sal_Int32 nStringProductVersionLength = aStringProductVersion.getLength();
 
-                // TODO/LATER: Do the request only once ( needs incompatible change )
-                ::rtl::OUString aProductName;
-                ::rtl::OUString aProductVersion;
-                uno::Any aProperty =
-                    ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME );
-                if ( !( aProperty >>= aProductName ) )
-                {
-                    OSL_FAIL( "Coudn't get PRODUCTNAME variable!\n" );
-                    aProductName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StarOffice" ) );
-                }
-                aProperty = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTVERSION );
-                if ( !( aProperty >>= aProductVersion ) )
-                {
-                    OSL_FAIL( "Coudn't get PRODUCTVERSION variable!\n" );
-                }
-
                 for( nInd = 0; nInd < seqNames.getLength(); nInd++ )
                 {
                     uno::Reference< container::XNameAccess > xEntry ;
@@ -190,7 +174,9 @@ void SvObjectServerList::FillInsertObjects()
                             sal_Int32 nIndex = aUIName.indexOf( aStringProductName );
                             while( nIndex != -1 )
                             {
-                                aUIName = aUIName.replaceAt( nIndex, nStringProductNameLength, aProductName );
+                                aUIName = aUIName.replaceAt(
+                                    nIndex, nStringProductNameLength,
+                                    utl::ConfigManager::getProductName() );
                                 nIndex = aUIName.indexOf( aStringProductName );
                             }
 
@@ -198,7 +184,9 @@ void SvObjectServerList::FillInsertObjects()
                             nIndex = aUIName.indexOf( aStringProductVersion );
                             while( nIndex != -1 )
                             {
-                                aUIName = aUIName.replaceAt( nIndex, nStringProductVersionLength, aProductVersion );
+                                aUIName = aUIName.replaceAt(
+                                    nIndex, nStringProductVersionLength,
+                                    utl::ConfigManager::getProductVersion() );
                                 nIndex = aUIName.indexOf( aStringProductVersion );
                             }
                         }
diff --git a/svtools/source/filter/FilterConfigItem.cxx b/svtools/source/filter/FilterConfigItem.cxx
index bbe40a0..c6dbc51 100644
--- a/svtools/source/filter/FilterConfigItem.cxx
+++ b/svtools/source/filter/FilterConfigItem.cxx
@@ -121,8 +121,6 @@ void FilterConfigItem::ImpInitTree( const String& rSubTree )
 {
     bModified = sal_False;
 
-    OUString sTree( ConfigManager::GetConfigBaseURL() );
-    sTree += rSubTree;
     Reference< XMultiServiceFactory > xSMGR = getProcessServiceFactory();   // get global uno service manager
 
     Reference< XMultiServiceFactory > xCfgProv(
@@ -131,6 +129,9 @@ void FilterConfigItem::ImpInitTree( const String& rSubTree )
 
     if ( xCfgProv.is() )
     {
+        OUString sTree(
+            OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.")) +
+            rSubTree);
         if ( ImpIsTreeAvailable( xCfgProv, String( sTree ) ) )
         {
             Any aAny;
diff --git a/sw/CppunitTest_sw_filters_test.mk b/sw/CppunitTest_sw_filters_test.mk
index 500405f..4aa77a4 100644
--- a/sw/CppunitTest_sw_filters_test.mk
+++ b/sw/CppunitTest_sw_filters_test.mk
@@ -96,6 +96,7 @@ $(eval $(call gb_CppunitTest_add_components,sw_filters_test,\
 ))
 
 $(eval $(call gb_CppunitTest_add_old_components,sw_filters_test,\
+    configmgr \
     ucb1 \
     ucpfile1 \
 ))
@@ -103,6 +104,7 @@ $(eval $(call gb_CppunitTest_add_old_components,sw_filters_test,\
 $(eval $(call gb_CppunitTest_set_args,sw_filters_test,\
     --headless \
     --protector unoexceptionprotector$(gb_Library_DLLEXT) unoexceptionprotector \
+    "-env:CONFIGURATION_LAYERS=xcsxcu:$(call gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry)" \
 ))
 
 # we need to explicitly depend on library msword because it is not implied
diff --git a/sw/CppunitTest_sw_swdoc_test.mk b/sw/CppunitTest_sw_swdoc_test.mk
index 0290889..f3f44bb 100644
--- a/sw/CppunitTest_sw_swdoc_test.mk
+++ b/sw/CppunitTest_sw_swdoc_test.mk
@@ -104,6 +104,7 @@ $(eval $(call gb_CppunitTest_add_components,sw_swdoc_test,\
 ))
 
 $(eval $(call gb_CppunitTest_add_old_components,sw_swdoc_test,\
+    configmgr \
     ucb1 \
     ucpfile1 \
 ))
@@ -114,6 +115,7 @@ $(call gb_CppunitTest_get_target,sw_swdoc_test) : \
 $(eval $(call gb_CppunitTest_set_args,sw_swdoc_test,\
     --headless \
     --protector unoexceptionprotector$(gb_Library_DLLEXT) unoexceptionprotector \
+    "-env:CONFIGURATION_LAYERS=xcsxcu:$(call gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry)" \
 ))
 
 # we need to explicitly depend on the sw resource files needed at unit-test
diff --git a/sw/prj/build.lst b/sw/prj/build.lst
index 75c602e..e2d759d 100644
--- a/sw/prj/build.lst
+++ b/sw/prj/build.lst
@@ -1,2 +1,2 @@
-sw      sw      :    filter TRANSLATIONS:translations connectivity writerperfect vbahelper svx stoc writerfilter unoxml fileaccess package forms toolkit dbaccess comphelper LIBXSLT:libxslt test NULL
+sw      sw      :    filter TRANSLATIONS:translations configmgr connectivity writerperfect vbahelper svx stoc writerfilter unoxml fileaccess package forms toolkit dbaccess comphelper LIBXSLT:libxslt test NULL
 sw sw\prj nmake - all sw_prj   NULL
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index efc597d..a36f233 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -441,9 +441,7 @@ void RtfExport::WriteInfo()
     }
 
     Strm() << '{' << OOO_STRING_SVTOOLS_RTF_COMMENT << " ";
-    OUString sProduct;
-    utl::ConfigManager::GetDirectConfigProperty(utl::ConfigManager::PRODUCTNAME) >>= sProduct;
-    Strm() << OUStringToOString( sProduct, eCurrentEncoding).getStr() << "}{" << OOO_STRING_SVTOOLS_RTF_VERN;
+    Strm() << OUStringToOString( utl::ConfigManager::getProductName(), eCurrentEncoding).getStr() << "}{" << OOO_STRING_SVTOOLS_RTF_VERN;
     OutULong( SUPD*10 ) << '}';
     Strm() << '}';
 }
diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx
index 9b4de6e..acd941f 100644
--- a/sw/source/ui/config/optcomp.cxx
+++ b/sw/source/ui/config/optcomp.cxx
@@ -191,24 +191,18 @@ void SwCompatibilityOptPage::ReplaceFormatName( String& rEntry )
     static const String sOpenOfficeName = String::CreateFromAscii("OpenOffice.org");
     static const String sAsianName = String::CreateFromAscii("StarSuite");
 
-    Any aAny = ::utl::ConfigManager::
-        GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME );
-    rtl::OUString sTmp;
-    if ( aAny >>= sTmp )
-    {
-        String sFormatName = sTmp;
-        String sFormatVersion;
-        bool bOpenOffice = ( sOpenOfficeName == sFormatName );
-        if ( bOpenOffice )
-            sFormatVersion = String::CreateFromAscii("1.1");
-        else
-            sFormatVersion = String::CreateFromAscii("6.0/7");
-        if ( !bOpenOffice && ( sAsianName != sFormatName ) )
-            sFormatName = String::CreateFromAscii("StarOffice");
-
-        rEntry.SearchAndReplace( String::CreateFromAscii("%FORMATNAME"), sFormatName );
-        rEntry.SearchAndReplace( String::CreateFromAscii("%FORMATVERSION"), sFormatVersion );
-    }
+    String sFormatName( utl::ConfigManager::getProductName() );
+    String sFormatVersion;
+    bool bOpenOffice = ( sOpenOfficeName == sFormatName );
+    if ( bOpenOffice )
+        sFormatVersion = String::CreateFromAscii("1.1");
+    else
+        sFormatVersion = String::CreateFromAscii("6.0/7");
+    if ( !bOpenOffice && ( sAsianName != sFormatName ) )
+        sFormatName = String::CreateFromAscii("StarOffice");
+
+    rEntry.SearchAndReplace( String::CreateFromAscii("%FORMATNAME"), sFormatName );
+    rEntry.SearchAndReplace( String::CreateFromAscii("%FORMATVERSION"), sFormatVersion );
 }
 
 sal_uLong convertBools2Ulong_Impl
diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index c95cf60..2729c3a 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -554,29 +554,10 @@ void SwCaptionOptPage::Reset( const SfxItemSet& rSet)
     SetOptions(nPos++, GRAPHIC_CAP);
 
     // get Productname and -version
-    String sComplete, sWithoutVersion;
-    ::rtl::OUString sTemp;
-    uno::Any aAny =
-        ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME );
-    if ( aAny >>= sTemp )
-    {
-        sComplete = sTemp;
-        sWithoutVersion = sTemp;
-        aAny = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTVERSION );
-        if ( !( aAny >>= sTemp ) )
-        {
-            OSL_FAIL("Couldn't get PRODUCTVERSION variable" );
-        }
-        else
-        {
-            sComplete += ' ';
-            sComplete += String( sTemp );
-        }
-    }
-    else
-    {
-        OSL_FAIL("Couldn't get PRODUCTNAME variable" );
-    }
+    rtl::OUString sWithoutVersion( utl::ConfigManager::getProductName() );
+    rtl::OUString sComplete(
+        sWithoutVersion + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ")) +
+        utl::ConfigManager::getProductVersion() );
 
     SvObjectServerList aObjS;
     aObjS.FillInsertObjects();
diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index d4e734e..01a5521 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -1153,19 +1153,11 @@ void    NumberingPreview::Paint( const Rectangle& /*rRect*/ )
                     nPreNum++;
                 }
                 pVDev->SetFont(aStdFont);
-
-                // Changed as per BugID 79541 Branding/Configuration
-                uno::Any MyAny = ::utl::ConfigManager::GetConfigManager().
-                        GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME );
-                ::rtl::OUString aProductName;
-
-                MyAny >>= aProductName;
-                String sMsg(C2S("%PRODUCTNAME"));
-                sMsg.SearchAndReplaceAscii( "%PRODUCTNAME" , aProductName );
-
-                if(pOutlineNames)
-                    sMsg = pOutlineNames[nLevel];
-                pVDev->DrawText( Point(nXStart + nTextOffset, nYStart), sMsg );
+                pVDev->DrawText(
+                    Point(nXStart + nTextOffset, nYStart),
+                    (pOutlineNames == 0
+                     ? utl::ConfigManager::getProductName()
+                     : rtl::OUString(pOutlineNames[nLevel])));
             }
         }
     }
diff --git a/tail_build/prj/build.lst b/tail_build/prj/build.lst
index 16df54b..01e2633 100644
--- a/tail_build/prj/build.lst
+++ b/tail_build/prj/build.lst
@@ -1,2 +1,2 @@
-tb      tail_build : APACHE_COMMONS:apache-commons BSH:beanshell BERKELEYDB:berkeleydb BOOST:boost l10ntools LIBXML2:libxml2 LIBXMLSEC:libxmlsec LIBXSLT:libxslt LIBWPG:libwpg LIBWPS:libwps LIBWPD:libwpd LIBVISIO:libvisio LPSOLVE:lpsolve MDDS:mdds NEON:neon NSS:nss OPENSSL:openssl PYTHON:python REDLAND:redland SAXON:saxon TRANSLATIONS:translations XPDF:xpdf avmedia basegfx basic bridges canvas comphelper connectivity cppcanvas cppu cppuhelper fpicker javaunohelper jurt jvmaccess offapi officecfg oovbaapi qadevOOo DESKTOP:rdbmaker readlicense_oo rhino ridljar sal sax sfx2 solenv soltools sot stoc svtools svx sysui test toolkit tools ucbhelper udkapi unoil unotools ure vcl xmlhelp xmloff xmlscript xsltml NULL
+tb      tail_build : APACHE_COMMONS:apache-commons BSH:beanshell BERKELEYDB:berkeleydb BOOST:boost l10ntools LIBXML2:libxml2 LIBXMLSEC:libxmlsec LIBXSLT:libxslt LIBWPG:libwpg LIBWPS:libwps LIBWPD:libwpd LIBVISIO:libvisio LPSOLVE:lpsolve MDDS:mdds NEON:neon NSS:nss OPENSSL:openssl PYTHON:python REDLAND:redland SAXON:saxon TRANSLATIONS:translations XPDF:xpdf avmedia basegfx basic bridges canvas comphelper configmgr connectivity cppcanvas cppu cppuhelper fpicker javaunohelper jurt jvmaccess offapi officecfg oovbaapi qadevOOo DESKTOP:rdbmaker readlicense_oo rhino ridljar sal sax sfx2 solenv soltools sot stoc svtools svx sysui test toolkit tools ucbhelper udkapi unoil unotools ure vcl xmlhelp xmloff xmlscript xsltml NULL
 tb tail_build\prj nmake - all tb_prj   NULL
diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx
index a101d9f..cba70c1 100644
--- a/toolkit/source/controls/unocontrolmodel.cxx
+++ b/toolkit/source/controls/unocontrolmodel.cxx
@@ -391,11 +391,8 @@ sal_Bool UnoControlModel::ImplHasProperty( sal_uInt16 nPropId ) const
             break;
             case BASEPROPERTY_CURRENCYSYMBOL:
             {
-                Any aDefaultCurrency = ::utl::ConfigManager::GetDirectConfigProperty(::utl::ConfigManager::DEFAULTCURRENCY);
-                DBG_ASSERT( TypeClass_STRING == aDefaultCurrency.getValueTypeClass(), "UnoControlModel::ImplGetDefaultValue: invalid currency config value!" );
-
-                ::rtl::OUString sDefaultCurrency;
-                aDefaultCurrency >>= sDefaultCurrency;
+                rtl::OUString sDefaultCurrency(
+                    utl::ConfigManager::getDefaultCurrency() );
 
                 // extract the bank symbol
                 sal_Int32 nSepPos = sDefaultCurrency.indexOf( '-' );
diff --git a/unotools/inc/unotools/configitem.hxx b/unotools/inc/unotools/configitem.hxx
index 1b1558d..fe3a0e9 100644
--- a/unotools/inc/unotools/configitem.hxx
+++ b/unotools/inc/unotools/configitem.hxx
@@ -58,8 +58,6 @@ namespace utl
 #define CONFIG_MODE_DELAYED_UPDATE      0x01
 #define CONFIG_MODE_ALL_LOCALES         0x02
 #define CONFIG_MODE_RELEASE_TREE        0x04
-#define CONFIG_MODE_IGNORE_ERRORS       0x08 // prevent assertions, if creation fails
-#define CONFIG_MODE_PROPAGATE_ERRORS    0x10 // throw exceptions, if creation fails
 
     enum  ConfigNameFormat
     {
diff --git a/unotools/inc/unotools/configmgr.hxx b/unotools/inc/unotools/configmgr.hxx
index 61bcac6..1ac1868 100644
--- a/unotools/inc/unotools/configmgr.hxx
+++ b/unotools/inc/unotools/configmgr.hxx
@@ -26,92 +26,76 @@
  *
  ************************************************************************/
 
-#ifndef _UTL_CONFIGMGR_HXX_
-#define _UTL_CONFIGMGR_HXX_
+#ifndef INCLUDED_UNOTOOLS_CONFIGMGR_HXX
+#define INCLUDED_UNOTOOLS_CONFIGMGR_HXX
 
-#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/uno/Any.hxx>
-#include <rtl/ustring.hxx>
+#include "sal/config.h"
+
+#include <list>
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "sal/types.h"
 #include "unotools/unotoolsdllapi.h"
 
-//-----------------------------------------------------------------------------
-namespace com{ namespace sun{ namespace star{
-    namespace lang{
-        class XMultiServiceFactory;
-    }
-    namespace container{
-        class XHierarchicalNameAccess;
-    }
-}}}
-
-//-----------------------------------------------------------------------------
-namespace utl
-{
-    struct ConfigMgr_Impl;
-    class ConfigItem;
-    class UNOTOOLS_DLLPUBLIC ConfigManager
-    {
-            ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
-                                xConfigurationProvider;
-            ConfigMgr_Impl*     pMgrImpl;
-
-            static void getBasisAboutBoxProductVersion( rtl::OUString& rVersion );
-
-        public:
-            ConfigManager();
-            ConfigManager(com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xConfigProvider);
-            ~ConfigManager();
-
-            ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
-                GetConfigurationProvider();
-
-            ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
-                GetLocalConfigurationProvider();
-
-            com::sun::star::uno::Reference< com::sun::star::container::XHierarchicalNameAccess>
-                AddConfigItem(utl::ConfigItem& rCfgItem);
-
-            void RegisterConfigItem(utl::ConfigItem& rCfgItem);
-            com::sun::star::uno::Reference< com::sun::star::container::XHierarchicalNameAccess>
-                AcquireTree(utl::ConfigItem& rCfgItem);
-
-
-            void RemoveConfigItem(utl::ConfigItem& rCfgItem);
-
-            void StoreConfigItems();
-
-            static ConfigManager&           GetConfigManager();
-            static rtl::OUString            GetConfigBaseURL();
-
-            enum ConfigProperty
-            {
-                INSTALLPATH,        // deprecated. don't use
-                LOCALE,
-                OFFICEINSTALL,      // deprecated. don't use
-                USERINSTALLURL,     // deprecated. don't use
-                OFFICEINSTALLURL,   // deprecated. don't use
-                PRODUCTNAME,
-                PRODUCTVERSION,
-                PRODUCTEXTENSION,
-                DEFAULTCURRENCY,
-                PRODUCTXMLFILEFORMATNAME,
-                PRODUCTXMLFILEFORMATVERSION,
-                WRITERCOMPATIBILITYVERSIONOOO11,
-                OPENSOURCECONTEXT,
-                ABOUTBOXPRODUCTVERSION,
-                OOOVENDOR
-            };
-            //direct readonly access to some special configuration elements
-            static com::sun::star::uno::Any GetDirectConfigProperty(ConfigProperty eProp);
-
-            sal_Bool        IsLocalConfigProvider();
-            com::sun::star::uno::Reference< com::sun::star::container::XHierarchicalNameAccess>
-                GetHierarchyAccess(const rtl::OUString& rFullPath);
-            com::sun::star::uno::Any GetLocalProperty(const rtl::OUString& rProperty);
-            void PutLocalProperty(const rtl::OUString& , const com::sun::star::uno::Any& rValue);
-
-    };
-}//namespace utl
-#endif //_UTL_CONFIGMGR_HXX_
+namespace com { namespace sun { namespace star {
+    namespace container{ class XHierarchicalNameAccess; }
+} } }
+namespace rtl { class OUString; }
+namespace utl { class ConfigItem; }
+
+namespace utl {
+
+class UNOTOOLS_DLLPUBLIC ConfigManager: private boost::noncopyable {
+public:
+    static rtl::OUString getAboutBoxProductVersion();
+
+    static rtl::OUString getDefaultCurrency();
+
+    static rtl::OUString getLocale();
+
+    static rtl::OUString getProductExtension();
+
+    static rtl::OUString getProductName();
+
+    static rtl::OUString getProductXmlFileFormat();
+
+    static rtl::OUString getProductXmlFileFormatVersion();
+
+    static rtl::OUString getProductVersion();
+
+    static rtl::OUString getVendor();
+
+    static rtl::OUString getWriterCompatibilityVersionOOo_1_1();
+
+    static void storeConfigItems();
+
+    SAL_DLLPRIVATE static ConfigManager & getConfigManager();
+
+    SAL_DLLPRIVATE static com::sun::star::uno::Reference<
+        com::sun::star::container::XHierarchicalNameAccess>
+    acquireTree(utl::ConfigItem & item);
+
+    SAL_DLLPRIVATE ConfigManager();
+
+    SAL_DLLPRIVATE ~ConfigManager();
+
+    SAL_DLLPRIVATE com::sun::star::uno::Reference<
+        com::sun::star::container::XHierarchicalNameAccess >
+    addConfigItem(utl::ConfigItem & item);
+
+    SAL_DLLPRIVATE void removeConfigItem(utl::ConfigItem & item);
+
+    SAL_DLLPRIVATE void registerConfigItem(utl::ConfigItem * item);
+
+private:
+    void doStoreConfigItems();
+
+    std::list< ConfigItem * > items_;
+};
+
+}
+
+#endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/configitem.cxx b/unotools/source/config/configitem.cxx
index d0b2921..a0200e6 100644
--- a/unotools/source/config/configitem.cxx
+++ b/unotools/source/config/configitem.cxx
@@ -225,21 +225,19 @@ ConfigItem::ConfigItem(const OUString &rSubTree, sal_Int16 nSetMode ) :
 {
     AutoDeleter<ConfigItem_Impl> aNewImpl(pImpl);
 
-    pImpl->pManager = &ConfigManager::GetConfigManager();
+    pImpl->pManager = &ConfigManager::getConfigManager();
     pImpl->nMode = nSetMode;
     if(0 != (nSetMode&CONFIG_MODE_RELEASE_TREE))
-        pImpl->pManager->AddConfigItem(*this);
+        pImpl->pManager->addConfigItem(*this);
     else
-        m_xHierarchyAccess = pImpl->pManager->AddConfigItem(*this);
+        m_xHierarchyAccess = pImpl->pManager->addConfigItem(*this);
 
-    // no more exceptions after c'tor has finished
     aNewImpl.keep();
-    pImpl->nMode &= ~CONFIG_MODE_PROPAGATE_ERRORS;
 }
 
 sal_Bool ConfigItem::IsValidConfigMgr() const
 {
-    return ( pImpl->pManager && pImpl->pManager->GetConfigurationProvider().is() );
+    return pImpl->pManager != 0;
 }
 
 ConfigItem::~ConfigItem()
@@ -247,7 +245,7 @@ ConfigItem::~ConfigItem()
     if(pImpl->pManager)
     {
         RemoveChangesListener();
-        pImpl->pManager->RemoveConfigItem(*this);
+        pImpl->pManager->removeConfigItem(*this);
     }
     delete pImpl;
 }
@@ -278,29 +276,6 @@ void ConfigItem::CallNotify( const com::sun::star::uno::Sequence<OUString>& rPro
         Notify(rPropertyNames);
 }
 
-sal_Bool lcl_IsLocalProperty(const OUString& rSubTree, const OUString& rProperty)
-{
-    static const sal_Char* aLocalProperties[] =
-    {
-        "Office.Common/Path/Current/Storage",
-        "Office.Common/Path/Current/Temp"
-    };
-    static const int aLocalPropLen[] =
-    {
-        34,
-        31
-    };
-    OUString sProperty(rSubTree);
-    sProperty += C2U("/");
-    sProperty += rProperty;
-
-    if(sProperty.equalsAsciiL( aLocalProperties[0], aLocalPropLen[0]) ||
-        sProperty.equalsAsciiL( aLocalProperties[1], aLocalPropLen[1]))
-        return sal_True;
-
-    return sal_False;
-}
-
 void ConfigItem::impl_packLocalizedProperties(  const   Sequence< OUString >&   lInNames    ,
                                                 const   Sequence< Any >&        lInValues   ,
                                                         Sequence< Any >&        lOutValues  )
@@ -471,12 +446,6 @@ Sequence< sal_Bool > ConfigItem::GetReadOnlyStates(const com::sun::star::uno::Se
     {
         try
         {
-            if(pImpl->pManager->IsLocalConfigProvider() && lcl_IsLocalProperty(sSubTree, rNames[i]))
-            {
-                OSL_FAIL("ConfigItem::IsReadonly()\nlocal mode seams to be used!?\n");
-                continue;
-            }
-
             OUString sName = rNames[i];
             OUString sPath;
             OUString sProperty;
@@ -546,15 +515,7 @@ Sequence< Any > ConfigItem::GetProperties(const Sequence< OUString >& rNames)
         {
             try
             {
-                if(pImpl->pManager->IsLocalConfigProvider() && lcl_IsLocalProperty(sSubTree, pNames[i]))
-                {
-                    OUString sProperty(sSubTree);
-                    sProperty += C2U("/");
-                    sProperty += pNames[i];
-                    pRet[i] = pImpl->pManager->GetLocalProperty(sProperty);
-                }
-                else
-                    pRet[i] = xHierarchyAccess->getByHierarchicalName(pNames[i]);
+                pRet[i] = xHierarchyAccess->getByHierarchicalName(pNames[i]);
             }
             catch (const Exception& rEx)
             {
@@ -563,10 +524,7 @@ Sequence< Any > ConfigItem::GetProperties(const Sequence< OUString >& rNames)
                 sMsg += OString(rEx.Message.getStr(),
                     rEx.Message.getLength(),
                      RTL_TEXTENCODING_ASCII_US);
-                sMsg += OString("\n");
-                sMsg += OString(ConfigManager::GetConfigBaseURL().getStr(),
-                    ConfigManager::GetConfigBaseURL().getLength(),
-                     RTL_TEXTENCODING_ASCII_US);
+                sMsg += OString("\n/org.openoffice.");
                 sMsg += OString(sSubTree.getStr(),
                     sSubTree.getLength(),
                      RTL_TEXTENCODING_ASCII_US);
@@ -627,43 +585,33 @@ sal_Bool ConfigItem::PutProperties( const Sequence< OUString >& rNames,
         }
         for(int i = 0; i < nNameCount; i++)
         {
-            if(pImpl->pManager->IsLocalConfigProvider() && lcl_IsLocalProperty(sSubTree, pNames[i]))
-            {
-                OUString sProperty(sSubTree);
-                sProperty += C2U("/");
-                sProperty += pNames[i];
-                pImpl->pManager->PutLocalProperty(sProperty, pValues[i]);
-            }
-            else
+            try
             {
-                try
+                OUString sNode, sProperty;
+                if (splitLastFromConfigurationPath(pNames[i],sNode, sProperty))
                 {
-                    OUString sNode, sProperty;
-                    if (splitLastFromConfigurationPath(pNames[i],sNode, sProperty))
-                    {
-                        Any aNode = xHierarchyAccess->getByHierarchicalName(sNode);
+                    Any aNode = xHierarchyAccess->getByHierarchicalName(sNode);
 
-                        Reference<XNameAccess> xNodeAcc;
-                        aNode >>= xNodeAcc;
-                        Reference<XNameReplace>   xNodeReplace(xNodeAcc, UNO_QUERY);
-                        Reference<XNameContainer> xNodeCont   (xNodeAcc, UNO_QUERY);
+                    Reference<XNameAccess> xNodeAcc;
+                    aNode >>= xNodeAcc;
+                    Reference<XNameReplace>   xNodeReplace(xNodeAcc, UNO_QUERY);
+                    Reference<XNameContainer> xNodeCont   (xNodeAcc, UNO_QUERY);
 
-                        sal_Bool bExist = (xNodeAcc.is() && xNodeAcc->hasByName(sProperty));
-                        if (bExist && xNodeReplace.is())
-                            xNodeReplace->replaceByName(sProperty, pValues[i]);
-                        else
+                    sal_Bool bExist = (xNodeAcc.is() && xNodeAcc->hasByName(sProperty));
+                    if (bExist && xNodeReplace.is())
+                        xNodeReplace->replaceByName(sProperty, pValues[i]);
+                    else
                         if (!bExist && xNodeCont.is())
                             xNodeCont->insertByName(sProperty, pValues[i]);
                         else
                             bRet = sal_False;
-                    }
-                    else //direct value
-                    {
-                        xTopNodeReplace->replaceByName(sProperty, pValues[i]);
-                    }
                 }
-                CATCH_INFO("Exception from PutProperties: ");
+                else //direct value
+                {
+                    xTopNodeReplace->replaceByName(sProperty, pValues[i]);
+                }
             }
+            CATCH_INFO("Exception from PutProperties: ");
         }
         try
         {
@@ -1314,7 +1262,7 @@ Reference< XHierarchicalNameAccess> ConfigItem::GetTree()
 {
     Reference< XHierarchicalNameAccess> xRet;
     if(!m_xHierarchyAccess.is())
-        xRet = pImpl->pManager->AcquireTree(*this);
+        xRet = ConfigManager::acquireTree(*this);
     else
         xRet = m_xHierarchyAccess;
     return xRet;
diff --git a/unotools/source/config/configmgr.cxx b/unotools/source/config/configmgr.cxx
index 00e4614..e11b99d 100644
--- a/unotools/source/config/configmgr.cxx
+++ b/unotools/source/config/configmgr.cxx
@@ -26,693 +26,225 @@
  *
  ************************************************************************/
 
-// MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_unotools.hxx"
-#include "unotools/configmgr.hxx"
-#include "unotools/configitem.hxx"
-#include "unotools/configpathes.hxx"
-#include <unotools/processfactory.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <osl/diagnose.h>
-#include <rtl/bootstrap.hxx>
-#include <rtl/instance.hxx>
-#if OSL_DEBUG_LEVEL > 0
-#include <rtl/strbuf.hxx>
-#endif
+#include "sal/config.h"
 
 #include <list>
 
-#include <stdio.h>
-
-//-----------------------------------------------------------------------------
-
-using namespace utl;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::beans;
-using namespace com::sun::star::container;
-
-using ::rtl::OUString;
-#if OSL_DEBUG_LEVEL > 0
-using ::rtl::OString;
-#endif
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/beans/NamedValue.hpp"
+#include "com/sun/star/container/XHierarchicalNameAccess.hpp"
+#include "com/sun/star/lang/XMultiServiceFactory.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "osl/diagnose.h"
+#include "rtl/instance.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "unotools/configitem.hxx"
+#include "unotools/configmgr.hxx"
+#include "unotools/processfactory.hxx"
 
-#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s))
+namespace {
 
-//-----------------------------------------------------------------------------
-const char aConfigBaseURL[] = "/org.openoffice.";
-const char aAccessSrvc[] = "com.sun.star.configuration.ConfigurationUpdateAccess";
+namespace css = com::sun::star;
 
-namespace
-{
-    struct BrandName
-        : public rtl::Static< ::rtl::OUString, BrandName > {};
-    struct ProductVersion
-        : public rtl::Static< ::rtl::OUString, ProductVersion > {};
-    struct AboutBoxProductVersion
-        : public rtl::Static< ::rtl::OUString, AboutBoxProductVersion > {};
-    struct OOOVendor
-        : public rtl::Static< ::rtl::OUString, OOOVendor > {};
-    struct ProductExtension
-        : public rtl::Static< ::rtl::OUString, ProductExtension > {};
-    struct XMLFileFormatName
-        : public rtl::Static< ::rtl::OUString, XMLFileFormatName > {};
-    struct XMLFileFormatVersion
-        : public rtl::Static< ::rtl::OUString, XMLFileFormatVersion > {};
-    struct WriterCompatibilityVersionOOo11
-        : public rtl::Static< ::rtl::OUString, WriterCompatibilityVersionOOo11 > {};
-    struct OpenSourceContext : public rtl::StaticWithInit< sal_Int32, OpenSourceContext >
+class RegisterConfigItemHelper: private boost::noncopyable {
+public:
+    RegisterConfigItemHelper(
+        utl::ConfigManager & manager, utl::ConfigItem & item):
+            manager_(manager), item_(&item)
     {
-        sal_Int32 operator() () { return sal_Int32( -1 ); }
-    };
+        manager.registerConfigItem(item_);
+    }
 
-}
+    ~RegisterConfigItemHelper() {
+        if (item_ != 0) {
+            manager_.removeConfigItem(*item_);
+        }
+    }
 
-//-----------------------------------------------------------------------------
-struct ConfigItemListEntry_Impl
-{
-    ConfigItem*                 pConfigItem;
+    void keep() { item_ = 0; }
 
-    ConfigItemListEntry_Impl(ConfigItem*    pItem ) :
-        pConfigItem(pItem){}
-};
-typedef std::list<ConfigItemListEntry_Impl> ConfigItemList;
-struct utl::ConfigMgr_Impl
-{
-    ConfigItemList                          aItemList;
+private:
+    utl::ConfigManager & manager_;
+    utl::ConfigItem * item_;
 };
 
-ConfigManager::ConfigManager() :
-    pMgrImpl(new utl::ConfigMgr_Impl)
-{
-    GetConfigurationProvider(); // attempt to create the provider early
+css::uno::Reference< css::lang::XMultiServiceFactory >
+getConfigurationProvider() {
+    return css::uno::Reference< css::lang::XMultiServiceFactory >(
+        (css::uno::Reference< css::lang::XMultiServiceFactory >(
+            utl::getProcessServiceFactory(), css::uno::UNO_SET_THROW)->
+         createInstance(
+             rtl::OUString(
+                 RTL_CONSTASCII_USTRINGPARAM(
+                     "com.sun.star.configuration.ConfigurationProvider")))),
+        css::uno::UNO_QUERY_THROW);
 }
 
-ConfigManager::ConfigManager(Reference< XMultiServiceFactory > xConfigProv) :
-    xConfigurationProvider(xConfigProv),
-    pMgrImpl(new utl::ConfigMgr_Impl)
+rtl::OUString getConfigurationString(
+    rtl::OUString const & module, rtl::OUString const & path)
 {
+    css::uno::Sequence< css::uno::Any > args(1);
+    args[0] <<= css::beans::NamedValue(
+        rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")),
+        css::uno::makeAny(module));
+    return
+        css::uno::Reference< css::container::XHierarchicalNameAccess >(
+            getConfigurationProvider()->createInstanceWithArguments(
+                rtl::OUString(
+                    RTL_CONSTASCII_USTRINGPARAM(
+                        "com.sun.star.configuration.ConfigurationAccess")),
+                args),
+            css::uno::UNO_QUERY_THROW)->
+        getByHierarchicalName(path).get< rtl::OUString >();
 }
 
-ConfigManager::~ConfigManager()
-{
-    //check list content -> should be empty!
-#if OSL_DEBUG_LEVEL > 0
-    if(!pMgrImpl->aItemList.empty())
-    {
-        ConfigItemList::iterator aListIter;
-        for (aListIter = pMgrImpl->aItemList.begin(); aListIter != pMgrImpl->aItemList.end(); ++aListIter)
-        {
-            ConfigItemListEntry_Impl& rEntry = *aListIter;
-            fprintf(stderr, "Dangling config item of %s\n", rtl::OUStringToOString(rEntry.pConfigItem->GetSubTreeName(), RTL_TEXTENCODING_UTF8).getStr());
-        }
-    }
-#endif
-    OSL_ENSURE(pMgrImpl->aItemList.empty(), "some ConfigItems are still alive");
-    if(!pMgrImpl->aItemList.empty())
-    {
-        ConfigItemList::iterator aListIter;
-        for(aListIter = pMgrImpl->aItemList.begin(); aListIter != pMgrImpl->aItemList.end(); ++aListIter)
-        {
-            ConfigItemListEntry_Impl& rEntry = *aListIter;
-            rEntry.pConfigItem->ReleaseConfigMgr();
-        }
-        pMgrImpl->aItemList.erase(pMgrImpl->aItemList.begin(), pMgrImpl->aItemList.end());
-    }
-    delete pMgrImpl;
+struct theConfigManager:
+    public rtl::Static< utl::ConfigManager, theConfigManager >
+{};
 
 }
 
-Reference< XMultiServiceFactory > ConfigManager::GetConfigurationProvider()
-{
-    if(!xConfigurationProvider.is())
-    {
-        Reference< XMultiServiceFactory > xMSF = ::utl::getProcessServiceFactory();
-        if ( xMSF.is() )
-        {
-            try
-            {
-                xConfigurationProvider = Reference< XMultiServiceFactory >
-                    (xMSF->createInstance(
-                        UNISTRING("com.sun.star.configuration.ConfigurationProvider")),
-                     UNO_QUERY);
-            }
-#if OSL_DEBUG_LEVEL > 1
-            catch (const Exception& rEx)
-            {
-                static sal_Bool bMessage = sal_True;
-                if(bMessage)
-                {
-                    bMessage = sal_False;
-                    OString sMsg("CreateInstance with arguments exception: ");
-                    sMsg += OString(rEx.Message.getStr(),
-                                rEx.Message.getLength(),
-                                RTL_TEXTENCODING_ASCII_US);
-                    OSL_FAIL(sMsg.getStr());
-                }
-            }
-#else
-            catch (const Exception&)
-            {
-            }
-#endif
-        }
-    }
-    return xConfigurationProvider;
+rtl::OUString utl::ConfigManager::getAboutBoxProductVersion() {
+    return getConfigurationString(
+        rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup")),
+        rtl::OUString(
+            RTL_CONSTASCII_USTRINGPARAM("Product/ooSetupVersionAboutBox")));
 }
 
-namespace
-{
-    // helper to achieve exception - safe registration of a ConfigItem under construction
-    class RegisterConfigItemHelper // : Noncopyable
-    {
-        utl::ConfigManager & rCfgMgr;
-        utl::ConfigItem* pCfgItem;
-    public:
-        RegisterConfigItemHelper(utl::ConfigManager & rMgr, utl::ConfigItem& rCfgItem)
-        : rCfgMgr(rMgr)
-        , pCfgItem(&rCfgItem)
-        {
-            rCfgMgr.RegisterConfigItem(rCfgItem);
-        }
-
-        ~RegisterConfigItemHelper()
-        {
-            if (pCfgItem) rCfgMgr.RemoveConfigItem(*pCfgItem);
-        }
-
-        void keep() { pCfgItem = 0; }
-    };
+rtl::OUString utl::ConfigManager::getDefaultCurrency() {
+    return getConfigurationString(
+        rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup")),
+        rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("L10N/ooSetupCurrency")));
 }
 
-Reference< XMultiServiceFactory > ConfigManager::GetLocalConfigurationProvider()
-{
-    return GetConfigurationProvider();
+rtl::OUString utl::ConfigManager::getLocale() {
+    return getConfigurationString(
+        rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup")),
+        rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("L10N/ooLocale")));
 }
 
-Reference< XHierarchicalNameAccess > ConfigManager::AddConfigItem(utl::ConfigItem& rCfgItem)
-{
-    RegisterConfigItemHelper registeredItem(*this,rCfgItem);
-    Reference< XHierarchicalNameAccess > xTree = AcquireTree(rCfgItem);
-    registeredItem.keep();
-    return xTree;
+rtl::OUString utl::ConfigManager::getProductExtension() {
+    return getConfigurationString(
+        rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup")),
+        rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Product/ooSetupExtension")));
 }
 
-void    ConfigManager::RegisterConfigItem(utl::ConfigItem& rCfgItem)
-{
-    ConfigItemList::iterator aListIter = pMgrImpl->aItemList.begin();
-#if OSL_DEBUG_LEVEL > 1
-    for(aListIter = pMgrImpl->aItemList.begin(); aListIter != pMgrImpl->aItemList.end(); ++aListIter)
-    {
-        ConfigItemListEntry_Impl& rEntry = *aListIter;
-        if(rEntry.pConfigItem == &rCfgItem)
-            OSL_FAIL("RegisterConfigItem: already inserted!");
-    }
-#endif
-    pMgrImpl->aItemList.insert(aListIter, ConfigItemListEntry_Impl(&rCfgItem));
+rtl::OUString utl::ConfigManager::getProductName() {
+    return getConfigurationString(
+        rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup")),
+        rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Product/ooName")));
 }
 
-Reference< XHierarchicalNameAccess> ConfigManager::AcquireTree(utl::ConfigItem& rCfgItem)
-{
-#if OSL_DEBUG_LEVEL > 1
-    sal_Bool bFound = sal_False;
-    ConfigItemList::iterator aListIter = pMgrImpl->aItemList.begin();
-    for(aListIter = pMgrImpl->aItemList.begin(); aListIter != pMgrImpl->aItemList.end(); ++aListIter)
-    {
-        ConfigItemListEntry_Impl& rEntry = *aListIter;
-        if(rEntry.pConfigItem == &rCfgItem)
-        {
-            bFound = sal_True;
-            break;
-        }
-    }
-    OSL_ENSURE(bFound, "AcquireTree: ConfigItem unknown!");
-#endif
-    OUString sPath(RTL_CONSTASCII_USTRINGPARAM(aConfigBaseURL));
-    sPath += rCfgItem.GetSubTreeName();
-    Sequence< Any > aArgs(2);
-    Any* pArgs = aArgs.getArray();
-    PropertyValue aPath;
-    aPath.Name = UNISTRING("nodepath");
-    aPath.Value <<= sPath;
-    pArgs[0] <<= aPath;
-    sal_Bool bLazy = 0 != (rCfgItem.GetMode()&CONFIG_MODE_DELAYED_UPDATE);
-    PropertyValue aUpdate;
-    aUpdate.Name = UNISTRING("lazywrite");
-    aUpdate.Value.setValue(&bLazy, ::getBooleanCppuType());
-    pArgs[1] <<= aUpdate;
-
-    // Initialize item with support for reading/writing more then one locales at same time!
-    // It's neccessary for creation of a complete configuration entry without changing office locale
-    // at runtime.
-    if((rCfgItem.GetMode() & CONFIG_MODE_ALL_LOCALES) == CONFIG_MODE_ALL_LOCALES)
-    {
-        sal_Int32 nCount = aArgs.getLength();
-        aArgs.realloc(nCount+1);
-
-        PropertyValue aAllLocale;
-        aAllLocale.Name  =   UNISTRING("locale");
-        aAllLocale.Value <<= UNISTRING("*"     );
-        aArgs[nCount]    <<= aAllLocale;
-    }
-
-    Reference< XMultiServiceFactory > xCfgProvider = GetConfigurationProvider();
-    Reference< XInterface > xIFace;
-    if(xCfgProvider.is())
-    {
-        try
-        {
-            xIFace = xCfgProvider->createInstanceWithArguments(
-                    OUString(RTL_CONSTASCII_USTRINGPARAM(aAccessSrvc)),
-                    aArgs);
-        }
-        catch (const Exception& rEx)
-        {
-            if (CONFIG_MODE_PROPAGATE_ERRORS & rCfgItem.GetMode())
-            {
-                OSL_TRACE("ConfigItem: Propagating creation error: %s\n",
-                            OUStringToOString(rEx.Message,RTL_TEXTENCODING_ASCII_US).getStr());
-
-                throw;
-            }
-#if OSL_DEBUG_LEVEL > 1
-            if(0 == (CONFIG_MODE_IGNORE_ERRORS & rCfgItem.GetMode()))
-            {
-                OString sMsg("CreateInstance exception: ");
-                sMsg += OString(rEx.Message.getStr(),
-                            rEx.Message.getLength(),
-                            RTL_TEXTENCODING_ASCII_US);
-                OSL_FAIL(sMsg.getStr());
-            }
-#endif
-        }
-    }
-    return Reference<XHierarchicalNameAccess>(xIFace, UNO_QUERY);
+rtl::OUString utl::ConfigManager::getProductVersion() {
+    return getConfigurationString(
+        rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup")),
+        rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Product/ooSetupVersion")));
 }
 
-void ConfigManager::RemoveConfigItem(utl::ConfigItem& rCfgItem)
-{
-    if( !pMgrImpl->aItemList.empty() )
-    {
-        ConfigItemList::iterator aListIter = pMgrImpl->aItemList.begin();
-        for(aListIter = pMgrImpl->aItemList.begin(); aListIter != pMgrImpl->aItemList.end(); ++aListIter)
-        {
-            ConfigItemListEntry_Impl& rEntry = *aListIter;
-            if(rEntry.pConfigItem == &rCfgItem)
-            {
-                pMgrImpl->aItemList.erase(aListIter);
-                break;
-            }
-        }
-    }
+rtl::OUString utl::ConfigManager::getProductXmlFileFormat() {
+    return getConfigurationString(
+        rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup")),
+        rtl::OUString(
+            RTL_CONSTASCII_USTRINGPARAM("Product/ooXMLFileFormatName")));
 }
 
-void ConfigManager::StoreConfigItems()
-{
-    if(!pMgrImpl->aItemList.empty())
-    {
-        ConfigItemList::iterator aListIter = pMgrImpl->aItemList.begin();
-        for(aListIter = pMgrImpl->aItemList.begin(); aListIter != pMgrImpl->aItemList.end(); ++aListIter)
-        {
-            ConfigItemListEntry_Impl& rEntry = *aListIter;
-            if(rEntry.pConfigItem->IsModified())
-            {
-                rEntry.pConfigItem->Commit();
-                rEntry.pConfigItem->ClearModified();
-            }
-        }
-    }
+rtl::OUString utl::ConfigManager::getProductXmlFileFormatVersion() {
+    return getConfigurationString(
+        rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup")),
+        rtl::OUString(
+            RTL_CONSTASCII_USTRINGPARAM("Product/ooXMLFileFormatVersion")));
 }
 
-struct theConfigManager : public rtl::Static<ConfigManager, theConfigManager> {};
-
-ConfigManager& ConfigManager::GetConfigManager()
-{
-    return theConfigManager::get();
+rtl::OUString utl::ConfigManager::getVendor() {
+    return getConfigurationString(
+        rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup")),
+        rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Product/ooVendor")));
 }
 
-rtl::OUString ConfigManager::GetConfigBaseURL()
-{
-    return OUString(RTL_CONSTASCII_USTRINGPARAM(aConfigBaseURL));
+rtl::OUString utl::ConfigManager::getWriterCompatibilityVersionOOo_1_1() {
+    return getConfigurationString(
+        rtl::OUString(
+            RTL_CONSTASCII_USTRINGPARAM(
+                "/org.openoffice.Office.Compatibility")),
+        rtl::OUString(
+            RTL_CONSTASCII_USTRINGPARAM("WriterCompatibilityVersion/OOo11")));
 }
 
-Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp)
-{
-    switch(eProp)
-    {
-        case INSTALLPATH:
-            OSL_FAIL( "ConfigManager::GetDirectConfigProperty: "
-                        "INSTALLPATH no longer supported." );
-            return Any();
-        case USERINSTALLURL:
-            OSL_FAIL( "ConfigManager::GetDirectConfigProperty: "
-                        "USERINSTALLURL no longer supported." );
-            return Any();
-        case OFFICEINSTALL:
-            OSL_FAIL( "ConfigManager::GetDirectConfigProperty: "
-                        "OFFICEINSTALL no longer supported." );
-            return Any();
-        case OFFICEINSTALLURL:
-            OSL_FAIL( "ConfigManager::GetDirectConfigProperty: "
-                        "OFFICEINSTALLURL no longer supported." );
-            return Any();
-        default:
-            break;
-    }
-
-    Any aRet;
-
-    ::rtl::OUString &rBrandName = BrandName::get();
-    if ( eProp == PRODUCTNAME && rBrandName.getLength() )
-    {
-        aRet <<= rBrandName;
-        return aRet;
-    }
-
-    rtl::OUString &rProductVersion = ProductVersion::get();
-    if ( eProp == PRODUCTVERSION && rProductVersion.getLength() )
-    {
-        aRet <<= rProductVersion;
-        return aRet;
-    }
-
-    rtl::OUString &rAboutBoxProductVersion = AboutBoxProductVersion::get();
-    if ( eProp == ABOUTBOXPRODUCTVERSION && rAboutBoxProductVersion.getLength() )
-    {
-        aRet <<= rAboutBoxProductVersion;
-        return aRet;
-    }
-
-    rtl::OUString &rOOOVendor = OOOVendor::get();
-    if ( eProp == OOOVENDOR && rOOOVendor.getLength() )
-    {
-        aRet <<= rOOOVendor;
-        return aRet;
-    }
-
-
-    rtl::OUString &rProductExtension = ProductExtension::get();
-    if ( eProp == PRODUCTEXTENSION && rProductExtension.getLength() )
-    {
-        aRet <<= rProductExtension;
-        return aRet;
-    }
-
-    rtl::OUString &rXMLFileFormatName = XMLFileFormatName::get();
-    if ( eProp == PRODUCTXMLFILEFORMATNAME && rXMLFileFormatName.getLength() )
-    {
-        aRet <<= rXMLFileFormatName;
-        return aRet;
-    }
-
-    rtl::OUString &rXMLFileFormatVersion = XMLFileFormatVersion::get();
-    if ( eProp == PRODUCTXMLFILEFORMATVERSION && rXMLFileFormatVersion.getLength() )
-    {
-        aRet <<= rXMLFileFormatVersion;
-        return aRet;
-    }
-
-    sal_Int32 &rOpenSourceContext = OpenSourceContext::get();
-    if ( eProp == OPENSOURCECONTEXT && ( rOpenSourceContext >= 0 ) )
-    {
-        aRet <<= rOpenSourceContext;
-        return aRet;
-    }
+void utl::ConfigManager::storeConfigItems() {
+    getConfigManager().doStoreConfigItems();
+}
 
-    rtl::OUString &rWriterCompatibilityVersionOOo11 = WriterCompatibilityVersionOOo11::get();
-    if ( eProp == WRITERCOMPATIBILITYVERSIONOOO11 && rWriterCompatibilityVersionOOo11.getLength() )
-    {
-        aRet <<= rWriterCompatibilityVersionOOo11;
-        return aRet;
-    }
+utl::ConfigManager & utl::ConfigManager::getConfigManager() {
+    return theConfigManager::get();
+}
 
-    if (eProp == PRODUCTEXTENSION) {
-        rtl::OUString name(
+css::uno::Reference< css::container::XHierarchicalNameAccess >
+utl::ConfigManager::acquireTree(utl::ConfigItem & item) {
+    css::uno::Sequence< css::uno::Any > args(1);
+    args[0] <<= css::beans::NamedValue(
+        rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")),
+        css::uno::makeAny(
+            rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.")) +
+            item.GetSubTreeName()));
+    if ((item.GetMode() & CONFIG_MODE_ALL_LOCALES) != 0) {
+        args.realloc(2);
+        args[1] <<= css::beans::NamedValue(
+            rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("locale")),
+            css::uno::makeAny(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*"))));
+    }
+    return css::uno::Reference< css::container::XHierarchicalNameAccess >(
+        getConfigurationProvider()->createInstanceWithArguments(
+            rtl::OUString(
                 RTL_CONSTASCII_USTRINGPARAM(
-                    "${BRAND_BASE_DIR}/program/edition/edition.ini"));
-        rtl::Bootstrap::expandMacros(name);
-        if (rtl::Bootstrap(name).getFrom(
-                rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EDITIONNAME")),
-                rProductExtension))
-        {
-            return com::sun::star::uno::Any(rProductExtension);
-        }
-    }
-
-    OUString sPath(RTL_CONSTASCII_USTRINGPARAM(aConfigBaseURL));
-    switch(eProp)
-    {

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list