Some more fixes

Forgotten in 150c9f8bbc

Change-Id: I177c3bcb15bf789a68b8758a8a545d4c6bdf5d85
Reviewed-on: https://gerrit.libreoffice.org/5820
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
This commit is contained in:
Thomas Arnhold
2013-09-04 22:47:59 +02:00
parent 62d5067191
commit ffda2ff88a

View File

@@ -664,7 +664,7 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector,
bool bOpenString=false; bool bOpenString=false;
sal_Int32 nTextStart = 0; sal_Int32 nTextStart = 0;
sal_Int32 nSubSupStartPos = 0; sal_Int32 nSubSupStartPos = 0;
sal_Int32 nLastTemplateBracket=STRING_NOTFOUND; sal_Int32 nLastTemplateBracket=-1;
do do
{ {
@@ -1261,7 +1261,7 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector,
{ {
bool bOk=false; bool bOk=false;
sal_Int32 nI = rRet.lastIndexOf('{'); sal_Int32 nI = rRet.lastIndexOf('{');
if (nI != STRING_NOTFOUND) if (nI != -1)
{ {
for(nI=nI+1;nI<rRet.getLength();nI++) for(nI=nI+1;nI<rRet.getLength();nI++)
if (rRet[nI] != ' ') if (rRet[nI] != ' ')
@@ -1386,7 +1386,7 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector,
bool bOk=false; bool bOk=false;
sal_Int32 nI = rRet.lastIndexOf('{'); sal_Int32 nI = rRet.lastIndexOf('{');
if (nI != STRING_NOTFOUND) if (nI != -1)
{ {
for(nI=nI+1;nI<rRet.getLength();nI++) for(nI=nI+1;nI<rRet.getLength();nI++)
if (rRet[nI] != ' ') if (rRet[nI] != ' ')
@@ -2694,7 +2694,7 @@ int MathType::HandleMatrix(int nLevel,sal_uInt8 nSelector,
int nRet = HandleRecords(nLevel+1,nSelector,nVariation,nRows,nCols); int nRet = HandleRecords(nLevel+1,nSelector,nVariation,nRows,nCols);
sal_Int32 nI = rRet.lastIndexOf('#'); sal_Int32 nI = rRet.lastIndexOf('#');
if ((nI != STRING_NOTFOUND) && (nI > 0)) if ((nI != -1) && (nI > 0))
if (rRet[nI-1] != '#') //missing column if (rRet[nI-1] != '#') //missing column
rRet += "{}"; rRet += "{}";
@@ -2723,7 +2723,7 @@ int MathType::HandleTemplate(int nLevel,sal_uInt8 &rSelector,
//another one after it, mathtype handles it as if the second one was //another one after it, mathtype handles it as if the second one was
//inside the first one and renders it as sub of sub //inside the first one and renders it as sub of sub
bool bRemove=false; bool bRemove=false;
if ( (rSelector == 0xf) && (rLastTemplateBracket != STRING_NOTFOUND) ) if ( (rSelector == 0xf) && (rLastTemplateBracket != -1) )
{ {
bRemove=true; bRemove=true;
for (sal_Int32 nI = rLastTemplateBracket+1; nI < rRet.getLength(); nI++ ) for (sal_Int32 nI = rLastTemplateBracket+1; nI < rRet.getLength(); nI++ )
@@ -2741,12 +2741,12 @@ int MathType::HandleTemplate(int nLevel,sal_uInt8 &rSelector,
{ {
rRet = rRet.replaceAt(rLastTemplateBracket,1,""); rRet = rRet.replaceAt(rLastTemplateBracket,1,"");
rRet += "} "; rRet += "} ";
rLastTemplateBracket = STRING_NOTFOUND; rLastTemplateBracket = -1;
} }
if (rSelector == 0xf) if (rSelector == 0xf)
rLastTemplateBracket = rRet.lastIndexOf('}'); rLastTemplateBracket = rRet.lastIndexOf('}');
else else
rLastTemplateBracket = STRING_NOTFOUND; rLastTemplateBracket = -1;
rSelector = sal::static_int_cast< sal_uInt8 >(-1); rSelector = sal::static_int_cast< sal_uInt8 >(-1);
return nRet; return nRet;