loplugin:stringviewparam improvements
improve the check by checking for methods that exclude using string_view, rather than checking for methods that __can__ use string_view, which leads to exposing some holes in our o3tl/string_view.hxx coverage. Change-Id: Ic9dd60441c671f502692f9cd2a1bb67301c4b960 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150277 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -1735,7 +1735,7 @@ void SbModule::GetCodeCompleteDataFromParse(CodeCompleteDataCache& aCache)
|
||||
}
|
||||
|
||||
|
||||
OUString SbModule::GetKeywordCase( const OUString& sKeyword )
|
||||
OUString SbModule::GetKeywordCase( std::u16string_view sKeyword )
|
||||
{
|
||||
return SbiParser::GetKeywordCase( sKeyword );
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include <basic/sberrors.hxx>
|
||||
#include <sal/macros.h>
|
||||
#include <o3tl/string_view.hxx>
|
||||
#include <basiccharclass.hxx>
|
||||
#include <token.hxx>
|
||||
|
||||
@@ -558,11 +559,11 @@ bool SbiTokenizer::MayBeLabel( bool bNeedsColon )
|
||||
}
|
||||
|
||||
|
||||
OUString SbiTokenizer::GetKeywordCase( const OUString& sKeyword )
|
||||
OUString SbiTokenizer::GetKeywordCase( std::u16string_view sKeyword )
|
||||
{
|
||||
for( auto& rTok : aTokTable_Basic )
|
||||
{
|
||||
if( sKeyword.equalsIgnoreAsciiCaseAscii(rTok.s) )
|
||||
if( o3tl::equalsIgnoreAsciiCase(sKeyword, rTok.s) )
|
||||
return OStringToOUString(rTok.s, RTL_TEXTENCODING_ASCII_US);
|
||||
}
|
||||
return OUString();
|
||||
|
||||
@@ -130,7 +130,7 @@ public:
|
||||
{ return t >= FIRSTKWD && t <= LASTKWD; }
|
||||
static bool IsExtra( SbiToken t )
|
||||
{ return t >= FIRSTEXTRA; }
|
||||
static OUString GetKeywordCase( const OUString& sKeyword );
|
||||
static OUString GetKeywordCase( std::u16string_view sKeyword );
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,11 @@
|
||||
|
||||
#include <comphelper/fileurl.hxx>
|
||||
#include <rtl/ustring.hxx>
|
||||
#include <o3tl/string_view.hxx>
|
||||
|
||||
bool comphelper::isFileUrl(OUString const& url) { return url.startsWithIgnoreAsciiCase("file:"); }
|
||||
bool comphelper::isFileUrl(std::u16string_view url)
|
||||
{
|
||||
return o3tl::matchIgnoreAsciiCase(url, "file:");
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
||||
@@ -137,12 +137,11 @@ DeclRefExpr const* relevantCXXMemberCallExpr(CXXMemberCallExpr const* expr)
|
||||
else if (auto const i = d->getIdentifier())
|
||||
{
|
||||
auto const n = i->getName();
|
||||
if (n == "endsWith" || n == "isEmpty" || n == "startsWith" || n == "subView"
|
||||
|| 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 == "equalsAscii" || n == "equalsAsciiL"
|
||||
|| n == "matchIgnoreAsciiCase")
|
||||
if (!(n == "getLength" || n == "getStr" || n == "convertToString" || n == "replace"
|
||||
|| n == "replaceAll" || n == "replaceAt" || n == "replaceFirst"
|
||||
|| n == "toAsciiLowerCase" || n == "toAsciiUpperCase" || n == "toUtf8"
|
||||
|| n == "iterateCodePoints" || n == "startsWithIgnoreAsciiCase" || n == "toUInt64"
|
||||
|| n == "toFloat" || n == "toBoolean"))
|
||||
{
|
||||
good = true;
|
||||
}
|
||||
|
||||
@@ -221,10 +221,10 @@ OUString convertName2SQLName(const OUString& rName, std::u16string_view _rSpecia
|
||||
return aNewName.makeStringAndClear();
|
||||
}
|
||||
|
||||
OUString quoteName(const OUString& _rQuote, const OUString& _rName)
|
||||
OUString quoteName(std::u16string_view _rQuote, const OUString& _rName)
|
||||
{
|
||||
OUString sName = _rName;
|
||||
if( !_rQuote.isEmpty() && _rQuote.toChar() != ' ')
|
||||
if( !_rQuote.empty() && _rQuote[0] != ' ')
|
||||
sName = _rQuote + _rName + _rQuote;
|
||||
return sName;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace
|
||||
bool bHaving,
|
||||
bool _bAddOrOnOneLine);
|
||||
|
||||
OUString quoteTableAlias(bool _bQuote, const OUString& _sAliasName, const OUString& _sQuote)
|
||||
OUString quoteTableAlias(bool _bQuote, const OUString& _sAliasName, std::u16string_view _sQuote)
|
||||
{
|
||||
OUString sRet;
|
||||
if ( _bQuote && !_sAliasName.isEmpty() )
|
||||
|
||||
@@ -69,9 +69,9 @@ using namespace ::com::sun::star::accessibility;
|
||||
|
||||
namespace
|
||||
{
|
||||
bool isFieldNameAsterisk(const OUString& _sFieldName )
|
||||
bool isFieldNameAsterisk(std::u16string_view _sFieldName )
|
||||
{
|
||||
bool bAsterisk = _sFieldName.isEmpty() || _sFieldName.toChar() == '*';
|
||||
bool bAsterisk = _sFieldName.empty() || _sFieldName[0] == '*';
|
||||
if ( !bAsterisk )
|
||||
{
|
||||
sal_Int32 nTokenCount = comphelper::string::getTokenCount(_sFieldName, '.');
|
||||
@@ -576,7 +576,7 @@ void OSelectionBrowseBox::notifyFunctionFieldChanged(const OUString& _sOldFuncti
|
||||
RowModified(GetBrowseRow(BROW_FUNCTION_ROW), _nColumnId);
|
||||
}
|
||||
|
||||
void OSelectionBrowseBox::clearEntryFunctionField(const OUString& _sFieldName,OTableFieldDescRef const & _pEntry, bool& _bListAction,sal_uInt16 _nColumnId)
|
||||
void OSelectionBrowseBox::clearEntryFunctionField(std::u16string_view _sFieldName,OTableFieldDescRef const & _pEntry, bool& _bListAction,sal_uInt16 _nColumnId)
|
||||
{
|
||||
if ( !(isFieldNameAsterisk( _sFieldName ) && (!_pEntry->isNoneFunction() || _pEntry->IsGroupBy())) )
|
||||
return;
|
||||
|
||||
@@ -306,7 +306,7 @@ namespace dbaui
|
||||
@param _bListAction
|
||||
When <TRUE/> a list action will be created.
|
||||
*/
|
||||
void clearEntryFunctionField(const OUString& _sFieldName,OTableFieldDescRef const & _pEntry, bool& _bListAction,sal_uInt16 _nColumnId);
|
||||
void clearEntryFunctionField(std::u16string_view _sFieldName,OTableFieldDescRef const & _pEntry, bool& _bListAction,sal_uInt16 _nColumnId);
|
||||
|
||||
/** remove or insert the necessary function types
|
||||
@param _pEntry
|
||||
|
||||
@@ -96,7 +96,7 @@ class JobURL
|
||||
|
||||
private:
|
||||
|
||||
static bool implst_split( const OUString& sPart ,
|
||||
static bool implst_split( std::u16string_view sPart ,
|
||||
const char* pPartIdentifier ,
|
||||
sal_Int32 nPartLength ,
|
||||
OUString& rPartValue ,
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <jobs/joburl.hxx>
|
||||
|
||||
#include <vcl/svapp.hxx>
|
||||
#include <o3tl/string_view.hxx>
|
||||
|
||||
namespace framework{
|
||||
|
||||
@@ -205,14 +206,14 @@ bool JobURL::getService( /*OUT*/ OUString& sService ) const
|
||||
@return <TRUE/> if the identifier could be found and the string was split.
|
||||
<FALSE/> otherwise.
|
||||
*/
|
||||
bool JobURL::implst_split( /*IN*/ const OUString& sPart ,
|
||||
bool JobURL::implst_split( /*IN*/ std::u16string_view sPart ,
|
||||
/*IN*/ const char* pPartIdentifier ,
|
||||
/*IN*/ sal_Int32 nPartLength ,
|
||||
/*OUT*/ OUString& rPartValue ,
|
||||
/*OUT*/ OUString& rPartArguments )
|
||||
{
|
||||
// first search for the given identifier
|
||||
bool bPartFound = sPart.matchIgnoreAsciiCaseAsciiL(pPartIdentifier,nPartLength);
|
||||
bool bPartFound = o3tl::matchIgnoreAsciiCase(sPart, std::string_view(pPartIdentifier,nPartLength));
|
||||
|
||||
// If it exist - we can split the part and return sal_True.
|
||||
// Otherwise we do nothing and return sal_False.
|
||||
@@ -222,16 +223,16 @@ bool JobURL::implst_split( /*IN*/ const OUString& sPart ,
|
||||
// Do so - we set the return value with the whole part string.
|
||||
// Arguments will be set to an empty string as default.
|
||||
// If we detect the right sign - we split the arguments and overwrite the default.
|
||||
OUString sValueAndArguments = sPart.copy(nPartLength);
|
||||
OUString sValue = sValueAndArguments;
|
||||
std::u16string_view sValueAndArguments = sPart.substr(nPartLength);
|
||||
std::u16string_view sValue = sValueAndArguments;
|
||||
OUString sArguments;
|
||||
|
||||
sal_Int32 nArgStart = sValueAndArguments.indexOf('?');
|
||||
if (nArgStart!=-1)
|
||||
size_t nArgStart = sValueAndArguments.find('?');
|
||||
if (nArgStart != std::u16string_view::npos)
|
||||
{
|
||||
sValue = sValueAndArguments.copy(0,nArgStart);
|
||||
sValue = sValueAndArguments.substr(0,nArgStart);
|
||||
++nArgStart; // ignore '?'!
|
||||
sArguments = sValueAndArguments.copy(nArgStart);
|
||||
sArguments = sValueAndArguments.substr(nArgStart);
|
||||
}
|
||||
|
||||
rPartValue = sValue;
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
|
||||
#include <sal/log.hxx>
|
||||
#include <o3tl/string_view.hxx>
|
||||
#include <rtl/ustring.hxx>
|
||||
#include <rtl/string.hxx>
|
||||
|
||||
@@ -87,7 +88,7 @@ struct IsoLanguageScriptCountryEntry
|
||||
|
||||
We don't have OUString::startsWithIgnoreAsciiCaseAscii()
|
||||
*/
|
||||
bool startsInIgnoreAsciiCase( const OUString & rStr ) const;
|
||||
bool startsInIgnoreAsciiCase( std::u16string_view aStr ) const;
|
||||
};
|
||||
|
||||
struct Bcp47CountryEntry
|
||||
@@ -830,9 +831,9 @@ css::lang::Locale IsoLanguageScriptCountryEntry::getLocale() const
|
||||
return lang::Locale( I18NLANGTAG_QLT, OUString::createFromAscii( maCountry), getTagString());
|
||||
}
|
||||
|
||||
bool IsoLanguageScriptCountryEntry::startsInIgnoreAsciiCase( const OUString & rStr ) const
|
||||
bool IsoLanguageScriptCountryEntry::startsInIgnoreAsciiCase( std::u16string_view aStr ) const
|
||||
{
|
||||
return rStr.matchIgnoreAsciiCaseAsciiL( maLanguageScript, strlen( maLanguageScript) );
|
||||
return o3tl::matchIgnoreAsciiCase(aStr, std::string_view(maLanguageScript) );
|
||||
}
|
||||
|
||||
OUString Bcp47CountryEntry::getTagString() const
|
||||
@@ -1208,12 +1209,12 @@ css::lang::Locale MsLangId::Conversion::lookupFallbackLocale(
|
||||
|
||||
|
||||
// static
|
||||
LanguageType MsLangId::Conversion::convertPrivateUseToLanguage( const OUString& rPriv )
|
||||
LanguageType MsLangId::Conversion::convertPrivateUseToLanguage( std::u16string_view rPriv )
|
||||
{
|
||||
for (const IsoLangOtherEntry* pPrivateEntry = aImplPrivateUseEntries;
|
||||
pPrivateEntry->mnLang != LANGUAGE_DONTKNOW; ++pPrivateEntry)
|
||||
{
|
||||
if ( rPriv.equalsIgnoreAsciiCaseAscii( pPrivateEntry->mpLanguage ) )
|
||||
if ( o3tl::equalsIgnoreAsciiCase(rPriv, pPrivateEntry->mpLanguage ) )
|
||||
return pPrivateEntry->mnLang;
|
||||
}
|
||||
return LANGUAGE_DONTKNOW;
|
||||
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
void GetCodeCompleteDataFromParse(CodeCompleteDataCache& aCache);
|
||||
const SbxArrayRef& GetMethods() const { return pMethods;}
|
||||
SbMethod* FindMethod( const OUString&, SbxClassType );
|
||||
static OUString GetKeywordCase( const OUString& sKeyword );
|
||||
static OUString GetKeywordCase( std::u16string_view sKeyword );
|
||||
};
|
||||
|
||||
typedef tools::SvRef<SbModule> SbModuleRef;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
namespace comphelper
|
||||
{
|
||||
// Return true iff url is an absolute URL of "file" scheme:
|
||||
COMPHELPER_DLLPUBLIC bool isFileUrl(OUString const& url);
|
||||
COMPHELPER_DLLPUBLIC bool isFileUrl(std::u16string_view url);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -367,7 +367,7 @@ namespace dbtools
|
||||
|
||||
/** quote the given name with the given quote string.
|
||||
*/
|
||||
OOO_DLLPUBLIC_DBTOOLS OUString quoteName(const OUString& _rQuote, const OUString& _rName);
|
||||
OOO_DLLPUBLIC_DBTOOLS OUString quoteName(std::u16string_view _rQuote, const OUString& _rName);
|
||||
|
||||
/** quote the given table name (which may contain a catalog and a schema) according to the rules provided by the meta data
|
||||
*/
|
||||
|
||||
@@ -261,7 +261,7 @@ public:
|
||||
|
||||
/** Convert x-... privateuse, used by convertLocaleToLanguageImpl(Locale) */
|
||||
I18NLANGTAG_DLLPRIVATE static LanguageType convertPrivateUseToLanguage(
|
||||
const OUString& rPriv );
|
||||
std::u16string_view rPriv );
|
||||
|
||||
/** Used by LanguageTag::canonicalize() */
|
||||
I18NLANGTAG_DLLPRIVATE static css::lang::Locale getOverride(
|
||||
|
||||
@@ -30,6 +30,12 @@ inline bool equalsAscii(std::u16string_view s1, std::string_view s2)
|
||||
== 0;
|
||||
}
|
||||
|
||||
// Like OUString::compareToAscii, but for std::u16string_view and std::string_view:
|
||||
inline int compareToAscii(std::u16string_view s1, std::string_view s2)
|
||||
{
|
||||
return rtl_ustr_asciil_reverseCompare_WithLength(s1.data(), s1.size(), s2.data(), s2.size());
|
||||
};
|
||||
|
||||
// Like OUString::equalsIgnoreAsciiCase, but for two std::u16string_view:
|
||||
inline bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2)
|
||||
{
|
||||
@@ -41,6 +47,14 @@ inline bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2
|
||||
== 0;
|
||||
};
|
||||
|
||||
inline bool equalsIgnoreAsciiCase(std::u16string_view s1, std::string_view s2)
|
||||
{
|
||||
return s1.size() == s2.size()
|
||||
&& (rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength(s1.data(), s1.size(),
|
||||
s2.data(), s2.size())
|
||||
== 0);
|
||||
}
|
||||
|
||||
inline bool equalsIgnoreAsciiCase(std::string_view s1, std::string_view s2)
|
||||
{
|
||||
if (s1.size() != s2.size())
|
||||
@@ -66,6 +80,41 @@ inline bool matchIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2,
|
||||
== 0;
|
||||
}
|
||||
|
||||
// Like OUString::matchIgnoreAsciiCase, but for std::u16string_view and std::string_view:
|
||||
inline bool matchIgnoreAsciiCase(std::u16string_view s1, std::string_view s2,
|
||||
sal_Int32 fromIndex = 0)
|
||||
{
|
||||
return rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength(
|
||||
s1.data() + fromIndex, s1.size() - fromIndex, s2.data(), s2.size())
|
||||
== 0;
|
||||
}
|
||||
|
||||
// Like OUString::endsWithIgnoreAsciiCase, but for std::u16string_view
|
||||
inline bool endsWithIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2,
|
||||
std::u16string_view* rest = nullptr)
|
||||
{
|
||||
auto const b = s2.size() <= s1.size() && matchIgnoreAsciiCase(s1, s2, s1.size() - s2.size());
|
||||
if (b && rest != nullptr)
|
||||
{
|
||||
*rest = s1.substr(0, s1.size() - s2.size());
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
inline bool endsWithIgnoreAsciiCase(std::u16string_view s1, std::string_view s2,
|
||||
std::u16string_view* rest = nullptr)
|
||||
{
|
||||
auto const b = s2.size() <= s1.size()
|
||||
&& rtl_ustr_ascii_compareIgnoreAsciiCase_WithLengths(
|
||||
s1.data() + s1.size() - s2.size(), s2.size(), s2.data(), s2.size())
|
||||
== 0;
|
||||
if (b && rest != nullptr)
|
||||
{
|
||||
*rest = s1.substr(0, s1.size() - s2.size());
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
// Similar to O[U]String::getToken, returning the first token of a std::[u16]string_view starting
|
||||
// at a given position.
|
||||
//
|
||||
@@ -456,6 +505,7 @@ inline double toDouble(std::string_view str)
|
||||
{
|
||||
return rtl_math_stringToDouble(str.data(), str.data() + str.size(), '.', 0, nullptr, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
|
||||
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
private:
|
||||
void parseRelationship( const AttributeList& rAttribs );
|
||||
|
||||
OUString getFilterNameFromContentType( std::u16string_view rContentType, const OUString& rFileName );
|
||||
OUString getFilterNameFromContentType( std::u16string_view rContentType, std::u16string_view rFileName );
|
||||
void parseContentTypesDefault( const AttributeList& rAttribs );
|
||||
void parseContentTypesOverride( const AttributeList& rAttribs );
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ public:
|
||||
|
||||
// if the mimetype says graphic/bitmap/gdimetafile then get the
|
||||
// graphic from the Any. Return says no errors
|
||||
bool GetGraphicFromAny(const OUString& rMimeType,
|
||||
bool GetGraphicFromAny(std::u16string_view rMimeType,
|
||||
const css::uno::Any & rValue,
|
||||
Graphic& rGrf,
|
||||
weld::Window* pParentWin);
|
||||
|
||||
@@ -418,7 +418,7 @@ public:
|
||||
void SetUseThumbnailSave( bool _bNew );
|
||||
void SetLoadReadonly( bool _bReadonly );
|
||||
void SetSaveVersionOnClose( bool bSet );
|
||||
void ResetFromTemplate( const OUString& rTemplateName, const OUString& rFileName );
|
||||
void ResetFromTemplate( const OUString& rTemplateName, std::u16string_view rFileName );
|
||||
|
||||
// TODO/LATER: the following two methods should be replaced by Get/SetModifPasswordInfo in future
|
||||
sal_uInt32 GetModifyPasswordHash() const;
|
||||
|
||||
@@ -120,7 +120,7 @@ public:
|
||||
static bool GetFormatDataFlavor( SotClipboardFormatId nFormat, css::datatransfer::DataFlavor& rFlavor );
|
||||
static OUString GetFormatMimeType( SotClipboardFormatId nFormat );
|
||||
static bool IsInternal( const SvGlobalName& );
|
||||
static SotClipboardFormatId GetFormatIdFromMimeType( const OUString& rMimeType );
|
||||
static SotClipboardFormatId GetFormatIdFromMimeType( std::u16string_view rMimeType );
|
||||
|
||||
// same for XTransferable interface
|
||||
static sal_uInt8 GetExchangeAction(
|
||||
|
||||
@@ -48,7 +48,7 @@ private:
|
||||
css::uno::Reference< css::sheet::XSpreadsheetDocument> getDoc(const OUString&);
|
||||
static css::uno::Reference< css::sheet::XNamedRanges> getNamedRanges(css::uno::Reference< css::sheet::XSpreadsheetDocument > const &);
|
||||
void importSheetToCopy();
|
||||
static bool isExternalReference(const OUString& aDestContent, std::u16string_view aSrcContent );
|
||||
static bool isExternalReference(std::u16string_view aDestContent, std::u16string_view aSrcContent );
|
||||
|
||||
css::uno::Reference< css::sheet::XSpreadsheetDocument> xDestDoc;
|
||||
css::uno::Reference< css::sheet::XSpreadsheet > xDestSheet;
|
||||
|
||||
@@ -699,6 +699,37 @@ private:
|
||||
o3tl::getToken(suTokenStr, 0, ';', n);
|
||||
// should not GPF with negative index
|
||||
}
|
||||
{
|
||||
CPPUNIT_ASSERT_MESSAGE("compareToAscii",
|
||||
OUString(u"aaa").compareToAscii("aa")
|
||||
> 0); // just for comparison to following line
|
||||
CPPUNIT_ASSERT_MESSAGE("compareToAscii", o3tl::compareToAscii(u"aaa", "aa") > 0);
|
||||
|
||||
OUString aa(u"aa");
|
||||
CPPUNIT_ASSERT_MESSAGE("compareToAscii",
|
||||
aa.compareToAscii("aaa")
|
||||
< 0); // just for comparison to following line
|
||||
CPPUNIT_ASSERT_MESSAGE("compareToAscii", o3tl::compareToAscii(u"aa", "aaa") < 0);
|
||||
|
||||
CPPUNIT_ASSERT_MESSAGE(
|
||||
"equalsIgnoreAsciiCase",
|
||||
aa.equalsIgnoreAsciiCase("AA")); // just for comparison to following line
|
||||
CPPUNIT_ASSERT_MESSAGE("equalsIgnoreAsciiCase",
|
||||
o3tl::equalsIgnoreAsciiCase(u"aa", "AA"));
|
||||
|
||||
CPPUNIT_ASSERT_MESSAGE(
|
||||
"matchIgnoreAsciiCase",
|
||||
aa.matchIgnoreAsciiCase("a")); // just for comparison to following line
|
||||
CPPUNIT_ASSERT_MESSAGE("matchIgnoreAsciiCase", o3tl::matchIgnoreAsciiCase(u"aa", "a"));
|
||||
|
||||
CPPUNIT_ASSERT_MESSAGE(
|
||||
"endsWithIgnoreAsciiCase",
|
||||
aa.endsWithIgnoreAsciiCase("a")); // just for comparison to following line
|
||||
CPPUNIT_ASSERT_MESSAGE("endsWithIgnoreAsciiCase",
|
||||
o3tl::endsWithIgnoreAsciiCase(u"aa", "a"));
|
||||
CPPUNIT_ASSERT_MESSAGE("endsWithIgnoreAsciiCase",
|
||||
o3tl::endsWithIgnoreAsciiCase(u"aa", u"a"));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
|
||||
#include <com/sun/star/uri/UriReferenceFactory.hpp>
|
||||
#include <com/sun/star/beans/NamedValue.hpp>
|
||||
#include <o3tl/string_view.hxx>
|
||||
#include <utility>
|
||||
|
||||
using namespace ::com::sun::star;
|
||||
@@ -175,9 +176,9 @@ void FilterDetectDocHandler::parseRelationship( const AttributeList& rAttribs )
|
||||
}
|
||||
}
|
||||
|
||||
OUString FilterDetectDocHandler::getFilterNameFromContentType( std::u16string_view rContentType, const OUString& rFileName )
|
||||
OUString FilterDetectDocHandler::getFilterNameFromContentType( std::u16string_view rContentType, std::u16string_view rFileName )
|
||||
{
|
||||
bool bDocm = rFileName.endsWithIgnoreAsciiCase(".docm");
|
||||
bool bDocm = o3tl::endsWithIgnoreAsciiCase(rFileName, ".docm");
|
||||
|
||||
if( rContentType == u"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml" && !bDocm )
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
void SetServiceName( std::u16string_view rServiceName );
|
||||
|
||||
/** @return The help ID of the function with given built-in name or 0 if not found. */
|
||||
OUString GetHelpId( const OUString& rFuncName ) const;
|
||||
OUString GetHelpId( std::u16string_view rFuncName ) const;
|
||||
};
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <addinhelpid.hxx>
|
||||
#include <helpids.h>
|
||||
#include <o3tl/string_view.hxx>
|
||||
|
||||
// A struct containing the built-in function name and the built-in help ID.
|
||||
struct ScUnoAddInHelpId
|
||||
@@ -183,7 +184,7 @@ void ScUnoAddInHelpIdGenerator::SetServiceName( std::u16string_view rServiceName
|
||||
nArrayCount = nSize / sizeof( ScUnoAddInHelpId );
|
||||
}
|
||||
|
||||
OUString ScUnoAddInHelpIdGenerator::GetHelpId( const OUString& rFuncName ) const
|
||||
OUString ScUnoAddInHelpIdGenerator::GetHelpId( std::u16string_view rFuncName ) const
|
||||
{
|
||||
if( !pCurrHelpIds || !nArrayCount )
|
||||
return {};
|
||||
@@ -194,7 +195,7 @@ OUString ScUnoAddInHelpIdGenerator::GetHelpId( const OUString& rFuncName ) const
|
||||
while( pFirst <= pLast )
|
||||
{
|
||||
const ScUnoAddInHelpId* pMiddle = pFirst + (pLast - pFirst) / 2;
|
||||
sal_Int32 nResult = rFuncName.compareToAscii( pMiddle->pFuncName );
|
||||
sal_Int32 nResult = o3tl::compareToAscii( rFuncName, pMiddle->pFuncName );
|
||||
if( !nResult )
|
||||
return pMiddle->sHelpId;
|
||||
else if( nResult < 0 )
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include <comphelper/string.hxx>
|
||||
#include <o3tl/float_int_conversion.hxx>
|
||||
#include <o3tl/string_view.hxx>
|
||||
#include <sfx2/bindings.hxx>
|
||||
#include <sfx2/linkmgr.hxx>
|
||||
#include <sfx2/objsh.hxx>
|
||||
@@ -3218,7 +3219,7 @@ void ScInterpreter::ScHyperLink()
|
||||
http://ec.europa.eu/economy_finance/euro/adoption/conversion/
|
||||
http://ec.europa.eu/economy_finance/euro/countries/
|
||||
*/
|
||||
static bool lclConvertMoney( const OUString& aSearchUnit, double& rfRate, int& rnDec )
|
||||
static bool lclConvertMoney( std::u16string_view aSearchUnit, double& rfRate, int& rnDec )
|
||||
{
|
||||
struct ConvertInfo
|
||||
{
|
||||
@@ -3251,7 +3252,7 @@ static bool lclConvertMoney( const OUString& aSearchUnit, double& rfRate, int& r
|
||||
};
|
||||
|
||||
for (const auto & i : aConvertTable)
|
||||
if ( aSearchUnit.equalsIgnoreAsciiCaseAscii( i.pCurrText ) )
|
||||
if ( o3tl::equalsIgnoreAsciiCase( aSearchUnit, i.pCurrText ) )
|
||||
{
|
||||
rfRate = i.fRate;
|
||||
rnDec = i.nDec;
|
||||
|
||||
@@ -107,10 +107,10 @@ sal_Unicode lclGetBuiltinIdFromPrefixedName( std::u16string_view aModelName )
|
||||
}
|
||||
|
||||
/** returns the built-in name identifier from a built-in base name, e.g. 'Print_Area'. */
|
||||
sal_Unicode lclGetBuiltinIdFromBaseName( const OUString& rModelName )
|
||||
sal_Unicode lclGetBuiltinIdFromBaseName( std::u16string_view rModelName )
|
||||
{
|
||||
for( sal_Unicode cBuiltinId = 0; cBuiltinId < SAL_N_ELEMENTS( sppcBaseNames ); ++cBuiltinId )
|
||||
if( rModelName.equalsIgnoreAsciiCaseAscii( sppcBaseNames[ cBuiltinId ] ) )
|
||||
if( o3tl::equalsIgnoreAsciiCase( rModelName, sppcBaseNames[ cBuiltinId ] ) )
|
||||
return cBuiltinId;
|
||||
return BIFF_DEFNAME_UNKNOWN;
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ static void lcl_SaveSeparators(
|
||||
aItem.PutProperties(aNames, aValues);
|
||||
}
|
||||
|
||||
ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, const OUString& aDatName,
|
||||
ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, std::u16string_view aDatName,
|
||||
SvStream* pInStream, ScImportAsciiCall eCall)
|
||||
: GenericDialogController(pParent, "modules/scalc/ui/textimportcsv.ui", "TextImportCsvDialog")
|
||||
, mpDatStream(pInStream)
|
||||
@@ -353,7 +353,7 @@ ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, const OUString& aDatNa
|
||||
case SC_IMPORTFILE:
|
||||
if (!comphelper::LibreOfficeKit::isActive())
|
||||
{
|
||||
aName += " - [" + aDatName + "]";
|
||||
aName += OUString::Concat(" - [") + aDatName + "]";
|
||||
m_xDialog->set_title(aName);
|
||||
}
|
||||
break;
|
||||
@@ -362,7 +362,7 @@ ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, const OUString& aDatNa
|
||||
}
|
||||
|
||||
// To be able to prefill the correct values based on the file extension
|
||||
bool bIsTSV = (aDatName.endsWithIgnoreAsciiCase(".tsv") || aDatName.endsWithIgnoreAsciiCase(".tab"));
|
||||
bool bIsTSV = (o3tl::endsWithIgnoreAsciiCase(aDatName, ".tsv") || o3tl::endsWithIgnoreAsciiCase(aDatName, ".tab"));
|
||||
|
||||
// Default options are set in officecfg/registry/schema/org/openoffice/Office/Calc.xcs
|
||||
OUString sFieldSeparators(",;\t");
|
||||
|
||||
@@ -284,7 +284,7 @@ void ScImportExport::EndPaste(bool bAutoRowHeight)
|
||||
|
||||
}
|
||||
|
||||
bool ScImportExport::ExportData( const OUString& rMimeType,
|
||||
bool ScImportExport::ExportData( std::u16string_view rMimeType,
|
||||
css::uno::Any & rValue )
|
||||
{
|
||||
SvMemoryStream aStrm;
|
||||
|
||||
@@ -144,7 +144,7 @@ public:
|
||||
bool ImportStream( SvStream&, const OUString& rBaseURL, SotClipboardFormatId );
|
||||
bool ExportStream( SvStream&, const OUString& rBaseURL, SotClipboardFormatId );
|
||||
|
||||
bool ExportData( const OUString& rMimeType,
|
||||
bool ExportData( std::u16string_view rMimeType,
|
||||
css::uno::Any & rValue );
|
||||
|
||||
// after import
|
||||
|
||||
@@ -82,7 +82,7 @@ class ScImportAsciiDlg : public weld::GenericDialogController
|
||||
|
||||
public:
|
||||
ScImportAsciiDlg(
|
||||
weld::Window* pParent, const OUString& aDatName,
|
||||
weld::Window* pParent, std::u16string_view aDatName,
|
||||
SvStream* pInStream, ScImportAsciiCall eCall );
|
||||
virtual ~ScImportAsciiDlg() override;
|
||||
|
||||
|
||||
@@ -1515,7 +1515,7 @@ void AnimationExporter::exportAnimateSet( SvStream& rStrm, const Reference< XAni
|
||||
exportAnimateTarget( rStrm, xNode, 0, nAfterEffectType );
|
||||
}
|
||||
|
||||
sal_uInt32 AnimationExporter::GetValueTypeForAttributeName( const OUString& rAttributeName )
|
||||
sal_uInt32 AnimationExporter::GetValueTypeForAttributeName( std::u16string_view rAttributeName )
|
||||
{
|
||||
sal_uInt32 nValueType = 0;
|
||||
|
||||
@@ -1555,7 +1555,7 @@ sal_uInt32 AnimationExporter::GetValueTypeForAttributeName( const OUString& rAtt
|
||||
const Entry* pPtr = &lcl_attributeMap[ 0 ];
|
||||
while( pPtr->pName )
|
||||
{
|
||||
if ( rAttributeName.equalsIgnoreAsciiCaseAscii( pPtr->pName ) )
|
||||
if ( o3tl::equalsIgnoreAsciiCase( rAttributeName, pPtr->pName ) )
|
||||
{
|
||||
nValueType = pPtr->nType;
|
||||
break;
|
||||
|
||||
@@ -125,7 +125,7 @@ public:
|
||||
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, std::u16string_view rPresetSubType );
|
||||
static sal_uInt32 GetPresetID( std::u16string_view aPreset, sal_uInt32 nAPIPresetClass, bool& bPresetId );
|
||||
static sal_uInt32 GetValueTypeForAttributeName( const OUString& rAttributeName );
|
||||
static sal_uInt32 GetValueTypeForAttributeName( std::u16string_view rAttributeName );
|
||||
|
||||
static const char* FindTransitionName( const sal_Int16 nType, const sal_Int16 nSubType, const bool bDirection );
|
||||
static css::uno::Reference< css::drawing::XShape > getTargetElementShape( const css::uno::Any& rAny, sal_Int32& rBegin, sal_Int32& rEnd, bool& rParagraphTarget );
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include <com/sun/star/beans/XPropertySet.hpp>
|
||||
|
||||
#include <o3tl/any.hxx>
|
||||
#include <o3tl/string_view.hxx>
|
||||
|
||||
using ::com::sun::star::beans::NamedValue;
|
||||
using ::com::sun::star::beans::XPropertySet;
|
||||
using ::com::sun::star::drawing::XShape;
|
||||
@@ -49,13 +51,14 @@ bool isValidTarget(const Any& rTarget)
|
||||
return (rTarget >>= aParagraphTarget) && aParagraphTarget.Shape.is();
|
||||
}
|
||||
|
||||
bool IsAudioURL(const OUString& rURL)
|
||||
bool IsAudioURL(std::u16string_view rURL)
|
||||
{
|
||||
return rURL.endsWithIgnoreAsciiCase(".wav") || rURL.endsWithIgnoreAsciiCase(".m4a");
|
||||
return o3tl::endsWithIgnoreAsciiCase(rURL, ".wav")
|
||||
|| o3tl::endsWithIgnoreAsciiCase(rURL, ".m4a");
|
||||
}
|
||||
|
||||
/// Returns if rURL has an extension which is a video format.
|
||||
bool IsVideoURL(const OUString& rURL) { return rURL.endsWithIgnoreAsciiCase(".mp4"); }
|
||||
bool IsVideoURL(std::u16string_view rURL) { return o3tl::endsWithIgnoreAsciiCase(rURL, ".mp4"); }
|
||||
|
||||
bool initCondList(const Any& rAny, std::vector<Cond>& rList, bool bIsMainSeqChild)
|
||||
{
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
|
||||
#include <o3tl/any.hxx>
|
||||
#include <o3tl/string_view.hxx>
|
||||
#include <oox/token/tokens.hxx>
|
||||
#include "epptooxml.hxx"
|
||||
#include <sax/fshelper.hxx>
|
||||
@@ -508,13 +509,14 @@ public:
|
||||
};
|
||||
|
||||
/// Returns if rURL has an extension which is an audio format.
|
||||
bool IsAudioURL(const OUString& rURL)
|
||||
bool IsAudioURL(std::u16string_view rURL)
|
||||
{
|
||||
return rURL.endsWithIgnoreAsciiCase(".wav") || rURL.endsWithIgnoreAsciiCase(".m4a");
|
||||
return o3tl::endsWithIgnoreAsciiCase(rURL, ".wav")
|
||||
|| o3tl::endsWithIgnoreAsciiCase(rURL, ".m4a");
|
||||
}
|
||||
|
||||
/// Returns if rURL has an extension which is a video format.
|
||||
bool IsVideoURL(const OUString& rURL) { return rURL.endsWithIgnoreAsciiCase(".mp4"); }
|
||||
bool IsVideoURL(std::u16string_view rURL) { return o3tl::endsWithIgnoreAsciiCase(rURL, ".mp4"); }
|
||||
}
|
||||
|
||||
namespace oox::core
|
||||
|
||||
@@ -101,7 +101,7 @@ using namespace ::com::sun::star::container;
|
||||
using namespace ::cppu;
|
||||
using namespace ::sfx2;
|
||||
|
||||
void SetTemplate_Impl( const OUString &rFileName,
|
||||
void SetTemplate_Impl( std::u16string_view rFileName,
|
||||
const OUString &rLongName,
|
||||
SfxObjectShell *pDoc)
|
||||
{
|
||||
|
||||
@@ -506,7 +506,7 @@ SotClipboardFormatId LinkManager::RegisterStatusInfoId()
|
||||
return nFormat;
|
||||
}
|
||||
|
||||
bool LinkManager::GetGraphicFromAny(const OUString& rMimeType,
|
||||
bool LinkManager::GetGraphicFromAny(std::u16string_view rMimeType,
|
||||
const css::uno::Any & rValue,
|
||||
Graphic& rGraphic,
|
||||
weld::Window* pParentWin)
|
||||
|
||||
@@ -271,7 +271,7 @@ private:
|
||||
Content& aNewFolder );
|
||||
static OUString CreateNewUniqueFileWithPrefix( std::u16string_view aPath,
|
||||
const OUString& aPrefix,
|
||||
const OUString& aExt );
|
||||
std::u16string_view aExt );
|
||||
|
||||
std::vector< beans::StringPair > ReadUINamesForTemplateDir_Impl( std::u16string_view aUserPath );
|
||||
bool UpdateUINamesForTemplateDir_Impl( std::u16string_view aUserPath,
|
||||
@@ -841,7 +841,7 @@ bool SfxDocTplService::CreateNewUniqueFolderWithPrefix( std::u16string_view aPat
|
||||
|
||||
OUString SfxDocTplService::CreateNewUniqueFileWithPrefix( std::u16string_view aPath,
|
||||
const OUString& aPrefix,
|
||||
const OUString& aExt )
|
||||
std::u16string_view aExt )
|
||||
{
|
||||
OUString aNewFileURL;
|
||||
INetURLObject aDirPath( aPath );
|
||||
@@ -858,7 +858,7 @@ OUString SfxDocTplService::CreateNewUniqueFileWithPrefix( std::u16string_view aP
|
||||
OUString aTryName = aPrefix;
|
||||
if ( nInd )
|
||||
aTryName += OUString::number( nInd );
|
||||
if ( aExt.toChar() != '.' )
|
||||
if ( aExt.empty() || aExt[0] != '.' )
|
||||
aTryName += ".";
|
||||
aTryName += aExt;
|
||||
|
||||
|
||||
@@ -569,7 +569,7 @@ bool SfxObjectShell::IsHelpDocument() const
|
||||
return (pFilter && pFilter->GetFilterName() == "writer_web_HTML_help");
|
||||
}
|
||||
|
||||
void SfxObjectShell::ResetFromTemplate( const OUString& rTemplateName, const OUString& rFileName )
|
||||
void SfxObjectShell::ResetFromTemplate( const OUString& rTemplateName, std::u16string_view rFileName )
|
||||
{
|
||||
// only care about resetting this data for LibreOffice formats otherwise
|
||||
if ( !IsOwnStorageFormat( *GetMedium()) )
|
||||
|
||||
@@ -29,7 +29,7 @@ class SfxObjectShell;
|
||||
|
||||
ErrCode CheckPasswd_Impl(SfxObjectShell* pDoc, SfxMedium* pFile);
|
||||
|
||||
void SetTemplate_Impl(const OUString&, const OUString&, SfxObjectShell*);
|
||||
void SetTemplate_Impl(std::u16string_view, const OUString&, SfxObjectShell*);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -381,18 +381,18 @@ OUString SotExchange::GetFormatMimeType( SotClipboardFormatId nFormat )
|
||||
|*
|
||||
*************************************************************************/
|
||||
|
||||
SotClipboardFormatId SotExchange::GetFormatIdFromMimeType( const OUString& rMimeType )
|
||||
SotClipboardFormatId SotExchange::GetFormatIdFromMimeType( std::u16string_view rMimeType )
|
||||
{
|
||||
const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl();
|
||||
for( SotClipboardFormatId i = SotClipboardFormatId::STRING; i <= SotClipboardFormatId::FILE_LIST; ++i )
|
||||
if( rMimeType.equals( pFormatArray_Impl[ static_cast<int>(i) ].pMimeType ) )
|
||||
if( rMimeType == pFormatArray_Impl[ static_cast<int>(i) ].pMimeType )
|
||||
return i;
|
||||
|
||||
// BM: the chart format 105 ("StarChartDocument 5.0") was written
|
||||
// only into 5.1 chart documents - in 5.0 and 5.2 it was 42 ("StarChart 5.0")
|
||||
// The registry only contains the entry for the 42 format id.
|
||||
for( SotClipboardFormatId i = SotClipboardFormatId::RTF; i <= SotClipboardFormatId::USER_END; ++i )
|
||||
if( rMimeType.equals( pFormatArray_Impl[ static_cast<int>(i) ].pMimeType ) )
|
||||
if( rMimeType == pFormatArray_Impl[ static_cast<int>(i) ].pMimeType )
|
||||
return ( (i == SotClipboardFormatId::STARCHARTDOCUMENT_50)
|
||||
? SotClipboardFormatId::STARCHART_50
|
||||
: i );
|
||||
|
||||
@@ -613,11 +613,11 @@ const SvxShapeControlPropertyMapping[] =
|
||||
|
||||
namespace
|
||||
{
|
||||
bool lcl_convertPropertyName( const OUString& rApiName, OUString& rInternalName )
|
||||
bool lcl_convertPropertyName( std::u16string_view rApiName, OUString& rInternalName )
|
||||
{
|
||||
for( const auto & rEntry : SvxShapeControlPropertyMapping )
|
||||
{
|
||||
if( rApiName.reverseCompareTo( rEntry.msAPIName ) == 0 )
|
||||
if( rApiName == rEntry.msAPIName )
|
||||
{
|
||||
rInternalName = rEntry.msFormName;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ class SwApplet_Impl
|
||||
OUString m_sAlt;
|
||||
|
||||
public:
|
||||
static SwHtmlOptType GetOptionType( const OUString& rName, bool bApplet );
|
||||
static SwHtmlOptType GetOptionType( std::u16string_view rName, bool bApplet );
|
||||
SwApplet_Impl( SfxItemPool& rPool );
|
||||
SwApplet_Impl( SfxItemSet aSet ): m_aItemSet (std::move(aSet)) {}
|
||||
~SwApplet_Impl();
|
||||
|
||||
@@ -490,14 +490,14 @@ const CharSetNameMap *GetCharSetNameMap()
|
||||
/*
|
||||
Get a rtl_TextEncoding from its name
|
||||
*/
|
||||
rtl_TextEncoding CharSetFromName(const OUString& rChrSetStr)
|
||||
rtl_TextEncoding CharSetFromName(std::u16string_view rChrSetStr)
|
||||
{
|
||||
const CharSetNameMap *pStart = GetCharSetNameMap();
|
||||
rtl_TextEncoding nRet = pStart->eCode;
|
||||
|
||||
for(const CharSetNameMap *pMap = pStart; pMap->pName; ++pMap)
|
||||
{
|
||||
if(rChrSetStr.equalsIgnoreAsciiCaseAscii(pMap->pName))
|
||||
if(o3tl::equalsIgnoreAsciiCase(rChrSetStr, pMap->pName))
|
||||
{
|
||||
nRet = pMap->eCode;
|
||||
break;
|
||||
@@ -549,7 +549,7 @@ void SwAsciiOptions::ReadUserData( std::u16string_view rStr )
|
||||
sal_Int32 nToken = 0;
|
||||
std::u16string_view sToken = o3tl::getToken(rStr, 0, ',', nToken); // 1. Charset name
|
||||
if (!sToken.empty())
|
||||
m_eCharSet = CharSetFromName(OUString(sToken));
|
||||
m_eCharSet = CharSetFromName(sToken);
|
||||
if (nToken >= 0 && !(sToken = o3tl::getToken(rStr, 0, ',', nToken)).empty()) // 2. Line ending type
|
||||
{
|
||||
if (o3tl::equalsIgnoreAsciiCase(sToken, u"CRLF"))
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <comphelper/embeddedobjectcontainer.hxx>
|
||||
#include <comphelper/classids.hxx>
|
||||
#include <com/sun/star/uno/Any.hxx>
|
||||
#include <o3tl/string_view.hxx>
|
||||
#include <svtools/embedhlp.hxx>
|
||||
#include <tools/globname.hxx>
|
||||
#include <tools/urlobj.hxx>
|
||||
@@ -33,75 +34,75 @@
|
||||
|
||||
using namespace com::sun::star;
|
||||
|
||||
SwHtmlOptType SwApplet_Impl::GetOptionType( const OUString& rName, bool bApplet )
|
||||
SwHtmlOptType SwApplet_Impl::GetOptionType( std::u16string_view rName, bool bApplet )
|
||||
{
|
||||
SwHtmlOptType nType = bApplet ? SwHtmlOptType::PARAM : SwHtmlOptType::TAG;
|
||||
|
||||
switch( rName.toChar() )
|
||||
switch( rName[0] )
|
||||
{
|
||||
case 'A':
|
||||
case 'a':
|
||||
if( rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_align ) ||
|
||||
rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_alt ) )
|
||||
if( o3tl::equalsIgnoreAsciiCase( rName, OOO_STRING_SVTOOLS_HTML_O_align ) ||
|
||||
o3tl::equalsIgnoreAsciiCase( rName, OOO_STRING_SVTOOLS_HTML_O_alt ) )
|
||||
nType = SwHtmlOptType::IGNORE;
|
||||
else if( bApplet &&
|
||||
(rName == "ARCHIVE" || rName == "ARCHIVES" ) )
|
||||
(rName == u"ARCHIVE" || rName == u"ARCHIVES" ) )
|
||||
nType = SwHtmlOptType::TAG;
|
||||
break;
|
||||
case 'C':
|
||||
case 'c':
|
||||
if( rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_class ) ||
|
||||
(bApplet && (rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_code ) ||
|
||||
rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_codebase ))) )
|
||||
if( o3tl::equalsIgnoreAsciiCase( rName, OOO_STRING_SVTOOLS_HTML_O_class ) ||
|
||||
(bApplet && (o3tl::equalsIgnoreAsciiCase( rName, OOO_STRING_SVTOOLS_HTML_O_code ) ||
|
||||
o3tl::equalsIgnoreAsciiCase( rName, OOO_STRING_SVTOOLS_HTML_O_codebase ))) )
|
||||
nType = SwHtmlOptType::IGNORE;
|
||||
break;
|
||||
case 'H':
|
||||
case 'h':
|
||||
if( rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_height ) )
|
||||
if( o3tl::equalsIgnoreAsciiCase( rName, OOO_STRING_SVTOOLS_HTML_O_height ) )
|
||||
nType = SwHtmlOptType::SIZE;
|
||||
else if( rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_hspace ) ||
|
||||
(!bApplet && rName.equalsIgnoreAsciiCase( OOO_STRING_SW_HTML_O_Hidden )) )
|
||||
else if( o3tl::equalsIgnoreAsciiCase( rName, OOO_STRING_SVTOOLS_HTML_O_hspace ) ||
|
||||
(!bApplet && o3tl::equalsIgnoreAsciiCase( rName, OOO_STRING_SW_HTML_O_Hidden )) )
|
||||
nType = SwHtmlOptType::IGNORE;
|
||||
break;
|
||||
case 'I':
|
||||
case 'i':
|
||||
if( rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_id ) )
|
||||
if( o3tl::equalsIgnoreAsciiCase( rName, OOO_STRING_SVTOOLS_HTML_O_id ) )
|
||||
nType = SwHtmlOptType::IGNORE;
|
||||
break;
|
||||
case 'M':
|
||||
case 'm':
|
||||
if( bApplet && rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_mayscript ) )
|
||||
if( bApplet && o3tl::equalsIgnoreAsciiCase( rName, OOO_STRING_SVTOOLS_HTML_O_mayscript ) )
|
||||
nType = SwHtmlOptType::IGNORE;
|
||||
break;
|
||||
case 'N':
|
||||
case 'n':
|
||||
if( rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_name ) )
|
||||
if( o3tl::equalsIgnoreAsciiCase( rName, OOO_STRING_SVTOOLS_HTML_O_name ) )
|
||||
nType = SwHtmlOptType::IGNORE;
|
||||
break;
|
||||
case 'O':
|
||||
case 'o':
|
||||
if( bApplet && rName == "OBJECT" )
|
||||
if( bApplet && rName == u"OBJECT" )
|
||||
nType = SwHtmlOptType::TAG;
|
||||
break;
|
||||
case 'S':
|
||||
case 's':
|
||||
if( rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_style ) ||
|
||||
(!bApplet && rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_src )) )
|
||||
if( o3tl::equalsIgnoreAsciiCase( rName, OOO_STRING_SVTOOLS_HTML_O_style ) ||
|
||||
(!bApplet && o3tl::equalsIgnoreAsciiCase( rName, OOO_STRING_SVTOOLS_HTML_O_src )) )
|
||||
nType = SwHtmlOptType::IGNORE;
|
||||
break;
|
||||
case 'T':
|
||||
case 't':
|
||||
if( !bApplet && rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_type ) )
|
||||
if( !bApplet && o3tl::equalsIgnoreAsciiCase( rName, OOO_STRING_SVTOOLS_HTML_O_type ) )
|
||||
nType = SwHtmlOptType::IGNORE;
|
||||
break;
|
||||
case 'V':
|
||||
case 'v':
|
||||
if( rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_vspace ) )
|
||||
if( o3tl::equalsIgnoreAsciiCase( rName, OOO_STRING_SVTOOLS_HTML_O_vspace ) )
|
||||
nType = SwHtmlOptType::IGNORE;
|
||||
break;
|
||||
case 'W':
|
||||
case 'w':
|
||||
if( rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_width ) )
|
||||
if( o3tl::equalsIgnoreAsciiCase( rName, OOO_STRING_SVTOOLS_HTML_O_width ) )
|
||||
nType = SwHtmlOptType::SIZE;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
|
||||
#include <com/sun/star/document/XDocumentProperties.hpp>
|
||||
#include <com/sun/star/frame/XModel.hpp>
|
||||
#include <o3tl/string_view.hxx>
|
||||
#include <osl/diagnose.h>
|
||||
#include <docsh.hxx>
|
||||
#include <IDocumentFieldsAccess.hxx>
|
||||
@@ -196,12 +197,12 @@ HTMLOptionEnum<SwFileNameFormat> const aHTMLFileNameFieldFormatTable[] =
|
||||
{ nullptr, SwFileNameFormat(0) }
|
||||
};
|
||||
|
||||
SvxNumType SwHTMLParser::GetNumType( const OUString& rStr, SvxNumType nDfltType )
|
||||
SvxNumType SwHTMLParser::GetNumType( std::u16string_view rStr, SvxNumType nDfltType )
|
||||
{
|
||||
const HTMLOptionEnum<SvxNumType> *pOptEnums = aHTMLPageNumFieldFormatTable;
|
||||
while( pOptEnums->pName )
|
||||
{
|
||||
if( rStr.equalsIgnoreAsciiCaseAscii( pOptEnums->pName ) )
|
||||
if( o3tl::equalsIgnoreAsciiCase( rStr, pOptEnums->pName ) )
|
||||
return pOptEnums->nValue;
|
||||
pOptEnums++;
|
||||
}
|
||||
|
||||
@@ -333,7 +333,7 @@ void SwHTMLParser::SetSpace( const Size& rPixSpace,
|
||||
}
|
||||
}
|
||||
|
||||
OUString SwHTMLParser::StripQueryFromPath(const OUString& rBase, const OUString& rPath)
|
||||
OUString SwHTMLParser::StripQueryFromPath(std::u16string_view rBase, const OUString& rPath)
|
||||
{
|
||||
if (!comphelper::isFileUrl(rBase))
|
||||
return rPath;
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
#include <vcl/svapp.hxx>
|
||||
#include <sal/log.hxx>
|
||||
#include <osl/diagnose.h>
|
||||
#include <o3tl/string_view.hxx>
|
||||
|
||||
#include <hintids.hxx>
|
||||
|
||||
@@ -866,11 +867,11 @@ void SvxCSS1Parser::ParseStyleOption( const OUString& rIn,
|
||||
}
|
||||
|
||||
bool SvxCSS1Parser::GetEnum( const CSS1PropertyEnum *pPropTable,
|
||||
const OUString &rValue, sal_uInt16& rEnum )
|
||||
std::u16string_view rValue, sal_uInt16& rEnum )
|
||||
{
|
||||
while( pPropTable->pName )
|
||||
{
|
||||
if( !rValue.equalsIgnoreAsciiCaseAscii( pPropTable->pName ) )
|
||||
if( !o3tl::equalsIgnoreAsciiCase( rValue, pPropTable->pName ) )
|
||||
pPropTable++;
|
||||
else
|
||||
break;
|
||||
|
||||
@@ -258,7 +258,7 @@ public:
|
||||
|
||||
// convert a string to enum value
|
||||
static bool GetEnum( const CSS1PropertyEnum *pPropTable,
|
||||
const OUString& rValue, sal_uInt16 &rEnum );
|
||||
std::u16string_view rValue, sal_uInt16 &rEnum );
|
||||
|
||||
static void PixelToTwip( tools::Long &nWidth, tools::Long &nHeight );
|
||||
|
||||
|
||||
@@ -667,7 +667,7 @@ class SwHTMLParser : public SfxHTMLParser, public SvtListener
|
||||
|
||||
// <SDFIELD>
|
||||
public:
|
||||
static SvxNumType GetNumType( const OUString& rStr, SvxNumType eDfltType );
|
||||
static SvxNumType GetNumType( std::u16string_view rStr, SvxNumType eDfltType );
|
||||
private:
|
||||
void NewField();
|
||||
void EndField();
|
||||
@@ -953,7 +953,7 @@ public:
|
||||
void NotifyMacroEventRead();
|
||||
|
||||
/// Strips query and fragment from a URL path if base URL is a file:// one.
|
||||
static OUString StripQueryFromPath(const OUString& rBase, const OUString& rPath);
|
||||
static OUString StripQueryFromPath(std::u16string_view rBase, const OUString& rPath);
|
||||
};
|
||||
|
||||
struct SwPendingData
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
#include <rtl/ustring.hxx>
|
||||
#include <cppunit/TestAssert.h>
|
||||
#include <o3tl/string_view.hxx>
|
||||
|
||||
using namespace css;
|
||||
using namespace css::uno;
|
||||
@@ -350,12 +351,14 @@ void XSpreadsheets2::importSheetToCopy()
|
||||
xDestSheet.set( xDestSheetIndexAccess->getByIndex(nDestPosEffective), UNO_QUERY_THROW);
|
||||
}
|
||||
|
||||
bool XSpreadsheets2::isExternalReference(const OUString& aDestContent, std::u16string_view aSrcContent )
|
||||
bool XSpreadsheets2::isExternalReference(std::u16string_view aDestContent, std::u16string_view aSrcContent )
|
||||
{
|
||||
CPPUNIT_ASSERT(aDestContent.startsWith("'file://"));
|
||||
CPPUNIT_ASSERT(o3tl::starts_with(aDestContent, u"'file://"));
|
||||
|
||||
return (aDestContent.endsWithIgnoreAsciiCase(aSrcContent) // same cell address
|
||||
&& aDestContent.indexOf(gaSrcFileName)>0); // contains source file name
|
||||
if (!o3tl::endsWithIgnoreAsciiCase(aDestContent, aSrcContent)) // same cell address
|
||||
return false;
|
||||
size_t nPos = aDestContent.find(gaSrcFileName);
|
||||
return nPos != std::u16string_view::npos && nPos > 0; // contains source file name
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "DateTimeHelper.hxx"
|
||||
#include "webdavprovider.hxx"
|
||||
#include "ContentProperties.hxx"
|
||||
#include <o3tl/string_view.hxx>
|
||||
|
||||
using namespace com::sun::star;
|
||||
using namespace http_dav_ucp;
|
||||
@@ -490,8 +491,7 @@ void ContentProperties::addProperty( const OUString & rName,
|
||||
|
||||
namespace
|
||||
{
|
||||
bool isCachable( OUString const & rName,
|
||||
bool isCaseSensitive )
|
||||
bool isCachable( std::u16string_view rName, bool isCaseSensitive )
|
||||
{
|
||||
const OUString aNonCachableProps [] =
|
||||
{
|
||||
@@ -518,11 +518,11 @@ namespace
|
||||
{
|
||||
if ( isCaseSensitive )
|
||||
{
|
||||
if ( rName.equals( aNonCachableProps[ n ] ) )
|
||||
if ( rName == aNonCachableProps[ n ] )
|
||||
return false;
|
||||
}
|
||||
else
|
||||
if ( rName.equalsIgnoreAsciiCase( aNonCachableProps[ n ] ) )
|
||||
if ( o3tl::equalsIgnoreAsciiCase( rName, aNonCachableProps[ n ] ) )
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -19,6 +19,6 @@
|
||||
|
||||
#include <rtl/ustring.hxx>
|
||||
|
||||
OUString GetParaStyleCondExternal(OUString const&);
|
||||
OUString GetParaStyleCondExternal(std::u16string_view);
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
||||
@@ -68,11 +68,11 @@ const ConditionMap g_ConditionMap[] =
|
||||
{ "NumberingLevel10", XML_LIST_LEVEL, 10 }
|
||||
};
|
||||
|
||||
OUString GetParaStyleCondExternal( OUString const &internal)
|
||||
OUString GetParaStyleCondExternal( std::u16string_view internal)
|
||||
{
|
||||
for (size_t i = 0; i < SAL_N_ELEMENTS(g_ConditionMap); ++i)
|
||||
{
|
||||
if (internal.compareToAscii( g_ConditionMap[i].aInternal ) == 0)
|
||||
if (o3tl::equalsAscii(internal, g_ConditionMap[i].aInternal ))
|
||||
{
|
||||
OUString aResult = GetXMLToken( g_ConditionMap[i].nExternal ) +
|
||||
"()";
|
||||
|
||||
@@ -454,11 +454,11 @@ void SAL_CALL XMLTransformerBase::initialize( const Sequence< Any >& aArguments
|
||||
assert(m_xHandler.is()); // can't do anything without that
|
||||
}
|
||||
|
||||
static sal_Int16 lcl_getUnit( const OUString& rValue )
|
||||
static sal_Int16 lcl_getUnit( std::u16string_view rValue )
|
||||
{
|
||||
if( rValue.endsWithIgnoreAsciiCase( "cm" ) )
|
||||
if( o3tl::endsWithIgnoreAsciiCase( rValue, "cm" ) )
|
||||
return util::MeasureUnit::CM;
|
||||
else if ( rValue.endsWithIgnoreAsciiCase( "mm" ) )
|
||||
else if ( o3tl::endsWithIgnoreAsciiCase( rValue, "mm" ) )
|
||||
return util::MeasureUnit::MM;
|
||||
else
|
||||
return util::MeasureUnit::INCH;
|
||||
|
||||
Reference in New Issue
Block a user