Skip to content

Commit

Permalink
FIXED: Incorrectly handled non-heading text in OOXML.
Browse files Browse the repository at this point in the history
  • Loading branch information
gottcode committed Sep 18, 2016
1 parent 616f2bc commit f38e418
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/fileformats/docx_reader.cpp
Expand Up @@ -355,8 +355,10 @@ void DocxReader::readParagraphProperties(Style& style, bool allowstyles)
style.block_format.setLayoutDirection(Qt::LeftToRight);
}
} else if (m_xml.qualifiedName() == "w:outlineLvl") {
int heading = qBound(1, m_xml.attributes().value("w:val").toString().toInt() + 1, 6);
style.block_format.setProperty(QTextFormat::UserProperty, heading);
int heading = m_xml.attributes().value("w:val").toString().toInt();
if (heading != 9) {
style.block_format.setProperty(QTextFormat::UserProperty, qBound(1, heading + 1, 6));
}
} else if ((m_xml.qualifiedName() == "w:pStyle") && allowstyles) {
Style pstyle = m_styles.value(value.toString());
pstyle.merge(style);
Expand Down

0 comments on commit f38e418

Please sign in to comment.