summaryrefslogtreecommitdiff
path: root/svtools/source/svhtml
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-12-11 17:44:34 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-12-11 21:25:10 +0100
commit35e471bb4d1388cf5afcdcee214cf5111edf44e3 (patch)
treebb78f4f13f131f0cb206a9707cc3cfc495a3876a /svtools/source/svhtml
parent0c06e77c122f10a1842bc908bd6e25b1110ddbd2 (diff)
Adapt the remaining OUString functions to std string_view
...for LIBO_INTERNAL_ONLY. These had been missed by 1b43cceaea2084a0489db68cd0113508f34b6643 "Make many OUString functions take std::u16string_view parameters" because they did not match the multi-overload pattern that was addressed there, but they nevertheless benefit from being changed just as well (witness e.g. the various resulting changes from copy() to subView()). This showed a conversion from OStringChar to std::string_view to be missing (while the corresponding conversion form OUStringChar to std::u16string_view was already present). The improvement to loplugin:stringadd became necessary to fix > [CPT] compilerplugins/clang/test/stringadd.cxx > error: 'error' diagnostics expected but not seen: > File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 43 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:42): simplify by merging with the preceding assignment [loplugin:stringadd] > File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 61 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:60): simplify by merging with the preceding assignment [loplugin:stringadd] > 2 errors generated. Change-Id: Ie40de0616a66e60e289c1af0ca60aed6f9ecc279 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107602 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'svtools/source/svhtml')
-rw-r--r--svtools/source/svhtml/HtmlWriter.cxx2
-rw-r--r--svtools/source/svhtml/htmlout.cxx6
2 files changed, 4 insertions, 4 deletions
diff --git a/svtools/source/svhtml/HtmlWriter.cxx b/svtools/source/svhtml/HtmlWriter.cxx
index 7414b40b15b5..ce398757b0d2 100644
--- a/svtools/source/svhtml/HtmlWriter.cxx
+++ b/svtools/source/svhtml/HtmlWriter.cxx
@@ -131,7 +131,7 @@ void HtmlWriter::attribute(const OString& aAttribute, const char* pValue)
attribute(aAttribute, OString(pValue));
}
-void HtmlWriter::attribute(const OString& aAttribute, const OUString& aValue)
+void HtmlWriter::attribute(const OString& aAttribute, std::u16string_view aValue)
{
attribute(aAttribute, OUStringToOString(aValue, RTL_TEXTENCODING_UTF8));
}
diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx
index 24ce5b50b98e..c148f49dc92f 100644
--- a/svtools/source/svhtml/htmlout.cxx
+++ b/svtools/source/svhtml/htmlout.cxx
@@ -789,7 +789,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
SvStream& HTMLOutFuncs::OutScript( SvStream& rStrm,
const OUString& rBaseURL,
- const OUString& rSource,
+ std::u16string_view rSource,
const OUString& rLanguage,
ScriptType eScriptType,
const OUString& rSrc,
@@ -846,7 +846,7 @@ SvStream& HTMLOutFuncs::OutScript( SvStream& rStrm,
rStrm.WriteOString( sOut.makeStringAndClear() );
- if( !rSource.isEmpty() || pSBLibrary || pSBModule )
+ if( !rSource.empty() || pSBLibrary || pSBModule )
{
rStrm.WriteCharPtr( SAL_NEWLINE_STRING );
@@ -877,7 +877,7 @@ SvStream& HTMLOutFuncs::OutScript( SvStream& rStrm,
}
}
- if( !rSource.isEmpty() )
+ if( !rSource.empty() )
{
// we write the module in ANSI-charset, but with
// the system new line.