android/source/src/java/org/libreoffice/LOKitThread.java |   12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

New commits:
commit 9ab43aebad67383057d2cc3f754ce2193fa78b4e
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Dec 4 17:18:20 2019 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed Dec 4 22:19:41 2019 +0100

    android: Allow zooming for Calc as well
    
    The comment mentioning "Calc has a fixed zoom at 1x
    and doesn't allow zooming for now" was there since
    support for the Calc UI was added in commit
    02f3c4848ab52358bfee56c570a19a3a071574f2  ("Calc UI
    on Android Viewer") in 2017. That seems no longer to be
    the case however, probably since commit
    498dceb43f870bf9e380f1f87e99c6ccadf1963c
    ("sc lok: Implement hi-dpi and zoom for spreadsheets.").
    
    Zooming in and out was working just fine when I tested this
    with Android Viewer using a spreadsheet containing some text
    and numbers, as well as a chart and an image.
    
    Therefore, allow zooming for Calc as well.
    
    Don't allow to set min zoom below the page width for Calc as
    somewhat suggested by the existing comment ("applies to all
    types of document; in the future spreadsheets may be
    singled out"). I don't see a particular reason for this and
    using 0f for minZoom would break double-tap zoom.
    
    Change-Id: Ib08439edbbac59a00005213b533df5792da965ee
    Reviewed-on: https://gerrit.libreoffice.org/84421
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/android/source/src/java/org/libreoffice/LOKitThread.java 
b/android/source/src/java/org/libreoffice/LOKitThread.java
index 846e6658d7cd..c9d1fa0508bd 100644
--- a/android/source/src/java/org/libreoffice/LOKitThread.java
+++ b/android/source/src/java/org/libreoffice/LOKitThread.java
@@ -183,15 +183,9 @@ class LOKitThread extends Thread {
     private void updateZoomConstraints() {
         if (mTileProvider == null) return;
         mLayerClient = mContext.getLayerClient();
-        if (mTileProvider.isSpreadsheet()) {
-            // Calc has a fixed zoom at 1x and doesn't allow zooming for now
-            mLayerClient.setZoomConstraints(new ZoomConstraints(false, 1f, 0f, 
0f));
-        } else {
-            // Set min zoom to the page width so that you cannot zoom below 
page width
-            // applies to all types of document; in the future spreadsheets 
may be singled out
-            float minZoom = 
mLayerClient.getViewportMetrics().getWidth()/mTileProvider.getPageWidth();
-            mLayerClient.setZoomConstraints(new ZoomConstraints(true, 1f, 
minZoom, 0f));
-        }
+        // Set min zoom to the page width so that you cannot zoom below page 
width
+        final float minZoom = 
mLayerClient.getViewportMetrics().getWidth()/mTileProvider.getPageWidth();
+        mLayerClient.setZoomConstraints(new ZoomConstraints(true, 1f, minZoom, 
0f));
     }
 
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to