Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index



        Just pushed this to libreoffice-3-4

        It seems that 'Seek' does an implicit bounds check, returning a NULL
for OOB that we need to replicate when doing this conversion :-)

        HTH,

                Michael.

From 128477a3cba4a8985432ed342ee2d3c654e1e119 Mon Sep 17 00:00:00 2001
From: Michael Meeks <michael.meeks@novell.com>
Date: Thu, 5 May 2011 15:00:31 +0100
Subject: [PATCH] fix fdo#36863 - math crasher on redraw, introduced by Seek difference

---
 starmath/source/parse.cxx |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index ee27781..5d7fc2b 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -2513,11 +2513,15 @@ const SmErrorDesc *SmParser::PrevError()
 }
 
 
-const SmErrorDesc  *SmParser::GetError(size_t i)
+const SmErrorDesc *SmParser::GetError(size_t i)
 {
-    return ( i < m_aErrDescList.size() )
-               ? m_aErrDescList[ i ]
-               : m_aErrDescList[ m_nCurError ];
+    if ( i < m_aErrDescList.size() )
+        return m_aErrDescList[ i ];
+
+    if ( (size_t)m_nCurError < m_aErrDescList.size() )
+        return m_aErrDescList[ m_nCurError ];
+
+    return NULL;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
-- 
1.7.3.4


-- 
 michael.meeks@novell.com  <><, Pseudo Engineer, itinerant idiot


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.