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 /unotools | |
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 'unotools')
-rw-r--r-- | unotools/source/config/moduleoptions.cxx | 30 | ||||
-rw-r--r-- | unotools/source/config/securityoptions.cxx | 42 |
2 files changed, 36 insertions, 36 deletions
diff --git a/unotools/source/config/moduleoptions.cxx b/unotools/source/config/moduleoptions.cxx index 8082749e998b..317f5261c76d 100644 --- a/unotools/source/config/moduleoptions.cxx +++ b/unotools/source/config/moduleoptions.cxx @@ -69,17 +69,17 @@ #define PROPERTYCOUNT 6 -#define FACTORYNAME_WRITER "com.sun.star.text.TextDocument" -#define FACTORYNAME_WRITERWEB "com.sun.star.text.WebDocument" -#define FACTORYNAME_WRITERGLOBAL "com.sun.star.text.GlobalDocument" -#define FACTORYNAME_CALC "com.sun.star.sheet.SpreadsheetDocument" -#define FACTORYNAME_DRAW "com.sun.star.drawing.DrawingDocument" -#define FACTORYNAME_IMPRESS "com.sun.star.presentation.PresentationDocument" -#define FACTORYNAME_MATH "com.sun.star.formula.FormulaProperties" -#define FACTORYNAME_CHART "com.sun.star.chart2.ChartDocument" -#define FACTORYNAME_DATABASE "com.sun.star.sdb.OfficeDatabaseDocument" -#define FACTORYNAME_STARTMODULE "com.sun.star.frame.StartModule" -#define FACTORYNAME_BASIC "com.sun.star.script.BasicIDE" +#define FACTORYNAME_WRITER u"com.sun.star.text.TextDocument" +#define FACTORYNAME_WRITERWEB u"com.sun.star.text.WebDocument" +#define FACTORYNAME_WRITERGLOBAL u"com.sun.star.text.GlobalDocument" +#define FACTORYNAME_CALC u"com.sun.star.sheet.SpreadsheetDocument" +#define FACTORYNAME_DRAW u"com.sun.star.drawing.DrawingDocument" +#define FACTORYNAME_IMPRESS u"com.sun.star.presentation.PresentationDocument" +#define FACTORYNAME_MATH u"com.sun.star.formula.FormulaProperties" +#define FACTORYNAME_CHART u"com.sun.star.chart2.ChartDocument" +#define FACTORYNAME_DATABASE u"com.sun.star.sdb.OfficeDatabaseDocument" +#define FACTORYNAME_STARTMODULE u"com.sun.star.frame.StartModule" +#define FACTORYNAME_BASIC u"com.sun.star.script.BasicIDE" #define FACTORYCOUNT 11 @@ -255,7 +255,7 @@ class SvtModuleOptions_Impl : public ::utl::ConfigItem OUString const & GetFactoryDefaultFilter ( SvtModuleOptions::EFactory eFactory ) const; bool IsDefaultFilterReadonly( SvtModuleOptions::EFactory eFactory ) const; sal_Int32 GetFactoryIcon ( SvtModuleOptions::EFactory eFactory ) const; - static bool ClassifyFactoryByName ( const OUString& sName , + static bool ClassifyFactoryByName ( std::u16string_view sName , SvtModuleOptions::EFactory& eFactory ); void SetFactoryStandardTemplate( SvtModuleOptions::EFactory eFactory , const OUString& sTemplate ); @@ -590,7 +590,7 @@ css::uno::Sequence< OUString > SvtModuleOptions_Impl::impl_ExpandSetNames( const @onerror We return false. @threadsafe no *//*-*************************************************************************************************************/ -bool SvtModuleOptions_Impl::ClassifyFactoryByName( const OUString& sName, SvtModuleOptions::EFactory& eFactory ) +bool SvtModuleOptions_Impl::ClassifyFactoryByName( std::u16string_view sName, SvtModuleOptions::EFactory& eFactory ) { bool bState; @@ -838,7 +838,7 @@ sal_Int32 SvtModuleOptions::GetFactoryIcon( EFactory eFactory ) const return m_pImpl->GetFactoryIcon( eFactory ); } -bool SvtModuleOptions::ClassifyFactoryByName( const OUString& sName , +bool SvtModuleOptions::ClassifyFactoryByName( std::u16string_view sName , EFactory& eFactory ) { // We don't need any mutex here ... because we don't use any member here! @@ -966,7 +966,7 @@ SvtModuleOptions::EFactory SvtModuleOptions::ClassifyFactoryByShortName(const OU return EFactory::UNKNOWN_FACTORY; } -SvtModuleOptions::EFactory SvtModuleOptions::ClassifyFactoryByServiceName(const OUString& sName) +SvtModuleOptions::EFactory SvtModuleOptions::ClassifyFactoryByServiceName(std::u16string_view sName) { if (sName == FACTORYNAME_WRITERGLOBAL) return EFactory::WRITERGLOBAL; diff --git a/unotools/source/config/securityoptions.cxx b/unotools/source/config/securityoptions.cxx index 6a99a87ca207..5062653413b9 100644 --- a/unotools/source/config/securityoptions.cxx +++ b/unotools/source/config/securityoptions.cxx @@ -46,27 +46,27 @@ using namespace ::com::sun::star::uno; // xmlsec05 deprecated #define DEFAULT_STAROFFICEBASIC eALWAYS_EXECUTE -#define PROPERTYNAME_SECUREURL "SecureURL" -#define PROPERTYNAME_DOCWARN_SAVEORSEND "WarnSaveOrSendDoc" -#define PROPERTYNAME_DOCWARN_SIGNING "WarnSignDoc" -#define PROPERTYNAME_DOCWARN_PRINT "WarnPrintDoc" -#define PROPERTYNAME_DOCWARN_CREATEPDF "WarnCreatePDF" -#define PROPERTYNAME_DOCWARN_REMOVEPERSONALINFO "RemovePersonalInfoOnSaving" -#define PROPERTYNAME_DOCWARN_RECOMMENDPASSWORD "RecommendPasswordProtection" -#define PROPERTYNAME_CTRLCLICK_HYPERLINK "HyperlinksWithCtrlClick" -#define PROPERTYNAME_BLOCKUNTRUSTEDREFERERLINKS "BlockUntrustedRefererLinks" -#define PROPERTYNAME_MACRO_SECLEVEL "MacroSecurityLevel" -#define PROPERTYNAME_MACRO_TRUSTEDAUTHORS "TrustedAuthors" -#define PROPERTYNAME_MACRO_DISABLE "DisableMacrosExecution" -#define PROPERTYNAME_TRUSTEDAUTHOR_SUBJECTNAME "SubjectName" -#define PROPERTYNAME_TRUSTEDAUTHOR_SERIALNUMBER "SerialNumber" -#define PROPERTYNAME_TRUSTEDAUTHOR_RAWDATA "RawData" +#define PROPERTYNAME_SECUREURL u"SecureURL" +#define PROPERTYNAME_DOCWARN_SAVEORSEND u"WarnSaveOrSendDoc" +#define PROPERTYNAME_DOCWARN_SIGNING u"WarnSignDoc" +#define PROPERTYNAME_DOCWARN_PRINT u"WarnPrintDoc" +#define PROPERTYNAME_DOCWARN_CREATEPDF u"WarnCreatePDF" +#define PROPERTYNAME_DOCWARN_REMOVEPERSONALINFO u"RemovePersonalInfoOnSaving" +#define PROPERTYNAME_DOCWARN_RECOMMENDPASSWORD u"RecommendPasswordProtection" +#define PROPERTYNAME_CTRLCLICK_HYPERLINK u"HyperlinksWithCtrlClick" +#define PROPERTYNAME_BLOCKUNTRUSTEDREFERERLINKS u"BlockUntrustedRefererLinks" +#define PROPERTYNAME_MACRO_SECLEVEL u"MacroSecurityLevel" +#define PROPERTYNAME_MACRO_TRUSTEDAUTHORS u"TrustedAuthors" +#define PROPERTYNAME_MACRO_DISABLE u"DisableMacrosExecution" +#define PROPERTYNAME_TRUSTEDAUTHOR_SUBJECTNAME u"SubjectName" +#define PROPERTYNAME_TRUSTEDAUTHOR_SERIALNUMBER u"SerialNumber" +#define PROPERTYNAME_TRUSTEDAUTHOR_RAWDATA u"RawData" // xmlsec05 deprecated -#define PROPERTYNAME_STAROFFICEBASIC "OfficeBasic" -#define PROPERTYNAME_EXECUTEPLUGINS "ExecutePlugins" -#define PROPERTYNAME_WARNINGENABLED "Warning" -#define PROPERTYNAME_CONFIRMATIONENABLED "Confirmation" +#define PROPERTYNAME_STAROFFICEBASIC u"OfficeBasic" +#define PROPERTYNAME_EXECUTEPLUGINS u"ExecutePlugins" +#define PROPERTYNAME_WARNINGENABLED u"Warning" +#define PROPERTYNAME_CONFIRMATIONENABLED u"Confirmation" // xmlsec05 deprecated #define PROPERTYHANDLE_SECUREURL 0 @@ -147,7 +147,7 @@ class SvtSecurityOptions_Impl : public ConfigItem void SetProperty( sal_Int32 nHandle, const Any& rValue, bool bReadOnly ); void LoadAuthors(); - static sal_Int32 GetHandle( const OUString& rPropertyName ); + static sal_Int32 GetHandle( std::u16string_view rPropertyName ); bool GetOption( SvtSecurityOptions::EOption eOption, bool*& rpValue, bool*& rpRO ); /*-**************************************************************************************************** @@ -457,7 +457,7 @@ void SvtSecurityOptions_Impl::LoadAuthors() m_seqTrustedAuthors = comphelper::containerToSequence(v); } -sal_Int32 SvtSecurityOptions_Impl::GetHandle( const OUString& rName ) +sal_Int32 SvtSecurityOptions_Impl::GetHandle( std::u16string_view rName ) { sal_Int32 nHandle; |