mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-11 06:22:44 +08:00
64 lines
1.6 KiB
C++
64 lines
1.6 KiB
C++
#include "CtrlShapeOle.h"
|
|
|
|
namespace HWP
|
|
{
|
|
CCtrlShapeOle::CCtrlShapeOle()
|
|
{}
|
|
|
|
CCtrlShapeOle::CCtrlShapeOle(const HWP_STRING& sCtrlID)
|
|
: CCtrlGeneralShape(sCtrlID)
|
|
{}
|
|
|
|
CCtrlShapeOle::CCtrlShapeOle(const CCtrlGeneralShape& oShape)
|
|
: CCtrlGeneralShape(oShape)
|
|
{}
|
|
|
|
CCtrlShapeOle::CCtrlShapeOle(const HWP_STRING& sCtrlID, int nSize, CHWPStream& oBuffer, int nOff, int nVersion)
|
|
: CCtrlGeneralShape(sCtrlID, nSize, oBuffer, nOff, nVersion)
|
|
{}
|
|
|
|
CCtrlShapeOle::CCtrlShapeOle(const HWP_STRING& sCtrlID, CXMLNode& oNode, int nVersion)
|
|
: CCtrlGeneralShape(sCtrlID, oNode, nVersion)
|
|
{
|
|
m_sBinDataID = oNode.GetAttribute(L"binaryItemIDRef");
|
|
|
|
for (CXMLNode& oChild : oNode.GetChilds(L"hc:extent"))
|
|
{
|
|
m_nExtentX = oChild.GetAttributeInt(L"x");
|
|
m_nExtentY = oChild.GetAttributeInt(L"y");
|
|
}
|
|
}
|
|
|
|
EShapeType CCtrlShapeOle::GetShapeType() const
|
|
{
|
|
return EShapeType::Ole;
|
|
}
|
|
|
|
HWP_STRING CCtrlShapeOle::GetBinDataID() const
|
|
{
|
|
return m_sBinDataID;
|
|
}
|
|
|
|
int CCtrlShapeOle::ParseElement(CCtrlShapeOle& oObj, int nSize, CHWPStream& oBuffer, int nOff, int nVersion)
|
|
{
|
|
oBuffer.SavePosition();
|
|
|
|
oBuffer.ReadInt(oObj.m_nAttr);
|
|
oBuffer.ReadInt(oObj.m_nExtentX);
|
|
oBuffer.ReadInt(oObj.m_nExtentY);
|
|
oObj.m_sBinDataID = std::to_wstring(oBuffer.ReadShort());
|
|
oBuffer.ReadColor(oObj.m_nBorderColor);
|
|
oBuffer.ReadInt(oObj.m_nBorderThick);
|
|
oBuffer.ReadInt(oObj.m_nBorderAttr);
|
|
|
|
oBuffer.Skip(nSize - oBuffer.GetDistanceToLastPos(true));
|
|
return nSize;
|
|
}
|
|
|
|
int CCtrlShapeOle::ParseCtrl(CCtrlShapeOle& oObj, int nSize, CHWPStream& oBuffer, int nOff, int nVersion)
|
|
{
|
|
return CCtrlObjElement::ParseCtrl(oObj, nSize, oBuffer, nOff, nVersion);
|
|
}
|
|
|
|
}
|