[Libreoffice-commits] core.git: vcl/inc vcl/skia vcl/source
Stephan Bergmann (via logerrit)
logerrit at kemper.freedesktop.org
Tue Sep 8 05:34:04 UTC 2020
vcl/inc/driverblocklist.hxx | 4 +++-
vcl/skia/SkiaHelper.cxx | 3 ++-
vcl/source/helper/driverblocklist.cxx | 12 ++++++------
3 files changed, 11 insertions(+), 8 deletions(-)
New commits:
commit 9db379b0b7dded5e9a4523ce48dac928979aab70
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Mon Sep 7 22:21:36 2020 +0200
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Tue Sep 8 07:33:19 2020 +0200
Simplify GetVendorNameFromId, returning std::string_view
Change-Id: Ida709a432a1892494a767da3979afdc3ee4477b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102206
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/vcl/inc/driverblocklist.hxx b/vcl/inc/driverblocklist.hxx
index f28dc418383a..a417d19ff543 100644
--- a/vcl/inc/driverblocklist.hxx
+++ b/vcl/inc/driverblocklist.hxx
@@ -12,6 +12,8 @@
#include <vcl/dllapi.h>
#include <xmlreader/xmlreader.hxx>
+
+#include <string_view>
#include <vector>
namespace DriverBlocklist
@@ -36,7 +38,7 @@ const int DeviceVendorMax = VendorMicrosoft + 1;
/// Returns vendor for the given vendor ID, or VendorAll if not known.
VCL_DLLPUBLIC DeviceVendor GetVendorFromId(uint32_t id);
-VCL_DLLPUBLIC OUStringLiteral GetVendorNameFromId(uint32_t id);
+VCL_DLLPUBLIC std::string_view GetVendorNameFromId(uint32_t id);
// The rest should be private (only for the unittest).
diff --git a/vcl/skia/SkiaHelper.cxx b/vcl/skia/SkiaHelper.cxx
index 8ba1e06f2463..5bf8c04cff6a 100644
--- a/vcl/skia/SkiaHelper.cxx
+++ b/vcl/skia/SkiaHelper.cxx
@@ -32,6 +32,7 @@ bool isVCLSkiaEnabled() { return false; }
#include <osl/file.hxx>
#include <tools/stream.hxx>
#include <list>
+#include <string_view>
#include <SkCanvas.h>
#include <SkPaint.h>
@@ -64,7 +65,7 @@ static OUString versionAsString(uint32_t version)
+ OUString::number(version & 0xfff);
}
-static OUStringLiteral vendorAsString(uint32_t vendor)
+static std::string_view vendorAsString(uint32_t vendor)
{
return DriverBlocklist::GetVendorNameFromId(vendor);
}
diff --git a/vcl/source/helper/driverblocklist.cxx b/vcl/source/helper/driverblocklist.cxx
index 8b2ca1ffa0c1..6bcee982015f 100644
--- a/vcl/source/helper/driverblocklist.cxx
+++ b/vcl/source/helper/driverblocklist.cxx
@@ -157,20 +157,20 @@ DeviceVendor GetVendorFromId(uint32_t id)
}
}
-OUStringLiteral GetVendorNameFromId(uint32_t id)
+std::string_view GetVendorNameFromId(uint32_t id)
{
switch (id)
{
case 0x8086:
- return u"Intel";
+ return "Intel";
case 0x10de:
- return u"Nvidia";
+ return "Nvidia";
case 0x1002:
- return u"AMD";
+ return "AMD";
case 0x1414:
- return u"Microsoft";
+ return "Microsoft";
default:
- return u"?";
+ return "?";
}
}
More information about the Libreoffice-commits
mailing list