1
0
mirror of https://github.com/ONLYOFFICE/core.git synced 2025-04-18 14:04:06 +03:00
This commit is contained in:
ElenaSubbotina 2025-02-19 15:35:55 +03:00
parent 2c27cfc720
commit b14fa1c2a1
12 changed files with 536 additions and 524 deletions

View File

@ -5070,8 +5070,10 @@ void BinaryDocumentTableWriter::WriteMathArgNodes(const std::vector<OOX::Writing
}
void BinaryDocumentTableWriter::WriteMathRunContent(OOX::Logic::CMRun* pMRun)
{
if ( pMRun->m_oMRPr.IsInit() )
if (pMRun->m_oMRPr.IsInit())
{
WriteMathMRPr(pMRun->m_oMRPr.get());
}
if ( pMRun->m_oRPr.IsInit() )
{
int nCurPos2 = m_oBcw.WriteItemStart(c_oSer_OMathContentType::RPr);
@ -5084,102 +5086,182 @@ void BinaryDocumentTableWriter::WriteMathRunContent(OOX::Logic::CMRun* pMRun)
m_oBcw.m_oStream.WriteRecord2(0, pMRun->m_oARPr);
m_oBcw.WriteItemEnd(nCurPos2);
}
if ( pMRun->m_oMText.IsInit() )
WriteMathText(pMRun->m_oMText.get());
if ( pMRun->m_oBr.IsInit() )
{
int nBreakType = -1;
switch(pMRun->m_oBr->m_oType.GetValue())
{
case SimpleTypes::brtypeColumn: nBreakType = c_oSer_OMathContentType::columnbreak;break;
case SimpleTypes::brtypePage: nBreakType = c_oSer_OMathContentType::pagebreak;break;
case SimpleTypes::brtypeTextWrapping: nBreakType = c_oSer_OMathContentType::linebreak;break;
}
if (-1 != nBreakType)
{
m_oBcw.m_oStream.WriteBYTE(nBreakType);
m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null);
}
}
if ( pMRun->m_oDel.IsInit() )
if (pMRun->m_oDel.IsInit())
{
int nCurPos2 = m_oBcw.WriteItemStart(c_oSer_OMathContentType::Del);
WriteMathDel(pMRun->m_oDel.get());
m_oBcw.WriteItemEnd(nCurPos2);
}
if ( pMRun->m_oIns.IsInit() )
if (pMRun->m_oIns.IsInit())
{
int nCurPos2 = m_oBcw.WriteItemStart(c_oSer_OMathContentType::Ins);
WriteMathIns(pMRun->m_oIns.get());
m_oBcw.WriteItemEnd(nCurPos2);
}
if (pMRun->m_oNoBreakHyphen.IsInit())
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathContentType::NoBreakHyphen);
m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null);
}
if (pMRun->m_oSoftHyphen.IsInit())
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathContentType::SoftHyphen);
m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null);
}
if (pMRun->m_oTab.IsInit())
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathContentType::Tab);
m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null);
}
if (pMRun->m_oSym.IsInit())
{
wchar_t ch = 0x0FFF & pMRun->m_oSym->m_oChar->GetValue();
std::wstring sText(&ch, 1);
int nCurPos2 = m_oBcw.WriteItemStart(c_oSer_OMathContentType::Sym);
m_oBcw.m_oStream.WriteStringW(sText);
m_oBcw.WriteItemEnd(nCurPos2);
}
if (pMRun->m_oAnnotationRef.IsInit())
for (size_t i = 0; i < pMRun->m_arrItems.size(); ++i)
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathContentType::AnnotationRef);
m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null);
}
if (pMRun->m_oCommentReference.IsInit())
{
int nCurPos2 = m_oBcw.WriteItemStart(c_oSer_OMathContentType::CommentReference);
WriteComment(OOX::et_w_commentReference, pMRun->m_oCommentReference->m_oId);
m_oBcw.WriteItemEnd(nCurPos2);
}
if (pMRun->m_oCr.IsInit())
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathContentType::Cr);
m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null);
}
if (pMRun->m_oEndnoteRef.IsInit())
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathContentType::EndnoteRef);
m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null);
}
if (pMRun->m_oEndnoteReference.IsInit())
{
int nCurPos2 = m_oBcw.WriteItemStart(c_oSer_OMathContentType::EndnoteReference);
WriteNoteRef(pMRun->m_oEndnoteReference->m_oCustomMarkFollows, pMRun->m_oEndnoteReference->m_oId);
m_oBcw.WriteItemEnd(nCurPos2);
}
if (pMRun->m_oFootnoteRef.IsInit())
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathContentType::FootnoteRef);
m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null);
}
if (pMRun->m_oFootnoteReference.IsInit())
{
int nCurPos2 = m_oBcw.WriteItemStart(c_oSer_OMathContentType::FootnoteReference);
WriteNoteRef(pMRun->m_oFootnoteReference->m_oCustomMarkFollows, pMRun->m_oFootnoteReference->m_oId);
m_oBcw.WriteItemEnd(nCurPos2);
}
if (pMRun->m_oLastRenderedPageBreak.IsInit())
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathContentType::LastRenderedPageBreak);
m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null);
OOX::WritingElement* item = pMRun->m_arrItems[i];
switch (item->getType())
{
case OOX::et_w_br:
{
OOX::Logic::CBr* pBr = static_cast<OOX::Logic::CBr*>(item);
int nBreakType = -1;
switch (pBr->m_oType.GetValue())
{
case SimpleTypes::brtypeColumn: nBreakType = c_oSerRunType::columnbreak; break;
case SimpleTypes::brtypePage: nBreakType = c_oSerRunType::pagebreak; break;
case SimpleTypes::brtypeTextWrapping:
{
switch (pBr->m_oClear.GetValue())
{
case SimpleTypes::brclearAll: nBreakType = c_oSerRunType::linebreakClearAll; break;
case SimpleTypes::brclearLeft: nBreakType = c_oSerRunType::linebreakClearLeft; break;
case SimpleTypes::brclearRight: nBreakType = c_oSerRunType::linebreakClearRight; break;
default: nBreakType = c_oSerRunType::linebreak; break;
}
}break;
default:
break;
}
if (-1 != nBreakType)
{
m_oBcw.m_oStream.WriteBYTE(nBreakType);
m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null);
}
}break;
case OOX::et_w_cr:
{
m_oBcw.m_oStream.WriteBYTE(c_oSerRunType::cr);
m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null);
break;
}
case OOX::et_mc_alternateContent:
case OOX::et_w_pict:
case OOX::et_w_drawing:
{
WriteDrawingPptx(item);
}break;
case OOX::et_w_fldChar:
{
OOX::Logic::CFldChar* pFldChar = static_cast<OOX::Logic::CFldChar*>(item);
int nCurPos = m_oBcw.WriteItemStart(c_oSerRunType::fldChar);
WriteFldChar(pFldChar);
m_oBcw.WriteItemEnd(nCurPos);
}break;
case OOX::et_w_delInstrText:
{
OOX::Logic::CDelInstrText* pInstrText = static_cast<OOX::Logic::CDelInstrText*>(item);
WriteText(pInstrText->m_sText, c_oSerRunType::delInstrText);
}break;
case OOX::et_w_instrText:
{
OOX::Logic::CInstrText* pInstrText = static_cast<OOX::Logic::CInstrText*>(item);
WriteText(pInstrText->m_sText, c_oSerRunType::instrText);
}
break;
case OOX::et_w_nonBreakHyphen:
{
m_oBcw.m_oStream.WriteBYTE(c_oSerRunType::noBreakHyphen);
m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null);
}break;
case OOX::et_w_pgNum:
{
m_oBcw.m_oStream.WriteBYTE(c_oSerRunType::pagenum);
m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null);
}break;
case OOX::et_w_ptab:
break;
case OOX::et_w_softHyphen:
{
m_oBcw.m_oStream.WriteBYTE(c_oSerRunType::softHyphen);
m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null);
}break;
case OOX::et_w_sym:
{
OOX::Logic::CSym* oSym = static_cast<OOX::Logic::CSym*>(item);
wchar_t ch = 0x0FFF & oSym->m_oChar->GetValue();
std::wstring sText(&ch, 1);
WriteText(sText, c_oSerRunType::run); // todooo определить что писать c_oSerRunType::run или c_oSerRunType::delText - 66333
}break;
case OOX::et_w_delText:
{
std::wstring& sText = static_cast<OOX::Logic::CDelText*>(item)->m_sText;
WriteText(sText, c_oSerRunType::delText);
}break;
case OOX::et_w_t:
{
std::wstring& sText = static_cast<OOX::Logic::CText*>(item)->m_sText;
WriteText(sText, c_oSerRunType::run);
}break;
case OOX::et_w_tab:
{
m_oBcw.m_oStream.WriteBYTE(c_oSerRunType::tab);
m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null);
}break;
case OOX::et_w_separator:
{
m_oBcw.m_oStream.WriteBYTE(c_oSerRunType::separator);
m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null);
}break;
case OOX::et_w_continuationSeparator:
{
m_oBcw.m_oStream.WriteBYTE(c_oSerRunType::continuationSeparator);
m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null);
}break;
case OOX::et_w_commentReference:
{
OOX::Logic::CCommentReference* pCommentReference = static_cast<OOX::Logic::CCommentReference*>(item);
WriteComment(OOX::et_w_commentReference, pCommentReference->m_oId);
}break;
case OOX::et_w_object:
{
int nPosObject = m_oBcw.WriteItemStart(c_oSerRunType::object);
OOX::Logic::CObject* pObject = static_cast<OOX::Logic::CObject*>(item);
std::wstring* pXml = pObject ? pObject->m_sXml.GetPointer() : NULL;
int nPosImageCache = m_oBcw.WriteItemStart(c_oSerRunType::pptxDrawing);
WriteDrawing(pXml, NULL, NULL);
m_oBcw.WriteItemEnd(nPosImageCache);
m_oBcw.WriteItemEnd(nPosObject);
}break;
case OOX::et_w_footnoteRef:
{
m_oBcw.m_oStream.WriteBYTE(c_oSerRunType::footnoteRef);
m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null);
}break;
case OOX::et_w_endnoteRef:
{
m_oBcw.m_oStream.WriteBYTE(c_oSerRunType::endnoteRef);
m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null);
}break;
case OOX::et_w_footnoteReference:
{
OOX::Logic::CFootnoteReference* pFootnoteReference = static_cast<OOX::Logic::CFootnoteReference*>(item);
int nCurPos = m_oBcw.WriteItemStart(c_oSerRunType::footnoteReference);
WriteNoteRef(pFootnoteReference->m_oCustomMarkFollows, pFootnoteReference->m_oId);
m_oBcw.WriteItemEnd(nCurPos);
}break;
case OOX::et_w_endnoteReference:
{
OOX::Logic::CEndnoteReference* pEndnoteReference = static_cast<OOX::Logic::CEndnoteReference*>(item);
int nCurPos = m_oBcw.WriteItemStart(c_oSerRunType::endnoteReference);
WriteNoteRef(pEndnoteReference->m_oCustomMarkFollows, pEndnoteReference->m_oId);
m_oBcw.WriteItemEnd(nCurPos);
}break;
case OOX::et_m_t:
{
WriteMathText(*static_cast<OOX::Logic::CMText*>(item));
}
break;
default:
break;
}
}
}
void BinaryDocumentTableWriter::WriteMathAccPr(const OOX::Logic::CAccPr &pAccPr)

