summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-10-31 17:15:19 (GMT)
committerCaolán McNamara <caolanm@redhat.com>2012-10-31 17:15:42 (GMT)
commit4dd6c44628ab4e6b4debf22e58e01f9263a5a878 (patch)
treeb73645e803d3c01a55b64ec43b32e09a9387e78d
parentbb6a12caede53029ecb99810f2f58daae4e11af7 (diff)
Related: rhbz#871516 plausible reason for crash in MathType::HandleRecords
Change-Id: I431c0615de56ddc0fa2c0ea06567d32419d29440
-rw-r--r--starmath/source/mathtype.cxx17
1 files changed, 7 insertions, 10 deletions
diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx
index 69aeabe..b911b5f 100644
--- a/starmath/source/mathtype.cxx
+++ b/starmath/source/mathtype.cxx
@@ -699,17 +699,14 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector,
rRet.Insert(aStr,nTextStart);
rRet += '\"';
}
- else
+ else if (nRecord == END && rRet.Len() > 0)
{
- if (nRecord == END)
- {
- sal_Unicode cChar = 0;
- xub_StrLen nI = rRet.Len()-1;
- while (nI && ((cChar = rRet.GetChar(nI)) == ' '))
- --nI;
- if ((cChar == '=') || (cChar == '+') || (cChar == '-'))
- APPEND(rRet,"{}");
- }
+ sal_Unicode cChar = 0;
+ xub_StrLen nI = rRet.Len()-1;
+ while (nI && ((cChar = rRet.GetChar(nI)) == ' '))
+ --nI;
+ if ((cChar == '=') || (cChar == '+') || (cChar == '-'))
+ APPEND(rRet,"{}");
}
}