diff options
author | Matúš Kukan <matus.kukan@gmail.com> | 2015-12-26 12:27:56 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@gmail.com> | 2015-12-27 13:55:28 +0100 |
commit | 6b723132daacae5e007589ffdbe78d7569b06fa0 (patch) | |
tree | e3172ee7d7ca05d463474b607fd913a0f6a28ae8 /framework/source/helper | |
parent | aa2a843c4bf87eefa59263f8691571c097276100 (diff) |
Small OUStringBuffer cleanup
Change-Id: I7b608400eea39eef4c620a1d4d67b11637c54436
Diffstat (limited to 'framework/source/helper')
-rw-r--r-- | framework/source/helper/persistentwindowstate.cxx | 51 |
1 files changed, 15 insertions, 36 deletions
diff --git a/framework/source/helper/persistentwindowstate.cxx b/framework/source/helper/persistentwindowstate.cxx index 4eb6f8cf2894..12bf95d89a78 100644 --- a/framework/source/helper/persistentwindowstate.cxx +++ b/framework/source/helper/persistentwindowstate.cxx @@ -19,11 +19,8 @@ #include <pattern/window.hxx> #include <helper/persistentwindowstate.hxx> -#include <services.h> #include <com/sun/star/awt/XWindow.hpp> - -#include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> #include <com/sun/star/frame/ModuleManager.hpp> @@ -162,27 +159,18 @@ OUString PersistentWindowState::implst_identifyModule(const css::uno::Reference< return sModuleName; } -OUString PersistentWindowState::implst_getWindowStateFromConfig(const css::uno::Reference< css::uno::XComponentContext >& rxContext, - const OUString& sModuleName) +OUString PersistentWindowState::implst_getWindowStateFromConfig( + const css::uno::Reference< css::uno::XComponentContext >& rxContext, + const OUString& sModuleName) { OUString sWindowState; - - OUStringBuffer sRelPathBuf(256); - sRelPathBuf.append("Office/Factories/*[\""); - sRelPathBuf.append (sModuleName ); - sRelPathBuf.append("\"]" ); - - OUString sPackage("org.openoffice.Setup/"); - OUString sRelPath = sRelPathBuf.makeStringAndClear(); - OUString sKey("ooSetupFactoryWindowAttributes"); - try { ::comphelper::ConfigurationHelper::readDirectKey(rxContext, - sPackage, - sRelPath, - sKey, - ::comphelper::ConfigurationHelper::E_READONLY) >>= sWindowState; + "org.openoffice.Setup/", + "Office/Factories/*[\"" + sModuleName + "\"]", + "ooSetupFactoryWindowAttributes", + ::comphelper::ConfigurationHelper::E_READONLY) >>= sWindowState; } catch(const css::uno::RuntimeException&) { throw; } @@ -192,27 +180,18 @@ OUString PersistentWindowState::implst_getWindowStateFromConfig(const css::uno:: return sWindowState; } -void PersistentWindowState::implst_setWindowStateOnConfig(const css::uno::Reference< css::uno::XComponentContext >& rxContext, - const OUString& sModuleName , - const OUString& sWindowState) +void PersistentWindowState::implst_setWindowStateOnConfig( + const css::uno::Reference< css::uno::XComponentContext >& rxContext, + const OUString& sModuleName, const OUString& sWindowState) { - OUStringBuffer sRelPathBuf(256); - sRelPathBuf.append("Office/Factories/*[\""); - sRelPathBuf.append (sModuleName ); - sRelPathBuf.append("\"]" ); - - OUString sPackage("org.openoffice.Setup/"); - OUString sRelPath = sRelPathBuf.makeStringAndClear(); - OUString sKey("ooSetupFactoryWindowAttributes"); - try { ::comphelper::ConfigurationHelper::writeDirectKey(rxContext, - sPackage, - sRelPath, - sKey, - css::uno::makeAny(sWindowState), - ::comphelper::ConfigurationHelper::E_STANDARD); + "org.openoffice.Setup/", + "Office/Factories/*[\"" + sModuleName + "\"]", + "ooSetupFactoryWindowAttributes", + css::uno::makeAny(sWindowState), + ::comphelper::ConfigurationHelper::E_STANDARD); } catch(const css::uno::RuntimeException&) { throw; } |