Commit a5c80e1c authored by Pino Toscano's avatar Pino Toscano
Browse files

fb2: basic conversion for <stanza>

parent 5ec4c069
......@@ -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;
}
......@@ -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 );
......
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