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

http://bugzserver/show_bug.cgi?id=30163

bold и italic перекинуты в <m:rPr>

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@66685 954022d7-b5bf-4e40-9824-e11837661b57
parent 6c8b05b3
...@@ -19,14 +19,12 @@ namespace MathEquation ...@@ -19,14 +19,12 @@ namespace MathEquation
LONG nTextSize; LONG nTextSize;
bool bAccent; bool bAccent;
MEMBELTYPE eType; MEMBELTYPE eType;
BYTE eStyle;
bool bNormal; bool bNormal;
public: public:
EquationRun() EquationRun()
{ {
bNormal = false; bNormal = false;
eStyle = NULL;
} }
void AddChar(CString sChar, TMathFont* pNewFont, LONG lSize) void AddChar(CString sChar, TMathFont* pNewFont, LONG lSize)
{ {
...@@ -168,18 +166,6 @@ namespace MathEquation ...@@ -168,18 +166,6 @@ namespace MathEquation
//else //else
// nCurPos = WriteItemStart(BinDocxRW::c_oSerRunType::rPr); // nCurPos = WriteItemStart(BinDocxRW::c_oSerRunType::rPr);
if (false != pFont->bBold)
{
m_oStream.WriteBYTE(BinDocxRW::c_oSerProp_rPrType::Bold);
m_oStream.WriteBYTE(BinDocxRW::c_oSerPropLenType::Byte);
m_oStream.WriteBOOL(true);
}
if (false != pFont->bItalic)
{
m_oStream.WriteBYTE(BinDocxRW::c_oSerProp_rPrType::Italic);
m_oStream.WriteBYTE(BinDocxRW::c_oSerPropLenType::Byte);
m_oStream.WriteBOOL(true);
}
CString sFontName; CString sFontName;
//sFontName.Format(_T("%lS"), pFont->sName.c_str()); //sFontName.Format(_T("%lS"), pFont->sName.c_str());
sFontName.Insert(0, _T("Cambria Math")); sFontName.Insert(0, _T("Cambria Math"));
...@@ -215,8 +201,21 @@ namespace MathEquation ...@@ -215,8 +201,21 @@ namespace MathEquation
{ {
int nCurPos = WriteItemStart(BinDocxRW::c_oSer_OMathContentType::MRPr); int nCurPos = WriteItemStart(BinDocxRW::c_oSer_OMathContentType::MRPr);
if (oRun.eStyle) BYTE eStyle = SimpleTypes::stylePlain;
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::Sty, oRun.eStyle); if (oRun.pFont->bBold || oRun.pFont->bItalic)
{
if (oRun.pFont->bBold)
{
if (oRun.pFont->bItalic)
eStyle = SimpleTypes::styleBoldItalic;
else
eStyle = SimpleTypes::styleBold;
}
else if ( oRun.pFont->bItalic )
eStyle = SimpleTypes::styleItalic;
}
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::Sty, eStyle );
if (oRun.bNormal) if (oRun.bNormal)
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::Nor, oRun.bNormal); WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::Nor, oRun.bNormal);
WriteItemEnd(nCurPos); WriteItemEnd(nCurPos);
...@@ -228,7 +227,6 @@ namespace MathEquation ...@@ -228,7 +227,6 @@ namespace MathEquation
TMathFont* pCurFont = oRun.pFont; TMathFont* pCurFont = oRun.pFont;
int nCurPos = WriteItemStart(BinDocxRW::c_oSer_OMathContentType::MRun); int nCurPos = WriteItemStart(BinDocxRW::c_oSer_OMathContentType::MRun);
WriteRPR(oRun.pFont, oRun.nTextSize, bIsOpen); WriteRPR(oRun.pFont, oRun.nTextSize, bIsOpen);
if (oRun.eStyle || oRun.bNormal)
WriteMRPR(oRun); WriteMRPR(oRun);
int nCurPos1 = WriteItemStart(BinDocxRW::c_oSer_OMathContentType::MText); int nCurPos1 = WriteItemStart(BinDocxRW::c_oSer_OMathContentType::MText);
m_oStream.WriteBYTE(BinDocxRW::c_oSer_OMathBottomNodesValType::Val); m_oStream.WriteBYTE(BinDocxRW::c_oSer_OMathBottomNodesValType::Val);
...@@ -462,10 +460,7 @@ namespace MathEquation ...@@ -462,10 +460,7 @@ namespace MathEquation
} }
else else
{ {
if ((uChar > 0x0390 && uChar < 0x03AA) //Greek Capital Letter if (uChar == 0x0026)
|| (uChar == 0x2207)) //Nabla
oRun.eStyle = SimpleTypes::stylePlain;
else if (uChar == 0x0026)
{ {
if (oRManager.GetAlligment()) if (oRManager.GetAlligment())
oRun.bNormal = true; oRun.bNormal = true;
...@@ -596,7 +591,7 @@ namespace MathEquation ...@@ -596,7 +591,7 @@ namespace MathEquation
int nPos = 0; int nPos = 0;
if (!m_aRowsPosCounter.empty()) if (!m_aRowsPosCounter.empty())
{ {
nRows = m_aRowsPosCounter.top(); nPos = m_aRowsPosCounter.top();
m_aRowsPosCounter.pop(); m_aRowsPosCounter.pop();
} }
int nEnd = m_oStream.GetPosition(); int nEnd = m_oStream.GetPosition();
......
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