aboutsummaryrefslogtreecommitdiffstats
path: root/main/abiword/pdf.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-02-03 08:02:15 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-02-03 08:02:56 +0000
commit1c7d7f104943da2fe9a9559537e6f2e3b2ad5314 (patch)
treeaa59fa917275335898cd97475ab08e0f749e4fcd /main/abiword/pdf.patch
parent776021e972760971ec9eddddb01368fb5812dc28 (diff)
downloadaports-1c7d7f104943da2fe9a9559537e6f2e3b2ad5314.tar.bz2
aports-1c7d7f104943da2fe9a9559537e6f2e3b2ad5314.tar.xz
main/abiword: fix crash on save as pdf
http://bugzilla.abisource.com/show_bug.cgi?id=13586
Diffstat (limited to 'main/abiword/pdf.patch')
-rw-r--r--main/abiword/pdf.patch88
1 files changed, 88 insertions, 0 deletions
diff --git a/main/abiword/pdf.patch b/main/abiword/pdf.patch
new file mode 100644
index 0000000000..0c3d0bb98c
--- /dev/null
+++ b/main/abiword/pdf.patch
@@ -0,0 +1,88 @@
+http://bugzilla.abisource.com/show_bug.cgi?id=13586
+
+Index: src/text/fmt/gtk/fv_UnixSelectionHandles.cpp
+===================================================================
+--- ./src/text/fmt/gtk/fv_UnixSelectionHandles.cpp (revision 33662)
++++ ./src/text/fmt/gtk/fv_UnixSelectionHandles.cpp (revision 33663)
+@@ -36,42 +36,60 @@
+
+ mode = _fv_text_handle_get_mode (handle);
+
+- if (pos == FV_TEXT_HANDLE_POSITION_SELECTION_START)
++ if (pos == FV_TEXT_HANDLE_POSITION_SELECTION_START) {
+ handles->updateSelectionStart ((UT_sint32)x, (UT_sint32)y);
++ }
+ else {
+- if (mode == FV_TEXT_HANDLE_MODE_SELECTION)
++ if (mode == FV_TEXT_HANDLE_MODE_SELECTION) {
+ handles->updateSelectionEnd ((UT_sint32)x, (UT_sint32)y);
+- else
++ }
++ else {
+ handles->updateCursor((UT_sint32)x, (UT_sint32)y);
++ }
+ }
+ }
+
+ FV_UnixSelectionHandles::FV_UnixSelectionHandles(FV_View *view, FV_Selection selection)
+ : FV_SelectionHandles (view, selection)
++ , m_text_handle(NULL)
+ {
+ XAP_Frame * pFrame = static_cast<XAP_Frame*>(m_pView->getParentData());
+- XAP_UnixFrameImpl * pFrameImpl =static_cast<XAP_UnixFrameImpl *>( pFrame->getFrameImpl());
+- GtkWidget * pWidget = pFrameImpl->getViewWidget();
++ // When saving to PDF (and printing) we don't have a frame
++ // See bug 13586
++ if (pFrame) {
++ XAP_UnixFrameImpl * pFrameImpl = static_cast<XAP_UnixFrameImpl *>(pFrame->getFrameImpl());
++ GtkWidget * pWidget = pFrameImpl->getViewWidget();
+
+- m_text_handle = _fv_text_handle_new (pWidget);
+- _fv_text_handle_set_relative_to (m_text_handle,
+- gtk_widget_get_window (pWidget));
+- g_signal_connect (m_text_handle, "handle-dragged",
+- G_CALLBACK(handle_dragged_cb), this);
++ m_text_handle = _fv_text_handle_new (pWidget);
++ _fv_text_handle_set_relative_to (m_text_handle,
++ gtk_widget_get_window (pWidget));
++ g_signal_connect (m_text_handle, "handle-dragged",
++ G_CALLBACK(handle_dragged_cb), this);
++ }
+ }
+
+ FV_UnixSelectionHandles::~FV_UnixSelectionHandles()
+ {
++ if(!m_text_handle) {
++ return;
++ }
+ g_object_unref (m_text_handle);
+ }
+
+ void FV_UnixSelectionHandles::hide()
+ {
++ if(!m_text_handle) {
++ return;
++ }
+ _fv_text_handle_set_mode (m_text_handle, FV_TEXT_HANDLE_MODE_NONE);
+ }
+
+ void FV_UnixSelectionHandles::setCursorCoords(UT_sint32 x, UT_sint32 y, UT_uint32 height, bool visible)
+ {
++ if(!m_text_handle) {
++ return;
++ }
++
+ GdkRectangle rect;
+
+ _fv_text_handle_set_mode(m_text_handle, FV_TEXT_HANDLE_MODE_CURSOR);
+@@ -92,6 +110,10 @@
+ void FV_UnixSelectionHandles::setSelectionCoords(UT_sint32 start_x, UT_sint32 start_y, UT_uint32 start_height, bool start_visible,
+ UT_sint32 end_x, UT_sint32 end_y, UT_uint32 end_height, bool end_visible)
+ {
++ if(!m_text_handle) {
++ return;
++ }
++
+ GdkRectangle rect;
+
+ _fv_text_handle_set_mode(m_text_handle, FV_TEXT_HANDLE_MODE_SELECTION);