summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-15 12:25:12 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-04-19 18:31:10 +0200
commitab699bfdb3375f7142a50cc35322e2924c9e5945 (patch)
tree8f935378a1ee272f4316a50f902e214d50ce8cc6 /desktop/source
parentf393785a146433cccd5bbecf1e49b5f1485ec5a7 (diff)
new loplugin:stringviewvar looks for OUString vars that can be
... that can be string_view Change-Id: I0ddf66725e08b58e866a764f57200dd188b9f639 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133066 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/deployment/misc/dp_platform.cxx8
-rw-r--r--desktop/source/lib/init.cxx18
-rw-r--r--desktop/source/migration/migration.cxx4
3 files changed, 15 insertions, 15 deletions
diff --git a/desktop/source/deployment/misc/dp_platform.cxx b/desktop/source/deployment/misc/dp_platform.cxx
index 90dee4a6d1c2..879e617b7258 100644
--- a/desktop/source/deployment/misc/dp_platform.cxx
+++ b/desktop/source/deployment/misc/dp_platform.cxx
@@ -173,12 +173,12 @@ bool platform_fits( std::u16string_view platform_string )
sal_Int32 index = 0;
for (;;)
{
- const OUString token(
+ const std::u16string_view token(
o3tl::trim(o3tl::getToken(platform_string, 0, ',', index )) );
// check if this platform:
- if (token.equalsIgnoreAsciiCase( StrPlatform::get() ) ||
- (token.indexOf( '_' ) < 0 && /* check OS part only */
- token.equalsIgnoreAsciiCase( StrOperatingSystem::get() )))
+ if (o3tl::equalsIgnoreAsciiCase( token, StrPlatform::get() ) ||
+ (token.find( '_' ) == std::u16string_view::npos && /* check OS part only */
+ o3tl::equalsIgnoreAsciiCase( token, StrOperatingSystem::get() )))
{
return true;
}
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index e017ec4d9985..7b99ed49fdc9 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2837,7 +2837,8 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const cha
// Check if watermark for pdf is passed by filteroptions...
// It is not a real filter option so it must be filtered out.
- OUString watermarkText, sFullSheetPreview;
+ OUString watermarkText;
+ std::u16string_view sFullSheetPreview;
int aIndex = -1;
if ((aIndex = aFilterOptions.indexOf(",Watermark=")) >= 0)
{
@@ -2853,7 +2854,7 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const cha
aFilterOptions = OUString::Concat(aFilterOptions.subView(0, aIndex)) + aFilterOptions.subView(bIndex+16);
}
- bool bFullSheetPreview = sFullSheetPreview == "true";
+ bool bFullSheetPreview = sFullSheetPreview == u"true";
// Select a pdf version if specified a valid one. If not specified then ignore.
// If invalid then fail.
@@ -2861,19 +2862,18 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const cha
if ((aIndex = aFilterOptions.indexOf(",PDFVer=")) >= 0)
{
int bIndex = aFilterOptions.indexOf("PDFVEREND");
- OUString sPdfVer;
- sPdfVer = aFilterOptions.subView(aIndex+8, bIndex-(aIndex+8));
+ std::u16string_view sPdfVer = aFilterOptions.subView(aIndex+8, bIndex-(aIndex+8));
aFilterOptions = OUString::Concat(aFilterOptions.subView(0, aIndex)) + aFilterOptions.subView(bIndex+9);
- if (sPdfVer.equalsIgnoreAsciiCase("PDF/A-1b"))
+ if (o3tl::equalsIgnoreAsciiCase(sPdfVer, u"PDF/A-1b"))
pdfVer = 1;
- else if (sPdfVer.equalsIgnoreAsciiCase("PDF/A-2b"))
+ else if (o3tl::equalsIgnoreAsciiCase(sPdfVer, u"PDF/A-2b"))
pdfVer = 2;
- else if (sPdfVer.equalsIgnoreAsciiCase("PDF/A-3b"))
+ else if (o3tl::equalsIgnoreAsciiCase(sPdfVer, u"PDF/A-3b"))
pdfVer = 3;
- else if (sPdfVer.equalsIgnoreAsciiCase("PDF-1.5"))
+ else if (o3tl::equalsIgnoreAsciiCase(sPdfVer, u"PDF-1.5"))
pdfVer = 15;
- else if (sPdfVer.equalsIgnoreAsciiCase("PDF-1.6"))
+ else if (o3tl::equalsIgnoreAsciiCase(sPdfVer, u"PDF-1.6"))
pdfVer = 16;
else
{
diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx
index 42a02fa2cf76..6014d0e74935 100644
--- a/desktop/source/migration/migration.cxx
+++ b/desktop/source/migration/migration.cxx
@@ -941,8 +941,8 @@ void MigrationImpl::mergeOldToNewVersion(const uno::Reference< ui::XUIConfigurat
OUString sParentNodeName = elem.m_sParentNodeName;
sal_Int32 nIndex = 0;
do {
- OUString sToken( o3tl::trim(o3tl::getToken(sParentNodeName, 0, '|', nIndex)) );
- if (sToken.isEmpty())
+ std::u16string_view sToken( o3tl::trim(o3tl::getToken(sParentNodeName, 0, '|', nIndex)) );
+ if (sToken.empty())
break;
sal_Int32 nCount = xTemp->getCount();