diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-27 16:47:53 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-28 13:40:36 +0200 |
commit | b1148c31ed2786396f0b018a988fce8288f1797d (patch) | |
tree | 307439b6e5c6c15dc9a91fa0363247b23644d77f /basctl/source/basicide | |
parent | ae761fd359f4a553e4552125f77575204d62c958 (diff) |
use more string_view in comphelper
Change-Id: I1544da756d8da074787bc19a98d2740058e36479
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133520
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basctl/source/basicide')
-rw-r--r-- | basctl/source/basicide/baside2.hxx | 2 | ||||
-rw-r--r-- | basctl/source/basicide/baside2b.cxx | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx index f43ee79d2c4f..2c9822610d64 100644 --- a/basctl/source/basicide/baside2.hxx +++ b/basctl/source/basicide/baside2.hxx @@ -153,7 +153,7 @@ public: void ChangeFontColor( Color aColor ); void UpdateSyntaxHighlighting (); - bool GetProcedureName(OUString const & rLine, OUString& rProcType, OUString& rProcName) const; + bool GetProcedureName(std::u16string_view rLine, OUString& rProcType, OUString& rProcName) const; FactoryFunction GetUITestFactory() const override; }; diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index 262f9e49a248..c080ea325807 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -40,6 +40,7 @@ #include <com/sun/star/container/XHierarchicalNameAccess.hpp> #include <com/sun/star/script/XLibraryContainer2.hpp> #include <comphelper/string.hxx> +#include <o3tl/string_view.hxx> #include <officecfg/Office/Common.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/progress.hxx> @@ -811,7 +812,7 @@ void EditorWindow::HandleProcedureCompletion() } } -bool EditorWindow::GetProcedureName(OUString const & rLine, OUString& rProcType, OUString& rProcName) const +bool EditorWindow::GetProcedureName(std::u16string_view rLine, OUString& rProcType, OUString& rProcName) const { std::vector<HighlightPortion> aPortions; aHighlighter.getHighlightPortions(rLine, aPortions); @@ -824,10 +825,10 @@ bool EditorWindow::GetProcedureName(OUString const & rLine, OUString& rProcType, for (auto const& portion : aPortions) { - OUString sTokStr = rLine.copy(portion.nBegin, portion.nEnd - portion.nBegin); + std::u16string_view sTokStr = rLine.substr(portion.nBegin, portion.nEnd - portion.nBegin); - if( portion.tokenType == TokenType::Keywords && ( sTokStr.equalsIgnoreAsciiCase("sub") - || sTokStr.equalsIgnoreAsciiCase("function")) ) + if( portion.tokenType == TokenType::Keywords && ( o3tl::equalsIgnoreAsciiCase(sTokStr, u"sub") + || o3tl::equalsIgnoreAsciiCase(sTokStr, u"function")) ) { rProcType = sTokStr; bFoundType = true; |