[Libreoffice] [PATCH] starmath: check for existing edit window

Miklos Vajna vmiklos at frugalware.org
Thu Jul 14 07:50:50 PDT 2011


Hi,

When I try to open
http://people.freedesktop.org/~vmiklos/math.word2007.docx on master
(with experimanl features disabled, so the inline formula editor is
disabled), double-click on the math formula, Math opens, finally I click
on the formula, Math crashes.

The attached patch fixes the problem here, but I'm sending it for review
as I'm totally unfamiliar with the starmath code - in case my patch
would just hide a deeper problem.

Thanks.
-------------- next part --------------
From 49d79671d9c7d69d80ec1fde7283ae74a1580ca0 Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos at frugalware.org>
Date: Thu, 14 Jul 2011 16:44:32 +0200
Subject: [PATCH] starmath: check for existing edit window

---
 starmath/source/view.cxx |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 79bfd82..b3d77ff 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -195,6 +195,8 @@ void SmGraphicWindow::MouseButtonDown(const MouseEvent& rMEvt)
 
         if (pNode)
         {	SmEditWindow  *pEdit = pViewShell->GetEditWindow();
+            if (!pEdit)
+                return;
             const SmToken  aToken (pNode->GetToken());
 
             // set selection to the beginning of the token
-- 
1.7.6

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110714/bbb112b0/attachment.pgp>


More information about the LibreOffice mailing list