summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-09 09:55:12 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-04-10 12:59:38 +0200
commite4ff847fe0796420ba8023b70cad8589f5f19e9f (patch)
tree136786200de69f70dde4190c9725f35fe14b33e0 /cui
parent5a89496ffcfcd561b3e595e01f35e0302fa00841 (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 'cui')
-rw-r--r--cui/source/customize/SvxNotebookbarConfigPage.cxx6
-rw-r--r--cui/source/dialogs/cuigaldlg.cxx3
-rw-r--r--cui/source/options/optpath.cxx3
-rw-r--r--cui/source/tabpages/macroass.cxx3
4 files changed, 10 insertions, 5 deletions
diff --git a/cui/source/customize/SvxNotebookbarConfigPage.cxx b/cui/source/customize/SvxNotebookbarConfigPage.cxx
index af08789c67b0..9c80960c669e 100644
--- a/cui/source/customize/SvxNotebookbarConfigPage.cxx
+++ b/cui/source/customize/SvxNotebookbarConfigPage.cxx
@@ -40,6 +40,7 @@
#include <sfx2/notebookbar/SfxNotebookBar.hxx>
#include <unotools/configmgr.hxx>
#include <comphelper/processfactory.hxx>
+#include <o3tl/string_view.hxx>
#include <com/sun/star/frame/theUICommandDescription.hpp>
namespace uno = com::sun::star::uno;
@@ -317,8 +318,9 @@ void SvxNotebookbarConfigPage::searchNodeandAttribute(std::vector<NotebookbarEnt
{
sal_Int32 rPos = 0;
aCategoryEntry.sDisplayName
- = aCurItemEntry.sDisplayName.getToken(rPos, ' ', rPos) + " | "
- + sUIItemId;
+ = OUString::Concat(
+ o3tl::getToken(aCurItemEntry.sDisplayName, rPos, ' ', rPos))
+ + " | " + sUIItemId;
}
aCategoryList.push_back(aCategoryEntry);
aCurItemEntry = aCategoryEntry;
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index fd1f4a36e10d..e51f05a44e93 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -52,6 +52,7 @@
#include <svx/dialmgr.hxx>
#include <svx/strings.hrc>
#include <osl/diagnose.h>
+#include <o3tl/string_view.hxx>
using namespace ::ucbhelper;
using namespace ::cppu;
@@ -754,7 +755,7 @@ void TPGalleryThemeProperties::FillFilterList()
{
if ( !aExtensions.isEmpty() )
aExtensions += ";";
- aExtensions += aWildcard + aFilter.second.getToken( 0, ';', nIndex );
+ aExtensions += OUString::Concat(aWildcard) + o3tl::getToken(aFilter.second, 0, ';', nIndex );
}
}
#endif
diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx
index a6c4a2ca5ad6..1272a52f091d 100644
--- a/cui/source/options/optpath.cxx
+++ b/cui/source/options/optpath.cxx
@@ -42,6 +42,7 @@
#include <com/sun/star/util/thePathSettings.hpp>
#include <tools/diagnose_ex.h>
#include <sal/log.hxx>
+#include <o3tl/string_view.hxx>
using namespace css;
using namespace css::beans;
@@ -368,7 +369,7 @@ IMPL_LINK_NOARG(SvxPathTabPage, StandardHdl_Impl, weld::Button&, void)
sal_Int32 nInternalPos = 0;
do
{
- if ( sInternal.getToken( 0, MULTIPATH_DELIMITER, nInternalPos ) == sOnePath )
+ if ( o3tl::getToken(sInternal, 0, MULTIPATH_DELIMITER, nInternalPos ) == sOnePath )
bFound = true;
}
while ( !bFound && nInternalPos >= 0 );
diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx
index d9b071dcff66..e80e471ff228 100644
--- a/cui/source/tabpages/macroass.cxx
+++ b/cui/source/tabpages/macroass.cxx
@@ -19,6 +19,7 @@
#include <macroass.hxx>
#include <o3tl/safeint.hxx>
+#include <o3tl/string_view.hxx>
#include <osl/diagnose.h>
#include <comphelper/string.hxx>
#include <comphelper/processfactory.hxx>
@@ -70,7 +71,7 @@ static OUString ConvertToUIName_Impl( SvxMacro const *pMacro )
OUString aEntry = aName.getToken( nCount-1, '.' );
if ( nCount > 2 )
{
- aEntry += "(" + aName.getToken( 0, '.' ) + "." + aName.getToken( nCount-2, '.' ) + ")";
+ aEntry += OUString::Concat("(") + o3tl::getToken(aName, 0, '.' ) + "." + o3tl::getToken(aName, nCount-2, '.' ) + ")";
}
return aEntry;
}