mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-11 03:42:47 +08:00
52 lines
1.2 KiB
C++
52 lines
1.2 KiB
C++
#include "CtrlShapeLine.h"
|
|
|
|
namespace HWP
|
|
{
|
|
CCtrlShapeLine::CCtrlShapeLine()
|
|
{}
|
|
|
|
CCtrlShapeLine::CCtrlShapeLine(const HWP_STRING& sCtrlID)
|
|
: CCtrlGeneralShape(sCtrlID)
|
|
{}
|
|
|
|
CCtrlShapeLine::CCtrlShapeLine(const CCtrlGeneralShape& oShape)
|
|
: CCtrlGeneralShape(oShape)
|
|
{}
|
|
|
|
CCtrlShapeLine::CCtrlShapeLine(const HWP_STRING& sCtrlID, int nSize, CHWPStream& oBuffer, int nOff, int nVersion)
|
|
: CCtrlGeneralShape(sCtrlID, nSize, oBuffer, nOff, nVersion)
|
|
{}
|
|
|
|
int CCtrlShapeLine::ParseElement(CCtrlShapeLine& oObj, int nSize, CHWPStream& oBuffer, int nOff, int nVersion)
|
|
{
|
|
oBuffer.SavePosition();
|
|
|
|
if (L"loc$" == oObj.GetID())
|
|
oBuffer.Skip(4);
|
|
|
|
oBuffer.ReadInt(oObj.m_nStartX);
|
|
oBuffer.ReadInt(oObj.m_nStartY);
|
|
oBuffer.ReadInt(oObj.m_nEndX);
|
|
oBuffer.ReadInt(oObj.m_nEndY);
|
|
|
|
if (nSize == oBuffer.GetDistanceToLastPos())
|
|
{
|
|
oBuffer.RemoveLastSavedPos();
|
|
return nSize;
|
|
}
|
|
|
|
oBuffer.ReadShort(oObj.m_shAttr);
|
|
oBuffer.Skip(2);
|
|
|
|
oBuffer.Skip(nSize - oBuffer.GetDistanceToLastPos(true));
|
|
return nSize;
|
|
}
|
|
|
|
int CCtrlShapeLine::ParseCtrl(CCtrlShapeLine& oObj, int nSize, CHWPStream& oBuffer, int nOff, int nVersion)
|
|
{
|
|
CCtrlGeneralShape::ParseCtrl(oObj, nSize, oBuffer, nOff, nVersion);
|
|
return oObj.GetSize();
|
|
}
|
|
|
|
}
|