void SpPr::fromXML(XmlUtils::CXmlNode& node)
		{
			m_namespace = XmlUtils::GetNamespace(node.GetName());

			Geometry.GetGeometryFrom(node);
			Fill.GetFillFrom(node);
			EffectList.GetEffectListFrom(node);

			node.ReadAttributeBase(L"bwMode", bwMode);

			XmlUtils::CXmlNodes oNodes;
			if (node.GetNodes(_T("*"), oNodes))
			{
				int nCount = oNodes.GetCount();
				for (int i = 0; i < nCount; ++i)
				{
					XmlUtils::CXmlNode oNode;
					oNodes.GetAt(i, oNode);

					CString strName = XmlUtils::GetNameNoNS(oNode.GetName());

					if (_T("xfrm") == strName)
						xfrm = oNode;
					else if (_T("ln") == strName)
						ln = oNode;
					else if (_T("scene3d") == strName)
						scene3d = oNode;
					else if (_T("sp3d") == strName)
						sp3d = oNode;
				}
			}

			FillParentPointersForChilds();
		}
Exemple #2
0
		void CxnSp::fromXML(XmlUtils::CXmlNode& node)
		{
			m_namespace = XmlUtils::GetNamespace(node.GetName());

			XmlUtils::CXmlNodes oNodes;
			if (node.GetNodes(_T("*"), oNodes))
			{
				int nCount = oNodes.GetCount();
				for (int i = 0; i < nCount; ++i)
				{
					XmlUtils::CXmlNode oNode;
					oNodes.GetAt(i, oNode);

					std::wstring strName = XmlUtils::GetNameNoNS(oNode.GetName());

					if (_T("nvCxnSpPr") == strName)
						nvCxnSpPr = oNode;
					else if (_T("spPr") == strName)
						spPr = oNode;
					else if (_T("style") == strName)
						style = oNode;
				}
			}

			FillParentPointersForChilds();
		}
		void NvGrpSpPr::fromXML(XmlUtils::CXmlNode& node)
		{
			cNvPr		= node.ReadNode(_T("p:cNvPr"));
			cNvGrpSpPr	= node.ReadNode(_T("p:cNvGrpSpPr"));
			nvPr		= node.ReadNode(_T("p:nvPr"));

			FillParentPointersForChilds();
		}
		void EffectStyle::fromXML(XmlUtils::CXmlNode& node)
		{
			EffectList.GetEffectListFrom(node);
			scene3d = node.ReadNode(_T("a:scene3d"));
			sp3d	= node.ReadNode(_T("a:sp3d"));

			FillParentPointersForChilds();
		}
Exemple #5
0
int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    XmlUtils::CXmlNode oNode;
    oNode.FromXmlFile(L"D:\\document.xml");

    return a.exec();
}
Exemple #6
0
bool CPPTShape::LoadFromXML(const std::wstring& xml)
{
    XmlUtils::CXmlNode oNodePict;
    if (oNodePict.FromXmlString(xml))
    {
        return LoadFromXML(oNodePict);
    }
    return false;
}
Exemple #7
0
		void CTblGridChange::fromXML(XmlUtils::CXmlNode& oNode)
		{
			oNode.ReadAttributeBase( _T("w:id"),     m_oId );

			XmlUtils::CXmlNode oNode_tblGrid;

			if ( m_pTblGrid && oNode.GetNode( _T("w:tblGrid"), oNode_tblGrid ) )
				m_pTblGrid->fromXML( oNode_tblGrid );

		}
