[Libreoffice-commits] core.git: registry/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Sat Sep 5 18:20:51 UTC 2020


 registry/source/regimpl.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 573f472c6d282c69d16d4ed985c7433c75876745
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Sat Sep 5 18:23:31 2020 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Sat Sep 5 20:20:13 2020 +0200

    Make printString take any std::u16string_view argument
    
    (This change is a prerequisite for making the OUString ctor taking a raw pointer
    explicit.)
    
    Change-Id: I201c87e47ae83b7c3df39e5abb420d6a80b1d3e3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102080
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx
index 583cddd295d1..f0c8162434d4 100644
--- a/registry/source/regimpl.cxx
+++ b/registry/source/regimpl.cxx
@@ -20,8 +20,10 @@
 
 #include "regimpl.hxx"
 
+#include <cstddef>
 #include <memory>
 #include <set>
+#include <string_view>
 #include <vector>
 #include <string.h>
 #include <stdio.h>
@@ -52,9 +54,9 @@ using namespace store;
 
 namespace {
 
-void printString(OUString const & s) {
+void printString(std::u16string_view s) {
     printf("\"");
-    for (sal_Int32 i = 0; i < s.getLength(); ++i) {
+    for (std::size_t i = 0; i < s.size(); ++i) {
         sal_Unicode c = s[i];
         if (c == '"' || c == '\\') {
             printf("\\%c", static_cast< char >(c));


More information about the Libreoffice-commits mailing list