diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-10-31 17:15:19 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-10-31 17:15:42 +0000 |
commit | 4dd6c44628ab4e6b4debf22e58e01f9263a5a878 (patch) | |
tree | b73645e803d3c01a55b64ec43b32e09a9387e78d /starmath | |
parent | bb6a12caede53029ecb99810f2f58daae4e11af7 (diff) |
Related: rhbz#871516 plausible reason for crash in MathType::HandleRecords
Change-Id: I431c0615de56ddc0fa2c0ea06567d32419d29440
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/mathtype.cxx | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx index 69aeabe2ce77..b911b5f4a890 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,"{}"); } } |