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 | |
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>
21 files changed, 133 insertions, 185 deletions
diff --git a/connectivity/qa/connectivity/commontools/FValue_test.cxx b/connectivity/qa/connectivity/commontools/FValue_test.cxx index 2e6e326db960..1db73c687d85 100644 --- a/connectivity/qa/connectivity/commontools/FValue_test.cxx +++ b/connectivity/qa/connectivity/commontools/FValue_test.cxx @@ -339,46 +339,41 @@ void FValueTest::test_bit_getString() void FValueTest::test_bool_creation() { - OUString s1("1"); - OUString s0("0"); - OUString sTrue("true"); - OUString sTrUe("tRuE"); - OUString sFalse("false"); ORowSetValue vTrue(true); ORowSetValue vFalse(false); { - ORowSetValue v(s1); + ORowSetValue v(OUString("1")); v.setTypeKind(DataType::BOOLEAN); CPPUNIT_ASSERT_MESSAGE("ORowSetValue bool creation from string didn't work", v == vTrue); } { - ORowSetValue v(s0); + ORowSetValue v(OUString("0")); v.setTypeKind(DataType::BOOLEAN); CPPUNIT_ASSERT_MESSAGE("ORowSetValue bool creation from string didn't work", v == vFalse); } { - ORowSetValue v(sTrue); + ORowSetValue v(OUString("true")); v.setTypeKind(DataType::BOOLEAN); CPPUNIT_ASSERT_MESSAGE("ORowSetValue bool creation from string didn't work", v == vTrue); } { - ORowSetValue v(sTrUe); + ORowSetValue v(OUString("tRuE")); v.setTypeKind(DataType::BOOLEAN); CPPUNIT_ASSERT_MESSAGE("ORowSetValue bool creation from string didn't work", v == vTrue); } { - ORowSetValue v(sFalse); + ORowSetValue v(OUString("false")); v.setTypeKind(DataType::BOOLEAN); CPPUNIT_ASSERT_MESSAGE("ORowSetValue bool creation from string didn't work", v == vFalse); } { - ORowSetValue v(s0); + ORowSetValue v(OUString("0")); v.setTypeKind(DataType::BOOLEAN); CPPUNIT_ASSERT_MESSAGE("ORowSetValue bool creation from string didn't work", v == vFalse); } diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx index abfff4ba14bd..b288c9983407 100644 --- a/cui/source/options/optinet2.cxx +++ b/cui/source/options/optinet2.cxx @@ -144,6 +144,15 @@ bool SvxNoSpaceEdit::set_property(const OString &rKey, const OString &rValue) } +static const char g_aProxyModePN[] = "ooInetProxyType"; +static const char g_aHttpProxyPN[] = "ooInetHTTPProxyName"; +static const char g_aHttpPortPN[] = "ooInetHTTPProxyPort"; +static const char g_aHttpsProxyPN[] = "ooInetHTTPSProxyName"; +static const char g_aHttpsPortPN[] = "ooInetHTTPSProxyPort"; +static const char g_aFtpProxyPN[] = "ooInetFTPProxyName"; +static const char g_aFtpPortPN[] = "ooInetFTPProxyPort"; +static const char g_aNoProxyDescPN[] = "ooInetNoProxy"; + /********************************************************************/ /* */ /* SvxProxyTabPage */ @@ -152,14 +161,6 @@ bool SvxNoSpaceEdit::set_property(const OString &rKey, const OString &rValue) SvxProxyTabPage::SvxProxyTabPage(vcl::Window* pParent, const SfxItemSet& rSet) : SfxTabPage(pParent, "OptProxyPage","cui/ui/optproxypage.ui", &rSet) - , aProxyModePN("ooInetProxyType") - , aHttpProxyPN("ooInetHTTPProxyName") - , aHttpPortPN("ooInetHTTPProxyPort") - , aHttpsProxyPN("ooInetHTTPSProxyName") - , aHttpsPortPN("ooInetHTTPSProxyPort") - , aFtpProxyPN("ooInetFTPProxyName") - , aFtpPortPN("ooInetFTPProxyPort") - , aNoProxyDescPN("ooInetNoProxy") { get(m_pProxyModeLB, "proxymode"); @@ -247,42 +248,42 @@ void SvxProxyTabPage::ReadConfigData_Impl() sal_Int32 nIntValue = 0; OUString aStringValue; - if( xNameAccess->getByName(aProxyModePN) >>= nIntValue ) + if( xNameAccess->getByName(g_aProxyModePN) >>= nIntValue ) { m_pProxyModeLB->SelectEntryPos( nIntValue ); } - if( xNameAccess->getByName(aHttpProxyPN) >>= aStringValue ) + if( xNameAccess->getByName(g_aHttpProxyPN) >>= aStringValue ) { m_pHttpProxyED->SetText( aStringValue ); } - if( xNameAccess->getByName(aHttpPortPN) >>= nIntValue ) + if( xNameAccess->getByName(g_aHttpPortPN) >>= nIntValue ) { m_pHttpPortED->SetText( OUString::number( nIntValue )); } - if( xNameAccess->getByName(aHttpsProxyPN) >>= aStringValue ) + if( xNameAccess->getByName(g_aHttpsProxyPN) >>= aStringValue ) { m_pHttpsProxyED->SetText( aStringValue ); } - if( xNameAccess->getByName(aHttpsPortPN) >>= nIntValue ) + if( xNameAccess->getByName(g_aHttpsPortPN) >>= nIntValue ) { m_pHttpsPortED->SetText( OUString::number( nIntValue )); } - if( xNameAccess->getByName(aFtpProxyPN) >>= aStringValue ) + if( xNameAccess->getByName(g_aFtpProxyPN) >>= aStringValue ) { m_pFtpProxyED->SetText( aStringValue ); } - if( xNameAccess->getByName(aFtpPortPN) >>= nIntValue ) + if( xNameAccess->getByName(g_aFtpPortPN) >>= nIntValue ) { m_pFtpPortED->SetText( OUString::number( nIntValue )); } - if( xNameAccess->getByName(aNoProxyDescPN) >>= aStringValue ) + if( xNameAccess->getByName(g_aNoProxyDescPN) >>= aStringValue ) { m_pNoProxyForED->SetText( aStringValue ); } @@ -311,37 +312,37 @@ void SvxProxyTabPage::ReadConfigDefaults_Impl() sal_Int32 nIntValue = 0; OUString aStringValue; - if( xPropertyState->getPropertyDefault(aHttpProxyPN) >>= aStringValue ) + if( xPropertyState->getPropertyDefault(g_aHttpProxyPN) >>= aStringValue ) { m_pHttpProxyED->SetText( aStringValue ); } - if( xPropertyState->getPropertyDefault(aHttpPortPN) >>= nIntValue ) + if( xPropertyState->getPropertyDefault(g_aHttpPortPN) >>= nIntValue ) { m_pHttpPortED->SetText( OUString::number( nIntValue )); } - if( xPropertyState->getPropertyDefault(aHttpsProxyPN) >>= aStringValue ) + if( xPropertyState->getPropertyDefault(g_aHttpsProxyPN) >>= aStringValue ) { m_pHttpsProxyED->SetText( aStringValue ); } - if( xPropertyState->getPropertyDefault(aHttpsPortPN) >>= nIntValue ) + if( xPropertyState->getPropertyDefault(g_aHttpsPortPN) >>= nIntValue ) { m_pHttpsPortED->SetText( OUString::number( nIntValue )); } - if( xPropertyState->getPropertyDefault(aFtpProxyPN) >>= aStringValue ) + if( xPropertyState->getPropertyDefault(g_aFtpProxyPN) >>= aStringValue ) { m_pFtpProxyED->SetText( aStringValue ); } - if( xPropertyState->getPropertyDefault(aFtpPortPN) >>= nIntValue ) + if( xPropertyState->getPropertyDefault(g_aFtpPortPN) >>= nIntValue ) { m_pFtpPortED->SetText( OUString::number( nIntValue )); } - if( xPropertyState->getPropertyDefault(aNoProxyDescPN) >>= aStringValue ) + if( xPropertyState->getPropertyDefault(g_aNoProxyDescPN) >>= aStringValue ) { m_pNoProxyForED->SetText( aStringValue ); } @@ -367,14 +368,14 @@ void SvxProxyTabPage::RestoreConfigDefaults_Impl() { Reference< beans::XPropertyState > xPropertyState(m_xConfigurationUpdateAccess, UNO_QUERY_THROW); - xPropertyState->setPropertyToDefault(aProxyModePN); - xPropertyState->setPropertyToDefault(aHttpProxyPN); - xPropertyState->setPropertyToDefault(aHttpPortPN); - xPropertyState->setPropertyToDefault(aHttpsProxyPN); - xPropertyState->setPropertyToDefault(aHttpsPortPN); - xPropertyState->setPropertyToDefault(aFtpProxyPN); - xPropertyState->setPropertyToDefault(aFtpPortPN); - xPropertyState->setPropertyToDefault(aNoProxyDescPN); + xPropertyState->setPropertyToDefault(g_aProxyModePN); + xPropertyState->setPropertyToDefault(g_aHttpProxyPN); + xPropertyState->setPropertyToDefault(g_aHttpPortPN); + xPropertyState->setPropertyToDefault(g_aHttpsProxyPN); + xPropertyState->setPropertyToDefault(g_aHttpsPortPN); + xPropertyState->setPropertyToDefault(g_aFtpProxyPN); + xPropertyState->setPropertyToDefault(g_aFtpPortPN); + xPropertyState->setPropertyToDefault(g_aNoProxyDescPN); Reference< util::XChangesBatch > xChangesBatch(m_xConfigurationUpdateAccess, UNO_QUERY_THROW); xChangesBatch->commitChanges(); @@ -427,50 +428,50 @@ bool SvxProxyTabPage::FillItemSet(SfxItemSet* ) return true; } - xPropertySet->setPropertyValue(aProxyModePN, + xPropertySet->setPropertyValue(g_aProxyModePN, makeAny((sal_Int32) nSelPos)); bModified = true; } if(m_pHttpProxyED->IsValueChangedFromSaved()) { - xPropertySet->setPropertyValue( aHttpProxyPN, makeAny(m_pHttpProxyED->GetText())); + xPropertySet->setPropertyValue( g_aHttpProxyPN, makeAny(m_pHttpProxyED->GetText())); bModified = true; } if ( m_pHttpPortED->IsValueChangedFromSaved()) { - xPropertySet->setPropertyValue( aHttpPortPN, makeAny(m_pHttpPortED->GetText().toInt32())); + xPropertySet->setPropertyValue( g_aHttpPortPN, makeAny(m_pHttpPortED->GetText().toInt32())); bModified = true; } if( m_pHttpsProxyED->IsValueChangedFromSaved() ) { - xPropertySet->setPropertyValue( aHttpsProxyPN, makeAny(m_pHttpsProxyED->GetText()) ); + xPropertySet->setPropertyValue( g_aHttpsProxyPN, makeAny(m_pHttpsProxyED->GetText()) ); bModified = true; } if ( m_pHttpsPortED->IsValueChangedFromSaved() ) { - xPropertySet->setPropertyValue( aHttpsPortPN, makeAny(m_pHttpsPortED->GetText().toInt32()) ); + xPropertySet->setPropertyValue( g_aHttpsPortPN, makeAny(m_pHttpsPortED->GetText().toInt32()) ); bModified = true; } if( m_pFtpProxyED->IsValueChangedFromSaved()) { - xPropertySet->setPropertyValue( aFtpProxyPN, makeAny(m_pFtpProxyED->GetText()) ); + xPropertySet->setPropertyValue( g_aFtpProxyPN, makeAny(m_pFtpProxyED->GetText()) ); bModified = true; } if ( m_pFtpPortED->IsValueChangedFromSaved() ) { - xPropertySet->setPropertyValue( aFtpPortPN, makeAny(m_pFtpPortED->GetText().toInt32())); + xPropertySet->setPropertyValue( g_aFtpPortPN, makeAny(m_pFtpPortED->GetText().toInt32())); bModified = true; } if ( m_pNoProxyForED->IsValueChangedFromSaved() ) { - xPropertySet->setPropertyValue( aNoProxyDescPN, makeAny( m_pNoProxyForED->GetText())); + xPropertySet->setPropertyValue( g_aNoProxyDescPN, makeAny( m_pNoProxyForED->GetText())); bModified = true; } diff --git a/cui/source/options/optinet2.hxx b/cui/source/options/optinet2.hxx index 57236c0d7f26..16fc4c94aaf6 100644 --- a/cui/source/options/optinet2.hxx +++ b/cui/source/options/optinet2.hxx @@ -79,15 +79,6 @@ private: VclPtr<Edit> m_pNoProxyForED; VclPtr<FixedText> m_pNoProxyDescFT; - const OUString aProxyModePN; - const OUString aHttpProxyPN; - const OUString aHttpPortPN; - const OUString aHttpsProxyPN; - const OUString aHttpsPortPN; - const OUString aFtpProxyPN; - const OUString aFtpPortPN; - const OUString aNoProxyDescPN; - css::uno::Reference< css::uno::XInterface > m_xConfigurationUpdateAccess; void EnableControls_Impl(bool bEnable); diff --git a/include/oox/ole/oleobjecthelper.hxx b/include/oox/ole/oleobjecthelper.hxx index 35e16b05add6..85b9ee59c022 100644 --- a/include/oox/ole/oleobjecthelper.hxx +++ b/include/oox/ole/oleobjecthelper.hxx @@ -69,7 +69,6 @@ public: private: css::uno::Reference<css::frame::XModel> m_xModel; css::uno::Reference< css::document::XEmbeddedObjectResolver > mxResolver; - const OUString maEmbeddedObjScheme; sal_Int32 mnObjectId; }; diff --git a/include/svtools/unoevent.hxx b/include/svtools/unoevent.hxx index 36337f4c6857..ac1f03c38a6f 100644 --- a/include/svtools/unoevent.hxx +++ b/include/svtools/unoevent.hxx @@ -60,18 +60,6 @@ class SVT_DLLPUBLIC SvBaseEventDescriptor : public cppu::WeakImplHelper2 css::lang::XServiceInfo > { - const OUString sEventType; - const OUString sMacroName; - const OUString sLibrary; - const OUString sStarBasic; - const OUString sJavaScript; - const OUString sScript; - const OUString sNone; - - - /// name of own service - const OUString sServiceName; - protected: /// last element is 0, 0 const SvEventDescription* mpSupportedMacroItems; diff --git a/oox/source/ole/oleobjecthelper.cxx b/oox/source/ole/oleobjecthelper.cxx index 12356c35d515..d55dc65f8df4 100644 --- a/oox/source/ole/oleobjecthelper.cxx +++ b/oox/source/ole/oleobjecthelper.cxx @@ -49,11 +49,12 @@ OleObjectInfo::OleObjectInfo() : { } +static const char g_aEmbeddedObjScheme[] = "vnd.sun.star.EmbeddedObject:"; + OleObjectHelper::OleObjectHelper( const Reference< XMultiServiceFactory >& rxModelFactory, uno::Reference<frame::XModel> const& xModel) : m_xModel(xModel) - , maEmbeddedObjScheme("vnd.sun.star.EmbeddedObject:") , mnObjectId( 100 ) { assert(m_xModel.is()); @@ -150,8 +151,8 @@ bool OleObjectHelper::importOleObject( PropertyMap& rPropMap, const OleObjectInf rOleObject.mbShowAsIcon ? OUString("Icon") : OUString("Content")); OUString aUrl = mxResolver->resolveEmbeddedObjectURL( aObjectId ); - OSL_ENSURE( aUrl.match( maEmbeddedObjScheme ), "OleObjectHelper::importOleObject - unexpected URL scheme" ); - OUString aPersistName = aUrl.copy( maEmbeddedObjScheme.getLength() ); + OSL_ENSURE( aUrl.match( g_aEmbeddedObjScheme ), "OleObjectHelper::importOleObject - unexpected URL scheme" ); + OUString aPersistName = aUrl.copy( strlen(g_aEmbeddedObjScheme) ); if( !aPersistName.isEmpty() ) { rPropMap.setProperty( PROP_PersistName, aPersistName); diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx index 4805ccc342ec..55f753712ffa 100644 --- a/sc/source/filter/xml/XMLStylesExportHelper.cxx +++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx @@ -97,13 +97,7 @@ ScMyValidationsContainer::ScMyValidationsContainer() sINPTITLE(SC_UNONAME_INPTITLE), sINPMESS(SC_UNONAME_INPMESS), sERRTITLE(SC_UNONAME_ERRTITLE), - sERRMESS(SC_UNONAME_ERRMESS), - sOnError("OnError"), - sEventType("EventType"), - sStarBasic("StarBasic"), - sScript("Script"), - sLibrary("Library"), - sMacroName("MacroName") + sERRMESS(SC_UNONAME_ERRMESS) { } @@ -423,17 +417,18 @@ void ScMyValidationsContainer::WriteValidations(ScXMLExport& rExport) // and the property name is "MacroName". bool bScriptURL = SfxApplication::IsXScriptURL( aItr->sErrorTitle ); + const OUString sScript("Script"); uno::Sequence<beans::PropertyValue> aSeq(3); beans::PropertyValue* pArr(aSeq.getArray()); - pArr[0].Name = sEventType; - pArr[0].Value <<= bScriptURL ? sScript : sStarBasic; - pArr[1].Name = sLibrary; + pArr[0].Name = "EventType"; + pArr[0].Value <<= bScriptURL ? sScript : OUString("StarBasic"); + pArr[1].Name = "Library"; pArr[1].Value <<= sEmptyString; - pArr[2].Name = bScriptURL ? sScript : sMacroName; + pArr[2].Name = bScriptURL ? sScript : OUString("MacroName"); pArr[2].Value <<= aItr->sErrorTitle; // 2) export the sequence - rExport.GetEventExport().ExportSingleEvent( aSeq, sOnError); + rExport.GetEventExport().ExportSingleEvent( aSeq, "OnError"); } } break; diff --git a/sc/source/filter/xml/XMLStylesExportHelper.hxx b/sc/source/filter/xml/XMLStylesExportHelper.hxx index 673dedb75bb5..7d2e590c757d 100644 --- a/sc/source/filter/xml/XMLStylesExportHelper.hxx +++ b/sc/source/filter/xml/XMLStylesExportHelper.hxx @@ -64,7 +64,7 @@ typedef std::vector<ScMyValidation> ScMyValidationVec; class ScMyValidationsContainer { private: - ScMyValidationVec aValidationVec; + ScMyValidationVec aValidationVec; const OUString sEmptyString; const OUString sERRALSTY; const OUString sIGNOREBL; @@ -76,12 +76,6 @@ private: const OUString sINPMESS; const OUString sERRTITLE; const OUString sERRMESS; - const OUString sOnError; - const OUString sEventType; - const OUString sStarBasic; - const OUString sScript; - const OUString sLibrary; - const OUString sMacroName; public: ScMyValidationsContainer(); diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index a3eb8657db44..17c7c0ccd356 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -359,7 +359,6 @@ ScXMLExport::ScXMLExport( pValidationsContainer(nullptr), pChangeTrackingExportHelper(nullptr), sLayerID( SC_LAYERID ), - sCaptionShape("com.sun.star.drawing.CaptionShape"), nOpenRow(-1), nProgressCount(0), nCurrentTable(0), @@ -3447,7 +3446,7 @@ void ScXMLExport::WriteShapes(const ScMyCell& rMyCell) { if (bNegativePage) aPoint.X = 2 * aItr->xShape->getPosition().X + aItr->xShape->getSize().Width - aPoint.X; - if ( !aItr->xShape->getShapeType().equals(sCaptionShape) ) + if ( aItr->xShape->getShapeType() != "com.sun.star.drawing.CaptionShape" ) { OUString sEndAddress; ScRangeStringConverter::GetStringFromAddress(sEndAddress, aItr->aEndAddress, pDoc, FormulaGrammar::CONV_OOO); diff --git a/sc/source/filter/xml/xmlexprt.hxx b/sc/source/filter/xml/xmlexprt.hxx index 2d7e3f5d510c..259e373322a1 100644 --- a/sc/source/filter/xml/xmlexprt.hxx +++ b/sc/source/filter/xml/xmlexprt.hxx @@ -111,7 +111,6 @@ class ScXMLExport : public SvXMLExport ScMyValidationsContainer* pValidationsContainer; ScChangeTrackingExportHelper* pChangeTrackingExportHelper; const OUString sLayerID; - const OUString sCaptionShape; OUString sExternalRefTabStyleName; OUString sAttrName; OUString sAttrStyleName; 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; diff --git a/svx/source/tbxctrls/extrusioncontrols.cxx b/svx/source/tbxctrls/extrusioncontrols.cxx index 80bda78901aa..859fe9b06d44 100644 --- a/svx/source/tbxctrls/extrusioncontrols.cxx +++ b/svx/source/tbxctrls/extrusioncontrols.cxx @@ -54,6 +54,8 @@ namespace svx { static const sal_Int32 gSkewList[] = { 135, 90, 45, 180, 0, -360, -135, -90, -45 }; +static const char g_sExtrusionDirection[] = ".uno:ExtrusionDirection"; +static const char g_sExtrusionProjection[] = ".uno:ExtrusionProjection"; ExtrusionDirectionWindow::ExtrusionDirectionWindow( svt::ToolboxController& rController, @@ -65,8 +67,6 @@ ExtrusionDirectionWindow::ExtrusionDirectionWindow( , mrController(rController) , maImgPerspective(SVX_RES(RID_SVXIMG_PERSPECTIVE)) , maImgParallel(SVX_RES(RID_SVXIMG_PARALLEL)) - , msExtrusionDirection(".uno:ExtrusionDirection") - , msExtrusionProjection(".uno:ExtrusionProjection") { for(sal_uInt16 i = DIRECTION_NW; i <= DIRECTION_SE; ++i) { @@ -95,8 +95,8 @@ ExtrusionDirectionWindow::ExtrusionDirectionWindow( SetOutputSizePixel( getMenuSize() ); - AddStatusListener( msExtrusionDirection ); - AddStatusListener( msExtrusionProjection ); + AddStatusListener( g_sExtrusionDirection ); + AddStatusListener( g_sExtrusionProjection ); } ExtrusionDirectionWindow::~ExtrusionDirectionWindow() @@ -167,7 +167,7 @@ void ExtrusionDirectionWindow::statusChanged( const css::frame::FeatureStateEvent& Event ) throw ( css::uno::RuntimeException ) { - if( Event.FeatureURL.Main.equals( msExtrusionDirection ) ) + if( Event.FeatureURL.Main == g_sExtrusionDirection ) { if( !Event.IsEnabled ) { @@ -180,7 +180,7 @@ void ExtrusionDirectionWindow::statusChanged( implSetDirection( nValue ); } } - else if( Event.FeatureURL.Main.equals( msExtrusionProjection ) ) + else if( Event.FeatureURL.Main == g_sExtrusionProjection ) { if( !Event.IsEnabled ) { @@ -213,10 +213,10 @@ void ExtrusionDirectionWindow::SelectHdl(void* pControl) if( pControl == mpDirectionSet ) { Sequence< PropertyValue > aArgs( 1 ); - aArgs[0].Name = msExtrusionDirection.copy(5); + aArgs[0].Name = OUString(g_sExtrusionDirection).copy(5); aArgs[0].Value <<= (sal_Int32)gSkewList[mpDirectionSet->GetSelectItemId()-1]; - mrController.dispatchCommand( msExtrusionDirection, aArgs ); + mrController.dispatchCommand( g_sExtrusionDirection, aArgs ); } else { @@ -224,10 +224,10 @@ void ExtrusionDirectionWindow::SelectHdl(void* pControl) if( (nProjection >= 0) && (nProjection < 2 ) ) { Sequence< PropertyValue > aArgs( 1 ); - aArgs[0].Name = msExtrusionProjection.copy(5); + aArgs[0].Name = OUString(g_sExtrusionProjection).copy(5); aArgs[0].Value <<= (sal_Int32)nProjection; - mrController.dispatchCommand( msExtrusionProjection, aArgs ); + mrController.dispatchCommand( g_sExtrusionProjection, aArgs ); implSetProjection( nProjection ); } } @@ -538,6 +538,9 @@ Sequence< OUString > SAL_CALL ExtrusionDepthController::getSupportedServiceNames return ExtrusionDepthController_getSupportedServiceNames(); } +static const char g_sExtrusionLightingDirection[] = ".uno:ExtrusionLightingDirection"; +static const char g_sExtrusionLightingIntensity[] = ".uno:ExtrusionLightingIntensity"; + ExtrusionLightingWindow::ExtrusionLightingWindow(svt::ToolboxController& rController, const css::uno::Reference<css::frame::XFrame >& rFrame, vcl::Window* pParentWindow) @@ -550,8 +553,6 @@ ExtrusionLightingWindow::ExtrusionLightingWindow(svt::ToolboxController& rContro , mbLevelEnabled(false) , mnDirection(FROM_FRONT) , mbDirectionEnabled(false) - , msExtrusionLightingDirection(".uno:ExtrusionLightingDirection") - , msExtrusionLightingIntensity(".uno:ExtrusionLightingIntensity") { for (sal_uInt16 i = FROM_TOP_LEFT; i <= FROM_BOTTOM_RIGHT; ++i) { @@ -593,8 +594,8 @@ ExtrusionLightingWindow::ExtrusionLightingWindow(svt::ToolboxController& rContro SetOutputSizePixel( getMenuSize() ); - AddStatusListener( msExtrusionLightingDirection ); - AddStatusListener( msExtrusionLightingIntensity ); + AddStatusListener( g_sExtrusionLightingDirection ); + AddStatusListener( g_sExtrusionLightingIntensity ); } ExtrusionLightingWindow::~ExtrusionLightingWindow() @@ -652,7 +653,7 @@ void ExtrusionLightingWindow::statusChanged( const css::frame::FeatureStateEvent& Event ) throw ( css::uno::RuntimeException ) { - if( Event.FeatureURL.Main.equals( msExtrusionLightingIntensity ) ) + if( Event.FeatureURL.Main == g_sExtrusionLightingIntensity ) { if( !Event.IsEnabled ) { @@ -665,7 +666,7 @@ void ExtrusionLightingWindow::statusChanged( implSetIntensity( nValue, true ); } } - else if( Event.FeatureURL.Main.equals( msExtrusionLightingDirection ) ) + else if( Event.FeatureURL.Main == g_sExtrusionLightingDirection ) { if( !Event.IsEnabled ) { @@ -718,10 +719,10 @@ void ExtrusionLightingWindow::SelectHdl(void* pControl) if( nLevel != 3 ) { Sequence< PropertyValue > aArgs( 1 ); - aArgs[0].Name = msExtrusionLightingIntensity.copy(5); + aArgs[0].Name = OUString(g_sExtrusionLightingIntensity).copy(5); aArgs[0].Value <<= (sal_Int32)nLevel; - mrController.dispatchCommand( msExtrusionLightingIntensity, aArgs ); + mrController.dispatchCommand( g_sExtrusionLightingIntensity, aArgs ); implSetIntensity( nLevel, true ); } @@ -736,10 +737,10 @@ void ExtrusionLightingWindow::SelectHdl(void* pControl) nDirection--; Sequence< PropertyValue > aArgs( 1 ); - aArgs[0].Name = msExtrusionLightingDirection.copy(5); + aArgs[0].Name = OUString(g_sExtrusionLightingDirection).copy(5); aArgs[0].Value <<= (sal_Int32)nDirection; - mrController.dispatchCommand( msExtrusionLightingDirection, aArgs ); + mrController.dispatchCommand( g_sExtrusionLightingDirection, aArgs ); implSetDirection( nDirection, true ); } @@ -816,6 +817,8 @@ Sequence< OUString > SAL_CALL ExtrusionLightingControl::getSupportedServiceNames return ExtrusionLightingControl_getSupportedServiceNames(); } +static const char g_sExtrusionSurface[] = ".uno:ExtrusionSurface"; + ExtrusionSurfaceWindow::ExtrusionSurfaceWindow( svt::ToolboxController& rController, const css::uno::Reference< css::frame::XFrame >& rFrame, @@ -826,7 +829,6 @@ ExtrusionSurfaceWindow::ExtrusionSurfaceWindow( , maImgSurface2(SVX_RES(RID_SVXIMG_MATTE)) , maImgSurface3(SVX_RES(RID_SVXIMG_PLASTIC)) , maImgSurface4(SVX_RES(RID_SVXIMG_METAL)) - , msExtrusionSurface(".uno:ExtrusionSurface") { SetSelectHdl( LINK( this, ExtrusionSurfaceWindow, SelectHdl ) ); @@ -837,7 +839,7 @@ ExtrusionSurfaceWindow::ExtrusionSurfaceWindow( SetOutputSizePixel( getMenuSize() ); - AddStatusListener( msExtrusionSurface ); + AddStatusListener( g_sExtrusionSurface ); } void ExtrusionSurfaceWindow::implSetSurface( int nSurface, bool bEnabled ) @@ -853,7 +855,7 @@ void ExtrusionSurfaceWindow::statusChanged( const css::frame::FeatureStateEvent& Event ) throw ( css::uno::RuntimeException ) { - if( Event.FeatureURL.Main.equals( msExtrusionSurface ) ) + if( Event.FeatureURL.Main == g_sExtrusionSurface ) { if( !Event.IsEnabled ) { @@ -879,10 +881,10 @@ IMPL_LINK_NOARG_TYPED(ExtrusionSurfaceWindow, SelectHdl, ToolbarMenu*, void) if( nSurface >= 0 ) { Sequence< PropertyValue > aArgs( 1 ); - aArgs[0].Name = msExtrusionSurface.copy(5); + aArgs[0].Name = OUString(g_sExtrusionSurface).copy(5); aArgs[0].Value <<= (sal_Int32)nSurface; - mrController.dispatchCommand( msExtrusionSurface, aArgs ); + mrController.dispatchCommand( g_sExtrusionSurface, aArgs ); implSetSurface( nSurface, true ); } diff --git a/svx/source/tbxctrls/extrusioncontrols.hxx b/svx/source/tbxctrls/extrusioncontrols.hxx index c2d714eb228e..084fe7d09ba4 100644 --- a/svx/source/tbxctrls/extrusioncontrols.hxx +++ b/svx/source/tbxctrls/extrusioncontrols.hxx @@ -55,9 +55,6 @@ private: Image maImgPerspective; Image maImgParallel; - const OUString msExtrusionDirection; - const OUString msExtrusionProjection; - DECL_LINK_TYPED( SelectToolbarMenuHdl, ToolbarMenu*, void ); DECL_LINK_TYPED( SelectValueSetHdl, ValueSet*, void ); void SelectHdl(void*); @@ -155,9 +152,6 @@ private: int mnDirection; bool mbDirectionEnabled; - const OUString msExtrusionLightingDirection; - const OUString msExtrusionLightingIntensity; - void implSetIntensity( int nLevel, bool bEnabled ); void implSetDirection( int nDirection, bool bEnabled ); @@ -205,8 +199,6 @@ private: Image maImgSurface3; Image maImgSurface4; - const OUString msExtrusionSurface; - DECL_LINK_TYPED( SelectHdl, ToolbarMenu*, void ); void implSetSurface( int nSurface, bool bEnabled ); diff --git a/sw/source/core/inc/unoevent.hxx b/sw/source/core/inc/unoevent.hxx index d942c6065dbd..f0da67bc7afb 100644 --- a/sw/source/core/inc/unoevent.hxx +++ b/sw/source/core/inc/unoevent.hxx @@ -34,8 +34,6 @@ class SwFormatINetFormat; class SwHyperlinkEventDescriptor : public SvDetachedEventDescriptor { - const OUString sImplName; - //XServiceInfo virtual OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException, std::exception ) override; diff --git a/sw/source/core/unocore/unoevent.cxx b/sw/source/core/unocore/unoevent.cxx index 53f311f7d3ea..bb6c1eebd2c0 100644 --- a/sw/source/core/unocore/unoevent.cxx +++ b/sw/source/core/unocore/unoevent.cxx @@ -101,8 +101,7 @@ const struct SvEventDescription aFrameStyleEvents[] = }; SwHyperlinkEventDescriptor::SwHyperlinkEventDescriptor() : - SvDetachedEventDescriptor(aHyperlinkEvents), - sImplName("SwHyperlinkEventDescriptor") + SvDetachedEventDescriptor(aHyperlinkEvents) { } @@ -113,7 +112,7 @@ SwHyperlinkEventDescriptor::~SwHyperlinkEventDescriptor() OUString SwHyperlinkEventDescriptor::getImplementationName() throw( RuntimeException, std::exception ) { - return sImplName; + return OUString("SwHyperlinkEventDescriptor"); } void SwHyperlinkEventDescriptor::copyMacrosFromINetFormat( diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx b/sw/source/filter/xml/XMLRedlineImportHelper.cxx index 73b6d293d3f3..af85125689db 100644 --- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx +++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx @@ -236,6 +236,10 @@ RedlineInfo::~RedlineInfo() delete pNextRedline; } +static const char g_sShowChanges[] = "ShowChanges"; +static const char g_sRecordChanges[] = "RecordChanges"; +static const char g_sRedlineProtectionKey[] = "RedlineProtectionKey"; + XMLRedlineImportHelper::XMLRedlineImportHelper( bool bNoRedlinesPlease, const Reference<XPropertySet> & rModel, @@ -243,9 +247,6 @@ XMLRedlineImportHelper::XMLRedlineImportHelper( sInsertion( GetXMLToken( XML_INSERTION )), sDeletion( GetXMLToken( XML_DELETION )), sFormatChange( GetXMLToken( XML_FORMAT_CHANGE )), - sShowChanges("ShowChanges"), - sRecordChanges("RecordChanges"), - sRedlineProtectionKey("RedlineProtectionKey"), aRedlineMap(), bIgnoreRedlines(bNoRedlinesPlease), xModelPropertySet(rModel), @@ -260,29 +261,29 @@ XMLRedlineImportHelper::XMLRedlineImportHelper( Reference<XPropertySetInfo> xInfo = xImportInfoPropertySet->getPropertySetInfo(); - bHandleShowChanges = ! xInfo->hasPropertyByName( sShowChanges ); - bHandleRecordChanges = ! xInfo->hasPropertyByName( sRecordChanges ); - bHandleProtectionKey = ! xInfo->hasPropertyByName( sRedlineProtectionKey ); + bHandleShowChanges = ! xInfo->hasPropertyByName( g_sShowChanges ); + bHandleRecordChanges = ! xInfo->hasPropertyByName( g_sRecordChanges ); + bHandleProtectionKey = ! xInfo->hasPropertyByName( g_sRedlineProtectionKey ); } // get redline mode bShowChanges = *static_cast<sal_Bool const *>( ( bHandleShowChanges ? xModelPropertySet : xImportInfoPropertySet ) - ->getPropertyValue( sShowChanges ).getValue()); + ->getPropertyValue( g_sShowChanges ).getValue()); bRecordChanges = *static_cast<sal_Bool const *>( ( bHandleRecordChanges ? xModelPropertySet : xImportInfoPropertySet ) - ->getPropertyValue( sRecordChanges ).getValue()); + ->getPropertyValue( g_sRecordChanges ).getValue()); { Any aAny = (bHandleProtectionKey ? xModelPropertySet : xImportInfoPropertySet ) - ->getPropertyValue( sRedlineProtectionKey ); + ->getPropertyValue( g_sRedlineProtectionKey ); aAny >>= aProtectionKey; } // set redline mode to "don't record changes" if( bHandleRecordChanges ) { - xModelPropertySet->setPropertyValue( sRecordChanges, makeAny(false) ); + xModelPropertySet->setPropertyValue( g_sRecordChanges, makeAny(false) ); } } @@ -334,9 +335,9 @@ XMLRedlineImportHelper::~XMLRedlineImportHelper() Reference<XPropertySetInfo> xInfo = xImportInfoPropertySet->getPropertySetInfo(); - bHandleShowChanges = ! xInfo->hasPropertyByName( sShowChanges ); - bHandleRecordChanges = ! xInfo->hasPropertyByName( sRecordChanges ); - bHandleProtectionKey = ! xInfo->hasPropertyByName( sRedlineProtectionKey ); + bHandleShowChanges = ! xInfo->hasPropertyByName( g_sShowChanges ); + bHandleRecordChanges = ! xInfo->hasPropertyByName( g_sRecordChanges ); + bHandleProtectionKey = ! xInfo->hasPropertyByName( g_sRedlineProtectionKey ); } // set redline mode & key @@ -346,21 +347,21 @@ XMLRedlineImportHelper::~XMLRedlineImportHelper() aAny <<= bShowChanges; if ( bHandleShowChanges ) - xModelPropertySet->setPropertyValue( sShowChanges, aAny ); + xModelPropertySet->setPropertyValue( g_sShowChanges, aAny ); else - xImportInfoPropertySet->setPropertyValue( sShowChanges, aAny ); + xImportInfoPropertySet->setPropertyValue( g_sShowChanges, aAny ); aAny <<= bRecordChanges; if ( bHandleRecordChanges ) - xModelPropertySet->setPropertyValue( sRecordChanges, aAny ); + xModelPropertySet->setPropertyValue( g_sRecordChanges, aAny ); else - xImportInfoPropertySet->setPropertyValue( sRecordChanges, aAny ); + xImportInfoPropertySet->setPropertyValue( g_sRecordChanges, aAny ); aAny <<= aProtectionKey; if ( bHandleProtectionKey ) - xModelPropertySet->setPropertyValue( sRedlineProtectionKey, aAny ); + xModelPropertySet->setPropertyValue( g_sRedlineProtectionKey, aAny ); else - xImportInfoPropertySet->setPropertyValue( sRedlineProtectionKey, aAny); + xImportInfoPropertySet->setPropertyValue( g_sRedlineProtectionKey, aAny); } catch (const uno::RuntimeException &) // fdo#65882 { diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.hxx b/sw/source/filter/xml/XMLRedlineImportHelper.hxx index 34761167191b..f78866b692f9 100644 --- a/sw/source/filter/xml/XMLRedlineImportHelper.hxx +++ b/sw/source/filter/xml/XMLRedlineImportHelper.hxx @@ -43,9 +43,6 @@ class XMLRedlineImportHelper const OUString sInsertion; const OUString sDeletion; const OUString sFormatChange; - const OUString sShowChanges; - const OUString sRecordChanges; - const OUString sRedlineProtectionKey; RedlineMapType aRedlineMap; diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx index 7dd8d1bfba31..4a3d4796dabd 100644 --- a/sw/source/filter/xml/xmlexp.cxx +++ b/sw/source/filter/xml/xmlexp.cxx @@ -92,9 +92,7 @@ SwXMLExport::SwXMLExport( bBlock( false ), bShowProgress( true ), bSavedShowChanges( false ), - doc( nullptr ), - sNumberFormat("NumberFormat"), - sIsProtected("IsProtected") + doc( nullptr ) { _InitItemExport(); } diff --git a/sw/source/filter/xml/xmlexp.hxx b/sw/source/filter/xml/xmlexp.hxx index 2f8a1e615869..b6d0da46c7e4 100644 --- a/sw/source/filter/xml/xmlexp.hxx +++ b/sw/source/filter/xml/xmlexp.hxx @@ -97,10 +97,6 @@ class SwXMLExport : public SvXMLExport virtual void GetConfigurationSettings(css::uno::Sequence<css::beans::PropertyValue>& aProps) override; virtual sal_Int32 GetDocumentSpecificSettings( ::std::list< SettingsGroup >& _out_rSettings ) override; - // string constants for table cell export - const OUString sNumberFormat; - const OUString sIsProtected; - void setBlockMode(); private: void DeleteTableLines(); diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx index 227ea830d9b2..47e6a0b1f41a 100644 --- a/sw/source/filter/xml/xmltble.cxx +++ b/sw/source/filter/xml/xmltble.cxx @@ -62,6 +62,10 @@ using table::XCell; using ::std::vector; using ::std::advance; +// string constants for table cell export +static const char g_sNumberFormat[] = "NumberFormat"; +static const char g_sIsProtected[] = "IsProtected"; + class SwXMLTableColumn_Impl : public SwWriteTableCol { OUString sStyleName; @@ -794,7 +798,7 @@ void SwXMLExport::ExportTableBox( const SwTableBox& rBox, if (xCellPropertySet.is()) { sal_Int32 nNumberFormat = 0; - Any aAny = xCellPropertySet->getPropertyValue(sNumberFormat); + Any aAny = xCellPropertySet->getPropertyValue(g_sNumberFormat); aAny >>= nNumberFormat; if (css::util::NumberFormat::TEXT == nNumberFormat) @@ -814,7 +818,7 @@ void SwXMLExport::ExportTableBox( const SwTableBox& rBox, // else: invalid key; ignore // cell protection - aAny = xCellPropertySet->getPropertyValue(sIsProtected); + aAny = xCellPropertySet->getPropertyValue(g_sIsProtected); if (*static_cast<sal_Bool const *>(aAny.getValue())) { AddAttribute( XML_NAMESPACE_TABLE, XML_PROTECTED, |