summaryrefslogtreecommitdiff
path: root/framework/source
diff options
context:
space:
mode:
Diffstat (limited to 'framework/source')
-rw-r--r--framework/source/accelerators/presethandler.cxx22
-rw-r--r--framework/source/services/pathsettings.cxx32
2 files changed, 36 insertions, 18 deletions
diff --git a/framework/source/accelerators/presethandler.cxx b/framework/source/accelerators/presethandler.cxx
index 0ba15b8bde76..6cc93c36efec 100644
--- a/framework/source/accelerators/presethandler.cxx
+++ b/framework/source/accelerators/presethandler.cxx
@@ -26,14 +26,15 @@
#include <threadhelp/writeguard.hxx>
#include <services.h>
+#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/configuration/CorruptedUIConfigurationException.hpp>
#include <com/sun/star/container/NoSuchElementException.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/XTransactedObject.hpp>
#include <com/sun/star/embed/FileSystemStorageFactory.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
+#include <com/sun/star/util/PathSettings.hpp>
#include <vcl/svapp.hxx>
#include <cppuhelper/exc_hlp.hxx>
@@ -44,9 +45,6 @@
#define SUBSTORAGE_GLOBAL DECLARE_ASCII("global" )
#define SUBSTORAGE_MODULES DECLARE_ASCII("modules")
-#define BASEPATH_SHARE_LAYER DECLARE_ASCII("UIConfig" )
-#define BASEPATH_USER_LAYER DECLARE_ASCII("UserConfig")
-
#define RELPATH_SHARE_LAYER DECLARE_ASCII("soffice.cfg")
#define RELPATH_USER_LAYER DECLARE_ASCII("soffice.cfg")
@@ -228,12 +226,10 @@ css::uno::Reference< css::embed::XStorage > PresetHandler::getOrCreateRootStorag
aReadLock.unlock();
// <- SAFE ----------------------------------
- css::uno::Reference< css::beans::XPropertySet > xPathSettings(
- xSMGR->createInstance(SERVICENAME_PATHSETTINGS),
- css::uno::UNO_QUERY_THROW);
+ css::uno::Reference< css::util::XPathSettings > xPathSettings =
+ css::util::PathSettings::create( comphelper::getComponentContext(xSMGR) );
- OUString sShareLayer;
- xPathSettings->getPropertyValue(BASEPATH_SHARE_LAYER) >>= sShareLayer;
+ OUString sShareLayer = xPathSettings->getBasePathShareLayer();
// "UIConfig" is a "multi path" ... use first part only here!
sal_Int32 nPos = sShareLayer.indexOf(';');
@@ -288,12 +284,10 @@ css::uno::Reference< css::embed::XStorage > PresetHandler::getOrCreateRootStorag
aReadLock.unlock();
// <- SAFE ----------------------------------
- css::uno::Reference< css::beans::XPropertySet > xPathSettings(
- xSMGR->createInstance(SERVICENAME_PATHSETTINGS),
- css::uno::UNO_QUERY_THROW);
+ css::uno::Reference< css::util::XPathSettings > xPathSettings =
+ css::util::PathSettings::create( comphelper::getComponentContext(xSMGR) );
- OUString sUserLayer;
- xPathSettings->getPropertyValue(BASEPATH_USER_LAYER) >>= sUserLayer ;
+ OUString sUserLayer = xPathSettings->getBasePathUserLayer();
// Note: May be an user uses URLs without a final slash! Check it ...
sal_Int32 nPos = sUserLayer.lastIndexOf('/');
diff --git a/framework/source/services/pathsettings.cxx b/framework/source/services/pathsettings.cxx
index 1369950ae942..4734eb2eb27a 100644
--- a/framework/source/services/pathsettings.cxx
+++ b/framework/source/services/pathsettings.cxx
@@ -74,29 +74,34 @@ sal_Int32 impl_getPropGroup(sal_Int32 nID)
}
+#define SERVICENAME_PATHSETTINGS DECLARE_ASCII("com.sun.star.util.PathSettings" )
+#define IMPLEMENTATIONNAME_PATHSETTINGS DECLARE_ASCII("com.sun.star.comp.framework.PathSettings" )
+
namespace framework
{
//-----------------------------------------------------------------------------
// XInterface, XTypeProvider, XServiceInfo
-DEFINE_XINTERFACE_7 ( PathSettings ,
+DEFINE_XINTERFACE_8 ( PathSettings ,
OWeakObject ,
DIRECT_INTERFACE ( css::lang::XTypeProvider ),
DIRECT_INTERFACE ( css::lang::XServiceInfo ),
DERIVED_INTERFACE( css::lang::XEventListener, css::util::XChangesListener),
DIRECT_INTERFACE ( css::util::XChangesListener ),
- DIRECT_INTERFACE ( css::beans::XPropertySet ),
+ DIRECT_INTERFACE ( css::util::XPathSettings ),
+ DERIVED_INTERFACE( css::beans::XPropertySet, css::util::XPathSettings),
DIRECT_INTERFACE ( css::beans::XFastPropertySet ),
DIRECT_INTERFACE ( css::beans::XMultiPropertySet )
)
-DEFINE_XTYPEPROVIDER_7 ( PathSettings ,
+DEFINE_XTYPEPROVIDER_8 ( PathSettings ,
css::lang::XTypeProvider ,
css::lang::XServiceInfo ,
css::lang::XEventListener ,
css::util::XChangesListener ,
- css::beans::XPropertySet ,
+ css::util::XPathSettings ,
+ css::beans::XPropertySet ,
css::beans::XFastPropertySet ,
css::beans::XMultiPropertySet
)
@@ -195,6 +200,23 @@ void SAL_CALL PathSettings::disposing(const css::lang::EventObject& aSource)
}
//-----------------------------------------------------------------------------
+OUString PathSettings::getStringProperty(const OUString& p1)
+ throw(css::uno::RuntimeException)
+{
+ css::uno::Any a = ::cppu::OPropertySetHelper::getPropertyValue(p1);
+ OUString s;
+ a >>= s;
+ return s;
+}
+
+//-----------------------------------------------------------------------------
+void PathSettings::setStringProperty(const OUString& p1, const OUString& p2)
+ throw(css::uno::RuntimeException)
+{
+ ::cppu::OPropertySetHelper::setPropertyValue(p1, css::uno::Any(p2));
+}
+
+//-----------------------------------------------------------------------------
void PathSettings::impl_readAll()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "PathSettings::impl_readAll" );
@@ -1124,6 +1146,8 @@ css::uno::Reference< css::container::XNameAccess > PathSettings::fa_getCfgNew()
ReadGuard aReadLock(m_aLock);
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
css::uno::Reference< css::container::XNameAccess > xCfg = m_xCfgNew;
+ if (xCfg.is())
+ return xCfg;
aReadLock.unlock();
// <- SAFE