Allow tile-twips coordinates for chart/draw edit cursor messages for now

Print twips coordinates for chart/draw edit-cursor is not there yet in
core (needs more work).

Change-Id: If8cd9431fa43351340c74e989ee837f4b1b859dd
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98152
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Tested-by: Jenkins
Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
This commit is contained in:
Dennis Francis 2020-06-06 13:30:18 +05:30
parent b882da11ee
commit a42d4103e7

View file

@ -780,7 +780,10 @@ L.CalcTileLayer = L.TileLayer.extend({
_getEditCursorRectangle: function (msgObj) {
if (!this.options.printTwipsMsgsEnabled) {
if (!this.options.printTwipsMsgsEnabled ||
!msgObj.hasOwnProperty('relrect') || !msgObj.hasOwnProperty('refpoint')) {
// 1) non-print-twips messaging mode OR
// 2) the edit-cursor belongs to draw/chart objects.
return L.TileLayer.prototype._getEditCursorRectangle.call(this, msgObj);
}
@ -789,13 +792,6 @@ L.CalcTileLayer = L.TileLayer.extend({
return undefined;
}
if (!msgObj.hasOwnProperty('relrect') || !msgObj.hasOwnProperty('refpoint')) {
// This can happen because the kit sends such messages (sometimes)
// after doing its own parsing (probably needed for writer/impress?).
// These aren't needed for Calc.
return undefined;
}
var relrect = L.Bounds.parse(msgObj.relrect);
var refpoint = L.Point.parse(msgObj.refpoint);
refpoint = this.sheetGeometry.getTileTwipsPointFromPrint(refpoint);