[Libreoffice-commits] core.git: 6 commits - android/experimental sal/osl vcl/android

Tor Lillqvist tml at iki.fi
Thu Feb 28 14:37:43 PST 2013


 android/experimental/desktop/src/org/libreoffice/experimental/desktop/Desktop.java |   11 +--
 sal/osl/unx/file.cxx                                                               |    9 +--
 vcl/android/androidinst.cxx                                                        |   28 +---------
 3 files changed, 12 insertions(+), 36 deletions(-)

New commits:
commit 043f614a3e6e68c26f2f4af609e6b2701e368156
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Mar 1 00:36:21 2013 +0200

    Bin some unnecessarily verbose logging
    
    Change-Id: I9c9b2a5405f994f180bd51a3a6c91815d0f70435

diff --git a/android/experimental/desktop/src/org/libreoffice/experimental/desktop/Desktop.java b/android/experimental/desktop/src/org/libreoffice/experimental/desktop/Desktop.java
index 997a942..d4ded73 100644
--- a/android/experimental/desktop/src/org/libreoffice/experimental/desktop/Desktop.java
+++ b/android/experimental/desktop/src/org/libreoffice/experimental/desktop/Desktop.java
@@ -232,7 +232,6 @@ public class Desktop
                 return super.onTouchEvent(event);
 
             super.onTouchEvent(event);
-            Log.d(TAG, "onTouch (" + event.getX() + "," + event.getY() + ")");
 
             // Just temporary hack. We should not show the keyboard
             // unconditionally on a ACTION_UP event here. The LO level
@@ -261,8 +260,6 @@ public class Desktop
         }
 
         @Override public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
-            Log.d(TAG, "onCreateInputConnection");
-
             BaseInputConnection fic = new LOInputConnection(this, true);
             outAttrs.actionLabel = null;
             outAttrs.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
@@ -272,7 +269,6 @@ public class Desktop
         }
 
         @Override public boolean onCheckIsTextEditor() {
-            Log.d(TAG, "onCheckIsTextEditor");
             return renderedOnce;
         }
     }
