Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
onlyoffice_core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
onlyoffice_core
Commits
15a71139
Commit
15a71139
authored
Mar 22, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x2t xlsx outline level save/read in binary
parent
3d840334
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
39 deletions
+63
-39
XlsxSerializerCom/Common/BinReaderWriterDefines.h
XlsxSerializerCom/Common/BinReaderWriterDefines.h
+26
-24
XlsxSerializerCom/Reader/BinaryWriter.h
XlsxSerializerCom/Reader/BinaryWriter.h
+21
-9
XlsxSerializerCom/Writer/BinaryReader.h
XlsxSerializerCom/Writer/BinaryReader.h
+16
-6
No files found.
XlsxSerializerCom/Common/BinReaderWriterDefines.h
100644 → 100755
View file @
15a71139
...
...
@@ -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
{
...
...
XlsxSerializerCom/Reader/BinaryWriter.h
View file @
15a71139
...
...
@@ -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
);
...
...
XlsxSerializerCom/Writer/BinaryReader.h
View file @
15a71139
...
...
@@ -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
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment