Kaydet (Commit) 5d8121f1 authored tarafından Matteo Casalin's avatar Matteo Casalin

Use indexes in OUString::getToken

Change-Id: Id30c5d094688d29e36e4ead8c58b59705b6bc91b
üst 451b26c8
...@@ -1231,18 +1231,20 @@ void SwTOXBaseSection::UpdateTemplate( const SwTxtNode* pOwnChapterNode ) ...@@ -1231,18 +1231,20 @@ void SwTOXBaseSection::UpdateTemplate( const SwTxtNode* pOwnChapterNode )
for(sal_uInt16 i = 0; i < MAXLEVEL; i++) for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
{ {
const OUString sTmpStyleNames = GetStyleNames(i); const OUString sTmpStyleNames = GetStyleNames(i);
sal_uInt16 nTokenCount = comphelper::string::getTokenCount(sTmpStyleNames, TOX_STYLE_DELIMITER); if (sTmpStyleNames.isEmpty())
for( sal_uInt16 nStyle = 0; nStyle < nTokenCount; ++nStyle ) continue;
sal_Int32 nIndex = 0;
while (nIndex >= 0)
{ {
SwTxtFmtColl* pColl = pDoc->FindTxtFmtCollByName( SwTxtFmtColl* pColl = pDoc->FindTxtFmtCollByName(
sTmpStyleNames.getToken( nStyle, sTmpStyleNames.getToken( 0, TOX_STYLE_DELIMITER, nIndex ));
TOX_STYLE_DELIMITER ));
//TODO: no outline Collections in content indexes if OutlineLevels are already included //TODO: no outline Collections in content indexes if OutlineLevels are already included
if( !pColl || if( !pColl ||
( TOX_CONTENT == SwTOXBase::GetType() && ( TOX_CONTENT == SwTOXBase::GetType() &&
GetCreateType() & nsSwTOXElement::TOX_OUTLINELEVEL && GetCreateType() & nsSwTOXElement::TOX_OUTLINELEVEL &&
pColl->IsAssignedToListLevelOfOutlineStyle()) ) pColl->IsAssignedToListLevelOfOutlineStyle()) )
continue; continue;
SwIterator<SwTxtNode,SwFmtColl> aIter( *pColl ); SwIterator<SwTxtNode,SwFmtColl> aIter( *pColl );
for( SwTxtNode* pTxtNd = aIter.First(); pTxtNd; pTxtNd = aIter.Next() ) for( SwTxtNode* pTxtNd = aIter.First(); pTxtNd; pTxtNd = aIter.Next() )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment