diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2023-04-16 21:05:27 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-04-17 07:54:12 +0200 |
commit | e870d996efb4a856f667c601032e02e5b21c5b82 (patch) | |
tree | 1692d68d47018555452bbae484abe9d1b23dd17a /test | |
parent | 80a0d3b44cd6edb6419ab66588548ba169f2567b (diff) |
use more string_view
Change-Id: If4523dc2c89d1fb1c5e11665ee60044834fcecd4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150458
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'test')
-rw-r--r-- | test/source/a11y/AccessibilityTools.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/source/a11y/AccessibilityTools.cxx b/test/source/a11y/AccessibilityTools.cxx index 15a7cec17bc3..33270505f3a6 100644 --- a/test/source/a11y/AccessibilityTools.cxx +++ b/test/source/a11y/AccessibilityTools.cxx @@ -34,6 +34,7 @@ #include <vcl/scheduler.hxx> #include <vcl/timer.hxx> #include <vcl/window.hxx> +#include <o3tl/string_view.hxx> using namespace css; @@ -165,9 +166,9 @@ bool AccessibilityTools::nameEquals(const uno::Reference<accessibility::XAccessi const std::u16string_view name) { auto ctxName = xCtx->getAccessibleName(); - OUString rest; + std::u16string_view rest; - if (!ctxName.startsWith(name, &rest)) + if (!o3tl::starts_with(ctxName, name, &rest)) return false; if (rest == u"") return true; @@ -193,7 +194,9 @@ bool AccessibilityTools::nameEquals(const uno::Reference<accessibility::XAccessi if (pVCLXAccessibleComponent) { auto windowType = pVCLXAccessibleComponent->GetWindow()->GetType(); - if (rest == u" (Type = " + OUString::number(static_cast<sal_Int32>(windowType)) + ")") + if (rest + == Concat2View(u" (Type = " + OUString::number(static_cast<sal_Int32>(windowType)) + + ")")) return true; } #endif |