From 042033f1e6da22616cb76c8d950c20c9efecbad5 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 28 Dec 2020 17:56:40 +0100 Subject: loplugin:stringviewparam: operator + Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- test/source/bootstrapfixture.cxx | 8 ++++---- test/source/helper/form.cxx | 11 ++++++----- test/source/helper/shape.cxx | 16 ++++++++-------- test/source/screenshot_test.cxx | 2 +- test/source/unoapi_test.cxx | 2 +- test/source/view/xcontrolaccess.cxx | 2 +- test/source/xmltesttools.cxx | 2 +- 7 files changed, 22 insertions(+), 21 deletions(-) (limited to 'test/source') diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx index c04729376b1e..5116ac32115a 100644 --- a/test/source/bootstrapfixture.cxx +++ b/test/source/bootstrapfixture.cxx @@ -174,13 +174,13 @@ void test::BootstrapFixture::validate(const OUString& rPath, test::ValidationFor // invoke without -e so that we know when something new is written // in loext namespace that isn't yet in the custom schema aValidator += " -M " - + m_directories.getPathFromSrc("/schema/libreoffice/OpenDocument-manifest-schema-v1.3+libreoffice.rng") + + m_directories.getPathFromSrc(u"/schema/libreoffice/OpenDocument-manifest-schema-v1.3+libreoffice.rng") + " -D " - + m_directories.getPathFromSrc("/schema/libreoffice/OpenDocument-dsig-schema-v1.3+libreoffice.rng") + + m_directories.getPathFromSrc(u"/schema/libreoffice/OpenDocument-dsig-schema-v1.3+libreoffice.rng") + " -O " - + m_directories.getPathFromSrc("/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng") + + m_directories.getPathFromSrc(u"/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng") + " -m " - + m_directories.getPathFromSrc("/schema/mathml2/mathml2.xsd"); + + m_directories.getPathFromSrc(u"/schema/mathml2/mathml2.xsd"); } utl::TempFile aOutput; diff --git a/test/source/helper/form.cxx b/test/source/helper/form.cxx index 77e6b163524c..c610070a1372 100644 --- a/test/source/helper/form.cxx +++ b/test/source/helper/form.cxx @@ -29,11 +29,11 @@ uno::Reference const sal_Int32 nX, const sal_Int32 nY, const sal_Int32 nHeight, const sal_Int32 nWidth) { - return createControlShape(r_xComponent, "CommandButton", nX, nY, nHeight, nWidth); + return createControlShape(r_xComponent, u"CommandButton", nX, nY, nHeight, nWidth); } uno::Reference OOO_DLLPUBLIC_TEST createControlShape( - const uno::Reference& r_xComponent, const OUString& r_aKind, + const uno::Reference& r_xComponent, std::u16string_view r_aKind, const sal_Int32 nX, const sal_Int32 nY, const sal_Int32 nHeight, const sal_Int32 nWidth) { uno::Reference xMSF(r_xComponent, uno::UNO_QUERY_THROW); @@ -42,10 +42,11 @@ uno::Reference OOO_DLLPUBLIC_TEST createControlShape( xMSF->createInstance("com.sun.star.drawing.ControlShape"), uno::UNO_QUERY_THROW); uno::Reference aComponent( - xMSF->createInstance("com.sun.star.form.component." + r_aKind), uno::UNO_SET_THROW); + xMSF->createInstance(OUString::Concat("com.sun.star.form.component.") + r_aKind), + uno::UNO_SET_THROW); uno::Reference xPropertySet(aComponent, uno::UNO_QUERY_THROW); - xPropertySet->setPropertyValue("DefaultControl", - uno::makeAny("com.sun.star.form.control." + r_aKind)); + xPropertySet->setPropertyValue( + "DefaultControl", uno::makeAny(OUString::Concat("com.sun.star.form.control.") + r_aKind)); uno::Reference xControlModel(aComponent, uno::UNO_QUERY_THROW); xControlShape->setSize(awt::Size(nHeight, nWidth)); diff --git a/test/source/helper/shape.cxx b/test/source/helper/shape.cxx index 4fafcc0c7e48..0fbc3bc6d3a3 100644 --- a/test/source/helper/shape.cxx +++ b/test/source/helper/shape.cxx @@ -26,7 +26,7 @@ uno::Reference const sal_Int32 nX, const sal_Int32 nY, const sal_Int32 nWidth, const sal_Int32 nHeight) { - return createShape(r_xComponent, "Ellipse", nX, nY, nWidth, nHeight); + return createShape(r_xComponent, u"Ellipse", nX, nY, nWidth, nHeight); } uno::Reference @@ -34,7 +34,7 @@ uno::Reference const sal_Int32 nX, const sal_Int32 nY, const sal_Int32 nWidth, const sal_Int32 nHeight) { - return createShape(r_xComponent, "Line", nX, nY, nWidth, nHeight); + return createShape(r_xComponent, u"Line", nX, nY, nWidth, nHeight); } uno::Reference @@ -42,17 +42,17 @@ uno::Reference const sal_Int32 nX, const sal_Int32 nY, const sal_Int32 nWidth, const sal_Int32 nHeight) { - return createShape(r_xComponent, "Rectangle", nX, nY, nWidth, nHeight); + return createShape(r_xComponent, u"Rectangle", nX, nY, nWidth, nHeight); } -uno::Reference - OOO_DLLPUBLIC_TEST createShape(const uno::Reference& r_xComponent, - const OUString& r_aKind, const sal_Int32 nX, const sal_Int32 nY, - const sal_Int32 nWidth, const sal_Int32 nHeight) +uno::Reference OOO_DLLPUBLIC_TEST +createShape(const uno::Reference& r_xComponent, std::u16string_view r_aKind, + const sal_Int32 nX, const sal_Int32 nY, const sal_Int32 nWidth, const sal_Int32 nHeight) { uno::Reference xMSF(r_xComponent, uno::UNO_QUERY_THROW); uno::Reference xShape( - xMSF->createInstance("com.sun.star.drawing." + r_aKind + "Shape"), uno::UNO_QUERY_THROW); + xMSF->createInstance(OUString::Concat("com.sun.star.drawing.") + r_aKind + "Shape"), + uno::UNO_QUERY_THROW); try { diff --git a/test/source/screenshot_test.cxx b/test/source/screenshot_test.cxx index a99b01d37c2f..a79d53a0d87a 100644 --- a/test/source/screenshot_test.cxx +++ b/test/source/screenshot_test.cxx @@ -242,7 +242,7 @@ void ScreenshotTest::processAllKnownDialogs() } } -void ScreenshotTest::processDialogBatchFile(const OUString& rFile) +void ScreenshotTest::processDialogBatchFile(std::u16string_view rFile) { test::Directories aDirectories; const OUString aURL(aDirectories.getURLFromSrc(rFile)); diff --git a/test/source/unoapi_test.cxx b/test/source/unoapi_test.cxx index 6147609f3f42..50d0ff562fc9 100644 --- a/test/source/unoapi_test.cxx +++ b/test/source/unoapi_test.cxx @@ -30,7 +30,7 @@ void UnoApiTest::setUp() CPPUNIT_ASSERT_MESSAGE("no desktop!", mxDesktop.is()); } -void UnoApiTest::createFileURL(const OUString& aFileBase, OUString& rFilePath) +void UnoApiTest::createFileURL(std::u16string_view aFileBase, OUString& rFilePath) { rFilePath = m_directories.getSrcRootURL() + m_aBaseString + "/" + aFileBase; } diff --git a/test/source/view/xcontrolaccess.cxx b/test/source/view/xcontrolaccess.cxx index 1e7583f2b137..43a98c9c868c 100644 --- a/test/source/view/xcontrolaccess.cxx +++ b/test/source/view/xcontrolaccess.cxx @@ -39,7 +39,7 @@ void XControlAccess::testGetControl() uno::Reference xShapes(xDP, uno::UNO_QUERY_THROW); uno::Reference xShape( - helper::form::createControlShape(xComponent, "CommandButton", 10000, 50000, 100, 100), + helper::form::createControlShape(xComponent, u"CommandButton", 10000, 50000, 100, 100), uno::UNO_QUERY_THROW); xShapes->add(xShape); diff --git a/test/source/xmltesttools.cxx b/test/source/xmltesttools.cxx index c1d03cd41fe7..16226a2e8845 100644 --- a/test/source/xmltesttools.cxx +++ b/test/source/xmltesttools.cxx @@ -251,7 +251,7 @@ void XmlTestTools::assertXPathNoAttribute(const xmlDocUniquePtr& pXmlDoc, const xmlXPathFreeObject(pXmlObj); } -int XmlTestTools::getXPathPosition(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath, const OString& rChildName) +int XmlTestTools::getXPathPosition(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath, std::string_view rChildName) { xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, rXPath); xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; -- cgit