diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-09 09:55:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-10 12:59:38 +0200 |
commit | e4ff847fe0796420ba8023b70cad8589f5f19e9f (patch) | |
tree | 136786200de69f70dde4190c9725f35fe14b33e0 /starmath | |
parent | 5a89496ffcfcd561b3e595e01f35e0302fa00841 (diff) |
loplugin:stringview check for getToken and trim
since we now have o3tl versions of those that work on
string_view.
Also improve those o3tl functions to support both string_view
and u16string_view
Change-Id: Iacab2996becec62aa78a5597c52d983bb784749a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132755
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/edit.cxx | 3 | ||||
-rw-r--r-- | starmath/source/mathml/mathmlimport.cxx | 3 | ||||
-rw-r--r-- | starmath/source/ooxmlimport.cxx | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx index 0b14c492ed23..6a6bbbf1162a 100644 --- a/starmath/source/edit.cxx +++ b/starmath/source/edit.cxx @@ -32,6 +32,7 @@ #include <svl/stritem.hxx> #include <sfx2/viewfrm.hxx> #include <osl/diagnose.h> +#include <o3tl/string_view.hxx> #include <edit.hxx> #include <smmod.hxx> @@ -305,7 +306,7 @@ bool SmEditTextWindow::KeyInput(const KeyEvent& rKEvt) SmModule *pMod = SM_MOD(); if (pMod && !pMod->GetConfig()->IsAutoCloseBrackets()) autoClose = false; - else if (selected.trim() == "<?>") + else if (o3tl::trim(selected) == u"<?>") autoClose = true; else if (selected.isEmpty() && !aSelection.HasRange()) { diff --git a/starmath/source/mathml/mathmlimport.cxx b/starmath/source/mathml/mathmlimport.cxx index 6b96cd9a4ed1..f8c845e93dee 100644 --- a/starmath/source/mathml/mathmlimport.cxx +++ b/starmath/source/mathml/mathmlimport.cxx @@ -59,6 +59,7 @@ one go*/ #include <svx/dialmgr.hxx> #include <svx/strings.hrc> #include <tools/diagnose_ex.h> +#include <o3tl/string_view.hxx> #include <mathmlattr.hxx> #include <xparsmlbase.hxx> @@ -1520,7 +1521,7 @@ void SmXMLSpaceContext_Impl::startFastElement( switch (aIter.getToken()) { case XML_WIDTH: - if (!ParseMathMLAttributeLengthValue(sValue.trim(), aLV) + if (!ParseMathMLAttributeLengthValue(o3tl::trim(sValue), aLV) || !lcl_CountBlanks(aLV, &nWide, &nNarrow)) SAL_WARN("starmath", "ignore mspace's width: " << sValue); break; diff --git a/starmath/source/ooxmlimport.cxx b/starmath/source/ooxmlimport.cxx index d14a4d2023b6..b096d80ba1f1 100644 --- a/starmath/source/ooxmlimport.cxx +++ b/starmath/source/ooxmlimport.cxx @@ -19,6 +19,7 @@ #include <rtl/ustring.hxx> #include <rtl/ustrbuf.hxx> #include <sal/log.hxx> +#include <o3tl/string_view.hxx> using namespace oox::formulaimport; @@ -602,7 +603,7 @@ OUString SmOoxmlImport::handleR() { XmlStream::Tag rtag = m_rStream.ensureOpeningTag( M_TOKEN( t )); if( rtag.attribute( OOX_TOKEN( xml, space )) != "preserve" ) - text.append(rtag.text.trim()); + text.append(o3tl::trim(rtag.text)); else text.append(rtag.text); m_rStream.ensureClosingTag( M_TOKEN( t )); |