Skip to content

Commit 4ac191b

Browse files
author
Friedrich W. H. Kossebau
committed
Let SessionController emit signalCursorMoved only via explicit helper method
1 parent cf6ab24 commit 4ac191b

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
@@ -958,6 +958,15 @@ ops.OdtDocument = function OdtDocument(odfCanvas) {
958958
self.emit(ops.OdtDocument.signalStepsRemoved, args);
959959
};
960960

961+
/**
962+
* Emit the signal that the passed cursor moved.
963+
* @param {!ops.OdtCursor} cursor
964+
* @return {undefined}
965+
*/
966+
this.emitSignalCursorMoved = function(cursor) {
967+
eventNotifier.emit(ops.Document.signalCursorMoved, cursor);
968+
};
969+
961970
/**
962971
* @return {undefined}
963972
*/

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)