summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-11-10 09:40:10 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-11-10 09:41:09 +0100
commitc044e51b9983d373cf3ea74aec0ffd37752f07a0 (patch)
treecdd31d0df87f81d9fa007a7a6dbb127c9296b22a
parentc3efbb1d23fcdd9df4f6f77525dc8db0b527b115 (diff)
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
-rw-r--r--android/source/res/drawable/handle_end.pngbin0 -> 1734 bytes
-rw-r--r--android/source/res/drawable/handle_middle.pngbin0 -> 1850 bytes
-rw-r--r--android/source/res/drawable/handle_start.pngbin0 -> 1676 bytes
-rw-r--r--libreofficekit/source/gtk/lokdocview.cxx13
4 files changed, 13 insertions, 0 deletions
diff --git a/android/source/res/drawable/handle_end.png b/android/source/res/drawable/handle_end.png
new file mode 100644
index 000000000000..32b77dfa6e26
--- /dev/null
+++ b/android/source/res/drawable/handle_end.png
Binary files differ
diff --git a/android/source/res/drawable/handle_middle.png b/android/source/res/drawable/handle_middle.png
new file mode 100644
index 000000000000..751eb898b136
--- /dev/null
+++ b/android/source/res/drawable/handle_middle.png
Binary files differ
diff --git a/android/source/res/drawable/handle_start.png b/android/source/res/drawable/handle_start.png
new file mode 100644
index 000000000000..cf12a0dcdcf3
--- /dev/null
+++ b/android/source/res/drawable/handle_start.png
Binary files differ
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 475f388d53f8..b68405f250f7 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);
}