diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-03-26 16:22:05 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-03-26 16:22:16 +0100 |
commit | 3759f02465b8c15a99f2a4662b57f214125b2922 (patch) | |
tree | d900c6a6eca359b3218977a47bc0b343e1626797 | |
parent | 1ed4210d8e6cbf1b25cd1eb8666be6578cc45845 (diff) |
starmath: remove no longer needed APPEND macro
Change-Id: I3102e86a7ea9f638f79ba9572e725362952a46e2
-rw-r--r-- | starmath/source/mathtype.cxx | 478 | ||||
-rw-r--r-- | starmath/source/node.cxx | 128 |
2 files changed, 299 insertions, 307 deletions
diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx index 5369d2f60df4..c003c9d9ce8b 100644 --- a/starmath/source/mathtype.cxx +++ b/starmath/source/mathtype.cxx @@ -22,8 +22,6 @@ #include <osl/diagnose.h> #include <sfx2/docfile.hxx> -#define APPEND(str,ascii) str.AppendAscii(RTL_CONSTASCII_STRINGPARAM(ascii)) - void MathType::Init() { //These are the default MathType sizes @@ -590,7 +588,7 @@ int MathType::Parse(SotStorage *pStor) //a sophisticated system to determine what expressions are //opened is required, but this is as much work as rewriting //starmaths internals. - APPEND(rRet,"{}"); + rRet += "{}"; #if OSL_DEBUG_LEVEL > 1 # ifdef CAOLAN @@ -632,7 +630,7 @@ static void lcl_AppendDummyTerm(String &rRet) break; } if (!bOk) //No term, use dummy - APPEND(rRet," {}"); + rRet += " {}"; } void MathType::HandleNudge() @@ -706,7 +704,7 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, while (nI && ((cChar = rRet.GetChar(nI)) == ' ')) --nI; if ((cChar == '=') || (cChar == '+') || (cChar == '-')) - APPEND(rRet,"{}"); + rRet += "{}"; } } @@ -718,92 +716,92 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, HandleNudge(); if (newline>0) - APPEND(rRet,"\nnewline\n"); + rRet += "\nnewline\n"; if (!(xfNULL(nTag))) { switch (nSelector) { case 0x0: if (nVariation==0) - APPEND(rRet," langle "); + rRet += " langle "; else if (nVariation==1) - APPEND(rRet," \\langle "); + rRet += " \\langle "; break; case 0x1: if (nVariation==0) - APPEND(rRet," left ("); + rRet += " left ("; else if (nVariation==1) - APPEND(rRet,"\\("); + rRet += "\\("; break; case 0x2: if ((nVariation==0) || (nVariation==1)) - APPEND(rRet," left lbrace "); + rRet += " left lbrace "; else - APPEND(rRet," left none "); + rRet += " left none "; break; case 0x3: if (nVariation==0) - APPEND(rRet," left ["); + rRet += " left ["; else if (nVariation==1) - APPEND(rRet,"\\["); + rRet += "\\["; break; case 0x8: case 0xb: - APPEND(rRet," \\["); + rRet += " \\["; break; case 0x4: if (nVariation==0) - APPEND(rRet," lline "); + rRet += " lline "; else if (nVariation==1) - APPEND(rRet," \\lline "); + rRet += " \\lline "; break; case 0x5: if (nVariation==0) - APPEND(rRet," ldline "); + rRet += " ldline "; else if (nVariation==1) - APPEND(rRet," \\ldline "); + rRet += " \\ldline "; break; case 0x6: if (nVariation == 0 || nVariation == 1) - APPEND(rRet," left lfloor "); + rRet += " left lfloor "; else if (nVariation==1) - APPEND(rRet," left none "); + rRet += " left none "; break; case 0x7: if (nVariation==0) - APPEND(rRet," lceil "); + rRet += " lceil "; else if (nVariation==1) - APPEND(rRet," \\lceil "); + rRet += " \\lceil "; break; case 0x9: case 0xa: - APPEND(rRet," \\]"); + rRet += " \\]"; break; case 0xc: - APPEND(rRet," \\("); + rRet += " \\("; break; case 0xd: if (nPart == 0) { if (nVariation == 0) - APPEND(rRet," sqrt"); + rRet += " sqrt"; else { - APPEND(rRet," nroot"); + rRet += " nroot"; sPush = rRet; rRet.Erase(); } } - APPEND(rRet," {"); + rRet += " {"; break; case 0xe: if (nPart == 0) - APPEND(rRet," { "); + rRet += " { "; if (nPart == 1) - APPEND(rRet," over "); - APPEND(rRet," {"); + rRet += " over "; + rRet += " {"; break; case 0xf: nSubSupStartPos = rRet.Len(); @@ -811,67 +809,67 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, ((nVariation == 2) && (nPart==1))) { lcl_AppendDummyTerm(rRet); - APPEND(rRet," rSup"); + rRet += " rSup"; } else if ((nVariation == 1) || ((nVariation == 2) && (nPart==0))) { lcl_AppendDummyTerm(rRet); - APPEND(rRet," rSub"); + rRet += " rSub"; } - APPEND(rRet," {"); + rRet += " {"; break; case 0x10: if (nVariation == 0) - APPEND(rRet," {underline "); + rRet += " {underline "; else if (nVariation == 1) - APPEND(rRet," {underline underline "); - APPEND(rRet," {"); + rRet += " {underline underline "; + rRet += " {"; break; case 0x11: if (nVariation == 0) - APPEND(rRet," {overline "); + rRet += " {overline "; else if (nVariation == 1) - APPEND(rRet," {overline overline "); - APPEND(rRet," {"); + rRet += " {overline overline "; + rRet += " {"; break; case 0x12: if (nPart == 0) { if (nVariation == 0) - APPEND(rRet," widevec ");//left arrow above + rRet += " widevec ";//left arrow above else if (nVariation == 1) - APPEND(rRet," widevec ");//left arrow below - APPEND(rRet," {"); + rRet += " widevec ";//left arrow below + rRet += " {"; } break; case 0x13: if (nPart == 0) { if (nVariation == 0) - APPEND(rRet," widevec ");//right arrow above + rRet += " widevec ";//right arrow above else if (nVariation == 1) - APPEND(rRet," widevec ");//right arrow below - APPEND(rRet," {"); + rRet += " widevec ";//right arrow below + rRet += " {"; } break; case 0x14: if (nPart == 0) { if (nVariation == 0) - APPEND(rRet," widevec ");//double arrow above + rRet += " widevec ";//double arrow above else if (nVariation == 1) - APPEND(rRet," widevec ");//double arrow below - APPEND(rRet," {"); + rRet += " widevec ";//double arrow below + rRet += " {"; } break; case 0x15: if (nPart == 0) { if ((nVariation == 3) || (nVariation == 4)) - APPEND(rRet," lInt"); + rRet += " lInt"; else - APPEND(rRet," Int"); + rRet += " Int"; if ( (nVariation != 0) && (nVariation != 3)) { sPush = rRet; @@ -880,20 +878,20 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, } if (((nVariation == 1) || (nVariation == 4)) && (nPart==1)) - APPEND(rRet," rSub"); + rRet += " rSub"; else if ((nVariation == 2) && (nPart==2)) - APPEND(rRet," rSup"); + rRet += " rSup"; else if ((nVariation == 2) && (nPart==1)) - APPEND(rRet," rSub"); - APPEND(rRet," {"); + rRet += " rSub"; + rRet += " {"; break; case 0x16: if (nPart == 0) { if ((nVariation == 2) || (nVariation == 3)) - APPEND(rRet," llInt"); + rRet += " llInt"; else - APPEND(rRet," iInt"); + rRet += " iInt"; if ( (nVariation != 0) && (nVariation != 2)) { sPush = rRet; @@ -902,16 +900,16 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, } if (((nVariation == 1) || (nVariation == 3)) && (nPart==1)) - APPEND(rRet," rSub"); - APPEND(rRet," {"); + rRet += " rSub"; + rRet += " {"; break; case 0x17: if (nPart == 0) { if ((nVariation == 2) || (nVariation == 3)) - APPEND(rRet," lllInt"); + rRet += " lllInt"; else - APPEND(rRet," iiInt"); + rRet += " iiInt"; if ( (nVariation != 0) && (nVariation != 2)) { sPush = rRet; @@ -920,64 +918,64 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, } if (((nVariation == 1) || (nVariation == 3)) && (nPart==1)) - APPEND(rRet," rSub"); - APPEND(rRet," {"); + rRet += " rSub"; + rRet += " {"; break; case 0x18: if (nPart == 0) { if (nVariation == 2) - APPEND(rRet," lInt"); + rRet += " lInt"; else - APPEND(rRet," Int"); + rRet += " Int"; sPush = rRet; rRet.Erase(); } if (((nVariation == 1) || (nVariation == 2)) && (nPart==1)) - APPEND(rRet," cSub"); + rRet += " cSub"; else if ((nVariation == 0) && (nPart==2)) - APPEND(rRet," cSup"); + rRet += " cSup"; else if ((nVariation == 0) && (nPart==1)) - APPEND(rRet," cSub"); - APPEND(rRet," {"); + rRet += " cSub"; + rRet += " {"; break; case 0x19: if (nPart == 0) { if (nVariation == 0) - APPEND(rRet," llInt"); + rRet += " llInt"; else - APPEND(rRet," iInt"); + rRet += " iInt"; sPush = rRet; rRet.Erase(); } if (nPart==1) - APPEND(rRet," cSub"); - APPEND(rRet," {"); + rRet += " cSub"; + rRet += " {"; break; case 0x1a: if (nPart == 0) { if (nVariation == 0) - APPEND(rRet," lllInt"); + rRet += " lllInt"; else - APPEND(rRet," iiInt"); + rRet += " iiInt"; sPush = rRet; rRet.Erase(); } if (nPart==1) - APPEND(rRet," cSub"); - APPEND(rRet," {"); + rRet += " cSub"; + rRet += " {"; break; case 0x1b: case 0x1c: - APPEND(rRet," {"); + rRet += " {"; break; case 0x1d: if (nPart == 0) { - APPEND(rRet," Sum"); + rRet += " Sum"; if (nVariation != 2) { sPush = rRet; @@ -985,32 +983,32 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, } } if ((nVariation == 0) && (nPart==1)) - APPEND(rRet," cSub"); + rRet += " cSub"; else if ((nVariation == 1) && (nPart==2)) - APPEND(rRet," cSup"); + rRet += " cSup"; else if ((nVariation == 1) && (nPart==1)) - APPEND(rRet," cSub"); - APPEND(rRet," {"); + rRet += " cSub"; + rRet += " {"; break; case 0x1e: if (nPart == 0) { - APPEND(rRet," Sum"); + rRet += " Sum"; sPush = rRet; rRet.Erase(); } if ((nVariation == 0) && (nPart==1)) - APPEND(rRet," rSub"); + rRet += " rSub"; else if ((nVariation == 1) && (nPart==2)) - APPEND(rRet," rSup"); + rRet += " rSup"; else if ((nVariation == 1) && (nPart==1)) - APPEND(rRet," rSub"); - APPEND(rRet," {"); + rRet += " rSub"; + rRet += " {"; break; case 0x1f: if (nPart == 0) { - APPEND(rRet," Prod"); + rRet += " Prod"; if (nVariation != 2) { sPush = rRet; @@ -1018,32 +1016,32 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, } } if ((nVariation == 0) && (nPart==1)) - APPEND(rRet," cSub"); + rRet += " cSub"; else if ((nVariation == 1) && (nPart==2)) - APPEND(rRet," cSup"); + rRet += " cSup"; else if ((nVariation == 1) && (nPart==1)) - APPEND(rRet," cSub"); - APPEND(rRet," {"); + rRet += " cSub"; + rRet += " {"; break; case 0x20: if (nPart == 0) { - APPEND(rRet," Prod"); + rRet += " Prod"; sPush = rRet; rRet.Erase(); } if ((nVariation == 0) && (nPart==1)) - APPEND(rRet," rSub"); + rRet += " rSub"; else if ((nVariation == 1) && (nPart==2)) - APPEND(rRet," rSup"); + rRet += " rSup"; else if ((nVariation == 1) && (nPart==1)) - APPEND(rRet," rSub"); - APPEND(rRet," {"); + rRet += " rSub"; + rRet += " {"; break; case 0x21: if (nPart == 0) { - APPEND(rRet," coProd"); + rRet += " coProd"; if (nVariation != 2) { sPush = rRet; @@ -1051,32 +1049,32 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, } } if ((nVariation == 0) && (nPart==1)) - APPEND(rRet," cSub"); + rRet += " cSub"; else if ((nVariation == 1) && (nPart==2)) - APPEND(rRet," cSup"); + rRet += " cSup"; else if ((nVariation == 1) && (nPart==1)) - APPEND(rRet," cSub"); - APPEND(rRet," {"); + rRet += " cSub"; + rRet += " {"; break; case 0x22: if (nPart == 0) { - APPEND(rRet," coProd"); + rRet += " coProd"; sPush = rRet; rRet.Erase(); } if ((nVariation == 0) && (nPart==1)) - APPEND(rRet," rSub"); + rRet += " rSub"; else if ((nVariation == 1) && (nPart==2)) - APPEND(rRet," rSup"); + rRet += " rSup"; else if ((nVariation == 1) && (nPart==1)) - APPEND(rRet," rSub"); - APPEND(rRet," {"); + rRet += " rSub"; + rRet += " {"; break; case 0x23: if (nPart == 0) { - APPEND(rRet," union"); //union + rRet += " union"; //union if (nVariation != 2) { sPush = rRet; @@ -1084,32 +1082,32 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, } } if ((nVariation == 0) && (nPart==1)) - APPEND(rRet," cSub"); + rRet += " cSub"; else if ((nVariation == 1) && (nPart==2)) - APPEND(rRet," cSup"); + rRet += " cSup"; else if ((nVariation == 1) && (nPart==1)) - APPEND(rRet," cSub"); - APPEND(rRet," {"); + rRet += " cSub"; + rRet += " {"; break; case 0x24: if (nPart == 0) { - APPEND(rRet," union"); //union + rRet += " union"; //union sPush = rRet; rRet.Erase(); } if ((nVariation == 0) && (nPart==1)) - APPEND(rRet," rSub"); + rRet += " rSub"; else if ((nVariation == 1) && (nPart==2)) - APPEND(rRet," rSup"); + rRet += " rSup"; else if ((nVariation == 1) && (nPart==1)) - APPEND(rRet," rSub"); - APPEND(rRet," {"); + rRet += " rSub"; + rRet += " {"; break; case 0x25: if (nPart == 0) { - APPEND(rRet," intersect"); //intersect + rRet += " intersect"; //intersect if (nVariation != 2) { sPush = rRet; @@ -1117,38 +1115,38 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, } } if ((nVariation == 0) && (nPart==1)) - APPEND(rRet," cSub"); + rRet += " cSub"; else if ((nVariation == 1) && (nPart==2)) - APPEND(rRet," cSup"); + rRet += " cSup"; else if ((nVariation == 1) && (nPart==1)) - APPEND(rRet," cSub"); - APPEND(rRet," {"); + rRet += " cSub"; + rRet += " {"; break; case 0x26: if (nPart == 0) { - APPEND(rRet," intersect"); //intersect + rRet += " intersect"; //intersect sPush = rRet; rRet.Erase(); } if ((nVariation == 0) && (nPart==1)) - APPEND(rRet," rSub"); + rRet += " rSub"; else if ((nVariation == 1) && (nPart==2)) - APPEND(rRet," rSup"); + rRet += " rSup"; else if ((nVariation == 1) && (nPart==1)) - APPEND(rRet," rSub"); - APPEND(rRet," {"); + rRet += " rSub"; + rRet += " {"; break; case 0x27: if ((nVariation == 0) && (nPart==1)) - APPEND(rRet," cSup"); + rRet += " cSup"; else if ((nVariation == 1) && (nPart==1)) - APPEND(rRet," cSub"); + rRet += " cSub"; else if ((nVariation == 2) && (nPart==1)) - APPEND(rRet," cSub"); + rRet += " cSub"; else if ((nVariation == 2) && (nPart==2)) - APPEND(rRet," cSup"); - APPEND(rRet," {"); + rRet += " cSup"; + rRet += " {"; break; case 0x28: if (nVariation == 0) @@ -1159,19 +1157,19 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, rRet.Erase(); } } - APPEND(rRet," {"); + rRet += " {"; if (nVariation == 0) { if (nPart == 1) - APPEND(rRet,"alignr "); + rRet += "alignr "; } if (nPart == 0) - APPEND(rRet,"\\lline "); + rRet += "\\lline "; if (nVariation == 1) - APPEND(rRet,"overline "); + rRet += "overline "; break; case 0x29: - APPEND(rRet," {"); + rRet += " {"; break; case 0x2a: if (nPart == 0) @@ -1180,14 +1178,14 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, rRet.Erase(); } if ((nVariation == 0) && (nPart==0)) - APPEND(rRet," rSup"); + rRet += " rSup"; else if ((nVariation == 2) && (nPart==1)) - APPEND(rRet," rSup"); + rRet += " rSup"; else if ((nVariation == 1) && (nPart==0)) - APPEND(rRet," rSub"); + rRet += " rSub"; else if ((nVariation == 2) && (nPart==0)) - APPEND(rRet," rSub"); - APPEND(rRet," {"); + rRet += " rSub"; + rRet += " {"; break; case 0x2b: if (nPart == 0) @@ -1196,60 +1194,60 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, rRet.Erase(); } if ((nVariation == 0) && (nPart==0)) - APPEND(rRet," cSup"); + rRet += " cSup"; else if ((nVariation == 2) && (nPart==1)) - APPEND(rRet," cSup"); + rRet += " cSup"; else if ((nVariation == 1) && (nPart==0)) - APPEND(rRet," cSub"); + rRet += " cSub"; else if ((nVariation == 2) && (nPart==0)) - APPEND(rRet," cSub"); - APPEND(rRet," {"); + rRet += " cSub"; + rRet += " {"; break; case 0x2c: if (nPart == 0) - APPEND(rRet,"\"\""); + rRet += "\"\""; if ((nVariation == 0) || ((nVariation == 2) && (nPart==1))) - APPEND(rRet," lSup"); + rRet += " lSup"; else if ((nVariation == 1) || ((nVariation == 2) && (nPart==0))) - APPEND(rRet," lSub"); - APPEND(rRet," {"); + rRet += " lSub"; + rRet += " {"; break; case 0x2d: if (nVariation==0) { if (nPart == 0) - APPEND(rRet," langle "); + rRet += " langle "; } else if (nVariation==1) { - APPEND(rRet," \\langle "); + rRet += " \\langle "; newline--; } else if (nVariation==2) { - APPEND(rRet," \\lline "); + rRet += " \\lline "; newline--; } break; case 0x2e: if (nVariation == 0) - APPEND(rRet," widevec ");//left below + rRet += " widevec ";//left below else if (nVariation == 1) - APPEND(rRet," widevec ");//right below + rRet += " widevec ";//right below else if (nVariation == 2) - APPEND(rRet," widevec ");//double headed below - APPEND(rRet," {"); + rRet += " widevec ";//double headed below + rRet += " {"; break; case 0x2f: if (nVariation == 0) - APPEND(rRet," widevec ");//left above + rRet += " widevec ";//left above else if (nVariation == 1) - APPEND(rRet," widevec ");//right above + rRet += " widevec ";//right above else if (nVariation == 2) - APPEND(rRet," widevec ");//double headed above - APPEND(rRet," {"); + rRet += " widevec ";//double headed above + rRet += " {"; break; default: break; @@ -1275,7 +1273,7 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, bOk=true; if (bOk) - APPEND(rRet,"} "); + rRet += "} "; else rRet.Erase(nSizeStartPos); nSetSize--; @@ -1290,62 +1288,62 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, { case 0x0: if (nVariation==0) - APPEND(rRet," rangle "); + rRet += " rangle "; else if (nVariation==2) - APPEND(rRet," \\rangle "); + rRet += " \\rangle "; break; case 0x1: if (nVariation==0) - APPEND(rRet," right )"); + rRet += " right )"; else if (nVariation==2) - APPEND(rRet,"\\)"); + rRet += "\\)"; break; case 0x2: if ((nVariation==0) || (nVariation==2)) - APPEND(rRet," right rbrace "); + rRet += " right rbrace "; else - APPEND(rRet," right none "); + rRet += " right none "; break; case 0x3: if (nVariation==0) - APPEND(rRet," right ]"); + rRet += " right ]"; else if (nVariation==2) - APPEND(rRet,"\\]"); + rRet += "\\]"; break; case 0x4: if (nVariation==0) - APPEND(rRet," rline "); + rRet += " rline "; else if (nVariation==2) - APPEND(rRet," \\rline "); + rRet += " \\rline "; break; case 0x5: if (nVariation==0) - APPEND(rRet," rdline "); + rRet += " rdline "; else if (nVariation==2) - APPEND(rRet," \\rdline "); + rRet += " \\rdline "; break; case 0x6: if (nVariation == 0 || nVariation == 2) - APPEND(rRet," right rfloor "); + rRet += " right rfloor "; else if (nVariation==2) - APPEND(rRet," right none "); + rRet += " right none "; break; case 0x7: if (nVariation==0) - APPEND(rRet," rceil "); + rRet += " rceil "; else if (nVariation==2) - APPEND(rRet," \\rceil "); + rRet += " \\rceil "; break; case 0x8: case 0xa: - APPEND(rRet,"\\["); + rRet += "\\["; break; case 0x9: case 0xc: - APPEND(rRet,"\\]"); + rRet += "\\]"; break; case 0xd: - APPEND(rRet,"} "); + rRet += "} "; if (nVariation == 1) { if (nPart == 0) @@ -1369,14 +1367,14 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, nPart++; break; case 0xb: - APPEND(rRet,"\\)"); + rRet += "\\)"; break; case 0xe: - APPEND(rRet,"} "); + rRet += "} "; if (nPart == 0) newline--; else - APPEND(rRet,"} "); + rRet += "} "; nPart++; break; case 0xf: @@ -1400,7 +1398,7 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, bOk=true; if (bOk) - APPEND(rRet,"} "); + rRet += "} "; else rRet.Erase(nSubSupStartPos); nPart++; @@ -1410,16 +1408,16 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, if ((nPart == 0) && ((nVariation == 2) || (nVariation == 1))) newline--; - APPEND(rRet,"} "); + rRet += "} "; nPart++; break; case 0x2e: case 0x2f: - APPEND(rRet,"} "); + rRet += "} "; break; case 0x10: case 0x11: - APPEND(rRet,"}} "); + rRet += "}} "; break; case 0x12: case 0x13: @@ -1427,25 +1425,25 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, if (nPart == 0) { newline--; - APPEND(rRet,"} "); + rRet += "} "; } nPart++; break; case 0x1b: - APPEND(rRet,"} "); + rRet += "} "; if (nPart == 0) { newline--; - APPEND(rRet,"overbrace"); + rRet += "overbrace"; } nPart++; break; case 0x1c: - APPEND(rRet,"} "); + rRet += "} "; if (nPart == 0) { newline--; - APPEND(rRet,"underbrace"); + rRet += "underbrace"; } nPart++; break; @@ -1455,11 +1453,11 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, else if ((nPart==1) && ((nVariation == 2) || (nVariation == 1))) newline--; - APPEND(rRet,"} "); + rRet += "} "; nPart++; break; case 0x28: - APPEND(rRet,"} "); + rRet += "} "; if (nVariation == 0) { if (nPart == 0) @@ -1471,7 +1469,7 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, { sPush += rRet; rRet = sPush; - APPEND(rRet," over "); + rRet += " over "; rRet += sMainTerm; } } @@ -1480,17 +1478,17 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, nPart++; break; case 0x29: - APPEND(rRet,"} "); + rRet += "} "; if (nPart == 0) { newline--; switch (nVariation) { case 1: - APPEND(rRet,"slash"); + rRet += "slash"; break; default: - APPEND(rRet,"wideslash"); + rRet += "wideslash"; break; } } @@ -1506,7 +1504,7 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, case 0x24: case 0x25: case 0x26: - APPEND(rRet,"} "); + rRet += "} "; if (nPart == 0) { if (nVariation != 2) @@ -1535,7 +1533,7 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, nPart++; break; case 0x15: - APPEND(rRet,"} "); + rRet += "} "; if (nPart == 0) { if ((nVariation != 0) && (nVariation != 3)) @@ -1566,7 +1564,7 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, break; case 0x16: case 0x17: - APPEND(rRet,"} "); + rRet += "} "; if (nPart == 0) { if ((nVariation != 0) && (nVariation != 2)) @@ -1587,7 +1585,7 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, nPart++; break; case 0x18: - APPEND(rRet,"} "); + rRet += "} "; if (nPart == 0) { sMainTerm = rRet; @@ -1615,7 +1613,7 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, break; case 0x19: case 0x1a: - APPEND(rRet,"} "); + rRet += "} "; if (nPart == 0) { sMainTerm = rRet; @@ -1633,7 +1631,7 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, break; case 0x2a: case 0x2b: - APPEND(rRet,"} "); + rRet += "} "; if ((nPart == 0) && ((nVariation == 0) || (nVariation == 1))) @@ -1665,15 +1663,15 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector, if (nPart == 0) { newline--; //there is another term to arrive - APPEND(rRet," mline "); + rRet += " mline "; } else - APPEND(rRet," rangle "); + rRet += " rangle "; } else if (nVariation==1) - APPEND(rRet," \\lline "); + rRet += " \\lline "; else if (nVariation==2) - APPEND(rRet," \\rangle "); + rRet += " \\rangle "; nPart++; break; default: @@ -1791,7 +1789,7 @@ void MathType::HandleMatrixSeperator(int nMatrixRows,int nMatrixCols, if (rCurCol == nMatrixCols-1) { if (rCurRow != nMatrixRows-1) - APPEND(rRet," {} ##\n"); + rRet += " {} ##\n"; if (nMatrixRows!=-1) { rCurCol=0; @@ -1800,7 +1798,7 @@ void MathType::HandleMatrixSeperator(int nMatrixRows,int nMatrixCols, } else { - APPEND(rRet," {} # "); + rRet += " {} # "; if (nMatrixRows!=-1) rCurCol++; else @@ -1817,13 +1815,13 @@ void MathType::HandleAlign(sal_uInt8 nHorAlign, sal_uInt8 /*nVAlign*/, int &rSet { case 1: default: - APPEND(rRet,"alignl {"); + rRet += "alignl {"; break; case 2: - APPEND(rRet,"alignc {"); + rRet += "alignc {"; break; case 3: - APPEND(rRet,"alignr {"); + rRet += "alignr {"; break; } rSetAlign++; @@ -1847,7 +1845,7 @@ sal_Bool MathType::HandleSize(sal_Int16 nLstSize,sal_Int16 nDefSize, int &rSetSi if (-nLstSize/32 != nLastSize) { nLastSize = nCurSize; - APPEND(rRet," size "); + rRet += " size "; rRet += OUString::number(-nLstSize/32); rRet += '{'; bRet=true; @@ -1876,7 +1874,7 @@ sal_Bool MathType::HandleSize(sal_Int16 nLstSize,sal_Int16 nDefSize, int &rSetSi if (nLstSize != nLastSize) { nLastSize = nCurSize; - APPEND(rRet," size "); + rRet += " size "; rRet += OUString::number(nLstSize); rRet += '{'; bRet=true; @@ -2660,14 +2658,14 @@ int MathType::HandlePile(int &rSetAlign,int nLevel,sal_uInt8 nSelector, HandleAlign(nHAlign,nVAlign,rSetAlign); - APPEND(rRet," stack {\n"); + rRet += " stack {\n"; int nRet = HandleRecords(nLevel+1,nSelector,nVariation,-1,-1); rRet.Erase(rRet.Len()-3,2); - APPEND(rRet,"} "); + rRet += "} "; while (rSetAlign) { - APPEND(rRet,"} "); + rRet += "} "; rSetAlign--; } return nRet; @@ -2690,15 +2688,15 @@ int MathType::HandleMatrix(int nLevel,sal_uInt8 nSelector, if (((nCols+1)*2)%8) nBytes++; pS->SeekRel(nBytes); - APPEND(rRet," matrix {\n"); + rRet += " matrix {\n"; int nRet = HandleRecords(nLevel+1,nSelector,nVariation,nRows,nCols); xub_StrLen nI = rRet.SearchBackward('#'); if ((nI != STRING_NOTFOUND) && (nI > 0)) if (rRet.GetChar(nI-1) != '#') //missing column - APPEND(rRet,"{}"); + rRet += "{}"; - APPEND(rRet,"\n} "); + rRet += "\n} "; return nRet; } @@ -2740,7 +2738,7 @@ int MathType::HandleTemplate(int nLevel,sal_uInt8 &rSelector, if (bRemove) { rRet.Erase(rLastTemplateBracket,1); - APPEND(rRet,"} "); + rRet += "} "; rLastTemplateBracket = STRING_NOTFOUND; } if (rSelector == 0xf) @@ -2761,18 +2759,18 @@ void MathType::HandleEmblishments() switch (nEmbel) { case 0x02: - APPEND(rRet," dot "); + rRet += " dot "; break; case 0x03: - APPEND(rRet," ddot "); + rRet += " ddot "; break; case 0x04: - APPEND(rRet," dddot "); + rRet += " dddot "; break; case 0x05: if (nPostSup == 0) { - APPEND(sPost," sup {}"); + sPost += " sup {}"; nPostSup = sPost.Len(); } sPost.InsertAscii(" ' ",nPostSup-1); @@ -2781,7 +2779,7 @@ void MathType::HandleEmblishments() case 0x06: if (nPostSup == 0) { - APPEND(sPost," sup {}"); + sPost += " sup {}"; nPostSup = sPost.Len(); } sPost.InsertAscii(" '' ",nPostSup-1); @@ -2790,38 +2788,38 @@ void MathType::HandleEmblishments() case 0x07: if (nPostlSup == 0) { - APPEND(sPost," lsup {}"); + sPost += " lsup {}"; nPostlSup = sPost.Len(); } sPost.InsertAscii(" ' ",nPostlSup-1); nPostlSup += 3; break; case 0x08: - APPEND(rRet," tilde "); + rRet += " tilde "; break; case 0x09: - APPEND(rRet," hat "); + rRet += " hat "; break; case 0x0b: - APPEND(rRet," vec "); + rRet += " vec "; break; case 0x10: - APPEND(rRet," overstrike "); + rRet += " overstrike "; break; case 0x11: - APPEND(rRet," bar "); + rRet += " bar "; break; case 0x12: if (nPostSup == 0) { - APPEND(sPost," sup {}"); + sPost += " sup {}"; nPostSup = sPost.Len(); } sPost.InsertAscii(" ''' ",nPostSup-1); nPostSup += 5; break; case 0x14: - APPEND(rRet," breve "); + rRet += " breve "; break; default: OSL_ENSURE(nEmbel < 21,"Embel out of range"); @@ -2898,7 +2896,7 @@ int MathType::HandleChar(xub_StrLen &rTextStart,int &rSetSize,int nLevel, sPost.Erase(); nPostSup = nPostlSup = 0; int nOriglen=rRet.Len()-rTextStart; - APPEND(rRet," {"); // #i24340# make what would be "vec {A}_n" become "{vec {A}}_n" + rRet += " {"; // #i24340# make what would be "vec {A}_n" become "{vec {A}}_n" if ((!bSilent) && ((nOriglen) > 1)) rRet += '\"'; nRet = HandleRecords(nLevel+1,nSelector,nVariation); @@ -2917,7 +2915,7 @@ int MathType::HandleChar(xub_StrLen &rTextStart,int &rSetSize,int nLevel, rRet += '{'; } else - APPEND(rRet," {"); + rRet += " {"; rTextStart = rRet.Len(); } } diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index 37c7a9935e01..fd857d9c7657 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -41,12 +41,6 @@ #include <float.h> -#define APPEND(str,ascii) str.AppendAscii(RTL_CONSTASCII_STRINGPARAM(ascii)) - - -using ::rtl::OUString; - - //////////////////////////////////////// // SmTmpDevice // Allows for font and color changes. The original settings will be restored @@ -440,7 +434,7 @@ void SmNode::CreateTextFromNode(String &rText) if (nSize > 1) { rText = comphelper::string::stripEnd(rText, ' '); - APPEND(rText,"} "); + rText += "} "; } } @@ -815,7 +809,7 @@ void SmExpressionNode::CreateTextFromNode(String &rText) if (nSize > 1) { rText = comphelper::string::stripEnd(rText, ' '); - APPEND(rText,"} "); + rText += "} "; } } @@ -1105,11 +1099,11 @@ void SmRootNode::CreateTextFromNode(String &rText) SmNode *pExtra = GetSubNode(0); if (pExtra) { - APPEND(rText,"nroot "); + rText += "nroot "; pExtra->CreateTextFromNode(rText); } else - APPEND(rText,"sqrt "); + rText += "sqrt "; GetSubNode(2)->CreateTextFromNode(rText); } @@ -1218,7 +1212,7 @@ void SmBinVerNode::CreateTextFromNode(String &rText) SmNode *pNum = GetSubNode(0), *pDenom = GetSubNode(2); pNum->CreateTextFromNode(rText); - APPEND(rText,"over "); + rText += "over "; pDenom->CreateTextFromNode(rText); } @@ -1606,22 +1600,22 @@ void SmSubSupNode::CreateTextFromNode(String &rText) if (NULL != (pNode = GetSubNode(LSUB+1))) { - APPEND(rText,"lsub "); + rText += "lsub "; pNode->CreateTextFromNode(rText); } if (NULL != (pNode = GetSubNode(LSUP+1))) { - APPEND(rText,"lsup "); + rText += "lsup "; pNode->CreateTextFromNode(rText); } if (NULL != (pNode = GetSubNode(CSUB+1))) { - APPEND(rText,"csub "); + rText += "csub "; pNode->CreateTextFromNode(rText); } if (NULL != (pNode = GetSubNode(CSUP+1))) { - APPEND(rText,"csup "); + rText += "csup "; pNode->CreateTextFromNode(rText); } if (NULL != (pNode = GetSubNode(RSUB+1))) @@ -1644,7 +1638,7 @@ void SmSubSupNode::CreateTextFromNode(String &rText) void SmBraceNode::CreateTextFromNode(String &rText) { if (GetScaleMode() == SCALE_HEIGHT) - APPEND(rText,"left "); + rText += "left "; { String aStr; GetSubNode(0)->CreateTextFromNode(aStr); @@ -1653,21 +1647,21 @@ void SmBraceNode::CreateTextFromNode(String &rText) if (aStr.Len()) { if (aStr.EqualsAscii("divides")) - APPEND(rText,"lline"); + rText += "lline"; else if (aStr.EqualsAscii("parallel")) - APPEND(rText,"ldline"); + rText += "ldline"; else if (aStr.EqualsAscii("<")) - APPEND(rText,"langle"); + rText += "langle"; else rText.Append(aStr); rText.Append(' '); } else - APPEND(rText,"none "); + rText += "none "; } GetSubNode(1)->CreateTextFromNode(rText); if (GetScaleMode() == SCALE_HEIGHT) - APPEND(rText,"right "); + rText += "right "; { String aStr; GetSubNode(2)->CreateTextFromNode(aStr); @@ -1676,17 +1670,17 @@ void SmBraceNode::CreateTextFromNode(String &rText) if (aStr.Len()) { if (aStr.EqualsAscii("divides")) - APPEND(rText,"rline"); + rText += "rline"; else if (aStr.EqualsAscii("parallel")) - APPEND(rText,"rdline"); + rText += "rdline"; else if (aStr.EqualsAscii(">")) - APPEND(rText,"rangle"); + rText += "rangle"; else rText.Append(aStr); rText.Append(' '); } else - APPEND(rText,"none "); + rText += "none "; } rText.Append(' '); @@ -2056,23 +2050,23 @@ void SmFontNode::CreateTextFromNode(String &rText) switch (GetToken().eType) { case TBOLD: - APPEND(rText,"bold "); + rText += "bold "; break; case TNBOLD: - APPEND(rText,"nbold "); + rText += "nbold "; break; case TITALIC: - APPEND(rText,"italic "); + rText += "italic "; break; case TNITALIC: - APPEND(rText,"nitalic "); + rText += "nitalic "; break; case TPHANTOM: - APPEND(rText,"phantom "); + rText += "phantom "; break; case TSIZE: { - APPEND(rText,"size "); + rText += "size "; switch (nSizeType) { case FNTSIZ_PLUS: @@ -2099,37 +2093,37 @@ void SmFontNode::CreateTextFromNode(String &rText) } break; case TBLACK: - APPEND(rText,"color black "); + rText += "color black "; break; case TWHITE: - APPEND(rText,"color white "); + rText += "color white "; break; case TRED: - APPEND(rText,"color red "); + rText += "color red "; break; case TGREEN: - APPEND(rText,"color green "); + rText += "color green "; break; case TBLUE: - APPEND(rText,"color blue "); + rText += "color blue "; break; case TCYAN: - APPEND(rText,"color cyan "); + rText += "color cyan "; break; case TMAGENTA: - APPEND(rText,"color magenta "); + rText += "color magenta "; break; case TYELLOW: - APPEND(rText,"color yellow "); + rText += "color yellow "; break; case TSANS: - APPEND(rText,"font sans "); + rText += "font sans "; break; case TSERIF: - APPEND(rText,"font serif "); + rText += "font serif "; break; case TFIXED: - APPEND(rText,"font fixed "); + rText += "font fixed "; break; default: break; @@ -2420,10 +2414,10 @@ void SmTextNode::CreateTextFromNode(String &rText) if ((GetToken().eType == TIDENT) && (GetFontDesc() == FNT_FUNCTION)) { //Search for existing functions and remove extraenous keyword - APPEND(rText,"func "); + rText += "func "; } else if (bQuoted) - APPEND(rText,"italic "); + rText += "italic "; if (bQuoted) rText.Append('\"'); @@ -2511,7 +2505,7 @@ sal_Unicode SmTextNode::ConvertSymbolToUnicode(sal_Unicode nIn) void SmMatrixNode::CreateTextFromNode(String &rText) { - APPEND(rText,"matrix {"); + rText += "matrix {"; for (sal_uInt16 i = 0; i < nNumRows; i++) { for (sal_uInt16 j = 0; j < nNumCols; j++) @@ -2519,13 +2513,13 @@ void SmMatrixNode::CreateTextFromNode(String &rText) SmNode *pNode = GetSubNode(i * nNumCols + j); pNode->CreateTextFromNode(rText); if (j != nNumCols-1) - APPEND(rText,"# "); + rText += "# "; } if (i != nNumRows-1) - APPEND(rText,"## "); + rText += "## "; } rText = comphelper::string::stripEnd(rText, ' '); - APPEND(rText,"} "); + rText += "} "; } @@ -2759,13 +2753,13 @@ void SmRectangleNode::CreateTextFromNode(String &rText) switch (GetToken().eType) { case TUNDERLINE: - APPEND(rText,"underline "); + rText += "underline "; break; case TOVERLINE: - APPEND(rText,"overline "); + rText += "overline "; break; case TOVERSTRIKE: - APPEND(rText,"overstrike "); + rText += "overstrike "; break; default: break; @@ -2791,49 +2785,49 @@ void SmAttributNode::CreateTextFromNode(String &rText) switch (nLast) { case 0xAF: // MACRON - APPEND(rText,"overline "); + rText += "overline "; break; case MS_DOT: // DOT ABOVE - APPEND(rText,"dot "); + rText += "dot "; break; case 0x2dc: // SMALL TILDE - APPEND(rText,"widetilde "); + rText += "widetilde "; break; case MS_DDOT: // DIAERESIS - APPEND(rText,"ddot "); + rText += "ddot "; break; case 0xE082: break; case 0xE09B: case MS_DDDOT: // COMBINING THREE DOTS ABOVE - APPEND(rText,"dddot "); + rText += "dddot "; break; case MS_ACUTE: // COMBINING ACUTE ACCENT - APPEND(rText,"acute "); + rText += "acute "; break; case MS_GRAVE: // COMBINING GRAVE ACCENT - APPEND(rText,"grave "); + rText += "grave "; break; case MS_CHECK: // COMBINING CARON - APPEND(rText,"check "); + rText += "check "; break; case MS_BREVE: // COMBINING BREVE - APPEND(rText,"breve "); + rText += "breve "; break; case MS_CIRCLE: // COMBINING RING ABOVE - APPEND(rText,"circle "); + rText += "circle "; break; case MS_VEC: // COMBINING RIGHT ARROW ABOVE - APPEND(rText,"vec "); + rText += "vec "; break; case MS_TILDE: // COMBINING TILDE - APPEND(rText,"tilde "); + rText += "tilde "; break; case MS_HAT: // COMBINING CIRCUMFLEX ACCENT - APPEND(rText,"hat "); + rText += "hat "; break; case MS_BAR: // COMBINING MACRON - APPEND(rText,"bar "); + rText += "bar "; break; default: rText.Append(nLast); @@ -2849,9 +2843,9 @@ void SmAttributNode::CreateTextFromNode(String &rText) rText = comphelper::string::stripEnd(rText, ' '); if (nLast == 0xE082) - APPEND(rText," overbrace {}"); + rText += " overbrace {}"; - APPEND(rText,"} "); + rText += "} "; } /**************************************************************************/ |