From 4dd6c44628ab4e6b4debf22e58e01f9263a5a878 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 31 Oct 2012 17:15:19 +0000 Subject: Related: rhbz#871516 plausible reason for crash in MathType::HandleRecords Change-Id: I431c0615de56ddc0fa2c0ea06567d32419d29440 --- starmath/source/mathtype.cxx | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'starmath') 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,"{}"); } } -- cgit v1.2.3