Skip to content

Commit 5fea1ba

Browse files
author
Friedrich W. H. Kossebau
committed
Let SessionController emit signalCursorMoved only via explicit helper method
1 parent 59f94c6 commit 5fea1ba

4 files changed

Lines changed: 12 additions & 4 deletions

File tree

webodf/lib/gui/SessionController.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ gui.SessionControllerOptions = function () {
374374
newSelectionRange.setEnd(shadowCursorIterator.container(), shadowCursorIterator.unfilteredDomOffset());
375375
}
376376
shadowCursor.setSelectedRange(newSelectionRange, handleEnd === 'right');
377-
odtDocument.emit(ops.Document.signalCursorMoved, shadowCursor);
377+
odtDocument.emitSignalCursorMoved(shadowCursor);
378378
}
379379
}
380380
}
@@ -400,7 +400,7 @@ gui.SessionControllerOptions = function () {
400400
selectionController.expandToParagraphBoundaries(selectionRange.range);
401401
}
402402
shadowCursor.setSelectedRange(selectionRange.range, selectionRange.hasForwardSelection);
403-
odtDocument.emit(ops.Document.signalCursorMoved, shadowCursor);
403+
odtDocument.emitSignalCursorMoved(shadowCursor);
404404
}
405405
}
406406
}

webodf/lib/ops/OdtDocument.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,15 @@ ops.OdtDocument = function OdtDocument(odfCanvas) {
961961
self.emit(ops.OdtDocument.signalStepsRemoved, args);
962962
};
963963

964+
/**
965+
* Emit the signal that the passed cursor moved.
966+
* @param {!ops.OdtCursor} cursor
967+
* @return {undefined}
968+
*/
969+
this.emitSignalCursorMoved = function(cursor) {
970+
eventNotifier.emit(ops.Document.signalCursorMoved, cursor);
971+
};
972+
964973
/**
965974
* @return {undefined}
966975
*/

webodf/tests/gui/DirectFormattingControllerTests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ gui.DirectFormattingControllerTests = function DirectFormattingControllerTests(r
140140
domUtils.getElementsByTagNameNS(node, testns, '*').forEach(function(node) {
141141
node.parentNode.removeChild(node);
142142
});
143-
t.odtDocument.emit(ops.Document.signalCursorMoved, t.cursor);
143+
t.odtDocument.emitSignalCursorMoved(t.cursor);
144144
}
145145
return node;
146146
}

webodf/tests/manifest.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
"odf.ObjectNameGenerator",
5050
"odf.OdfCanvas",
5151
"odf.OdfContainer",
52-
"ops.Document",
5352
"ops.OdtCursor",
5453
"ops.OdtDocument",
5554
"ops.Session"

0 commit comments

Comments
 (0)