View File

@ -71,10 +71,8 @@ namespace OOX
virtual std::wstring toXML() const;
virtual EElementType getType() const;
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader);
public:
SimpleTypes::CBrClear m_oClear;
@ -97,14 +95,12 @@ namespace OOX
virtual std::wstring toXML() const;
virtual EElementType getType() const;
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader);
public:
std::wstring m_namespace;
nullable<PPTX::Logic::Xfrm> m_oXfrm;
//nullable<nvContentPartPr> m_oNvContentPartPr;
std::wstring m_namespace;
nullable<PPTX::Logic::Xfrm> m_oXfrm;
//nullable<nvContentPartPr> m_oNvContentPartPr;
nullable<SimpleTypes::CRelationshipId > m_oId;
};
@ -173,18 +169,14 @@ namespace OOX
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const;
virtual std::wstring toXML() const;
virtual EElementType getType() const;
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader);
public:
// Attributes
nullable<SimpleTypes::CXmlSpace> m_oSpace;
// Value
std::wstring m_sText;
std::wstring m_sText;
};
@ -283,19 +275,17 @@ namespace OOX
CPTab(OOX::Document *pMain = NULL);
virtual ~CPTab();
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const;
virtual std::wstring toXML() const;
virtual EElementType getType() const;
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader);
public:
nullable<SimpleTypes::CPTabAlignment > m_oAlignment;
nullable<SimpleTypes::CPTabLeader > m_oLeader;
nullable<SimpleTypes::CPTabAlignment> m_oAlignment;
nullable<SimpleTypes::CPTabLeader> m_oLeader;
nullable<SimpleTypes::CPTabRelativeTo> m_oRelativeTo;
};
@ -310,11 +300,10 @@ namespace OOX
CRuby(OOX::Document *pMain = NULL);
virtual ~CRuby();
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const;
virtual std::wstring toXML() const;
virtual EElementType getType() const;
};
@ -327,12 +316,11 @@ namespace OOX
WritingElement_AdditionMethods(CSoftHyphen)
CSoftHyphen(OOX::Document *pMain = NULL);
virtual ~CSoftHyphen();
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const;
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const;
virtual EElementType getType() const;
};
@ -346,19 +334,16 @@ namespace OOX
CSym(OOX::Document *pMain = NULL);
virtual ~CSym();
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const;
virtual std::wstring toXML() const;
virtual EElementType getType() const;
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader);
public:
nullable<SimpleTypes::CShortHexNumber> m_oChar;
nullable<std::wstring> m_oFont;
nullable<SimpleTypes::CShortHexNumber> m_oChar;
nullable<std::wstring> m_oFont;
};
@ -379,16 +364,11 @@ namespace OOX
virtual EElementType getType() const;
static void ReadAttributes(XmlUtils::CXmlLiteReader& oReader, nullable<SimpleTypes::CXmlSpace>& oSpace);
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader);
public:
// Attributes
nullable<SimpleTypes::CXmlSpace> m_oSpace;
// Value
std::wstring m_sText;
std::wstring m_sText;
};
//--------------------------------------------------------------------------------
@ -401,11 +381,10 @@ namespace OOX
CTab(OOX::Document *pMain = NULL);
virtual ~CTab();
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const;
virtual std::wstring toXML() const;
virtual EElementType getType() const;
};
@ -419,11 +398,10 @@ namespace OOX
CYearLong(OOX::Document *pMain = NULL);
virtual ~CYearLong();
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const;
virtual std::wstring toXML() const;
virtual EElementType getType() const;
};
@ -437,11 +415,10 @@ namespace OOX
CYearShort(OOX::Document *pMain = NULL);
virtual ~CYearShort();
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const;
virtual std::wstring toXML() const;
virtual EElementType getType() const;
};
@ -458,7 +435,7 @@ namespace OOX
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const;
virtual std::wstring toXML() const;
virtual EElementType getType() const;
};
@ -475,9 +452,8 @@ namespace OOX
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const;
virtual std::wstring toXML() const;
virtual EElementType getType() const;
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader);
@ -498,7 +474,7 @@ namespace OOX
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const;
virtual std::wstring toXML() const;
virtual EElementType getType() const;
};
@ -515,18 +491,16 @@ namespace OOX
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const;
virtual std::wstring toXML() const;
virtual EElementType getType() const;
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader);
public:
// Attributes
nullable<SimpleTypes::CXmlSpace> m_oSpace;
// Value
std::wstring m_sText;
std::wstring m_sText;
};
@ -543,7 +517,7 @@ namespace OOX
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const;
virtual std::wstring toXML() const;
virtual EElementType getType() const;
};
@ -562,13 +536,11 @@ namespace OOX
virtual std::wstring toXML() const;
virtual EElementType getType() const;
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader);
public:
nullable<SimpleTypes::COnOff> m_oCustomMarkFollows;
nullable<SimpleTypes::CDecimalNumber> m_oId;
nullable<SimpleTypes::COnOff> m_oCustomMarkFollows;
nullable<SimpleTypes::CDecimalNumber> m_oId;
};
@ -585,7 +557,7 @@ namespace OOX
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const;
virtual std::wstring toXML() const;
virtual EElementType getType() const;
};
@ -602,15 +574,15 @@ namespace OOX
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const;
virtual std::wstring toXML() const;
virtual EElementType getType() const;
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader);
public:
nullable<SimpleTypes::COnOff> m_oCustomMarkFollows;
nullable<SimpleTypes::CDecimalNumber> m_oId;
nullable<SimpleTypes::COnOff> m_oCustomMarkFollows;
nullable<SimpleTypes::CDecimalNumber> m_oId;
};
//--------------------------------------------------------------------------------
@ -626,18 +598,13 @@ namespace OOX
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const;
virtual std::wstring toXML() const;
virtual EElementType getType() const;
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader);
public:
// Attributes
nullable<SimpleTypes::CXmlSpace> m_oSpace;
// Value
std::wstring m_sText;
std::wstring m_sText;
};
@ -654,7 +621,7 @@ namespace OOX
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const;
virtual std::wstring toXML() const;
virtual EElementType getType() const;
};

