diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-12-29 12:20:23 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-01-04 15:29:54 +0100 |
commit | c34e8bd71384326184baac7dea31f7ddf9bae6bc (patch) | |
tree | 0914b24023030781b3a74a768be9df4d2873b4b9 | |
parent | a1cdde17aa27902ee162d5b40860f05c592c4de8 (diff) |
loplugin:stringviewparam: operator +=
Change-Id: I30ce1b5bd8fb168da7067c1967c5af2569df2653
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108512
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
57 files changed, 150 insertions, 79 deletions
diff --git a/basctl/source/basicide/localizationmgr.cxx b/basctl/source/basicide/localizationmgr.cxx index 72408cd61ac0..806b3d8aacae 100644 --- a/basctl/source/basicide/localizationmgr.cxx +++ b/basctl/source/basicide/localizationmgr.cxx @@ -171,7 +171,7 @@ void LocalizationMgr::implEnableDisableResourceForAllLibraryDialogs( HandleResou static OUString implCreatePureResourceId ( std::u16string_view aDialogName, std::u16string_view aCtrlName, - const OUString& aPropName, + std::u16string_view aPropName, const Reference< XStringResourceManager >& xStringResourceManager ) { sal_Int32 nUniqueId = xStringResourceManager->getUniqueNumericId(); diff --git a/basic/source/inc/iosys.hxx b/basic/source/inc/iosys.hxx index 7fb75a2e113c..ca5c6b275bcc 100644 --- a/basic/source/inc/iosys.hxx +++ b/basic/source/inc/iosys.hxx @@ -88,7 +88,7 @@ class SbiIoSystem short nChan; ErrCode nError; void ReadCon(OString&); - void WriteCon(const OUString&); + void WriteCon(std::u16string_view); public: SbiIoSystem(); ~SbiIoSystem() COVERITY_NOEXCEPT_FALSE; @@ -102,7 +102,7 @@ public: void Close(); void Read(OString&); char Read(); - void Write(const OUString&); + void Write(std::u16string_view); // 0 == bad channel or no SvStream (nChannel=0..CHANNELS-1) SbiStream* GetStream( short nChannel ) const; void CloseAll(); // JSM diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx index 6fc681f48492..4c991c6676c7 100644 --- a/basic/source/runtime/iosys.cxx +++ b/basic/source/runtime/iosys.cxx @@ -744,7 +744,7 @@ char SbiIoSystem::Read() return ch; } -void SbiIoSystem::Write(const OUString& rBuf) +void SbiIoSystem::Write(std::u16string_view rBuf) { if( !nChan ) { @@ -806,7 +806,7 @@ void SbiIoSystem::ReadCon(OString& rIn) // output of a MessageBox, if there's a CR in the console-buffer -void SbiIoSystem::WriteCon(const OUString& rText) +void SbiIoSystem::WriteCon(std::u16string_view rText) { aOut += rText; sal_Int32 n1 = aOut.indexOf('\n'); diff --git a/chart2/source/controller/dialogs/ObjectNameProvider.cxx b/chart2/source/controller/dialogs/ObjectNameProvider.cxx index 2a3d954a61fa..56dca8dde908 100644 --- a/chart2/source/controller/dialogs/ObjectNameProvider.cxx +++ b/chart2/source/controller/dialogs/ObjectNameProvider.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <string_view> + #include <ObjectNameProvider.hxx> #include <ResId.hxx> #include <strings.hrc> @@ -80,11 +84,11 @@ OUString lcl_getFullSeriesName( const OUString& rObjectCID, const Reference< fra return aRet; } -void lcl_addText( OUString& rOut, const OUString& rSeparator, const OUString& rNext ) +void lcl_addText( OUString& rOut, std::u16string_view rSeparator, std::u16string_view rNext ) { - if( !(rOut.isEmpty() || rNext.isEmpty()) ) + if( !(rOut.isEmpty() || rNext.empty()) ) rOut+=rSeparator; - if( !rNext.isEmpty() ) + if( !rNext.empty() ) rOut+=rNext; } diff --git a/compilerplugins/clang/stringviewparam.cxx b/compilerplugins/clang/stringviewparam.cxx index 9d3aac5fed0a..a96d8cad4929 100644 --- a/compilerplugins/clang/stringviewparam.cxx +++ b/compilerplugins/clang/stringviewparam.cxx @@ -195,6 +195,14 @@ SmallVector<DeclRefExpr const*, 2> relevantCXXOperatorCallExpr(CXXOperatorCallEx } return v; } + if (op == OO_PlusEqual) + { + if (relevantStringType(expr->getArg(0)->getType()) != StringType::RtlOustring) + { + return {}; + } + return wrap(relevantDeclRefExpr(expr->getArg(1))); + } return {}; } diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index 4f3e07be5938..fece1bf7fb21 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -58,6 +58,7 @@ #include <algorithm> #include <cassert> #include <memory> +#include <string_view> using namespace ::comphelper; using namespace connectivity; @@ -2270,7 +2271,7 @@ void SAL_CALL ODbaseTable::rename( const OUString& newName ) } namespace { - void renameFile(file::OConnection const * _pConnection,const OUString& oldName, + void renameFile(file::OConnection const * _pConnection,std::u16string_view oldName, const OUString& newName,const OUString& _sExtension) { OUString aName = ODbaseTable::getEntry(_pConnection,oldName); diff --git a/cui/source/dialogs/toolbarmodedlg.cxx b/cui/source/dialogs/toolbarmodedlg.cxx index e15f54e830cb..4f5df939e948 100644 --- a/cui/source/dialogs/toolbarmodedlg.cxx +++ b/cui/source/dialogs/toolbarmodedlg.cxx @@ -141,13 +141,13 @@ int ToolbarmodeDialog::GetActiveRadioButton() return -1; } -void ToolbarmodeDialog::UpdateImage(OUString sFileName) +void ToolbarmodeDialog::UpdateImage(std::u16string_view sFileName) { // load image OUString aURL("$BRAND_BASE_DIR/$BRAND_SHARE_SUBDIR/toolbarmode/"); rtl::Bootstrap::expandMacros(aURL); aURL += sFileName; - if (sFileName.isEmpty() || !file_exists(aURL)) + if (sFileName.empty() || !file_exists(aURL)) return; // draw image Graphic aGraphic; diff --git a/cui/source/inc/toolbarmodedlg.hxx b/cui/source/inc/toolbarmodedlg.hxx index 40d6dc835851..8d0216734a75 100644 --- a/cui/source/inc/toolbarmodedlg.hxx +++ b/cui/source/inc/toolbarmodedlg.hxx @@ -9,6 +9,10 @@ #pragma once +#include <sal/config.h> + +#include <string_view> + #include <vcl/weld.hxx> class ToolbarmodeDialog : public weld::GenericDialogController @@ -24,7 +28,7 @@ private: std::unique_ptr<weld::RadioButton> m_pRadioButtons[9]; std::unique_ptr<weld::Label> m_pInfoLabel; - void UpdateImage(OUString sFileName); + void UpdateImage(std::u16string_view sFileName); int GetActiveRadioButton(); DECL_LINK(SelectToolbarmode, weld::ToggleButton&, void); DECL_LINK(OnApplyClick, weld::Button&, void); diff --git a/editeng/inc/editdoc.hxx b/editeng/inc/editdoc.hxx index ff2681e3ca5e..9b35cfeaa028 100644 --- a/editeng/inc/editdoc.hxx +++ b/editeng/inc/editdoc.hxx @@ -31,6 +31,7 @@ #include <o3tl/typed_flags_set.hxx> #include <memory> +#include <string_view> #include <vector> class ImpEditEngine; @@ -287,7 +288,7 @@ public: void SetChar(sal_Int32 nPos, sal_Unicode c); void Insert(const OUString& rStr, sal_Int32 nPos); - void Append(const OUString& rStr); + void Append(std::u16string_view rStr); void Erase(sal_Int32 nPos); void Erase(sal_Int32 nPos, sal_Int32 nCount); OUString Copy(sal_Int32 nPos) const; diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index 11d18adae056..e1a9c91e3ee5 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -1724,7 +1724,7 @@ void ContentNode::Insert(const OUString& rStr, sal_Int32 nPos) maString = maString.replaceAt(nPos, 0, rStr); } -void ContentNode::Append(const OUString& rStr) +void ContentNode::Append(std::u16string_view rStr) { maString += rStr; } diff --git a/i18nlangtag/source/languagetag/languagetag.cxx b/i18nlangtag/source/languagetag/languagetag.cxx index 148a102a5733..ef5e4cf518a4 100644 --- a/i18nlangtag/source/languagetag/languagetag.cxx +++ b/i18nlangtag/source/languagetag/languagetag.cxx @@ -1950,7 +1950,7 @@ OUString LanguageTagImpl::getGlibcLocaleString() const return maCachedGlibcString; } -OUString LanguageTag::getGlibcLocaleString( const OUString & rEncoding ) const +OUString LanguageTag::getGlibcLocaleString( std::u16string_view rEncoding ) const { OUString aRet; if (isIsoLocale()) @@ -1966,7 +1966,7 @@ OUString LanguageTag::getGlibcLocaleString( const OUString & rEncoding ) const aRet = getImpl()->getGlibcLocaleString(); sal_Int32 nAt = aRet.indexOf('@'); if (nAt != -1) - aRet = aRet.subView(0, nAt) + rEncoding + aRet.subView(nAt); + aRet = OUString::Concat(aRet.subView(0, nAt)) + rEncoding + aRet.subView(nAt); else aRet += rEncoding; } diff --git a/i18npool/source/localedata/LocaleNode.hxx b/i18npool/source/localedata/LocaleNode.hxx index b187cc9adbd9..9706948419bf 100644 --- a/i18npool/source/localedata/LocaleNode.hxx +++ b/i18npool/source/localedata/LocaleNode.hxx @@ -87,7 +87,7 @@ protected: public: LocaleNode (const OUString& name, const Reference< XAttributeList > & attr); - void setValue(const OUString &oValue) { aValue += oValue; }; + void setValue(std::u16string_view oValue) { aValue += oValue; }; const OUString& getName() const { return aName; }; const OUString& getValue() const { return aValue; }; const Attr& getAttr() const { return aAttribs; }; diff --git a/include/i18nlangtag/languagetag.hxx b/include/i18nlangtag/languagetag.hxx index d7c1c8787a53..62957f1f7f70 100644 --- a/include/i18nlangtag/languagetag.hxx +++ b/include/i18nlangtag/languagetag.hxx @@ -224,7 +224,7 @@ public: @return The resulting GLIBC locale string if it could be constructed, if not an empty string is returned. */ - OUString getGlibcLocaleString( const OUString & rEncoding ) const; + OUString getGlibcLocaleString( std::u16string_view rEncoding ) const; /** If language tag has a non-default script specified. */ diff --git a/include/oox/mathml/importutils.hxx b/include/oox/mathml/importutils.hxx index 851b2564a100..9ab79a6f0858 100644 --- a/include/oox/mathml/importutils.hxx +++ b/include/oox/mathml/importutils.hxx @@ -10,6 +10,7 @@ #define INCLUDED_OOX_MATHML_IMPORTUTILS_HXX #include <map> +#include <string_view> #include <vector> #include <com/sun/star/uno/Reference.hxx> @@ -229,7 +230,7 @@ public: void appendOpeningTag(int token, const AttributeList& attribs); void appendClosingTag(int token); // appends the characters after the last appended token - void appendCharacters(const OUString& characters); + void appendCharacters(std::u16string_view characters); }; inline OUString XmlStream::Tag::attribute(int t, const OUString& def) const diff --git a/include/sfx2/linkmgr.hxx b/include/sfx2/linkmgr.hxx index 4a159e16df3e..fcd91ea81f0d 100644 --- a/include/sfx2/linkmgr.hxx +++ b/include/sfx2/linkmgr.hxx @@ -96,7 +96,7 @@ public: // the links connect to a SvLinkSource and adds to the list void InsertDDELink( SvBaseLink*, const OUString& rServer, - const OUString& rTopic, + std::u16string_view rTopic, std::u16string_view rItem ); // if everything is already set at the link! @@ -176,7 +176,7 @@ const sal_Unicode cTokenSeparator = 0xFFFF; // - File-/Graphics-LinkNames the last 3 Strings (FileName, Region, Filter) SFX2_DLLPUBLIC void MakeLnkName( OUString& rName, const OUString* pType, // Can also be null!! - const OUString& rFile, + std::u16string_view rFile, std::u16string_view rLink, const OUString* pFilter = nullptr ); diff --git a/include/svx/tbxcolor.hxx b/include/svx/tbxcolor.hxx index b98b0be7b326..86dff9a9249f 100644 --- a/include/svx/tbxcolor.hxx +++ b/include/svx/tbxcolor.hxx @@ -19,6 +19,10 @@ #pragma once +#include <sal/config.h> + +#include <string_view> + #include <com/sun/star/frame/XLayoutManager.hpp> #include <svx/svxdllapi.h> @@ -37,7 +41,7 @@ namespace svx css::frame::XLayoutManager > m_xLayouter; public: - ToolboxAccess( const OUString& rToolboxName ); + ToolboxAccess( std::u16string_view rToolboxName ); public: /** toggles the toolbox diff --git a/include/unotools/fontdefs.hxx b/include/unotools/fontdefs.hxx index 887041f6f15b..ad1d6726f17e 100644 --- a/include/unotools/fontdefs.hxx +++ b/include/unotools/fontdefs.hxx @@ -19,6 +19,10 @@ #ifndef INCLUDED_UNOTOOLS_FONTDEFS_HXX #define INCLUDED_UNOTOOLS_FONTDEFS_HXX +#include <sal/config.h> + +#include <string_view> + #include <unotools/unotoolsdllapi.h> #include <sal/types.h> #include <rtl/ustring.hxx> @@ -38,7 +42,7 @@ namespace o3tl UNOTOOLS_DLLPUBLIC OUString GetSubsFontName( const OUString& rName, SubsFontFlags nFlags ); -UNOTOOLS_DLLPUBLIC void AddTokenFontName( OUString& rName, const OUString& rNewToken ); +UNOTOOLS_DLLPUBLIC void AddTokenFontName( OUString& rName, std::u16string_view rNewToken ); class UNLESS_MERGELIBS(UNOTOOLS_DLLPUBLIC) ConvertChar diff --git a/lotuswordpro/source/filter/lwppara.hxx b/lotuswordpro/source/filter/lwppara.hxx index 4815d1661a9b..bfb1dcb82b9a 100644 --- a/lotuswordpro/source/filter/lwppara.hxx +++ b/lotuswordpro/source/filter/lwppara.hxx @@ -67,6 +67,7 @@ #include <lwpobj.hxx> #include <lwpobjstrm.hxx> +#include <string_view> #include <vector> #include "lwpdlvlist.hxx" #include <lwpbasetype.hxx> @@ -184,7 +185,7 @@ public: bool IsInCell(); - void SetAllText(const OUString& sText); + void SetAllText(std::u16string_view sText); protected: sal_uInt32 m_nOrdinal; // Ordinal number of this paragraph diff --git a/lotuswordpro/source/filter/lwppara1.cxx b/lotuswordpro/source/filter/lwppara1.cxx index 4a32be862b5b..621a0bdac6b3 100644 --- a/lotuswordpro/source/filter/lwppara1.cxx +++ b/lotuswordpro/source/filter/lwppara1.cxx @@ -99,7 +99,7 @@ OUString const & LwpPara::GetContentText(bool bAllText) /** * @short set text of paragraph */ -void LwpPara::SetAllText(const OUString& sText) +void LwpPara::SetAllText(std::u16string_view sText) { m_AllText+=sText; } diff --git a/oox/source/mathml/importutils.cxx b/oox/source/mathml/importutils.cxx index caeaf7de05f8..962528acba2a 100644 --- a/oox/source/mathml/importutils.cxx +++ b/oox/source/mathml/importutils.cxx @@ -326,7 +326,7 @@ void XmlStreamBuilder::appendClosingTag( int token ) tags.emplace_back( CLOSING( token )); } -void XmlStreamBuilder::appendCharacters( const OUString& chars ) +void XmlStreamBuilder::appendCharacters( std::u16string_view chars ) { assert( !tags.empty()); tags.back().text += chars; diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index d878070f64ea..4db88f60bb7c 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -49,6 +49,7 @@ #include <math.h> #include <memory> #include <list> +#include <string_view> #define D_MAX_LONG_ double(0x7fffffff) @@ -133,7 +134,8 @@ OUString lcl_ValueString( sal_Int32 nValue, sal_uInt16 nMinDigits ) } void setSuffixCell( - ScColumn& rColumn, SCROW nRow, sal_Int32 nValue, sal_uInt16 nDigits, const OUString& rSuffix, + ScColumn& rColumn, SCROW nRow, sal_Int32 nValue, sal_uInt16 nDigits, + std::u16string_view rSuffix, CellType eCellType, bool bIsOrdinalSuffix ) { ScDocument& rDoc = rColumn.GetDoc(); diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx index 7f8ace82683f..8156b4579499 100644 --- a/sc/source/filter/excel/xepivot.cxx +++ b/sc/source/filter/excel/xepivot.cxx @@ -29,6 +29,7 @@ #include <algorithm> #include <math.h> +#include <string_view> #include <osl/diagnose.h> #include <sot/storage.hxx> @@ -865,7 +866,7 @@ void XclExpPivotCache::WriteSxindexlistList( XclExpStream& rStrm ) const namespace { /** Returns a display string for a data field containing the field name and aggregation function. */ -OUString lclGetDataFieldCaption( const OUString& rFieldName, ScGeneralFunction eFunc ) +OUString lclGetDataFieldCaption( std::u16string_view rFieldName, ScGeneralFunction eFunc ) { OUString aCaption; diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx index 684a6727839a..f7e04a15c3c8 100644 --- a/sc/source/filter/html/htmlexp.cxx +++ b/sc/source/filter/html/htmlexp.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <string_view> + #include <scitems.hxx> #include <editeng/eeitem.hxx> @@ -148,7 +152,7 @@ static OString lcl_getColGroupString(sal_Int32 nSpan, sal_Int32 nWidth) return aByteStr.makeStringAndClear(); } -static void lcl_AddStamp( OUString& rStr, const OUString& rName, +static void lcl_AddStamp( OUString& rStr, std::u16string_view rName, const css::util::DateTime& rDateTime, const LocaleDataWrapper& rLoc ) { @@ -161,7 +165,7 @@ static void lcl_AddStamp( OUString& rStr, const OUString& rName, OUString aStrTime = rLoc.getTime( aDateTime ); rStr += GLOBSTR( STR_BY ) + " "; - if (!rName.isEmpty()) + if (!rName.empty()) rStr += rName; else rStr += "???"; diff --git a/sc/source/filter/inc/pagesettings.hxx b/sc/source/filter/inc/pagesettings.hxx index 13e7eba7f779..ff0e0a035ace 100644 --- a/sc/source/filter/inc/pagesettings.hxx +++ b/sc/source/filter/inc/pagesettings.hxx @@ -21,6 +21,8 @@ #define INCLUDED_SC_SOURCE_FILTER_INC_PAGESETTINGS_HXX #include <memory> +#include <string_view> + #include "worksheethelper.hxx" namespace oox { class AttributeList; } @@ -96,7 +98,8 @@ public: /** Imports header and footer settings from a headerFooter element. */ void importHeaderFooter( const AttributeList& rAttribs ); /** Imports header/footer characters from a headerFooter element. */ - void importHeaderFooterCharacters( const OUString& rChars, sal_Int32 nElement ); + void importHeaderFooterCharacters( + std::u16string_view rChars, sal_Int32 nElement ); /** Imports the picture element. */ void importPicture( const ::oox::core::Relations& rRelations, const AttributeList& rAttribs ); diff --git a/sc/source/filter/oox/pagesettings.cxx b/sc/source/filter/oox/pagesettings.cxx index b19caea83634..d6fd828c79dd 100644 --- a/sc/source/filter/oox/pagesettings.cxx +++ b/sc/source/filter/oox/pagesettings.cxx @@ -212,7 +212,7 @@ void PageSettings::importHeaderFooter( const AttributeList& rAttribs ) maModel.mbUseFirstHF = rAttribs.getBool( XML_differentFirst, false ); } -void PageSettings::importHeaderFooterCharacters( const OUString& rChars, sal_Int32 nElement ) +void PageSettings::importHeaderFooterCharacters( std::u16string_view rChars, sal_Int32 nElement ) { switch( nElement ) { diff --git a/sd/inc/glob.hxx b/sd/inc/glob.hxx index 884d16032719..b4560c0a8a5a 100644 --- a/sd/inc/glob.hxx +++ b/sd/inc/glob.hxx @@ -48,8 +48,8 @@ #define SD_LT_SEPARATOR "~LT~" // option-stream identifier -#define SD_OPTION_MORPHING "Morph" -#define SD_OPTION_VECTORIZE "Vectorize" +#define SD_OPTION_MORPHING u"Morph" +#define SD_OPTION_VECTORIZE u"Vectorize" #endif // _ INCLUDED_SD_INC_GLOB_HXX diff --git a/sd/inc/sdmod.hxx b/sd/inc/sdmod.hxx index 42c4ea4e85bc..7789b896b871 100644 --- a/sd/inc/sdmod.hxx +++ b/sd/inc/sdmod.hxx @@ -33,6 +33,7 @@ #include <vcl/virdev.hxx> #include <map> #include <memory> +#include <string_view> class SdOptions; class SvxSearchItem; @@ -92,7 +93,7 @@ public: void GetState(SfxItemSet&); SdOptions* GetSdOptions(DocumentType eDocType); - SD_DLLPUBLIC tools::SvRef<SotStorageStream> GetOptionStream( const OUString& rOptionName, SdOptionStreamMode eMode ); + SD_DLLPUBLIC tools::SvRef<SotStorageStream> GetOptionStream( std::u16string_view rOptionName, SdOptionStreamMode eMode ); bool GetWaterCan() const { return bWaterCan; } void SetWaterCan( bool bWC ) { bWaterCan = bWC; } diff --git a/sd/inc/sdpage.hxx b/sd/inc/sdpage.hxx index 56398c331cfd..cca449bcce8d 100644 --- a/sd/inc/sdpage.hxx +++ b/sd/inc/sdpage.hxx @@ -200,7 +200,7 @@ public: objects are removed with this mechanism instead of RemoveObject*/ virtual SdrObject* ReplaceObject(SdrObject* pNewObj, size_t nObjNum) override; - void SetObjText(SdrTextObj* pObj, SdrOutliner* pOutliner, PresObjKind eObjKind, const OUString& rStr ); + void SetObjText(SdrTextObj* pObj, SdrOutliner* pOutliner, PresObjKind eObjKind, std::u16string_view rStr ); void SetPageKind(PageKind ePgType) { mePageKind = ePgType; } PageKind GetPageKind() const { return mePageKind; } diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 798d48b2543e..bc876afdac0a 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -2374,7 +2374,7 @@ void SdPage::InsertPresObj(SdrObject* pObj, PresObjKind eKind ) |* \************************************************************************/ -void SdPage::SetObjText(SdrTextObj* pObj, SdrOutliner* pOutliner, PresObjKind eObjKind, const OUString& rString ) +void SdPage::SetObjText(SdrTextObj* pObj, SdrOutliner* pOutliner, PresObjKind eObjKind, std::u16string_view rString ) { if ( !pObj ) return; @@ -2414,7 +2414,7 @@ void SdPage::SetObjText(SdrTextObj* pObj, SdrOutliner* pOutliner, PresObjKind eO { pOutl->Init( OutlinerMode::OutlineObject ); - aString += "\t" + rString; + aString += OUString::Concat("\t") + rString; if (mbMaster) { diff --git a/sd/source/ui/app/sdmod.cxx b/sd/source/ui/app/sdmod.cxx index 27fea87ae28b..482a6d6bca4f 100644 --- a/sd/source/ui/app/sdmod.cxx +++ b/sd/source/ui/app/sdmod.cxx @@ -162,7 +162,7 @@ SdOptions* SdModule::GetSdOptions(DocumentType eDocType) * if the stream is opened for reading but does not exist, an 'empty' * RefObject is returned */ -tools::SvRef<SotStorageStream> SdModule::GetOptionStream( const OUString& rOptionName, +tools::SvRef<SotStorageStream> SdModule::GetOptionStream( std::u16string_view rOptionName, SdOptionStreamMode eMode ) { ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() ); diff --git a/sdext/source/presenter/PresenterHelpView.cxx b/sdext/source/presenter/PresenterHelpView.cxx index 18fcb3d3c21b..d6b625e53183 100644 --- a/sdext/source/presenter/PresenterHelpView.cxx +++ b/sdext/source/presenter/PresenterHelpView.cxx @@ -31,6 +31,7 @@ #include <com/sun/star/util/Color.hpp> #include <algorithm> #include <numeric> +#include <string_view> #include <vector> using namespace ::com::sun::star; @@ -50,7 +51,7 @@ namespace { public: LineDescriptor(); void AddPart ( - const OUString& rsLine, + std::u16string_view rsLine, const css::uno::Reference<css::rendering::XCanvasFont>& rxFont); bool IsEmpty() const; @@ -503,7 +504,7 @@ LineDescriptor::LineDescriptor() } void LineDescriptor::AddPart ( - const OUString& rsLine, + std::u16string_view rsLine, const css::uno::Reference<css::rendering::XCanvasFont>& rxFont) { msLine += rsLine; @@ -689,7 +690,7 @@ void LineDescriptorList::FormatText ( nIndex = nLength; } - aLineDescriptor.AddPart(iPart->copy(nStart, nIndex-nStart), rxFont); + aLineDescriptor.AddPart(iPart->subView(nStart, nIndex-nStart), rxFont); if (nIndex != nLength) { mpLineDescriptors->push_back(aLineDescriptor); @@ -706,14 +707,14 @@ void LineDescriptorList::FormatText ( else if (PresenterCanvasHelper::GetTextSize( rxFont, aLineDescriptor.msLine+", "+*iPart).Width > nMaximalWidth) { - aLineDescriptor.AddPart(",", rxFont); + aLineDescriptor.AddPart(u",", rxFont); mpLineDescriptors->push_back(aLineDescriptor); aLineDescriptor = LineDescriptor(); continue; } else { - aLineDescriptor.AddPart(", "+*iPart, rxFont); + aLineDescriptor.AddPart(OUString(", "+*iPart), rxFont); } ++iPart; } diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index e63c9b910d5e..ed980af3d90a 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -187,7 +187,7 @@ bool LinkManager::InsertLink( SvBaseLink * pLink, void LinkManager::InsertDDELink( SvBaseLink * pLink, const OUString& rServer, - const OUString& rTopic, + std::u16string_view rTopic, std::u16string_view rItem ) { if( !isClientType( pLink->GetObjType() ) ) @@ -375,7 +375,7 @@ void LinkManager::RemoveServer( SvLinkSource* pObj ) aServerTbl.erase( pObj ); } -void MakeLnkName( OUString& rName, const OUString* pType, const OUString& rFile, +void MakeLnkName( OUString& rName, const OUString* pType, std::u16string_view rFile, std::u16string_view rLink, const OUString* pFilter ) { if( pType ) diff --git a/svgio/inc/svgcharacternode.hxx b/svgio/inc/svgcharacternode.hxx index 988c30001df9..46d7ec995b18 100644 --- a/svgio/inc/svgcharacternode.hxx +++ b/svgio/inc/svgcharacternode.hxx @@ -20,6 +20,10 @@ #ifndef INCLUDED_SVGIO_INC_SVGCHARACTERNODE_HXX #define INCLUDED_SVGIO_INC_SVGCHARACTERNODE_HXX +#include <sal/config.h> + +#include <string_view> + #include "svgnode.hxx" namespace drawinglayer::primitive2d { class TextSimplePortionPrimitive2D; } @@ -148,7 +152,7 @@ namespace svgio::svgreader void decomposeText(drawinglayer::primitive2d::Primitive2DContainer& rTarget, SvgTextPosition& rSvgTextPosition) const; void whiteSpaceHandling(); void addGap(); - void concatenate(const OUString& rText); + void concatenate(std::u16string_view rText); /// Text content const OUString& getText() const { return maText; } diff --git a/svgio/inc/svgtitledescnode.hxx b/svgio/inc/svgtitledescnode.hxx index 0c8eae4b94f6..50eb5bc73ee2 100644 --- a/svgio/inc/svgtitledescnode.hxx +++ b/svgio/inc/svgtitledescnode.hxx @@ -19,6 +19,10 @@ #ifndef INCLUDED_SVGIO_INC_SVGTITLEDESCNODE_HXX #define INCLUDED_SVGIO_INC_SVGTITLEDESCNODE_HXX +#include <sal/config.h> + +#include <string_view> + #include "svgnode.hxx" @@ -38,7 +42,7 @@ namespace svgio::svgreader virtual ~SvgTitleDescNode() override; /// add new chars - void concatenate(const OUString& rChars); + void concatenate(std::u16string_view rChars); /// x content, set if found in current context const OUString& getText() const { return maText; } diff --git a/svgio/source/svgreader/svgcharacternode.cxx b/svgio/source/svgreader/svgcharacternode.cxx index 457039e1ba82..dc24adc7ffc0 100644 --- a/svgio/source/svgreader/svgcharacternode.cxx +++ b/svgio/source/svgreader/svgcharacternode.cxx @@ -539,7 +539,7 @@ namespace svgio::svgreader maText += " "; } - void SvgCharacterNode::concatenate(const OUString& rText) + void SvgCharacterNode::concatenate(std::u16string_view rText) { maText += rText; } diff --git a/svgio/source/svgreader/svgtitledescnode.cxx b/svgio/source/svgreader/svgtitledescnode.cxx index 9ff26e1a7e95..0475a8275c88 100644 --- a/svgio/source/svgreader/svgtitledescnode.cxx +++ b/svgio/source/svgreader/svgtitledescnode.cxx @@ -37,7 +37,7 @@ namespace svgio::svgreader { } - void SvgTitleDescNode::concatenate(const OUString& rChars) + void SvgTitleDescNode::concatenate(std::u16string_view rChars) { maText += rChars; } diff --git a/svtools/source/config/extcolorcfg.cxx b/svtools/source/config/extcolorcfg.cxx index 397d83b1cf94..1fa91e645dc2 100644 --- a/svtools/source/config/extcolorcfg.cxx +++ b/svtools/source/config/extcolorcfg.cxx @@ -217,7 +217,7 @@ void ExtendedColorConfig_Impl::EnableBroadcast() ExtendedColorConfig::m_pImpl->m_bIsBroadcastEnabled = true; } -static void lcl_addString(uno::Sequence < OUString >& _rSeq,const OUString& _sAdd) +static void lcl_addString(uno::Sequence < OUString >& _rSeq,std::u16string_view _sAdd) { for(OUString & i : _rSeq) i += _sAdd; @@ -319,7 +319,7 @@ void ExtendedColorConfig_Impl::FillComponentColors(const uno::Sequence < OUStrin const OUString sColor("/Color"); lcl_addString(aColorNames,sColor); - lcl_addString(aDefaultColorNames,"/DefaultColor"); + lcl_addString(aDefaultColorNames,u"/DefaultColor"); uno::Sequence< uno::Any > aColors = GetProperties( aColorNames ); const uno::Any* pColors = aColors.getConstArray(); diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx index 95c0ee341087..a88e0f5b59b8 100644 --- a/svx/source/tbxctrls/grafctrl.cxx +++ b/svx/source/tbxctrls/grafctrl.cxx @@ -60,7 +60,7 @@ using namespace ::com::sun::star::util; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::lang; -#define TOOLBOX_NAME "colorbar" +#define TOOLBOX_NAME u"colorbar" #define RID_SVXSTR_UNDO_GRAFCROP RID_SVXSTR_GRAFCROP namespace { diff --git a/svx/source/tbxctrls/tbxcolor.cxx b/svx/source/tbxctrls/tbxcolor.cxx index e87e1910f58e..f3dbbe096ce3 100644 --- a/svx/source/tbxctrls/tbxcolor.cxx +++ b/svx/source/tbxctrls/tbxcolor.cxx @@ -33,7 +33,7 @@ namespace svx using namespace ::com::sun::star::frame; using namespace ::com::sun::star::beans; - ToolboxAccess::ToolboxAccess( const OUString& rToolboxName ) : + ToolboxAccess::ToolboxAccess( std::u16string_view rToolboxName ) : m_sToolboxResName ( "private:resource/toolbar/" ) { m_sToolboxResName += rToolboxName; diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx index 5da1a4729bcb..f3a2cdc14b4c 100644 --- a/sw/inc/docufld.hxx +++ b/sw/inc/docufld.hxx @@ -19,6 +19,10 @@ #ifndef INCLUDED_SW_INC_DOCUFLD_HXX #define INCLUDED_SW_INC_DOCUFLD_HXX +#include <sal/config.h> + +#include <string_view> + #include <tools/solar.h> #include <tools/date.hxx> #include <tools/datetime.hxx> @@ -417,7 +421,7 @@ public: virtual bool PutValue( const css::uno::Any& rVal, sal_uInt16 nWhich ) override; static void CreateMacroString( OUString& rMacro, - const OUString& rMacroName, + std::u16string_view rMacroName, const OUString& rLibraryName ); static bool isScriptURL( const OUString& str ); diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index e308e467571b..b586536403c1 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -628,7 +628,7 @@ static void lcl_CpyAttr( SfxItemSet &rNewSet, const SfxItemSet &rOldSet, sal_uIn static SwFlyFrameFormat * lcl_InsertLabel(SwDoc & rDoc, SwTextFormatColls *const pTextFormatCollTable, SwUndoInsertLabel *const pUndo, - SwLabelType const eType, OUString const& rText, OUString const& rSeparator, + SwLabelType const eType, std::u16string_view rText, std::u16string_view rSeparator, const OUString& rNumberingSeparator, const bool bBefore, const sal_uInt16 nId, const sal_uLong nNdIdx, const OUString& rCharacterStyle, @@ -896,7 +896,7 @@ lcl_InsertLabel(SwDoc & rDoc, SwTextFormatColls *const pTextFormatCollTable, aText += " "; } sal_Int32 nIdx = aText.getLength(); - if( !rText.isEmpty() ) + if( !rText.empty() ) { aText += rSeparator; } diff --git a/sw/source/core/fields/macrofld.cxx b/sw/source/core/fields/macrofld.cxx index c9fd26870f99..2430a859afbe 100644 --- a/sw/source/core/fields/macrofld.cxx +++ b/sw/source/core/fields/macrofld.cxx @@ -194,12 +194,12 @@ bool SwMacroField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) /// create an internally used macro name from the library and macro name parts void SwMacroField::CreateMacroString( OUString& rMacro, - const OUString& rMacroName, + std::u16string_view rMacroName, const OUString& rLibraryName ) { // concatenate library and name; use dot only if both strings have content rMacro = rLibraryName; - if ( !rLibraryName.isEmpty() && !rMacroName.isEmpty() ) + if ( !rLibraryName.isEmpty() && !rMacroName.empty() ) rMacro += "."; rMacro += rMacroName; } diff --git a/sw/source/core/text/porftn.hxx b/sw/source/core/text/porftn.hxx index 758d76dfde74..bbaad2aa751b 100644 --- a/sw/source/core/text/porftn.hxx +++ b/sw/source/core/text/porftn.hxx @@ -19,6 +19,10 @@ #pragma once +#include <sal/config.h> + +#include <string_view> + #include "porfld.hxx" class SwTextFootnote; @@ -89,7 +93,7 @@ public: class SwErgoSumPortion : public SwFieldPortion { public: - SwErgoSumPortion( const OUString &rExp, const OUString& rStr ); + SwErgoSumPortion( const OUString &rExp, std::u16string_view rStr ); virtual TextFrameIndex GetModelPositionForViewPoint(sal_uInt16 nOfst) const override; virtual bool Format( SwTextFormatInfo &rInf ) override; diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx index 19880e023d7f..ea326a91ae3f 100644 --- a/sw/source/core/text/txtftn.cxx +++ b/sw/source/core/text/txtftn.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <string_view> + #include <viewsh.hxx> #include <doc.hxx> #include <IDocumentLayoutAccess.hxx> @@ -1470,10 +1474,10 @@ void SwQuoVadisPortion::Paint( const SwTextPaintInfo &rInf ) const SwFieldPortion *SwErgoSumPortion::Clone( const OUString &rExpand ) const { - return new SwErgoSumPortion( rExpand, OUString() ); + return new SwErgoSumPortion( rExpand, std::u16string_view() ); } -SwErgoSumPortion::SwErgoSumPortion(const OUString &rExp, const OUString& rStr) +SwErgoSumPortion::SwErgoSumPortion(const OUString &rExp, std::u16string_view rStr) : SwFieldPortion( rExp ) { SetLen(TextFrameIndex(0)); diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx index d4197cba5c85..0ed3e1daa146 100644 --- a/sw/source/uibase/shells/grfsh.cxx +++ b/sw/source/uibase/shells/grfsh.cxx @@ -64,7 +64,7 @@ #include <unocrsr.hxx> #include <memory> -#define TOOLBOX_NAME "colorbar" +#define TOOLBOX_NAME u"colorbar" class SwGrfShell::SwExternalToolEdit : public ExternalToolEdit diff --git a/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx b/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx index 33c4f11cbfa9..332da1096a2e 100644 --- a/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx +++ b/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx @@ -391,7 +391,7 @@ bool ResultSetDataSupplier::queryNamesOfChildren() } OUString -ResultSetDataSupplier::assembleChildURL( const OUString& aName ) +ResultSetDataSupplier::assembleChildURL( std::u16string_view aName ) { OUString aContURL = m_pImpl->m_xContent->getIdentifier()->getContentIdentifier(); diff --git a/ucb/source/ucp/tdoc/tdoc_datasupplier.hxx b/ucb/source/ucp/tdoc/tdoc_datasupplier.hxx index cf888c0d6a0a..0f7cbffeb1c3 100644 --- a/ucb/source/ucp/tdoc/tdoc_datasupplier.hxx +++ b/ucb/source/ucp/tdoc/tdoc_datasupplier.hxx @@ -23,6 +23,7 @@ #include <rtl/ref.hxx> #include <ucbhelper/resultset.hxx> #include <memory> +#include <string_view> namespace tdoc_ucp { @@ -35,7 +36,7 @@ class ResultSetDataSupplier : public ::ucbhelper::ResultSetDataSupplier private: bool queryNamesOfChildren(); - OUString assembleChildURL( const OUString& aName ); + OUString assembleChildURL( std::u16string_view aName ); public: ResultSetDataSupplier( diff --git a/ucb/source/ucp/webdav-neon/NeonUri.cxx b/ucb/source/ucp/webdav-neon/NeonUri.cxx index f3f142123a40..4c88819e7bb5 100644 --- a/ucb/source/ucp/webdav-neon/NeonUri.cxx +++ b/ucb/source/ucp/webdav-neon/NeonUri.cxx @@ -235,7 +235,7 @@ OUString NeonUri::GetPathBaseNameUnescaped () const return unescape( GetPathBaseName() ); } -void NeonUri::AppendPath (const OUString& rPath) +void NeonUri::AppendPath (std::u16string_view rPath) { if (mPath.lastIndexOf ('/') != mPath.getLength () - 1) mPath += "/"; diff --git a/ucb/source/ucp/webdav-neon/NeonUri.hxx b/ucb/source/ucp/webdav-neon/NeonUri.hxx index fae505e501f5..3149ab9fb53f 100644 --- a/ucb/source/ucp/webdav-neon/NeonUri.hxx +++ b/ucb/source/ucp/webdav-neon/NeonUri.hxx @@ -28,6 +28,10 @@ #ifndef INCLUDED_UCB_SOURCE_UCP_WEBDAV_NEON_NEONURI_HXX #define INCLUDED_UCB_SOURCE_UCP_WEBDAV_NEON_NEONURI_HXX +#include <sal/config.h> + +#include <string_view> + #include <config_lgpl.h> #include <ne_uri.h> #include <rtl/ustring.hxx> @@ -84,7 +88,7 @@ class NeonUri void SetScheme (const OUString& scheme) { mScheme = scheme; calculateURI (); }; - void AppendPath (const OUString& rPath); + void AppendPath (std::u16string_view rPath); static OUString escapeSegment( const OUString& segment ); static OUString unescape( const OUString& string ); diff --git a/unotools/source/i18n/resmgr.cxx b/unotools/source/i18n/resmgr.cxx index ef5b83cf06bc..caee3ecf1818 100644 --- a/unotools/source/i18n/resmgr.cxx +++ b/unotools/source/i18n/resmgr.cxx @@ -119,7 +119,7 @@ namespace Translate std::locale Create(const char* pPrefixName, const LanguageTag& rLocale) { static std::unordered_map<OString, std::locale> aCache; - OString sIdentifier = rLocale.getGlibcLocaleString(".UTF-8").toUtf8(); + OString sIdentifier = rLocale.getGlibcLocaleString(u".UTF-8").toUtf8(); OString sUnique = sIdentifier + pPrefixName; auto aFind = aCache.find(sUnique); if (aFind != aCache.end()) diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx index 59830cb1e1b0..e470575a015b 100644 --- a/unotools/source/misc/fontdefs.cxx +++ b/unotools/source/misc/fontdefs.cxx @@ -20,6 +20,8 @@ #include <unotools/fontdefs.hxx> #include <unotools/fontcfg.hxx> #include <rtl/ustrbuf.hxx> + +#include <string_view> #include <unordered_map> sal_Unicode const aBatang[] = { 0xBC14, 0xD0D5, 0 }; @@ -489,7 +491,7 @@ static bool ImplIsFontToken( const OUString& rName, std::u16string_view rToken ) return false; } -static void ImplAppendFontToken( OUString& rName, const OUString& rNewToken ) +static void ImplAppendFontToken( OUString& rName, std::u16string_view rNewToken ) { if ( !rName.isEmpty() ) { @@ -498,7 +500,7 @@ static void ImplAppendFontToken( OUString& rName, const OUString& rNewToken ) rName += rNewToken; } -void AddTokenFontName( OUString& rName, const OUString& rNewToken ) +void AddTokenFontName( OUString& rName, std::u16string_view rNewToken ) { if ( !ImplIsFontToken( rName, rNewToken ) ) ImplAppendFontToken( rName, rNewToken ); diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index 4c9fbbe06f48..eaba51522b76 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -333,7 +333,7 @@ bool InitVCL() //force that in as $LANGUAGE. That way we can get gtk to render widgets RTL //if we have a RTL UI in an otherwise LTR locale and get gettext using externals (e.g. python) //to match their translations to our preferred UI language - OUString aLocaleString(SvtSysLocaleOptions().GetRealUILanguageTag().getGlibcLocaleString(".UTF-8")); + OUString aLocaleString(SvtSysLocaleOptions().GetRealUILanguageTag().getGlibcLocaleString(u".UTF-8")); if (!aLocaleString.isEmpty()) { MsLangId::getSystemUILanguage(); //call this now to pin what the system UI really was diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 503776986f70..5dc3d8b0f10c 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -585,7 +585,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r return aGraphic; } -static OUString ImpCreateFullFilterPath( const OUString& rPath, const OUString& rFilterName ) +static OUString ImpCreateFullFilterPath( const OUString& rPath, std::u16string_view rFilterName ) { OUString aPathURL; diff --git a/vcl/unx/generic/app/wmadaptor.cxx b/vcl/unx/generic/app/wmadaptor.cxx index ec853e26accc..9a6142314328 100644 --- a/vcl/unx/generic/app/wmadaptor.cxx +++ b/vcl/unx/generic/app/wmadaptor.cxx @@ -19,6 +19,7 @@ #include <string.h> #include <stdlib.h> +#include <string_view> #include <i18nlangtag/languagetag.hxx> #include <rtl/locale.h> @@ -973,7 +974,8 @@ void WMAdaptor::setWMName( X11SalFrame* pFrame, const OUString& rWMName ) const osl_getProcessLocale( &pLocale ); if( pLocale ) { - OUString aLocaleString( LanguageTag( *pLocale).getGlibcLocaleString( OUString())); + OUString aLocaleString( + LanguageTag( *pLocale).getGlibcLocaleString( std::u16string_view())); aWMLocale = OUStringToOString( aLocaleString, RTL_TEXTENCODING_ISO_8859_1 ); } else diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index dfd398cbda37..59f856801c05 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -3999,7 +3999,7 @@ void FieldContext::SetTextField(uno::Reference<text::XTextField> const& xTextFie m_xTextField = xTextField; } -void FieldContext::AppendCommand(const OUString& rPart) +void FieldContext::AppendCommand(std::u16string_view rPart) { m_sCommand += rPart; } @@ -6067,7 +6067,7 @@ bool DomainMapper_Impl::IsFieldResultAsString() return bRet; } -void DomainMapper_Impl::AppendFieldResult(OUString const& rString) +void DomainMapper_Impl::AppendFieldResult(std::u16string_view rString) { assert(!m_aFieldStack.empty()); FieldContextPtr pContext = m_aFieldStack.back(); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx index 0a2b5cbd5e85..b4b111e787ec 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx @@ -27,6 +27,7 @@ #include <com/sun/star/embed/XStorage.hpp> #include <queue> #include <stack> +#include <string_view> #include <o3tl/sorted_vector.hxx> #include <unordered_map> #include <vector> @@ -182,13 +183,13 @@ public: const css::uno::Reference<css::text::XTextRange>& GetStartRange() const { return m_xStartRange; } - void AppendCommand(const OUString& rPart); + void AppendCommand(std::u16string_view rPart); const OUString& GetCommand() const {return m_sCommand; } void SetFieldId(FieldId eFieldId ) { m_eFieldId = eFieldId; } std::optional<FieldId> const & GetFieldId() const { return m_eFieldId; } - void AppendResult(OUString const& rResult) { m_sResult += rResult; } + void AppendResult(std::u16string_view rResult) { m_sResult += rResult; } const OUString& GetResult() const { return m_sResult; } void SetCommandCompleted() { m_bFieldCommandCompleted = true; } @@ -854,7 +855,7 @@ public: void CloseFieldCommand(); //the _current_ fields require a string type result while TOCs accept richt results bool IsFieldResultAsString(); - void AppendFieldResult(OUString const& rResult); + void AppendFieldResult(std::u16string_view rResult); //apply the result text to the related field void SetFieldResult(OUString const& rResult); // set FFData of top field context diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx index fb480dd136e0..c74fbeb0fcd7 100644 --- a/xmloff/source/text/txtparai.cxx +++ b/xmloff/source/text/txtparai.cxx @@ -20,6 +20,7 @@ #include <xmloff/unointerfacetouniqueidentifiermapper.hxx> #include <memory> +#include <string_view> #include <vector> #include <rtl/ustring.hxx> @@ -524,7 +525,7 @@ public: sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override; void SetTextStyleName( const OUString& s ) { m_sTextStyleName = s; } - void AppendText( const OUString& s ) { m_sText += s; } + void AppendText( std::u16string_view s ) { m_sText += s; } }; class XMLImpRubyTextContext_Impl : public SvXMLImportContext |