Commit bfa53df1 authored by Brad Hards's avatar Brad Hards

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
parent a831fd46
......@@ -201,17 +201,22 @@ void TextDocumentGeneratorPrivate::generateTitleInfos()
} else if ( newLevel > level ) {
parentNodeStack.push( parentNode );
parentNode = parentNode.lastChildElement();
if ( ! parentNode.isNull() ) {
parentNode.appendChild( item );
}
level = newLevel;
} else {
for ( int i = level; i > newLevel; i-- ) {
level--;
if ( ! parentNodeStack.isEmpty() ) {
parentNode = parentNodeStack.pop();
}
}
if ( ! parentNode.isNull() ) {
parentNode.appendChild( item );
}
}
}
}
TextDocumentGenerator::TextDocumentGenerator( TextDocumentConverter *converter, QObject *parent, const QVariantList &args )
......
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