View File

@ -499,8 +499,8 @@ namespace OOX
void CBrk::ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_ReadSingle( oReader, _T("m:alnAt"), m_alnAt )
WritingElement_ReadAttributes_End( oReader )
WritingElement_ReadAttributes_ReadSingle( oReader, _T("m:alnAt"), m_alnAt )
WritingElement_ReadAttributes_End( oReader )
}
//--------------------------------------------------------------------------------
@ -2289,11 +2289,22 @@ namespace OOX
// CMRun 22.1.2.87 (Math Run)
//--------------------------------------------------------------------------------
CMRun::CMRun(OOX::Document *pMain) : WritingElement(pMain)
CMRun::CMRun(OOX::Document *pMain) : WritingElementWithChilds<>(pMain)
{
}
CMRun::~CMRun()
{
ClearItems();
}
void CMRun::ClearItems()
{
m_oARPr.reset();
m_oMRPr.reset();
m_oRPr.reset();
m_oDel.reset();
m_oIns.reset();
WritingElementWithChilds<>::ClearItems();
}
void CMRun::fromXML(XmlUtils::CXmlNode& oNode)
{
@ -2306,83 +2317,89 @@ namespace OOX
if ( oItem.IsValid( ) )
{
std::wstring sName = oItem.GetName();
WritingElement* pItem = NULL;
if ( _T("w:annotationRef") == sName )
m_oAnnotationRef = oItem;
else if ( _T("w:br") == sName )
m_oBr = oItem;
else if ( _T("w:commentReference") == sName )
m_oCommentReference = oItem;
else if ( _T("w:contentPart") == sName )
m_oContentPart = oItem;
else if ( _T("w:continuationSeparator") == sName )
m_oContinuationSeparator = oItem;
else if ( _T("w:cr") == sName )
m_oCr = oItem;
else if ( _T("w:dayLong") == sName )
m_oDayLong = oItem;
else if ( _T("w:dayShort") == sName )
m_oDayShort = oItem;
else if ( _T("w:del") == sName )
if (L"w:annotationRef" == sName)
AssignPtrXmlContent(pItem, CAnnotationRef, oItem)
else if (L"w:br" == sName)
AssignPtrXmlContent(pItem, CBr, oItem)
else if (L"w:commentReference" == sName)
AssignPtrXmlContent(pItem, CCommentReference, oItem)
else if (L"w:contentPart" == sName)
AssignPtrXmlContent(pItem, CContentPart, oItem)
else if (L"w:continuationSeparator" == sName)
AssignPtrXmlContent(pItem, CContinuationSeparator, oItem)
else if (L"w:cr" == sName)
AssignPtrXmlContent(pItem, CCr, oItem)
else if (L"w:dayLong" == sName)
AssignPtrXmlContent(pItem, CDayLong, oItem)
else if (L"w:dayShort" == sName)
AssignPtrXmlContent(pItem, CDayShort, oItem)
else if (L"w:delInstrText" == sName)
AssignPtrXmlContent(pItem, CDelInstrText, oItem)
else if (L"w:delText" == sName)
AssignPtrXmlContent(pItem, CDelText, oItem)
else if (L"w:drawing" == sName)
AssignPtrXmlContent(pItem, CDrawing, oItem)
else if (L"w:endnoteRef" == sName)
AssignPtrXmlContent(pItem, CEndnoteRef, oItem)
else if (L"w:endnoteReference" == sName)
AssignPtrXmlContent(pItem, CEndnoteReference, oItem)
else if (L"w:fldChar" == sName)
AssignPtrXmlContent(pItem, CFldChar, oItem)
else if (L"w:footnoteRef" == sName)
AssignPtrXmlContent(pItem, CFootnoteRef, oItem)
else if (L"w:footnoteReference" == sName)
AssignPtrXmlContent(pItem, CFootnoteReference, oItem)
else if (L"w:instrText" == sName)
AssignPtrXmlContent(pItem, CInstrText, oItem)
else if (L"w:lastRenderedPageBreak" == sName)
AssignPtrXmlContent(pItem, CLastRenderedPageBreak, oItem)
else if (L"w:monthLong" == sName)
AssignPtrXmlContent(pItem, CMonthLong, oItem)
else if (L"w:monthShort" == sName)
AssignPtrXmlContent(pItem, CMonthShort, oItem)
else if (L"w:noBreakHyphen" == sName)
AssignPtrXmlContent(pItem, CNoBreakHyphen, oItem)
else if (L"w:object" == sName)
AssignPtrXmlContent(pItem, CObject, oItem)
else if (L"w:pgNum" == sName)
AssignPtrXmlContent(pItem, CPgNum, oItem)
else if (L"w:pict" == sName)
AssignPtrXmlContent(pItem, CPicture, oItem)
else if (L"w:ptab" == sName)
AssignPtrXmlContent(pItem, CPTab, oItem)
else if (L"w:ruby" == sName)
AssignPtrXmlContent(pItem, CRuby, oItem)
else if (L"w:separator" == sName)
AssignPtrXmlContent(pItem, CSeparator, oItem)
else if (L"w:softHyphen" == sName)
AssignPtrXmlContent(pItem, CSoftHyphen, oItem)
else if (L"w:sym" == sName)
AssignPtrXmlContent(pItem, CSym, oItem)
else if (L"m:t" == sName)
AssignPtrXmlContent(pItem, CMText, oItem)
else if (L"w:t" == sName)
AssignPtrXmlContent(pItem, CText, oItem)
else if (L"w:tab" == sName)
AssignPtrXmlContent(pItem, CTab, oItem)
else if (L"w:yearLong" == sName)
AssignPtrXmlContent(pItem, CYearLong, oItem)
else if (L"w:yearShort" == sName)
AssignPtrXmlContent(pItem, CYearShort, oItem)
else if ( L"w:del" == sName )
m_oDel = oItem;
else if ( _T("w:delInstrText") == sName )
m_oDelInstrText = oItem;
else if ( _T("w:delText") == sName )
m_oDelText = oItem;
else if ( _T("w:drawing") == sName )
m_oDrawing = oItem;
else if ( _T("w:endnoteRef") == sName )
m_oEndnoteRef = oItem;
else if ( _T("w:endnoteReference") == sName )
m_oEndnoteReference = oItem;
else if ( _T("w:fldChar") == sName )
m_oFldChar = oItem;
else if ( _T("w:footnoteRef") == sName )
m_oFootnoteRef = oItem;
else if ( _T("w:footnoteReference") == sName )
m_oFootnoteReference = oItem;
else if ( _T("w:ins") == sName )
else if ( L"w:ins" == sName )
m_oIns = oItem;
else if ( _T("w:instrText") == sName )
m_oInstrText = oItem;
else if ( _T("w:lastRenderedPageBreak") == sName )
m_oLastRenderedPageBreak = oItem;
else if ( _T("w:monthLong") == sName )
m_oMonthLong = oItem;
else if ( _T("w:monthShort") == sName )
m_oMonthShort = oItem;
else if ( _T("w:noBreakHyphen") == sName )
m_oNoBreakHyphen = oItem;
else if ( _T("w:object") == sName )
m_oObject = oItem;
else if ( _T("w:pgNum") == sName )
m_oPgNum = oItem;
else if ( _T("w:ptab") == sName )
m_oPtab = oItem;
else if ( _T("m:rPr") == sName )
else if ( L"m:rPr" == sName )
m_oMRPr = oItem ;
else if ( _T("w:rPr") == sName )
else if ( L"w:rPr" == sName )
m_oRPr = oItem;
else if ( _T("a:rPr") == sName )
else if ( L"a:rPr" == sName )
m_oARPr = oItem;
else if ( _T("w:ruby") == sName )
m_oRuby = oItem;
else if ( _T("w:separator") == sName )
m_oSeparator = oItem;
else if ( _T("w:softHyphen") == sName )
m_oSoftHyphen = oItem;
else if ( _T("w:sym") == sName )
m_oSym = oItem;
else if ( _T("m:t") == sName )
m_oMText = oItem ;
else if ( _T("w:t") == sName )
m_oText = oItem;
else if ( _T("w:tab") == sName )
m_oTab = oItem;
else if ( _T("w:yearLong") == sName )
m_oYearLong = oItem;
else if ( _T("w:yearShort") == sName )
m_oYearShort = oItem;
if (pItem)
m_arrItems.push_back(pItem);
}
}
}
@ -2395,63 +2412,83 @@ namespace OOX
while( oReader.ReadNextSiblingNode( nParentDepth ) )
{
std::wstring sName = oReader.GetName();
if ( _T("w:annotationRef") == sName )
m_oAnnotationRef = oReader;
else if ( _T("w:br") == sName )
m_oBr = oReader;
else if ( _T("w:commentReference") == sName )
m_oCommentReference = oReader;
else if ( _T("w:contentPart") == sName )
m_oContentPart = oReader;
else if ( _T("w:continuationSeparator") == sName )
m_oContinuationSeparator = oReader;
else if ( _T("w:cr") == sName )
m_oCr = oReader;
else if ( _T("w:dayLong") == sName )
m_oDayLong = oReader;
else if ( _T("w:dayShort") == sName )
m_oDayShort = oReader;
else if ( _T("w:del") == sName )
WritingElement* pItem = NULL;
if (L"w:annotationRef" == sName)
pItem = new CAnnotationRef();
else if (L"w:br" == sName)
pItem = new CBr();
else if (L"w:commentReference" == sName)
pItem = new CCommentReference();
else if (L"w:contentPart" == sName)
pItem = new CContentPart();
else if (L"w:continuationSeparator" == sName)
pItem = new CContinuationSeparator();
else if (L"w:cr" == sName)
pItem = new CCr();
else if (L"w:dayLong" == sName)
pItem = new CDayLong();
else if (L"w:dayShort" == sName)
pItem = new CDayShort();
else if (L"w:delInstrText" == sName)
pItem = new CDelInstrText();
else if (L"w:delText" == sName)
pItem = new CDelText();
else if (L"w:drawing" == sName)
pItem = new CDrawing();
else if (L"w:endnoteRef" == sName)
pItem = new CEndnoteRef();
else if (L"w:endnoteReference" == sName)
pItem = new CEndnoteReference();
else if (L"w:fldChar" == sName)
pItem = new CFldChar();
else if (L"w:footnoteRef" == sName)
pItem = new CFootnoteRef();
else if (L"w:footnoteReference" == sName)
pItem = new CFootnoteReference();
else if (L"w:instrText" == sName)
pItem = new CInstrText();
else if (L"w:lastRenderedPageBreak" == sName)
pItem = new CLastRenderedPageBreak();
else if (L"w:monthLong" == sName)
pItem = new CMonthLong();
else if (L"w:monthShort" == sName)
pItem = new CMonthShort();
else if (L"w:noBreakHyphen" == sName)
pItem = new CNoBreakHyphen();
else if (L"w:object" == sName)
pItem = new CObject();
else if (L"w:pgNum" == sName)
pItem = new CPgNum();
else if (L"w:pict" == sName)
pItem = new CPicture();
else if (L"w:ptab" == sName)
pItem = new CPTab();
else if (L"w:ruby" == sName)
pItem = new CRuby();
else if (L"w:separator" == sName)
pItem = new CSeparator();
else if (L"w:softHyphen" == sName)
pItem = new CSoftHyphen();
else if (L"w:sym" == sName)
pItem = new CSym();
else if (L"w:t" == sName)
pItem = new CText();
else if (L"w:tab" == sName)
pItem = new CTab();
else if (L"w:yearLong" == sName)
pItem = new CYearLong();
else if (L"m:t" == sName)
pItem = new CMText();
else if (L"w:del" == sName)
m_oDel = oReader;
else if ( _T("w:delInstrText") == sName )
m_oDelInstrText = oReader;
else if ( _T("w:delText") == sName )
m_oDelText = oReader;
else if ( _T("w:drawing") == sName )
m_oDrawing = oReader;
else if ( _T("w:endnoteRef") == sName )
m_oEndnoteRef = oReader;
else if ( _T("w:endnoteReference") == sName )
m_oEndnoteReference = oReader;
else if ( _T("w:fldChar") == sName )
m_oFldChar = oReader;
else if ( _T("w:footnoteRef") == sName )
m_oFootnoteRef = oReader;
else if ( _T("w:footnoteReference") == sName )
m_oFootnoteReference = oReader;
else if ( _T("w:ins") == sName )
else if (L"w:ins" == sName)
m_oIns = oReader;
else if ( _T("w:instrText") == sName )
m_oInstrText = oReader;
else if ( _T("w:lastRenderedPageBreak") == sName )
m_oLastRenderedPageBreak = oReader;
else if ( _T("w:monthLong") == sName )
m_oMonthLong = oReader;
else if ( _T("w:monthShort") == sName )
m_oMonthShort = oReader;
else if ( _T("w:noBreakHyphen") == sName )
m_oNoBreakHyphen = oReader;
else if ( _T("w:object") == sName )
m_oObject = oReader;
else if ( _T("w:pgNum") == sName )
m_oPgNum = oReader;
else if ( _T("w:ptab") == sName )
m_oPtab = oReader;
else if ( _T("m:rPr") == sName )
m_oMRPr = oReader ;
else if ( _T("w:rPr") == sName )
else if (L"m:rPr" == sName)
m_oMRPr = oReader;
else if (L"w:rPr" == sName)
m_oRPr = oReader;
else if ( _T("a:rPr") == sName )
else if (L"a:rPr" == sName)
{
std::wstring sXml = oReader.GetOuterXml();
XmlUtils::CXmlNode node;
@ -2459,24 +2496,11 @@ namespace OOX
m_oARPr = node;
}
else if ( _T("w:ruby") == sName )
m_oRuby = oReader;
else if ( _T("w:separator") == sName )
m_oSeparator = oReader;
else if ( _T("w:softHyphen") == sName )
m_oSoftHyphen = oReader;
else if ( _T("w:sym") == sName )
m_oSym = oReader;
else if ( _T("m:t") == sName )
m_oMText = oReader ;
else if ( _T("w:t") == sName )
m_oText = oReader;
else if ( _T("w:tab") == sName )
m_oTab = oReader;
else if ( _T("w:yearLong") == sName )
m_oYearLong = oReader;
else if ( _T("w:yearShort") == sName )
m_oYearShort = oReader;
if (pItem)
{
pItem->fromXML(oReader);
m_arrItems.push_back(pItem);
}
}
}
EElementType CMRun::getType() const
@ -4216,7 +4240,7 @@ namespace OOX
return sResult;
}
std::wstring CMc::toXML() const
std::wstring CMc::toXML() const
{
std::wstring sResult = L"<m:mc>";
@ -4228,7 +4252,7 @@ namespace OOX
return sResult;
}
std::wstring CNary::toXML() const
std::wstring CNary::toXML() const
{
std::wstring sResult = L"<m:nary>";
@ -4249,7 +4273,7 @@ namespace OOX
return sResult;
}
std::wstring CPhant::toXML() const
std::wstring CPhant::toXML() const
{
std::wstring sResult = L"<m:phant>";
@ -4264,7 +4288,7 @@ namespace OOX
return sResult;
}
std::wstring CMRun::toXML() const
std::wstring CMRun::toXML() const
{
std::wstring sResult = L"<m:r>";
@ -4274,81 +4298,15 @@ namespace OOX
return sResult;
}
std::wstring CMRun::toXMLInner() const
std::wstring CMRun::toXMLInner() const
{
std::wstring sResult;
if ( m_oAnnotationRef.IsInit() )
sResult += m_oAnnotationRef->toXML();
if (m_oIns.IsInit() )
sResult += m_oIns->toXML();
if ( m_oBr.IsInit() )
sResult += m_oBr->toXML();
if ( m_oCommentReference.IsInit() )
sResult += m_oCommentReference->toXML();
if ( m_oContentPart.IsInit() )
sResult += m_oContentPart->toXML();
if ( m_oContinuationSeparator.IsInit() )
sResult += m_oContinuationSeparator->toXML();
if ( m_oCr.IsInit() )
sResult += m_oCr->toXML();
if ( m_oDayLong.IsInit() )
sResult += m_oDayLong->toXML();
if ( m_oDayShort.IsInit() )
sResult += m_oDayShort->toXML();
if ( m_oDelInstrText.IsInit() )
sResult += m_oDelInstrText->toXML();
if ( m_oDelText.IsInit() )
sResult += m_oDelText->toXML();
if ( m_oDrawing.IsInit() )
sResult += m_oDrawing->toXML();
if ( m_oEndnoteRef.IsInit() )
sResult += m_oEndnoteRef->toXML();
if ( m_oEndnoteReference.IsInit() )
sResult += m_oEndnoteReference->toXML();
if ( m_oFldChar.IsInit() )
sResult += m_oFldChar->toXML();
if ( m_oFootnoteRef.IsInit() )
sResult += m_oFootnoteRef->toXML();
if ( m_oFootnoteReference.IsInit() )
sResult += m_oFootnoteReference->toXML();
if ( m_oInstrText.IsInit() )
sResult += m_oInstrText->toXML();
if ( m_oLastRenderedPageBreak.IsInit() )
sResult += m_oLastRenderedPageBreak->toXML();
if ( m_oMonthLong.IsInit() )
sResult += m_oMonthLong->toXML();
if ( m_oMonthShort.IsInit() )
sResult += m_oMonthShort->toXML();
if ( m_oNoBreakHyphen.IsInit() )
sResult += m_oNoBreakHyphen->toXML();
if ( m_oObject.IsInit() )
sResult += m_oObject->toXML();
if ( m_oPgNum.IsInit() )
sResult += m_oPgNum->toXML();
if ( m_oPtab.IsInit() )
sResult += m_oPtab->toXML();
if ( m_oDel.IsInit() )
sResult += m_oDel->toXML();
if ( m_oMRPr.IsInit() )
sResult += m_oMRPr->toXML();
@ -4359,33 +4317,13 @@ namespace OOX
if ( m_oRPr.IsInit() )
sResult += m_oRPr->toXML();
if ( m_oRuby.IsInit() )
sResult += m_oRuby->toXML();
if ( m_oSeparator.IsInit() )
sResult += m_oSeparator->toXML();
if ( m_oSoftHyphen.IsInit() )
sResult += m_oSoftHyphen->toXML();
if ( m_oSym.IsInit() )
sResult += m_oSym->toXML();
if ( m_oMText.IsInit() )
sResult += m_oMText->toXML();
if ( m_oText.IsInit() )
sResult += m_oText->toXML();
if ( m_oTab.IsInit() )
sResult += m_oTab->toXML();
if ( m_oYearLong.IsInit() )
sResult += m_oYearLong->toXML();
if ( m_oYearShort.IsInit() )
sResult += m_oYearShort->toXML();
for (size_t i = 0; i < m_arrItems.size(); ++i)
{
if (m_arrItems[i])
{
sResult += m_arrItems[i]->toXML();
}
}
return sResult;
}
}

