-
Notifications
You must be signed in to change notification settings - Fork 0
/
fix-pdf-export.diff
54 lines (46 loc) · 1.69 KB
/
fix-pdf-export.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
diff --git a/src/text/fmt/gtk/fv_UnixSelectionHandles.cpp b/src/text/fmt/gtk/fv_UnixSelectionHandles.cpp
index 935e8fa..3032aed 100644
--- a/src/text/fmt/gtk/fv_UnixSelectionHandles.cpp
+++ b/src/text/fmt/gtk/fv_UnixSelectionHandles.cpp
@@ -50,6 +50,12 @@ FV_UnixSelectionHandles::FV_UnixSelectionHandles(FV_View *view, FV_Selection sel
: FV_SelectionHandles (view, selection)
{
XAP_Frame * pFrame = static_cast<XAP_Frame*>(m_pView->getParentData());
+
+ if (!pFrame) {
+ m_text_handle = NULL;
+ return;
+ }
+
XAP_UnixFrameImpl * pFrameImpl =static_cast<XAP_UnixFrameImpl *>( pFrame->getFrameImpl());
GtkWidget * pWidget = pFrameImpl->getViewWidget();
@@ -62,11 +68,15 @@ FV_UnixSelectionHandles::FV_UnixSelectionHandles(FV_View *view, FV_Selection sel
FV_UnixSelectionHandles::~FV_UnixSelectionHandles()
{
- g_object_unref (m_text_handle);
+ if (m_text_handle)
+ 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);
}
@@ -74,6 +84,9 @@ void FV_UnixSelectionHandles::setCursorCoords(UT_sint32 x, UT_sint32 y, UT_uint3
{
GdkRectangle rect;
+ if (!m_text_handle)
+ return;
+
_fv_text_handle_set_mode(m_text_handle, FV_TEXT_HANDLE_MODE_CURSOR);
_fv_text_handle_set_visible (m_text_handle, FV_TEXT_HANDLE_POSITION_CURSOR, visible);
@@ -94,6 +107,9 @@ void FV_UnixSelectionHandles::setSelectionCoords(UT_sint32 start_x, UT_sint32 st
{
GdkRectangle rect;
+ if (!m_text_handle)
+ return;
+
_fv_text_handle_set_mode(m_text_handle, FV_TEXT_HANDLE_MODE_SELECTION);
_fv_text_handle_set_visible (m_text_handle, FV_TEXT_HANDLE_POSITION_SELECTION_START, start_visible);