diff options
author | Noel <noel.grandin@collabora.co.uk> | 2020-12-18 08:57:20 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-12-18 09:29:49 +0100 |
commit | 8e6ec5ebcc523a189238a90fd9237872d67085f9 (patch) | |
tree | bd1dba3f8c3a352f81d860cc6d811c1a323a49f1 /sc | |
parent | 976ceae533becc3978e7c3741eadc69af4484437 (diff) |
use more string_view in IsXMLToken
Change-Id: Ib84e2e7db4b4e6e2486dd024d60057d9d42ff4b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107932
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/xml/XMLConverter.cxx | 12 | ||||
-rw-r--r-- | sc/source/filter/xml/XMLConverter.hxx | 12 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlfilti.cxx | 28 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlfilti.hxx | 4 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlsorti.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlsorti.hxx | 2 |
6 files changed, 30 insertions, 30 deletions
diff --git a/sc/source/filter/xml/XMLConverter.cxx b/sc/source/filter/xml/XMLConverter.cxx index 004479c7a2c6..02d4eca32f24 100644 --- a/sc/source/filter/xml/XMLConverter.cxx +++ b/sc/source/filter/xml/XMLConverter.cxx @@ -41,7 +41,7 @@ ScDocument* ScXMLConverter::GetScDocument( const uno::Reference< frame::XModel > return nullptr; } -sheet::GeneralFunction ScXMLConverter::GetFunctionFromString( const OUString& sFunction ) +sheet::GeneralFunction ScXMLConverter::GetFunctionFromString( std::u16string_view sFunction ) { if( IsXMLToken(sFunction, XML_SUM ) ) return sheet::GeneralFunction_SUM; @@ -70,7 +70,7 @@ sheet::GeneralFunction ScXMLConverter::GetFunctionFromString( const OUString& sF return sheet::GeneralFunction_NONE; } -ScGeneralFunction ScXMLConverter::GetFunctionFromString2( const OUString& sFunction ) +ScGeneralFunction ScXMLConverter::GetFunctionFromString2( std::u16string_view sFunction ) { if( IsXMLToken(sFunction, XML_SUM ) ) return ScGeneralFunction::SUM; @@ -101,7 +101,7 @@ ScGeneralFunction ScXMLConverter::GetFunctionFromString2( const OUString& sFunct return ScGeneralFunction::NONE; } -ScSubTotalFunc ScXMLConverter::GetSubTotalFuncFromString( const OUString& sFunction ) +ScSubTotalFunc ScXMLConverter::GetSubTotalFuncFromString( std::u16string_view sFunction ) { if( IsXMLToken(sFunction, XML_SUM ) ) return SUBTOTAL_FUNC_SUM; @@ -187,7 +187,7 @@ void ScXMLConverter::GetStringFromFunction( } sheet::DataPilotFieldOrientation ScXMLConverter::GetOrientationFromString( - const OUString& rString ) + std::u16string_view rString ) { if( IsXMLToken(rString, XML_COLUMN ) ) return sheet::DataPilotFieldOrientation_COLUMN; @@ -230,7 +230,7 @@ void ScXMLConverter::GetStringFromOrientation( ScRangeStringConverter::AssignString( rString, sOrientStr, false ); } -ScDetectiveObjType ScXMLConverter::GetDetObjTypeFromString( const OUString& rString ) +ScDetectiveObjType ScXMLConverter::GetDetObjTypeFromString( std::u16string_view rString ) { if( IsXMLToken(rString, XML_FROM_SAME_TABLE ) ) return SC_DETOBJ_ARROW; @@ -241,7 +241,7 @@ ScDetectiveObjType ScXMLConverter::GetDetObjTypeFromString( const OUString& rStr return SC_DETOBJ_NONE; } -bool ScXMLConverter::GetDetOpTypeFromString( ScDetOpType& rDetOpType, const OUString& rString ) +bool ScXMLConverter::GetDetOpTypeFromString( ScDetOpType& rDetOpType, std::u16string_view rString ) { if( IsXMLToken(rString, XML_TRACE_DEPENDENTS ) ) rDetOpType = SCDETOP_ADDSUCC; diff --git a/sc/source/filter/xml/XMLConverter.hxx b/sc/source/filter/xml/XMLConverter.hxx index 2f8c08383353..8e149485f83d 100644 --- a/sc/source/filter/xml/XMLConverter.hxx +++ b/sc/source/filter/xml/XMLConverter.hxx @@ -47,13 +47,13 @@ public: // IMPORT: GeneralFunction / ScSubTotalFunc static css::sheet::GeneralFunction GetFunctionFromString( - const OUString& rString ); + std::u16string_view rString ); static ScGeneralFunction GetFunctionFromString2( - const OUString& rString ); + std::u16string_view rString ); static ScSubTotalFunc GetSubTotalFuncFromString( - const OUString& rString ); + std::u16string_view rString ); // EXPORT: GeneralFunctio2 / ScSubTotalFunc static void GetStringFromFunction( @@ -66,7 +66,7 @@ public: // IMPORT: DataPilotFieldOrientation static css::sheet::DataPilotFieldOrientation GetOrientationFromString( - const OUString& rString ); + std::u16string_view rString ); // EXPORT: DataPilotFieldOrientation static void GetStringFromOrientation( @@ -76,10 +76,10 @@ public: // IMPORT: Detective static ScDetectiveObjType GetDetObjTypeFromString( - const OUString& rString ); + std::u16string_view rString ); static bool GetDetOpTypeFromString( ScDetOpType& rDetOpType, - const OUString& rString ); + std::u16string_view rString ); // EXPORT: Detective static void GetStringFromDetObjType( diff --git a/sc/source/filter/xml/xmlfilti.cxx b/sc/source/filter/xml/xmlfilti.cxx index 9b811176faaf..5b5708e7a68b 100644 --- a/sc/source/filter/xml/xmlfilti.cxx +++ b/sc/source/filter/xml/xmlfilti.cxx @@ -347,7 +347,7 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL ScXMLConditionContext:: } void ScXMLConditionContext::GetOperator( - const OUString& aOpStr, ScQueryParam& rParam, ScQueryEntry& rEntry) + std::u16string_view aOpStr, ScQueryParam& rParam, ScQueryEntry& rEntry) { rParam.eSearchType = utl::SearchParam::SearchType::Normal; if (IsXMLToken(aOpStr, XML_MATCH)) @@ -360,9 +360,9 @@ void ScXMLConditionContext::GetOperator( rParam.eSearchType = utl::SearchParam::SearchType::Regexp; rEntry.eOp = SC_NOT_EQUAL; } - else if (aOpStr == "=") + else if (aOpStr == u"=") rEntry.eOp = SC_EQUAL; - else if (aOpStr == "!=") + else if (aOpStr == u"!=") rEntry.eOp = SC_NOT_EQUAL; else if (IsXMLToken(aOpStr, XML_BOTTOM_PERCENT)) rEntry.eOp = SC_BOTPERC; @@ -370,13 +370,13 @@ void ScXMLConditionContext::GetOperator( rEntry.eOp = SC_BOTVAL; else if (IsXMLToken(aOpStr, XML_EMPTY)) rEntry.SetQueryByEmpty(); - else if (aOpStr == ">") + else if (aOpStr == u">") rEntry.eOp = SC_GREATER; - else if (aOpStr == ">=") + else if (aOpStr == u">=") rEntry.eOp = SC_GREATER_EQUAL; - else if (aOpStr == "<") + else if (aOpStr == u"<") rEntry.eOp = SC_LESS; - else if (aOpStr == "<=") + else if (aOpStr == u"<=") rEntry.eOp = SC_LESS_EQUAL; else if (IsXMLToken(aOpStr, XML_NOEMPTY)) rEntry.SetQueryByNonEmpty(); @@ -695,7 +695,7 @@ ScXMLDPConditionContext::~ScXMLDPConditionContext() } void ScXMLDPConditionContext::getOperatorXML( - const OUString& sTempOperator, ScQueryOp& aFilterOperator, utl::SearchParam::SearchType& rSearchType) + std::u16string_view sTempOperator, ScQueryOp& aFilterOperator, utl::SearchParam::SearchType& rSearchType) { rSearchType = utl::SearchParam::SearchType::Normal; if (IsXMLToken(sTempOperator, XML_MATCH)) @@ -708,21 +708,21 @@ void ScXMLDPConditionContext::getOperatorXML( rSearchType = utl::SearchParam::SearchType::Regexp; aFilterOperator = SC_NOT_EQUAL; } - else if (sTempOperator == "=") + else if (sTempOperator == u"=") aFilterOperator = SC_EQUAL; - else if (sTempOperator == "!=") + else if (sTempOperator == u"!=") aFilterOperator = SC_NOT_EQUAL; else if (IsXMLToken(sTempOperator, XML_BOTTOM_PERCENT)) aFilterOperator = SC_BOTPERC; else if (IsXMLToken(sTempOperator, XML_BOTTOM_VALUES)) aFilterOperator = SC_BOTVAL; - else if (sTempOperator == ">") + else if (sTempOperator == u">") aFilterOperator = SC_GREATER; - else if (sTempOperator == ">=") + else if (sTempOperator == u">=") aFilterOperator = SC_GREATER_EQUAL; - else if (sTempOperator == "<") + else if (sTempOperator == u"<") aFilterOperator = SC_LESS; - else if (sTempOperator == "<=") + else if (sTempOperator == u"<=") aFilterOperator = SC_LESS_EQUAL; else if (IsXMLToken(sTempOperator, XML_TOP_PERCENT)) aFilterOperator = SC_TOPPERC; diff --git a/sc/source/filter/xml/xmlfilti.hxx b/sc/source/filter/xml/xmlfilti.hxx index 076253b2f117..41a0d103ffc7 100644 --- a/sc/source/filter/xml/xmlfilti.hxx +++ b/sc/source/filter/xml/xmlfilti.hxx @@ -133,7 +133,7 @@ public: virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override; - static void GetOperator(const OUString& aOpStr, ScQueryParam& rParam, ScQueryEntry& rEntry); + static void GetOperator(std::u16string_view aOpStr, ScQueryParam& rParam, ScQueryEntry& rEntry); void AddSetItem(const ScQueryEntry::Item& rItem); }; @@ -259,7 +259,7 @@ public: virtual ~ScXMLDPConditionContext() override; static void getOperatorXML( - const OUString& sTempOperator, ScQueryOp& aFilterOperator, utl::SearchParam::SearchType& rSearchType); + std::u16string_view sTempOperator, ScQueryOp& aFilterOperator, utl::SearchParam::SearchType& rSearchType); virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override; }; diff --git a/sc/source/filter/xml/xmlsorti.cxx b/sc/source/filter/xml/xmlsorti.cxx index 0744e3d85997..633966845ef0 100644 --- a/sc/source/filter/xml/xmlsorti.cxx +++ b/sc/source/filter/xml/xmlsorti.cxx @@ -162,7 +162,7 @@ void SAL_CALL ScXMLSortContext::endFastElement( sal_Int32 /*nElement*/ ) pDatabaseRangeContext->SetSortSequence(aSortDescriptor); } -void ScXMLSortContext::AddSortField(const OUString& sFieldNumber, const OUString& sDataType, const OUString& sOrder) +void ScXMLSortContext::AddSortField(const OUString& sFieldNumber, const OUString& sDataType, std::u16string_view sOrder) { util::SortField aSortField; aSortField.Field = sFieldNumber.toInt32(); diff --git a/sc/source/filter/xml/xmlsorti.hxx b/sc/source/filter/xml/xmlsorti.hxx index 0e20453d5d12..e40bd31eed20 100644 --- a/sc/source/filter/xml/xmlsorti.hxx +++ b/sc/source/filter/xml/xmlsorti.hxx @@ -57,7 +57,7 @@ public: virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override; - void AddSortField(const OUString& sFieldNumber, const OUString& sDataType, const OUString& sOrder); + void AddSortField(const OUString& sFieldNumber, const OUString& sDataType, std::u16string_view sOrder); }; class ScXMLSortByContext : public ScXMLImportContext |