From 3e6ad944ac6a7ccd465ed7a862157c467730f86b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Tue, 3 Dec 2024 11:07:23 +0000 Subject: [PATCH] don't bother passing const std::[u16]string_view by reference MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I49477c20849dd99118d5935c0f1576429648bfca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177734 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- cui/source/options/optcolor.cxx | 8 ++++---- desktop/source/app/updater.cxx | 4 ++-- filter/source/pdf/pdfexport.cxx | 2 +- filter/source/pdf/pdfexport.hxx | 2 +- include/vbahelper/vbahelper.hxx | 2 +- include/vcl/themecolors.hxx | 2 +- sc/inc/compiler.hxx | 2 +- sc/qa/unit/helper/qahelper.cxx | 6 +++--- sc/qa/unit/helper/qahelper.hxx | 6 +++--- sc/source/core/tool/compiler.cxx | 2 +- sd/qa/unit/uiimpress.cxx | 9 ++++----- sw/qa/inc/swmodeltestbase.hxx | 2 +- sw/qa/unit/swmodeltestbase.cxx | 2 +- test/source/a11y/accessibletestbase.cxx | 2 +- vbahelper/source/vbahelper/vbahelper.cxx | 2 +- xmloff/source/draw/shapeexport.cxx | 2 +- xmlsecurity/source/helper/ooxmlsecexporter.cxx | 7 +++---- 17 files changed, 30 insertions(+), 32 deletions(-) diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx index 8e008e2c8069..1f2d455a1cf0 100644 --- a/cui/source/options/optcolor.cxx +++ b/cui/source/options/optcolor.cxx @@ -278,9 +278,9 @@ private: void SetLinks(Link const&, Link const&, Link const&); - void Update (ColorConfigValue const&, const std::u16string_view&, + void Update (ColorConfigValue const&, std::u16string_view, css::uno::Reference const&); - void Update (ExtendedColorConfigValue const&, const std::u16string_view&, + void Update (ExtendedColorConfigValue const&, std::u16string_view, css::uno::Reference const&); void ColorChanged (ColorConfigValue&); void ColorChanged (ExtendedColorConfigValue&); @@ -387,7 +387,7 @@ void ColorConfigWindow_Impl::Entry::SetLinks(Link const& } // updates a default color config entry -void ColorConfigWindow_Impl::Entry::Update(ColorConfigValue const& rValue, const std::u16string_view& rConfigPath, +void ColorConfigWindow_Impl::Entry::Update(ColorConfigValue const& rValue, std::u16string_view rConfigPath, css::uno::Reference const& xReadWriteAccess) { Color aColor(rValue.nColor); @@ -418,7 +418,7 @@ void ColorConfigWindow_Impl::Entry::Update(ColorConfigValue const& rValue, const } // updates an extended color config entry -void ColorConfigWindow_Impl::Entry::Update(ExtendedColorConfigValue const& rValue, const std::u16string_view& rConfigPath, +void ColorConfigWindow_Impl::Entry::Update(ExtendedColorConfigValue const& rValue, std::u16string_view rConfigPath, css::uno::Reference const& xReadWriteAccess) { Color aColor(rValue.getColor()); diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx index 39699b90dec5..a82743627d4a 100644 --- a/desktop/source/app/updater.cxx +++ b/desktop/source/app/updater.cxx @@ -403,9 +403,9 @@ public: } }; -OUString toOUString(const std::string_view& rStr) +OUString toOUString(std::string_view str) { - return OUString::fromUtf8(rStr); + return OUString::fromUtf8(str); } update_file parse_update_file(orcus::json::node& rNode) diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index 8c42ebb7a5fa..5956933154c6 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -361,7 +361,7 @@ static OUString getMimetypeForDocument( const Reference< XComponentContext >& xC } uno::Reference -PDFExport::GetCertificateFromSubjectName(const std::u16string_view& rSubjectName) const +PDFExport::GetCertificateFromSubjectName(std::u16string_view rSubjectName) const { uno::Reference xSEInitializer = xml::crypto::SEInitializer::create(mxContext); diff --git a/filter/source/pdf/pdfexport.hxx b/filter/source/pdf/pdfexport.hxx index 8bfd1c363038..0e8e7fc429bc 100644 --- a/filter/source/pdf/pdfexport.hxx +++ b/filter/source/pdf/pdfexport.hxx @@ -66,7 +66,7 @@ private: void ImplWriteWatermark( vcl::PDFWriter& rWriter, const Size& rPageSize ); void ImplWriteTiledWatermark( vcl::PDFWriter& rWriter, const Size& rPageSize ); - css::uno::Reference GetCertificateFromSubjectName(const std::u16string_view& rSubjectName) const; + css::uno::Reference GetCertificateFromSubjectName(std::u16string_view rSubjectName) const; public: diff --git a/include/vbahelper/vbahelper.hxx b/include/vbahelper/vbahelper.hxx index 5dd3e00dbdc1..82c676710263 100644 --- a/include/vbahelper/vbahelper.hxx +++ b/include/vbahelper/vbahelper.hxx @@ -131,7 +131,7 @@ namespace ooo::vba VBAHELPER_DLLPUBLIC bool setPropertyValue( css::uno::Sequence< css::beans::PropertyValue >& aProp, const OUString& aName, const css::uno::Any& aValue ); VBAHELPER_DLLPUBLIC void setOrAppendPropertyValue( css::uno::Sequence< css::beans::PropertyValue >& aProp, const OUString& aName, const css::uno::Any& aValue ); - VBAHELPER_DLLPUBLIC bool executeRunTimeLibrary(const std::u16string_view& rSbRtl_command, + VBAHELPER_DLLPUBLIC bool executeRunTimeLibrary(std::u16string_view rSbRtl_command, SbxArray* pParameters); class VBAHELPER_DLLPUBLIC Millimeter diff --git a/include/vcl/themecolors.hxx b/include/vcl/themecolors.hxx index 8cadf21f552d..fec422adbac9 100644 --- a/include/vcl/themecolors.hxx +++ b/include/vcl/themecolors.hxx @@ -23,7 +23,7 @@ public: static bool IsThemeLoaded() { return m_bIsThemeLoaded; } static void SetThemeLoaded(bool bLoaded) { m_bIsThemeLoaded = bLoaded; } - static bool IsAutomaticTheme(const std::u16string_view& rThemeName) + static bool IsAutomaticTheme(std::u16string_view rThemeName) { return rThemeName == svtools::AUTOMATIC_COLOR_SCHEME; } diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx index 04aa7ea18d2d..046761650847 100644 --- a/sc/inc/compiler.hxx +++ b/sc/inc/compiler.hxx @@ -331,7 +331,7 @@ private: bool NextNewToken(bool bInArray); bool ToUpperAsciiOrI18nIsAscii( OUString& rUpper, const OUString& rOrg ) const; - short GetPossibleParaCount( const std::u16string_view& rLambdaFormula ) const; + short GetPossibleParaCount( std::u16string_view rLambdaFormula ) const; virtual void SetError(FormulaError nError) override; diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx index b24072714cb5..b58bee67cb88 100644 --- a/sc/qa/unit/helper/qahelper.cxx +++ b/sc/qa/unit/helper/qahelper.cxx @@ -290,7 +290,7 @@ void ScModelTestBase::goToCell(const OUString& rCell) dispatchCommand(mxComponent, u".uno:GoToCell"_ustr, aArgs); } -void ScModelTestBase::typeString(const std::u16string_view& rStr) +void ScModelTestBase::typeString(std::u16string_view rStr) { ScModelObj* pModelObj = comphelper::getFromUnoTunnel(mxComponent); for (const char16_t c : rStr) @@ -301,7 +301,7 @@ void ScModelTestBase::typeString(const std::u16string_view& rStr) } } -void ScModelTestBase::insertStringToCell(const OUString& rCell, const std::u16string_view& rStr) +void ScModelTestBase::insertStringToCell(const OUString& rCell, std::u16string_view rStr) { goToCell(rCell); @@ -313,7 +313,7 @@ void ScModelTestBase::insertStringToCell(const OUString& rCell, const std::u16st Scheduler::ProcessEventsToIdle(); } -void ScModelTestBase::insertArrayToCell(const OUString& rCell, const std::u16string_view& rStr) +void ScModelTestBase::insertArrayToCell(const OUString& rCell, std::u16string_view rStr) { goToCell(rCell); diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx index 6eeb111ad25b..a2d46916a521 100644 --- a/sc/qa/unit/helper/qahelper.hxx +++ b/sc/qa/unit/helper/qahelper.hxx @@ -179,9 +179,9 @@ public: void testFormats(ScDocument* pDoc,std::u16string_view sFormat); void goToCell(const OUString& rCell); - void typeString(const std::u16string_view& rStr); - void insertStringToCell(const OUString& rCell, const std::u16string_view& rStr); - void insertArrayToCell(const OUString& rCell, const std::u16string_view& rStr); + void typeString(std::u16string_view rStr); + void insertStringToCell(const OUString& rCell, std::u16string_view rStr); + void insertArrayToCell(const OUString& rCell, std::u16string_view rStr); void insertNewSheet(ScDocument& rDoc); void executeAutoSum(); diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 2425b311844c..8b5c948e9779 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -4412,7 +4412,7 @@ bool ScCompiler::ToUpperAsciiOrI18nIsAscii( OUString& rUpper, const OUString& rO } } -short ScCompiler::GetPossibleParaCount( const std::u16string_view& rLambdaFormula ) const +short ScCompiler::GetPossibleParaCount( std::u16string_view rLambdaFormula ) const { sal_Unicode cSep = mxSymbols->getSymbolChar(ocSep); sal_Unicode cOpen = mxSymbols->getSymbolChar(ocOpen); diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx index d99098edd6fb..a66c008f4db4 100644 --- a/sd/qa/unit/uiimpress.cxx +++ b/sd/qa/unit/uiimpress.cxx @@ -72,9 +72,9 @@ public: } void checkCurrentPageNumber(sal_uInt16 nNum); - void typeString(SdXImpressDocument* rImpressDocument, const std::u16string_view& rStr); + void typeString(SdXImpressDocument* rImpressDocument, std::u16string_view rStr); void typeKey(SdXImpressDocument* rImpressDocument, const sal_uInt16 nKey); - void insertStringToObject(sal_uInt16 nObj, const std::u16string_view& rStr, bool bUseEscape); + void insertStringToObject(sal_uInt16 nObj, std::u16string_view rStr, bool bUseEscape); sd::slidesorter::SlideSorterViewShell* getSlideSorterViewShell(); void lcl_search(const OUString& rKey, bool bFindAll = false, bool bBackwards = false); }; @@ -98,8 +98,7 @@ void SdUiImpressTest::typeKey(SdXImpressDocument* rImpressDocument, const sal_uI Scheduler::ProcessEventsToIdle(); } -void SdUiImpressTest::typeString(SdXImpressDocument* rImpressDocument, - const std::u16string_view& rStr) +void SdUiImpressTest::typeString(SdXImpressDocument* rImpressDocument, std::u16string_view rStr) { for (const char16_t c : rStr) { @@ -109,7 +108,7 @@ void SdUiImpressTest::typeString(SdXImpressDocument* rImpressDocument, } } -void SdUiImpressTest::insertStringToObject(sal_uInt16 nObj, const std::u16string_view& rStr, +void SdUiImpressTest::insertStringToObject(sal_uInt16 nObj, std::u16string_view rStr, bool bUseEscape) { auto pImpressDocument = dynamic_cast(mxComponent.get()); diff --git a/sw/qa/inc/swmodeltestbase.hxx b/sw/qa/inc/swmodeltestbase.hxx index 3ff243c2c11c..e3d1a895a8b4 100644 --- a/sw/qa/inc/swmodeltestbase.hxx +++ b/sw/qa/inc/swmodeltestbase.hxx @@ -251,7 +251,7 @@ protected: */ xmlDocUniquePtr WrapReqifFromTempFile(); - void emulateTyping(const std::u16string_view& rStr); + void emulateTyping(std::u16string_view rStr); private: void loadURL(OUString const& rURL, const char* pPassword = nullptr); diff --git a/sw/qa/unit/swmodeltestbase.cxx b/sw/qa/unit/swmodeltestbase.cxx index 88156bb58eb0..69aab12a38ba 100644 --- a/sw/qa/unit/swmodeltestbase.cxx +++ b/sw/qa/unit/swmodeltestbase.cxx @@ -488,7 +488,7 @@ xmlDocUniquePtr SwModelTestBase::WrapReqifFromTempFile() return pXmlDoc; } -void SwModelTestBase::emulateTyping(const std::u16string_view& rStr) +void SwModelTestBase::emulateTyping(std::u16string_view rStr) { SwXTextDocument* pTextDoc = getSwTextDoc(); for (const char16_t c : rStr) diff --git a/test/source/a11y/accessibletestbase.cxx b/test/source/a11y/accessibletestbase.cxx index dc34855a3935..692f72a474fc 100644 --- a/test/source/a11y/accessibletestbase.cxx +++ b/test/source/a11y/accessibletestbase.cxx @@ -530,7 +530,7 @@ test::AccessibleTestBase::awaitDialog(const std::u16string_view name, maIdleHandler.Stop(); } - ListenerHelper(const std::u16string_view& name, std::function callback, + ListenerHelper(std::u16string_view name, std::function callback, bool bAutoClose) : mbWaitingForDialog(true) , msName(name) diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx index 04ee85e3c2bf..5a39f691eeea 100644 --- a/vbahelper/source/vbahelper/vbahelper.cxx +++ b/vbahelper/source/vbahelper/vbahelper.cxx @@ -747,7 +747,7 @@ void setOrAppendPropertyValue( uno::Sequence< beans::PropertyValue >& aProp, con pProp[ nLength ].Value = aValue; } -bool executeRunTimeLibrary(const std::u16string_view& rSbRtl_command, SbxArray* pParameters) +bool executeRunTimeLibrary(std::u16string_view rSbRtl_command, SbxArray* pParameters) { StarBASIC* pBasic = dynamic_cast< StarBASIC* >(StarBASIC::GetActiveModule()->GetParent()); if (!pBasic) diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 1cebc8631334..9d9cb7506b14 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -3411,7 +3411,7 @@ lcl_StoreMediaAndGetURL(SvXMLExport & rExport, namespace { -void ExportGraphicPreview(const uno::Reference& xGraphic, SvXMLExport& rExport, const std::u16string_view& rPrefix, const std::u16string_view& rExtension, const OUString& rMimeType) +void ExportGraphicPreview(const uno::Reference& xGraphic, SvXMLExport& rExport, std::u16string_view rPrefix, std::u16string_view rExtension, const OUString& rMimeType) { const bool bExportEmbedded(rExport.getExportFlags() & SvXMLExportFlags::EMBEDDED); diff --git a/xmlsecurity/source/helper/ooxmlsecexporter.cxx b/xmlsecurity/source/helper/ooxmlsecexporter.cxx index 874fc4079c28..f8a870d16860 100644 --- a/xmlsecurity/source/helper/ooxmlsecexporter.cxx +++ b/xmlsecurity/source/helper/ooxmlsecexporter.cxx @@ -94,10 +94,9 @@ bool OOXMLSecExporter::Impl::isOOXMLDenylist(std::u16string_view rStreamName) // Don't attempt to sign other signatures for now. u"/_xmlsignatures" }; // Just check the prefix, as we don't care about the content type part of the stream name. - return std::any_of(vDenylist.begin(), vDenylist.end(), - [&](const std::u16string_view& rLiteral) { - return o3tl::starts_with(rStreamName, rLiteral); - }); + return std::any_of(vDenylist.begin(), vDenylist.end(), [&](std::u16string_view rLiteral) { + return o3tl::starts_with(rStreamName, rLiteral); + }); } bool OOXMLSecExporter::Impl::isOOXMLRelationDenylist(const OUString& rRelationName)