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
59d75ed1
Commit
59d75ed1
authored
Jul 06, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XlsFormat - fix pivots
parent
ccc4d751
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
45 additions
and
13 deletions
+45
-13
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/SXLI.cpp
...ficeXlsFile2/source/XlsFormat/Logic/Biff_records/SXLI.cpp
+13
-6
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/Xnum.h
...iceXlsFile2/source/XlsFormat/Logic/Biff_structures/Xnum.h
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/FDB.cpp
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/FDB.cpp
+9
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/FDB.h
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/FDB.h
+1
-0
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/PIVOTLI.cpp
...ceXlsFile2/source/XlsFormat/Logic/Biff_unions/PIVOTLI.cpp
+6
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/PIVOTVD.cpp
...ceXlsFile2/source/XlsFormat/Logic/Biff_unions/PIVOTVD.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/PIVOTVIEW.cpp
...XlsFile2/source/XlsFormat/Logic/Biff_unions/PIVOTVIEW.cpp
+2
-2
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/SXOPER.cpp
...iceXlsFile2/source/XlsFormat/Logic/Biff_unions/SXOPER.cpp
+11
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/SXOPER.h
...fficeXlsFile2/source/XlsFormat/Logic/Biff_unions/SXOPER.h
+1
-0
No files found.
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/SXLI.cpp
View file @
59d75ed1
...
@@ -72,14 +72,21 @@ void SXLI::readFields(CFRecord& record)
...
@@ -72,14 +72,21 @@ void SXLI::readFields(CFRecord& record)
item
.
fGrand
=
GETBIT
(
flags
,
11
);
item
.
fGrand
=
GETBIT
(
flags
,
11
);
item
.
fMultiDataOnAxis
=
GETBIT
(
flags
,
12
);
item
.
fMultiDataOnAxis
=
GETBIT
(
flags
,
12
);
//if (!item.fGrand && item.itmType != 0x000E)
if
(
item
.
fGrand
)
item
.
isxviMac
=
1
;
if
(
item
.
cSic
>
item
.
isxviMac
)
item
.
cSic
=
item
.
isxviMac
;
if
(
item
.
fSbt
&&
item
.
itmType
<
0x000D
)
item
.
isxviMac
++
;
for
(
short
i
=
0
;
i
<
item
.
isxviMac
;
i
++
)
{
{
for
(
short
i
=
0
;
i
<
item
.
isxviMac
;
i
++
)
short
val
;
record
>>
val
;
{
item
.
rgisxvi
.
push_back
(
val
);
short
val
;
record
>>
val
;
item
.
rgisxvi
.
push_back
(
val
);
}
}
}
m_arItems
.
push_back
(
item
);
m_arItems
.
push_back
(
item
);
}
}
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/Xnum.h
View file @
59d75ed1
...
@@ -57,7 +57,7 @@ public:
...
@@ -57,7 +57,7 @@ public:
unsigned
char
Byte4
;
unsigned
char
Byte4
;
unsigned
short
type
;
unsigned
short
type
;
unsigned
short
fExprO
;
unsigned
short
fExprO
;
};
}
bytes
;
double
value
;
double
value
;
}
data
;
}
data
;
};
};
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/FDB.cpp
View file @
59d75ed1
...
@@ -78,6 +78,7 @@ FDB::FDB()
...
@@ -78,6 +78,7 @@ FDB::FDB()
bDate
=
false
;
bDate
=
false
;
bNumber
=
false
;
bNumber
=
false
;
bEmpty
=
false
;
bEmpty
=
false
;
bInteger
=
false
;
}
}
FDB
::~
FDB
()
FDB
::~
FDB
()
...
@@ -164,6 +165,7 @@ const bool FDB::loadContent(BinProcessor& proc)
...
@@ -164,6 +165,7 @@ const bool FDB::loadContent(BinProcessor& proc)
bDate
|=
operatr
->
bDate
;
bDate
|=
operatr
->
bDate
;
bNumber
|=
operatr
->
bNumber
;
bNumber
|=
operatr
->
bNumber
;
bEmpty
|=
operatr
->
bEmpty
;
bEmpty
|=
operatr
->
bEmpty
;
bInteger
|=
operatr
->
bInteger
;
}
}
return
true
;
return
true
;
...
@@ -186,7 +188,7 @@ int FDB::serialize(std::wostream & strm)
...
@@ -186,7 +188,7 @@ int FDB::serialize(std::wostream & strm)
{
{
CP_XML_ATTR
(
L"numFmtId"
,
fdb_type
->
wTypeSql
);
CP_XML_ATTR
(
L"numFmtId"
,
fdb_type
->
wTypeSql
);
}
}
if
(
m_arSRCSXOPER
.
empty
())
if
(
m_arSRCSXOPER
.
empty
()
&&
m_arGRPSXOPER
.
empty
()
==
false
)
{
{
CP_XML_ATTR
(
L"databaseField"
,
0
);
CP_XML_ATTR
(
L"databaseField"
,
0
);
}
}
...
@@ -234,6 +236,11 @@ int FDB::serialize(std::wostream & strm)
...
@@ -234,6 +236,11 @@ int FDB::serialize(std::wostream & strm)
// CP_XML_ATTR(L"containsString", 0);
// CP_XML_ATTR(L"containsString", 0);
// }
// }
//}
//}
if
(
bInteger
)
{
if
(
bNumber
)
bInteger
=
false
;
else
bNumber
=
true
;
}
if
((
bDate
&
bNumber
)
||
(
bNumber
&
bString
))
if
((
bDate
&
bNumber
)
||
(
bNumber
&
bString
))
{
{
CP_XML_ATTR
(
L"containsSemiMixedTypes"
,
1
);
CP_XML_ATTR
(
L"containsSemiMixedTypes"
,
1
);
...
@@ -250,6 +257,7 @@ int FDB::serialize(std::wostream & strm)
...
@@ -250,6 +257,7 @@ int FDB::serialize(std::wostream & strm)
if
(
bDate
)
CP_XML_ATTR
(
L"containsDate"
,
1
);
if
(
bDate
)
CP_XML_ATTR
(
L"containsDate"
,
1
);
if
(
!
bString
)
CP_XML_ATTR
(
L"containsString"
,
0
);
if
(
!
bString
)
CP_XML_ATTR
(
L"containsString"
,
0
);
if
(
bEmpty
)
CP_XML_ATTR
(
L"containsBlank"
,
1
);
if
(
bEmpty
)
CP_XML_ATTR
(
L"containsBlank"
,
1
);
if
(
bInteger
)
CP_XML_ATTR
(
L"containsInteger"
,
1
);
if
(
fdb
->
fnumMinMaxValid
)
if
(
fdb
->
fnumMinMaxValid
)
{
{
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/FDB.h
View file @
59d75ed1
...
@@ -64,6 +64,7 @@ public:
...
@@ -64,6 +64,7 @@ public:
bool
bDate
;
bool
bDate
;
bool
bNumber
;
bool
bNumber
;
bool
bEmpty
;
bool
bEmpty
;
bool
bInteger
;
};
};
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/PIVOTLI.cpp
View file @
59d75ed1
...
@@ -95,7 +95,12 @@ int PIVOTLI::serialize(std::wostream & strm)
...
@@ -95,7 +95,12 @@ int PIVOTLI::serialize(std::wostream & strm)
case
0x000E
:
CP_XML_ATTR
(
L"t"
,
L"blank"
);
break
;
case
0x000E
:
CP_XML_ATTR
(
L"t"
,
L"blank"
);
break
;
}
}
for
(
size_t
j
=
0
;
j
<
line_items
->
m_arItems
[
i
].
rgisxvi
.
size
();
j
++
)
if
(
line_items
->
m_arItems
[
i
].
cSic
>
0
&&
line_items
->
m_arItems
[
i
].
itmType
==
0
)
//??
{
CP_XML_ATTR
(
L"r"
,
line_items
->
m_arItems
[
i
].
cSic
);
}
for
(
size_t
j
=
line_items
->
m_arItems
[
i
].
cSic
;
j
<
line_items
->
m_arItems
[
i
].
rgisxvi
.
size
();
j
++
)
{
{
CP_XML_NODE
(
L"x"
)
CP_XML_NODE
(
L"x"
)
{
{
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/PIVOTVD.cpp
View file @
59d75ed1
...
@@ -106,7 +106,6 @@ int PIVOTVD::serialize(std::wostream & strm)
...
@@ -106,7 +106,6 @@ int PIVOTVD::serialize(std::wostream & strm)
if
(
vd
->
fCounta
)
CP_XML_ATTR
(
L"countASubtotal"
,
1
);
if
(
vd
->
fCounta
)
CP_XML_ATTR
(
L"countASubtotal"
,
1
);
if
(
vd
->
fCount
)
CP_XML_ATTR
(
L"countSubtotal"
,
1
);
if
(
vd
->
fCount
)
CP_XML_ATTR
(
L"countSubtotal"
,
1
);
if
(
vd
->
fDefault
)
CP_XML_ATTR
(
L"defaultSubtotal"
,
1
);
if
(
vd
->
fSum
)
CP_XML_ATTR
(
L"sumSubtotal"
,
1
);
if
(
vd
->
fSum
)
CP_XML_ATTR
(
L"sumSubtotal"
,
1
);
if
(
vd
->
fAverage
)
CP_XML_ATTR
(
L"avgSubtotal"
,
1
);
if
(
vd
->
fAverage
)
CP_XML_ATTR
(
L"avgSubtotal"
,
1
);
if
(
vd
->
fMax
)
CP_XML_ATTR
(
L"maxSubtotal"
,
1
);
if
(
vd
->
fMax
)
CP_XML_ATTR
(
L"maxSubtotal"
,
1
);
...
@@ -147,6 +146,7 @@ int PIVOTVD::serialize(std::wostream & strm)
...
@@ -147,6 +146,7 @@ int PIVOTVD::serialize(std::wostream & strm)
{
{
CP_XML_ATTR
(
L"rankBy"
,
vd_ex
->
isxdiAutoShow
);
CP_XML_ATTR
(
L"rankBy"
,
vd_ex
->
isxdiAutoShow
);
}
}
if
(
!
vd
->
fDefault
)
CP_XML_ATTR
(
L"defaultSubtotal"
,
0
);
if
(
!
m_arSXVI
.
empty
())
if
(
!
m_arSXVI
.
empty
())
{
{
CP_XML_NODE
(
L"items"
)
CP_XML_NODE
(
L"items"
)
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/PIVOTVIEW.cpp
View file @
59d75ed1
...
@@ -137,7 +137,7 @@ int PIVOTVIEW::serialize(std::wostream & strm)
...
@@ -137,7 +137,7 @@ int PIVOTVIEW::serialize(std::wostream & strm)
core
->
m_arPIVOTVD
[
i
]
->
serialize
(
CP_XML_STREAM
());
core
->
m_arPIVOTVD
[
i
]
->
serialize
(
CP_XML_STREAM
());
}
}
}
}
if
(
core
->
m_arPIVOTIVD
.
size
()
==
2
)
//0 or 2
if
(
core
->
m_arPIVOTIVD
.
size
()
>=
1
)
{
{
CP_XML_NODE
(
L"rowFields"
)
CP_XML_NODE
(
L"rowFields"
)
{
{
...
@@ -147,7 +147,7 @@ int PIVOTVIEW::serialize(std::wostream & strm)
...
@@ -147,7 +147,7 @@ int PIVOTVIEW::serialize(std::wostream & strm)
ivd
->
serialize
(
CP_XML_STREAM
());
ivd
->
serialize
(
CP_XML_STREAM
());
}
}
}
}
if
(
core
->
m_arPIVOTLI
.
size
()
==
2
)
//0 or 2
if
(
core
->
m_arPIVOTLI
.
size
()
>=
1
)
//0 or 2
{
{
CP_XML_NODE
(
L"rowItems"
)
CP_XML_NODE
(
L"rowItems"
)
{
{
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/SXOPER.cpp
View file @
59d75ed1
...
@@ -47,6 +47,7 @@ SXOPER::SXOPER()
...
@@ -47,6 +47,7 @@ SXOPER::SXOPER()
bDate
=
false
;
bDate
=
false
;
bNumber
=
false
;
bNumber
=
false
;
bEmpty
=
false
;
bEmpty
=
false
;
bInteger
=
false
;
}
}
SXOPER
::~
SXOPER
()
SXOPER
::~
SXOPER
()
...
@@ -67,7 +68,16 @@ const bool SXOPER::loadContent(BinProcessor& proc)
...
@@ -67,7 +68,16 @@ const bool SXOPER::loadContent(BinProcessor& proc)
}
}
else
if
(
proc
.
optional
<
SXNum
>
())
else
if
(
proc
.
optional
<
SXNum
>
())
{
{
bNumber
=
true
;
SXNum
*
num
=
dynamic_cast
<
SXNum
*>
(
elements_
.
back
().
get
());
if
(
num
)
{
bInteger
=
(
num
->
num
.
data
.
bytes
.
Byte1
==
num
->
num
.
data
.
bytes
.
Byte2
&&
num
->
num
.
data
.
bytes
.
Byte2
==
num
->
num
.
data
.
bytes
.
Byte3
&&
num
->
num
.
data
.
bytes
.
Byte3
==
num
->
num
.
data
.
bytes
.
Byte4
&&
num
->
num
.
data
.
bytes
.
Byte4
==
0
);
}
bNumber
=
!
bInteger
;
}
}
else
if
(
proc
.
optional
<
SxBool
>
())
else
if
(
proc
.
optional
<
SxBool
>
())
{
{
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/SXOPER.h
View file @
59d75ed1
...
@@ -57,6 +57,7 @@ public:
...
@@ -57,6 +57,7 @@ public:
bool
bDate
;
bool
bDate
;
bool
bNumber
;
bool
bNumber
;
bool
bEmpty
;
bool
bEmpty
;
bool
bInteger
;
};
};
}
// namespace XLS
}
// namespace XLS
...
...
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