aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-02-13 19:12:25 +0000
committerMichael Williamson <mike@zwobble.org>2016-02-13 19:12:25 +0000
commit56cb9da5bfd621ffa49f82c525d0f5172ff8a2f0 (patch)
treed8e573da0ddd812cdff5c5970214fc1ed7c99bc4 /src/main
parent9415477ff50a54d51ed45968dd49fd524144ce42 (diff)
Read struckthrough runs
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/zwobble/mammoth/documents/Run.java7
-rw-r--r--src/main/java/org/zwobble/mammoth/docx/BodyXmlReader.java5
2 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/org/zwobble/mammoth/documents/Run.java b/src/main/java/org/zwobble/mammoth/documents/Run.java
index 73349ba..d903546 100644
--- a/src/main/java/org/zwobble/mammoth/documents/Run.java
+++ b/src/main/java/org/zwobble/mammoth/documents/Run.java
@@ -7,6 +7,7 @@ public class Run implements DocumentElement, HasChildren {
private final boolean isBold;
private final boolean isItalic;
private final boolean isUnderline;
+ private final boolean isStrikethrough;
private final Optional<Style> style;
private final List<DocumentElement> children;
@@ -14,12 +15,14 @@ public class Run implements DocumentElement, HasChildren {
boolean isBold,
boolean isItalic,
boolean isUnderline,
+ boolean isStrikethrough,
Optional<Style> style,
List<DocumentElement> children)
{
this.isBold = isBold;
this.isItalic = isItalic;
this.isUnderline = isUnderline;
+ this.isStrikethrough = isStrikethrough;
this.style = style;
this.children = children;
}
@@ -36,6 +39,10 @@ public class Run implements DocumentElement, HasChildren {
return isUnderline;
}
+ public boolean isStrikethrough() {
+ return isStrikethrough;
+ }
+
public Optional<Style> getStyle() {
return style;
}
diff --git a/src/main/java/org/zwobble/mammoth/docx/BodyXmlReader.java b/src/main/java/org/zwobble/mammoth/docx/BodyXmlReader.java
index 1cc7a34..7885c3f 100644
--- a/src/main/java/org/zwobble/mammoth/docx/BodyXmlReader.java
+++ b/src/main/java/org/zwobble/mammoth/docx/BodyXmlReader.java
@@ -53,6 +53,7 @@ public class BodyXmlReader {
isBold(properties),
isItalic(properties),
isUnderline(properties),
+ isStrikethrough(properties),
style,
children));
}
@@ -69,6 +70,10 @@ public class BodyXmlReader {
return properties.hasChild("w:u");
}
+ private boolean isStrikethrough(XmlElementLike properties) {
+ return properties.hasChild("w:strike");
+ }
+
private Result<Optional<Style>> readRunStyle(XmlElementLike properties) {
return readStyle(properties, "w:rStyle", "Run", styles::findCharacterStyleById);
}