diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-04-10 18:01:17 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-04-10 20:09:26 +0200 |
commit | f6fa9c455502e9a00e4a4cff6e19f3e17c5479c3 (patch) | |
tree | 2aec6ab1a00a8be7630b5b189269f076e2b7d2b0 /desktop/source | |
parent | b454107b87ac78096d98fd7ceedcbfac71d247a0 (diff) |
Use more *string_view
Change-Id: I1172febd45da4dba006f8495427fe45c6d9b9fa6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150187
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'desktop/source')
-rw-r--r-- | desktop/source/lib/init.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index cda953a928f4..0521af8b427a 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -490,18 +490,18 @@ static bool extractLinks(const uno::Reference< container::XNameAccess >& xLinks, return bIsTarget; } -static void unoAnyToJson(tools::JsonWriter& rJson, const char * pNodeName, const uno::Any& anyItem) +static void unoAnyToJson(tools::JsonWriter& rJson, std::string_view pNodeName, const uno::Any& anyItem) { auto aNode = rJson.startNode(pNodeName); OUString aType = anyItem.getValueTypeName(); - rJson.put("type", aType.toUtf8().getStr()); + rJson.put("type", aType); if (aType == "string") - rJson.put("value", anyItem.get<OUString>().toUtf8().getStr()); + rJson.put("value", anyItem.get<OUString>()); else if (aType == "unsigned long") - rJson.put("value", OString::number(anyItem.get<sal_uInt32>()).getStr()); + rJson.put("value", OString::number(anyItem.get<sal_uInt32>())); else if (aType == "long") - rJson.put("value", OString::number(anyItem.get<sal_Int32>()).getStr()); + rJson.put("value", OString::number(anyItem.get<sal_Int32>())); else if (aType == "[]any") { uno::Sequence<uno::Any> aSeq; @@ -511,7 +511,7 @@ static void unoAnyToJson(tools::JsonWriter& rJson, const char * pNodeName, const for (auto i = 0; i < aSeq.getLength(); ++i) { - unoAnyToJson(rJson, OString::number(i).getStr(), aSeq[i]); + unoAnyToJson(rJson, OString::number(i), aSeq[i]); } } } |