Ticket #4093: fix-pdf-export.diff

File fix-pdf-export.diff, 1.7 KB (added by garnacho, 10 years ago)

patch

  • src/text/fmt/gtk/fv_UnixSelectionHandles.cpp

    diff --git a/src/text/fmt/gtk/fv_UnixSelectionHandles.cpp b/src/text/fmt/gtk/fv_UnixSelectionHandles.cpp
    index 935e8fa..3032aed 100644
    a b FV_UnixSelectionHandles::FV_UnixSelectionHandles(FV_View *view, FV_Selection sel 
    5050        : FV_SelectionHandles (view, selection)
    5151{
    5252        XAP_Frame * pFrame = static_cast<XAP_Frame*>(m_pView->getParentData());
     53
     54        if (!pFrame) {
     55                m_text_handle = NULL;
     56                return;
     57        }
     58
    5359        XAP_UnixFrameImpl * pFrameImpl =static_cast<XAP_UnixFrameImpl *>( pFrame->getFrameImpl());
    5460        GtkWidget * pWidget = pFrameImpl->getViewWidget();
    5561
    FV_UnixSelectionHandles::FV_UnixSelectionHandles(FV_View *view, FV_Selection sel 
    6268
    6369FV_UnixSelectionHandles::~FV_UnixSelectionHandles()
    6470{
    65         g_object_unref (m_text_handle);
     71        if (m_text_handle)
     72                g_object_unref (m_text_handle);
    6673}
    6774
    6875void FV_UnixSelectionHandles::hide()
    6976{
     77        if (!m_text_handle)
     78                return;
     79
    7080        _fv_text_handle_set_mode (m_text_handle, FV_TEXT_HANDLE_MODE_NONE);
    7181}
    7282
    void FV_UnixSelectionHandles::setCursorCoords(UT_sint32 x, UT_sint32 y, UT_uint3 
    7484{
    7585        GdkRectangle rect;
    7686
     87        if (!m_text_handle)
     88                return;
     89
    7790        _fv_text_handle_set_mode(m_text_handle, FV_TEXT_HANDLE_MODE_CURSOR);
    7891        _fv_text_handle_set_visible (m_text_handle, FV_TEXT_HANDLE_POSITION_CURSOR, visible);
    7992
    void FV_UnixSelectionHandles::setSelectionCoords(UT_sint32 start_x, UT_sint32 st 
    94107{
    95108        GdkRectangle rect;
    96109
     110        if (!m_text_handle)
     111                return;
     112
    97113        _fv_text_handle_set_mode(m_text_handle, FV_TEXT_HANDLE_MODE_SELECTION);
    98114
    99115        _fv_text_handle_set_visible (m_text_handle, FV_TEXT_HANDLE_POSITION_SELECTION_START, start_visible);