Fixed issue #30

This commit is contained in:
Vincent Heuken
2017-09-14 16:31:09 -07:00
parent d3f6f6c8e1
commit d28051774a
2 changed files with 10 additions and 7 deletions
+1
View File
@@ -1,4 +1,5 @@
.DS_Store
*.swp
node_modules
*.log
extract/
+9 -7
View File
@@ -240,15 +240,17 @@ module.exports = (function() {
self.substituteTableColumnHeaders(namedTables, substitutions);
// Update <dimension /> if we added rows or columns
if(totalRowsInserted > 0 || totalColumnsInserted > 0) {
var dimensionRange = self.splitRange(dimension.attrib.ref),
dimensionEndRef = self.splitRef(dimensionRange.end);
if(dimension) {
if(totalRowsInserted > 0 || totalColumnsInserted > 0) {
var dimensionRange = self.splitRange(dimension.attrib.ref),
dimensionEndRef = self.splitRef(dimensionRange.end);
dimensionEndRef.row += totalRowsInserted;
dimensionEndRef.col = self.numToChar(self.charToNum(dimensionEndRef.col) + totalColumnsInserted);
dimensionRange.end = self.joinRef(dimensionEndRef);
dimensionEndRef.row += totalRowsInserted;
dimensionEndRef.col = self.numToChar(self.charToNum(dimensionEndRef.col) + totalColumnsInserted);
dimensionRange.end = self.joinRef(dimensionEndRef);
dimension.attrib.ref = self.joinRange(dimensionRange);
dimension.attrib.ref = self.joinRange(dimensionRange);
}
}
// Write back the modified XML trees