summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-12-28 17:56:40 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-12-29 16:42:33 +0100
commit042033f1e6da22616cb76c8d950c20c9efecbad5 (patch)
tree26b3f1f42d067506f44550b410f3fb9640616a5b /xmloff
parentccfd8e9d09f9ac0a0ea92d0f378391006faaf934 (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 'xmloff')
-rw-r--r--xmloff/inc/txtflde.hxx2
-rw-r--r--xmloff/qa/unit/style.cxx10
-rw-r--r--xmloff/source/core/xmlimp.cxx6
-rw-r--r--xmloff/source/style/xmlnumfi.cxx3
-rw-r--r--xmloff/source/text/XMLTextFrameContext.cxx3
-rw-r--r--xmloff/source/text/txtflde.cxx4
6 files changed, 17 insertions, 11 deletions
diff --git a/xmloff/inc/txtflde.hxx b/xmloff/inc/txtflde.hxx
index 81efbde29629..989d3fb02149 100644
--- a/xmloff/inc/txtflde.hxx
+++ b/xmloff/inc/txtflde.hxx
@@ -405,7 +405,7 @@ private:
/// make reference name for a sequence field
static OUString MakeSequenceRefName(sal_Int16 nSeqNo,
- const OUString& rSeqName);
+ std::u16string_view rSeqName);
std::unique_ptr<XMLPropertyState> pCombinedCharactersPropertyState;
diff --git a/xmloff/qa/unit/style.cxx b/xmloff/qa/unit/style.cxx
index d9511e3e2a8a..1814d4f4f2ce 100644
--- a/xmloff/qa/unit/style.cxx
+++ b/xmloff/qa/unit/style.cxx
@@ -7,6 +7,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include <sal/config.h>
+
+#include <string_view>
+
#include <test/bootstrapfixture.hxx>
#include <unotest/macros_test.hxx>
@@ -27,7 +31,7 @@ public:
void setUp() override;
void tearDown() override;
uno::Reference<lang::XComponent>& getComponent() { return mxComponent; }
- void load(const OUString& rURL);
+ void load(std::u16string_view rURL);
};
void XmloffStyleTest::setUp()
@@ -45,7 +49,7 @@ void XmloffStyleTest::tearDown()
test::BootstrapFixture::tearDown();
}
-void XmloffStyleTest::load(const OUString& rFileName)
+void XmloffStyleTest::load(std::u16string_view rFileName)
{
OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + rFileName;
mxComponent = loadFromDesktop(aURL);
@@ -54,7 +58,7 @@ void XmloffStyleTest::load(const OUString& rFileName)
CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testFillImageBase64)
{
// Load a flat ODG that has base64-encoded bitmap as a fill style.
- load("fill-image-base64.fodg");
+ load(u"fill-image-base64.fodg");
uno::Reference<lang::XMultiServiceFactory> xFactory(getComponent(), uno::UNO_QUERY);
uno::Reference<container::XNameContainer> xBitmaps(
xFactory->createInstance("com.sun.star.drawing.BitmapTable"), uno::UNO_QUERY);
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 9d3b1115f57e..64dccb70abf5 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -1302,7 +1302,7 @@ Reference< XOutputStream > SvXMLImport::GetStreamForGraphicObjectURLFromBase64()
OUString SvXMLImport::ResolveEmbeddedObjectURL(
const OUString& rURL,
- const OUString& rClassId )
+ std::u16string_view rClassId )
{
OUString sRet;
@@ -1311,9 +1311,9 @@ OUString SvXMLImport::ResolveEmbeddedObjectURL(
if ( mxEmbeddedResolver.is() )
{
OUString sURL( rURL );
- if( !rClassId.isEmpty() )
+ if( !rClassId.empty() )
{
- sURL += "!" + rClassId;
+ sURL += OUString::Concat("!") + rClassId;
}
sRet = mxEmbeddedResolver->resolveEmbeddedObjectURL( sURL );
}
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index e513e1e34be2..1e54872ada83 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -43,6 +43,7 @@
#include <xmloff/languagetagodf.hxx>
#include <memory>
+#include <string_view>
#include <vector>
using namespace ::com::sun::star;
@@ -1212,7 +1213,7 @@ SvXMLNumFormatContext::SvXMLNumFormatContext( SvXMLImport& rImport,
return;
LanguageTag aLanguageTag( OUString(), aNatNumAttr.Locale.Language,
- OUString(), aNatNumAttr.Locale.Country);
+ std::u16string_view(), aNatNumAttr.Locale.Country);
aNatNumAttr.Locale = aLanguageTag.getLocale( false);
// NatNum12 spell out formula (cardinal, ordinal, ordinal-feminine etc.)
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index d06bc3cde711..fdad9672c099 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -61,6 +61,7 @@
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <basegfx/numeric/ftools.hxx>
#include <map>
+#include <string_view>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -434,7 +435,7 @@ void XMLTextFrameContext_Impl::Create()
else if( !sHRef.isEmpty() )
{
OUString sURL( GetImport().ResolveEmbeddedObjectURL( sHRef,
- OUString() ) );
+ std::u16string_view() ) );
if( GetImport().IsPackageURL( sHRef ) )
{
diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx
index 47dfb71a0bd9..f9c0769ead3e 100644
--- a/xmloff/source/text/txtflde.cxx
+++ b/xmloff/source/text/txtflde.cxx
@@ -3457,10 +3457,10 @@ OUString XMLTextFieldExport::MakeFootnoteRefName(
OUString XMLTextFieldExport::MakeSequenceRefName(
sal_Int16 nSeqNo,
- const OUString& rSeqName)
+ std::u16string_view rSeqName)
{
// generate foot-/endnote ID
- return "ref" +rSeqName + OUString::number(static_cast<sal_Int32>(nSeqNo));
+ return OUString::Concat("ref") +rSeqName + OUString::number(static_cast<sal_Int32>(nSeqNo));
}