Commit d795c35c authored by Sergey.Tsarkov's avatar Sergey.Tsarkov Committed by Alexander Trofimov

исправлены падения при конвертации старых формул с eqarray

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@63741 954022d7-b5bf-4e40-9824-e11837661b57
parent d5946c05
...@@ -467,10 +467,10 @@ namespace MathEquation ...@@ -467,10 +467,10 @@ namespace MathEquation
default: nHAlignPile = SimpleTypes::xalignLeft; break; default: nHAlignPile = SimpleTypes::xalignLeft; break;
} }
/*if (m_aCommandStack.empty()) if (m_aCommandStack.empty())
{ {
PushCommand(commandEqArray); PushCommand(commandEqArray);
}*/ }
m_aCommandStack.top()->SetPile(true, nHAlignPile); m_aCommandStack.top()->SetPile(true, nHAlignPile);
} }
virtual void EndPile() virtual void EndPile()
...@@ -1485,6 +1485,41 @@ namespace MathEquation ...@@ -1485,6 +1485,41 @@ namespace MathEquation
pWriter->WriteItemEnd(nElemPos);
nElemPos = pWriter->WriteItemStart(BinDocxRW::c_oSer_OMathContentType::Element);
nRows = 1;
m_aBaseStack.push(nElemPos);
}
}
void WriteBeginNode(BinaryEquationWriter* pWriter)
{
int nElemPos;
if (bEqArrayStart)
{
nElemPos = pWriter->WriteItemStart(BinDocxRW::c_oSer_OMathContentType::Element);
nRows++;
m_aBaseStack.push(nElemPos);
}
if (bPile && !bEqArrayStart)
{
bEqArrayStart = true;
nElemPos = pWriter->WriteItemStart(BinDocxRW::c_oSer_OMathContentType::EqArr);
m_aBaseStack.push(nElemPos);
nElemPos = pWriter->WriteItemStart(BinDocxRW::c_oSer_OMathContentType::EqArrPr);
pWriter->WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::McJc, nHAlignPile);
int nCurPos1 = pWriter->WriteItemStart(BinDocxRW::c_oSer_OMathBottomNodesType::Row);
pWriter->m_oStream.WriteBYTE(BinDocxRW::c_oSer_OMathBottomNodesValType::Val);
pWriter->m_oStream.WriteBYTE(BinDocxRW::c_oSerPropLenType::Long);
pWriter->m_aRowsPosCounter.push(pWriter->WriteItemWithLengthStart());
pWriter->WriteItemEnd(nCurPos1);
pWriter->WriteItemEnd(nElemPos); pWriter->WriteItemEnd(nElemPos);
nElemPos = pWriter->WriteItemStart(BinDocxRW::c_oSer_OMathContentType::Element); nElemPos = pWriter->WriteItemStart(BinDocxRW::c_oSer_OMathContentType::Element);
...@@ -1520,8 +1555,8 @@ namespace MathEquation ...@@ -1520,8 +1555,8 @@ namespace MathEquation
{ {
nCurPos = m_aBaseStack.top(); nCurPos = m_aBaseStack.top();
m_aBaseStack.pop(); m_aBaseStack.pop();
} pWriter->WriteItemEnd(nCurPos);
pWriter->WriteItemEnd(nCurPos); }
} }
} }
...@@ -1919,7 +1954,7 @@ namespace MathEquation ...@@ -1919,7 +1954,7 @@ namespace MathEquation
{ {
bOpenNode = bBeginNode; bOpenNode = bBeginNode;
if (bBeginNode) if (bBeginNode)
WriteBeginNode(pWriter, BinDocxRW::c_oSer_OMathContentType::EqArr); WriteBeginNode(pWriter);
else else
WriteEndNode(pWriter); WriteEndNode(pWriter);
} }
......
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