summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--starmath/source/mathmlimport.cxx5
-rw-r--r--starmath/source/node.cxx3
2 files changed, 5 insertions, 3 deletions
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index 3487a386be29..50c06aa67257 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 e0c72822f305..469eee1b64ef 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 += "# ";
}