Exemple #8
0
		void CTblPrExChange::fromXML(XmlUtils::CXmlNode& oNode)
		{
			oNode.ReadAttributeBase( _T("w:author"), m_sAuthor );
			oNode.ReadAttributeBase( _T("w:date"),   m_oDate );
			oNode.ReadAttributeBase( _T("w:id"),     m_oId );
			oNode.ReadAttributeBase( _T("oouserid"), m_sUserId );

			XmlUtils::CXmlNode oNode_tblPrEx;

			if ( m_pTblPrEx.IsInit() && oNode.GetNode( _T("w:tblPrEx"), oNode_tblPrEx ) )
				m_pTblPrEx->fromXML( oNode_tblPrEx );

		}
		void Blip::fromXML(XmlUtils::CXmlNode& node)
		{
			m_namespace = XmlUtils::GetNamespace(node.GetName());

			node.ReadAttributeBase(L"r:embed", embed);
			node.ReadAttributeBase(L"r:link", link);
			node.ReadAttributeBase(L"cstate", cstate);

			Effects.RemoveAll();
			node.LoadArray(_T("*"), Effects);

			FillParentPointersForChilds();
		}
		void CRPrChange::fromXML(XmlUtils::CXmlNode& oNode)
		{
			if ( _T("w:rPrChange") != oNode.GetName() )
				return;

			oNode.ReadAttributeBase( _T("w:author"), m_sAuthor );
			oNode.ReadAttributeBase( _T("w:date"),   m_oDate );
			oNode.ReadAttributeBase( _T("w:id"),     m_oID );

			XmlUtils::CXmlNode oNode_rPr;

			if ( m_pRunPr.IsInit() && oNode.GetNode( _T("w:rPr"), oNode_rPr ) )
				m_pRunPr->fromXML( oNode_rPr );

		}
		void GraphicFrame::fromXMLOle(XmlUtils::CXmlNode& node)
		{
			oleObject.Init();
			node.ReadAttributeBase(L"progId", oleObject->m_sProgId);
			node.ReadAttributeBase(L"r:id", oleObject->m_oId);
			int imgW = node.GetAttributeInt(CString(L"imgW"), 0);
			if(imgW > 0)
			{
				oleObject->m_oDxaOrig = Emu_To_Twips(imgW);
			}
			int imgH = node.GetAttributeInt(CString(L"imgH"), 0);
			if(imgH > 0)
			{
				oleObject->m_oDyaOrig = Emu_To_Twips(imgH);
			}
		}
Exemple #12
0
		void CNvGrpSpPr::fromXML(XmlUtils::CXmlNode& node)
		{
			XmlUtils::CXmlNode oNode;
			if (node.GetNode(_T("a:grpSpLocks"), oNode))
			{
				oNode.ReadAttributeBase(L"noChangeAspect", noChangeAspect);
				oNode.ReadAttributeBase(L"noGrp", noGrp);
				oNode.ReadAttributeBase(L"noMove", noMove);
				oNode.ReadAttributeBase(L"noResize", noResize);
				oNode.ReadAttributeBase(L"noRot", noRot);
				oNode.ReadAttributeBase(L"noSelect", noSelect);
				oNode.ReadAttributeBase(L"noUngrp", noUngrp);
			}
		}
		void EffectLst::fromXML(XmlUtils::CXmlNode& node)
		{
			blur		= node.ReadNode(_T("a:blur"));
			fillOverlay = node.ReadNode(_T("a:fillOverlay"));
			glow		= node.ReadNode(_T("a:glow"));
			innerShdw	= node.ReadNode(_T("a:innerShdw"));
			outerShdw	= node.ReadNode(_T("a:outerShdw"));
			prstShdw	= node.ReadNode(_T("a:prstShdw"));
			reflection	= node.ReadNode(_T("a:reflection"));
			softEdge	= node.ReadNode(_T("a:softEdge"));

			FillParentPointersForChilds();
		}
	void FontTable::read(const OOX::CPath& oPath)
	{
		m_fonts.clear();

		XmlUtils::CXmlNode oFonts;
		oFonts.FromXmlFile( oPath.GetPath(), true );

		if ( _T("w:fonts") == oFonts.GetName() )
		{
			XmlUtils::CXmlNodes oFontList;
			oFonts.GetNodes( _T("w:font"), oFontList );

			for ( int nFontIndex = 0; nFontIndex < oFontList.GetCount(); ++nFontIndex )
			{
				XmlUtils::CXmlNode oFontNode;
				if ( oFontList.GetAt( nFontIndex, oFontNode ) )
				{
					Font oFont;
					oFont.fromXML( oFontNode );
					m_fonts.push_back( oFont );
				}
			}
		}
	}
	void Numbering::Level::fromXML(XmlUtils::CXmlNode& oNode)
	{
		if ( _T("w:lvl") == oNode.GetName() )
		{
			Ilvl = _wtoi(static_cast<const wchar_t*>(oNode.GetAttributeBase( _T("w:ilvl"))));
			Tentative = _wtoi(static_cast<const wchar_t*>(oNode.GetAttributeBase( _T("w:tentative"))));
			Tplc = std::wstring(static_cast<const wchar_t*>(oNode.GetAttributeBase( _T("w:tentative"))));

			XmlUtils::CXmlNode oChild;
			
			if ( oNode.GetNode( _T("w:suff"), oChild ) )
				Suffix = std::wstring(static_cast<const wchar_t*>(oChild.GetAttributeBase( _T("w:val"))));
			
			if ( oNode.GetNode( _T("w:lvlText"), oChild ) )
				Text = std::wstring(static_cast<const wchar_t*>(oChild.GetAttributeBase( _T("w:val"))));
			
			if ( oNode.GetNode( _T("w:lvlJc"), oChild ) )
				Align = Logic::Align(std::wstring(static_cast<const wchar_t*>(oChild.GetAttributeBase( _T("w:val")))));
			
			if ( oNode.GetNode( _T("w:start"), oChild ) )
				Start = _wtoi(static_cast<const wchar_t*>(oChild.GetAttributeBase( _T("w:val"))));

			if ( oNode.GetNode( _T("w:numFmt"), oChild ) )
			{
				OOX::Logic::NumFormat fmt;
				fmt.fromXML(oChild);
				NumFmt = fmt;
			}
		}

		

		
		
	}
