From ddef1e2c017b7d8e421dedc1a0ce722ff4208985 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sun, 1 May 2022 20:34:18 +0200 Subject: add o3tl::equalsAscii Change-Id: I042b8dcadbf7581de325c161763fe35aecde5ca2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133694 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sc/inc/compiler.hxx | 2 +- sc/source/core/tool/addincol.cxx | 5 +++-- sc/source/core/tool/compiler.cxx | 5 +++-- sc/source/filter/excel/xechart.cxx | 2 +- sc/source/filter/excel/xlchart.cxx | 5 +++-- sc/source/filter/inc/xechart.hxx | 2 +- sc/source/filter/inc/xlchart.hxx | 2 +- sc/source/ui/condformat/condformatdlgentry.cxx | 5 +++-- 8 files changed, 16 insertions(+), 12 deletions(-) (limited to 'sc') diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx index 5f3b6354c967..0cd48fccc92e 100644 --- a/sc/inc/compiler.hxx +++ b/sc/inc/compiler.hxx @@ -349,7 +349,7 @@ private: bool ParseValue( const OUString& ); bool ParseOpCode( const OUString&, bool bInArray ); - bool ParseOpCode2( const OUString& ); + bool ParseOpCode2( std::u16string_view ); bool ParseString(); bool ParseReference( const OUString& rSymbol, const OUString* pErrRef = nullptr ); bool ParseSingleReference( const OUString& rSymbol, const OUString* pErrRef = nullptr ); diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx index 126a0f915c7a..26b7baa9ed7f 100644 --- a/sc/source/core/tool/addincol.cxx +++ b/sc/source/core/tool/addincol.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -294,7 +295,7 @@ void ScUnoAddInCollection::Initialize() bInitialized = true; // with or without functions } -static sal_uInt16 lcl_GetCategory( const OUString& rName ) +static sal_uInt16 lcl_GetCategory( std::u16string_view rName ) { static const char* aFuncNames[SC_FUNCGROUP_COUNT] = { @@ -313,7 +314,7 @@ static sal_uInt16 lcl_GetCategory( const OUString& rName ) "Add-In" // ID_FUNCTION_GRP_ADDINS }; for (sal_uInt16 i=0; i #include #include +#include #include #include #include @@ -3061,13 +3062,13 @@ bool ScCompiler::ParseOpCode( const OUString& rName, bool bInArray ) return bFound; } -bool ScCompiler::ParseOpCode2( const OUString& rName ) +bool ScCompiler::ParseOpCode2( std::u16string_view rName ) { bool bFound = false; sal_uInt16 i; for( i = ocInternalBegin; i <= ocInternalEnd && !bFound; i++ ) - bFound = rName.equalsAscii( pInternal[ i-ocInternalBegin ] ); + bFound = o3tl::equalsAscii( rName, pInternal[ i-ocInternalBegin ] ); if (bFound) { diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx index f42a1448e54e..64525457f894 100644 --- a/sc/source/filter/excel/xechart.cxx +++ b/sc/source/filter/excel/xechart.cxx @@ -315,7 +315,7 @@ const XclChTypeInfo& XclExpChRoot::GetChartTypeInfo( XclChTypeId eType ) const return mxChData->mxTypeInfoProv->GetTypeInfo( eType ); } -const XclChTypeInfo& XclExpChRoot::GetChartTypeInfo( const OUString& rServiceName ) const +const XclChTypeInfo& XclExpChRoot::GetChartTypeInfo( std::u16string_view rServiceName ) const { return mxChData->mxTypeInfoProv->GetTypeInfoFromService( rServiceName ); } diff --git a/sc/source/filter/excel/xlchart.cxx b/sc/source/filter/excel/xlchart.cxx index 3a178c10dc06..d446f77d2353 100644 --- a/sc/source/filter/excel/xlchart.cxx +++ b/sc/source/filter/excel/xlchart.cxx @@ -37,6 +37,7 @@ #include #include +#include #include #include #include @@ -528,10 +529,10 @@ const XclChTypeInfo& XclChTypeInfoProvider::GetTypeInfoFromRecId( sal_uInt16 nRe return GetTypeInfo( EXC_CHTYPEID_UNKNOWN ); } -const XclChTypeInfo& XclChTypeInfoProvider::GetTypeInfoFromService( const OUString& rServiceName ) const +const XclChTypeInfo& XclChTypeInfoProvider::GetTypeInfoFromService( std::u16string_view rServiceName ) const { for(auto const &rIt : spTypeInfos) - if( rServiceName.equalsAscii( rIt.mpcServiceName ) ) + if( o3tl::equalsAscii( rServiceName, rIt.mpcServiceName ) ) return rIt; OSL_FAIL( "XclChTypeInfoProvider::GetTypeInfoFromService - unknown service name" ); return GetTypeInfo( EXC_CHTYPEID_UNKNOWN ); diff --git a/sc/source/filter/inc/xechart.hxx b/sc/source/filter/inc/xechart.hxx index d291266a06b1..ff7dcc90920f 100644 --- a/sc/source/filter/inc/xechart.hxx +++ b/sc/source/filter/inc/xechart.hxx @@ -97,7 +97,7 @@ public: /** Returns chart type info for a unique chart type identifier. */ const XclChTypeInfo& GetChartTypeInfo( XclChTypeId eType ) const; /** Returns the first fitting chart type info for the passed service name. */ - const XclChTypeInfo& GetChartTypeInfo( const OUString& rServiceName ) const; + const XclChTypeInfo& GetChartTypeInfo( std::u16string_view rServiceName ) const; /** Returns an info struct about auto formatting for the passed object type. */ const XclChFormatInfo& GetFormatInfo( XclChObjectType eObjType ) const; diff --git a/sc/source/filter/inc/xlchart.hxx b/sc/source/filter/inc/xlchart.hxx index 15859aac7814..8b015e012949 100644 --- a/sc/source/filter/inc/xlchart.hxx +++ b/sc/source/filter/inc/xlchart.hxx @@ -1253,7 +1253,7 @@ public: /** Returns the first fitting chart type info for an Excel chart type record identifier. */ const XclChTypeInfo& GetTypeInfoFromRecId( sal_uInt16 nRecId ) const; /** Returns the first fitting chart type info for the passed service name. */ - const XclChTypeInfo& GetTypeInfoFromService( const OUString& rServiceName ) const; + const XclChTypeInfo& GetTypeInfoFromService( std::u16string_view rServiceName ) const; private: typedef ::std::map< XclChTypeId, const XclChTypeInfo* > XclChTypeInfoMap; diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index d67ee8e36f57..77175fa64c64 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -17,6 +17,7 @@ #include +#include #include #include #include @@ -605,11 +606,11 @@ const struct { COLORSCALE_FORMULA, "formula" }, }; -ScColorScaleEntryType getTypeForId(const OUString& sId) +ScColorScaleEntryType getTypeForId(std::u16string_view sId) { for (auto& r : TypeIdMap) { - if (sId.equalsAscii(r.sId)) + if (o3tl::equalsAscii(sId, r.sId)) return r.eType; } assert(false); // The id is not in TypeIdMap - something not in sync? -- cgit