From 60bc26354763fa3461db49a3e827da552484150d Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 16 Aug 2018 16:57:15 +0200 Subject: new loplugin:conststringfield Look for const string fields which can be static, and mostly convert them to OUStringLiteral And add a getLength() method to OUStringLiteral to make the transition easier. Remove dead code in XclExpRoot::GenerateDefaultEncryptionData, default password is never empty. Change-Id: Iae75514d9dbb87289fd5b016222f640abe755091 Reviewed-on: https://gerrit.libreoffice.org/59204 Tested-by: Jenkins Reviewed-by: Noel Grandin --- xmloff/source/script/XMLStarBasicContextFactory.cxx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'xmloff/source/script/XMLStarBasicContextFactory.cxx') diff --git a/xmloff/source/script/XMLStarBasicContextFactory.cxx b/xmloff/source/script/XMLStarBasicContextFactory.cxx index f849db55758d..7dd340b00301 100644 --- a/xmloff/source/script/XMLStarBasicContextFactory.cxx +++ b/xmloff/source/script/XMLStarBasicContextFactory.cxx @@ -33,11 +33,12 @@ using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; -XMLStarBasicContextFactory::XMLStarBasicContextFactory() : - sEventType("EventType"), - sLibrary("Library"), - sMacroName("MacroName"), - sStarBasic("StarBasic") +static const OUStringLiteral gsEventType("EventType"); +static const OUStringLiteral gsLibrary("Library"); +static const OUStringLiteral gsMacroName("MacroName"); +static const OUStringLiteral gsStarBasic("StarBasic"); + +XMLStarBasicContextFactory::XMLStarBasicContextFactory() { } @@ -95,15 +96,15 @@ SvXMLImportContext* XMLStarBasicContextFactory::CreateContext( Sequence aValues(3); // EventType - aValues[0].Name = sEventType; - aValues[0].Value <<= sStarBasic; + aValues[0].Name = gsEventType; + aValues[0].Value <<= OUString(gsStarBasic); // library name - aValues[1].Name = sLibrary; + aValues[1].Name = gsLibrary; aValues[1].Value <<= sLibraryVal; // macro name - aValues[2].Name = sMacroName; + aValues[2].Name = gsMacroName; aValues[2].Value <<= sMacroNameVal; // add values for event now -- cgit