Exemple #16
0
		void    CTc::fromXML(XmlUtils::CXmlNode& oNode)
		{
			oNode.ReadAttributeBase( _T("w:id"), m_sId );

			XmlUtils::CXmlNodes oChilds;
			if ( oNode.GetNodes( _T("*"), oChilds ) )
			{
				XmlUtils::CXmlNode oItem;
				for ( int nIndex = 0; nIndex < oChilds.GetCount(); nIndex++ )
				{
					if ( oChilds.GetAt( nIndex, oItem ) )
					{
						CString sName = oItem.GetName();
						WritingElement *pItem = NULL;

/*						if ( _T("w:altChunk") == sName )
							pItem = new CAltChunk( oItem );
						else */if ( _T("w:bookmarkEnd") == sName )
							pItem = new CBookmarkEnd( oItem );
						else if ( _T("w:bookmarkStart") == sName )
							pItem = new CBookmarkStart( oItem );
						else if ( _T("w:commentRangeEnd") == sName )
							pItem = new CCommentRangeEnd( oItem );
						else if ( _T("w:commentRangeStart") == sName )
							pItem = new CCommentRangeStart( oItem );
						//else if ( _T("w:customXml") == sName )
						//	pItem = new CCustomXml( oItem );
						else if ( _T("w:customXmlDelRangeEnd") == sName )
							pItem = new CCustomXmlDelRangeEnd( oItem );
						else if ( _T("w:customXmlDelRangeStart") == sName )
							pItem = new CCustomXmlDelRangeStart( oItem );
						else if ( _T("w:customXmlInsRangeEnd") == sName )
							pItem = new CCustomXmlInsRangeEnd( oItem );
						else if ( _T("w:customXmlInsRangeStart") == sName )
							pItem = new CCustomXmlInsRangeStart( oItem );
						else if ( _T("w:customXmlMoveFromRangeEnd") == sName ) 
							pItem = new CCustomXmlMoveFromRangeEnd( oItem );
						else if ( _T("w:customXmlMoveFromRangeStart") == sName )
							pItem = new CCustomXmlMoveFromRangeStart( oItem );
						else if ( _T("w:customXmlMoveToRangeEnd") == sName ) 
							pItem = new CCustomXmlMoveToRangeEnd( oItem );
						else if ( _T("w:customXmlMoveToRangeStart") == sName )
							pItem = new CCustomXmlMoveToRangeStart( oItem );
						//else if ( _T("w:del") == sName )
						//	pItem = new CDel( oItem );
						//else if ( _T("w:ins") == sName )
						//	pItem = new CIns( oItem );
						//else if ( _T("w:moveFrom") == sName )
						//	pItem = new CMoveFrom( oItem );
						else if ( _T("w:moveFromRangeEnd") == sName )
							pItem = new CMoveToRangeEnd( oItem );
						else if ( _T("w:moveFromRangeStart") == sName )
							pItem = new CMoveToRangeStart( oItem );
						//else if ( _T("w:moveTo") == sName )
						//	pItem = new CMoveTo( oItem );
						else if ( _T("w:moveToRangeEnd") == sName )
							pItem = new CMoveToRangeEnd( oItem );
						else if ( _T("w:moveToRangeStart") == sName )
							pItem = new CMoveToRangeStart( oItem );
						else if ( _T("m:oMath") == sName )
							pItem = new COMath( oItem );
						else if ( _T("m:oMathPara") == sName )
							pItem = new COMathPara( oItem );
						else if ( _T("w:p") == sName )
							pItem = new CParagraph( oItem );
						else if ( _T("w:permEnd") == sName )
							pItem = new CPermEnd( oItem );
						else if ( _T("w:permStart") == sName )
							pItem = new CPermStart( oItem );
						else if ( _T("w:proofErr") == sName )
							pItem = new CProofErr( oItem );
						else if ( _T("w:sdt") == sName )
							pItem = new CSdt( oItem );
						else if ( _T("w:tbl") == sName )
							pItem = new CTbl( oItem );
						else if ( _T("w:tcPr") == sName )
						{
							pItem = m_oTableCellProperties = new CTableCellProperties( oItem );
						}

						if ( pItem )
							m_arrItems.push_back( pItem );
					}
				}
			}
		}