@@ -285,7 +281,6 @@ public class Desktop
         }
 
         @Override public boolean commitText(CharSequence text, int newCursorPosition) {
-            Log.i(TAG, "commitText(" + text + ", " + newCursorPosition + ")");
             for (int i = 0; i < text.length(); i++) {
                 Desktop.key(text.charAt(i), Desktop.getTimestamp());
             }
commit e63165c685e96acb7939b15db61328eef79ff920
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Mar 1 00:32:05 2013 +0200

    Pass touch events on to the ScaleGestureDetector
    
    Note that the listener doesn't do anything with the scale gestures yet,
    though. I guesss either a new type of VCL event is needed for zooming, or then
    we could fake entering of Control-+ and Control-- key events (or whatever the
    default bindings for zoom in and out are).
    
    Change-Id: Ib2ba138dd3e7874f85e9fc9fb7ac7198fa6212d3

diff --git a/android/experimental/desktop/src/org/libreoffice/experimental/desktop/Desktop.java b/android/experimental/desktop/src/org/libreoffice/experimental/desktop/Desktop.java
index e471a7d..997a942 100644
--- a/android/experimental/desktop/src/org/libreoffice/experimental/desktop/Desktop.java
+++ b/android/experimental/desktop/src/org/libreoffice/experimental/desktop/Desktop.java
@@ -226,6 +226,8 @@ public class Desktop
 
         @Override public boolean onTouchEvent(MotionEvent event)
         {
+            gestureDetector.onTouchEvent(event);
+
             if (!renderedOnce)
                 return super.onTouchEvent(event);
 
commit 18df08f974074c4263c357351beabda4fad6cb1b
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Mar 1 00:20:16 2013 +0200

    Bin two lines of logging that are too repetitive to be useful
    
    Change-Id: I460614dba8f162a8bedcf0bf847614fae9b05910

diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx
index ab6278a..2c54a0e 100644
--- a/vcl/android/androidinst.cxx
+++ b/vcl/android/androidinst.cxx
@@ -210,10 +210,6 @@ static void BlitFrameRegionToWindow(ANativeWindow_Buffer *pOutBuffer,
                                     const ARect &rSrcRect,
                                     int nDestX, int nDestY)
 {
-    LOGI("Blit frame src %d,%d->%d,%d to position %d, %d",
-             rSrcRect.left, rSrcRect.top, rSrcRect.right, rSrcRect.bottom,
-             nDestX, nDestY);
-
     basebmp::RawMemorySharedArray aSrcData = aDev->getBuffer();
     basegfx::B2IVector aDevSize = aDev->getSize();
     sal_Int32 nStride = aDev->getScanlineStride();
@@ -278,7 +274,6 @@ void AndroidSalInstance::RedrawWindows(ANativeWindow *pWindow, ANativeWindow_Buf
     ANativeWindow_Buffer aOutBuffer;
     memset ((void *)&aOutBuffer, 0, sizeof (aOutBuffer));
 
-    int32_t nRet = 0;
     if (pBuffer != NULL)
         aOutBuffer = *pBuffer;
     else
@@ -288,26 +283,11 @@ void AndroidSalInstance::RedrawWindows(ANativeWindow *pWindow, ANativeWindow_Buf
 
         //    ARect aRect;
         LOGI("pre lock #3");
-        nRet = ANativeWindow_lock(pWindow, &aOutBuffer, NULL);
+        ANativeWindow_lock(pWindow, &aOutBuffer, NULL);
     }
-    LOGI("Frame count: %d locked window %d returned " // rect:  %d,%d->%d,%d "
-             "buffer: %dx%d stride %d, format %d, bits %p",
-             (int)getFrames().size(),
-             nRet, // aRect.left, aRect.top, aRect.right, aRect.bottom,
-             aOutBuffer.width, aOutBuffer.height, aOutBuffer.stride,
-             aOutBuffer.format, aOutBuffer.bits);
+
     if (aOutBuffer.bits != NULL)
     {
-
-#if 0   // pre-'clean' the buffer with cruft:
-        // hard-code / guess at a format ...
-        int32_t *p = (int32_t *)aOutBuffer.bits;
-        for (int32_t y = 0; y < aOutBuffer.height; y++)
-        {
-            for (int32_t x = 0; x < aOutBuffer.stride; x++)
-                *p++ = (y << 24) + (x << 10) + 0xff ;
-        }
-#endif
         int i = 0;
         std::list< SalFrame* >::const_iterator it;
         for ( it = getFrames().begin(); it != getFrames().end(); i++, it++ )
commit 1e254b3a508eb7b99ace65587fc0e5719efca801
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Mar 1 00:18:48 2013 +0200

    The RGBA bytes are already in the order we want
    
    Change-Id: Ib4434400b110f8056b3291c0d48fe6548a7a9e8e

diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx
index 4b7b5ae..ab6278a 100644
--- a/vcl/android/androidinst.cxx
+++ b/vcl/android/androidinst.cxx
@@ -236,9 +236,9 @@ static void BlitFrameRegionToWindow(ANativeWindow_Buffer *pOutBuffer,
                                   nDestX * 4 /* dest pixel size */ );
             for (unsigned int x = 0; x < (unsigned int)(aSrcRect.right - aSrcRect.left); x++)
             {
-                dp[x*4 + 0] = sp[x*4 + 2]; // R
+                dp[x*4 + 0] = sp[x*4 + 0]; // R
                 dp[x*4 + 1] = sp[x*4 + 1]; // G
-                dp[x*4 + 2] = sp[x*4 + 0]; // B
+                dp[x*4 + 2] = sp[x*4 + 2]; // B
                 dp[x*4 + 3] = 255; // A
             }
             break;
commit 429827a3e83121cbddd99e1f0df3611203f04171
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Mar 1 00:18:00 2013 +0200

    Loading a test document works now
    
    Change-Id: I02f8ff9c1a2379fe03dff4e5a0dd4a05634d4034

diff --git a/android/experimental/desktop/src/org/libreoffice/experimental/desktop/Desktop.java b/android/experimental/desktop/src/org/libreoffice/experimental/desktop/Desktop.java
index 22e15ac..e471a7d 100644
--- a/android/experimental/desktop/src/org/libreoffice/experimental/desktop/Desktop.java
+++ b/android/experimental/desktop/src/org/libreoffice/experimental/desktop/Desktop.java
@@ -110,8 +110,8 @@ public class Desktop
             String input;
 //            input = getIntent().getStringExtra("input");
 //            if (input == null)
-//            input = "/assets/test1.odt";
-            input = "--writer";
+            input = "/assets/test1.odt";
+//          input = "--writer";
 
             // We need to fake up an argv, and the argv[0] even needs to
             // point to some file name that we can pretend is the "program".
commit 3c06db79d32583c6953d503f547a4ac5d78e608b
Author: Tor Lillqvist <tml at iki.fi>
Date:   Thu Feb 28 23:57:58 2013 +0200

    Open files from /assets (i.e. read-only) even if asked for write access
    
    It seems to work better to silently "open" a such file read-only even if write
    access is requested, and let write attempts, if any, fail later. Otherwise
    loading a document from /assets fails with that idiotic "General Error"
    dialog...
    
    Change-Id: I95cbe18010ec5e75ee5993faef2656ae8a2f981b

diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index d1840a3..d3f6251 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -859,11 +859,10 @@ SAL_CALL osl_openFilePath( const char *cpFilePath, oslFileHandle* pHandle, sal_u
     {
         if (uFlags & osl_File_OpenFlag_Write)
         {
-            // Or should we just silently "open" it read-only and let write
-            // attempts, if any, fail then later?
-            OSL_TRACE("osl_openFile(%s, writeable), not possible!", cpFilePath);
-            errno = EPERM;
-            return osl_File_E_PERM;
+            // It seems to work better to silently "open" it read-only
+            // and let write attempts, if any, fail later. Otherwise
+            // loading a document from /assets fails with that idiotic
+            // "General Error" dialog...
         }
         void *address;
         size_t size;


More information about the Libreoffice-commits mailing list