mirror of
https://github.com/optilude/xlsx-template.git
synced 2026-07-02 08:27:39 +08:00
Fixed issue #30
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
.DS_Store
|
||||
*.swp
|
||||
node_modules
|
||||
*.log
|
||||
extract/
|
||||
|
||||
+9
-7
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user