Exemple #17
0
bool CPPTShape::LoadFromXML(XmlUtils::CXmlNode& oNodePict)
{
    std::wstring id = oNodePict.GetAttributeOrValue(_T("type"));
    bool isPathList = false;
    if (id != _T(""))
    {
        SetShapeType((PPTShapes::ShapeType)XmlUtils::GetInteger(id));
    }
    else
    {
        XmlUtils::CXmlNode oNodeTemplate;
        if (oNodePict.GetNode(_T("template"), oNodeTemplate))
        {
            std::wstring strAdj = oNodeTemplate.GetAttributeOrValue(_T("adj"));
            LoadAdjustValuesList(strAdj);

            XmlUtils::CXmlNode oNodeGuides;
            if (oNodeTemplate.GetNode(_T("v:formulas"), oNodeGuides))
            {
                LoadGuidesList(oNodeGuides.GetXml());
            }

            std::wstring strPath = oNodeTemplate.GetAttributeOrValue(_T("path"));
            if (strPath != _T(""))
            {
                LoadPathList(strPath);
                isPathList = true;
            }
        }
    }

    XmlUtils::CXmlNode oNodeGuides;
    if (oNodePict.GetNode(_T("path"), oNodeGuides))
    {
        std::wstring strPath = oNodeGuides.GetAttributeOrValue(_T("val"));
        if (strPath != _T(""))
        {
            LoadPathList(strPath);
            isPathList = true;
        }
    }

    if (!isPathList)
        ReCalculate();
    return true;
}
		void    CSmartTag::fromXML(XmlUtils::CXmlNode& oNode)
		{
			oNode.ReadAttributeBase( _T("w:element"),      m_sElement );
			oNode.ReadAttributeBase( _T("w:uri"), m_sUri );

			XmlUtils::CXmlNodes oChilds;
			if ( oNode.GetNodes( _T("*"), oChilds ) )
			{
				XmlUtils::CXmlNode oItem;
				for ( int nIndex = 0; nIndex < oChilds.GetCount(); nIndex++ )
				{
					if ( oChilds.GetAt( nIndex, oItem ) )
					{
						CString sName = oItem.GetName();
						WritingElement *pItem = NULL;

						if ( _T("w:bdo") == sName )
							pItem = new CBdo( oItem );
						else if ( _T("w:bookmarkEnd") == sName )
							pItem = new CBookmarkEnd( oItem );
						else if ( _T("w:bookmarkStart") == sName )
							pItem = new CBookmarkStart( oItem );
						else if ( _T("w:commentRangeEnd") == sName )
							pItem = new CCommentRangeEnd( oItem );
						else if ( _T("w:commentRangeStart") == sName )
							pItem = new CCommentRangeStart( oItem );
						
						
						else if ( _T("w:customXmlDelRangeEnd") == sName )
							pItem = new CCustomXmlDelRangeEnd( oItem );
						else if ( _T("w:customXmlDelRangeStart") == sName )
							pItem = new CCustomXmlDelRangeStart( oItem );
						else if ( _T("w:customXmlInsRangeEnd") == sName )
							pItem = new CCustomXmlInsRangeEnd( oItem );
						else if ( _T("w:customXmlInsRangeStart") == sName )
							pItem = new CCustomXmlInsRangeStart( oItem );
						else if ( _T("w:customXmlMoveFromRangeEnd") == sName ) 
							pItem = new CCustomXmlMoveFromRangeEnd( oItem );
						else if ( _T("w:customXmlMoveFromRangeStart") == sName )
							pItem = new CCustomXmlMoveFromRangeStart( oItem );
						else if ( _T("w:customXmlMoveToRangeEnd") == sName ) 
							pItem = new CCustomXmlMoveToRangeEnd( oItem );
						else if ( _T("w:customXmlMoveToRangeStart") == sName )
							pItem = new CCustomXmlMoveToRangeStart( oItem );
						
						
						else if ( _T("w:dir") == sName )
							pItem = new CDir( oItem );
						else if ( _T("w:fldSimple") == sName )
							pItem = new CFldSimple( oItem );
						else if ( _T("w:hyperlink") == sName )
							pItem = new CHyperlink( oItem );
						
						
						
						
						else if ( _T("w:moveFromRangeEnd") == sName )
							pItem = new CMoveToRangeEnd( oItem );
						else if ( _T("w:moveFromRangeStart") == sName )
							pItem = new CMoveToRangeStart( oItem );
						
						
						else if ( _T("w:moveToRangeEnd") == sName )
							pItem = new CMoveToRangeEnd( oItem );
						else if ( _T("w:moveToRangeStart") == sName )
							pItem = new CMoveToRangeStart( oItem );
						else if ( _T("m:oMath") == sName )
							pItem = new COMath( oItem );
						else if ( _T("m:oMathPara") == sName )
							pItem = new COMathPara( oItem );
						else if ( _T("w:permEnd") == sName )
							pItem = new CPermEnd( oItem );
						else if ( _T("w:permStart") == sName )
							pItem = new CPermStart( oItem );
						else if ( _T("w:proofErr") == sName )
							pItem = new CProofErr( oItem );
						else if ( _T("w:r") == sName )
							pItem = new CRun( oItem );
						else if ( _T("w:sdt") == sName )
							pItem = new CSdt( oItem );
						else if ( _T("w:smartTag") == sName )
							pItem = new CSmartTag( oItem );
						
						

						if ( pItem )
							m_arrItems.Add( pItem );
					}
				}
			}
		}
		void GraphicFrame::fromXML(XmlUtils::CXmlNode& node)
		{
			XmlUtils::CXmlNodes oNodes;
			if (node.GetNodes(_T("*"), oNodes))
			{
				int count = oNodes.GetCount();
				for (int i = 0; i < count; ++i)
				{
					XmlUtils::CXmlNode oNode;
					oNodes.GetAt(i, oNode);
					CString strName = XmlUtils::GetNameNoNS(oNode.GetName());

					if (_T("xfrm") == strName)
						xfrm = oNode;
					else if (_T("nvGraphicFramePr") == strName)
						nvGraphicFramePr = oNode;
					
					if (_T("graphic") == strName)
					{
						XmlUtils::CXmlNode oNodeData;
						if (oNode.GetNode(_T("a:graphicData"), oNodeData))
						{
							XmlUtils::CXmlNode oNode1 = oNodeData.ReadNodeNoNS(_T("tbl"));
							if (oNode1.IsValid())
							{
                                table = oNode1;
								return;
							}
							XmlUtils::CXmlNode oNode2 = oNodeData.ReadNodeNoNS(_T("oleObj"));
							if (oNode2.IsValid())
							{
								fromXMLOle(oNode2);
								oNode2.ReadAttributeBase(L"spid", spid);
								pic = oNode2.ReadNode(_T("p:pic"));

								if (pic.is_init())
								{
									xfrm.Merge(pic->spPr.xfrm);
								}
								return;
							}
							XmlUtils::CXmlNode oNode3 = oNodeData.ReadNodeNoNS(_T("AlternateContent"));
							if (oNode3.IsValid())
							{
								XmlUtils::CXmlNode oNodeC;
								if (oNode3.GetNode(_T("mc:Choice"), oNodeC))
								{
									XmlUtils::CXmlNode oNodeO;
									if (oNodeC.GetNode(_T("p:oleObj"), oNodeO))
									{
										oNodeO.ReadAttributeBase(L"spid", spid);
									}
								}

								XmlUtils::CXmlNode oNodeFallback;
								if (oNode3.GetNode(_T("mc:Fallback"), oNodeFallback))
								{
									XmlUtils::CXmlNode oNodeO;
									if (oNodeFallback.GetNode(_T("p:oleObj"), oNodeO))
									{
										fromXMLOle(oNodeO);
										pic = oNodeO.ReadNode(_T("p:pic"));

										if (pic.is_init())
										{
											xfrm.Merge(pic->spPr.xfrm);
										}
									}
								}
							}
							XmlUtils::CXmlNode oNode4 = oNodeData.ReadNode(_T("dgm:relIds"));
							if (oNode4.IsValid())
							{
								smartArt = oNode4;
							}
							XmlUtils::CXmlNode oNode5 = oNodeData.ReadNode(_T("c:chart"));
							if (oNode5.IsValid())
							{
								chartRec = oNode5;
							}
							XmlUtils::CXmlNode oNode6 = oNodeData.ReadNode(_T("com:legacyDrawing"));
							if (oNode6.IsValid())
							{
								oNode6.ReadAttributeBase(L"spid", spid);
							}
						}
					}
				}
			}
			if(pic.IsInit() && oleObject.IsInit())
			{
				pic->oleObject = oleObject;
				pic->blipFill.blip->oleRid = oleObject->m_oId.get().ToString();
			}
			
			FillParentPointersForChilds();
		}
