summaryrefslogtreecommitdiff
path: root/jvmfwk
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-12 12:43:11 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-04-13 08:38:53 +0200
commitfdfd517a6f75e394ddcb1e195decbfed33ba56b9 (patch)
treee3bff14e5531affcd908415b4e85d7ceac4aa1fd /jvmfwk
parente568c9dca8b93b96a8a130a8fb6f1bba1a33d6ea (diff)
loplugin:stringviewparam whitelist some more functions
for which we have o3tl:: equivalents Change-Id: I4670fd8b703ac47214be213f41e88d1c6ede7032 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132913 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'jvmfwk')
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/util.cxx13
1 files changed, 7 insertions, 6 deletions
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index 743db3a9ce13..f7d786007544 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -29,6 +29,7 @@
#include <sal/log.hxx>
#include <salhelper/linkhelper.hxx>
#include <salhelper/thread.hxx>
+#include <o3tl/string_view.hxx>
#include <memory>
#include <utility>
#include <algorithm>
@@ -113,7 +114,7 @@ static bool getSDKInfoFromRegistry(std::vector<OUString> & vecHome);
static bool getJREInfoFromRegistry(std::vector<OUString>& vecJavaHome);
#endif
-static bool decodeOutput(const OString& s, OUString* out);
+static bool decodeOutput(std::string_view s, OUString* out);
namespace
@@ -482,22 +483,22 @@ bool getJavaProps(const OUString & exePath,
readable strings. The strings are encoded as integer values separated
by spaces.
*/
-bool decodeOutput(const OString& s, OUString* out)
+bool decodeOutput(std::string_view s, OUString* out)
{
OSL_ASSERT(out != nullptr);
OUStringBuffer buff(512);
sal_Int32 nIndex = 0;
do
{
- OString aToken = s.getToken( 0, ' ', nIndex );
- if (!aToken.isEmpty())
+ std::string_view aToken = o3tl::getToken(s, 0, ' ', nIndex );
+ if (!aToken.empty())
{
- for (sal_Int32 i = 0; i < aToken.getLength(); ++i)
+ for (size_t i = 0; i < aToken.size(); ++i)
{
if (aToken[i] < '0' || aToken[i] > '9')
return false;
}
- sal_Unicode value = static_cast<sal_Unicode>(aToken.toInt32());
+ sal_Unicode value = static_cast<sal_Unicode>(o3tl::toInt32(aToken));
buff.append(value);
}
} while (nIndex >= 0);