diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-12-28 17:56:40 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-12-29 16:42:33 +0100 |
commit | 042033f1e6da22616cb76c8d950c20c9efecbad5 (patch) | |
tree | 26b3f1f42d067506f44550b410f3fb9640616a5b /svx | |
parent | ccfd8e9d09f9ac0a0ea92d0f378391006faaf934 (diff) |
loplugin:stringviewparam: operator +
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/qa/unit/customshapes.cxx | 19 | ||||
-rw-r--r-- | svx/qa/unit/gallery/test_gallery.cxx | 6 | ||||
-rw-r--r-- | svx/qa/unit/sdr.cxx | 2 | ||||
-rw-r--r-- | svx/qa/unit/svx-dialogs-test.cxx | 2 | ||||
-rw-r--r-- | svx/qa/unit/xoutdev.cxx | 2 | ||||
-rw-r--r-- | svx/source/form/fmview.cxx | 2 | ||||
-rw-r--r-- | svx/source/form/fmvwimp.cxx | 4 | ||||
-rw-r--r-- | svx/source/inc/fmvwimp.hxx | 5 | ||||
-rw-r--r-- | svx/source/smarttags/SmartTagMgr.cxx | 7 | ||||
-rw-r--r-- | svx/source/svdraw/svdomedia.cxx | 2 | ||||
-rw-r--r-- | svx/source/xml/xmlgrhlp.cxx | 7 |
11 files changed, 32 insertions, 26 deletions
diff --git a/svx/qa/unit/customshapes.cxx b/svx/qa/unit/customshapes.cxx index e3a5e0ac92a3..fe4e22f0a909 100644 --- a/svx/qa/unit/customshapes.cxx +++ b/svx/qa/unit/customshapes.cxx @@ -90,29 +90,32 @@ sal_uInt8 CustomshapesTest::countShapes() return xDrawPage->getCount(); } -void lcl_AssertRectEqualWithTolerance(const OString& sInfo, const tools::Rectangle& rExpected, +void lcl_AssertRectEqualWithTolerance(std::string_view sInfo, const tools::Rectangle& rExpected, const tools::Rectangle& rActual, const sal_Int32 nTolerance) { // Left - OString sMsg = sInfo + " Left expected " + OString::number(rExpected.Left()) + " actual " - + OString::number(rActual.Left()) + " Tolerance " + OString::number(nTolerance); + OString sMsg = OString::Concat(sInfo) + " Left expected " + OString::number(rExpected.Left()) + + " actual " + OString::number(rActual.Left()) + " Tolerance " + + OString::number(nTolerance); CPPUNIT_ASSERT_MESSAGE(sMsg.getStr(), std::abs(rExpected.Left() - rActual.Left()) <= nTolerance); // Top - sMsg = sInfo + " Top expected " + OString::number(rExpected.Top()) + " actual " + sMsg = OString::Concat(sInfo) + " Top expected " + OString::number(rExpected.Top()) + " actual " + OString::number(rActual.Top()) + " Tolerance " + OString::number(nTolerance); CPPUNIT_ASSERT_MESSAGE(sMsg.getStr(), std::abs(rExpected.Top() - rActual.Top()) <= nTolerance); // Width - sMsg = sInfo + " Width expected " + OString::number(rExpected.GetWidth()) + " actual " - + OString::number(rActual.GetWidth()) + " Tolerance " + OString::number(nTolerance); + sMsg = OString::Concat(sInfo) + " Width expected " + OString::number(rExpected.GetWidth()) + + " actual " + OString::number(rActual.GetWidth()) + " Tolerance " + + OString::number(nTolerance); CPPUNIT_ASSERT_MESSAGE(sMsg.getStr(), std::abs(rExpected.GetWidth() - rActual.GetWidth()) <= nTolerance); // Height - sMsg = sInfo + " Height expected " + OString::number(rExpected.GetHeight()) + " actual " - + OString::number(rActual.GetHeight()) + " Tolerance " + OString::number(nTolerance); + sMsg = OString::Concat(sInfo) + " Height expected " + OString::number(rExpected.GetHeight()) + + " actual " + OString::number(rActual.GetHeight()) + " Tolerance " + + OString::number(nTolerance); CPPUNIT_ASSERT_MESSAGE(sMsg.getStr(), std::abs(rExpected.GetHeight() - rActual.GetHeight()) <= nTolerance); } diff --git a/svx/qa/unit/gallery/test_gallery.cxx b/svx/qa/unit/gallery/test_gallery.cxx index 96bcc16fdc07..641101e11a50 100644 --- a/svx/qa/unit/gallery/test_gallery.cxx +++ b/svx/qa/unit/gallery/test_gallery.cxx @@ -316,7 +316,7 @@ void GalleryObjTest::TestInsertGalleryObject() for (sal_uInt32 i = 0; i < static_cast<sal_uInt32>(imageList.size()); i++) { OUString imageNameFromList(imageList[i]); - OUString aURL(m_directories.getURLFromSrc("/svx/qa/unit/gallery/data/") + OUString aURL(m_directories.getURLFromSrc(u"/svx/qa/unit/gallery/data/") + imageNameFromList); CPPUNIT_ASSERT_MESSAGE("Could not insert object into theme", pGalleryTheme->InsertURL(INetURLObject(aURL))); @@ -361,7 +361,7 @@ void GalleryObjTest::TestRemoveGalleryObject() for (sal_uInt32 i = 0; i < static_cast<sal_uInt32>(imageList.size()); i++) { OUString imageNameFromList(imageList[i]); - OUString aURL(m_directories.getURLFromSrc("/svx/qa/unit/gallery/data/") + OUString aURL(m_directories.getURLFromSrc(u"/svx/qa/unit/gallery/data/") + imageNameFromList); CPPUNIT_ASSERT_MESSAGE("Could not insert object into theme", pGalleryTheme->InsertURL(INetURLObject(aURL))); @@ -416,7 +416,7 @@ void GalleryObjTest::TestChangePositionGalleryObject() for (sal_uInt32 i = 0; i < (sizeof(imageList) / sizeof(imageList[0])); i++) { OUString imageNameFromList(imageList[i]); - OUString aURL(m_directories.getURLFromSrc("/svx/qa/unit/gallery/data/") + OUString aURL(m_directories.getURLFromSrc(u"/svx/qa/unit/gallery/data/") + imageNameFromList); CPPUNIT_ASSERT_MESSAGE("Could not insert object into theme", pGalleryTheme->InsertURL(INetURLObject(aURL))); diff --git a/svx/qa/unit/sdr.cxx b/svx/qa/unit/sdr.cxx index b087e1144ba8..49f4baa7182c 100644 --- a/svx/qa/unit/sdr.cxx +++ b/svx/qa/unit/sdr.cxx @@ -57,7 +57,7 @@ CPPUNIT_TEST_FIXTURE(SdrTest, testShadowScaleOrigin) { // Load a document containing a custom shape. test::Directories aDirectories; - OUString aURL = aDirectories.getURLFromSrc("svx/qa/unit/data/shadow-scale-origin.pptx"); + OUString aURL = aDirectories.getURLFromSrc(u"svx/qa/unit/data/shadow-scale-origin.pptx"); getComponent() = loadFromDesktop(aURL); uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier(getComponent(), uno::UNO_QUERY); uno::Reference<drawing::XDrawPage> xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0), diff --git a/svx/qa/unit/svx-dialogs-test.cxx b/svx/qa/unit/svx-dialogs-test.cxx index 0a182e7fb026..32c632c991cf 100644 --- a/svx/qa/unit/svx-dialogs-test.cxx +++ b/svx/qa/unit/svx-dialogs-test.cxx @@ -48,7 +48,7 @@ VclPtr<VclAbstractDialog> SvxDialogsTest::createDialogByID(sal_uInt32 /*nID*/) { void SvxDialogsTest::openAnyDialog() { /// process input file containing the UXMLDescriptions of the dialogs to dump - processDialogBatchFile("svx/qa/unit/data/svx-dialogs-test.txt"); + processDialogBatchFile(u"svx/qa/unit/data/svx-dialogs-test.txt"); } CPPUNIT_TEST_SUITE_REGISTRATION(SvxDialogsTest); diff --git a/svx/qa/unit/xoutdev.cxx b/svx/qa/unit/xoutdev.cxx index 0b5148b393d5..f422b5141705 100644 --- a/svx/qa/unit/xoutdev.cxx +++ b/svx/qa/unit/xoutdev.cxx @@ -39,7 +39,7 @@ CPPUNIT_TEST_FIXTURE(XOutdevTest, testPdfGraphicExport) // Import the graphic. Graphic aGraphic; test::Directories aDirectories; - OUString aURL = aDirectories.getURLFromSrc("svx/qa/unit/data/graphic.pdf"); + OUString aURL = aDirectories.getURLFromSrc(u"svx/qa/unit/data/graphic.pdf"); SvFileStream aStream(aURL, StreamMode::READ); CPPUNIT_ASSERT_EQUAL(ERRCODE_NONE, GraphicFilter::GetGraphicFilter().ImportGraphic(aGraphic, aURL, aStream)); diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx index aec343857f75..34e3f228cbb4 100644 --- a/svx/source/form/fmview.cxx +++ b/svx/source/form/fmview.cxx @@ -555,7 +555,7 @@ void FmFormView::createControlLabelPair( OutputDevice const * _pOutDev, sal_Int3 FmXFormView::createControlLabelPair( *_pOutDev, _nXOffsetMM, _nYOffsetMM, _rxField, _rxNumberFormats, - _nControlObjectID, "", _nInventor, _nLabelObjectID, + _nControlObjectID, u"", _nInventor, _nLabelObjectID, _rModel, _rpLabel, _rpControl ); diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx index 148eba130028..f197548cad70 100644 --- a/svx/source/form/fmvwimp.cxx +++ b/svx/source/form/fmvwimp.cxx @@ -1471,7 +1471,7 @@ SdrObjectUniquePtr FmXFormView::implCreateXFormsControl( const svx::OXFormsDescr bool FmXFormView::createControlLabelPair( OutputDevice const & _rOutDev, sal_Int32 _nXOffsetMM, sal_Int32 _nYOffsetMM, const Reference< XPropertySet >& _rxField, const Reference< XNumberFormats >& _rxNumberFormats, - SdrObjKind _nControlObjectID, const OUString& _rFieldPostfix, + SdrObjKind _nControlObjectID, std::u16string_view _rFieldPostfix, std::unique_ptr<SdrUnoObj, SdrObjectFreeOp>& _rpLabel, std::unique_ptr<SdrUnoObj, SdrObjectFreeOp>& _rpControl, const Reference< XDataSource >& _rxDataSource, const OUString& _rDataSourceName, @@ -1517,7 +1517,7 @@ bool FmXFormView::createControlLabelPair( OutputDevice const & _rOutDev, sal_Int bool FmXFormView::createControlLabelPair( OutputDevice const & _rOutDev, sal_Int32 _nXOffsetMM, sal_Int32 _nYOffsetMM, const Reference< XPropertySet >& _rxField, const Reference< XNumberFormats >& _rxNumberFormats, SdrObjKind _nControlObjectID, - const OUString& _rFieldPostfix, SdrInventor _nInventor, SdrObjKind _nLabelObjectID, + std::u16string_view _rFieldPostfix, SdrInventor _nInventor, SdrObjKind _nLabelObjectID, SdrModel& _rModel, std::unique_ptr<SdrUnoObj, SdrObjectFreeOp>& _rpLabel, std::unique_ptr<SdrUnoObj, SdrObjectFreeOp>& _rpControl) { diff --git a/svx/source/inc/fmvwimp.hxx b/svx/source/inc/fmvwimp.hxx index 3a1f254d51e5..36f1dcda1883 100644 --- a/svx/source/inc/fmvwimp.hxx +++ b/svx/source/inc/fmvwimp.hxx @@ -24,6 +24,7 @@ #include <map> #include <memory> #include <set> +#include <string_view> #include <svx/svdmark.hxx> #include <svx/svdobj.hxx> @@ -249,7 +250,7 @@ private: const css::uno::Reference< css::beans::XPropertySet >& _rxField, const css::uno::Reference< css::util::XNumberFormats >& _rxNumberFormats, SdrObjKind _nControlObjectID, - const OUString& _rFieldPostfix, + std::u16string_view _rFieldPostfix, SdrInventor _nInventor, SdrObjKind _nLabelObjectID, @@ -268,7 +269,7 @@ private: const css::uno::Reference< css::beans::XPropertySet >& _rxField, const css::uno::Reference< css::util::XNumberFormats >& _rxNumberFormats, SdrObjKind _nControlObjectID, - const OUString& _rFieldPostfix, + std::u16string_view _rFieldPostfix, std::unique_ptr<SdrUnoObj, SdrObjectFreeOp>& _rpLabel, std::unique_ptr<SdrUnoObj, SdrObjectFreeOp>& _rpControl, const css::uno::Reference< css::sdbc::XDataSource >& _rxDataSource, diff --git a/svx/source/smarttags/SmartTagMgr.cxx b/svx/source/smarttags/SmartTagMgr.cxx index 8d82643c82aa..4733a466663d 100644 --- a/svx/source/smarttags/SmartTagMgr.cxx +++ b/svx/source/smarttags/SmartTagMgr.cxx @@ -61,7 +61,7 @@ SmartTagMgr::~SmartTagMgr() { } -void SmartTagMgr::Init( const OUString& rConfigurationGroupName ) +void SmartTagMgr::Init( std::u16string_view rConfigurationGroupName ) { PrepareConfiguration( rConfigurationGroupName ); ReadConfiguration( true, true ); @@ -372,9 +372,10 @@ void SmartTagMgr::LoadLibraries() } -void SmartTagMgr::PrepareConfiguration( const OUString& rConfigurationGroupName ) +void SmartTagMgr::PrepareConfiguration( std::u16string_view rConfigurationGroupName ) { - Any aAny = makeAny( "/org.openoffice.Office.Common/SmartTags/" + rConfigurationGroupName ); + Any aAny = makeAny( + OUString::Concat("/org.openoffice.Office.Common/SmartTags/") + rConfigurationGroupName ); beans::PropertyValue aPathArgument; aPathArgument.Name = "nodepath"; aPathArgument.Value = aAny; diff --git a/svx/source/svdraw/svdomedia.cxx b/svx/source/svdraw/svdomedia.cxx index 42c7a6c59c8d..47e30a1049ac 100644 --- a/svx/source/svdraw/svdomedia.cxx +++ b/svx/source/svdraw/svdomedia.cxx @@ -268,7 +268,7 @@ void SdrMediaObj::SetInputStream(uno::Reference<io::XInputStream> const& xStream ::avmedia::CreateMediaTempFile( xStream, tempFileURL, - "")); + u"")); if (bSuccess) { diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index 7adb1981a738..cefa978ff29b 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -48,6 +48,7 @@ #include <algorithm> #include <memory> +#include <string_view> #include <utility> using namespace com::sun::star; @@ -608,11 +609,11 @@ OUString SAL_CALL SvXMLGraphicHelper::saveGraphicByName(css::uno::Reference<css: OUString SAL_CALL SvXMLGraphicHelper::saveGraphic(css::uno::Reference<css::graphic::XGraphic> const & rxGraphic) { OUString aOutMimeType; - return implSaveGraphic(rxGraphic, aOutMimeType, OUString()); + return implSaveGraphic(rxGraphic, aOutMimeType, std::u16string_view()); } OUString SvXMLGraphicHelper::implSaveGraphic(css::uno::Reference<css::graphic::XGraphic> const & rxGraphic, - OUString & rOutSavedMimeType, OUString const & rRequestName) + OUString & rOutSavedMimeType, std::u16string_view rRequestName) { Graphic aGraphic(rxGraphic); @@ -697,7 +698,7 @@ OUString SvXMLGraphicHelper::implSaveGraphic(css::uno::Reference<css::graphic::X } OUString rPictureStreamName; - if (!rRequestName.isEmpty()) + if (!rRequestName.empty()) { rPictureStreamName = rRequestName + aExtension; } |