Exemple #20
0
		void    CBdo::fromXML(XmlUtils::CXmlNode& oNode)
		{
			oNode.ReadAttributeBase( _T("w:val"), m_oVal );

			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:bdo") == sName )
							pItem = new CBdo( oItem );
						else if ( _T("w:bookmarkEnd") == sName )
							pItem = new CBookmarkEnd( oItem );
						else if ( _T("w:bookmarkStart") == sName )
							pItem = new CBookmarkStart( oItem );
						else if ( _T("w:commentRangeEnd") == sName )
							pItem = new CCommentRangeEnd( oItem );
						else if ( _T("w:commentRangeStart") == sName )
							pItem = new CCommentRangeStart( oItem );
						//else if ( _T("w:customXml") == sName )
						//	pItem = new CCustomXml( oItem );
						else if ( _T("w:customXmlDelRangeEnd") == sName )
							pItem = new CCustomXmlDelRangeEnd( oItem );
						else if ( _T("w:customXmlDelRangeStart") == sName )
							pItem = new CCustomXmlDelRangeStart( oItem );
						else if ( _T("w:customXmlInsRangeEnd") == sName )
							pItem = new CCustomXmlInsRangeEnd( oItem );
						else if ( _T("w:customXmlInsRangeStart") == sName )
							pItem = new CCustomXmlInsRangeStart( oItem );
						else if ( _T("w:customXmlMoveFromRangeEnd") == sName ) 
							pItem = new CCustomXmlMoveFromRangeEnd( oItem );
						else if ( _T("w:customXmlMoveFromRangeStart") == sName )
							pItem = new CCustomXmlMoveFromRangeStart( oItem );
						else if ( _T("w:customXmlMoveToRangeEnd") == sName ) 
							pItem = new CCustomXmlMoveToRangeEnd( oItem );
						else if ( _T("w:customXmlMoveToRangeStart") == sName )
							pItem = new CCustomXmlMoveToRangeStart( oItem );
						//else if ( _T("w:del") == sName )
						//	pItem = new CDel( oItem );
						else if ( _T("w:dir") == sName )
							pItem = new CDir( oItem );
						else if ( _T("w:fldSimple") == sName )
							pItem = new CFldSimple( oItem );
						else if ( _T("w:hyperlink") == sName )
							pItem = new CHyperlink( oItem );
						//else if ( _T("w:ins") == sName )
						//	pItem = new CIns( oItem );
						//else if ( _T("w:moveFrom") == sName )
						//	pItem = new CMoveFrom( oItem );
						else if ( _T("w:moveFromRangeEnd") == sName )
							pItem = new CMoveFromRangeEnd( oItem );
						else if ( _T("w:moveFromRangeStart") == sName )
							pItem = new CMoveFromRangeStart( oItem );
						//else if ( _T("w:moveTo") == sName )
						//	pItem = new CMoveTo( oItem );
						else if ( _T("w:moveToRangeEnd") == sName )
							pItem = new CMoveToRangeEnd( oItem );
						else if ( _T("w:moveToRangeStart") == sName )
							pItem = new CMoveToRangeStart( oItem );
						else if ( _T("m:oMath") == sName )
							pItem = new COMath( oItem );
						else if ( _T("m:oMathPara") == sName )
							pItem = new COMathPara( oItem );
						else if ( _T("w:permEnd") == sName )
							pItem = new CPermEnd( oItem );
						else if ( _T("w:permStart") == sName )
							pItem = new CPermStart( oItem );
						else if ( _T("w:proofErr") == sName )
							pItem = new CProofErr( oItem );
						else if ( _T("w:r") == sName )
							pItem = new CRun( oItem );
						else if ( _T("w:sdt") == sName )
							pItem = new CSdt( oItem );
						else if ( _T("w:smartTag") == sName )
							pItem = new CSmartTag( oItem );
						//else if ( _T("w:subDoc") == sName )
						//	pItem = new CSubDoc( oItem );

						if ( pItem )
							m_arrItems.push_back( pItem );
					}
				}
			}
		}
