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

(2.0.0.188): ASCOfficeDocxFile2

1) сброс текстовых настроек для чтения у формул
2) поправлен баг, когда отсутствуют настройки для матрицы в формулах

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@58722 954022d7-b5bf-4e40-9824-e11837661b57
parent d38f58fb
......@@ -2650,7 +2650,7 @@ public:
if (bVal)
sVal += _T(" m:val=\"true\" />");
else
sVal += _T(" />");
sVal += _T(" m:val=\"false\" />");
m_oFileWriter.m_oSettingWriter.AddSetting(sVal);
}
else
......@@ -3251,7 +3251,7 @@ public:
if (bVal)
sVal += _T(" m:val=\"true\" />");
else
sVal += _T(" />");
sVal += _T(" m:val=\"false\" />");
GetRunStringWriter().WriteString(sVal);
}
else
......@@ -3268,7 +3268,7 @@ public:
if (bVal)
sVal += _T(" m:val=\"true\" />");
else
sVal += _T(" />");
sVal += _T(" m:val=\"false\" />");
GetRunStringWriter().WriteString(sVal);
}
else
......@@ -3622,6 +3622,7 @@ public:
int res = c_oSerConstants::ReadOk;
if ( c_oSerRunType::rPr == type )
{
m_oMath_rPr.Reset();
res = oBinary_rPrReader.Read(length, &m_oMath_rPr);
if(m_oMath_rPr.IsNoEmpty())
m_oMath_rPr.Write(&GetRunStringWriter());
......@@ -3659,7 +3660,7 @@ public:
if (bVal)
sVal += _T(" m:val=\"true\" />");
else
sVal += _T(" />");
sVal += _T(" m:val=\"false\" />");
GetRunStringWriter().WriteString(sVal);
}
else
......@@ -3676,7 +3677,7 @@ public:
if (bVal)
sVal += _T(" m:val=\"true\" />");
else
sVal += _T(" />");
sVal += _T(" m:val=\"false\" />");
GetRunStringWriter().WriteString(sVal);
}
else
......@@ -3941,7 +3942,7 @@ public:
if (bVal)
sVal += _T(" m:val=\"true\" />");
else
sVal += _T(" />");
sVal += _T(" m:val=\"false\" />");
GetRunStringWriter().WriteString(sVal);
}
else
......@@ -3958,7 +3959,7 @@ public:
if (bVal)
sVal += _T(" m:val=\"true\" />");
else
sVal += _T(" />");
sVal += _T(" m:val=\"false\" />");
GetRunStringWriter().WriteString(sVal);
}
else
......@@ -3975,7 +3976,7 @@ public:
if (bVal)
sVal += _T(" m:val=\"true\" />");
else
sVal += _T(" />");
sVal += _T(" m:val=\"false\" />");
GetRunStringWriter().WriteString(sVal);
}
else
......@@ -3992,7 +3993,7 @@ public:
if (bVal)
sVal += _T(" m:val=\"true\" />");
else
sVal += _T(" />");
sVal += _T(" m:val=\"false\" />");
GetRunStringWriter().WriteString(sVal);
}
else
......@@ -4128,7 +4129,7 @@ public:
if (bVal)
sVal += _T(" m:val=\"true\" />");
else
sVal += _T(" />");
sVal += _T(" m:val=\"false\" />");
GetRunStringWriter().WriteString(sVal);
}
else
......@@ -4164,7 +4165,7 @@ public:
if (bVal)
sVal += _T(" m:val=\"true\" />");
else
sVal += _T(" />");
sVal += _T(" m:val=\"false\" />");
GetRunStringWriter().WriteString(sVal);
}
else
......@@ -4242,6 +4243,10 @@ public:
{
res = Read2(length, &Binary_DocumentTableReader::ReadMathLong, this, poResult);
}
else if ( c_oSer_OMathBottomNodesType::Column == type )
{
res = Read2(length, &Binary_DocumentTableReader::ReadMathLong, this, poResult);
}
else if ( c_oSer_OMathBottomNodesType::BaseJc == type )
{
res = Read2(length, &Binary_DocumentTableReader::ReadMathBaseJc, this, poResult);
......@@ -4294,7 +4299,7 @@ public:
GetRunStringWriter().WriteString(CString(_T("<m:e>")));
res = Read1(length, &Binary_DocumentTableReader::ReadMathArg, this, poResult);
GetRunStringWriter().WriteString(CString(_T("</m:e>")));
}
}
else
res = c_oSerConstants::ReadUnknown;
return res;
......@@ -4373,7 +4378,7 @@ public:
if (bVal)
sVal += _T(" m:val=\"true\" />");
else
sVal += _T(" />");
sVal += _T(" m:val=\"false\" />");
GetRunStringWriter().WriteString(sVal);
}
else
......@@ -4390,7 +4395,7 @@ public:
if (bVal)
sVal += _T(" m:val=\"true\" />");
else
sVal += _T(" />");
sVal += _T(" m:val=\"false\" />");
GetRunStringWriter().WriteString(sVal);
}
else
......@@ -4407,7 +4412,7 @@ public:
if (bVal)
sVal += _T(" m:val=\"true\" />");
else
sVal += _T(" />");
sVal += _T(" m:val=\"false\" />");
GetRunStringWriter().WriteString(sVal);
}
else
......@@ -4454,7 +4459,7 @@ public:
if (bVal)
sVal += _T(" m:val=\"true\" />");
else
sVal += _T(" />");
sVal += _T(" m:val=\"false\" />");
GetRunStringWriter().WriteString(sVal);
}
else
......@@ -4523,7 +4528,7 @@ public:
if (bVal)
sVal += _T(" m:val=\"true\" />");
else
sVal += _T(" />");
sVal += _T(" m:val=\"false\" />");
GetRunStringWriter().WriteString(sVal);
}
else
......@@ -4571,6 +4576,7 @@ public:
}
else if ( c_oSer_OMathContentType::RPr == type )
{
m_oMath_rPr.Reset();
res = oBinary_rPrReader.Read(length, &m_oMath_rPr);
if(m_oMath_rPr.IsNoEmpty())
m_oMath_rPr.Write(&GetRunStringWriter());
......@@ -4753,7 +4759,7 @@ public:
if (bVal)
sVal += _T(" m:val=\"true\" />");
else
sVal += _T(" />");
sVal += _T(" m:val=\"false\" />");
GetRunStringWriter().WriteString(sVal);
}
else
......@@ -4958,7 +4964,7 @@ public:
if (bVal)
sVal += _T(" m:val=\"true\" />");
else
sVal += _T(" />");
sVal += _T(" m:val=\"false\" />");
GetRunStringWriter().WriteString(sVal);
}
else
......@@ -4975,7 +4981,7 @@ public:
if (bVal)
sVal += _T(" m:val=\"true\" />");
else
sVal += _T(" />");
sVal += _T(" m:val=\"false\" />");
GetRunStringWriter().WriteString(sVal);
}
else
......@@ -4992,7 +4998,7 @@ public:
if (bVal)
sVal += _T(" m:val=\"true\" />");
else
sVal += _T(" />");
sVal += _T(" m:val=\"false\" />");
GetRunStringWriter().WriteString(sVal);
}
else
......@@ -5009,7 +5015,7 @@ public:
if (bVal)
sVal += _T(" m:val=\"true\" />");
else
sVal += _T(" />");
sVal += _T(" m:val=\"false\" />");
GetRunStringWriter().WriteString(sVal);
}
else
......@@ -5048,7 +5054,7 @@ public:
if (bVal)
sVal += _T(" m:val=\"true\" />");
else
sVal += _T(" />");
sVal += _T(" m:val=\"false\" />");
GetRunStringWriter().WriteString(sVal);
}
else
......@@ -5065,7 +5071,7 @@ public:
if (bVal)
sVal += _T(" m:val=\"true\" />");
else
sVal += _T(" />");
sVal += _T(" m:val=\"false\" />");
GetRunStringWriter().WriteString(sVal);
}
else
......@@ -5082,7 +5088,7 @@ public:
if (bVal)
sVal += _T(" m:val=\"true\" />");
else
sVal += _T(" />");
sVal += _T(" m:val=\"false\" />");
GetRunStringWriter().WriteString(sVal);
}
else
......@@ -5141,7 +5147,7 @@ public:
if (bVal)
sVal += _T(" m:val=\"true\" />");
else
sVal += _T(" />");
sVal += _T(" m:val=\"false\" />");
GetRunStringWriter().WriteString(sVal);
}
else
......@@ -5158,7 +5164,7 @@ public:
if (bVal)
sVal += _T(" m:val=\"true\" />");
else
sVal += _T(" />");
sVal += _T(" m:val=\"false\" />");
GetRunStringWriter().WriteString(sVal);
}
else
......@@ -5175,7 +5181,7 @@ public:
if (bVal)
sVal += _T(" m:val=\"true\" />");
else
sVal += _T(" />");
sVal += _T(" m:val=\"false\" />");
GetRunStringWriter().WriteString(sVal);
}
else
......@@ -5345,7 +5351,7 @@ public:
else
res = c_oSerConstants::ReadUnknown;
return res;
};
};
int ReadComment(BYTE type, long length, void* poResult)
{
long* pVal = static_cast<long*>(poResult);
......
......@@ -3047,7 +3047,18 @@ namespace BinDocxRW
OOX::Logic::CMatrix* pMatrix = static_cast<OOX::Logic::CMatrix*>(item);
nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::Matrix);
WriteMathMatrix(pMatrix->m_arrItems, pMatrix->m_lRow);
LONG lCol = 0;
for ( int j = 0; j < pMatrix->m_arrItems.size(); j++)
{
OOX::WritingElement* item = pMatrix->m_arrItems[j];
if (item->getType() == OOX::et_m_mr)
{
OOX::Logic::CMr* pMr = static_cast<OOX::Logic::CMr*>(item);
lCol = pMr->GetCol();
break;
}
}
WriteMathMatrix(pMatrix->m_arrItems, pMatrix->m_lRow, lCol);
m_oBcw.WriteItemEnd(nCurPos);
break;
}
......@@ -3773,7 +3784,7 @@ namespace BinDocxRW
}
m_oBcw.WriteItemEnd(nCurPos);
}
void WriteMathMatrix(const std::vector<OOX::WritingElement*>& m_arrItems, LONG &lRow)
void WriteMathMatrix(const std::vector<OOX::WritingElement*>& m_arrItems, LONG &lRow, LONG &lCol)
{
BOOL bColumn = false;
for(int i = 0; i< m_arrItems.size(); ++i)
......@@ -3790,6 +3801,8 @@ namespace BinDocxRW
if (lRow)
WriteMathRow(lRow);
if (lCol)
WriteMathColumn(lCol);
if ( pMPr->m_oBaseJc.IsInit() )
WriteMathBaseJc(pMPr->m_oBaseJc.get());
if ( pMPr->m_oCGp.IsInit() )
......
......@@ -2,6 +2,6 @@
//2
//0
//0
//187
#define INTVER 2,0,0,187
#define STRVER "2,0,0,187\0"
//188
#define INTVER 2,0,0,188
#define STRVER "2,0,0,188\0"
......@@ -517,6 +517,7 @@ namespace SimpleTypes
virtual ETopBot FromString(CString &sValue)
{
if ( _T("bot") == sValue ) this->m_eValue = tbBot;
else if ( _T("bottom") == sValue ) this->m_eValue = tbBot;
else this->m_eValue = tbTop;
return this->m_eValue;
......
......@@ -854,6 +854,7 @@ namespace SimpleTypes
virtual EYAlign FromString(CString &sValue)
{
if ( _T("bottom") == sValue ) this->m_eValue = yalignBottom;
else if ( _T("bot") == sValue ) this->m_eValue = yalignBottom;
else if ( _T("center") == sValue ) this->m_eValue = yalignCenter;
else if ( _T("inline") == sValue ) this->m_eValue = yalignInline;
else if ( _T("inside") == sValue ) this->m_eValue = yalignInside;
......
......@@ -1804,6 +1804,8 @@ namespace OOX
if ( oReader.IsEmptyNode() )
return;
m_lCol = 0;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
......@@ -1811,7 +1813,10 @@ namespace OOX
WritingElement *pItem = NULL;
if ( _T("m:e") == sName )
{
pItem = new Logic::CElement( oReader );
m_lCol++;
}
if ( pItem )
m_arrItems.push_back( pItem );
......@@ -1838,8 +1843,13 @@ namespace OOX
{
return et_m_mr;
}
public:
LONG GetCol()
{
return m_lCol;
}
public:
// Childs
LONG m_lCol;
};
//--------------------------------------------------------------------------------
// CMatrix 22.1.2.60 (Matrix Object)
......
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