loleaflet/src/map/handler/Map.TouchGesture.js |   23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

New commits:
commit 56f93367b438f67b6fc38a5055079d12485a275c
Author:     Muhammet Kara <muhammet.k...@collabora.com>
AuthorDate: Wed Jul 24 18:11:56 2019 +0300
Commit:     Muhammet Kara <muhammet.k...@collabora.com>
CommitDate: Wed Sep 25 20:50:15 2019 +0200

    Fix range selection for Function Wizard on mobile
    
    [ Miklos: cherry-pick this early as it has no change-id. ]
    
    Change-Id: Ifb4229d9b3aacb3248dc16be11edd2a9c3379a27
    Reviewed-on: https://gerrit.libreoffice.org/79550
    Reviewed-by: Muhammet Kara <muhammet.k...@collabora.com>
    Tested-by: Muhammet Kara <muhammet.k...@collabora.com>

diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js 
b/loleaflet/src/map/handler/Map.TouchGesture.js
index 6081c8539..e78709e56 100644
--- a/loleaflet/src/map/handler/Map.TouchGesture.js
+++ b/loleaflet/src/map/handler/Map.TouchGesture.js
@@ -120,11 +120,30 @@ L.Map.TouchGesture = L.Handler.extend({
 
        _onHammer: function (e) {
                this._map.notifyActive();
+
+               // Function/Formula Wizard keeps the formula cell active all 
the time,
+               // so the usual range selection doesn't work here.
+               // Instead, the cells are highlighted with a certain color and 
opacity
+               // to mark as selection. And that's why we are checking for it 
here.
+               // FIXME: JS-ify. This code is written by a C++ dev.
+               function getFuncWizRangeBounds (obj) {
+                       for (var i in obj._map._layers) {
+                               if (obj._map._layers[i].options && 
obj._map._layers[i].options.fillColor
+                                       && 
obj._map._layers[i].options.fillOpacity) {
+                                       if 
(obj._map._layers[i].options.fillColor === '#ef0fff'
+                                               && 
obj._map._layers[i].options.fillOpacity === 0.25) {
+                                               return 
obj._map._layers[i]._bounds;
+                                       }
+                               }
+                       }
+               }
+
                if (e.isFirst) {
                        var point = e.pointers[0],
                            containerPoint = 
this._map.mouseEventToContainerPoint(point),
                            layerPoint = 
this._map.containerPointToLayerPoint(containerPoint),
-                           latlng = this._map.layerPointToLatLng(layerPoint);
+                           latlng = this._map.layerPointToLatLng(layerPoint),
+                       funcWizardRangeBounds = getFuncWizRangeBounds(this);
 
                        if (this._map._docLayer._graphicMarker) {
                                this._marker = 
this._map._docLayer._graphicMarker.transform.getMarker(layerPoint);
@@ -136,6 +155,8 @@ L.Map.TouchGesture = L.Handler.extend({
                                this._state = L.Map.TouchGesture.GRAPHIC;
                        } else if (this._map._docLayer._cellCursor && 
this._map._docLayer._cellCursor.contains(latlng)) {
                                this._state = L.Map.TouchGesture.CURSOR;
+                       } else if (this._map._docLayer._cellCursor && 
funcWizardRangeBounds && funcWizardRangeBounds.contains(latlng)) {
+                               this._state = L.Map.TouchGesture.CURSOR;
                        } else {
                                this._state = L.Map.TouchGesture.MAP;
                        }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to