Commit b8b8a142 authored by ElenaSubbotina's avatar ElenaSubbotina

fix bug 36524 (fix MathType equation)

parent e5ef7497
...@@ -144,9 +144,13 @@ namespace MathEquation ...@@ -144,9 +144,13 @@ namespace MathEquation
void AddAccent (MEMBELTYPE eType) void AddAccent (MEMBELTYPE eType)
{ {
LONG lPos = GetSize() - 1; LONG lPos = GetSize() - 1;
if (lPos < 0) return;
EquationRun oRun; EquationRun oRun;
oRun = arrRun[lPos]; oRun = arrRun[lPos];
RemoveElem(lPos); RemoveElem(lPos);
oRun.bAccent = true; oRun.bAccent = true;
oRun.eType = eType; oRun.eType = eType;
Add(oRun); Add(oRun);
...@@ -557,11 +561,11 @@ namespace MathEquation ...@@ -557,11 +561,11 @@ namespace MathEquation
BYTE horAlign; BYTE horAlign;
switch(eHorAlign) switch(eHorAlign)
{ {
case matrixhoralignLeft: horAlign = SimpleTypes::xalignLeft; case matrixhoralignLeft: horAlign = SimpleTypes::xalignLeft; break;
case matrixhoralignCenter: horAlign = SimpleTypes::xalignCenter; case matrixhoralignCenter: horAlign = SimpleTypes::xalignCenter; break;
case matrixhoralignRight: horAlign = SimpleTypes::xalignRight; case matrixhoralignRight: horAlign = SimpleTypes::xalignRight; break;
case matrixhoralignEqualSign: horAlign = SimpleTypes::xalignCenter; case matrixhoralignEqualSign: horAlign = SimpleTypes::xalignCenter; break;
case matrixhoralignCommaSign: horAlign = SimpleTypes::xalignCenter; case matrixhoralignCommaSign: horAlign = SimpleTypes::xalignCenter; break;
} }
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::McJc, horAlign); WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::McJc, horAlign);
...@@ -614,7 +618,7 @@ namespace MathEquation ...@@ -614,7 +618,7 @@ namespace MathEquation
nRows = m_aRowsCounter.top(); nRows = m_aRowsCounter.top();
m_aRowsCounter.pop(); m_aRowsCounter.pop();
} }
int nPos = 0; int nPos = m_oStream.GetPosition();
if (!m_aRowsPosCounter.empty()) if (!m_aRowsPosCounter.empty())
{ {
nPos = m_aRowsPosCounter.top(); nPos = m_aRowsPosCounter.top();
...@@ -1675,7 +1679,7 @@ namespace MathEquation ...@@ -1675,7 +1679,7 @@ namespace MathEquation
void WriteEndNode(BinaryEquationWriter* pWriter) void WriteEndNode(BinaryEquationWriter* pWriter)
{ {
int nCurPos; int nCurPos = -1;
if (!m_aBaseStack.empty()) if (!m_aBaseStack.empty())
{ {
nCurPos = m_aBaseStack.top(); nCurPos = m_aBaseStack.top();
...@@ -1687,13 +1691,19 @@ namespace MathEquation ...@@ -1687,13 +1691,19 @@ namespace MathEquation
} }
if (bPile && bEqArrayStart) if (bPile && bEqArrayStart)
{
pWriter->WriteItemEnd(nCurPos); pWriter->WriteItemEnd(nCurPos);
}
else if (!bPile && !bEqArrayStart) else if (!bPile && !bEqArrayStart)
{
pWriter->WriteItemEnd(nCurPos); pWriter->WriteItemEnd(nCurPos);
}
else if (!bPile && bEqArrayStart) else if (!bPile && bEqArrayStart)
{ {
pWriter->m_aRowsCounter.push(nRows); pWriter->m_aRowsCounter.push(nRows);
bEqArrayStart = false; bEqArrayStart = false;
if (nCurPos > 0)
pWriter->WriteItemEnd(nCurPos);//eqArr pWriter->WriteItemEnd(nCurPos);//eqArr
if (!m_aBaseStack.empty()) if (!m_aBaseStack.empty())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment