Commit 15a71139 authored by ElenaSubbotina's avatar ElenaSubbotina

x2t xlsx outline level save/read in binary

parent 3d840334
...@@ -248,7 +248,8 @@ namespace BinXlsxRW ...@@ -248,7 +248,8 @@ namespace BinXlsxRW
Min = 3, Min = 3,
Style = 4, Style = 4,
Width = 5, Width = 5,
CustomWidth = 6 CustomWidth = 6,
OutLevel = 7
};} };}
namespace c_oSerHyperlinkTypes{enum c_oSerWorksheetColTypes namespace c_oSerHyperlinkTypes{enum c_oSerWorksheetColTypes
{ {
...@@ -274,7 +275,8 @@ namespace BinXlsxRW ...@@ -274,7 +275,8 @@ namespace BinXlsxRW
Hidden = 3, Hidden = 3,
Cells = 4, Cells = 4,
Cell = 5, Cell = 5,
CustomHeight = 6 CustomHeight = 6,
OutLevel = 7
};} };}
namespace c_oSerCellTypes{enum c_oSerCellTypes namespace c_oSerCellTypes{enum c_oSerCellTypes
{ {
......
...@@ -1944,6 +1944,12 @@ namespace BinXlsxRW { ...@@ -1944,6 +1944,12 @@ namespace BinXlsxRW {
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte); m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBYTE(oCol.m_oCustomWidth->ToBool()); 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) void WriteSheetViews(const OOX::Spreadsheet::CSheetViews& oSheetViews)
...@@ -2402,6 +2408,12 @@ namespace BinXlsxRW { ...@@ -2402,6 +2408,12 @@ namespace BinXlsxRW {
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte); m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(oRows.m_oCustomHeight->ToBool()); m_oBcw.m_oStream.WriteBOOL(oRows.m_oCustomHeight->ToBool());
} }
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) if(oRows.m_arrItems.size() > 0)
{ {
m_oBcw.m_oStream.WriteBYTE(c_oSerRowTypes::Cells); m_oBcw.m_oStream.WriteBYTE(c_oSerRowTypes::Cells);
......
...@@ -2118,7 +2118,7 @@ namespace BinXlsxRW { ...@@ -2118,7 +2118,7 @@ namespace BinXlsxRW {
else else
res = c_oSerConstants::ReadUnknown; res = c_oSerConstants::ReadUnknown;
return res; return res;
}; }
int ReadWorksheetProp(BYTE type, long length, void* poResult) int ReadWorksheetProp(BYTE type, long length, void* poResult)
{ {
int res = c_oSerConstants::ReadOk; int res = c_oSerConstants::ReadOk;
...@@ -2140,7 +2140,7 @@ namespace BinXlsxRW { ...@@ -2140,7 +2140,7 @@ namespace BinXlsxRW {
else else
res = c_oSerConstants::ReadUnknown; res = c_oSerConstants::ReadUnknown;
return res; return res;
}; }
int ReadWorksheetCols(BYTE type, long length, void* poResult) int ReadWorksheetCols(BYTE type, long length, void* poResult)
{ {
int res = c_oSerConstants::ReadOk; int res = c_oSerConstants::ReadOk;
...@@ -2153,7 +2153,7 @@ namespace BinXlsxRW { ...@@ -2153,7 +2153,7 @@ namespace BinXlsxRW {
else else
res = c_oSerConstants::ReadUnknown; res = c_oSerConstants::ReadUnknown;
return res; return res;
}; }
int ReadWorksheetCol(BYTE type, long length, void* poResult) int ReadWorksheetCol(BYTE type, long length, void* poResult)
{ {
OOX::Spreadsheet::CCol* pCol = static_cast<OOX::Spreadsheet::CCol*>(poResult); OOX::Spreadsheet::CCol* pCol = static_cast<OOX::Spreadsheet::CCol*>(poResult);
...@@ -2198,10 +2198,15 @@ namespace BinXlsxRW { ...@@ -2198,10 +2198,15 @@ namespace BinXlsxRW {
pCol->m_oCustomWidth.Init(); pCol->m_oCustomWidth.Init();
pCol->m_oCustomWidth->SetValue(false != m_oBufferedStream.GetBool() ? SimpleTypes::onoffTrue : SimpleTypes::onoffFalse); pCol->m_oCustomWidth->SetValue(false != m_oBufferedStream.GetBool() ? SimpleTypes::onoffTrue : SimpleTypes::onoffFalse);
} }
else if(c_oSerWorksheetColTypes::OutLevel == type)
{
pCol->m_oOutlineLevel.Init();
pCol->m_oOutlineLevel->SetValue(m_oBufferedStream.GetLong());
}
else else
res = c_oSerConstants::ReadUnknown; res = c_oSerConstants::ReadUnknown;
return res; return res;
}; }
int ReadSheetViews(BYTE type, long length, void* poResult) int ReadSheetViews(BYTE type, long length, void* poResult)
{ {
int res = c_oSerConstants::ReadOk; int res = c_oSerConstants::ReadOk;
...@@ -2978,6 +2983,11 @@ namespace BinXlsxRW { ...@@ -2978,6 +2983,11 @@ namespace BinXlsxRW {
pRow->m_oCustomHeight.Init(); pRow->m_oCustomHeight.Init();
pRow->m_oCustomHeight->SetValue(false != m_oBufferedStream.GetBool() ? SimpleTypes::onoffTrue : SimpleTypes::onoffFalse); pRow->m_oCustomHeight->SetValue(false != m_oBufferedStream.GetBool() ? SimpleTypes::onoffTrue : SimpleTypes::onoffFalse);
} }
else if(c_oSerRowTypes::OutLevel == type)
{
pRow->m_oOutlineLevel.Init();
pRow->m_oOutlineLevel->SetValue(m_oBufferedStream.GetLong());
}
else if(c_oSerRowTypes::Cells == type) else if(c_oSerRowTypes::Cells == type)
{ {
res = Read1(length, &BinaryWorksheetsTableReader::ReadCells, this, pRow); 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