Skip to content

Commit 40acf3a

Browse files
author
Friedrich W. H. Kossebau
committed
Let Session emit ProcessingBatchStart/End signals only via explicit helper method
1 parent 0ef8f12 commit 40acf3a

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
@@ -505,6 +505,22 @@ ops.OdtDocument = function OdtDocument(odfCanvas) {
505505
}
506506
};
507507

508+
/**
509+
* @param {*} args
510+
* @return {undefined}
511+
*/
512+
this.prepareBatchProcessing = function(args) {
513+
eventNotifier.emit(ops.OdtDocument.signalProcessingBatchStart, args);
514+
};
515+
516+
/**
517+
* @param {*} args
518+
* @return {undefined}
519+
*/
520+
this.finishBatchProcessing = function (args) {
521+
eventNotifier.emit(ops.OdtDocument.signalProcessingBatchEnd, args);
522+
};
523+
508524
/**
509525
* Upgrades literal whitespaces (' ') to <text:s> </text:s>,
510526
* 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)