[Libreoffice-commits] core.git: android/source libreofficekit/source

Miklos Vajna vmiklos at collabora.co.uk
Tue Nov 10 00:42:12 PST 2015


 android/source/res/drawable/handle_end.png    |binary
 android/source/res/drawable/handle_middle.png |binary
 android/source/res/drawable/handle_start.png  |binary
 libreofficekit/source/gtk/lokdocview.cxx      |   13 +++++++++++++
 4 files changed, 13 insertions(+)

New commits:
commit c044e51b9983d373cf3ea74aec0ffd37752f07a0
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Nov 10 09:40:10 2015 +0100

    lokdocview: assert that loading of handle bitmaps succeeded
    
    A number of such bitmaps were removed by accident in commit
    74463457b39c9def1add630b7b0581dc195549c8 (android: chanhe handles to use
    alias, tint handles with color, 2015-11-01).
    
    Change-Id: I253c4b5790e82de32e6fd06896645adf360fa586

diff --git a/android/source/res/drawable/handle_end.png b/android/source/res/drawable/handle_end.png
new file mode 100644
index 0000000..32b77df
Binary files /dev/null and b/android/source/res/drawable/handle_end.png differ
diff --git a/android/source/res/drawable/handle_middle.png b/android/source/res/drawable/handle_middle.png
new file mode 100644
index 0000000..751eb89
Binary files /dev/null and b/android/source/res/drawable/handle_middle.png differ
diff --git a/android/source/res/drawable/handle_start.png b/android/source/res/drawable/handle_start.png
new file mode 100644
index 0000000..cf12a0d
Binary files /dev/null and b/android/source/res/drawable/handle_start.png differ
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 475f388..b68405f 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -12,6 +12,7 @@
 #include <string.h>
 #include <vector>
 #include <string>
+#include <iostream>
 #include <boost/property_tree/json_parser.hpp>
 
 #include <com/sun/star/awt/Key.hpp>
@@ -1059,7 +1060,10 @@ renderOverlay(LOKDocView* pDocView, cairo_t* pCairo)
         // Have a cursor, but no selection: we need the middle handle.
         gchar* handleMiddlePath = g_strconcat (priv->m_aLOPath, "/../..", CURSOR_HANDLE_DIR, "handle_middle.png", NULL);
         if (!priv->m_pHandleMiddle)
+        {
             priv->m_pHandleMiddle = cairo_image_surface_create_from_png(handleMiddlePath);
+            assert(cairo_surface_status(priv->m_pHandleMiddle) == CAIRO_STATUS_SUCCESS);
+        }
         g_free (handleMiddlePath);
         renderHandle(pDocView, pCairo, priv->m_aVisibleCursor, priv->m_pHandleMiddle, priv->m_aHandleMiddleRect);
     }
@@ -1084,7 +1088,10 @@ renderOverlay(LOKDocView* pDocView, cairo_t* pCairo)
             // Have a start position: we need a start handle.
             gchar* handleStartPath = g_strconcat (priv->m_aLOPath, "/../..", CURSOR_HANDLE_DIR, "handle_start.png", NULL);
             if (!priv->m_pHandleStart)
+            {
                 priv->m_pHandleStart = cairo_image_surface_create_from_png(handleStartPath);
+                assert(cairo_surface_status(priv->m_pHandleStart) == CAIRO_STATUS_SUCCESS);
+            }
             renderHandle(pDocView, pCairo, priv->m_aTextSelectionStart, priv->m_pHandleStart, priv->m_aHandleStartRect);
             g_free (handleStartPath);
         }
@@ -1093,7 +1100,10 @@ renderOverlay(LOKDocView* pDocView, cairo_t* pCairo)
             // Have a start position: we need an end handle.
             gchar* handleEndPath = g_strconcat (priv->m_aLOPath, "/../..", CURSOR_HANDLE_DIR, "handle_end.png", NULL);
             if (!priv->m_pHandleEnd)
+            {
                 priv->m_pHandleEnd = cairo_image_surface_create_from_png(handleEndPath);
+                assert(cairo_surface_status(priv->m_pHandleEnd) == CAIRO_STATUS_SUCCESS);
+            }
             renderHandle(pDocView, pCairo, priv->m_aTextSelectionEnd, priv->m_pHandleEnd, priv->m_aHandleEndRect);
             g_free (handleEndPath);
         }
@@ -1103,7 +1113,10 @@ renderOverlay(LOKDocView* pDocView, cairo_t* pCairo)
     {
         gchar* handleGraphicPath = g_strconcat (priv->m_aLOPath, "/../..", CURSOR_HANDLE_DIR, "handle_graphic.png", NULL);
         if (!priv->m_pGraphicHandle)
+        {
             priv->m_pGraphicHandle = cairo_image_surface_create_from_png(handleGraphicPath);
+            assert(cairo_surface_status(priv->m_pGraphicHandle) == CAIRO_STATUS_SUCCESS);
+        }
         renderGraphicHandle(pDocView, pCairo, priv->m_aGraphicSelection, priv->m_pGraphicHandle);
         g_free (handleGraphicPath);
     }


More information about the Libreoffice-commits mailing list