diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-16 16:57:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-22 13:31:57 +0200 |
commit | 60bc26354763fa3461db49a3e827da552484150d (patch) | |
tree | 5c66cee43f76f556f9a086a67fa8a6e88750c5d5 /include | |
parent | 7867e1f1cdd726cb98a236245e3d08557cc3a313 (diff) |
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/oox/helper/modelobjecthelper.hxx | 4 | ||||
-rw-r--r-- | include/oox/vml/vmlinputstream.hxx | 2 | ||||
-rw-r--r-- | include/rtl/ustring.hxx | 3 | ||||
-rw-r--r-- | include/svtools/unoevent.hxx | 2 | ||||
-rw-r--r-- | include/svx/xmleohlp.hxx | 2 | ||||
-rw-r--r-- | include/vbahelper/vbaglobalbase.hxx | 1 | ||||
-rw-r--r-- | include/xmloff/SettingsExportHelper.hxx | 8 | ||||
-rw-r--r-- | include/xmloff/XMLEventExport.hxx | 2 | ||||
-rw-r--r-- | include/xmloff/XMLPageExport.hxx | 3 | ||||
-rw-r--r-- | include/xmloff/XMLTextMasterPageContext.hxx | 1 | ||||
-rw-r--r-- | include/xmloff/XMLTextMasterPageExport.hxx | 14 | ||||
-rw-r--r-- | include/xmloff/XMLTextShapeImportHelper.hxx | 4 | ||||
-rw-r--r-- | include/xmloff/XMLTextShapeStyleContext.hxx | 2 | ||||
-rw-r--r-- | include/xmloff/numehelp.hxx | 4 | ||||
-rw-r--r-- | include/xmloff/prstylei.hxx | 2 | ||||
-rw-r--r-- | include/xmloff/shapeexport.hxx | 22 | ||||
-rw-r--r-- | include/xmloff/shapeimport.hxx | 5 | ||||
-rw-r--r-- | include/xmloff/styleexp.hxx | 5 | ||||
-rw-r--r-- | include/xmloff/txtparae.hxx | 95 | ||||
-rw-r--r-- | include/xmloff/xmlnume.hxx | 3 | ||||
-rw-r--r-- | include/xmloff/xmlnumi.hxx | 4 | ||||
-rw-r--r-- | include/xmloff/xmlstyle.hxx | 3 |
22 files changed, 23 insertions, 168 deletions
diff --git a/include/oox/helper/modelobjecthelper.hxx b/include/oox/helper/modelobjecthelper.hxx index eb9c7ba97228..5b5dea4f4092 100644 --- a/include/oox/helper/modelobjecthelper.hxx +++ b/include/oox/helper/modelobjecthelper.hxx @@ -117,10 +117,6 @@ private: ObjectContainer maGradientContainer; ///< Contains all named fill gradients. ObjectContainer maTransGradContainer; ///< Contains all named transparency Gradients. ObjectContainer maBitmapUrlContainer; ///< Contains all named fill bitmap URLs. - const OUString maDashNameBase; ///< Base name for all named line dashes. - const OUString maGradientNameBase; ///< Base name for all named fill gradients. - const OUString maTransGradNameBase; ///< Base name for all named fill gradients. - const OUString maBitmapUrlNameBase; ///< Base name for all named fill bitmap URLs. }; diff --git a/include/oox/vml/vmlinputstream.hxx b/include/oox/vml/vmlinputstream.hxx index ed5db08330f4..54b93bbe4344 100644 --- a/include/oox/vml/vmlinputstream.hxx +++ b/include/oox/vml/vmlinputstream.hxx @@ -90,8 +90,6 @@ private: mxTextStrm; css::uno::Sequence< sal_Unicode > maOpeningBracket; css::uno::Sequence< sal_Unicode > maClosingBracket; - const OString maOpeningCData; - const OString maClosingCData; OString maBuffer; sal_Int32 mnBufferPos; }; diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx index 1795f486162b..7ab872e9d61d 100644 --- a/include/rtl/ustring.hxx +++ b/include/rtl/ustring.hxx @@ -87,6 +87,9 @@ struct SAL_WARN_UNUSED OUStringLiteral int size; const char* data; + + // So we can use this struct in some places interchangeably with OUString + constexpr sal_Int32 getLength() const { return size; } }; /// @endcond diff --git a/include/svtools/unoevent.hxx b/include/svtools/unoevent.hxx index 74470085ff52..bb2d438fe04f 100644 --- a/include/svtools/unoevent.hxx +++ b/include/svtools/unoevent.hxx @@ -207,8 +207,6 @@ class SVT_DLLPUBLIC SvDetachedEventDescriptor : public SvBaseEventDescriptor // the macros; aMacros[i] is the value for aSupportedMacroItemIDs[i] std::vector<std::unique_ptr<SvxMacro>> aMacros; - const OUString sImplName; - public: SvDetachedEventDescriptor(const SvEventDescription* pSupportedMacroItems); diff --git a/include/svx/xmleohlp.hxx b/include/svx/xmleohlp.hxx index c96f40c3d75c..2cd352bc159d 100644 --- a/include/svx/xmleohlp.hxx +++ b/include/svx/xmleohlp.hxx @@ -46,8 +46,6 @@ class SVX_DLLPUBLIC SvXMLEmbeddedObjectHelper final : { ::osl::Mutex maMutex; - const OUString maReplacementGraphicsContainerStorageName; - const OUString maReplacementGraphicsContainerStorageName60; OUString maCurContainerStorageName; diff --git a/include/vbahelper/vbaglobalbase.hxx b/include/vbahelper/vbaglobalbase.hxx index fe338acd7f21..ed1f2114fcfb 100644 --- a/include/vbahelper/vbaglobalbase.hxx +++ b/include/vbahelper/vbaglobalbase.hxx @@ -48,7 +48,6 @@ class VBAHELPER_DLLPUBLIC VbaGlobalsBase : public Globals_BASE { protected: const OUString msDocCtxName; - const OUString msApplication; bool hasServiceName( const OUString& serviceName ); void init( const css::uno::Sequence< css::beans::PropertyValue >& aInitArgs ); 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<OUString> 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<SvXMLTokenMap> mp3DSphereObjectAttrTokenMap; std::unique_ptr<SvXMLTokenMap> 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<rtl::Reference<SvxXMLListLevelStyleContext_Impl>> 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<SvxXMLListStyle_Impl> 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<SvXMLStylesContext_Impl> mpImpl; std::unique_ptr<SvXMLTokenMap> mpStyleStylesElemTokenMap; |