Skip to content

Commit

Permalink
Add import of strikethrough and underlined text from PDF
Browse files Browse the repository at this point in the history
  • Loading branch information
iljukhaput authored and dimkanovikov committed Oct 24, 2024
1 parent 1163741 commit 3e914ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ QString AbstractDocumentImporter::parseDocument(const ImportOptions& _options,
writer.writeStartElement(xml::kFormatsTag);
for (const auto& range : currentBlock.textFormats()) {
if (range.format.fontWeight() != QFont::Normal || range.format.fontItalic()
|| range.format.fontUnderline()) {
|| range.format.fontUnderline() || range.format.fontStrikeOut()) {
writer.writeEmptyElement(xml::kFormatTag);
writer.writeAttribute(xml::kFromAttribute,
QString::number(range.start));
Expand All @@ -429,13 +429,13 @@ QString AbstractDocumentImporter::parseDocument(const ImportOptions& _options,
if (range.format.fontWeight() != QFont::Normal) {
writer.writeAttribute(xml::kBoldAttribute, "true");
}
if (range.format.boolProperty(QTextFormat::FontItalic)) {
if (range.format.fontItalic()) {
writer.writeAttribute(xml::kItalicAttribute, "true");
}
if (range.format.boolProperty(QTextFormat::TextUnderlineStyle)) {
if (range.format.fontUnderline()) {
writer.writeAttribute(xml::kUnderlineAttribute, "true");
}
if (range.format.boolProperty(QTextFormat::FontStrikeOut)) {
if (range.format.fontStrikeOut()) {
writer.writeAttribute(xml::kStrikethroughAttribute, "true");
}
}
Expand Down

0 comments on commit 3e914ac

Please sign in to comment.