diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-15 12:25:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-19 18:31:10 +0200 |
commit | ab699bfdb3375f7142a50cc35322e2924c9e5945 (patch) | |
tree | 8f935378a1ee272f4316a50f902e214d50ce8cc6 /desktop/source/lib | |
parent | f393785a146433cccd5bbecf1e49b5f1485ec5a7 (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/lib')
-rw-r--r-- | desktop/source/lib/init.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
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 { |