mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
61 lines
1.3 KiB
C++
61 lines
1.3 KiB
C++
#include "CtrlColumnDef.h"
|
|
|
|
namespace HWP
|
|
{
|
|
CCtrlColumnDef::CCtrlColumnDef(const HWP_STRING& sCtrlID)
|
|
: CCtrl(sCtrlID)
|
|
{}
|
|
|
|
CCtrlColumnDef::CCtrlColumnDef(const HWP_STRING& sCtrlID, int nSize, CHWPStream& oBuffer, int nOff, int nVersion)
|
|
: CCtrl(sCtrlID)
|
|
{
|
|
oBuffer.SavePosition();
|
|
|
|
short shAttrLowBits;
|
|
oBuffer.ReadShort(shAttrLowBits);
|
|
oBuffer.ReadShort(m_shSameGap);
|
|
|
|
m_shColCount = (short)(shAttrLowBits >> 2 & 0xFF);
|
|
m_bSameSz = CHECK_FLAG(shAttrLowBits >> 12, 0x1);
|
|
|
|
if (!m_bSameSz)
|
|
{
|
|
m_arColSzWidths.reserve(m_shColCount);
|
|
m_arColSzGaps.reserve(m_shColCount - 1);
|
|
|
|
for (int nIndex = 0; nIndex < m_shColCount; ++nIndex)
|
|
{
|
|
oBuffer.ReadShort(m_arColSzWidths[nIndex]);
|
|
if (nIndex < m_shColCount - 1)
|
|
oBuffer.ReadShort(m_arColSzGaps[nIndex]);
|
|
}
|
|
}
|
|
|
|
short shAttrHighBits;
|
|
oBuffer.ReadShort(shAttrHighBits);
|
|
m_eColLineStyle = GetLineStyle2(oBuffer.ReadByte());
|
|
oBuffer.ReadByte(m_chColLineWidth);
|
|
oBuffer.ReadInt(m_nColLineColor);
|
|
|
|
m_nAttr = shAttrHighBits << 16 | shAttrLowBits;
|
|
|
|
m_nSize = oBuffer.GetDistanceToLastPos(true);
|
|
m_bFullFilled = true;
|
|
}
|
|
|
|
int CCtrlColumnDef::GetSize()
|
|
{
|
|
return m_nSize;
|
|
}
|
|
|
|
short CCtrlColumnDef::GetColCount() const
|
|
{
|
|
return m_shColCount;
|
|
}
|
|
|
|
ELineStyle2 CCtrlColumnDef::GetColLineStyle() const
|
|
{
|
|
return m_eColLineStyle;
|
|
}
|
|
}
|