summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-11-19 18:13:47 +0000
committerMichael Williamson <mike@zwobble.org>2016-11-19 18:13:47 +0000
commit954211d736386bebca30393e63481e04af429878 (patch)
treed40c8dcac6ad5fae62df8297566757b1760aa6d1
parent29be3ac8baadeb10ee827147b67a798348be6b9b (diff)
Simplify reading of verticalAlignment
-rw-r--r--lib/docx/body-reader.js5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/docx/body-reader.js b/lib/docx/body-reader.js
index 6bc1934..61dc79d 100644
--- a/lib/docx/body-reader.js
+++ b/lib/docx/body-reader.js
@@ -38,10 +38,7 @@ function BodyReader(options) {
type: "runProperties"
};
- var verticalAlignmentElement = element.first("w:vertAlign");
- if (verticalAlignmentElement) {
- properties.verticalAlignment = verticalAlignmentElement.attributes["w:val"];
- }
+ properties.verticalAlignment = element.firstOrEmpty("w:vertAlign").attributes["w:val"];
properties.font = element.firstOrEmpty("w:rFonts").attributes["w:ascii"];
properties.isBold = readBooleanElement(element.first("w:b"));
properties.isUnderline = readBooleanElement(element.first("w:u"));