include/oox/dump/dumperbase.hxx | 10 +++++----- l10ntools/source/xmlparse.cxx | 4 ++-- lotuswordpro/source/filter/lwpfootnote.hxx | 12 ++++++------ oox/source/core/xmlfilterbase.cxx | 5 ++--- winaccessibility/source/UAccCOM/AccTextBase.cxx | 12 ++++++------ 5 files changed, 21 insertions(+), 22 deletions(-)
New commits: commit a916adba23e81c8c661369d2c06fbe9c6714d9c2 Author: Noel Grandin <[email protected]> AuthorDate: Thu Nov 25 14:53:21 2021 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Fri Nov 26 09:45:44 2021 +0100 loplugin:stringliteraldefine in l10ntools..oox Change-Id: Ia19d247f3cf439405c05a53c4cf2c9d0e7344560 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125811 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/include/oox/dump/dumperbase.hxx b/include/oox/dump/dumperbase.hxx index 53a35775ce9d..6d8435e94a1e 100644 --- a/include/oox/dump/dumperbase.hxx +++ b/include/oox/dump/dumperbase.hxx @@ -61,13 +61,13 @@ namespace oox::core { namespace oox::dump { -#define OOX_DUMP_UNUSED "unused" -#define OOX_DUMP_UNKNOWN "?unknown" +inline constexpr OUStringLiteral OOX_DUMP_UNUSED = u"unused"; +inline constexpr OUStringLiteral OOX_DUMP_UNKNOWN = u"?unknown"; #define OOX_DUMP_ERRASCII( ascii ) "?err:" ascii #define OOX_DUMP_ERR_NOMAP "no-map" -#define OOX_DUMP_ERR_NONAME "no-name" +inline constexpr OUStringLiteral OOX_DUMP_ERR_NONAME = u"no-name"; #define OOX_DUMP_ERR_STREAM "stream-error" #define OOX_DUMP_DUMPEXT ".dump" @@ -1393,8 +1393,8 @@ protected: void dumpRemainingStream(); void dumpArray( const String& rName, sal_Int32 nBytes, sal_Unicode cSep = OOX_DUMP_LISTSEP ); - void dumpUnused( sal_Int32 nBytes ) { dumpArray( OOX_DUMP_UNUSED, nBytes ); } - void dumpUnknown( sal_Int32 nBytes ) { dumpArray( OOX_DUMP_UNKNOWN, nBytes ); } + void dumpUnused( sal_Int32 nBytes ) { dumpArray( OUString(OOX_DUMP_UNUSED), nBytes ); } + void dumpUnknown( sal_Int32 nBytes ) { dumpArray( OUString(OOX_DUMP_UNKNOWN), nBytes ); } sal_Unicode dumpUnicode( const String& rName ); diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx index bb37352f71dc..d533d8db07ba 100644 --- a/l10ntools/source/xmlparse.cxx +++ b/l10ntools/source/xmlparse.cxx @@ -251,7 +251,7 @@ void XMLFile::Print( XMLNode *pCur, sal_uInt16 nLevel ) for (size_t j = 0; j < pElement->GetAttributeList()->size(); ++j) { const OString aAttrName((*pElement->GetAttributeList())[j]->GetName()); - if (!aAttrName.equalsIgnoreAsciiCase(XML_LANG)) + if (aAttrName != XML_LANG) { fprintf( stdout, " %s=\"%s\"", aAttrName.getStr(), @@ -671,7 +671,7 @@ void XMLElement::Print(XMLNode *pCur, OStringBuffer& rBuffer, bool bRootelement for ( size_t j = 0; j < pElement->GetAttributeList()->size(); j++ ) { const OString aAttrName( (*pElement->GetAttributeList())[ j ]->GetName() ); - if (!aAttrName.equalsIgnoreAsciiCase(XML_LANG)) + if (aAttrName != XML_LANG) { rBuffer.append( " " + aAttrName + "=\"" + diff --git a/lotuswordpro/source/filter/lwpfootnote.hxx b/lotuswordpro/source/filter/lwpfootnote.hxx index 5163204e39ea..b1743df94d41 100644 --- a/lotuswordpro/source/filter/lwpfootnote.hxx +++ b/lotuswordpro/source/filter/lwpfootnote.hxx @@ -87,13 +87,13 @@ #define FN_DIVISIONGROUP_SEPARATE (FN_BASE_DIVISIONGROUP | FN_MASK_SEPARATE) #define FN_DOCUMENT (FN_BASE_DOCUMENT) #define FN_DOCUMENT_SEPARATE (FN_BASE_DOCUMENT | FN_MASK_SEPARATE) -#define STRID_FOOTCONTINUEDFROM "Continued from previous page..." -#define STRID_FOOTCONTINUEDON "Continued on next page..." +inline constexpr OUStringLiteral STRID_FOOTCONTINUEDFROM = u"Continued from previous page..."; +inline constexpr OUStringLiteral STRID_FOOTCONTINUEDON = u"Continued on next page..."; //Footnote table types, the string may have to do with local language -#define STR_DivisionFootnote "DivisionFootnote" -#define STR_DivisionEndnote "DivisionEndnote" -#define STR_DivisionGroupEndnote "DivisionGroupEndnote" -#define STR_DocumentEndnote "DocumentEndnote" +inline constexpr OUStringLiteral STR_DivisionFootnote = u"DivisionFootnote"; +inline constexpr OUStringLiteral STR_DivisionEndnote = u"DivisionEndnote"; +inline constexpr OUStringLiteral STR_DivisionGroupEndnote = u"DivisionGroupEndnote"; +inline constexpr OUStringLiteral STR_DocumentEndnote = u"DocumentEndnote"; /** * @brief Footnote frib object diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index daea0ad49962..9625f0f509ba 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -1130,8 +1130,7 @@ void XmlFilterBase::exportCustomFragments() uno::Reference<beans::XPropertySet> xPropSet(xModel, uno::UNO_QUERY_THROW); uno::Reference<beans::XPropertySetInfo> xPropSetInfo = xPropSet->getPropertySetInfo(); - static constexpr OUStringLiteral aName = u"" UNO_NAME_MISC_OBJ_INTEROPGRABBAG; - if (!xPropSetInfo->hasPropertyByName(aName)) + if (!xPropSetInfo->hasPropertyByName(UNO_NAME_MISC_OBJ_INTEROPGRABBAG)) return; uno::Sequence<uno::Reference<xml::dom::XDocument>> customXmlDomlist; @@ -1142,7 +1141,7 @@ void XmlFilterBase::exportCustomFragments() uno::Sequence<uno::Sequence<beans::StringPair>> aContentTypes; uno::Sequence<beans::PropertyValue> propList; - xPropSet->getPropertyValue(aName) >>= propList; + xPropSet->getPropertyValue(UNO_NAME_MISC_OBJ_INTEROPGRABBAG) >>= propList; for (const auto& rProp : std::as_const(propList)) { const OUString propName = rProp.Name; commit 6dfcabf54a86f7204b4924718a930be5d13b1eeb Author: Stephan Bergmann <[email protected]> AuthorDate: Fri Nov 26 08:19:33 2021 +0100 Commit: Stephan Bergmann <[email protected]> CommitDate: Fri Nov 26 09:45:34 2021 +0100 loplugin:stringviewparam Change-Id: I8a4c310e3a963362bff390e93ca39a7583e83e1e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125857 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <[email protected]> diff --git a/winaccessibility/source/UAccCOM/AccTextBase.cxx b/winaccessibility/source/UAccCOM/AccTextBase.cxx index 47225cb46f25..a71431fc1d22 100644 --- a/winaccessibility/source/UAccCOM/AccTextBase.cxx +++ b/winaccessibility/source/UAccCOM/AccTextBase.cxx @@ -882,7 +882,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccTextBase::put_XInterface(hyper pXInterface LEAVE_PROTECTED_BLOCK } -static OUString ReplaceOneChar(OUString const & oldOUString, sal_Unicode replacedChar, OUString const & replaceStr) +static OUString ReplaceOneChar(OUString const & oldOUString, sal_Unicode replacedChar, std::u16string_view replaceStr) { auto s = oldOUString; int iReplace = s.lastIndexOf(replacedChar); @@ -900,11 +900,11 @@ static OUString ReplaceOneChar(OUString const & oldOUString, sal_Unicode replace static OUString ReplaceFourChar(OUString const & oldOUString) { auto s = oldOUString; - s = ReplaceOneChar(s, '\\', "\\\\"); - s = ReplaceOneChar(s, ';', "\\;"); - s = ReplaceOneChar(s, '=', "\\="); - s = ReplaceOneChar(s, ',', "\\,"); - s = ReplaceOneChar(s, ':', "\\:"); + s = ReplaceOneChar(s, '\\', u"\\\\"); + s = ReplaceOneChar(s, ';', u"\\;"); + s = ReplaceOneChar(s, '=', u"\\="); + s = ReplaceOneChar(s, ',', u"\\,"); + s = ReplaceOneChar(s, ':', u"\\:"); return s; }
