diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-09 09:42:26 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-09 13:26:39 +0200 |
commit | 035c9fc7ecaf0fce032748f47450fb31cc62d65a (patch) | |
tree | c8c1bbea65c36c518e5f6c84e1a3fcce219b29f0 /stoc/source | |
parent | 29578ae1394de2fffae2e34326d03d81b4c4f475 (diff) |
use more subView when converting to Int32
Change-Id: Ia1be48050cca386a6e765aa2229de1bc9e64ffff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132749
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'stoc/source')
-rw-r--r-- | stoc/source/security/permissions.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/stoc/source/security/permissions.cxx b/stoc/source/security/permissions.cxx index 1d7aca177344..8fa8bdd831cd 100644 --- a/stoc/source/security/permissions.cxx +++ b/stoc/source/security/permissions.cxx @@ -27,6 +27,7 @@ #include <rtl/string.hxx> #include <rtl/ustrbuf.hxx> #include <sal/log.hxx> +#include <o3tl/string_view.hxx> #include <com/sun/star/security/RuntimePermission.hpp> #include <com/sun/star/security/AllPermission.hpp> @@ -148,20 +149,20 @@ SocketPermission::SocketPermission( sal_Int32 minus = m_host.indexOf( '-', colon +1 ); if (minus < 0) { - m_lowerPort = m_upperPort = m_host.copy( colon +1 ).toInt32(); + m_lowerPort = m_upperPort = o3tl::toInt32(m_host.subView( colon +1 )); } else if (minus == (colon +1)) // -N { - m_upperPort = m_host.copy( minus +1 ).toInt32(); + m_upperPort = o3tl::toInt32(m_host.subView( minus +1 )); } else if (minus == (m_host.getLength() -1)) // N- { - m_lowerPort = m_host.copy( colon +1, m_host.getLength() -1 -colon -1 ).toInt32(); + m_lowerPort = o3tl::toInt32(m_host.subView( colon +1, m_host.getLength() -1 -colon -1 )); } else // A-B { - m_lowerPort = m_host.copy( colon +1, minus - colon -1 ).toInt32(); - m_upperPort = m_host.copy( minus +1 ).toInt32(); + m_lowerPort = o3tl::toInt32(m_host.subView( colon +1, minus - colon -1 )); + m_upperPort = o3tl::toInt32(m_host.subView( minus +1 )); } m_host = m_host.copy( 0, colon ); } |