diff options
author | Oliver Bolte <obo@openoffice.org> | 2005-03-18 09:41:31 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2005-03-18 09:41:31 +0000 |
commit | 15f03e5a5481f6f4ece001fcd8f3e678e153a0fa (patch) | |
tree | 6939569bbcdcb2ce9abdbf09f6f787f158b74cb9 /desktop/source/app/configinit.cxx | |
parent | e4c71d7fb1c3ad04a5cdbd3bf00f21efe50ce7e1 (diff) |
INTEGRATION: CWS cfgfix01 (1.9.78); FILE MERGED
2005/02/18 10:57:30 jb 1.9.78.1: #i41985# Don't create interaction handler unless needed - avoids loading uui dll unnecessarily
Diffstat (limited to 'desktop/source/app/configinit.cxx')
-rw-r--r-- | desktop/source/app/configinit.cxx | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/desktop/source/app/configinit.cxx b/desktop/source/app/configinit.cxx index a9edaa0382c3..265b4a442a75 100644 --- a/desktop/source/app/configinit.cxx +++ b/desktop/source/app/configinit.cxx @@ -168,17 +168,12 @@ namespace class SimpleCurrentContext : public cppu::WeakImplHelper1< uno::XCurrentContext > { CurrentContext m_xChainedContext; - typedef std::map< OUString, uno::Any > Settings; - Settings m_settings; public: explicit SimpleCurrentContext(const CurrentContext & xChainedContext) : m_xChainedContext(xChainedContext) {} - void addSetting(const OUString & aName, const uno::Any & aValue) - { m_settings[aName] = aValue; } - void install() { uno::setCurrentContext(this); } void deinstall() { uno::setCurrentContext(m_xChainedContext); } @@ -190,7 +185,7 @@ namespace } // XCurrentContext - uno::Any SAL_CALL + virtual uno::Any SAL_CALL getValueByName( OUString const & aName) throw (uno::RuntimeException); }; @@ -199,11 +194,7 @@ namespace SimpleCurrentContext::getValueByName( OUString const & aName) throw (uno::RuntimeException) { - Settings::iterator it = m_settings.find(aName); - if (it != m_settings.end()) - return it->second; - else - return getChainedValueByName(aName); + return getChainedValueByName(aName); } } @@ -216,16 +207,35 @@ public: Context(InteractionHandler const & xHandler) : SimpleCurrentContext( uno::getCurrentContext() ) { - addSetting( OUSTRING(CONFIG_ERROR_HANDLER), uno::makeAny(xHandler) ); } ~Context() { } + // XCurrentContext + virtual uno::Any SAL_CALL + getValueByName( OUString const & aName) + throw (uno::RuntimeException); + +private: + InteractionHandler m_xHandler; }; //------------------------------------------------------------------------------ +uno::Any SAL_CALL ConfigurationErrorHandler::Context::getValueByName( OUString const & aName) + throw (uno::RuntimeException) +{ + if ( aName.equalsAscii( CONFIG_ERROR_HANDLER ) ) + { + if ( !m_xHandler.is() ) + m_xHandler = ConfigurationErrorHandler::getDefaultInteractionHandler(); + return uno::Any( m_xHandler ); + } + return SimpleCurrentContext::getValueByName( aName ); +} + +//------------------------------------------------------------------------------ ConfigurationErrorHandler::~ConfigurationErrorHandler() { deactivate(); @@ -274,3 +284,4 @@ ConfigurationErrorHandler::InteractionHandler ConfigurationErrorHandler::getDefa //------------------------------------------------------------------------------ + |