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
b2184f71
Commit
b2184f71
authored
Aug 31, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug after testing
parent
3a10eabf
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
46 additions
and
22 deletions
+46
-22
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgSxName.cpp
...ile2/source/XlsFormat/Logic/Biff_structures/PtgSxName.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/PIVOTCACHEDEFINITION.cpp
...urce/XlsFormat/Logic/Biff_unions/PIVOTCACHEDEFINITION.cpp
+8
-6
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
+13
-4
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/PIVOTVIEW.h
...ceXlsFile2/source/XlsFormat/Logic/Biff_unions/PIVOTVIEW.h
+3
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/GlobalWorkbookInfo.h
...fficeXlsFile2/source/XlsFormat/Logic/GlobalWorkbookInfo.h
+3
-1
ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp
ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp
+4
-3
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_pivots_context.cpp
...eXlsFile2/source/XlsXlsxConverter/xlsx_pivots_context.cpp
+12
-4
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_pivots_context.h
...iceXlsFile2/source/XlsXlsxConverter/xlsx_pivots_context.h
+1
-1
No files found.
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgSxName.cpp
View file @
b2184f71
...
...
@@ -77,7 +77,7 @@ void PtgSxName::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, bool f
SXPair
*
pair
=
dynamic_cast
<
SXPair
*>
(
global_info
->
arPivotSxNames
[
sxIndex
].
pair
[
0
].
get
());
if
(
pair
)
{
std
::
map
<
int
,
BaseObjectPtr
>::
iterator
pFind
=
global_info
->
mapPivotCache
.
find
(
global_info
->
idPivotCache
);
std
::
unordered_
map
<
int
,
BaseObjectPtr
>::
iterator
pFind
=
global_info
->
mapPivotCache
.
find
(
global_info
->
idPivotCache
);
if
(
pFind
!=
global_info
->
mapPivotCache
.
end
())
{
PIVOTCACHE
*
pivot_cache
=
dynamic_cast
<
PIVOTCACHE
*>
(
pFind
->
second
.
get
());
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/PIVOTCACHEDEFINITION.cpp
View file @
b2184f71
...
...
@@ -98,7 +98,7 @@ int PIVOTCACHEDEFINITION::serialize_definitions(std::wostream & strm)
SXStreamID
*
streamId
=
dynamic_cast
<
SXStreamID
*>
(
m_SXStreamID
.
get
());
if
(
!
streamId
)
return
0
;
std
::
map
<
int
,
BaseObjectPtr
>::
iterator
pFind
=
global_info_
->
mapPivotCache
.
find
(
streamId
->
idStm
);
std
::
unordered_
map
<
int
,
BaseObjectPtr
>::
iterator
pFind
=
global_info_
->
mapPivotCache
.
find
(
streamId
->
idStm
);
if
(
pFind
==
global_info_
->
mapPivotCache
.
end
())
return
0
;
global_info_
->
idPivotCache
=
streamId
->
idStm
;
...
...
@@ -124,13 +124,15 @@ int PIVOTCACHEDEFINITION::serialize_definitions(std::wostream & strm)
{
CP_XML_ATTR
(
L"r:id"
,
L"rId1"
);
}
else
{
CP_XML_ATTR
(
L"saveData"
,
0
);
}
CP_XML_ATTR
(
L"enableRefresh"
,
1
);
CP_XML_ATTR
(
L"refreshedBy"
,
db
->
rgb
.
value
());
CP_XML_ATTR
(
L"refreshedDate"
,
db_ex
->
numDate
.
data
.
value
);
CP_XML_ATTR
(
L"recordCount"
,
db
->
crdbdb
);
//createdVersion="1"
//refreshedVersion="2"
//upgradeOnRefresh="1">
//upgradeOnRefresh="1"
SXSRC
*
src
=
dynamic_cast
<
SXSRC
*>
(
m_SXSRC
.
get
());
if
(
src
)
{
...
...
@@ -167,7 +169,7 @@ int PIVOTCACHEDEFINITION::serialize_definitions(std::wostream & strm)
}
}
}
return
0
;
return
global_info_
->
idPivotCache
;
}
...
...
@@ -176,7 +178,7 @@ int PIVOTCACHEDEFINITION::serialize_records(std::wostream & strm)
SXStreamID
*
streamId
=
dynamic_cast
<
SXStreamID
*>
(
m_SXStreamID
.
get
());
if
(
!
streamId
)
return
0
;
std
::
map
<
int
,
BaseObjectPtr
>::
iterator
pFind
=
global_info_
->
mapPivotCache
.
find
(
streamId
->
idStm
);
std
::
unordered_
map
<
int
,
BaseObjectPtr
>::
iterator
pFind
=
global_info_
->
mapPivotCache
.
find
(
streamId
->
idStm
);
if
(
pFind
==
global_info_
->
mapPivotCache
.
end
())
return
0
;
PIVOTCACHE
*
pivot_cache
=
dynamic_cast
<
PIVOTCACHE
*>
(
pFind
->
second
.
get
());
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/PIVOTVD.cpp
View file @
b2184f71
...
...
@@ -99,7 +99,7 @@ int PIVOTVD::serialize(std::wostream & strm)
if
(
vd_ex
->
ifmt
>
0
)
{
CP_XML_ATTR
(
L"numFmtId"
,
vd_ex
->
ifmt
);
CP_XML_ATTR
(
L"numFmtId"
,
vd_ex
->
ifmt
!=
44
?
vd_ex
->
ifmt
:
0
);
}
if
(
vd
->
stName
.
value
().
empty
()
==
false
)
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/PIVOTVIEW.cpp
View file @
b2184f71
...
...
@@ -49,7 +49,7 @@ namespace XLS
PIVOTVIEW
::
PIVOTVIEW
()
{
index
Cache
=
-
1
;
index
=
-
1
;
}
PIVOTVIEW
::~
PIVOTVIEW
()
...
...
@@ -64,6 +64,8 @@ BaseObjectPtr PIVOTVIEW::clone()
// PIVOTVIEW = PIVOTCORE [PIVOTFRT]
const
bool
PIVOTVIEW
::
loadContent
(
BinProcessor
&
proc
)
{
global_info_
=
proc
.
getGlobalWorkbookInfo
();
if
(
!
proc
.
mandatory
<
PIVOTCORE
>
())
{
return
false
;
...
...
@@ -100,7 +102,12 @@ int PIVOTVIEW::serialize(std::wostream & strm)
PIVOTADDL
*
addls
=
frt
?
dynamic_cast
<
PIVOTADDL
*>
(
frt
->
m_PIVOTADDL
.
get
())
:
NULL
;
indexCache
=
view
->
iCache
;
std
::
unordered_map
<
int
,
BaseObjectPtr
>::
iterator
pFind
=
global_info_
->
mapPivotCache
.
begin
();
for
(
int
i
=
0
;
i
<
view
->
iCache
;
i
++
)
pFind
++
;
index
=
pFind
->
first
;
CP_XML_WRITER
(
strm
)
{
...
...
@@ -137,7 +144,7 @@ int PIVOTVIEW::serialize(std::wostream & strm)
CP_XML_ATTR
(
L"firstHeaderRow"
,
view
->
rwFirstHead
-
view
->
ref
.
rowFirst
);
CP_XML_ATTR
(
L"firstDataRow"
,
view
->
rwFirstData
-
view
->
ref
.
rowFirst
);
CP_XML_ATTR
(
L"firstDataCol"
,
view
->
colFirstData
-
view
->
ref
.
columnFirst
);
CP_XML_ATTR
(
L"rowPageCount"
,
1
);
CP_XML_ATTR
(
L"rowPageCount"
,
view
->
cDimPg
>
0
?
view
->
cDimPg
:
1
);
CP_XML_ATTR
(
L"colPageCount"
,
1
);
}
CP_XML_NODE
(
L"pivotFields"
)
...
...
@@ -215,7 +222,9 @@ int PIVOTVIEW::serialize(std::wostream & strm)
SXAddl_SXCView_SXDTableStyleClient
*
table_style
=
dynamic_cast
<
SXAddl_SXCView_SXDTableStyleClient
*>
(
addls
->
m_SXAddl_SXCView_SXDTableStyleClient
.
get
());
CP_XML_NODE
(
L"pivotTableStyleInfo"
)
{
CP_XML_ATTR
(
L"name"
,
table_style
->
stName
.
value
());
if
(
!
table_style
->
stName
.
value
().
empty
())
CP_XML_ATTR
(
L"name"
,
table_style
->
stName
.
value
());
CP_XML_ATTR
(
L"showRowHeaders"
,
table_style
->
fRowHeaders
);
CP_XML_ATTR
(
L"showColHeaders"
,
table_style
->
fColumnHeaders
);
CP_XML_ATTR
(
L"showRowStripes"
,
table_style
->
fRowStrips
);
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/PIVOTVIEW.h
View file @
b2184f71
...
...
@@ -54,8 +54,10 @@ public:
BaseObjectPtr
m_PIVOTCORE
;
BaseObjectPtr
m_PIVOTFRT
;
//----------------------------------
int
index
Cache
;
int
index
;
std
::
wstring
name
;
GlobalWorkbookInfoPtr
global_info_
;
};
}
// namespace XLS
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/GlobalWorkbookInfo.h
View file @
b2184f71
...
...
@@ -35,6 +35,7 @@
#include <boost/smart_ptr/shared_array.hpp>
#include <vector>
#include <map>
#include <unordered_map>
#include "Biff_structures/BorderFillInfo.h"
...
...
@@ -106,7 +107,8 @@ public:
const
static
unsigned
int
initial_AXES_id
=
0x2000000
;
short
idPivotCache
;
std
::
map
<
int
,
BaseObjectPtr
>
mapPivotCache
;
std
::
unordered_map
<
int
,
BaseObjectPtr
>
mapPivotCache
;
std
::
vector
<
bool
>
arPivotCacheFields
;
std
::
vector
<
bool
>
arPivotCacheFieldShortSize
;
...
...
ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp
View file @
b2184f71
...
...
@@ -1924,7 +1924,8 @@ void XlsConverter::convert(XLS::PIVOTVIEW * pivot_view)
pivot_view
->
serialize
(
strm
);
int
index_view
=
xlsx_context
->
get_pivots_context
().
add_view
(
strm
.
str
(),
pivot_view
->
indexCache
);
int
index_view
=
xlsx_context
->
get_pivots_context
().
add_view
(
strm
.
str
(),
pivot_view
->
index
);
if
(
index_view
>
0
)
{
...
...
@@ -1940,8 +1941,8 @@ void XlsConverter::convert(XLS::PIVOTCACHEDEFINITION * pivot_cached)
std
::
wstringstream
strmD
,
strmR
;
pivot_cached
->
serialize_definitions
(
strmD
);
int
index
=
pivot_cached
->
serialize_definitions
(
strmD
);
pivot_cached
->
serialize_records
(
strmR
);
xlsx_context
->
get_pivots_context
().
add_cache
(
strmD
.
str
(),
strmR
.
str
());
xlsx_context
->
get_pivots_context
().
add_cache
(
strmD
.
str
(),
strmR
.
str
()
,
index
);
}
\ No newline at end of file
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_pivots_context.cpp
View file @
b2184f71
...
...
@@ -34,6 +34,8 @@
#include <boost/make_shared.hpp>
#include <simple_xml_writer.h>
#include <map>
namespace
oox
{
class
xlsx_pivots_context
::
Impl
...
...
@@ -55,16 +57,20 @@ public:
std
::
vector
<
_pivot_cache
>
caches_
;
std
::
vector
<
_pivot_view
>
views_
;
std
::
wstring
connections_
;
std
::
map
<
int
,
int
>
mapIndex_
;
};
xlsx_pivots_context
::
xlsx_pivots_context
()
:
impl_
(
new
xlsx_pivots_context
::
Impl
())
{
}
void
xlsx_pivots_context
::
add_cache
(
std
::
wstring
definitions
,
std
::
wstring
records
)
void
xlsx_pivots_context
::
add_cache
(
std
::
wstring
definitions
,
std
::
wstring
records
,
int
indexCache
)
{
Impl
::
_pivot_cache
c
=
{
definitions
,
records
};
impl_
->
caches_
.
push_back
(
c
);
impl_
->
mapIndex_
.
insert
(
std
::
make_pair
(
indexCache
,
impl_
->
caches_
.
size
()));
}
int
xlsx_pivots_context
::
get_cache_count
()
...
...
@@ -86,11 +92,11 @@ void xlsx_pivots_context::dump_rels_cache(int index, rels & Rels)
}
void
xlsx_pivots_context
::
dump_rels_view
(
int
index
,
rels
&
Rels
)
{
if
(
impl_
->
views_
[
index
].
indexCache_
>
=
0
)
if
(
impl_
->
views_
[
index
].
indexCache_
>
0
)
{
Rels
.
add
(
relationship
(
L"rId1"
,
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition"
,
L"../pivotCache/pivotCacheDefinition"
+
std
::
to_wstring
(
impl_
->
views_
[
index
].
indexCache_
+
1
)
+
L".xml"
,
L""
));
L"../pivotCache/pivotCacheDefinition"
+
std
::
to_wstring
(
impl_
->
views_
[
index
].
indexCache_
)
+
L".xml"
,
L""
));
}
}
void
xlsx_pivots_context
::
write_cache_definitions_to
(
int
index
,
std
::
wostream
&
strm
)
...
...
@@ -122,7 +128,9 @@ int xlsx_pivots_context::add_view(std::wstring table_view, int indexCache)
{
if
(
table_view
.
empty
())
return
0
;
Impl
::
_pivot_view
v
=
{
table_view
,
indexCache
};
std
::
map
<
int
,
int
>::
iterator
pFind
=
impl_
->
mapIndex_
.
find
(
indexCache
);
Impl
::
_pivot_view
v
=
{
table_view
,
pFind
->
second
};
impl_
->
views_
.
push_back
(
v
);
return
(
int
)
impl_
->
views_
.
size
();
...
...
ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_pivots_context.h
View file @
b2184f71
...
...
@@ -46,7 +46,7 @@ public:
int
add_view
(
std
::
wstring
table_view
,
int
indexCache
);
int
get_view_count
();
void
add_cache
(
std
::
wstring
definitions
,
std
::
wstring
records
);
void
add_cache
(
std
::
wstring
definitions
,
std
::
wstring
records
,
int
indexCache
);
int
get_cache_count
();
void
write_cache_definitions_to
(
int
index
,
std
::
wostream
&
strm
);
...
...
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