@@ -31,6 +31,7 @@ const PageSetupXform = require('../../xlsx/xform/sheet/page-setup-xform');
31
31
const AutoFilterXform = require ( '../../xlsx/xform/sheet/auto-filter-xform' ) ;
32
32
const PictureXform = require ( '../../xlsx/xform/sheet/picture-xform' ) ;
33
33
const ConditionalFormattingsXform = require ( '../../xlsx/xform/sheet/cf/conditional-formattings-xform' ) ;
34
+ const RowBreaksXform = require ( '../../xlsx/xform/sheet/row-breaks-xform' ) ;
34
35
35
36
// since prepare and render are functional, we can use singletons
36
37
const xform = {
@@ -47,6 +48,7 @@ const xform = {
47
48
autoFilter : new AutoFilterXform ( ) ,
48
49
picture : new PictureXform ( ) ,
49
50
conditionalFormattings : new ConditionalFormattingsXform ( ) ,
51
+ rowBreaks : new RowBreaksXform ( ) ,
50
52
} ;
51
53
52
54
// ============================================================================================
@@ -72,7 +74,7 @@ class WorksheetWriter {
72
74
// column keys (addRow convenience): key ==> this._columns index
73
75
this . _keys = { } ;
74
76
75
- // keep record of all merges
77
+ // keep a record of all row and column pageBreaks
76
78
this . _merges = [ ] ;
77
79
this . _merges . add = function ( ) { } ; // ignore cell instruction
78
80
@@ -100,6 +102,9 @@ class WorksheetWriter {
100
102
// keep a record of conditionalFormattings
101
103
this . conditionalFormatting = [ ] ;
102
104
105
+ // keep a record of all row and column pageBreaks
106
+ this . rowBreaks = [ ] ;
107
+
103
108
// for default row height, outline levels, etc
104
109
this . properties = Object . assign (
105
110
{ } ,
@@ -214,6 +219,7 @@ class WorksheetWriter {
214
219
this . _writePageMargins ( ) ;
215
220
this . _writePageSetup ( ) ;
216
221
this . _writeBackground ( ) ;
222
+ this . _writeRowBreaks ( ) ;
217
223
218
224
// Legacy Data tag for comments
219
225
this . _writeLegacyData ( ) ;
@@ -580,6 +586,10 @@ class WorksheetWriter {
580
586
this . stream . write ( xform . conditionalFormattings . toXml ( this . conditionalFormatting ) ) ;
581
587
}
582
588
589
+ _writeRowBreaks ( ) {
590
+ this . stream . write ( xform . rowBreaks . toXml ( this . rowBreaks ) ) ;
591
+ }
592
+
583
593
_writeDataValidations ( ) {
584
594
this . stream . write ( xform . dataValidations . toXml ( this . dataValidations . model ) ) ;
585
595
}
0 commit comments