Skip to content

Commit 9fcb16a

Browse files
author
Friedrich W. H. Kossebau
committed
Let Session emit ProcessingBatchStart/End signals only via explicit helper method
1 parent b52dc79 commit 9fcb16a

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

webodf/lib/ops/OdtDocument.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,22 @@ ops.OdtDocument = function OdtDocument(odfCanvas) {
502502
}
503503
};
504504

505+
/**
506+
* @param {*} args
507+
* @return {undefined}
508+
*/
509+
this.prepareBatchProcessing = function(args) {
510+
eventNotifier.emit(ops.OdtDocument.signalProcessingBatchStart, args);
511+
};
512+
513+
/**
514+
* @param {*} args
515+
* @return {undefined}
516+
*/
517+
this.finishBatchProcessing = function (args) {
518+
eventNotifier.emit(ops.OdtDocument.signalProcessingBatchEnd, args);
519+
};
520+
505521
/**
506522
* Upgrades literal whitespaces (' ') to <text:s> </text:s>,
507523
* when given a textNode containing the whitespace and an offset

webodf/lib/ops/Session.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ ops.Session = function Session(odfCanvas) {
4646
* @return {undefined}
4747
*/
4848
function forwardBatchStart(args) {
49-
odtDocument.emit(ops.OdtDocument.signalProcessingBatchStart, args);
49+
odtDocument.prepareBatchProcessing(args);
5050
}
5151

5252
/**
@@ -55,7 +55,7 @@ ops.Session = function Session(odfCanvas) {
5555
* @return {undefined}
5656
*/
5757
function forwardBatchEnd(args) {
58-
odtDocument.emit(ops.OdtDocument.signalProcessingBatchEnd, args);
58+
odtDocument.finishBatchProcessing(args);
5959
}
6060

6161
/**

0 commit comments

Comments
 (0)