Kaydet (Commit) 27415fd0 authored tarafından Jan Holesovsky's avatar Jan Holesovsky

Kill some static OUStrings.

Change-Id: Ic06a3b4673446bbadd21f2380c04ec628a6f86a9
üst 40043080
...@@ -48,6 +48,9 @@ ...@@ -48,6 +48,9 @@
#include <unotools/configpaths.hxx> #include <unotools/configpaths.hxx>
#include <svtools/acceleratorexecute.hxx> #include <svtools/acceleratorexecute.hxx>
#define PRESET_DEFAULT "default"
#define TARGET_CURRENT "current"
namespace framework namespace framework
{ {
const char CFG_ENTRY_SECONDARY[] = "SecondaryKeys"; const char CFG_ENTRY_SECONDARY[] = "SecondaryKeys";
...@@ -228,10 +231,10 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::reload() ...@@ -228,10 +231,10 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::reload()
css::uno::Reference< css::io::XStream > xStreamNoLang; css::uno::Reference< css::io::XStream > xStreamNoLang;
{ {
SolarMutexGuard g; SolarMutexGuard g;
xStream = m_aPresetHandler.openTarget(PresetHandler::TARGET_CURRENT(), true); // sal_True => open or create! xStream = m_aPresetHandler.openTarget(TARGET_CURRENT, true); // sal_True => open or create!
try try
{ {
xStreamNoLang = m_aPresetHandler.openPreset(PresetHandler::PRESET_DEFAULT(), true); xStreamNoLang = m_aPresetHandler.openPreset(PRESET_DEFAULT, true);
} }
catch(const css::io::IOException&) {} // does not have to exist catch(const css::io::IOException&) {} // does not have to exist
} }
...@@ -269,7 +272,7 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::store() ...@@ -269,7 +272,7 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::store()
css::uno::Reference< css::io::XStream > xStream; css::uno::Reference< css::io::XStream > xStream;
{ {
SolarMutexGuard g; SolarMutexGuard g;
xStream = m_aPresetHandler.openTarget(PresetHandler::TARGET_CURRENT(), true); // sal_True => open or create! xStream = m_aPresetHandler.openTarget(TARGET_CURRENT, true); // sal_True => open or create!
} }
css::uno::Reference< css::io::XOutputStream > xOut; css::uno::Reference< css::io::XOutputStream > xOut;
...@@ -295,7 +298,7 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::storeToStorage(const css::uno::R ...@@ -295,7 +298,7 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::storeToStorage(const css::uno::R
{ {
css::uno::Reference< css::io::XStream > xStream = StorageHolder::openSubStreamWithFallback( css::uno::Reference< css::io::XStream > xStream = StorageHolder::openSubStreamWithFallback(
xStorage, xStorage,
PresetHandler::TARGET_CURRENT(), TARGET_CURRENT,
css::embed::ElementModes::READWRITE, css::embed::ElementModes::READWRITE,
false); // False => no fallback from read/write to readonly! false); // False => no fallback from read/write to readonly!
css::uno::Reference< css::io::XOutputStream > xOut; css::uno::Reference< css::io::XOutputStream > xOut;
...@@ -325,7 +328,7 @@ sal_Bool SAL_CALL XMLBasedAcceleratorConfiguration::isReadOnly() ...@@ -325,7 +328,7 @@ sal_Bool SAL_CALL XMLBasedAcceleratorConfiguration::isReadOnly()
css::uno::Reference< css::io::XStream > xStream; css::uno::Reference< css::io::XStream > xStream;
{ {
SolarMutexGuard g; SolarMutexGuard g;
xStream = m_aPresetHandler.openTarget(PresetHandler::TARGET_CURRENT(), true); // sal_True => open or create! xStream = m_aPresetHandler.openTarget(TARGET_CURRENT, true); // sal_True => open or create!
} }
css::uno::Reference< css::io::XOutputStream > xOut; css::uno::Reference< css::io::XOutputStream > xOut;
...@@ -364,7 +367,7 @@ throw(css::uno::RuntimeException, std::exception) ...@@ -364,7 +367,7 @@ throw(css::uno::RuntimeException, std::exception)
{ {
{ {
SolarMutexGuard g; SolarMutexGuard g;
m_aPresetHandler.copyPresetToTarget(PresetHandler::PRESET_DEFAULT(), PresetHandler::TARGET_CURRENT()); m_aPresetHandler.copyPresetToTarget(PRESET_DEFAULT, TARGET_CURRENT);
} }
reload(); reload();
......
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
using namespace framework; using namespace framework;
#define RESOURCETYPE_ACCELERATOR "accelerator"
namespace { namespace {
/** /**
...@@ -189,7 +191,7 @@ void DocumentAcceleratorConfiguration::fillCache() ...@@ -189,7 +191,7 @@ void DocumentAcceleratorConfiguration::fillCache()
// open the folder, where the configuration exists // open the folder, where the configuration exists
m_aPresetHandler.connectToResource( m_aPresetHandler.connectToResource(
PresetHandler::E_DOCUMENT, PresetHandler::E_DOCUMENT,
PresetHandler::RESOURCETYPE_ACCELERATOR(), RESOURCETYPE_ACCELERATOR,
OUString(), OUString(),
xDocumentRoot, xDocumentRoot,
aLanguageTag); aLanguageTag);
......
...@@ -46,36 +46,6 @@ static const ::sal_Int32 ID_CORRUPT_UICONFIG_GENERAL = 3; ...@@ -46,36 +46,6 @@ static const ::sal_Int32 ID_CORRUPT_UICONFIG_GENERAL = 3;
namespace framework namespace framework
{ {
OUString PresetHandler::PRESET_DEFAULT()
{
return OUString("default");
}
OUString PresetHandler::TARGET_CURRENT()
{
return OUString("current");
}
OUString PresetHandler::RESOURCETYPE_MENUBAR()
{
return OUString("menubar");
}
OUString PresetHandler::RESOURCETYPE_TOOLBAR()
{
return OUString("toolbar");
}
OUString PresetHandler::RESOURCETYPE_ACCELERATOR()
{
return OUString("accelerator");
}
OUString PresetHandler::RESOURCETYPE_STATUSBAR()
{
return OUString("statusbar");
}
PresetHandler::PresetHandler(const css::uno::Reference< css::uno::XComponentContext >& xContext) PresetHandler::PresetHandler(const css::uno::Reference< css::uno::XComponentContext >& xContext)
: m_xContext(xContext) : m_xContext(xContext)
, m_eConfigType(E_GLOBAL) , m_eConfigType(E_GLOBAL)
......
...@@ -51,19 +51,6 @@ namespace framework ...@@ -51,19 +51,6 @@ namespace framework
*/ */
class PresetHandler class PresetHandler
{ {
public:
static OUString PRESET_DEFAULT();
static OUString TARGET_CURRENT();
static OUString RESOURCETYPE_MENUBAR();
static OUString RESOURCETYPE_TOOLBAR();
static OUString RESOURCETYPE_ACCELERATOR();
static OUString RESOURCETYPE_STATUSBAR();
// types
public: public:
/** @short this handler can provide different /** @short this handler can provide different
......
...@@ -61,6 +61,10 @@ using namespace com::sun::star::container; ...@@ -61,6 +61,10 @@ using namespace com::sun::star::container;
using namespace com::sun::star::beans; using namespace com::sun::star::beans;
using namespace framework; using namespace framework;
#define RESOURCETYPE_MENUBAR "menubar"
#define RESOURCETYPE_TOOLBAR "toolbar"
#define RESOURCETYPE_STATUSBAR "statusbar"
namespace { namespace {
class ModuleUIConfigurationManager : public cppu::WeakImplHelper3< class ModuleUIConfigurationManager : public cppu::WeakImplHelper3<
...@@ -882,11 +886,11 @@ ModuleUIConfigurationManager::ModuleUIConfigurationManager( ...@@ -882,11 +886,11 @@ ModuleUIConfigurationManager::ModuleUIConfigurationManager(
{ {
OUString aResourceType; OUString aResourceType;
if ( i == ::com::sun::star::ui::UIElementType::MENUBAR ) if ( i == ::com::sun::star::ui::UIElementType::MENUBAR )
aResourceType = PresetHandler::RESOURCETYPE_MENUBAR(); aResourceType = RESOURCETYPE_MENUBAR;
else if ( i == ::com::sun::star::ui::UIElementType::TOOLBAR ) else if ( i == ::com::sun::star::ui::UIElementType::TOOLBAR )
aResourceType = PresetHandler::RESOURCETYPE_TOOLBAR(); aResourceType = RESOURCETYPE_TOOLBAR;
else if ( i == ::com::sun::star::ui::UIElementType::STATUSBAR ) else if ( i == ::com::sun::star::ui::UIElementType::STATUSBAR )
aResourceType = PresetHandler::RESOURCETYPE_STATUSBAR(); aResourceType = RESOURCETYPE_STATUSBAR;
if ( !aResourceType.isEmpty() ) if ( !aResourceType.isEmpty() )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment