From bb06f51308428500c9c8d11ae05f0aa03ecc179c Mon Sep 17 00:00:00 2001 From: Noel Date: Wed, 18 Nov 2020 10:10:40 +0200 Subject: loplugin:stringviewparam extend to comparison operators which means that some call sites have to change to use unicode string literals i.e. u"foo" instead of "foo" Change-Id: Ie51c3adf56d343dd1d1710777f9d2a43ee66221c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106125 Tested-by: Jenkins Reviewed-by: Noel Grandin --- starmath/inc/dialog.hxx | 4 ++-- starmath/inc/smmod.hxx | 4 ++-- starmath/inc/symbol.hxx | 2 +- starmath/source/cfgitem.cxx | 4 ++-- starmath/source/cfgitem.hxx | 4 ++-- starmath/source/dialog.cxx | 6 +++--- starmath/source/parse.cxx | 2 +- starmath/source/smmod.cxx | 4 ++-- starmath/source/symbol.cxx | 4 ++-- 9 files changed, 17 insertions(+), 17 deletions(-) (limited to 'starmath') diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx index cb3fcc677069..d3017f8e9554 100644 --- a/starmath/inc/dialog.hxx +++ b/starmath/inc/dialog.hxx @@ -34,7 +34,7 @@ class SvxShowCharSet; /**************************************************************************/ -void SetFontStyle(const OUString &rStyleName, vcl::Font &rFont); +void SetFontStyle(std::u16string_view rStyleName, vcl::Font &rFont); /**************************************************************************/ @@ -432,7 +432,7 @@ class SmSymDefineDialog final : public weld::GenericDialogController void FillStyles(); void SetSymbolSetManager(const SmSymbolManager &rMgr); - void SetFont(const OUString &rFontName, const OUString &rStyleName); + void SetFont(const OUString &rFontName, std::u16string_view rStyleName); void SetOrigSymbol(const SmSym *pSymbol, const OUString &rSymbolSetName); void UpdateButtons(); diff --git a/starmath/inc/smmod.hxx b/starmath/inc/smmod.hxx index a8f1ac17c467..3bab0068495b 100644 --- a/starmath/inc/smmod.hxx +++ b/starmath/inc/smmod.hxx @@ -57,10 +57,10 @@ public: SmLocalizedSymbolData() = delete; static OUString GetUiSymbolName( const OUString &rExportName ); - static OUString GetExportSymbolName( const OUString &rUiName ); + static OUString GetExportSymbolName( std::u16string_view rUiName ); static OUString GetUiSymbolSetName( const OUString &rExportName ); - static OUString GetExportSymbolSetName( const OUString &rUiName ); + static OUString GetExportSymbolSetName( std::u16string_view rUiName ); }; class SmModule final : public SfxModule, public utl::ConfigurationListener diff --git a/starmath/inc/symbol.hxx b/starmath/inc/symbol.hxx index 58f757c4e3a2..5b43d3f0692d 100644 --- a/starmath/inc/symbol.hxx +++ b/starmath/inc/symbol.hxx @@ -87,7 +87,7 @@ public: // symbol sets are for UI purpose only, thus we assemble them here std::set< OUString > GetSymbolSetNames() const; - SymbolPtrVec_t GetSymbolSet( const OUString& rSymbolSetName ); + SymbolPtrVec_t GetSymbolSet( std::u16string_view rSymbolSetName ); SymbolPtrVec_t GetSymbols() const; bool AddOrReplaceSymbol( const SmSym & rSymbol, bool bForceChange = false ); diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx index f3c0ec3e99b8..a7d7d51f71af 100644 --- a/starmath/source/cfgitem.cxx +++ b/starmath/source/cfgitem.cxx @@ -237,7 +237,7 @@ void SmFontFormatList::AddFontFormat( const OUString &rFntFmtId, } -void SmFontFormatList::RemoveFontFormat( const OUString &rFntFmtId ) +void SmFontFormatList::RemoveFontFormat( std::u16string_view rFntFmtId ) { // search for entry @@ -254,7 +254,7 @@ void SmFontFormatList::RemoveFontFormat( const OUString &rFntFmtId ) } -const SmFontFormat * SmFontFormatList::GetFontFormat( const OUString &rFntFmtId ) const +const SmFontFormat * SmFontFormatList::GetFontFormat( std::u16string_view rFntFmtId ) const { const SmFontFormat *pRes = nullptr; diff --git a/starmath/source/cfgitem.hxx b/starmath/source/cfgitem.hxx index 8fa101187297..fe11ce08f409 100644 --- a/starmath/source/cfgitem.hxx +++ b/starmath/source/cfgitem.hxx @@ -77,9 +77,9 @@ public: void Clear(); void AddFontFormat( const OUString &rFntFmtId, const SmFontFormat &rFntFmt ); - void RemoveFontFormat( const OUString &rFntFmtId ); + void RemoveFontFormat( std::u16string_view rFntFmtId ); - const SmFontFormat * GetFontFormat( const OUString &rFntFmtId ) const; + const SmFontFormat * GetFontFormat( std::u16string_view rFntFmtId ) const; const SmFontFormat * GetFontFormat( size_t nPos ) const; OUString GetFontFormatId( const SmFontFormat &rFntFmt ) const; OUString GetFontFormatId( const SmFontFormat &rFntFmt, bool bAdd ); diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 5902669c8df4..f13d0558abe3 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -134,12 +134,12 @@ static const SmFontStyles & GetFontStyles() return aImpl; } -void SetFontStyle(const OUString &rStyleName, vcl::Font &rFont) +void SetFontStyle(std::u16string_view rStyleName, vcl::Font &rFont) { // Find index related to StyleName. For an empty StyleName it's assumed to be // 0 (neither bold nor italic). sal_uInt16 nIndex = 0; - if (!rStyleName.isEmpty()) + if (!rStyleName.empty()) { sal_uInt16 i; const SmFontStyles &rStyles = GetFontStyles(); @@ -1952,7 +1952,7 @@ bool SmSymDefineDialog::SelectSymbol(weld::ComboBox& rComboBox, } -void SmSymDefineDialog::SetFont(const OUString &rFontName, const OUString &rStyleName) +void SmSymDefineDialog::SetFont(const OUString &rFontName, std::u16string_view rStyleName) { // get Font (FontInfo) matching name and style FontMetric aFontMetric; diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx index 4ac26866e07c..b558da047cc0 100644 --- a/starmath/source/parse.cxx +++ b/starmath/source/parse.cxx @@ -2567,7 +2567,7 @@ std::unique_ptr SmParser::DoSpecial() } else if (IsExportSymbolNames()) { - aNewName = SmLocalizedSymbolData::GetExportSymbolName(rName.copy(1)); + aNewName = SmLocalizedSymbolData::GetExportSymbolName(rName.subView(1)); bReplace = true; } } diff --git a/starmath/source/smmod.cxx b/starmath/source/smmod.cxx index 208d6677f6c7..f0a809803a9e 100644 --- a/starmath/source/smmod.cxx +++ b/starmath/source/smmod.cxx @@ -61,7 +61,7 @@ OUString SmLocalizedSymbolData::GetUiSymbolName( const OUString &rExportName ) return aRes; } -OUString SmLocalizedSymbolData::GetExportSymbolName( const OUString &rUiName ) +OUString SmLocalizedSymbolData::GetExportSymbolName( std::u16string_view rUiName ) { OUString aRes; @@ -94,7 +94,7 @@ OUString SmLocalizedSymbolData::GetUiSymbolSetName( const OUString &rExportName return aRes; } -OUString SmLocalizedSymbolData::GetExportSymbolSetName( const OUString &rUiName ) +OUString SmLocalizedSymbolData::GetExportSymbolSetName( std::u16string_view rUiName ) { OUString aRes; diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx index 5e6a6486a337..0d2f33045c08 100644 --- a/starmath/source/symbol.cxx +++ b/starmath/source/symbol.cxx @@ -187,10 +187,10 @@ std::set< OUString > SmSymbolManager::GetSymbolSetNames() const } -SymbolPtrVec_t SmSymbolManager::GetSymbolSet( const OUString& rSymbolSetName ) +SymbolPtrVec_t SmSymbolManager::GetSymbolSet( std::u16string_view rSymbolSetName ) { SymbolPtrVec_t aRes; - if (!rSymbolSetName.isEmpty()) + if (!rSymbolSetName.empty()) { for (const auto& rEntry : m_aSymbols) { -- cgit