summaryrefslogtreecommitdiff
path: root/svtools
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 /svtools
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 'svtools')
-rw-r--r--svtools/qa/unit/svtools-dialogs-test.cxx2
-rw-r--r--svtools/qa/unit/testHtmlReader.cxx2
-rw-r--r--svtools/source/config/extcolorcfg.cxx9
-rw-r--r--svtools/source/dialogs/prnsetup.cxx6
-rw-r--r--svtools/source/misc/langtab.cxx8
-rw-r--r--svtools/source/svhtml/HtmlWriter.cxx6
-rw-r--r--svtools/source/svhtml/parhtml.cxx4
7 files changed, 23 insertions, 14 deletions
diff --git a/svtools/qa/unit/svtools-dialogs-test.cxx b/svtools/qa/unit/svtools-dialogs-test.cxx
index 85537fc42572..974cf5347cbd 100644
--- a/svtools/qa/unit/svtools-dialogs-test.cxx
+++ b/svtools/qa/unit/svtools-dialogs-test.cxx
@@ -51,7 +51,7 @@ VclPtr<VclAbstractDialog> SvtoolsDialogsTest::createDialogByID(sal_uInt32 /*nID*
void SvtoolsDialogsTest::openAnyDialog()
{
/// process input file containing the UXMLDescriptions of the dialogs to dump
- processDialogBatchFile("svtools/qa/unit/data/svtools-dialogs-test.txt");
+ processDialogBatchFile(u"svtools/qa/unit/data/svtools-dialogs-test.txt");
}
CPPUNIT_TEST_SUITE_REGISTRATION(SvtoolsDialogsTest);
diff --git a/svtools/qa/unit/testHtmlReader.cxx b/svtools/qa/unit/testHtmlReader.cxx
index 4e5638cc59b7..146458a200eb 100644
--- a/svtools/qa/unit/testHtmlReader.cxx
+++ b/svtools/qa/unit/testHtmlReader.cxx
@@ -70,7 +70,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLineBreak)
aStream.Seek(0);
tools::SvRef<TestHTMLParser> xParser = new TestHTMLParser(aStream);
- xParser->SetNamespace("reqif-xhtml");
+ xParser->SetNamespace(u"reqif-xhtml");
xParser->CallParser();
// This was 2, <br></br> was interpreted as 2 line breaks in XHTML mode.
diff --git a/svtools/source/config/extcolorcfg.cxx b/svtools/source/config/extcolorcfg.cxx
index 707047f8b535..397d83b1cf94 100644
--- a/svtools/source/config/extcolorcfg.cxx
+++ b/svtools/source/config/extcolorcfg.cxx
@@ -20,6 +20,7 @@
#include <sal/config.h>
#include <map>
+#include <string_view>
#include <svtools/extcolorcfg.hxx>
#include <com/sun/star/uno/Any.hxx>
@@ -85,7 +86,7 @@ public:
void CommitCurrentSchemeName();
//changes the name of the current scheme but doesn't load it!
void SetCurrentSchemeName(const OUString& rSchemeName) {m_sLoadedScheme = rSchemeName;}
- bool ExistsScheme(const OUString& _sSchemeName);
+ bool ExistsScheme(std::u16string_view _sSchemeName);
virtual void Notify( const uno::Sequence<OUString>& aPropertyNames) override;
sal_Int32 GetComponentCount() const;
@@ -290,7 +291,7 @@ void ExtendedColorConfig_Impl::Load(const OUString& rScheme)
if ( sScheme != "default" )
{
- if ( ExistsScheme("default") )
+ if ( ExistsScheme(u"default") )
{
aComponentNames = GetPropertyNames("ExtendedColorScheme/ColorSchemes/default");
FillComponentColors(aComponentNames,aDisplayNameMap);
@@ -426,12 +427,12 @@ void ExtendedColorConfig_Impl::CommitCurrentSchemeName()
PutProperties(aCurrent, aCurrentVal);
}
-bool ExtendedColorConfig_Impl::ExistsScheme(const OUString& _sSchemeName)
+bool ExtendedColorConfig_Impl::ExistsScheme(std::u16string_view _sSchemeName)
{
OUString sBase("ExtendedColorScheme/ColorSchemes");
uno::Sequence < OUString > aComponentNames = GetPropertyNames(sBase);
- sBase += "/" + _sSchemeName;
+ sBase += OUString::Concat("/") + _sSchemeName;
return comphelper::findValue(aComponentNames, sBase) != -1;
}
diff --git a/svtools/source/dialogs/prnsetup.cxx b/svtools/source/dialogs/prnsetup.cxx
index 6b95d7fb1bb7..054a7b0f077d 100644
--- a/svtools/source/dialogs/prnsetup.cxx
+++ b/svtools/source/dialogs/prnsetup.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <string_view>
+
#include <svtools/prnsetup.hxx>
#include <svtools/strings.hrc>
#include <svtools/svtresid.hxx>
@@ -121,7 +125,7 @@ void ImplPrnDlgUpdateQueueInfo( const weld::ComboBox* pBox, QueueInfo& rInfo )
}
-static OUString ImplPrnDlgAddString(const OUString& rStr, const OUString& rAddStr)
+static OUString ImplPrnDlgAddString(const OUString& rStr, std::u16string_view rAddStr)
{
OUString aStr(rStr);
if (!aStr.isEmpty())
diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index c8479d92445b..7bd30f365158 100644
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <string_view>
+
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/i18n/DirectionProperty.hpp>
#include <com/sun/star/uno/Sequence.hxx>
@@ -152,7 +156,7 @@ OUString ApplyLreOrRleEmbedding( const OUString &rText )
return aRes;
}
-static OUString lcl_getDescription( const OUString& rBcp47 )
+static OUString lcl_getDescription( std::u16string_view rBcp47 )
{
// Place in curly brackets, so all on-the-fly tags are grouped together at
// the top of a listbox (but behind the "[None]" entry), and not sprinkled
@@ -161,7 +165,7 @@ static OUString lcl_getDescription( const OUString& rBcp47 )
/* TODO: pulling descriptive names (language, script, country, subtags)
* from liblangtag or ISO databases might be nice, but those are English
* only. Maybe ICU, that has translations for language and country. */
- return "{" + rBcp47 + "}";
+ return OUString::Concat("{") + rBcp47 + "}";
}
SvtLanguageTableImpl::SvtLanguageTableImpl()
diff --git a/svtools/source/svhtml/HtmlWriter.cxx b/svtools/source/svhtml/HtmlWriter.cxx
index ce398757b0d2..dd2f40c6d16f 100644
--- a/svtools/source/svhtml/HtmlWriter.cxx
+++ b/svtools/source/svhtml/HtmlWriter.cxx
@@ -11,16 +11,16 @@
#include <svtools/HtmlWriter.hxx>
#include <tools/stream.hxx>
-HtmlWriter::HtmlWriter(SvStream& rStream, const OString& rNamespace) :
+HtmlWriter::HtmlWriter(SvStream& rStream, std::string_view rNamespace) :
mrStream(rStream),
mbElementOpen(false),
mbCharactersWritten(false),
mbPrettyPrint(true)
{
- if (!rNamespace.isEmpty())
+ if (!rNamespace.empty())
{
// Convert namespace alias to a prefix.
- maNamespace = rNamespace + ":";
+ maNamespace = OString::Concat(rNamespace) + ":";
}
}
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx
index 76791dc5abcd..be66cc8b6ac8 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -238,10 +238,10 @@ HTMLParser::~HTMLParser()
{
}
-void HTMLParser::SetNamespace(const OUString& rNamespace)
+void HTMLParser::SetNamespace(std::u16string_view rNamespace)
{
// Convert namespace alias to a prefix.
- maNamespace = rNamespace + ":";
+ maNamespace = OUString::Concat(rNamespace) + ":";
}
namespace