View File

@ -937,13 +937,15 @@ namespace OOX
//--------------------------------------------------------------------------------
// CMRun 22.1.2.87 (Math Run)
//--------------------------------------------------------------------------------
class CMRun : public WritingElement
class CMRun : public WritingElementWithChilds<>
{
public:
WritingElement_AdditionMethods(CMRun)
CMRun(OOX::Document *pMain = NULL);
virtual ~CMRun();
virtual void ClearItems();
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
@ -952,45 +954,11 @@ namespace OOX
virtual EElementType getType() const;
// Childs
nullable<OOX::Logic::CAnnotationRef> m_oAnnotationRef;
nullable<OOX::Logic::CBr> m_oBr;
nullable<OOX::Logic::CCommentReference> m_oCommentReference;
nullable<OOX::Logic::CContentPart> m_oContentPart;
nullable<OOX::Logic::CContinuationSeparator> m_oContinuationSeparator;
nullable<OOX::Logic::CCr> m_oCr;
nullable<OOX::Logic::CDayLong> m_oDayLong;
nullable<OOX::Logic::CDayShort> m_oDayShort;
nullable<OOX::Logic::CMDel> m_oDel;
nullable<OOX::Logic::CDelInstrText> m_oDelInstrText;
nullable<OOX::Logic::CDelText> m_oDelText;
nullable<OOX::Logic::CDrawing> m_oDrawing;
nullable<OOX::Logic::CEndnoteRef> m_oEndnoteRef;
nullable<OOX::Logic::CEndnoteReference> m_oEndnoteReference;
nullable<OOX::Logic::CFldChar> m_oFldChar;
nullable<OOX::Logic::CFootnoteRef> m_oFootnoteRef;
nullable<OOX::Logic::CFootnoteReference> m_oFootnoteReference;
nullable<OOX::Logic::CMIns> m_oIns;
nullable<OOX::Logic::CInstrText> m_oInstrText;
nullable<OOX::Logic::CLastRenderedPageBreak> m_oLastRenderedPageBreak;
nullable<OOX::Logic::CMonthLong> m_oMonthLong;
nullable<OOX::Logic::CMonthShort> m_oMonthShort;
nullable<OOX::Logic::CNoBreakHyphen> m_oNoBreakHyphen;
nullable<OOX::Logic::CObject> m_oObject;
nullable<OOX::Logic::CPgNum> m_oPgNum;
nullable<OOX::Logic::CPTab> m_oPtab;
nullable<OOX::Logic::CRunProperty> m_oRPr;
nullable<OOX::Logic::CMRPr> m_oMRPr;
nullable<PPTX::Logic::RunProperties> m_oARPr;
nullable<OOX::Logic::CRuby> m_oRuby;
nullable<OOX::Logic::CSeparator> m_oSeparator;
nullable<OOX::Logic::CSoftHyphen> m_oSoftHyphen;
nullable<OOX::Logic::CSym> m_oSym;
nullable<OOX::Logic::CMText> m_oMText;
nullable<OOX::Logic::CText> m_oText;
nullable<OOX::Logic::CTab> m_oTab;
nullable<OOX::Logic::CYearLong> m_oYearLong;
nullable<OOX::Logic::CYearShort> m_oYearShort;
nullable<PPTX::Logic::RunProperties> m_oARPr;
nullable<OOX::Logic::CRunProperty> m_oRPr;
nullable<OOX::Logic::CMRPr> m_oMRPr;
nullable<OOX::Logic::CMDel> m_oDel;
nullable<OOX::Logic::CMIns>m_oIns;
};
class CMDel : public WritingElement

