summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-05-01 20:34:18 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-05-03 09:12:32 +0200
commitddef1e2c017b7d8e421dedc1a0ce722ff4208985 (patch)
tree54e52c86e4e33bcb61eee44706117b1616e99624 /sw
parent0a6d946694e4fcb39228c5e1fec58fcfd8a45989 (diff)
add o3tl::equalsAscii
Change-Id: I042b8dcadbf7581de325c161763fe35aecde5ca2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133694 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/ccoll.hxx2
-rw-r--r--sw/inc/unocoll.hxx2
-rw-r--r--sw/source/core/fields/authfld.cxx4
-rw-r--r--sw/source/core/unocore/unocoll.cxx5
-rw-r--r--sw/source/filter/html/htmlcss1.cxx5
-rw-r--r--sw/source/uibase/app/appopt.cxx6
-rw-r--r--sw/source/uibase/chrdlg/ccoll.cxx5
7 files changed, 16 insertions, 13 deletions
diff --git a/sw/inc/ccoll.hxx b/sw/inc/ccoll.hxx
index dffe09b4eb60..978b8c698a83 100644
--- a/sw/inc/ccoll.hxx
+++ b/sw/inc/ccoll.hxx
@@ -34,7 +34,7 @@ struct CommandStruct
sal_uLong nSubCond;
};
-sal_Int16 GetCommandContextIndex( const OUString &rContextName );
+sal_Int16 GetCommandContextIndex( std::u16string_view rContextName );
OUString GetCommandContextByIndex( sal_Int16 nIndex );
class SW_DLLPUBLIC SwCondCollItem final : public SfxPoolItem
diff --git a/sw/inc/unocoll.hxx b/sw/inc/unocoll.hxx
index 8d883a8223cb..90f634ab9cbc 100644
--- a/sw/inc/unocoll.hxx
+++ b/sw/inc/unocoll.hxx
@@ -246,7 +246,7 @@ class SwXServiceProvider
{
public:
static OUString GetProviderName(SwServiceType nObjectType);
- static SwServiceType GetProviderType(const OUString& rServiceName);
+ static SwServiceType GetProviderType(std::u16string_view rServiceName);
static css::uno::Reference< css::uno::XInterface > MakeInstance(SwServiceType nObjectType, SwDoc & rDoc);
static css::uno::Sequence<OUString> GetAllServiceNames();
diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx
index f81feebca3d1..8a6212e22738 100644
--- a/sw/source/core/fields/authfld.cxx
+++ b/sw/source/core/fields/authfld.cxx
@@ -720,10 +720,10 @@ bool SwAuthorityField::QueryValue( Any& rAny, sal_uInt16 /*nWhichId*/ ) const
return false;
}
-static sal_Int32 lcl_Find(const OUString& rFieldName)
+static sal_Int32 lcl_Find(std::u16string_view rFieldName)
{
for(sal_Int32 i = 0; i < AUTH_FIELD_END; ++i)
- if(rFieldName.equalsAscii(aFieldNames[i]))
+ if(o3tl::equalsAscii(rFieldName, aFieldNames[i]))
return i;
return -1;
}
diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx
index 044e5acc99cb..9eac5a41949f 100644
--- a/sw/source/core/unocore/unocoll.cxx
+++ b/sw/source/core/unocore/unocoll.cxx
@@ -33,6 +33,7 @@
#include <txtftn.hxx>
#include <com/sun/star/text/XTextTable.hpp>
#include <o3tl/safeint.hxx>
+#include <o3tl/string_view.hxx>
#include <svtools/unoimap.hxx>
#include <svtools/unoevent.hxx>
#include <svx/SvxXTextColumns.hxx>
@@ -502,11 +503,11 @@ uno::Sequence<OUString> SwXServiceProvider::GetAllServiceNames()
}
-SwServiceType SwXServiceProvider::GetProviderType(const OUString& rServiceName)
+SwServiceType SwXServiceProvider::GetProviderType(std::u16string_view rServiceName)
{
for(const ProvNamesId_Type & i : aProvNamesId)
{
- if (rServiceName.equalsAscii(i.pName))
+ if (o3tl::equalsAscii(rServiceName, i.pName))
return i.nType;
}
return SwServiceType::Invalid;
diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx
index 2572820be953..23c7128719a1 100644
--- a/sw/source/filter/html/htmlcss1.cxx
+++ b/sw/source/filter/html/htmlcss1.cxx
@@ -34,6 +34,7 @@
#include <editeng/fontitem.hxx>
#include <editeng/langitem.hxx>
#include <editeng/frmdiritem.hxx>
+#include <o3tl/string_view.hxx>
#include <svtools/htmltokn.h>
#include <svtools/htmlkywd.hxx>
#include <fmtpdsc.hxx>
@@ -1659,7 +1660,7 @@ void SwHTMLParser::NewStyle()
}
m_bIgnoreRawData = sType.getLength() &&
- !sType.getToken(0,';').equalsAscii(sCSS_mimetype);
+ !o3tl::equalsAscii(o3tl::getToken(sType, 0,';'), sCSS_mimetype);
}
void SwHTMLParser::EndStyle()
@@ -1745,7 +1746,7 @@ void SwHTMLParser::InsertLink()
if( !sHRef.isEmpty() && sRel.equalsIgnoreAsciiCase( "STYLESHEET" ) &&
( sType.isEmpty() ||
- sType.getToken(0,';').equalsAscii(sCSS_mimetype) ) )
+ o3tl::equalsAscii(o3tl::getToken(sType, 0,';'), sCSS_mimetype) ) )
{
if( GetMedium() )
{
diff --git a/sw/source/uibase/app/appopt.cxx b/sw/source/uibase/app/appopt.cxx
index 8334dea7a785..86343d2e6651 100644
--- a/sw/source/uibase/app/appopt.cxx
+++ b/sw/source/uibase/app/appopt.cxx
@@ -132,17 +132,17 @@ std::optional<SfxItemSet> SwModule::CreateItemSet( sal_uInt16 nId )
using namespace ::com::sun::star::i18n::ScriptType;
- Any aLang = aLinguCfg.GetProperty("DefaultLocale");
+ Any aLang = aLinguCfg.GetProperty(u"DefaultLocale");
aLang >>= aLocale;
nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType( aLocale, false), LATIN);
aRet.Put(SvxLanguageItem(nLang, SID_ATTR_LANGUAGE));
- aLang = aLinguCfg.GetProperty("DefaultLocale_CJK");
+ aLang = aLinguCfg.GetProperty(u"DefaultLocale_CJK");
aLang >>= aLocale;
nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType( aLocale, false), ASIAN);
aRet.Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CJK_LANGUAGE));
- aLang = aLinguCfg.GetProperty("DefaultLocale_CTL");
+ aLang = aLinguCfg.GetProperty(u"DefaultLocale_CTL");
aLang >>= aLocale;
nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType( aLocale, false), COMPLEX);
aRet.Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CTL_LANGUAGE));
diff --git a/sw/source/uibase/chrdlg/ccoll.cxx b/sw/source/uibase/chrdlg/ccoll.cxx
index 6285ac52789a..547566c427a0 100644
--- a/sw/source/uibase/chrdlg/ccoll.cxx
+++ b/sw/source/uibase/chrdlg/ccoll.cxx
@@ -21,6 +21,7 @@
#include <ccoll.hxx>
#include <fmtcol.hxx>
+#include <o3tl/string_view.hxx>
//!! order of entries has to be the same as in
//!! CommandStruct SwCondCollItem::aCmds[]
@@ -59,12 +60,12 @@ const char * const aCommandContext[COND_COMMAND_COUNT] =
"NumberingLevel10"
};
-sal_Int16 GetCommandContextIndex( const OUString &rContextName )
+sal_Int16 GetCommandContextIndex( std::u16string_view rContextName )
{
sal_Int16 nRes = -1;
for (sal_Int16 i = 0; nRes == -1 && i < COND_COMMAND_COUNT; ++i)
{
- if (rContextName.equalsAscii( aCommandContext[i] ))
+ if (o3tl::equalsAscii( rContextName, aCommandContext[i] ))
nRes = i;
}
return nRes;