Commit 7496de06 authored by ElenaSubbotina's avatar ElenaSubbotina

.

parent fdd443a2
...@@ -51,6 +51,12 @@ namespace PPTX ...@@ -51,6 +51,12 @@ namespace PPTX
WritingElement_AdditionConstructors(UniFill) WritingElement_AdditionConstructors(UniFill)
PPTX_LOGIC_BASE2(UniFill) PPTX_LOGIC_BASE2(UniFill)
virtual OOX::EElementType getType() const
{
if (Fill.IsInit())
return Fill->getType();
return OOX::et_Unknown;
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader) virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{ {
std::wstring name = oReader.GetName(); std::wstring name = oReader.GetName();
......
...@@ -47,7 +47,8 @@ namespace PPTX ...@@ -47,7 +47,8 @@ namespace PPTX
m_ns = _T("a"); m_ns = _T("a");
} }
virtual ~Xfrm() {} virtual ~Xfrm() {}
explicit Xfrm(XmlUtils::CXmlNode& node) { fromXML(node); } explicit Xfrm(XmlUtils::CXmlNode& node) { fromXML(node); }
explicit Xfrm(XmlUtils::CXmlLiteReader& oReader){ fromXML(oReader); }
const Xfrm& operator =(XmlUtils::CXmlNode& node) const Xfrm& operator =(XmlUtils::CXmlNode& node)
{ {
fromXML(node); fromXML(node);
...@@ -57,9 +58,54 @@ namespace PPTX ...@@ -57,9 +58,54 @@ namespace PPTX
virtual OOX::EElementType getType () const virtual OOX::EElementType getType () const
{ {
return OOX::et_p_xfrm; return OOX::et_a_xfrm;
} }
public: virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes(oReader);
if ( oReader.IsEmptyNode() )
return;
int nParentDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth ) )
{
std::wstring sName = oReader.GetName();
if (sName == L"a:off")
ReadAttributes1(oReader, offX, offY);
else if (sName == L"a:ext")
ReadAttributes2(oReader, extX, extY);
else if (sName == L"a:chOff")
ReadAttributes1(oReader, chOffX, chOffY);
else if (sName == L"a:chExt")
ReadAttributes2(oReader, chExtX, chExtY);
}
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("flipH"), flipH)
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("flipV"), flipV )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("rot"), rot )
WritingElement_ReadAttributes_End( oReader )
}
void ReadAttributes1(XmlUtils::CXmlLiteReader& oReader, nullable_int & x, nullable_int & y)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("x"), x )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("y"), y )
WritingElement_ReadAttributes_End( oReader )
}
void ReadAttributes2(XmlUtils::CXmlLiteReader& oReader, nullable_int & cx, nullable_int & cy)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("cx"), cx )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("cy"), cy )
WritingElement_ReadAttributes_End( oReader )
}
virtual void fromXML(XmlUtils::CXmlNode& node) virtual void fromXML(XmlUtils::CXmlNode& node)
{ {
m_ns = XmlUtils::GetNamespace(node.GetName()); m_ns = XmlUtils::GetNamespace(node.GetName());
......
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