diff options
author | Noel <noelgrandin@gmail.com> | 2020-11-25 08:14:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-11-30 12:32:14 +0100 |
commit | 8332d6d8200e8ca1f22dd98d9373efd5a431d09c (patch) | |
tree | dd45d452202998297b8562743ea6345462304d04 /include | |
parent | d05a4cfbdcece491f7385dbeaa7eca03f2fdc1d5 (diff) |
loplugin:stringviewparam include comparisons with string literals
Change-Id: I8ba1214500dddaf413c506a4b82f43d63cda804b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106559
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/avmedia/MediaControlBase.hxx | 2 | ||||
-rw-r--r-- | include/comphelper/docpasswordhelper.hxx | 6 | ||||
-rw-r--r-- | include/editeng/unoprnms.hxx | 16 | ||||
-rw-r--r-- | include/linguistic/misc.hxx | 8 | ||||
-rw-r--r-- | include/oox/core/filterdetect.hxx | 2 | ||||
-rw-r--r-- | include/oox/drawingml/color.hxx | 2 | ||||
-rw-r--r-- | include/oox/dump/dumperbase.hxx | 4 | ||||
-rw-r--r-- | include/oox/export/drawingml.hxx | 2 | ||||
-rw-r--r-- | include/oox/helper/attributelist.hxx | 2 | ||||
-rw-r--r-- | include/oox/ppt/slidetransition.hxx | 2 | ||||
-rw-r--r-- | include/sfx2/charwin.hxx | 2 | ||||
-rw-r--r-- | include/sfx2/infobar.hxx | 2 | ||||
-rw-r--r-- | include/sfx2/lokhelper.hxx | 2 | ||||
-rw-r--r-- | include/sfx2/templatedlglocalview.hxx | 2 | ||||
-rw-r--r-- | include/sfx2/templatelocalview.hxx | 4 | ||||
-rw-r--r-- | include/svx/SvxPresetListBox.hxx | 2 | ||||
-rw-r--r-- | include/svx/charmap.hxx | 2 | ||||
-rw-r--r-- | include/svx/imapdlg.hxx | 2 | ||||
-rw-r--r-- | include/unotools/moduleoptions.hxx | 4 | ||||
-rw-r--r-- | include/vcl/IconThemeInfo.hxx | 2 | ||||
-rw-r--r-- | include/vcl/builder.hxx | 2 | ||||
-rw-r--r-- | include/xmloff/odffields.hxx | 4 |
22 files changed, 38 insertions, 38 deletions
diff --git a/include/avmedia/MediaControlBase.hxx b/include/avmedia/MediaControlBase.hxx index 44a93d0e0dde..3d4464ce0424 100644 --- a/include/avmedia/MediaControlBase.hxx +++ b/include/avmedia/MediaControlBase.hxx @@ -63,7 +63,7 @@ protected: void UpdateVolumeSlider( MediaItem const & aMediaItem ); void UpdateTimeSlider( MediaItem const & aMediaItem ); void UpdateTimeField( MediaItem const & aMediaItem, double fTime ); - void SelectPlayToolBoxItem( MediaItem& aExecItem, MediaItem const & aItem, const OString& rId); + void SelectPlayToolBoxItem( MediaItem& aExecItem, MediaItem const & aItem, std::string_view rId); void disposeWidgets(); }; diff --git a/include/comphelper/docpasswordhelper.hxx b/include/comphelper/docpasswordhelper.hxx index 7505e3bdf2c4..fc98fd3ff34d 100644 --- a/include/comphelper/docpasswordhelper.hxx +++ b/include/comphelper/docpasswordhelper.hxx @@ -223,7 +223,7 @@ public: const OUString& rSaltValue, sal_uInt32 nSpinCount, comphelper::Hash::IterCount eIterCount, - const OUString& rAlgorithmName); + std::u16string_view rAlgorithmName); /** Convenience function to calculate a salted hash with iterations as @@ -269,7 +269,7 @@ public: const OUString& rSaltValue, sal_uInt32 nSpinCount, comphelper::Hash::IterCount eIterCount, - const OUString& rAlgorithmName); + std::u16string_view rAlgorithmName); /** Convenience function to calculate a salted hash with iterations as @@ -313,7 +313,7 @@ public: const std::vector<unsigned char>& rSaltValue, sal_uInt32 nSpinCount, comphelper::Hash::IterCount eIterCount, - const OUString& rAlgorithmName); + std::u16string_view rAlgorithmName); /** This helper function generates a random sequence of bytes of diff --git a/include/editeng/unoprnms.hxx b/include/editeng/unoprnms.hxx index 35355a2f3186..011e504ae7f4 100644 --- a/include/editeng/unoprnms.hxx +++ b/include/editeng/unoprnms.hxx @@ -92,18 +92,18 @@ #define UNO_NAME_EDGERADIUS "CornerRadius" #define UNO_NAME_TEXT_MINFRAMEHEIGHT "TextMinimumFrameHeight" -#define UNO_NAME_TEXT_AUTOGROWHEIGHT "TextAutoGrowHeight" +#define UNO_NAME_TEXT_AUTOGROWHEIGHT u"TextAutoGrowHeight" #define UNO_NAME_TEXT_FITTOSIZE "TextFitToSize" -#define UNO_NAME_TEXT_LEFTDIST "TextLeftDistance" -#define UNO_NAME_TEXT_RIGHTDIST "TextRightDistance" -#define UNO_NAME_TEXT_UPPERDIST "TextUpperDistance" -#define UNO_NAME_TEXT_LOWERDIST "TextLowerDistance" -#define UNO_NAME_TEXT_VERTADJUST "TextVerticalAdjust" +#define UNO_NAME_TEXT_LEFTDIST u"TextLeftDistance" +#define UNO_NAME_TEXT_RIGHTDIST u"TextRightDistance" +#define UNO_NAME_TEXT_UPPERDIST u"TextUpperDistance" +#define UNO_NAME_TEXT_LOWERDIST u"TextLowerDistance" +#define UNO_NAME_TEXT_VERTADJUST u"TextVerticalAdjust" #define UNO_NAME_TEXT_MAXFRAMEHEIGHT "TextMaximumFrameHeight" #define UNO_NAME_TEXT_MINFRAMEWIDTH "TextMinimumFrameWidth" #define UNO_NAME_TEXT_MAXFRAMEWIDTH "TextMaximumFrameWidth" #define UNO_NAME_TEXT_AUTOGROWWIDTH "TextAutoGrowWidth" -#define UNO_NAME_TEXT_HORZADJUST "TextHorizontalAdjust" +#define UNO_NAME_TEXT_HORZADJUST u"TextHorizontalAdjust" #define UNO_NAME_TEXT_ANIKIND "TextAnimationKind" #define UNO_NAME_TEXT_ANIDIRECTION "TextAnimationDirection" #define UNO_NAME_TEXT_ANISTARTINSIDE "TextAnimationStartInside" @@ -112,7 +112,7 @@ #define UNO_NAME_TEXT_ANIDELAY "TextAnimationDelay" #define UNO_NAME_TEXT_ANIAMOUNT "TextAnimationAmount" #define UNO_NAME_TEXT_CONTOURFRAME "TextContourFrame" -#define UNO_NAME_TEXT_WRITINGMODE "TextWritingMode" +#define UNO_NAME_TEXT_WRITINGMODE u"TextWritingMode" #define UNO_NAME_TEXT_FONTINDEPENDENTLINESPACING "FontIndependentLineSpacing" #define UNO_NAME_TEXT_WORDWRAP "TextWordWrap" #define UNO_NAME_TEXT_CHAINNEXTNAME "TextChainNextName" diff --git a/include/linguistic/misc.hxx b/include/linguistic/misc.hxx index a251ced79c63..aba180066990 100644 --- a/include/linguistic/misc.hxx +++ b/include/linguistic/misc.hxx @@ -46,10 +46,10 @@ class CharClass; class LocaleDataWrapper; -#define SN_GRAMMARCHECKER "com.sun.star.linguistic2.Proofreader" -#define SN_SPELLCHECKER "com.sun.star.linguistic2.SpellChecker" -#define SN_HYPHENATOR "com.sun.star.linguistic2.Hyphenator" -#define SN_THESAURUS "com.sun.star.linguistic2.Thesaurus" +#define SN_GRAMMARCHECKER u"com.sun.star.linguistic2.Proofreader" +#define SN_SPELLCHECKER u"com.sun.star.linguistic2.SpellChecker" +#define SN_HYPHENATOR u"com.sun.star.linguistic2.Hyphenator" +#define SN_THESAURUS u"com.sun.star.linguistic2.Thesaurus" namespace linguistic diff --git a/include/oox/core/filterdetect.hxx b/include/oox/core/filterdetect.hxx index 59e989c36ea3..ec0cd81a52db 100644 --- a/include/oox/core/filterdetect.hxx +++ b/include/oox/core/filterdetect.hxx @@ -84,7 +84,7 @@ public: private: void parseRelationship( const AttributeList& rAttribs ); - OUString getFilterNameFromContentType( const OUString& rContentType, const OUString& rFileName ); + OUString getFilterNameFromContentType( std::u16string_view rContentType, const OUString& rFileName ); void parseContentTypesDefault( const AttributeList& rAttribs ); void parseContentTypesOverride( const AttributeList& rAttribs ); diff --git a/include/oox/drawingml/color.hxx b/include/oox/drawingml/color.hxx index 5642b4000fc5..59f417cfac52 100644 --- a/include/oox/drawingml/color.hxx +++ b/include/oox/drawingml/color.hxx @@ -104,7 +104,7 @@ public: /** Translates between color transformation tokens and their names */ static OUString getColorTransformationName( sal_Int32 nElement ); /** Translates between color transformation token names and the corresponding token */ - static sal_Int32 getColorTransformationToken( const OUString& sName ); + static sal_Int32 getColorTransformationToken( std::u16string_view sName ); /// Compares this color with rOther. bool equals(const Color& rOther, const GraphicHelper& rGraphicHelper, ::Color nPhClr) const; diff --git a/include/oox/dump/dumperbase.hxx b/include/oox/dump/dumperbase.hxx index d0b954c7be5a..74aa1da81213 100644 --- a/include/oox/dump/dumperbase.hxx +++ b/include/oox/dump/dumperbase.hxx @@ -330,8 +330,8 @@ public: static OUString trimTrailingNul( const OUString& rStr ); static OString convertToUtf8( const OUString& rStr ); - static DataType convertToDataType( const OUString& rStr ); - static FormatType convertToFormatType( const OUString& rStr ); + static DataType convertToDataType( std::u16string_view rStr ); + static FormatType convertToFormatType( std::u16string_view rStr ); static bool convertFromDec( sal_Int64& ornData, const OUString& rData ); static bool convertFromHex( sal_Int64& ornData, const OUString& rData ); diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx index 6c310fa0cbac..31eeb727760f 100644 --- a/include/oox/export/drawingml.hxx +++ b/include/oox/export/drawingml.hxx @@ -281,7 +281,7 @@ public: void WriteFill( const css::uno::Reference< css::beans::XPropertySet >& xPropSet ); void WriteShapeStyle( const css::uno::Reference< css::beans::XPropertySet >& rXPropSet ); void WriteShapeEffects( const css::uno::Reference< css::beans::XPropertySet >& rXPropSet ); - void WriteShapeEffect( const OUString& sName, const css::uno::Sequence< css::beans::PropertyValue >& aEffectProps ); + void WriteShapeEffect( std::u16string_view sName, const css::uno::Sequence< css::beans::PropertyValue >& aEffectProps ); void WriteShape3DEffects( const css::uno::Reference< css::beans::XPropertySet >& rXPropSet ); void WriteArtisticEffect( const css::uno::Reference< css::beans::XPropertySet >& rXPropSet ); OString WriteWdpPicture( const OUString& rFileId, const css::uno::Sequence< sal_Int8 >& rPictureData ); diff --git a/include/oox/helper/attributelist.hxx b/include/oox/helper/attributelist.hxx index 43808761c922..4e3210bd3919 100644 --- a/include/oox/helper/attributelist.hxx +++ b/include/oox/helper/attributelist.hxx @@ -41,7 +41,7 @@ namespace sax_fastparser { namespace oox { /* Get the color tokens from their string representatives. */ - sal_Int32 getHighlightColorTokenFromString(const OUString& sColorName); + sal_Int32 getHighlightColorTokenFromString(std::u16string_view sColorName); /** Static helpers for conversion of strings to attribute values of various different data types. diff --git a/include/oox/ppt/slidetransition.hxx b/include/oox/ppt/slidetransition.hxx index 40b664231d9f..36f5eca9cebe 100644 --- a/include/oox/ppt/slidetransition.hxx +++ b/include/oox/ppt/slidetransition.hxx @@ -62,7 +62,7 @@ namespace oox::ppt { void setOoxTransitionType( ::sal_Int32 OoxType, ::sal_Int32 param1, ::sal_Int32 param2 ); - void setPresetTransition(OUString const & sPresetTransition); + void setPresetTransition(std::u16string_view sPresetTransition); private: ::sal_Int16 mnTransitionType; diff --git a/include/sfx2/charwin.hxx b/include/sfx2/charwin.hxx index 253bed5c1bd1..f4118d44ceb6 100644 --- a/include/sfx2/charwin.hxx +++ b/include/sfx2/charwin.hxx @@ -64,7 +64,7 @@ public: void setClearClickHdl(const Link<SvxCharView*,void> &rLink); void setClearAllClickHdl(const Link<SvxCharView*,void> &rLink); - void ContextMenuSelect(const OString& rIdent); + void ContextMenuSelect(std::string_view rIdent); }; #endif diff --git a/include/sfx2/infobar.hxx b/include/sfx2/infobar.hxx index 3b821a785c42..2b89052110b7 100644 --- a/include/sfx2/infobar.hxx +++ b/include/sfx2/infobar.hxx @@ -128,7 +128,7 @@ public: VclPtr<SfxInfoBarWindow> getInfoBar(std::u16string_view sId); bool hasInfoBarWithID(std::u16string_view sId); void removeInfoBar(VclPtr<SfxInfoBarWindow> const& pInfoBar); - static bool isInfobarEnabled(const OUString& sId); + static bool isInfobarEnabled(std::u16string_view sId); void TriggerUpdateLayout(); diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx index 521bf4207458..252b2d6d6e9e 100644 --- a/include/sfx2/lokhelper.hxx +++ b/include/sfx2/lokhelper.hxx @@ -73,7 +73,7 @@ public: /// Get the device form factor that should be used for a new view. static LOKDeviceFormFactor getDeviceFormFactor(); /// Set the device form factor that should be used for a new view. - static void setDeviceFormFactor(const OUString& rDeviceFormFactor); + static void setDeviceFormFactor(std::u16string_view rDeviceFormFactor); /// Iterate over any view shell, except pThisViewShell, passing it to the f function. template<typename ViewShellType, typename FunctionType> diff --git a/include/sfx2/templatedlglocalview.hxx b/include/sfx2/templatedlglocalview.hxx index bd51d72766c5..b3a50eeff50c 100644 --- a/include/sfx2/templatedlglocalview.hxx +++ b/include/sfx2/templatedlglocalview.hxx @@ -42,7 +42,7 @@ public: void MakeItemVisible(sal_uInt16 nId) { ThumbnailView::MakeItemVisible(nId); } private: - void ContextMenuSelectHdl(const OString& rIdent); + void ContextMenuSelectHdl(std::string_view rIdent); void insertFilteredItems(); diff --git a/include/sfx2/templatelocalview.hxx b/include/sfx2/templatelocalview.hxx index 99ccbab5ecc1..9b8569c04b03 100644 --- a/include/sfx2/templatelocalview.hxx +++ b/include/sfx2/templatelocalview.hxx @@ -55,7 +55,7 @@ public: bool operator () (const ThumbnailViewItem *pItem); - static bool isFilteredExtension(FILTER_APPLICATION filter, const OUString &rExt); + static bool isFilteredExtension(FILTER_APPLICATION filter, std::u16string_view rExt); bool isValid (const OUString& rPath) const; private: @@ -90,7 +90,7 @@ public: void createContextMenu(const bool bIsDefault ); - void ContextMenuSelectHdl(const OString& rIdent); + void ContextMenuSelectHdl(std::string_view rIdent); TemplateContainerItem* getRegion(std::u16string_view sStr); diff --git a/include/svx/SvxPresetListBox.hxx b/include/svx/SvxPresetListBox.hxx index 7b5cca421f54..ec608c830754 100644 --- a/include/svx/SvxPresetListBox.hxx +++ b/include/svx/SvxPresetListBox.hxx @@ -32,7 +32,7 @@ private: Link<SvxPresetListBox*,void> maRenameHdl; Link<SvxPresetListBox*,void> maDeleteHdl; - void OnMenuItemSelected(const OString& rIdent); + void OnMenuItemSelected(std::string_view rIdent); template< typename ListType, typename EntryType > void FillPresetListBoxImpl(ListType& pList, sal_uInt32 nStartIndex); diff --git a/include/svx/charmap.hxx b/include/svx/charmap.hxx index 25341d5f8e8c..5ea7b1f2e0be 100644 --- a/include/svx/charmap.hxx +++ b/include/svx/charmap.hxx @@ -152,7 +152,7 @@ protected: // abstraction layers are: Unicode<->MapIndex<->Pixel Point MapIndexToPixel( int) const; DECL_LINK(VscrollHdl, weld::ScrolledWindow&, void); - void ContextMenuSelect(const OString& rIdent); + void ContextMenuSelect(std::string_view rIdent); void init(); tools::Rectangle getGridRectangle(const Point &rPointUL, const Size &rOutputSize); diff --git a/include/svx/imapdlg.hxx b/include/svx/imapdlg.hxx index 74b5a69a005f..edd80a41285e 100644 --- a/include/svx/imapdlg.hxx +++ b/include/svx/imapdlg.hxx @@ -118,7 +118,7 @@ class SVX_DLLPUBLIC SvxIMapDlg : public SfxModelessDialogController void URLModify(); void DoOpen(); bool DoSave(); - void SetActiveTool(const OString& rId); + void SetActiveTool(std::string_view rId); public: diff --git a/include/unotools/moduleoptions.hxx b/include/unotools/moduleoptions.hxx index 969fac8ad598..3293560c3733 100644 --- a/include/unotools/moduleoptions.hxx +++ b/include/unotools/moduleoptions.hxx @@ -99,7 +99,7 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtModuleOptions final : public utl::de OUString GetFactoryDefaultFilter ( EFactory eFactory ) const; bool IsDefaultFilterReadonly ( EFactory eFactory ) const; sal_Int32 GetFactoryIcon ( EFactory eFactory ) const; - static bool ClassifyFactoryByName ( const OUString& sName , + static bool ClassifyFactoryByName ( std::u16string_view sName , EFactory& eFactory ); void SetFactoryStandardTemplate( EFactory eFactory , const OUString& sTemplate ); @@ -109,7 +109,7 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtModuleOptions final : public utl::de /** @short return the corresponding application ID for the given document service name. */ - static EFactory ClassifyFactoryByServiceName(const OUString& sName); + static EFactory ClassifyFactoryByServiceName(std::u16string_view sName); /** @short return the corresponding application ID for the given short name. diff --git a/include/vcl/IconThemeInfo.hxx b/include/vcl/IconThemeInfo.hxx index c398754c88a1..ec116ca2f4fc 100644 --- a/include/vcl/IconThemeInfo.hxx +++ b/include/vcl/IconThemeInfo.hxx @@ -48,7 +48,7 @@ public: * It is not clear where this information belongs to. The sizes were hard-coded before they moved here. * Maybe there is a way to determine the sizes from the icon theme packages. */ - static Size SizeByThemeName(const OUString&); + static Size SizeByThemeName(std::u16string_view); /** Check whether an IconThemeInfo can be constructed from a URL */ static bool UrlCanBeParsed(const OUString& url); diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx index 6e9c9505fde9..d108f16a9dba 100644 --- a/include/vcl/builder.hxx +++ b/include/vcl/builder.hxx @@ -372,7 +372,7 @@ private: void handleMenuChild(Menu *pParent, xmlreader::XmlReader &reader); void handleMenuObject(Menu *pParent, xmlreader::XmlReader &reader); - void handleListStore(xmlreader::XmlReader &reader, const OString &rID, const OString &rClass); + void handleListStore(xmlreader::XmlReader &reader, const OString &rID, std::string_view rClass); void handleRow(xmlreader::XmlReader &reader, const OString &rID); void handleTabChild(vcl::Window *pParent, xmlreader::XmlReader &reader); VclPtr<Menu> handleMenu(xmlreader::XmlReader &reader, const OString &rID, bool bMenuBar); diff --git a/include/xmloff/odffields.hxx b/include/xmloff/odffields.hxx index 890c618cc604..89c2e6174335 100644 --- a/include/xmloff/odffields.hxx +++ b/include/xmloff/odffields.hxx @@ -23,12 +23,12 @@ #define ODF_FORMTEXT "vnd.oasis.opendocument.field.FORMTEXT" #define ODF_FORMFIELD_DEFAULT_LENGTH 5 -#define ODF_FORMCHECKBOX "vnd.oasis.opendocument.field.FORMCHECKBOX" +#define ODF_FORMCHECKBOX u"vnd.oasis.opendocument.field.FORMCHECKBOX" #define ODF_FORMCHECKBOX_HELPTEXT "Checkbox_HelpText" #define ODF_FORMCHECKBOX_NAME "Checkbox_Name" #define ODF_FORMCHECKBOX_RESULT "Checkbox_Checked" -#define ODF_FORMDROPDOWN "vnd.oasis.opendocument.field.FORMDROPDOWN" +#define ODF_FORMDROPDOWN u"vnd.oasis.opendocument.field.FORMDROPDOWN" #define ODF_FORMDROPDOWN_LISTENTRY "Dropdown_ListEntry" #define ODF_FORMDROPDOWN_RESULT "Dropdown_Selected" #define ODF_FORMDROPDOWN_ENTRY_COUNT_LIMIT 25 |