Commit 21f7f6ed authored by ElenaSubbotina's avatar ElenaSubbotina

fix bug #36335

parent 80863ae2
...@@ -608,7 +608,7 @@ namespace NSPresentationEditor ...@@ -608,7 +608,7 @@ namespace NSPresentationEditor
{ {
if (bIsNamespace) if (bIsNamespace)
{ {
return _T("<a:prstGeom xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" prst=\"line\"><a:avLst/></a:prstGeom>"); return _T("<a:prstGeom xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" prst=\"ellipse\"><a:avLst/></a:prstGeom>");
} }
return _T("<a:prstGeom prst=\"ellipse\"><a:avLst/></a:prstGeom>"); return _T("<a:prstGeom prst=\"ellipse\"><a:avLst/></a:prstGeom>");
} }
......
...@@ -60,9 +60,6 @@ namespace OOX ...@@ -60,9 +60,6 @@ namespace OOX
virtual ~CMathArgNodes() virtual ~CMathArgNodes()
{ {
} }
public:
const CMathArgNodes &operator =(const XmlUtils::CXmlNode& oNode) const CMathArgNodes &operator =(const XmlUtils::CXmlNode& oNode)
{ {
ClearItems(); ClearItems();
...@@ -75,12 +72,9 @@ namespace OOX ...@@ -75,12 +72,9 @@ namespace OOX
fromXML( (XmlUtils::CXmlLiteReader&)oReader ); fromXML( (XmlUtils::CXmlLiteReader&)oReader );
return *this; return *this;
} }
virtual void fromXML(XmlUtils::CXmlNode& oNode);
public: 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
{ {
......
...@@ -39,29 +39,166 @@ namespace OOX ...@@ -39,29 +39,166 @@ namespace OOX
{ {
namespace Logic namespace Logic
{ {
void CMathArgNodes::fromXML(XmlUtils::CXmlLiteReader& oReader) void CMathArgNodes::fromXML(XmlUtils::CXmlNode& oNode)
{
sNodeName = oNode.GetName();
if(sNodeName == _T("m:deg"))
eType = et_m_deg;
else if (sNodeName == _T("m:den"))
eType = et_m_den;
else if (sNodeName == _T("m:e"))
eType = et_m_e;
else if (sNodeName == _T("m:fName"))
eType = et_m_fName;
else if (sNodeName == _T("m:lim"))
eType = et_m_lim;
else if (sNodeName == _T("m:num"))
eType = et_m_num;
else if (sNodeName == _T("m:oMath"))
eType = et_m_oMath;
else if (sNodeName == _T("m:sub"))
eType = et_m_sub;
else if (sNodeName == _T("m:sup"))
eType = et_m_sup;
else
eType = et_Unknown;
XmlUtils::CXmlNodes oChilds;
if ( oNode.GetNodes( _T("*"), oChilds ) )
{
XmlUtils::CXmlNode oItem;
for ( int nIndex = 0; nIndex < oChilds.GetCount(); nIndex++ )
{
if ( oChilds.GetAt( nIndex, oItem ) )
{
std::wstring sName = oItem.GetName();
WritingElement *pItem = NULL;
if ( _T("m:acc") == sName )
pItem = new OOX::Logic::CAcc( oItem );
else if ( _T("m:argPr") == sName )
pItem = new OOX::Logic::CArgPr( oItem );
else if ( _T("m:bar") == sName )
pItem = new OOX::Logic::CBar( oItem );
else if ( _T("w:bookmarkEnd") == sName )
pItem = new OOX::Logic::CBookmarkEnd( oItem );
else if ( _T("w:bookmarkStart") == sName )
pItem = new OOX::Logic::CBookmarkStart( oItem );
else if ( _T("m:borderBox") == sName )
pItem = new OOX::Logic::CBorderBox( oItem );
else if ( _T("m:box") == sName )
pItem = new OOX::Logic::CBox( oItem );
else if ( _T("w:commentRangeEnd") == sName )
pItem = new OOX::Logic::CCommentRangeEnd( oItem );
else if ( _T("w:commentRangeStart") == sName )
pItem = new OOX::Logic::CCommentRangeStart( oItem );
else if ( _T("m:ctrlPr") == sName )
pItem = new OOX::Logic::CCtrlPr( oItem );
else if ( _T("w:customXmlDelRangeEnd") == sName )
pItem = new OOX::Logic::CCustomXmlDelRangeEnd( oItem );
else if ( _T("w:customXmlDelRangeStart") == sName )
pItem = new OOX::Logic::CCustomXmlDelRangeStart( oItem );
else if ( _T("w:customXmlInsRangeEnd") == sName )
pItem = new OOX::Logic::CCustomXmlInsRangeEnd( oItem );
else if ( _T("w:customXmlInsRangeStart") == sName )
pItem = new OOX::Logic::CCustomXmlInsRangeStart( oItem );
else if ( _T("w:customXmlMoveFromRangeEnd") == sName )
pItem = new OOX::Logic::CCustomXmlMoveFromRangeEnd( oItem );
else if ( _T("w:customXmlMoveFromRangeStart") == sName )
pItem = new OOX::Logic::CCustomXmlMoveFromRangeStart( oItem );
else if ( _T("w:customXmlMoveToRangeEnd") == sName )
pItem = new OOX::Logic::CCustomXmlMoveToRangeEnd( oItem );
else if ( _T("w:customXmlMoveToRangeStart") == sName )
pItem = new OOX::Logic::CCustomXmlMoveToRangeStart( oItem );
else if ( _T("m:d") == sName )
pItem = new OOX::Logic::CDelimiter( oItem );
else if ( _T("w:del") == sName )
pItem = new CDel( oItem );
else if ( _T("m:eqArr") == sName )
pItem = new OOX::Logic::CEqArr( oItem );
else if ( _T("m:f") == sName )
pItem = new OOX::Logic::CFraction( oItem );
else if ( _T("m:func") == sName )
pItem = new OOX::Logic::CFunc( oItem );
else if ( _T("m:groupChr") == sName )
pItem = new CGroupChr( oItem );
else if ( _T("w:ins") == sName )
pItem = new CIns( oItem );
else if ( _T("m:limLow") == sName )
pItem = new OOX::Logic::CLimLow( oItem );
else if ( _T("m:limUpp") == sName )
pItem = new OOX::Logic::CLimUpp( oItem );
else if ( _T("m:m") == sName )
pItem = new OOX::Logic::CMatrix( oItem );
else if ( _T("w:moveFrom") == sName )
pItem = new OOX::Logic::CMoveFrom( oItem );
else if ( _T("w:moveFromRangeEnd") == sName )
pItem = new OOX::Logic::CMoveFromRangeEnd( oItem );
else if ( _T("w:moveFromRangeStart") == sName )
pItem = new OOX::Logic::CMoveFromRangeStart( oItem );
else if ( _T("w:moveTo") == sName )
pItem = new CMoveTo( oItem );
else if ( _T("w:moveToRangeEnd") == sName )
pItem = new OOX::Logic::CMoveToRangeEnd( oItem );
else if ( _T("w:moveToRangeStart") == sName )
pItem = new OOX::Logic::CMoveToRangeStart( oItem );
else if ( _T("m:nary") == sName )
pItem = new OOX::Logic::CNary( oItem );
else if ( _T("m:oMath") == sName )
pItem = new OOX::Logic::COMath( oItem );
else if ( _T("m:oMathPara") == sName )
pItem = new OOX::Logic::COMathPara( oItem );
else if ( _T("w:permEnd") == sName )
pItem = new OOX::Logic::CPermEnd( oItem );
else if ( _T("w:permStart") == sName )
pItem = new OOX::Logic::CPermStart( oItem );
else if ( _T("m:phant") == sName )
pItem = new OOX::Logic::CPhant( oItem );
else if ( _T("w:proofErr") == sName )
pItem = new OOX::Logic::CProofErr( oItem );
else if ( _T("m:r") == sName )
pItem = new OOX::Logic::CMRun( oItem );
else if ( _T("m:rad") == sName )
pItem = new OOX::Logic::CRad( oItem );
else if ( _T("m:sPre") == sName )
pItem = new OOX::Logic::CSPre( oItem );
else if ( _T("m:sSub") == sName )
pItem = new OOX::Logic::CSSub( oItem );
else if ( _T("m:sSubSup") == sName )
pItem = new OOX::Logic::CSSubSup( oItem );
else if ( _T("m:sSup") == sName )
pItem = new OOX::Logic::CSSup( oItem );
if ( pItem )
m_arrItems.push_back( pItem );
}
}
}
}
void CMathArgNodes::fromXML(XmlUtils::CXmlLiteReader& oReader)
{ {
sNodeName = std::wstring(oReader.GetName().c_str()); sNodeName = std::wstring(oReader.GetName().c_str());
if(sNodeName == _T("m:deg")) if(sNodeName == _T("m:deg"))
eType = et_m_deg; eType = et_m_deg;
else if (sNodeName == _T("m:den")) else if (sNodeName == _T("m:den"))
eType = et_m_den; eType = et_m_den;
else if (sNodeName == _T("m:e")) else if (sNodeName == _T("m:e"))
eType = et_m_e; eType = et_m_e;
else if (sNodeName == _T("m:fName")) else if (sNodeName == _T("m:fName"))
eType = et_m_fName; eType = et_m_fName;
else if (sNodeName == _T("m:lim")) else if (sNodeName == _T("m:lim"))
eType = et_m_lim; eType = et_m_lim;
else if (sNodeName == _T("m:num")) else if (sNodeName == _T("m:num"))
eType = et_m_num; eType = et_m_num;
else if (sNodeName == _T("m:oMath")) else if (sNodeName == _T("m:oMath"))
eType = et_m_oMath; eType = et_m_oMath;
else if (sNodeName == _T("m:sub")) else if (sNodeName == _T("m:sub"))
eType = et_m_sub; eType = et_m_sub;
else if (sNodeName == _T("m:sup")) else if (sNodeName == _T("m:sup"))
eType = et_m_sup; eType = et_m_sup;
else else
eType = et_Unknown; eType = et_Unknown;
if ( oReader.IsEmptyNode()) if ( oReader.IsEmptyNode())
return; return;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -52,12 +52,33 @@ namespace OOX ...@@ -52,12 +52,33 @@ namespace OOX
virtual ~COMathPara() virtual ~COMathPara()
{ {
} }
virtual void fromXML(XmlUtils::CXmlNode& oNode)
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{ {
XmlUtils::CXmlNodes oChilds;
if ( oNode.GetNodes( _T("*"), oChilds ) )
{
XmlUtils::CXmlNode oItem;
for ( int nIndex = 0; nIndex < oChilds.GetCount(); nIndex++ )
{
if ( oChilds.GetAt( nIndex, oItem ) )
{
std::wstring sName = oItem.GetName();
WritingElement *pItem = NULL;
if ( _T("w:r") == sName )
pItem = new CRun( oItem );
else if ( _T("m:oMath") == sName )
pItem = new COMath( oItem );
else if ( _T("m:oMathParaPr") == sName )
pItem = new COMathParaPr( oItem );
if ( pItem )
m_arrItems.push_back( pItem );
}
}
}
} }
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader) virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{ {
if ( oReader.IsEmptyNode() ) if ( oReader.IsEmptyNode() )
return; return;
......
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