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 --- .../text/XMLFootnoteConfigurationImportContext.cxx | 48 +++++++++++----------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx') diff --git a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx index 31412606573f..633a2151c400 100644 --- a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx +++ b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx @@ -109,6 +109,18 @@ void XMLFootnoteConfigHelper::Characters( const OUString& rChars ) // XMLFootnoteConfigurationImportContext +static const OUStringLiteral gsPropertyAnchorCharStyleName("AnchorCharStyleName"); +static const OUStringLiteral gsPropertyCharStyleName("CharStyleName"); +static const OUStringLiteral gsPropertyNumberingType("NumberingType"); +static const OUStringLiteral gsPropertyPageStyleName("PageStyleName"); +static const OUStringLiteral gsPropertyParagraphStyleName("ParaStyleName"); +static const OUStringLiteral gsPropertyPrefix("Prefix"); +static const OUStringLiteral gsPropertyStartAt("StartAt"); +static const OUStringLiteral gsPropertySuffix("Suffix"); +static const OUStringLiteral gsPropertyPositionEndOfDoc("PositionEndOfDoc"); +static const OUStringLiteral gsPropertyFootnoteCounting("FootnoteCounting"); +static const OUStringLiteral gsPropertyEndNotice("EndNotice"); +static const OUStringLiteral gsPropertyBeginNotice("BeginNotice"); XMLFootnoteConfigurationImportContext::XMLFootnoteConfigurationImportContext( SvXMLImport& rImport, @@ -116,18 +128,6 @@ XMLFootnoteConfigurationImportContext::XMLFootnoteConfigurationImportContext( const OUString& rLocalName, const Reference & xAttrList) : SvXMLStyleContext(rImport, nPrfx, rLocalName, xAttrList, XML_STYLE_FAMILY_TEXT_FOOTNOTECONFIG) -, sPropertyAnchorCharStyleName("AnchorCharStyleName") -, sPropertyCharStyleName("CharStyleName") -, sPropertyNumberingType("NumberingType") -, sPropertyPageStyleName("PageStyleName") -, sPropertyParagraphStyleName("ParaStyleName") -, sPropertyPrefix("Prefix") -, sPropertyStartAt("StartAt") -, sPropertySuffix("Suffix") -, sPropertyPositionEndOfDoc("PositionEndOfDoc") -, sPropertyFootnoteCounting("FootnoteCounting") -, sPropertyEndNotice("EndNotice") -, sPropertyBeginNotice("BeginNotice") , sNumFormat("1") , sNumSync("false") , pAttrTokenMap(nullptr) @@ -356,33 +356,33 @@ void XMLFootnoteConfigurationImportContext::ProcessSettings( { aAny <<= GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_TEXT, sCitationStyle ); - rConfig->setPropertyValue(sPropertyCharStyleName, aAny); + rConfig->setPropertyValue(gsPropertyCharStyleName, aAny); } if (!sAnchorStyle.isEmpty()) { aAny <<= GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_TEXT, sAnchorStyle ); - rConfig->setPropertyValue(sPropertyAnchorCharStyleName, aAny); + rConfig->setPropertyValue(gsPropertyAnchorCharStyleName, aAny); } if (!sPageStyle.isEmpty()) { aAny <<= GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_MASTER_PAGE, sPageStyle ); - rConfig->setPropertyValue(sPropertyPageStyleName, aAny); + rConfig->setPropertyValue(gsPropertyPageStyleName, aAny); } if (!sDefaultStyle.isEmpty()) { aAny <<= GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_PARAGRAPH, sDefaultStyle ); - rConfig->setPropertyValue(sPropertyParagraphStyleName, aAny); + rConfig->setPropertyValue(gsPropertyParagraphStyleName, aAny); } - rConfig->setPropertyValue(sPropertyPrefix, Any(sPrefix)); + rConfig->setPropertyValue(gsPropertyPrefix, Any(sPrefix)); - rConfig->setPropertyValue(sPropertySuffix, Any(sSuffix)); + rConfig->setPropertyValue(gsPropertySuffix, Any(sSuffix)); sal_Int16 nNumType = NumberingType::ARABIC; GetImport().GetMM100UnitConverter().convertNumFormat( nNumType, sNumFormat, @@ -392,16 +392,16 @@ void XMLFootnoteConfigurationImportContext::ProcessSettings( if( NumberingType::CHAR_SPECIAL == nNumType ) nNumType = NumberingType::ARABIC; - rConfig->setPropertyValue(sPropertyNumberingType, Any(nNumType)); + rConfig->setPropertyValue(gsPropertyNumberingType, Any(nNumType)); - rConfig->setPropertyValue(sPropertyStartAt, Any(nOffset)); + rConfig->setPropertyValue(gsPropertyStartAt, Any(nOffset)); if (!bIsEndnote) { - rConfig->setPropertyValue(sPropertyPositionEndOfDoc, Any(bPosition)); - rConfig->setPropertyValue(sPropertyFootnoteCounting, Any(nNumbering)); - rConfig->setPropertyValue(sPropertyEndNotice, Any(sEndNotice)); - rConfig->setPropertyValue(sPropertyBeginNotice, Any(sBeginNotice)); + rConfig->setPropertyValue(gsPropertyPositionEndOfDoc, Any(bPosition)); + rConfig->setPropertyValue(gsPropertyFootnoteCounting, Any(nNumbering)); + rConfig->setPropertyValue(gsPropertyEndNotice, Any(sEndNotice)); + rConfig->setPropertyValue(gsPropertyBeginNotice, Any(sBeginNotice)); } } -- cgit