summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2015-03-01 22:21:12 +0100
committerMatteo Casalin <matteo.casalin@yahoo.com>2015-04-05 11:25:13 +0200
commit5d8121f1c93a09733b357ee84c5a88de7dd93ce2 (patch)
treee52d8196e18a8db6c455c75c9a0fb1efd8bd2b15 /sw
parent451b26c8e91b57336210a6f47aab9a039f83b62f (diff)
Use indexes in OUString::getToken
Change-Id: Id30c5d094688d29e36e4ead8c58b59705b6bc91b
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/doctxm.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index cf611c3a7374..0c61cb4a7fe0 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -1231,18 +1231,20 @@ void SwTOXBaseSection::UpdateTemplate( const SwTxtNode* pOwnChapterNode )
for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
{
const OUString sTmpStyleNames = GetStyleNames(i);
- sal_uInt16 nTokenCount = comphelper::string::getTokenCount(sTmpStyleNames, TOX_STYLE_DELIMITER);
- for( sal_uInt16 nStyle = 0; nStyle < nTokenCount; ++nStyle )
+ if (sTmpStyleNames.isEmpty())
+ continue;
+
+ sal_Int32 nIndex = 0;
+ while (nIndex >= 0)
{
SwTxtFmtColl* pColl = pDoc->FindTxtFmtCollByName(
- sTmpStyleNames.getToken( nStyle,
- TOX_STYLE_DELIMITER ));
+ sTmpStyleNames.getToken( 0, TOX_STYLE_DELIMITER, nIndex ));
//TODO: no outline Collections in content indexes if OutlineLevels are already included
if( !pColl ||
( TOX_CONTENT == SwTOXBase::GetType() &&
GetCreateType() & nsSwTOXElement::TOX_OUTLINELEVEL &&
pColl->IsAssignedToListLevelOfOutlineStyle()) )
- continue;
+ continue;
SwIterator<SwTxtNode,SwFmtColl> aIter( *pColl );
for( SwTxtNode* pTxtNd = aIter.First(); pTxtNd; pTxtNd = aIter.Next() )