|
@@ -209,11 +209,28 @@ Fb2Handler::SectionHandler::SectionHandler(ContentHandler &parent, const QString
|
|
frameFormat.setPadding(8);
|
|
frameFormat.setPadding(8);
|
|
frameFormat.setTopMargin(4);
|
|
frameFormat.setTopMargin(4);
|
|
frameFormat.setBottomMargin(4);
|
|
frameFormat.setBottomMargin(4);
|
|
- cursor().insertFrame(frameFormat);
|
|
|
|
|
|
+ if (name == "title") {
|
|
|
|
+ frameFormat.setWidth(QTextLength(QTextLength::PercentageLength, 80));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+// if (name == "stanza") {
|
|
|
|
+// frameFormat.setLeftMargin(20);
|
|
|
|
+// frameFormat.setWidth(QTextLength(QTextLength::PercentageLength, 80));
|
|
|
|
+// frameFormat.setPosition(QTextFrameFormat::FloatRight);
|
|
|
|
+
|
|
|
|
+ if (name == "stanza") {
|
|
|
|
+ QTextTableFormat format;
|
|
|
|
+ format.setCellPadding(5);
|
|
|
|
+ format.setCellSpacing(5);
|
|
|
|
+ QTextTable * table = cursor().insertTable(1, 1, format);
|
|
|
|
+ } else {
|
|
|
|
+ cursor().insertFrame(frameFormat);
|
|
|
|
+ }
|
|
|
|
|
|
QTextBlockFormat blockFormat;
|
|
QTextBlockFormat blockFormat;
|
|
blockFormat.setTopMargin(4);
|
|
blockFormat.setTopMargin(4);
|
|
blockFormat.setBottomMargin(4);
|
|
blockFormat.setBottomMargin(4);
|
|
|
|
+
|
|
cursor().setBlockFormat(blockFormat);
|
|
cursor().setBlockFormat(blockFormat);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -234,6 +251,7 @@ bool Fb2Handler::SectionHandler::doStart(const QString &name, const QXmlAttribut
|
|
case Paragraph:
|
|
case Paragraph:
|
|
case Emptyline:
|
|
case Emptyline:
|
|
case Image:
|
|
case Image:
|
|
|
|
+ case Verse:
|
|
if (m_feed) cursor().insertBlock();
|
|
if (m_feed) cursor().insertBlock();
|
|
m_feed = true;
|
|
m_feed = true;
|
|
break;
|
|
break;
|
|
@@ -244,6 +262,7 @@ bool Fb2Handler::SectionHandler::doStart(const QString &name, const QXmlAttribut
|
|
switch (keyword) {
|
|
switch (keyword) {
|
|
case Emptyline : m_handler = new ContentHandler(*this); break;
|
|
case Emptyline : m_handler = new ContentHandler(*this); break;
|
|
case Paragraph : m_handler = new TextHandler(*this, name); break;
|
|
case Paragraph : m_handler = new TextHandler(*this, name); break;
|
|
|
|
+ case Verse : m_handler = new TextHandler(*this, name); break;
|
|
case Section : m_handler = new SectionHandler(*this, name, attributes); break;
|
|
case Section : m_handler = new SectionHandler(*this, name, attributes); break;
|
|
case Title : m_handler = new SectionHandler(*this, name, attributes); break;
|
|
case Title : m_handler = new SectionHandler(*this, name, attributes); break;
|
|
case Poem : m_handler = new SectionHandler(*this, name, attributes); break;
|
|
case Poem : m_handler = new SectionHandler(*this, name, attributes); break;
|