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
3044d112
Commit
3044d112
authored
Oct 06, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OdfFormatReader - fix pilot tables (groups & references)
parent
fb00ba7e
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
527 additions
and
135 deletions
+527
-135
ASCOfficeOdfFile/src/docx/xlsx_pivots_context.cpp
ASCOfficeOdfFile/src/docx/xlsx_pivots_context.cpp
+474
-129
ASCOfficeOdfFile/src/docx/xlsx_pivots_context.h
ASCOfficeOdfFile/src/docx/xlsx_pivots_context.h
+16
-2
ASCOfficeOdfFile/src/odf/table_data_pilot_tables.cpp
ASCOfficeOdfFile/src/odf/table_data_pilot_tables.cpp
+36
-4
ASCOfficeOdfFile/src/odf/table_data_pilot_tables.h
ASCOfficeOdfFile/src/odf/table_data_pilot_tables.h
+1
-0
No files found.
ASCOfficeOdfFile/src/docx/xlsx_pivots_context.cpp
View file @
3044d112
This diff is collapsed.
Click to expand it.
ASCOfficeOdfFile/src/docx/xlsx_pivots_context.h
View file @
3044d112
...
@@ -51,6 +51,7 @@ public:
...
@@ -51,6 +51,7 @@ public:
void
start_field
();
void
start_field
();
void
set_field_name
(
std
::
wstring
name
);
void
set_field_name
(
std
::
wstring
name
);
void
set_field_display
(
std
::
wstring
name
);
void
set_field_type
(
int
type
,
int
hierarchy
);
void
set_field_type
(
int
type
,
int
hierarchy
);
void
set_field_function
(
int
type
);
void
set_field_function
(
int
type
);
void
set_field_user_function
(
std
::
wstring
f
);
void
set_field_user_function
(
std
::
wstring
f
);
...
@@ -59,9 +60,22 @@ public:
...
@@ -59,9 +60,22 @@ public:
void
set_field_show_empty
(
bool
val
);
void
set_field_show_empty
(
bool
val
);
void
set_field_data_layout
(
bool
val
);
void
set_field_data_layout
(
bool
val
);
void
set_field_sort
(
int
type
);
void
set_field_sort
(
int
type
);
void
set_repeat_item_labels
(
bool
val
);
void
set_field_groups
(
int
type
);
void
set_field_groups
(
int
type
);
void
set_field_groups_source
(
std
::
wstring
name
);
void
set_field_groups_source
(
std
::
wstring
name
);
void
set_repeat_item_labels
(
bool
val
);
void
start_field_group
();
void
set_field_group_name
(
std
::
wstring
name
);
void
end_field_group
();
void
start_field_reference
();
void
set_field_ref_name
(
std
::
wstring
name
);
void
set_field_ref_type
(
int
type
);
void
set_field_ref_member_name
(
std
::
wstring
name
);
void
set_field_ref_member_type
(
int
type
);
void
end_field_reference
();
void
end_field
();
void
end_field
();
int
get_count
();
int
get_count
();
...
@@ -73,6 +87,7 @@ public:
...
@@ -73,6 +87,7 @@ public:
void
add_button_header
(
std
::
wstring
ref
);
void
add_button_header
(
std
::
wstring
ref
);
void
set_identify_categories
(
bool
val
);
void
set_identify_categories
(
bool
val
);
void
set_ignore_empty_rows
(
bool
val
);
void
set_drill
(
bool
val
);
void
set_drill
(
bool
val
);
void
set_source_range
(
std
::
wstring
table_name
,
std
::
wstring
ref
);
void
set_source_range
(
std
::
wstring
table_name
,
std
::
wstring
ref
);
...
@@ -98,7 +113,6 @@ public:
...
@@ -98,7 +113,6 @@ public:
private:
private:
class
Impl
;
class
Impl
;
_CP_PTR
(
Impl
)
impl_
;
_CP_PTR
(
Impl
)
impl_
;
};
};
}
}
...
...
ASCOfficeOdfFile/src/odf/table_data_pilot_tables.cpp
View file @
3044d112
...
@@ -123,6 +123,9 @@ void table_data_pilot_table::xlsx_convert(oox::xlsx_conversion_context & Context
...
@@ -123,6 +123,9 @@ void table_data_pilot_table::xlsx_convert(oox::xlsx_conversion_context & Context
if
(
table_identify_categories_
)
if
(
table_identify_categories_
)
Context
.
get_pivots_context
().
set_identify_categories
(
table_identify_categories_
->
get
());
Context
.
get_pivots_context
().
set_identify_categories
(
table_identify_categories_
->
get
());
if
(
table_ignore_empty_rows_
)
Context
.
get_pivots_context
().
set_ignore_empty_rows
(
table_ignore_empty_rows_
->
get
());
if
(
table_drill_down_ondouble_click_
)
if
(
table_drill_down_ondouble_click_
)
Context
.
get_pivots_context
().
set_drill
(
table_drill_down_ondouble_click_
->
get
());
Context
.
get_pivots_context
().
set_drill
(
table_drill_down_ondouble_click_
->
get
());
...
@@ -155,6 +158,7 @@ void table_data_pilot_field::add_attributes( const xml::attributes_wc_ptr & Attr
...
@@ -155,6 +158,7 @@ void table_data_pilot_field::add_attributes( const xml::attributes_wc_ptr & Attr
CP_APPLY_ATTR
(
L"loext:ignore-selected-page"
,
loext_ignore_selected_page_
);
CP_APPLY_ATTR
(
L"loext:ignore-selected-page"
,
loext_ignore_selected_page_
);
CP_APPLY_ATTR
(
L"table:selected-page"
,
table_selected_page_
);
CP_APPLY_ATTR
(
L"table:selected-page"
,
table_selected_page_
);
CP_APPLY_ATTR
(
L"table:is-data-layout-field"
,
table_is_data_layout_field_
);
CP_APPLY_ATTR
(
L"table:is-data-layout-field"
,
table_is_data_layout_field_
);
CP_APPLY_ATTR
(
L"tableooo:display-name"
,
table_display_name_
);
}
}
void
table_data_pilot_field
::
add_child_element
(
xml
::
sax
*
Reader
,
const
std
::
wstring
&
Ns
,
const
std
::
wstring
&
Name
)
void
table_data_pilot_field
::
add_child_element
(
xml
::
sax
*
Reader
,
const
std
::
wstring
&
Ns
,
const
std
::
wstring
&
Name
)
...
@@ -175,6 +179,9 @@ void table_data_pilot_field::xlsx_convert(oox::xlsx_conversion_context & Context
...
@@ -175,6 +179,9 @@ void table_data_pilot_field::xlsx_convert(oox::xlsx_conversion_context & Context
Context
.
get_pivots_context
().
set_field_name
(
table_source_field_name_
.
get_value_or
(
L""
));
Context
.
get_pivots_context
().
set_field_name
(
table_source_field_name_
.
get_value_or
(
L""
));
if
(
table_display_name_
)
Context
.
get_pivots_context
().
set_field_display
(
*
table_display_name_
);
if
(
table_is_data_layout_field_
)
if
(
table_is_data_layout_field_
)
Context
.
get_pivots_context
().
set_field_data_layout
(
table_is_data_layout_field_
->
get
());
Context
.
get_pivots_context
().
set_field_data_layout
(
table_is_data_layout_field_
->
get
());
...
@@ -217,7 +224,24 @@ void table_data_pilot_field_reference::add_attributes( const xml::attributes_wc_
...
@@ -217,7 +224,24 @@ void table_data_pilot_field_reference::add_attributes( const xml::attributes_wc_
void
table_data_pilot_field_reference
::
xlsx_convert
(
oox
::
xlsx_conversion_context
&
Context
)
void
table_data_pilot_field_reference
::
xlsx_convert
(
oox
::
xlsx_conversion_context
&
Context
)
{
{
Context
.
get_pivots_context
().
start_field_reference
();
if
(
table_field_name_
)
{
Context
.
get_pivots_context
().
set_field_ref_name
(
*
table_field_name_
);
}
if
(
table_type_
)
{
Context
.
get_pivots_context
().
set_field_ref_type
(
table_type_
->
get_type
());
}
if
(
table_member_name_
)
{
Context
.
get_pivots_context
().
set_field_ref_member_name
(
*
table_member_name_
);
}
if
(
table_member_type_
)
{
Context
.
get_pivots_context
().
set_field_ref_member_type
(
table_member_type_
->
get_type
());
}
Context
.
get_pivots_context
().
end_field_reference
();
}
}
//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
const
wchar_t
*
table_database_source_table
::
ns
=
L"table"
;
const
wchar_t
*
table_database_source_table
::
ns
=
L"table"
;
...
@@ -405,6 +429,8 @@ void table_data_pilot_groups::xlsx_convert(oox::xlsx_conversion_context & Contex
...
@@ -405,6 +429,8 @@ void table_data_pilot_groups::xlsx_convert(oox::xlsx_conversion_context & Contex
{
{
if
(
table_grouped_by_
)
if
(
table_grouped_by_
)
Context
.
get_pivots_context
().
set_field_groups
(
table_grouped_by_
->
get_type
());
Context
.
get_pivots_context
().
set_field_groups
(
table_grouped_by_
->
get_type
());
else
Context
.
get_pivots_context
().
set_field_groups
(
7
);
if
(
table_source_field_name_
)
if
(
table_source_field_name_
)
Context
.
get_pivots_context
().
set_field_groups_source
(
*
table_source_field_name_
);
Context
.
get_pivots_context
().
set_field_groups_source
(
*
table_source_field_name_
);
...
@@ -429,10 +455,16 @@ void table_data_pilot_group::add_child_element( xml::sax * Reader, const std::ws
...
@@ -429,10 +455,16 @@ void table_data_pilot_group::add_child_element( xml::sax * Reader, const std::ws
}
}
void
table_data_pilot_group
::
xlsx_convert
(
oox
::
xlsx_conversion_context
&
Context
)
void
table_data_pilot_group
::
xlsx_convert
(
oox
::
xlsx_conversion_context
&
Context
)
{
{
Context
.
get_pivots_context
().
start_field_group
();
if
(
table_name_
)
Context
.
get_pivots_context
().
set_field_group_name
(
*
table_name_
);
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
{
content_
[
i
]
->
xlsx_convert
(
Context
);
content_
[
i
]
->
xlsx_convert
(
Context
);
}
}
Context
.
get_pivots_context
().
end_field_group
();
}
}
//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
const
wchar_t
*
table_data_pilot_members
::
ns
=
L"table"
;
const
wchar_t
*
table_data_pilot_members
::
ns
=
L"table"
;
...
@@ -475,7 +507,7 @@ void table_data_pilot_group_member::add_attributes( const xml::attributes_wc_ptr
...
@@ -475,7 +507,7 @@ void table_data_pilot_group_member::add_attributes( const xml::attributes_wc_ptr
void
table_data_pilot_group_member
::
xlsx_convert
(
oox
::
xlsx_conversion_context
&
Context
)
void
table_data_pilot_group_member
::
xlsx_convert
(
oox
::
xlsx_conversion_context
&
Context
)
{
{
Context
.
get_pivots_context
().
add_field_cache
(
-
1
,
table_name_
.
get_value_or
(
L""
));
}
}
//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
const
wchar_t
*
table_data_pilot_subtotals
::
ns
=
L"table"
;
const
wchar_t
*
table_data_pilot_subtotals
::
ns
=
L"table"
;
...
...
ASCOfficeOdfFile/src/odf/table_data_pilot_tables.h
View file @
3044d112
...
@@ -130,6 +130,7 @@ public:
...
@@ -130,6 +130,7 @@ public:
_CP_OPT
(
odf_types
::
Bool
)
loext_ignore_selected_page_
;
_CP_OPT
(
odf_types
::
Bool
)
loext_ignore_selected_page_
;
_CP_OPT
(
std
::
wstring
)
table_selected_page_
;
_CP_OPT
(
std
::
wstring
)
table_selected_page_
;
_CP_OPT
(
odf_types
::
Bool
)
table_is_data_layout_field_
;
_CP_OPT
(
odf_types
::
Bool
)
table_is_data_layout_field_
;
_CP_OPT
(
std
::
wstring
)
table_display_name_
;
office_element_ptr
reference_
;
office_element_ptr
reference_
;
office_element_ptr
level_
;
office_element_ptr
level_
;
...
...
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