summaryrefslogtreecommitdiff
path: root/sal/osl/w32
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-04-09 13:32:12 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-04-09 19:27:44 +0200
commitd7910847fba1694c83dc57a1f27b8eaabb2a7d85 (patch)
treee673f1ee50082681f8f8fd4b7a5da3557446518f /sal/osl/w32
parentbcf9c4dc32eccd33234511ccf3c2281bee3b0e60 (diff)
use more OStringToOUString
both because it is more obvious to read, and it takes a string_view, which is handy Change-Id: Ic201cfa0434446f51436d23c33d3f1a919ed65be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150167 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal/osl/w32')
-rw-r--r--sal/osl/w32/file_url.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/sal/osl/w32/file_url.cxx b/sal/osl/w32/file_url.cxx
index 8c525042ddef..a14f8d4b9b39 100644
--- a/sal/osl/w32/file_url.cxx
+++ b/sal/osl/w32/file_url.cxx
@@ -502,8 +502,10 @@ static std::optional<OUString> osl_decodeURL_(const OString& sUTF8)
}
}
- return bValidEncoded ? OUString(aBuffer.getStr(), aBuffer.getLength(), RTL_TEXTENCODING_UTF8)
- : std::optional<OUString>();
+ if (!bValidEncoded)
+ return std::nullopt;
+
+ return OStringToOUString(aBuffer, RTL_TEXTENCODING_UTF8);
}
static OUString osl_encodeURL_(std::u16string_view sURL)