Commit 15a71139 authored by ElenaSubbotina's avatar ElenaSubbotina

x2t xlsx outline level save/read in binary

parent 3d840334
......@@ -242,39 +242,41 @@ namespace BinXlsxRW
};}
namespace c_oSerWorksheetColTypes{enum c_oSerWorksheetColTypes
{
BestFit = 0,
Hidden = 1,
Max = 2,
Min = 3,
Style = 4,
Width = 5,
CustomWidth = 6
BestFit = 0,
Hidden = 1,
Max = 2,
Min = 3,
Style = 4,
Width = 5,
CustomWidth = 6,
OutLevel = 7
};}
namespace c_oSerHyperlinkTypes{enum c_oSerWorksheetColTypes
{
Ref = 0,
Hyperlink = 1,
Location = 2,
Tooltip = 3,
Display = 4
Ref = 0,
Hyperlink = 1,
Location = 2,
Tooltip = 3,
Display = 4
};}
namespace c_oSerSheetFormatPrTypes{enum c_oSerSheetFormatPrTypes
{
DefaultColWidth = 0,
DefaultRowHeight = 1,
BaseColWidth = 2,
CustomHeight = 3,
ZeroHeight = 4
DefaultColWidth = 0,
DefaultRowHeight = 1,
BaseColWidth = 2,
CustomHeight = 3,
ZeroHeight = 4
};}
namespace c_oSerRowTypes{enum c_oSerRowTypes
{
Row = 0,
Style = 1,
Height = 2,
Hidden = 3,
Cells = 4,
Cell = 5,
CustomHeight = 6
Row = 0,
Style = 1,
Height = 2,
Hidden = 3,
Cells = 4,
Cell = 5,
CustomHeight = 6,
OutLevel = 7
};}
namespace c_oSerCellTypes{enum c_oSerCellTypes
{
......
......@@ -1937,14 +1937,20 @@ namespace BinXlsxRW {
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
m_oBcw.m_oStream.WriteDoubleReal(oCol.m_oWidth->GetValue());
}
//CustomWidth
if(oCol.m_oCustomWidth.IsInit())
{
m_oBcw.m_oStream.WriteBYTE(c_oSerWorksheetColTypes::CustomWidth);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBYTE(oCol.m_oCustomWidth->ToBool());
}
}
//CustomWidth
if(oCol.m_oCustomWidth.IsInit())
{
m_oBcw.m_oStream.WriteBYTE(c_oSerWorksheetColTypes::CustomWidth);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBYTE(oCol.m_oCustomWidth->ToBool());
}
if(oCol.m_oOutlineLevel.IsInit())
{
m_oBcw.m_oStream.WriteBYTE(c_oSerWorksheetColTypes::OutLevel);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
m_oBcw.m_oStream.WriteLONG(oCol.m_oOutlineLevel->GetValue());
}
}
void WriteSheetViews(const OOX::Spreadsheet::CSheetViews& oSheetViews)
{
......@@ -2402,7 +2408,13 @@ namespace BinXlsxRW {
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(oRows.m_oCustomHeight->ToBool());
}
if(oRows.m_arrItems.size() > 0)
if(oRows.m_oOutlineLevel.IsInit())
{
m_oBcw.m_oStream.WriteBYTE(c_oSerRowTypes::OutLevel);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
m_oBcw.m_oStream.WriteLONG(oRows.m_oOutlineLevel->GetValue());
}
if(oRows.m_arrItems.size() > 0)
{
m_oBcw.m_oStream.WriteBYTE(c_oSerRowTypes::Cells);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable);
......
......@@ -2118,7 +2118,7 @@ namespace BinXlsxRW {
else
res = c_oSerConstants::ReadUnknown;
return res;
};
}
int ReadWorksheetProp(BYTE type, long length, void* poResult)
{
int res = c_oSerConstants::ReadOk;
......@@ -2140,7 +2140,7 @@ namespace BinXlsxRW {
else
res = c_oSerConstants::ReadUnknown;
return res;
};
}
int ReadWorksheetCols(BYTE type, long length, void* poResult)
{
int res = c_oSerConstants::ReadOk;
......@@ -2153,7 +2153,7 @@ namespace BinXlsxRW {
else
res = c_oSerConstants::ReadUnknown;
return res;
};
}
int ReadWorksheetCol(BYTE type, long length, void* poResult)
{
OOX::Spreadsheet::CCol* pCol = static_cast<OOX::Spreadsheet::CCol*>(poResult);
......@@ -2198,10 +2198,15 @@ namespace BinXlsxRW {
pCol->m_oCustomWidth.Init();
pCol->m_oCustomWidth->SetValue(false != m_oBufferedStream.GetBool() ? SimpleTypes::onoffTrue : SimpleTypes::onoffFalse);
}
else
else if(c_oSerWorksheetColTypes::OutLevel == type)
{
pCol->m_oOutlineLevel.Init();
pCol->m_oOutlineLevel->SetValue(m_oBufferedStream.GetLong());
}
else
res = c_oSerConstants::ReadUnknown;
return res;
};
}
int ReadSheetViews(BYTE type, long length, void* poResult)
{
int res = c_oSerConstants::ReadOk;
......@@ -2978,7 +2983,12 @@ namespace BinXlsxRW {
pRow->m_oCustomHeight.Init();
pRow->m_oCustomHeight->SetValue(false != m_oBufferedStream.GetBool() ? SimpleTypes::onoffTrue : SimpleTypes::onoffFalse);
}
else if(c_oSerRowTypes::Cells == type)
else if(c_oSerRowTypes::OutLevel == type)
{
pRow->m_oOutlineLevel.Init();
pRow->m_oOutlineLevel->SetValue(m_oBufferedStream.GetLong());
}
else if(c_oSerRowTypes::Cells == type)
{
res = Read1(length, &BinaryWorksheetsTableReader::ReadCells, this, pRow);
}
......
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