View File

@ -542,17 +542,34 @@ namespace StarMath
}
std::vector<COneElement*> COOXml2Odf::ConversionMRun(OOX::Logic::CMRun *pMRun)
{
StValuePr* stRpr(nullptr);
std::vector<COneElement*> arLine;
if(pMRun == nullptr) return arLine;
StValuePr* stRpr(nullptr);
if(pMRun->m_oRPr.GetPointer() != nullptr)
stRpr = ConversionRunProperties(pMRun->m_oRPr.GetPointer());
else if (pMRun->m_oARPr.GetPointer() != nullptr)
ConversionARpr(pMRun->m_oARPr.GetPointer(),stRpr);
if(pMRun->m_oMRPr.GetPointer() != nullptr)
ConversionMRunProperties(pMRun->m_oMRPr.GetPointer(),stRpr);
if(pMRun->m_oMText.GetPointer() != nullptr)
arLine = ConversionMT(pMRun->m_oMText.GetPointer(),stRpr,pMRun->m_oMRPr.GetPointer());
for (size_t i = 0; i < pMRun->m_arrItems.size(); ++i)
{
switch (pMRun->m_arrItems[i]->getType())
{
case OOX::et_m_t:
{
std::vector<COneElement*> arLine_run;
arLine_run = ConversionMT(dynamic_cast<OOX::Logic::CMText*>(pMRun->m_arrItems[i]), stRpr, pMRun->m_oMRPr.GetPointer());
arLine.insert(arLine.end(), arLine_run.begin(), arLine_run.end());
arLine_run.clear();
}break;
default:
break;
}
}
CreateAttribute(stRpr);
if(stRpr != nullptr && !arLine.empty())
{
@ -564,8 +581,8 @@ namespace StarMath
{
if(i != 0 )
{
arLine[i]->SetAttribute(stRpr);
stRpr->AddRef();
arLine[i]->SetAttribute(stRpr);
stRpr->AddRef();
}
else if(i == 0 )
arLine[i]->SetAttribute(stRpr);

View File

@ -637,7 +637,7 @@ void odf_document::Impl::parse_settings(office_element *element)
for (auto info_elm = conf_item_set->content_.begin(); info_elm != conf_item_set->content_.end(); ++info_elm)
{
settings_config_item* info = dynamic_cast<settings_config_item*>(info_elm->get());
if (info)
if (info && !info->content_.empty())
{
context_->Settings().add(L"modify:" + info->config_name_, info->content_);
}

View File

@ -1252,46 +1252,72 @@ namespace Oox2Odf
{
if (!oox_mrun) return;
convert(oox_mrun->m_oAnnotationRef.GetPointer());
convert(oox_mrun->m_oARPr.GetPointer());
convert(oox_mrun->m_oBr.GetPointer());
convert(oox_mrun->m_oCommentReference.GetPointer());
convert(oox_mrun->m_oContentPart.GetPointer());
convert(oox_mrun->m_oContinuationSeparator.GetPointer());
convert(oox_mrun->m_oCr.GetPointer());
convert(oox_mrun->m_oDayLong.GetPointer());
convert(oox_mrun->m_oDayShort.GetPointer());
convert(oox_mrun->m_oDel.GetPointer());
convert(oox_mrun->m_oDelInstrText.GetPointer());
convert(oox_mrun->m_oDelText.GetPointer());
convert(oox_mrun->m_oDrawing.GetPointer());
convert(oox_mrun->m_oEndnoteRef.GetPointer());
convert(oox_mrun->m_oEndnoteReference.GetPointer());
convert(oox_mrun->m_oEndnoteReference.GetPointer());
convert(oox_mrun->m_oFldChar.GetPointer());
convert(oox_mrun->m_oFootnoteRef.GetPointer());
convert(oox_mrun->m_oFootnoteReference.GetPointer());
convert(oox_mrun->m_oIns.GetPointer());
convert(oox_mrun->m_oInstrText.GetPointer());
convert(oox_mrun->m_oLastRenderedPageBreak.GetPointer());
convert(oox_mrun->m_oMonthLong.GetPointer());
convert(oox_mrun->m_oMonthShort.GetPointer());
//convert(oox_mrun->m_oMRPr.GetPointer());
convert(oox_mrun->m_oARPr.GetPointer());
bool clrFlag = convert(oox_mrun->m_oRPr.GetPointer());
convert(oox_mrun->m_oMText.GetPointer());
convert(oox_mrun->m_oNoBreakHyphen.GetPointer());
convert(oox_mrun->m_oObject.GetPointer());
convert(oox_mrun->m_oPgNum.GetPointer());
convert(oox_mrun->m_oPtab.GetPointer());
convert(oox_mrun->m_oRuby.GetPointer());
convert(oox_mrun->m_oSeparator.GetPointer());
convert(oox_mrun->m_oSoftHyphen.GetPointer());
convert(oox_mrun->m_oSym.GetPointer());
convert(oox_mrun->m_oTab.GetPointer());
convert(oox_mrun->m_oText.GetPointer());
convert(oox_mrun->m_oYearLong.GetPointer());
convert(oox_mrun->m_oYearShort.GetPointer());
//convert(oox_mrun->m_oMRPr.GetPointer());
for (size_t i = 0; i < oox_mrun->m_arrItems.size(); ++i)
{
switch (oox_mrun->m_arrItems[i]->getType())
{
case OOX::et_w_fldChar:
{
OOX::Logic::CFldChar* pFldChar = dynamic_cast<OOX::Logic::CFldChar*>(oox_mrun->m_arrItems[i]);
convert(pFldChar);
}break;
case OOX::et_w_instrText:
{
OOX::Logic::CInstrText* pInstrText = dynamic_cast<OOX::Logic::CInstrText*>(oox_mrun->m_arrItems[i]);
convert(pInstrText);
}break;
case OOX::et_w_delText:
{
OOX::Logic::CDelText* pDelText = dynamic_cast<OOX::Logic::CDelText*>(oox_mrun->m_arrItems[i]);
convert(pDelText);
}break;
case OOX::et_w_lastRenderedPageBreak: // не информативное .. может быть неверно записано
{
}break;
case OOX::et_w_t:
{
OOX::Logic::CText* pText = dynamic_cast<OOX::Logic::CText*>(oox_mrun->m_arrItems[i]);
convert(pText);
}break;
case OOX::et_m_t:
{
OOX::Logic::CMText* pMText = dynamic_cast<OOX::Logic::CMText*>(oox_mrun->m_arrItems[i]);
convert(pMText);
}break;
case OOX::et_w_sym:
{
OOX::Logic::CSym* pSym = dynamic_cast<OOX::Logic::CSym*>(oox_mrun->m_arrItems[i]);
convert(pSym);
}break;
case OOX::et_w_tab:
{
OOX::Logic::CTab* pTab = dynamic_cast<OOX::Logic::CTab*>(oox_mrun->m_arrItems[i]);
}break;
case OOX::et_w_separator:
case OOX::et_w_continuationSeparator:
{
}break;
//contentPart
//cr
//dayLong, dayShort, monthLong, monthShort, yearLong, yearShort
//noBreakHyphen
//pgNum
//ruby
//softHyphen
//delInstrText
default:
convert(oox_mrun->m_arrItems[i]);
}
}
if (clrFlag)
{
CLOSE_MATH_TAG;

View File

@ -5355,8 +5355,8 @@ bool RtfListTableReader::ListReader::ListLevelReader::ExecuteCommand(RtfDocument
}
else if( "leveltext" == sCommand )
{
TextReader oLevelTextReader( m_oListLevelProp.m_sText );
oLevelTextReader.m_bUseGlobalCodepage = true;
TextReader oLevelTextReader( m_oListLevelProp.m_sLevelText);
oLevelTextReader.m_bUseGlobalCodepage = true; // font Symbol
return StartSubReader( oLevelTextReader, oDocument, oReader );
}
else if( "levelnumbers" == sCommand )

View File

@ -1886,7 +1886,7 @@ bool RtfListLevelProperty::IsValid()
{
//return -1 != m_nFollow && -1 != m_nStart && -1 != m_nNumberType && -1 != m_nJustification &&
// false == m_sText.empty() && false == m_sNumber.empty();
return PROP_DEF != m_nNumberType && false == m_sText.empty();
return PROP_DEF != m_nNumberType && false == m_sLevelText.empty();
}
std::wstring RtfListLevelProperty::GenerateListText()
{//заменяем на булеты
@ -1918,7 +1918,7 @@ void RtfListLevelProperty::SetDefault()
DEFAULT_PROPERTY ( m_nJustification )
DEFAULT_PROPERTY ( m_nFollow )
DEFAULT_PROPERTY ( m_nStart )
DEFAULT_PROPERTY_DEF( m_sText, L"" )
DEFAULT_PROPERTY_DEF(m_sLevelText, L"" )
DEFAULT_PROPERTY_DEF( m_sNumber, L"" )
DEFAULT_PROPERTY ( m_nNoRestart )
DEFAULT_PROPERTY ( m_nLegal )
@ -1940,8 +1940,8 @@ void RtfListLevelProperty::Merge(RtfListLevelProperty& oListLevel)
MERGE_PROPERTY( m_nFollow, oListLevel)
MERGE_PROPERTY( m_nStart, oListLevel)
if (!oListLevel.m_sText.empty())
m_sText = oListLevel.m_sText;
if (!oListLevel.m_sLevelText.empty())
m_sLevelText = oListLevel.m_sLevelText;
if (!oListLevel.m_sNumber.empty())
m_sNumber = oListLevel.m_sNumber;
@ -2119,7 +2119,7 @@ std::wstring RtfListLevelProperty::RenderToRtf(RenderParameter oRenderParameter)
//чтобы при последующем чтении из rtf не потерялась информация о шрифте
sResult += m_oCharProp.RenderToRtf( oRenderParameter );
sResult += L"{\\leveltext" + m_sText + L";}";
sResult += L"{\\leveltext" + m_sLevelText + L";}";
sResult += L"{\\levelnumbers" + m_sNumber + L";}";
RENDER_RTF_INT( m_nFirstIndent, sResult, L"fi" )
@ -2138,7 +2138,7 @@ std::wstring RtfListLevelProperty::RenderToRtf(RenderParameter oRenderParameter)
}
std::wstring RtfListLevelProperty::GetLevelTextOOX()
{
std::wstring sResult = m_sText;
std::wstring sResult = m_sLevelText;
if ( sResult.length() > 0 )
{
size_t nLevelTextLength = sResult[0];
@ -2174,8 +2174,8 @@ std::wstring RtfListLevelProperty::GetLevelTextOOX()
void RtfListLevelProperty::SetLevelTextOOX(const std::wstring& sText)
{
m_sText = L"";
m_sNumber = L"";
m_sLevelText.clear();
m_sNumber.clear();
int nLevelOffsets = 0;
int nText = 0;
@ -2186,7 +2186,7 @@ void RtfListLevelProperty::SetLevelTextOOX(const std::wstring& sText)
{
int nLevel = RtfUtility::ToByte( sText[ i + 1 ] );
m_sText += L"\\'" + XmlUtils::ToString(nLevel - 1, L"%02x");
m_sLevelText += L"\\'" + XmlUtils::ToString(nLevel - 1, L"%02x");
m_sNumber += L"\\'" + XmlUtils::ToString(nLevelOffsets + 1, L"%02x");
i++; //т.к. следующий симовл уже учли
@ -2195,12 +2195,12 @@ void RtfListLevelProperty::SetLevelTextOOX(const std::wstring& sText)
else
{
std::wstring s (sText.c_str() + i, 1);
m_sText += RtfChar::renderRtfText(s);
m_sLevelText += RtfChar::renderRtfText(s);
nText++;
}
nLevelOffsets++;
}
m_sText = L"\\'" + XmlUtils::ToString(nText, L"%02x") + m_sText;
m_sLevelText = L"\\'" + XmlUtils::ToString(nText, L"%02x") + m_sLevelText;
}
std::wstring RtfListLevelProperty::RenderToOOX(RenderParameter oRenderParameter)
{

View File

@ -503,7 +503,7 @@ public:
_INT32 m_nJustification; //leveljcN \leveljcnN 0 Left justified 1 Center justified 2 Right justified
_INT32 m_nFollow; //levelfollowN
_INT32 m_nStart; //levelstartatN N specifies the start-at value for the level.
std::wstring m_sText; //как в rtf текст, но сдвинут от нуля на 1 // \'03\'00.\'01 -> ("%d%d%d",4,1,2)
std::wstring m_sLevelText; //как в rtf текст, но сдвинут от нуля на 1 // \'03\'00.\'01 -> ("%d%d%d",4,1,2)
std::wstring m_sNumber;
_INT32 m_nNoRestart; //levelnorestartN 1 if this level does not restart its count each time a super ordinate level is incremented; 0 if this level does restart its count each time a super ordinate level is incremented.
_INT32 m_nLegal; //levellegalN 1 if any list numbers from previous levels should be converted to Arabic numbers; 0 if they should be left with the format specified by their own levels definition.

View File

@ -258,7 +258,13 @@ std::wstring RtfAbstractReader::ExecuteTextInternal(RtfDocument& oDocument, RtfR
if ("u" == sKey)
{
if (true == bHasPar)
{
if (m_bUseGlobalCodepage && sizeof(wchar_t) != 2)
{
nPar = nPar & 0x0FFF;
}
sResult += wchar_t(nPar);
}
}
else
{

View File

@ -105,23 +105,31 @@ bool OOXMathReader::ParseElement(ReaderParameter oParam , OOX::WritingElement *
OOXrPrReader orPrReader(ooxRPr);
orPrReader.Parse( oParam, m_oCharProperty);
//-----------------------------------------------------------------------------------
OOX::Logic::CMText *ooxTextMath = dynamic_cast<OOX::Logic::CMText *>(ooxRunMath->m_oMText.GetPointer());
if (ooxTextMath)
bool result = false;
for (size_t i = 0; i < ooxRunMath->m_arrItems.size(); ++i)
{
RtfCharPtr oChar(new RtfChar);
oChar->m_oProperty = m_oCharProperty;
oChar->setText( ooxTextMath->m_sText );
rtfMath->m_oVal.AddItem( oChar );
}
else
{
bool res = false;
if (!res) res = ParseElement(oParam, ooxRunMath->m_oIns.GetPointer(), rtfMath);
if (!res) res = ParseElement(oParam, ooxRunMath->m_oDel.GetPointer(), rtfMath);
switch (ooxRunMath->m_arrItems[i]->getType())
{
case OOX::et_m_t:
{
OOX::Logic::CMText* ooxTextMath = dynamic_cast<OOX::Logic::CMText*>(ooxRunMath->m_arrItems[i]);
if (ooxTextMath)
{
RtfCharPtr oChar(new RtfChar);
oChar->m_oProperty = m_oCharProperty;
oChar->setText(ooxTextMath->m_sText);
rtfMath->m_oVal.AddItem(oChar);
result = true;
}
}break;
default:
break;
}
}
if (!result) result = ParseElement(oParam, ooxRunMath->m_oIns.GetPointer(), rtfMath);
if (!result) result = ParseElement(oParam, ooxRunMath->m_oDel.GetPointer(), rtfMath);
m_oCharProperty = oCurrentProp;
}break;
case OOX::et_m_t: