From 6b723132daacae5e007589ffdbe78d7569b06fa0 Mon Sep 17 00:00:00 2001 From: Matúš Kukan Date: Sat, 26 Dec 2015 12:27:56 +0100 Subject: Small OUStringBuffer cleanup Change-Id: I7b608400eea39eef4c620a1d4d67b11637c54436 --- framework/source/helper/persistentwindowstate.cxx | 51 +++++++---------------- 1 file changed, 15 insertions(+), 36 deletions(-) (limited to 'framework') 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 #include -#include #include - -#include #include #include @@ -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; } -- cgit