diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2015-12-31 10:26:43 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-01-04 14:44:33 +0000 |
commit | f14d64fa71565e86c98348f9c54cc6cab53649d8 (patch) | |
tree | 830034b8c4ac9e9bf83f049fabb3138f9a854486 /svtools/source | |
parent | 549e900b4b0047b8cb6c236ea50a3fc046e5fb51 (diff) |
these fields can be static constants
Change-Id: Id56e219782d7f858cdeb26232c7aabd4f643c9d9
Reviewed-on: https://gerrit.libreoffice.org/21020
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'svtools/source')
-rw-r--r-- | svtools/source/config/colorcfg.cxx | 10 | ||||
-rw-r--r-- | svtools/source/uno/unoevent.cxx | 27 |
2 files changed, 18 insertions, 19 deletions
diff --git a/svtools/source/config/colorcfg.cxx b/svtools/source/config/colorcfg.cxx index fcaf46a1a2aa..2c0f1a54043b 100644 --- a/svtools/source/config/colorcfg.cxx +++ b/svtools/source/config/colorcfg.cxx @@ -47,6 +47,8 @@ using namespace utl; using namespace com::sun::star; +static const char g_sIsVisible[] = "/IsVisible"; + namespace svtools { @@ -66,7 +68,6 @@ class ColorConfig_Impl : public utl::ConfigItem { ColorConfigValue m_aConfigValues[ColorConfigEntryCount]; bool m_bEditMode; - OUString m_sIsVisible; OUString m_sLoadedScheme; bool m_bAutoDetectSystemHC; @@ -180,7 +181,7 @@ uno::Sequence< OUString> ColorConfig_Impl::GetPropertyNames(const OUString& rSch if(cNames[nPos].bCanBeVisible) { pNames[nIndex] += sBaseName; - pNames[nIndex++] += m_sIsVisible; + pNames[nIndex++] += g_sIsVisible; } } aNames.realloc(nIndex); @@ -190,7 +191,6 @@ uno::Sequence< OUString> ColorConfig_Impl::GetPropertyNames(const OUString& rSch ColorConfig_Impl::ColorConfig_Impl(bool bEditMode) : ConfigItem("Office.UI/ColorScheme"), m_bEditMode(bEditMode), - m_sIsVisible("/IsVisible"), m_bAutoDetectSystemHC(true) { if(!m_bEditMode) @@ -241,7 +241,7 @@ void ColorConfig_Impl::Load(const OUString& rScheme) if(nIndex >= aColors.getLength()) break; //test for visibility property - if(pColorNames[nIndex].endsWith(m_sIsVisible)) + if(pColorNames[nIndex].endsWith(g_sIsVisible)) m_aConfigValues[i / 2].bIsVisible = Any2Bool(pColors[nIndex++]); } // fdo#71511: check if we are running in a11y autodetect @@ -281,7 +281,7 @@ void ColorConfig_Impl::ImplCommit() if(nIndex >= aColorNames.getLength()) break; //test for visibility property - if(pColorNames[nIndex].endsWith(m_sIsVisible)) + if(pColorNames[nIndex].endsWith(g_sIsVisible)) { pPropValues[nIndex].Name = pColorNames[nIndex]; pPropValues[nIndex].Value.setValue(&m_aConfigValues[i/2].bIsVisible, rBoolType); diff --git a/svtools/source/uno/unoevent.cxx b/svtools/source/uno/unoevent.cxx index 56e6ccb93b56..d789301a4c37 100644 --- a/svtools/source/uno/unoevent.cxx +++ b/svtools/source/uno/unoevent.cxx @@ -35,19 +35,18 @@ using css::lang::XServiceInfo; using css::beans::PropertyValue; -const sal_Char sAPI_ServiceName[] = "com.sun.star.container.XNameReplace"; -const sal_Char sAPI_SvDetachedEventDescriptor[] = "SvDetachedEventDescriptor"; +static const char sAPI_ServiceName[] = "com.sun.star.container.XNameReplace"; +static const char sAPI_SvDetachedEventDescriptor[] = "SvDetachedEventDescriptor"; +static const char sEventType[] = "EventType"; +static const char sMacroName[] = "MacroName"; +static const char sLibrary[] = "Library"; +static const char sStarBasic[] = "StarBasic"; +static const char sJavaScript[] = "JavaScript"; +static const char sScript[] = "Script"; +static const char sNone[] = "None"; SvBaseEventDescriptor::SvBaseEventDescriptor( const SvEventDescription* pSupportedMacroItems ) : - sEventType("EventType"), - sMacroName("MacroName"), - sLibrary("Library"), - sStarBasic("StarBasic"), - sJavaScript("JavaScript"), - sScript("Script"), - sNone("None"), - sServiceName(sAPI_ServiceName), mpSupportedMacroItems(pSupportedMacroItems), mnMacroItems(0) { @@ -151,7 +150,7 @@ sal_Bool SvBaseEventDescriptor::supportsService(const OUString& rServiceName) Sequence<OUString> SvBaseEventDescriptor::getSupportedServiceNames() throw(RuntimeException, std::exception) { - Sequence<OUString> aSequence { sServiceName }; + Sequence<OUString> aSequence { sAPI_ServiceName }; return aSequence; } @@ -194,7 +193,7 @@ void SvBaseEventDescriptor::getAnyFromMacro(Any& rAny, // create type PropertyValue aTypeValue; aTypeValue.Name = sEventType; - aTmp <<= sStarBasic; + aTmp <<= OUString(sStarBasic); aTypeValue.Value = aTmp; aSequence[0] = aTypeValue; @@ -227,7 +226,7 @@ void SvBaseEventDescriptor::getAnyFromMacro(Any& rAny, // create type PropertyValue aTypeValue; aTypeValue.Name = sEventType; - aTmp <<= sScript; + aTmp <<= OUString(sScript); aTypeValue.Value = aTmp; aSequence[0] = aTypeValue; @@ -259,7 +258,7 @@ void SvBaseEventDescriptor::getAnyFromMacro(Any& rAny, PropertyValue aKindValue; aKindValue.Name = sEventType; Any aTmp; - aTmp <<= sNone; + aTmp <<= OUString(sNone); aKindValue.Value = aTmp; aSequence[0] = aKindValue; |