[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - starmath/source
Caolán McNamara
caolanm at redhat.com
Thu Nov 7 16:21:13 CET 2013
starmath/source/mathmlimport.cxx | 5 +++--
starmath/source/node.cxx | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)
New commits:
commit 893039fa142c6b0188549bda5567d8cb115600fa
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Nov 5 16:04:28 2013 +0000
Resolves: fdo#58094 don't crash on attempting mml import
Change-Id: I812f2b3e333ea59e9ebfc75a854faca050af8711
(cherry picked from commit 603e9338568c29c01f812c4fd47b7e8138e015bb)
Reviewed-on: https://gerrit.libreoffice.org/6590
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index 3487a38..50c06aa 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -2244,10 +2244,11 @@ void SmXMLRowContext_Impl::EndElement()
{
SmNodeArray aRelationArray;
SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
- sal_uLong nSize = rNodeStack.size()-nElementCount;
- if (nSize > 0)
+ if (rNodeStack.size() > nElementCount)
{
+ sal_uLong nSize = rNodeStack.size() - nElementCount;
+
aRelationArray.resize(nSize);
for (sal_uLong j=nSize;j > 0;j--)
{
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index e0c7282..469eee1 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -2511,7 +2511,8 @@ void SmMatrixNode::CreateTextFromNode(String &rText)
for (sal_uInt16 j = 0; j < nNumCols; j++)
{
SmNode *pNode = GetSubNode(i * nNumCols + j);
- pNode->CreateTextFromNode(rText);
+ if (pNode)
+ pNode->CreateTextFromNode(rText);
if (j != nNumCols-1)
rText += "# ";
}
More information about the Libreoffice-commits
mailing list