summaryrefslogtreecommitdiff
path: root/starmath/source/mathtype.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <cmc@openoffice.org>2002-09-27 10:52:25 +0000
committerCaolán McNamara <cmc@openoffice.org>2002-09-27 10:52:25 +0000
commit09583640927e2c104788c6d3c172160890c8361f (patch)
tree0bd533eee2712175ee1dfeb2b7b4af719bfb810e /starmath/source/mathtype.cxx
parenta7ae7a8696326d581d08156042585e7e53f19cf3 (diff)
#i6436# Even when embelishments are addpended to a character be able to balance unbalanced = symbols
Diffstat (limited to 'starmath/source/mathtype.cxx')
-rw-r--r--starmath/source/mathtype.cxx31
1 files changed, 18 insertions, 13 deletions
diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx
index cca01e97ad23..94e4a903b987 100644
--- a/starmath/source/mathtype.cxx
+++ b/starmath/source/mathtype.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: mathtype.cxx,v $
*
- * $Revision: 1.23 $
+ * $Revision: 1.24 $
*
- * last change: $Author: cmc $ $Date: 2002-09-20 12:05:19 $
+ * last change: $Author: cmc $ $Date: 2002-09-27 11:52:25 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -792,7 +792,19 @@ int MathType::Parse(SvStorage *pStor)
return nRet;
}
-static void lcl_InsertDummyTerm(String &rRet)
+static void lcl_PrependDummyTerm(String &rRet, xub_StrLen &rTextStart)
+{
+ if ((rRet.GetChar(rTextStart) == '=') &&
+ ((rTextStart == 0) ||
+ (rRet.GetChar(rTextStart-1) == '{'))
+ )
+ {
+ rRet.InsertAscii(" {}",rTextStart);
+ rTextStart+=3;
+ }
+}
+
+static void lcl_AppendDummyTerm(String &rRet)
{
sal_Bool bOk=sal_False;
for(xub_StrLen nI=rRet.Len()-1;nI >= 0; nI--)
@@ -871,14 +883,6 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector,
if ((cChar == '=') || (cChar == '+') || (cChar == '-'))
APPEND(rRet,"{}");
}
-
- if ((rRet.GetChar(nTextStart) == '=') &&
- ((nTextStart == 0) ||
- (rRet.GetChar(nTextStart-1) == '{'))
- )
- {
- rRet.InsertAscii(" {}",nTextStart);
- }
}
}
@@ -983,13 +987,13 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector,
if ((nVariation == 0) ||
((nVariation == 2) && (nPart==1)))
{
- lcl_InsertDummyTerm(rRet);
+ lcl_AppendDummyTerm(rRet);
APPEND(rRet," rSup");
}
else if ((nVariation == 1) ||
((nVariation == 2) && (nPart==0)))
{
- lcl_InsertDummyTerm(rRet);
+ lcl_AppendDummyTerm(rRet);
APPEND(rRet," rSub");
}
APPEND(rRet," {");
@@ -3126,6 +3130,7 @@ int MathType::HandleChar(xub_StrLen &rTextStart,int &rSetSize,int nLevel,
}
rTextStart = rRet.Len();
}
+ lcl_PrependDummyTerm(rRet, rTextStart);
}
if ((xfEMBELL(nTag)) && (!bSilent))