Don't crash when setting up the document synopsis for

ODTs with strange heading ordering.

This may still cause the synopsis to look different
to the way the user expected. Will take another
look at that.

BUG: 168678

svn path=/trunk/KDE/kdegraphics/okular/; revision=890395
remotes/origin/old/work/record-presentation
Brad Hards 18 years ago
parent a831fd4628
commit bfa53df1ec
  1. 13
      core/textdocumentgenerator.cpp

@ -201,15 +201,20 @@ void TextDocumentGeneratorPrivate::generateTitleInfos()
} else if ( newLevel > level ) {
parentNodeStack.push( parentNode );
parentNode = parentNode.lastChildElement();
parentNode.appendChild( item );
if ( ! parentNode.isNull() ) {
parentNode.appendChild( item );
}
level = newLevel;
} else {
for ( int i = level; i > newLevel; i-- ) {
level--;
parentNode = parentNodeStack.pop();
if ( ! parentNodeStack.isEmpty() ) {
parentNode = parentNodeStack.pop();
}
}
if ( ! parentNode.isNull() ) {
parentNode.appendChild( item );
}
parentNode.appendChild( item );
}
}
}

Loading…
Cancel
Save