Exemple #21
0
bool CPPTShape::LoadFromXMLShapeType(XmlUtils::CXmlNode& oNodeShapeType) // vml object
{		// из за особенносей форматирования vmlDrawing могут вылезти пустые текстовые значения - value ..
    std::wstring sId = oNodeShapeType.GetAttribute(_T("o:spt"));

    bool bIsNeedRecalc = true;
    if (sId != _T(""))
    {
        int id = XmlUtils::GetInteger(sId);
        if (id > 0)
        {
            SetShapeType((PPTShapes::ShapeType)id);
            //ReCalculate();
            m_eType = (PPTShapes::ShapeType)id;
        }
    }
    std::wstring strAdj = oNodeShapeType.GetAttribute(_T("adj"));
    if (strAdj != _T(""))
        LoadAdjustValuesList(strAdj);

    XmlUtils::CXmlNode oNodeGuides;
    if (oNodeShapeType.GetNode(_T("v:formulas"), oNodeGuides))
    {
        LoadGuidesList(oNodeGuides.GetXml());
    }

    XmlUtils::CXmlNode oNodePath;
    if (oNodeShapeType.GetNode(_T("v:path"), oNodePath))
    {
        std::wstring strTextR = oNodePath.GetAttribute(_T("textboxrect"));
        if (strTextR != _T(""))
            LoadTextRect(strTextR);
    }

    XmlUtils::CXmlNode oNodeAHs;
    if (oNodeShapeType.GetNode(_T("v:handles"), oNodeAHs))
    {
        LoadAHList(oNodeAHs);
    }

    std::wstring strPath = oNodeShapeType.GetAttribute(_T("path"));
    if (strPath != _T(""))
    {
        LoadPathList(strPath);
    }

    XmlUtils::CXmlNode oNodeTextPath;
    if (oNodeShapeType.GetNode(_T("v:textpath"), oNodeTextPath))
    {
        if (m_eType < PPTShapes::ShapeType::sptCTextPlain || m_eType > PPTShapes::ShapeType::sptCTextCanDown)
            m_eType = PPTShapes::ShapeType::sptCTextPlain;
    }

    std::wstring strFilled = oNodeShapeType.GetAttribute(_T("filled"));
    std::wstring strStroked = oNodeShapeType.GetAttribute(_T("stroked"));

    if (strFilled != _T(""))
    {
        if (strFilled == _T("false") || strFilled == _T("f"))
            m_bIsFilled = false;
        else
            m_bIsFilled = true;
    }

    if (strStroked != _T(""))
    {
        if (strStroked == _T("false") || strStroked == _T("f"))
            m_bIsStroked = false;
        else
            m_bIsStroked = true;
    }
    XmlUtils::CXmlNode oNodeSignature;
    if (oNodeShapeType.GetNode(_T("o:signatureline"), oNodeSignature))
    {
        m_oSignatureLine = oNodeSignature;
    }

    ReCalculate();
    return true;
}
	void FontTable::Font::fromXML(XmlUtils::CXmlNode& oNode)
	{
		if ( _T("w:font") == oNode.GetName() )
		{
			m_name = std::wstring(static_cast<const wchar_t*>(oNode.GetAttributeBase( _T("w:name"))));

			XmlUtils::CXmlNode oChild;
			if ( oNode.GetNode( _T("w:panose1"), oChild ) )
				m_panose1 = std::wstring(static_cast<const wchar_t*>(oChild.GetAttributeBase( _T("w:val"))));
			if ( oNode.GetNode( _T("w:charset"), oChild ) )
				m_charset = std::wstring(static_cast<const wchar_t*>(oChild.GetAttributeBase( _T("w:val"))));
			if ( oNode.GetNode( _T("w:family"), oChild ) )
				m_family = std::wstring(static_cast<const wchar_t*>(oChild.GetAttributeBase( _T("w:val"))));	
			if ( oNode.GetNode( _T("w:pitch"), oChild ) )
				m_pitch = std::wstring(static_cast<const wchar_t*>(oChild.GetAttributeBase( _T("w:val"))));	
			if ( oNode.GetNode( _T("w:sig"), oChild ) )
			{
				m_usb0	= std::wstring(static_cast<const wchar_t*>(oChild.GetAttributeBase( _T("w:usb0"))));		
				m_usb1	= std::wstring(static_cast<const wchar_t*>(oChild.GetAttributeBase( _T("w:usb1"))));		
				m_usb2	= std::wstring(static_cast<const wchar_t*>(oChild.GetAttributeBase( _T("w:usb2"))));		
				m_usb3	= std::wstring(static_cast<const wchar_t*>(oChild.GetAttributeBase( _T("w:usb3"))));	
				m_csb0	= std::wstring(static_cast<const wchar_t*>(oChild.GetAttributeBase( _T("w:csb0"))));	
				m_csb1	= std::wstring(static_cast<const wchar_t*>(oChild.GetAttributeBase( _T("w:csb1"))));	
			}
		}
	}
