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>
This commit is contained in:
Noel Grandin
2022-05-03 09:12:32 +02:00
parent 0a6d946694
commit ddef1e2c01
57 changed files with 162 additions and 130 deletions
+3 -3
View File
@@ -343,11 +343,11 @@ void CharacterProperties::AddDefaultsToMap(
SvtLinguConfig aLinguConfig;
lang::Locale aDefaultLocale;
aLinguConfig.GetProperty("DefaultLocale") >>= aDefaultLocale;
aLinguConfig.GetProperty(u"DefaultLocale") >>= aDefaultLocale;
lang::Locale aDefaultLocale_CJK;
aLinguConfig.GetProperty("DefaultLocale_CJK") >>= aDefaultLocale_CJK;
aLinguConfig.GetProperty(u"DefaultLocale_CJK") >>= aDefaultLocale_CJK;
lang::Locale aDefaultLocale_CTL;
aLinguConfig.GetProperty("DefaultLocale_CTL") >>= aDefaultLocale_CTL;
aLinguConfig.GetProperty(u"DefaultLocale_CTL") >>= aDefaultLocale_CTL;
using namespace ::com::sun::star::i18n::ScriptType;
LanguageType nLang;
+4 -3
View File
@@ -377,9 +377,10 @@ bool StringView::VisitCXXMemberCallExpr(CXXMemberCallExpr const* expr)
{
auto const dc = loplugin::DeclCheck(expr->getMethodDecl());
if (dc.Function("toInt32") || dc.Function("toUInt32") || dc.Function("toInt64")
|| dc.Function("toDouble") || dc.Function("equalsIgnoreAsciiCase")
|| dc.Function("compareToIgnoreAsciiCase") || dc.Function("trim")
|| dc.Function("startsWith") || dc.Function("endsWith") || dc.Function("match"))
|| dc.Function("toDouble") || dc.Function("equalsAscii")
|| dc.Function("equalsIgnoreAsciiCase") || dc.Function("compareToIgnoreAsciiCase")
|| dc.Function("trim") || dc.Function("startsWith") || dc.Function("endsWith")
|| dc.Function("match"))
{
handleSubExprThatCouldBeView(expr->getImplicitObjectArgument());
}
+1 -1
View File
@@ -141,7 +141,7 @@ DeclRefExpr const* relevantCXXMemberCallExpr(CXXMemberCallExpr const* expr)
|| n == "indexOf" || n == "lastIndexOf" || n == "compareTo" || n == "match"
|| n == "trim" || n == "toInt32" || n == "toUInt32" || n == "toInt64" || n == "toDouble"
|| n == "equalsIgnoreAsciiCase" || n == "compareToIgnoreAsciiCase" || n == "getToken"
|| n == "copy")
|| n == "copy" || n == "equalsAscii")
{
good = true;
}
+9 -9
View File
@@ -1365,7 +1365,7 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet )
Any aValue;
Locale aLocale = LanguageTag::convertToLocale( eSelectLang, false);
aValue <<= aLocale;
pLangConfig->aLinguConfig.SetProperty( "DefaultLocale", aValue );
pLangConfig->aLinguConfig.SetProperty( u"DefaultLocale", aValue );
if (xLinguProp.is())
xLinguProp->setDefaultLocale( aLocale );
}
@@ -1384,7 +1384,7 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet )
Any aValue;
Locale aLocale = LanguageTag::convertToLocale( eSelectLang, false);
aValue <<= aLocale;
pLangConfig->aLinguConfig.SetProperty( "DefaultLocale_CJK", aValue );
pLangConfig->aLinguConfig.SetProperty( u"DefaultLocale_CJK", aValue );
if (xLinguProp.is())
xLinguProp->setDefaultLocale_CJK( aLocale );
}
@@ -1403,7 +1403,7 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet )
Any aValue;
Locale aLocale = LanguageTag::convertToLocale( eSelectLang, false);
aValue <<= aLocale;
pLangConfig->aLinguConfig.SetProperty( "DefaultLocale_CTL", aValue );
pLangConfig->aLinguConfig.SetProperty( u"DefaultLocale_CTL", aValue );
if (xLinguProp.is())
xLinguProp->setDefaultLocale_CTL( aLocale );
}
@@ -1530,18 +1530,18 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet* rSet )
Any aCTLLang;
try
{
aWestLang = pLangConfig->aLinguConfig.GetProperty("DefaultLocale");
aWestLang = pLangConfig->aLinguConfig.GetProperty(u"DefaultLocale");
Locale aLocale;
aWestLang >>= aLocale;
eCurLang = LanguageTag::convertToLanguageType( aLocale, false);
aCJKLang = pLangConfig->aLinguConfig.GetProperty("DefaultLocale_CJK");
aCJKLang = pLangConfig->aLinguConfig.GetProperty(u"DefaultLocale_CJK");
aLocale = Locale();
aCJKLang >>= aLocale;
eCurLangCJK = LanguageTag::convertToLanguageType( aLocale, false);
aCTLLang = pLangConfig->aLinguConfig.GetProperty("DefaultLocale_CTL");
aCTLLang = pLangConfig->aLinguConfig.GetProperty(u"DefaultLocale_CTL");
aLocale = Locale();
aCTLLang >>= aLocale;
eCurLangCTL = LanguageTag::convertToLanguageType( aLocale, false);
@@ -1596,7 +1596,7 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet* rSet )
m_xIgnoreLanguageChangeCB->save_state();
m_xCurrentDocCB->save_state();
bool bEnable = !pLangConfig->aLinguConfig.IsReadOnly( "DefaultLocale" );
bool bEnable = !pLangConfig->aLinguConfig.IsReadOnly( u"DefaultLocale" );
m_xWesternLanguageFT->set_sensitive( bEnable );
m_xWesternLanguageLB->set_sensitive( bEnable );
@@ -1616,7 +1616,7 @@ IMPL_LINK(OfaLanguagesTabPage, SupportHdl, weld::Toggleable&, rBox, void)
bool bCheck = rBox.get_active();
if ( m_xAsianSupportCB.get() == &rBox )
{
bool bReadonly = pLangConfig->aLinguConfig.IsReadOnly("DefaultLocale_CJK");
bool bReadonly = pLangConfig->aLinguConfig.IsReadOnly(u"DefaultLocale_CJK");
bCheck = ( bCheck && !bReadonly );
m_xAsianLanguageLB->set_sensitive( bCheck );
if (rBox.get_sensitive())
@@ -1624,7 +1624,7 @@ IMPL_LINK(OfaLanguagesTabPage, SupportHdl, weld::Toggleable&, rBox, void)
}
else if ( m_xCTLSupportCB.get() == &rBox )
{
bool bReadonly = pLangConfig->aLinguConfig.IsReadOnly("DefaultLocale_CTL");
bool bReadonly = pLangConfig->aLinguConfig.IsReadOnly(u"DefaultLocale_CTL");
bCheck = ( bCheck && !bReadonly );
m_xComplexLanguageLB->set_sensitive( bCheck );
if (rBox.get_sensitive())
+3 -2
View File
@@ -21,6 +21,7 @@
#include <string_view>
#include <o3tl/string_view.hxx>
#include <svl/eitem.hxx>
#include <svl/intitem.hxx>
#include "optsave.hxx"
@@ -324,7 +325,7 @@ bool SvxSaveTabPage::FillItemSet( SfxItemSet* rSet )
return bModified;
}
static bool isODFFormat( const OUString& sFilter )
static bool isODFFormat( std::u16string_view sFilter )
{
static const char* aODFFormats[] =
{
@@ -348,7 +349,7 @@ static bool isODFFormat( const OUString& sFilter )
int i = 0;
while ( aODFFormats[i] != nullptr )
{
if ( sFilter.equalsAscii( aODFFormats[i++] ) )
if ( o3tl::equalsAscii( sFilter, aODFFormats[i++] ) )
{
bRet = true;
break;
@@ -21,6 +21,7 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <o3tl/string_view.hxx>
#include <osl/diagnose.h>
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/sequence.hxx>
@@ -123,12 +124,12 @@ namespace dbaccess
m_pData->rParent.release();
}
bool DocumentEvents::needsSynchronousNotification( const OUString& _rEventName )
bool DocumentEvents::needsSynchronousNotification( std::u16string_view _rEventName )
{
const DocumentEventData* pEventData = lcl_getDocumentEventData();
while ( pEventData->pAsciiEventName )
{
if ( _rEventName.equalsAscii( pEventData->pAsciiEventName ) )
if ( o3tl::equalsAscii( _rEventName, pEventData->pAsciiEventName ) )
return pEventData->bNeedsSyncNotify;
++pEventData;
}
+1 -1
View File
@@ -48,7 +48,7 @@ namespace dbaccess
DocumentEvents(const DocumentEvents&) = delete;
const DocumentEvents& operator=(const DocumentEvents&) = delete;
static bool needsSynchronousNotification( const OUString& _rEventName );
static bool needsSynchronousNotification( std::u16string_view _rEventName );
// XInterface
virtual void SAL_CALL acquire() noexcept override;
@@ -22,6 +22,7 @@
#include "formstrings.hxx"
#include <comphelper/extract.hxx>
#include <comphelper/property.hxx>
#include <o3tl/string_view.hxx>
#include <osl/diagnose.h>
#include <tools/diagnose_ex.h>
@@ -53,12 +54,12 @@ namespace pcr
nullptr
};
sal_Int32 lcl_getNavigationURLIndex( const OUString& _rNavURL )
sal_Int32 lcl_getNavigationURLIndex( std::u16string_view _rNavURL )
{
const char** pLookup = pNavigationURLs;
while ( *pLookup )
{
if ( _rNavURL.equalsAscii( *pLookup ) )
if ( o3tl::equalsAscii( _rNavURL, *pLookup ) )
return pLookup - pNavigationURLs;
++pLookup;
}
+3 -2
View File
@@ -28,6 +28,7 @@
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XSeekable.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
#include <o3tl/string_view.hxx>
#include <tools/wldcrd.hxx>
#include <sal/log.hxx>
#include <framework/interaction.hxx>
@@ -125,7 +126,7 @@ namespace {
* In each category, rank them from strictly-structured to
* loosely-structured.
*/
int getFlatTypeRank(const OUString& rType)
int getFlatTypeRank(std::u16string_view rType)
{
// List formats from more complex to less complex.
// TODO: Add more.
@@ -287,7 +288,7 @@ int getFlatTypeRank(const OUString& rType)
for (size_t i = 0; i < n; ++i)
{
if (rType.equalsAscii(ranks[i]))
if (o3tl::equalsAscii(rType, ranks[i]))
return n - i - 1;
}
+3 -2
View File
@@ -26,6 +26,7 @@
#include <comphelper/propertyvalue.hxx>
#include <tools/debug.hxx>
#include <o3tl/string_view.hxx>
#include <osl/diagnose.h>
@@ -427,12 +428,12 @@ namespace frm
}
sal_Int16 OFormNavigationMapper::getFeatureId( const OUString& _rCompleteURL )
sal_Int16 OFormNavigationMapper::getFeatureId( std::u16string_view _rCompleteURL )
{
const FeatureURL* pFeatures = lcl_getFeatureTable();
while ( pFeatures->pAsciiURL )
{
if ( _rCompleteURL.equalsAscii( pFeatures->pAsciiURL ) )
if ( o3tl::equalsAscii( _rCompleteURL, pFeatures->pAsciiURL ) )
return pFeatures->nFormFeature;
++pFeatures;
}
+1 -1
View File
@@ -203,7 +203,7 @@ namespace frm
the id of the feature URL, or -1 if the URl is not known
(which is a valid usage)
*/
static sal_Int16 getFeatureId( const OUString& _rCompleteURL );
static sal_Int16 getFeatureId( std::u16string_view _rCompleteURL );
private:
OFormNavigationMapper( const OFormNavigationMapper& ) = delete;
+1 -1
View File
@@ -91,7 +91,7 @@ private:
css::uno::Reference< css::i18n::XExtendedTransliteration > caseignore;
/// @throws css::uno::RuntimeException
bool loadModuleByName( const OUString& implName,
bool loadModuleByName( std::u16string_view implName,
css::uno::Reference<css::i18n::XExtendedTransliteration> & body, const css::lang::Locale& rLocale);
void clear();
@@ -27,6 +27,7 @@
#include <comphelper/sequence.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <o3tl/string_view.hxx>
#include <rtl/ustring.hxx>
#include <algorithm>
@@ -203,11 +204,11 @@ TransliterationImpl::loadModule( TransliterationModules modType, const Locale& r
// additional transliterations from TransliterationModulesExtra (we cannot extend TransliterationModules)
if (bool(modType & TransliterationModules(TransliterationModulesExtra::IGNORE_DIACRITICS_CTL)))
{
if (loadModuleByName("ignoreDiacritics_CTL", bodyCascade[numCascade], rLocale))
if (loadModuleByName(u"ignoreDiacritics_CTL", bodyCascade[numCascade], rLocale))
numCascade++;
}
if (bool(modType & TransliterationModules(TransliterationModulesExtra::IGNORE_KASHIDA_CTL)))
if (loadModuleByName("ignoreKashida_CTL", bodyCascade[numCascade], rLocale))
if (loadModuleByName(u"ignoreKashida_CTL", bodyCascade[numCascade], rLocale))
numCascade++;
} else if (bool(modType & TransliterationModules_NON_IGNORE_MASK)) {
@@ -600,17 +601,17 @@ void TransliterationImpl::loadBody( OUString const &implName, Reference<XExtende
}
bool
TransliterationImpl::loadModuleByName( const OUString& implName,
TransliterationImpl::loadModuleByName( std::u16string_view implName,
Reference<XExtendedTransliteration>& body, const Locale& rLocale)
{
OUString cname = TRLT_IMPLNAME_PREFIX + implName;
OUString cname = OUString::Concat(TRLT_IMPLNAME_PREFIX) + implName;
loadBody(cname, body);
if (body.is()) {
body->loadModule(TransliterationModules(0), rLocale); // toUpper/toLoad need rLocale
// if the module is ignore case/kana/width, load caseignore for equals/compareString mothed
for (sal_Int16 i = 0; i < 3; i++) {
if (implName.equalsAscii(TMlist[i].implName)) {
if (o3tl::equalsAscii(implName, TMlist[i].implName)) {
if (i == 0) // current module is caseignore
body->loadModule(TMlist[0].tm, rLocale); // caseignore need to setup module name
if (! caseignore.is()) {
+6
View File
@@ -21,6 +21,12 @@
namespace o3tl
{
// Like OUString::equalsIgnoreAsciiCase, but for two std::u16string_view:
inline bool equalsAscii(std::u16string_view s1, const char* s2)
{
return rtl_ustr_ascii_compare_WithLength(s1.data(), s1.size(), s2) == 0;
}
// Like OUString::equalsIgnoreAsciiCase, but for two std::u16string_view:
inline bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2)
{
+1 -1
View File
@@ -58,7 +58,7 @@ namespace oox::ppt {
bool mbDirection; // true: default geometric direction
static const transition* getList();
static const transition* find( const OUString& rName );
static const transition* find( std::u16string_view rName );
};
struct OOX_DLLPUBLIC convert_subtype
+1 -1
View File
@@ -38,7 +38,7 @@ namespace oox::ppt {
{
public:
SlideTransition();
explicit SlideTransition(const OUString & );
explicit SlideTransition(std::u16string_view );
void setSlideProperties( PropertyMap& props );
void setTransitionFilterProperties( const css::uno::Reference< css::animations::XTransitionFilter > & xFilter );
+2 -2
View File
@@ -136,10 +136,10 @@ protected:
const SvMacroItemId nEvent ) = 0;
/// convert an API event name to the event ID as used by SvxMacroItem
SvMacroItemId mapNameToEventID(const OUString& rName) const;
SvMacroItemId mapNameToEventID(std::u16string_view rName) const;
/// get the event ID for the name; return 0 if not supported
SvMacroItemId getMacroID(const OUString& rName) const;
SvMacroItemId getMacroID(std::u16string_view rName) const;
};
+3 -3
View File
@@ -169,18 +169,18 @@ public:
const css::uno::Sequence< css::beans::PropertyValue >& rValues );
css::uno::Any
GetProperty( const OUString &rPropertyName ) const;
GetProperty( std::u16string_view rPropertyName ) const;
css::uno::Any
GetProperty( sal_Int32 nPropertyHandle ) const;
bool SetProperty( const OUString &rPropertyName,
bool SetProperty( std::u16string_view rPropertyName,
const css::uno::Any &rValue );
bool SetProperty( sal_Int32 nPropertyHandle,
const css::uno::Any &rValue );
void GetOptions( SvtLinguOptions &rOptions ) const;
bool IsReadOnly( const OUString &rPropertyName ) const;
bool IsReadOnly( std::u16string_view rPropertyName ) const;
//!
//! the following functions work on the 'ServiceManager' sub node of the
+2 -2
View File
@@ -127,13 +127,13 @@ namespace oox::ppt {
return aList;
}
const transition* transition::find( const OUString& rName )
const transition* transition::find( std::u16string_view rName )
{
const transition* p = transition::getList();
while( p->mpName )
{
if( rName.equalsAscii( p->mpName ) )
if( o3tl::equalsAscii( rName, p->mpName ) )
return p;
p++;
+1 -1
View File
@@ -52,7 +52,7 @@ namespace oox::ppt {
}
SlideTransition::SlideTransition(const OUString & sFilterName)
SlideTransition::SlideTransition(std::u16string_view sFilterName)
: mnTransitionType( 0 )
, mnTransitionSubType( 0 )
, mbTransitionDirectionNormal( true )
+4 -3
View File
@@ -38,6 +38,7 @@
#include <oox/ppt/slidetransition.hxx>
#include <oox/token/namespaces.hxx>
#include <oox/token/tokens.hxx>
#include <o3tl/string_view.hxx>
#include "animvariantcontext.hxx"
#include "commonbehaviorcontext.hxx"
@@ -59,13 +60,13 @@ using ::com::sun::star::beans::NamedValue;
namespace {
oox::ppt::AnimationAttributeEnum getAttributeEnumByAPIName(const OUString &rAPIName)
oox::ppt::AnimationAttributeEnum getAttributeEnumByAPIName(std::u16string_view rAPIName)
{
oox::ppt::AnimationAttributeEnum eResult = oox::ppt::AnimationAttributeEnum::UNKNOWN;
const oox::ppt::ImplAttributeNameConversion *attrConv = oox::ppt::getAttributeConversionList();
while(attrConv->mpAPIName != nullptr)
{
if(rAPIName.equalsAscii(attrConv->mpAPIName))
if(o3tl::equalsAscii(rAPIName, attrConv->mpAPIName))
{
eResult = attrConv->meAttribute;
break;
@@ -82,7 +83,7 @@ namespace {
aAny >>= aNameList;
// only get first token.
return oox::ppt::convertAnimationValue(getAttributeEnumByAPIName(aNameList.getToken(0, ';')), rAny);
return oox::ppt::convertAnimationValue(getAttributeEnumByAPIName(o3tl::getToken(aNameList, 0, ';')), rAny);
}
css::uno::Any convertPointPercent(const css::awt::Point& rPoint)
@@ -79,11 +79,11 @@ OFormatProperties::OFormatProperties()
SvtLinguConfig aLinguConfig;
using namespace ::com::sun::star::i18n::ScriptType;
aLinguConfig.GetProperty("DefaultLocale") >>= aCharLocale;
aLinguConfig.GetProperty(u"DefaultLocale") >>= aCharLocale;
LanguageType eCurLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType( aCharLocale, false), LATIN);
aLinguConfig.GetProperty("DefaultLocale_CJK") >>= aCharLocaleAsian;
aLinguConfig.GetProperty(u"DefaultLocale_CJK") >>= aCharLocaleAsian;
LanguageType eCurLangCJK = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType( aCharLocaleAsian, false), ASIAN);
aLinguConfig.GetProperty("DefaultLocale_CTL") >>= aCharLocaleComplex;
aLinguConfig.GetProperty(u"DefaultLocale_CTL") >>= aCharLocaleComplex;
LanguageType eCurLangCTL = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType( aCharLocaleComplex, false), COMPLEX);
vcl::Font aLatin,aCJK,aCTL;
+1 -1
View File
@@ -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 );
+3 -2
View File
@@ -24,6 +24,7 @@
#include <sfx2/objsh.hxx>
#include <unotools/charclass.hxx>
#include <sal/log.hxx>
#include <o3tl/string_view.hxx>
#include <osl/diagnose.h>
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
@@ -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<SC_FUNCGROUP_COUNT; i++)
if ( rName.equalsAscii( aFuncNames[i] ) )
if ( o3tl::equalsAscii( rName, aFuncNames[i] ) )
return i+1; // IDs start at 1
return ID_FUNCTION_GRP_ADDINS; // if not found, use Add-In group
+3 -2
View File
@@ -32,6 +32,7 @@
#include <svl/sharedstringpool.hxx>
#include <sal/log.hxx>
#include <o3tl/safeint.hxx>
#include <o3tl/string_view.hxx>
#include <osl/diagnose.h>
#include <rtl/character.hxx>
#include <unotools/charclass.hxx>
@@ -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)
{
+1 -1
View File
@@ -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 );
}
+3 -2
View File
@@ -37,6 +37,7 @@
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <o3tl/string_view.hxx>
#include <sal/macros.h>
#include <sal/mathconf.h>
#include <svl/itemset.hxx>
@@ -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 );
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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;
@@ -17,6 +17,7 @@
#include <document.hxx>
#include <o3tl/string_view.hxx>
#include <svl/style.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/frame.hxx>
@@ -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?
+1 -1
View File
@@ -41,7 +41,7 @@ public:
static css::presentation::AnimationSpeed ConvertDuration( double fDuration );
static double ConvertAnimationSpeed( css::presentation::AnimationSpeed eSpeed );
static bool ConvertPreset( const OUString& rPresetId, const OUString* pPresetSubType, css::presentation::AnimationEffect& rEffect );
static bool ConvertPreset( std::u16string_view rPresetId, const OUString* pPresetSubType, css::presentation::AnimationEffect& rEffect );
static bool ConvertAnimationEffect( const css::presentation::AnimationEffect& rEffect, OUString& rPresetId, OUString& rPresetSubType );
static void SetFadeEffect( SdPage* pPage, css::presentation::FadeEffect eNewEffect);
+4 -3
View File
@@ -25,6 +25,7 @@
#include <com/sun/star/animations/AnimationFill.hpp>
#include <com/sun/star/animations/XAnimate.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
#include <o3tl/string_view.hxx>
#include <tools/debug.hxx>
#include <svx/unoshape.hxx>
#include <svx/svdotext.hxx>
@@ -751,16 +752,16 @@ AnimationEffect EffectMigration::GetTextAnimationEffect( SvxShape* pShape )
return eEffect;
}
bool EffectMigration::ConvertPreset( const OUString& rPresetId, const OUString* pPresetSubType, AnimationEffect& rEffect )
bool EffectMigration::ConvertPreset( std::u16string_view rPresetId, const OUString* pPresetSubType, AnimationEffect& rEffect )
{
rEffect = AnimationEffect_NONE;
if( !rPresetId.isEmpty() )
if( !rPresetId.empty() )
{
// first try a match for preset id and subtype
deprecated_AnimationEffect_conversion_table_entry const * p = deprecated_AnimationEffect_conversion_table;
while( p->mpPresetId )
{
if( rPresetId.equalsAscii( p->mpPresetId ) &&
if( o3tl::equalsAscii( rPresetId, p->mpPresetId ) &&
(( p->mpPresetSubType == nullptr ) ||
( pPresetSubType == nullptr) ||
( pPresetSubType->equalsAscii( p->mpPresetSubType )) ) )
+10 -10
View File
@@ -138,7 +138,7 @@ static void ImplTranslateAttribute( OUString& rString, const TranslateMode eTran
}
}
sal_uInt32 AnimationExporter::TranslatePresetSubType( const sal_uInt32 nPresetClass, const sal_uInt32 nPresetId, const OUString& rPresetSubType )
sal_uInt32 AnimationExporter::TranslatePresetSubType( const sal_uInt32 nPresetClass, const sal_uInt32 nPresetId, std::u16string_view rPresetSubType )
{
sal_uInt32 nPresetSubType = 0;
bool bTranslated = false;
@@ -151,12 +151,12 @@ sal_uInt32 AnimationExporter::TranslatePresetSubType( const sal_uInt32 nPresetCl
{
case 5 :
{
if ( rPresetSubType == "downward" )
if ( rPresetSubType == u"downward" )
{
nPresetSubType = 5;
bTranslated = true;
}
else if ( rPresetSubType == "across" )
else if ( rPresetSubType == u"across" )
{
nPresetSubType = 10;
bTranslated = true;
@@ -165,7 +165,7 @@ sal_uInt32 AnimationExporter::TranslatePresetSubType( const sal_uInt32 nPresetCl
break;
case 17 :
{
if ( rPresetSubType == "across" )
if ( rPresetSubType == u"across" )
{
nPresetSubType = 10;
bTranslated = true;
@@ -174,22 +174,22 @@ sal_uInt32 AnimationExporter::TranslatePresetSubType( const sal_uInt32 nPresetCl
break;
case 18 :
{
if ( rPresetSubType == "right-to-top" )
if ( rPresetSubType == u"right-to-top" )
{
nPresetSubType = 3;
bTranslated = true;
}
else if ( rPresetSubType == "right-to-bottom" )
else if ( rPresetSubType == u"right-to-bottom" )
{
nPresetSubType = 6;
bTranslated = true;
}
else if ( rPresetSubType == "left-to-top" )
else if ( rPresetSubType == u"left-to-top" )
{
nPresetSubType = 9;
bTranslated = true;
}
else if ( rPresetSubType == "left-to-bottom" )
else if ( rPresetSubType == u"left-to-bottom" )
{
nPresetSubType = 12;
bTranslated = true;
@@ -203,7 +203,7 @@ sal_uInt32 AnimationExporter::TranslatePresetSubType( const sal_uInt32 nPresetCl
const oox::ppt::convert_subtype* p = oox::ppt::convert_subtype::getList();
while( p->mpStrSubType )
{
if ( rPresetSubType.equalsAscii( p->mpStrSubType ) )
if ( o3tl::equalsAscii( rPresetSubType, p->mpStrSubType ) )
{
nPresetSubType = p->mnID;
bTranslated = true;
@@ -214,7 +214,7 @@ sal_uInt32 AnimationExporter::TranslatePresetSubType( const sal_uInt32 nPresetCl
}
}
if ( !bTranslated )
nPresetSubType = rPresetSubType.toUInt32();
nPresetSubType = o3tl::toUInt32(rPresetSubType);
return nPresetSubType;
}
+1 -1
View File
@@ -122,7 +122,7 @@ public:
static bool GetNodeType( const css::uno::Reference< css::animations::XAnimationNode >& xNode, sal_Int16& nType );
static sal_Int16 GetFillMode( const css::uno::Reference< css::animations::XAnimationNode >& xNode, const sal_Int16 nFillDefault );
static void GetUserData( const css::uno::Sequence< css::beans::NamedValue >& rUserData, const css::uno::Any ** pAny, std::size_t nLen );
static sal_uInt32 TranslatePresetSubType( const sal_uInt32 nPresetClass, const sal_uInt32 nPresetId, const OUString& rPresetSubType );
static sal_uInt32 TranslatePresetSubType( const sal_uInt32 nPresetClass, const sal_uInt32 nPresetId, std::u16string_view rPresetSubType );
static sal_uInt32 GetPresetID( const OUString& rPreset, sal_uInt32 nAPIPresetClass, bool& bPresetId );
static sal_uInt32 GetValueTypeForAttributeName( const OUString& rAttributeName );
+3 -2
View File
@@ -32,6 +32,7 @@
#include <cppuhelper/supportsservice.hxx>
#include <comphelper/propertysethelper.hxx>
#include <comphelper/propertysetinfo.hxx>
#include <o3tl/string_view.hxx>
#include <tools/debug.hxx>
#include <tools/urlobj.hxx>
#include <svx/xtable.hxx>
@@ -289,10 +290,10 @@ struct {
{ "BitmapTableURL", XPropertyListType::Bitmap }
};
static XPropertyListType getTypeOfName( const OUString &aName )
static XPropertyListType getTypeOfName( std::u16string_view aName )
{
for(const auto & rURLPropertyName : aURLPropertyNames) {
if( aName.equalsAscii( rURLPropertyName.pName ) )
if( o3tl::equalsAscii( aName, rURLPropertyName.pName ) )
return rURLPropertyName.t;
}
return XPropertyListType::Unknown;
+2 -2
View File
@@ -53,10 +53,10 @@ class SmLocalizedSymbolData
public:
SmLocalizedSymbolData() = delete;
static OUString GetUiSymbolName( const OUString &rExportName );
static OUString GetUiSymbolName( std::u16string_view rExportName );
static OUString GetExportSymbolName( std::u16string_view rUiName );
static OUString GetUiSymbolSetName( const OUString &rExportName );
static OUString GetUiSymbolSetName( std::u16string_view rExportName );
static OUString GetExportSymbolSetName( std::u16string_view rUiName );
};
+1 -1
View File
@@ -2621,7 +2621,7 @@ std::unique_ptr<SmSpecialNode> SmParser5::DoSpecial()
{
if (IsImportSymbolNames())
{
aNewName = SmLocalizedSymbolData::GetUiSymbolName(rName.copy(1));
aNewName = SmLocalizedSymbolData::GetUiSymbolName(rName.subView(1));
bReplace = true;
}
else if (IsExportSymbolNames())
+5 -4
View File
@@ -19,6 +19,7 @@
#include <sal/config.h>
#include <o3tl/string_view.hxx>
#include <sfx2/objface.hxx>
#include <svl/whiter.hxx>
#include <sfx2/viewsh.hxx>
@@ -43,13 +44,13 @@ OUString SmResId(TranslateId aId)
return Translate::get(aId, SM_MOD()->GetResLocale());
}
OUString SmLocalizedSymbolData::GetUiSymbolName( const OUString &rExportName )
OUString SmLocalizedSymbolData::GetUiSymbolName( std::u16string_view rExportName )
{
OUString aRes;
for (size_t i = 0; i < SAL_N_ELEMENTS(RID_UI_SYMBOL_NAMES); ++i)
{
if (rExportName.equalsAscii(RID_UI_SYMBOL_NAMES[i].mpId))
if (o3tl::equalsAscii(rExportName, RID_UI_SYMBOL_NAMES[i].mpId))
{
aRes = SmResId(RID_UI_SYMBOL_NAMES[i]);
break;
@@ -76,13 +77,13 @@ OUString SmLocalizedSymbolData::GetExportSymbolName( std::u16string_view rUiName
return aRes;
}
OUString SmLocalizedSymbolData::GetUiSymbolSetName( const OUString &rExportName )
OUString SmLocalizedSymbolData::GetUiSymbolSetName( std::u16string_view rExportName )
{
OUString aRes;
for (size_t i = 0; i < SAL_N_ELEMENTS(RID_UI_SYMBOLSET_NAMES); ++i)
{
if (rExportName.equalsAscii(RID_UI_SYMBOLSET_NAMES[i].mpId))
if (o3tl::equalsAscii(rExportName, RID_UI_SYMBOLSET_NAMES[i].mpId))
{
aRes = SmResId(RID_UI_SYMBOLSET_NAMES[i]);
break;
+2 -2
View File
@@ -224,7 +224,7 @@ void SmSymbolManager::Load()
}
// now add a %i... symbol to the 'iGreek' set for every symbol found in the 'Greek' set.
const OUString aGreekSymbolSetName(SmLocalizedSymbolData::GetUiSymbolSetName("Greek"));
const OUString aGreekSymbolSetName(SmLocalizedSymbolData::GetUiSymbolSetName(u"Greek"));
const SymbolPtrVec_t aGreekSymbols( GetSymbolSet( aGreekSymbolSetName ) );
OUString aSymbolSetName = "i" + aGreekSymbolSetName;
size_t nSymbols = aGreekSymbols.size();
@@ -252,7 +252,7 @@ void SmSymbolManager::Save()
// prepare to skip symbols from iGreek on saving
OUString aSymbolSetName = "i" +
SmLocalizedSymbolData::GetUiSymbolSetName("Greek");
SmLocalizedSymbolData::GetUiSymbolSetName(u"Greek");
SymbolPtrVec_t aTmp( GetSymbols() );
std::vector< SmSym > aSymbols;
+4 -3
View File
@@ -21,6 +21,7 @@
#include <comphelper/propertyvalue.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <o3tl/string_view.hxx>
#include <osl/diagnose.h>
#include <sfx2/event.hxx>
#include <svtools/unoevent.hxx>
@@ -284,12 +285,12 @@ Sequence<OUString> SvBaseEventDescriptor::getSupportedServiceNames()
return { sAPI_ServiceName };
}
SvMacroItemId SvBaseEventDescriptor::mapNameToEventID(const OUString& rName) const
SvMacroItemId SvBaseEventDescriptor::mapNameToEventID(std::u16string_view rName) const
{
// iterate over known event names
for(sal_Int16 i = 0; i < mnMacroItems; i++)
{
if( rName.equalsAscii(mpSupportedMacroItems[i].mpEventName))
if( o3tl::equalsAscii(rName, mpSupportedMacroItems[i].mpEventName))
{
return mpSupportedMacroItems[i].mnEvent;
}
@@ -299,7 +300,7 @@ SvMacroItemId SvBaseEventDescriptor::mapNameToEventID(const OUString& rName) con
return SvMacroItemId::NONE;
}
SvMacroItemId SvBaseEventDescriptor::getMacroID(const OUString& rName) const
SvMacroItemId SvBaseEventDescriptor::getMacroID(std::u16string_view rName) const
{
return mapNameToEventID(rName);
}
+3 -2
View File
@@ -25,6 +25,7 @@
#include <com/sun/star/xforms/XFormsSupplier.hpp>
#include <com/sun/star/frame/XModule.hpp>
#include <o3tl/string_view.hxx>
#include <tools/diagnose_ex.h>
@@ -164,12 +165,12 @@ namespace svxform
}
DocumentType DocumentClassification::getDocumentTypeForModuleIdentifier( const OUString& _rModuleIdentifier )
DocumentType DocumentClassification::getDocumentTypeForModuleIdentifier( std::u16string_view _rModuleIdentifier )
{
const ModuleInfo* pModuleInfo = lcl_getModuleInfo();
while ( pModuleInfo->pAsciiModuleOrServiceName )
{
if ( _rModuleIdentifier.equalsAscii( pModuleInfo->pAsciiModuleOrServiceName ) )
if ( o3tl::equalsAscii(_rModuleIdentifier, pModuleInfo->pAsciiModuleOrServiceName ) )
return pModuleInfo->eType;
++pModuleInfo;
}
+1 -1
View File
@@ -54,7 +54,7 @@ namespace svxform
);
static DocumentType getDocumentTypeForModuleIdentifier(
const OUString& _rModuleIdentifier
std::u16string_view _rModuleIdentifier
);
static OUString getModuleIdentifierForDocumentType(
+3 -2
View File
@@ -20,6 +20,7 @@
#include <sal/config.h>
#include <comphelper/propertyvalue.hxx>
#include <o3tl/string_view.hxx>
#include <vcl/toolbox.hxx>
#include <vcl/idle.hxx>
#include <svl/intitem.hxx>
@@ -161,7 +162,7 @@ struct CommandToRID
}
static OUString ImplGetRID( const OUString& aCommand )
static OUString ImplGetRID( std::u16string_view aCommand )
{
static constexpr OUStringLiteral EMPTY = u"";
static const CommandToRID aImplCommandToResMap[] =
@@ -181,7 +182,7 @@ static OUString ImplGetRID( const OUString& aCommand )
sal_Int32 i( 0 );
while ( aImplCommandToResMap[ i ].pCommand )
{
if ( aCommand.equalsAscii( aImplCommandToResMap[ i ].pCommand ))
if ( o3tl::equalsAscii( aCommand, aImplCommandToResMap[ i ].pCommand ))
{
sRID = aImplCommandToResMap[i].sResId;
break;
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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();
+2 -2
View File
@@ -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;
}
+3 -2
View File
@@ -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;
+3 -2
View File
@@ -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() )
{
+3 -3
View File
@@ -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));
+3 -2
View File
@@ -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;
+2 -1
View File
@@ -24,6 +24,7 @@
#include <string_view>
#include <o3tl/any.hxx>
#include <o3tl/string_view.hxx>
#include <osl/diagnose.h>
#include <osl/diagnose.hxx>
#include <sal/types.h>
@@ -1313,7 +1314,7 @@ SAL_DLLPUBLIC_EXPORT void * component_getFactory(
{
void * pRet = nullptr;
if (pServiceManager && OUString(IMPLNAME).equalsAscii(pImplName))
if (pServiceManager && o3tl::equalsAscii(IMPLNAME, pImplName))
{
Reference< XInterface > xFactory(
createSingleComponentFactory(
+2 -1
View File
@@ -20,6 +20,7 @@
#include <utility>
#include <cppu/unotype.hxx>
#include <o3tl/string_view.hxx>
#include <osl/diagnose.h>
#include <osl/diagnose.hxx>
#include <osl/thread.hxx>
@@ -1197,7 +1198,7 @@ SAL_DLLPUBLIC_EXPORT void * component_getFactory(
{
void * pRet = nullptr;
if (pServiceManager && OUString(IMPLNAME).equalsAscii(pImplName))
if (pServiceManager && o3tl::equalsAscii(IMPLNAME, pImplName))
{
Reference< XSingleServiceFactory > xFactory( createSingleFactory(
static_cast< XMultiServiceFactory * >( pServiceManager ),
+13 -12
View File
@@ -37,6 +37,7 @@
#include <sal/macros.h>
#include <comphelper/getexpandeduri.hxx>
#include <comphelper/processfactory.hxx>
#include <o3tl/string_view.hxx>
#include "itemholder1.hxx"
@@ -149,7 +150,7 @@ class SvtLinguConfigItem : public utl::ConfigItem
{
SvtLinguOptions aOpt;
static bool GetHdlByName( sal_Int32 &rnHdl, const OUString &rPropertyName, bool bFullPropName = false );
static bool GetHdlByName( sal_Int32 &rnHdl, std::u16string_view rPropertyName, bool bFullPropName = false );
static uno::Sequence< OUString > GetPropertyNames();
void LoadOptions( const uno::Sequence< OUString > &rProperyNames );
bool SaveOptions( const uno::Sequence< OUString > &rProperyNames );
@@ -173,18 +174,18 @@ public:
//using utl::ConfigItem::GetReadOnlyStates;
css::uno::Any
GetProperty( const OUString &rPropertyName ) const;
GetProperty( std::u16string_view rPropertyName ) const;
css::uno::Any
GetProperty( sal_Int32 nPropertyHandle ) const;
bool SetProperty( const OUString &rPropertyName,
bool SetProperty( std::u16string_view rPropertyName,
const css::uno::Any &rValue );
bool SetProperty( sal_Int32 nPropertyHandle,
const css::uno::Any &rValue );
const SvtLinguOptions& GetOptions() const;
bool IsReadOnly( const OUString &rPropertyName ) const;
bool IsReadOnly( std::u16string_view rPropertyName ) const;
bool IsReadOnly( sal_Int32 nPropertyHandle ) const;
};
@@ -286,7 +287,7 @@ uno::Sequence< OUString > SvtLinguConfigItem::GetPropertyNames()
bool SvtLinguConfigItem::GetHdlByName(
sal_Int32 &rnHdl,
const OUString &rPropertyName,
std::u16string_view rPropertyName,
bool bFullPropName )
{
NamesToHdl const *pEntry = &aNamesToHdl[0];
@@ -295,7 +296,7 @@ bool SvtLinguConfigItem::GetHdlByName(
{
while (pEntry && pEntry->pFullPropName != nullptr)
{
if (rPropertyName.equalsAscii( pEntry->pFullPropName ))
if (o3tl::equalsAscii(rPropertyName, pEntry->pFullPropName ))
{
rnHdl = pEntry->nHdl;
break;
@@ -319,7 +320,7 @@ bool SvtLinguConfigItem::GetHdlByName(
}
}
uno::Any SvtLinguConfigItem::GetProperty( const OUString &rPropertyName ) const
uno::Any SvtLinguConfigItem::GetProperty( std::u16string_view rPropertyName ) const
{
osl::MutexGuard aGuard(theSvtLinguConfigItemMutex());
@@ -409,7 +410,7 @@ uno::Any SvtLinguConfigItem::GetProperty( sal_Int32 nPropertyHandle ) const
return aRes;
}
bool SvtLinguConfigItem::SetProperty( const OUString &rPropertyName, const uno::Any &rValue )
bool SvtLinguConfigItem::SetProperty( std::u16string_view rPropertyName, const uno::Any &rValue )
{
osl::MutexGuard aGuard(theSvtLinguConfigItemMutex());
@@ -746,7 +747,7 @@ bool SvtLinguConfigItem::SaveOptions( const uno::Sequence< OUString > &rProperyN
return bRet;
}
bool SvtLinguConfigItem::IsReadOnly( const OUString &rPropertyName ) const
bool SvtLinguConfigItem::IsReadOnly( std::u16string_view rPropertyName ) const
{
osl::MutexGuard aGuard(theSvtLinguConfigItemMutex());
@@ -856,7 +857,7 @@ bool SvtLinguConfig::ReplaceSetProperties(
return GetConfigItem().ReplaceSetProperties( rNode, rValues );
}
uno::Any SvtLinguConfig::GetProperty( const OUString &rPropertyName ) const
uno::Any SvtLinguConfig::GetProperty( std::u16string_view rPropertyName ) const
{
return GetConfigItem().GetProperty( rPropertyName );
}
@@ -866,7 +867,7 @@ uno::Any SvtLinguConfig::GetProperty( sal_Int32 nPropertyHandle ) const
return GetConfigItem().GetProperty( nPropertyHandle );
}
bool SvtLinguConfig::SetProperty( const OUString &rPropertyName, const uno::Any &rValue )
bool SvtLinguConfig::SetProperty( std::u16string_view rPropertyName, const uno::Any &rValue )
{
return GetConfigItem().SetProperty( rPropertyName, rValue );
}
@@ -881,7 +882,7 @@ void SvtLinguConfig::GetOptions( SvtLinguOptions &rOptions ) const
rOptions = GetConfigItem().GetOptions();
}
bool SvtLinguConfig::IsReadOnly( const OUString &rPropertyName ) const
bool SvtLinguConfig::IsReadOnly( std::u16string_view rPropertyName ) const
{
return GetConfigItem().IsReadOnly( rPropertyName );
}
+1 -1
View File
@@ -412,7 +412,7 @@ public:
namespace vcl_sal {
// get foreign key names
OUString getKeysymReplacementName(
const OUString& pLang,
std::u16string_view pLang,
KeySym nSymbol );
inline SalDisplay *getSalDisplay(GenericUnixSalData const * data)
+3 -2
View File
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <o3tl/string_view.hxx>
#include <unx/saldisp.hxx>
#include <X11/keysym.h>
#include <sal/macros.h>
@@ -478,11 +479,11 @@ namespace vcl_sal {
};
// translate keycodes, used within the displayed menu shortcuts
OUString getKeysymReplacementName( const OUString& pLang, KeySym nSymbol )
OUString getKeysymReplacementName( std::u16string_view pLang, KeySym nSymbol )
{
for(const auto & rKeyboard : aKeyboards)
{
if( pLang.equalsAscii( rKeyboard.pLangName ) )
if( o3tl::equalsAscii( pLang, rKeyboard.pLangName ) )
{
const struct KeysymNameReplacement* pRepl = rKeyboard.pReplacements;
for( int m = rKeyboard.nReplacements ; m ; )
+1 -1
View File
@@ -40,7 +40,7 @@ class SdXMLNumberFormatImportContext final : public SvXMLNumFormatContext
bool compareStyle( const SdXMLFixedDataStyle* pStyle, sal_Int16& nIndex ) const;
void add( std::u16string_view rNumberStyle, bool bLong, bool bTextual, bool bDecimal02, OUString const & rText );
void add( std::u16string_view rNumberStyle, bool bLong, bool bTextual, bool bDecimal02, std::u16string_view rText );
public:
+4 -3
View File
@@ -24,6 +24,7 @@
#include <xmloff/namespacemap.hxx>
#include <xmloff/xmltoken.hxx>
#include <o3tl/string_view.hxx>
#include <sal/log.hxx>
#include "sdxmlexp_impl.hxx"
@@ -600,7 +601,7 @@ SdXMLNumberFormatImportContext::~SdXMLNumberFormatImportContext()
{
}
void SdXMLNumberFormatImportContext::add( std::u16string_view rNumberStyle, bool bLong, bool bTextual, bool bDecimal02, OUString const & rText )
void SdXMLNumberFormatImportContext::add( std::u16string_view rNumberStyle, bool bLong, bool bTextual, bool bDecimal02, std::u16string_view rText )
{
if (mnIndex == 16)
return;
@@ -612,8 +613,8 @@ void SdXMLNumberFormatImportContext::add( std::u16string_view rNumberStyle, bool
(pStyleMember->mbLong == bLong) &&
(pStyleMember->mbTextual == bTextual) &&
(pStyleMember->mbDecimal02 == bDecimal02) &&
( ( (pStyleMember->mpText == nullptr) && (rText.isEmpty()) ) ||
( pStyleMember->mpText && (rText.equalsAscii( pStyleMember->mpText ) ) ) ) )
( ( (pStyleMember->mpText == nullptr) && (rText.empty()) ) ||
( pStyleMember->mpText && (o3tl::equalsAscii( rText, pStyleMember->mpText ) ) ) ) )
{
mnElements[mnIndex++] = static_cast<DataStyleNumber>(nIndex + 1);
return;