diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-09-22 17:18:06 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-09-22 19:59:56 +0200 |
commit | d1e14030e81ff2bbe4bcb3706a9f21672a368074 (patch) | |
tree | 713e59ead818f81e599c9757dd87468326795173 /sw/source/uibase/utlui | |
parent | 743e6aa211ccd631c811fb57e2050a5b4e8ffbba (diff) |
Extend loplugin:stringviewparam to starts/endsWith: sw
Change-Id: I7271bba6c61a56be15335c81d8950a29a07eb6d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122473
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sw/source/uibase/utlui')
-rw-r--r-- | sw/source/uibase/utlui/unotools.cxx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sw/source/uibase/utlui/unotools.cxx b/sw/source/uibase/utlui/unotools.cxx index 73edc7e540f1..a0066904e0a1 100644 --- a/sw/source/uibase/utlui/unotools.cxx +++ b/sw/source/uibase/utlui/unotools.cxx @@ -17,12 +17,18 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <string_view> + #include <swtypes.hxx> #include <strings.hrc> #include <unotools.hxx> #include <unoprnms.hxx> #include <i18nutil/unicode.hxx> +#include <o3tl/string_view.hxx> +#include <rtl/string.h> #include <svtools/colorcfg.hxx> #include <vcl/commandevent.hxx> #include <vcl/jobset.hxx> @@ -488,12 +494,12 @@ bool SwOneExampleFrame::CreatePopup(const Point& rPt) return true; } -void SwOneExampleFrame::PopupHdl(const OString& rId) +void SwOneExampleFrame::PopupHdl(std::string_view rId) { - OString sZoomValue; - if (rId.startsWith("zoom", &sZoomValue)) + std::string_view sZoomValue; + if (o3tl::starts_with(rId, "zoom", &sZoomValue)) { - sal_Int16 nZoom = sZoomValue.toInt32(); + sal_Int16 nZoom = rtl_str_toInt64_WithLength(sZoomValue.data(), 10, sZoomValue.length()); uno::Reference< view::XViewSettingsSupplier > xSettings(m_xController, uno::UNO_QUERY); uno::Reference< beans::XPropertySet > xViewProps = xSettings->getViewSettings(); |