Exemple #23
0
		void    CTr::fromXML(XmlUtils::CXmlNode& oNode)
		{
			oNode.ReadAttributeBase( _T("w:rsidDel"), m_oRsidDel );
			oNode.ReadAttributeBase( _T("w:rsidR"),   m_oRsidR );
			oNode.ReadAttributeBase( _T("w:rsidRPr"), m_oRsidRPr );
			oNode.ReadAttributeBase( _T("w:rsidTr"),  m_oRsidTr );

			XmlUtils::CXmlNodes oChilds;
			int nNumCol = 0;
			if ( oNode.GetNodes( _T("*"), oChilds ) )
			{
				XmlUtils::CXmlNode oItem;
				for ( int nIndex = 0; nIndex < oChilds.GetCount(); nIndex++ )
				{
					if ( oChilds.GetAt( nIndex, oItem ) )
					{
						CString sName = oItem.GetName();
						WritingElement *pItem = NULL;

						if ( _T("w:bookmarkEnd") == sName )
							pItem = new CBookmarkEnd( oItem );
						else if ( _T("w:bookmarkStart") == sName )
							pItem = new CBookmarkStart( oItem );
						else if ( _T("w:commentRangeEnd") == sName )
							pItem = new CCommentRangeEnd( oItem );
						else if ( _T("w:commentRangeStart") == sName )
							pItem = new CCommentRangeStart( oItem );
						//else if ( _T("w:customXml") == sName )
						//	pItem = new CCustomXml( oItem );
						else if ( _T("w:customXmlDelRangeEnd") == sName )
							pItem = new CCustomXmlDelRangeEnd( oItem );
						else if ( _T("w:customXmlDelRangeStart") == sName )
							pItem = new CCustomXmlDelRangeStart( oItem );
						else if ( _T("w:customXmlInsRangeEnd") == sName )
							pItem = new CCustomXmlInsRangeEnd( oItem );
						else if ( _T("w:customXmlInsRangeStart") == sName )
							pItem = new CCustomXmlInsRangeStart( oItem );
						else if ( _T("w:customXmlMoveFromRangeEnd") == sName ) 
							pItem = new CCustomXmlMoveFromRangeEnd( oItem );
						else if ( _T("w:customXmlMoveFromRangeStart") == sName )
							pItem = new CCustomXmlMoveFromRangeStart( oItem );
						else if ( _T("w:customXmlMoveToRangeEnd") == sName ) 
							pItem = new CCustomXmlMoveToRangeEnd( oItem );
						else if ( _T("w:customXmlMoveToRangeStart") == sName )
							pItem = new CCustomXmlMoveToRangeStart( oItem );
						//else if ( _T("w:del") == sName )
						//	pItem = new CDel( oItem );
						//else if ( _T("w:ins") == sName )
						//	pItem = new CIns( oItem );
						//else if ( _T("w:moveFrom") == sName )
						//	pItem = new CMoveFrom( oItem );
						else if ( _T("w:moveFromRangeEnd") == sName )
							pItem = new CMoveToRangeEnd( oItem );
						else if ( _T("w:moveFromRangeStart") == sName )
							pItem = new CMoveToRangeStart( oItem );
						//else if ( _T("w:moveTo") == sName )
						//	pItem = new CMoveTo( oItem );
						else if ( _T("w:moveToRangeEnd") == sName )
							pItem = new CMoveToRangeEnd( oItem );
						else if ( _T("w:moveToRangeStart") == sName )
							pItem = new CMoveToRangeStart( oItem );
						else if ( _T("m:oMath") == sName )
							pItem = new COMath( oItem );
						else if ( _T("m:oMathPara") == sName )
							pItem = new COMathPara( oItem );
						else if ( _T("w:permEnd") == sName )
							pItem = new CPermEnd( oItem );
						else if ( _T("w:permStart") == sName )
							pItem = new CPermStart( oItem );
						else if ( _T("w:proofErr") == sName )
							pItem = new CProofErr( oItem );
						else if ( _T("w:sdt") == sName )
							pItem = new CSdt( oItem );
						else if ( _T("w:tblPrEx") == sName )
							pItem = new CTblPrEx( oItem );
						else if ( _T("w:tc") == sName )
						{
							pItem = new CTc( oItem );
							if ( pItem )
							{
								CTc *pCell = (CTc *)pItem;
								pCell->m_nNumCol = nNumCol;
								
								CTableCellProperties *pProps = pCell->GetProperties();
								if ( pProps )
								{
									if ( pProps->m_oGridSpan.IsInit() && pProps->m_oGridSpan->m_oVal.IsInit() )
										nNumCol += pProps->m_oGridSpan->m_oVal->GetValue();
									else
										nNumCol++;
								}
								else
									nNumCol++;
							}
						}
						else if ( _T("w:trPr") == sName )
						{
							pItem = m_oTableRowProperties = new CTableRowProperties( oItem );
						}

						if ( pItem )
							m_arrItems.push_back( pItem );
					}
				}
			}
		}