summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2018-04-25 17:15:46 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2018-04-29 22:50:46 +0200
commit4f03fabc4bf02400b961f8f3117ed07bd8ff81f5 (patch)
tree188259c96c8d90419baf9f2ef8c6997b9b9849c8
parenta04b9aa9ed00ac944e168910a22461273f09966a (diff)
Avoid comphelper::string::getTokenCount()
Change-Id: I6bc5740d9e2115a09b1b096f120ab3ae19e30d66
-rw-r--r--sw/source/ui/index/cnttab.cxx15
1 files changed, 7 insertions, 8 deletions
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 426ec4c3db2d..79eeb008953c 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -670,15 +670,14 @@ SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(vcl::Window* pParent,
m_pHeaderTree->GetModel()->SetSortMode(SortAscending);
for (sal_uInt16 i = 0; i < MAXLEVEL; ++i)
{
- OUString sStyles(rStringArr[i]);
- for(sal_Int32 nToken = 0;
- nToken < comphelper::string::getTokenCount(sStyles, TOX_STYLE_DELIMITER);
- ++nToken)
- {
- const OUString sTmp(sStyles.getToken(nToken, TOX_STYLE_DELIMITER));
- SvTreeListEntry* pEntry = m_pHeaderTree->InsertEntry(sTmp);
+ const OUString &rStyles{rStringArr[i]};
+ if (rStyles.isEmpty())
+ continue;
+ sal_Int32 nPos {0};
+ do {
+ SvTreeListEntry* pEntry = m_pHeaderTree->InsertEntry(rStyles.getToken(0, TOX_STYLE_DELIMITER, nPos));
pEntry->SetUserData(reinterpret_cast<void*>(i));
- }
+ } while (nPos>=0);
}
// now the other styles