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 --- include/xmloff/SettingsExportHelper.hxx | 8 --- include/xmloff/XMLEventExport.hxx | 2 - include/xmloff/XMLPageExport.hxx | 3 - include/xmloff/XMLTextMasterPageContext.hxx | 1 - include/xmloff/XMLTextMasterPageExport.hxx | 14 ----- include/xmloff/XMLTextShapeImportHelper.hxx | 4 -- include/xmloff/XMLTextShapeStyleContext.hxx | 2 - include/xmloff/numehelp.hxx | 4 -- include/xmloff/prstylei.hxx | 2 - include/xmloff/shapeexport.hxx | 22 ------- include/xmloff/shapeimport.hxx | 5 -- include/xmloff/styleexp.hxx | 5 -- include/xmloff/txtparae.hxx | 95 ++++++----------------------- include/xmloff/xmlnume.hxx | 3 - include/xmloff/xmlnumi.hxx | 4 -- include/xmloff/xmlstyle.hxx | 3 - 16 files changed, 20 insertions(+), 157 deletions(-) (limited to 'include/xmloff') diff --git a/include/xmloff/SettingsExportHelper.hxx b/include/xmloff/SettingsExportHelper.hxx index df73af11999d..ff503b2b2749 100644 --- a/include/xmloff/SettingsExportHelper.hxx +++ b/include/xmloff/SettingsExportHelper.hxx @@ -46,14 +46,6 @@ class XMLOFF_DLLPUBLIC XMLSettingsExportHelper css::uno::Reference< css::util::XStringSubstitution > mxStringSubsitution; - const OUString msPrinterIndependentLayout; - const OUString msColorTableURL; - const OUString msLineEndTableURL; - const OUString msHatchTableURL; - const OUString msDashTableURL; - const OUString msGradientTableURL; - const OUString msBitmapTableURL; - void ManipulateSetting( css::uno::Any& rAny, const OUString& rName ) const; void CallTypeFunction(const css::uno::Any& rAny, diff --git a/include/xmloff/XMLEventExport.hxx b/include/xmloff/XMLEventExport.hxx index 5ca4a2b23448..797fc4a6dde3 100644 --- a/include/xmloff/XMLEventExport.hxx +++ b/include/xmloff/XMLEventExport.hxx @@ -58,8 +58,6 @@ typedef ::std::map< OUString, XMLEventName > NameMap; */ class XMLOFF_DLLPUBLIC XMLEventExport { - const OUString sEventType; - SvXMLExport& rExport; HandlerMap aHandlerMap; diff --git a/include/xmloff/XMLPageExport.hxx b/include/xmloff/XMLPageExport.hxx index 0bfee31c8b59..4df54310e731 100644 --- a/include/xmloff/XMLPageExport.hxx +++ b/include/xmloff/XMLPageExport.hxx @@ -53,9 +53,6 @@ class XMLOFF_DLLPUBLIC XMLPageExport : public salhelper::SimpleReferenceObject { SvXMLExport& rExport; - const OUString sIsPhysical; - const OUString sFollowStyle; - css::uno::Reference< css::container::XNameAccess > xPageStyles; ::std::vector< XMLPageExportNameEntry > aNameVector; diff --git a/include/xmloff/XMLTextMasterPageContext.hxx b/include/xmloff/XMLTextMasterPageContext.hxx index ca715494dcca..cda2bb4a77a4 100644 --- a/include/xmloff/XMLTextMasterPageContext.hxx +++ b/include/xmloff/XMLTextMasterPageContext.hxx @@ -31,7 +31,6 @@ namespace com { namespace sun { namespace star { class XMLOFF_DLLPUBLIC XMLTextMasterPageContext : public SvXMLStyleContext { - const OUString sFollowStyle; OUString sFollow; OUString sPageMasterName; diff --git a/include/xmloff/XMLTextMasterPageExport.hxx b/include/xmloff/XMLTextMasterPageExport.hxx index 150a74020c48..c56e90116c31 100644 --- a/include/xmloff/XMLTextMasterPageExport.hxx +++ b/include/xmloff/XMLTextMasterPageExport.hxx @@ -32,20 +32,6 @@ namespace com { namespace sun { namespace star { class XMLOFF_DLLPUBLIC XMLTextMasterPageExport : public XMLPageExport { - const OUString sHeaderText; - const OUString sHeaderOn; - const OUString sHeaderShareContent; - const OUString sHeaderTextFirst; - const OUString sHeaderTextLeft; - - const OUString sFirstShareContent; - - const OUString sFooterText; - const OUString sFooterOn; - const OUString sFooterShareContent; - const OUString sFooterTextFirst; - const OUString sFooterTextLeft; - protected: virtual void exportHeaderFooterContent( diff --git a/include/xmloff/XMLTextShapeImportHelper.hxx b/include/xmloff/XMLTextShapeImportHelper.hxx index 7a1a0a03f6fe..42f5d412f5b4 100644 --- a/include/xmloff/XMLTextShapeImportHelper.hxx +++ b/include/xmloff/XMLTextShapeImportHelper.hxx @@ -28,10 +28,6 @@ class XMLOFF_DLLPUBLIC XMLTextShapeImportHelper : public XMLShapeImportHelper { SvXMLImport& rImport; - const OUString sAnchorType; - const OUString sAnchorPageNo; - const OUString sVertOrientPosition; - public: XMLTextShapeImportHelper( SvXMLImport& rImp ); diff --git a/include/xmloff/XMLTextShapeStyleContext.hxx b/include/xmloff/XMLTextShapeStyleContext.hxx index f1f9bf5a49d5..830da64c1838 100644 --- a/include/xmloff/XMLTextShapeStyleContext.hxx +++ b/include/xmloff/XMLTextShapeStyleContext.hxx @@ -25,8 +25,6 @@ class XMLOFF_DLLPUBLIC XMLTextShapeStyleContext : public XMLShapeStyleContext { - const OUString sIsAutoUpdate; - bool bAutoUpdate : 1; SvXMLImportContextRef xEventContext; diff --git a/include/xmloff/numehelp.hxx b/include/xmloff/numehelp.hxx index dba76e714ed7..9402eaec011c 100644 --- a/include/xmloff/numehelp.hxx +++ b/include/xmloff/numehelp.hxx @@ -59,16 +59,12 @@ class XMLOFF_DLLPUBLIC XMLNumberFormatAttributesExportHelper { css::uno::Reference< css::util::XNumberFormats > xNumberFormats; SvXMLExport* pExport; - const OUString sStandardFormat; - const OUString sType; const OUString sAttrValue; const OUString sAttrDateValue; const OUString sAttrTimeValue; const OUString sAttrBooleanValue; const OUString sAttrStringValue; const OUString sAttrCurrency; - const OUString msCurrencySymbol; - const OUString msCurrencyAbbreviation; XMLNumberFormatSet aNumberFormats; public: XMLNumberFormatAttributesExportHelper(css::uno::Reference< css::util::XNumberFormatsSupplier > const & xNumberFormatsSupplier); diff --git a/include/xmloff/prstylei.hxx b/include/xmloff/prstylei.hxx index 1fbda3c11f77..da79ed726ad7 100644 --- a/include/xmloff/prstylei.hxx +++ b/include/xmloff/prstylei.hxx @@ -40,8 +40,6 @@ typedef std::unordered_set OldFillStyleDefinitionSet; class XMLOFF_DLLPUBLIC XMLPropStyleContext : public SvXMLStyleContext { private: - const OUString msIsPhysical; - const OUString msFollowStyle; ::std::vector< XMLPropertyState > maProperties; css::uno::Reference < css::style::XStyle > mxStyle; SvXMLImportContextRef mxStyles; diff --git a/include/xmloff/shapeexport.hxx b/include/xmloff/shapeexport.hxx index 1865210d5bde..def1bd936536 100644 --- a/include/xmloff/shapeexport.hxx +++ b/include/xmloff/shapeexport.hxx @@ -182,28 +182,6 @@ private: SAL_DLLPRIVATE const rtl::Reference< SvXMLExportPropertyMapper >& GetPropertySetMapper() const { return mxPropertySetMapper; } - const OUString msZIndex; - const OUString msPrintable; - const OUString msVisible; - - const OUString msModel; - const OUString msStartShape; - const OUString msEndShape; - const OUString msOnClick; - const OUString msEventType; - const OUString msPresentation; - const OUString msMacroName; - const OUString msScript; - const OUString msLibrary; - const OUString msClickAction; - const OUString msBookmark; - const OUString msEffect; - const OUString msPlayFull; - const OUString msVerb; - const OUString msSoundURL; - const OUString msSpeed; - const OUString msStarBasic; - OUStringBuffer msBuffer; SAL_DLLPRIVATE void ImpCalcShapeType(const css::uno::Reference< css::drawing::XShape >& xShape, XmlShapeType& eShapeType); diff --git a/include/xmloff/shapeimport.hxx b/include/xmloff/shapeimport.hxx index 080b71a02d0f..db7804be82b5 100644 --- a/include/xmloff/shapeimport.hxx +++ b/include/xmloff/shapeimport.hxx @@ -242,11 +242,6 @@ class XMLOFF_DLLPUBLIC XMLShapeImportHelper : public salhelper::SimpleReferenceO std::unique_ptr mp3DSphereObjectAttrTokenMap; std::unique_ptr mp3DLightAttrTokenMap; - const OUString msStartShape; - const OUString msEndShape; - const OUString msStartGluePointIndex; - const OUString msEndGluePointIndex; - rtl::Reference< XMLTableImport > mxShapeTableImport; protected: diff --git a/include/xmloff/styleexp.hxx b/include/xmloff/styleexp.hxx index 0418aaebc8e5..66a23053005e 100644 --- a/include/xmloff/styleexp.hxx +++ b/include/xmloff/styleexp.hxx @@ -52,11 +52,6 @@ class SvXMLExport; class XMLOFF_DLLPUBLIC XMLStyleExport : public salhelper::SimpleReferenceObject { SvXMLExport& rExport; - const OUString sIsPhysical; - const OUString sIsAutoUpdate; - const OUString sFollowStyle; - const OUString sNumberingStyleName; - const OUString sOutlineLevel; SvXMLAutoStylePoolP *pAutoStylePool; protected: diff --git a/include/xmloff/txtparae.hxx b/include/xmloff/txtparae.hxx index 6a09abdaf30f..f19080d0c518 100644 --- a/include/xmloff/txtparae.hxx +++ b/include/xmloff/txtparae.hxx @@ -132,83 +132,28 @@ public: private: // Implement Title/Description Elements UI (#i73249#) - const OUString sTitle; - const OUString sDescription; - const OUString sAnchorCharStyleName; - const OUString sAnchorPageNo; - const OUString sAnchorType; - const OUString sBeginNotice; - const OUString sBookmark; - const OUString sCategory; - const OUString sChainNextName; - const OUString sCharStyleName; - const OUString sCharStyleNames; - const OUString sContourPolyPolygon; - const OUString sDocumentIndexMark; - const OUString sEndNotice; - const OUString sFootnote; - const OUString sFootnoteCounting; - const OUString sFrame; - const OUString sGraphicFilter; - const OUString sGraphicRotation; - const OUString sHeight; - const OUString sHoriOrient; - const OUString sHoriOrientPosition; - const OUString sHyperLinkName; - const OUString sHyperLinkTarget; - const OUString sHyperLinkURL; - const OUString sIsAutomaticContour; - const OUString sIsCollapsed; - const OUString sIsPixelContour; - const OUString sIsStart; - const OUString sIsSyncHeightToWidth; - const OUString sIsSyncWidthToHeight; - const OUString sNumberingRules; - const OUString sNumberingType; - const OUString sPageDescName; - const OUString sPageStyleName; - const OUString sParaConditionalStyleName; - const OUString sParagraphService; - const OUString sParaStyleName; - const OUString sPositionEndOfDoc; - const OUString sPrefix; - const OUString sRedline; - const OUString sReferenceId; - const OUString sReferenceMark; - const OUString sRelativeHeight; - const OUString sRelativeWidth; - const OUString sRuby; - const OUString sRubyCharStyleName; - const OUString sRubyText; - const OUString sServerMap; - const OUString sShapeService; - const OUString sSizeType; - const OUString sSoftPageBreak; - const OUString sStartAt; - const OUString sSuffix; - const OUString sTableService; - const OUString sText; - const OUString sTextContentService; - const OUString sTextEmbeddedService; - const OUString sTextEndnoteService; - const OUString sTextField; - const OUString sTextFieldService; - const OUString sTextFrameService; - const OUString sTextGraphicService; - const OUString sTextPortionType; - const OUString sTextSection; - const OUString sUnvisitedCharStyleName; - const OUString sVertOrient; - const OUString sVertOrientPosition; - const OUString sVisitedCharStyleName; - const OUString sWidth; - const OUString sWidthType; - const OUString sTextFieldStart; - const OUString sTextFieldEnd; - const OUString sTextFieldStartEnd; + static const OUStringLiteral gsAnchorCharStyleName; + static const OUStringLiteral gsBeginNotice; + static const OUStringLiteral gsCategory; + static const OUStringLiteral gsCharStyleName; + static const OUStringLiteral gsCharStyleNames; + static const OUStringLiteral gsEndNotice; + static const OUStringLiteral gsFootnote; + static const OUStringLiteral gsFootnoteCounting; + static const OUStringLiteral gsNumberingType; + static const OUStringLiteral gsPageDescName; + static const OUStringLiteral gsPageStyleName; + static const OUStringLiteral gsParaStyleName; + static const OUStringLiteral gsPositionEndOfDoc; + static const OUStringLiteral gsPrefix; + static const OUStringLiteral gsReferenceId; + static const OUStringLiteral gsStartAt; + static const OUStringLiteral gsSuffix; + static const OUStringLiteral gsTextEndnoteService; + static const OUStringLiteral gsTextSection; protected: - const OUString sFrameStyleName; + static const OUStringLiteral gsFrameStyleName; SinglePropertySetInfoCache aCharStyleNamesPropInfoCache; SvXMLAutoStylePoolP& GetAutoStylePool() { return rAutoStylePool; } diff --git a/include/xmloff/xmlnume.hxx b/include/xmloff/xmlnume.hxx index 0a4b1b5836ea..f8d905e522f4 100644 --- a/include/xmloff/xmlnume.hxx +++ b/include/xmloff/xmlnume.hxx @@ -40,9 +40,6 @@ class XMLTextListAutoStylePool; class XMLOFF_DLLPUBLIC SvxXMLNumRuleExport final { SvXMLExport& rExport; - const OUString sNumberingRules; - const OUString sIsPhysical; - const OUString sIsContinuousNumbering; // Boolean indicating, if properties for position-and-space-mode LABEL_ALIGNMENT // are exported or not. (#i89178#) // These properties have been introduced in ODF 1.2. Thus, its export have diff --git a/include/xmloff/xmlnumi.hxx b/include/xmloff/xmlnumi.hxx index 57898f76d254..877340d34df1 100644 --- a/include/xmloff/xmlnumi.hxx +++ b/include/xmloff/xmlnumi.hxx @@ -38,10 +38,6 @@ typedef std::vector> SvxXMLList class XMLOFF_DLLPUBLIC SvxXMLListStyleContext : public SvXMLStyleContext { - const OUString sIsPhysical; - const OUString sNumberingRules; - const OUString sIsContinuousNumbering; - css::uno::Reference< css::container::XIndexReplace > xNumRules; std::unique_ptr pLevelStyles; diff --git a/include/xmloff/xmlstyle.hxx b/include/xmloff/xmlstyle.hxx index 1c06b1388aed..292af5128e3e 100644 --- a/include/xmloff/xmlstyle.hxx +++ b/include/xmloff/xmlstyle.hxx @@ -148,9 +148,6 @@ public: class XMLOFF_DLLPUBLIC SvXMLStylesContext : public SvXMLImportContext { - const OUString msParaStyleServiceName; - const OUString msTextStyleServiceName; - std::unique_ptr mpImpl; std::unique_ptr mpStyleStylesElemTokenMap; -- cgit