diff --git a/generators/fictionbook/converter.cpp b/generators/fictionbook/converter.cpp index f59556a82..c7c8d3b66 100644 --- a/generators/fictionbook/converter.cpp +++ b/generators/fictionbook/converter.cpp @@ -665,6 +665,9 @@ bool Converter::convertPoem( const QDomElement &element ) } else if ( child.tagName() == QLatin1String( "empty-line" ) ) { if ( !convertEmptyLine( child ) ) return false; + } else if ( child.tagName() == QLatin1String( "stanza" ) ) { + if ( !convertStanza( child ) ) + return false; } child = child.nextSiblingElement(); @@ -766,3 +769,27 @@ bool Converter::convertLink( const QDomElement &element ) return true; } + +bool Converter::convertStanza( const QDomElement &element ) +{ + QDomElement child = element.firstChildElement(); + while ( !child.isNull() ) { + if ( child.tagName() == QLatin1String( "title" ) ) { + if ( !convertTitle( child ) ) + return false; + } else if ( child.tagName() == QLatin1String( "subtitle" ) ) { + if ( !convertSubTitle( child ) ) + return false; + } else if ( child.tagName() == QLatin1String( "v" ) ) { + QTextBlockFormat format; + format.setTextIndent( 50 ); + mCursor->insertBlock( format ); + if ( !convertParagraph( child ) ) + return false; + } + + child = child.nextSiblingElement(); + } + + return true; +} diff --git a/generators/fictionbook/converter.h b/generators/fictionbook/converter.h index 437a58dff..7de5dc462 100644 --- a/generators/fictionbook/converter.h +++ b/generators/fictionbook/converter.h @@ -44,6 +44,7 @@ class Converter : public Okular::TextDocumentConverter bool convertStrong( const QDomElement &element ); bool convertStrikethrough( const QDomElement &element ); bool convertStyle( const QDomElement &element ); + bool convertStanza( const QDomElement &element ); bool convertTitleInfo( const QDomElement &element );