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
19960fa3
Commit
19960fa3
authored
Apr 04, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OdfFormatWriter - presentation tables
parent
32121d6d
Changes
31
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
1206 additions
and
1186 deletions
+1206
-1186
ASCOfficeOdfFileW/OdfFileWTest/OdfFileWTest.vcproj
ASCOfficeOdfFileW/OdfFileWTest/OdfFileWTest.vcproj
+1
-1
ASCOfficeOdfFileW/linux/OdfFileWriterLib.pro
ASCOfficeOdfFileW/linux/OdfFileWriterLib.pro
+2
-4
ASCOfficeOdfFileW/source/OdfFormat/odf_chart_context.cpp
ASCOfficeOdfFileW/source/OdfFormat/odf_chart_context.cpp
+11
-11
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp
+157
-157
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.h
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.h
+3
-3
ASCOfficeOdfFileW/source/OdfFormat/odf_style_context.cpp
ASCOfficeOdfFileW/source/OdfFormat/odf_style_context.cpp
+3
-3
ASCOfficeOdfFileW/source/OdfFormat/odf_style_state.cpp
ASCOfficeOdfFileW/source/OdfFormat/odf_style_state.cpp
+20
-10
ASCOfficeOdfFileW/source/OdfFormat/odf_style_state.h
ASCOfficeOdfFileW/source/OdfFormat/odf_style_state.h
+9
-6
ASCOfficeOdfFileW/source/OdfFormat/odf_table_context.cpp
ASCOfficeOdfFileW/source/OdfFormat/odf_table_context.cpp
+56
-20
ASCOfficeOdfFileW/source/OdfFormat/odf_table_context.h
ASCOfficeOdfFileW/source/OdfFormat/odf_table_context.h
+1
-1
ASCOfficeOdfFileW/source/OdfFormat/odp_conversion_context.cpp
...fficeOdfFileW/source/OdfFormat/odp_conversion_context.cpp
+5
-6
ASCOfficeOdfFileW/source/OdfFormat/odp_conversion_context.h
ASCOfficeOdfFileW/source/OdfFormat/odp_conversion_context.h
+6
-5
ASCOfficeOdfFileW/source/OdfFormat/odp_slide_context.cpp
ASCOfficeOdfFileW/source/OdfFormat/odp_slide_context.cpp
+171
-5
ASCOfficeOdfFileW/source/OdfFormat/odp_slide_context.h
ASCOfficeOdfFileW/source/OdfFormat/odp_slide_context.h
+22
-2
ASCOfficeOdfFileW/source/OdfFormat/ods_table_context.cpp
ASCOfficeOdfFileW/source/OdfFormat/ods_table_context.cpp
+0
-1
ASCOfficeOdfFileW/source/OdfFormat/odt_conversion_context.h
ASCOfficeOdfFileW/source/OdfFormat/odt_conversion_context.h
+2
-2
ASCOfficeOdfFileW/source/OdfFormat/style_graphic_properties.cpp
...iceOdfFileW/source/OdfFormat/style_graphic_properties.cpp
+68
-2
ASCOfficeOdfFileW/source/OdfFormat/style_graphic_properties.h
...fficeOdfFileW/source/OdfFormat/style_graphic_properties.h
+20
-2
ASCOfficeOdfFileW/source/OdfFormat/styles.cpp
ASCOfficeOdfFileW/source/OdfFormat/styles.cpp
+21
-5
ASCOfficeOdfFileW/source/OdfFormat/styles.h
ASCOfficeOdfFileW/source/OdfFormat/styles.h
+9
-9
ASCOfficeOdfFileW/source/OdfFormat/table.h
ASCOfficeOdfFileW/source/OdfFormat/table.h
+40
-65
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertDrawing.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertDrawing.cpp
+80
-45
ASCOfficeOdfFileW/source/Oox2OdfConverter/Converter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/Converter.cpp
+8
-787
ASCOfficeOdfFileW/source/Oox2OdfConverter/Converter.h
ASCOfficeOdfFileW/source/Oox2OdfConverter/Converter.h
+12
-2
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
+4
-4
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp
+418
-13
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.h
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.h
+22
-5
ASCOfficePPTXFile/PPTXFormat/Logic/Table/TableCellProperties.h
...ficePPTXFile/PPTXFormat/Logic/Table/TableCellProperties.h
+23
-9
Common/DocxFormat/Source/DocxFormat/Logic/Table.h
Common/DocxFormat/Source/DocxFormat/Logic/Table.h
+1
-1
DesktopEditor/xml/include/xmlutils.h
DesktopEditor/xml/include/xmlutils.h
+2
-0
DesktopEditor/xml/src/xmldom.cpp
DesktopEditor/xml/src/xmldom.cpp
+9
-0
No files found.
ASCOfficeOdfFileW/OdfFileWTest/OdfFileWTest.vcproj
View file @
19960fa3
...
...
@@ -43,7 +43,7 @@
<Tool
Name=
"VCCLCompilerTool"
Optimization=
"0"
PreprocessorDefinitions=
"WIN32;_DEBUG;_CONSOLE;
BOOST_EXCEPTION_DISABLE;
USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;__WORDSIZE=32;DONT_WRITE_EMBEDDED_FONTS"
PreprocessorDefinitions=
"WIN32;_DEBUG;_CONSOLE;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;__WORDSIZE=32;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild=
"true"
BasicRuntimeChecks=
"3"
RuntimeLibrary=
"3"
...
...
ASCOfficeOdfFileW/linux/OdfFileWriterLib.pro
View file @
19960fa3
...
...
@@ -105,7 +105,7 @@ SOURCES += \
..
/
source
/
OdfFormat
/
odp_page_state
.
cpp
\
..
/
source
/
OdfFormat
/
odp_slide_context
.
cpp
\
..
/
source
/
OdfFormat
/
office_presentation
.
cpp
\
..
/
source
/
OdfFormat
/
style_presentation
.
cpp
\
..
/
source
/
OdfFormat
/
style_presentation
.
cpp
}
SOURCES
+=
\
...
...
@@ -115,9 +115,7 @@ SOURCES += \
..
/
source
/
Oox2OdfConverter
/
DocxConverter
.
cpp
\
..
/
source
/
Oox2OdfConverter
/
XlsxConverter
.
cpp
\
..
/
source
/
Oox2OdfConverter
/
ConvertDrawing
.
cpp
\
..
/
source
/
Oox2OdfConverter
/
PptxConverter
.
cpp
\
..
/
source
/
OdfFormat
/
anim_elements
.
cpp
\
..
/
source
/
OdfFormat
/
style_presentation
.
cpp
..
/
source
/
Oox2OdfConverter
/
PptxConverter
.
cpp
HEADERS
+=
\
..
/
source
/
OdfFormat
/
abstract_xml
.
h
\
...
...
ASCOfficeOdfFileW/source/OdfFormat/odf_chart_context.cpp
View file @
19960fa3
...
...
@@ -109,7 +109,7 @@ namespace odf_writer
struct
odf_chart_level_state
{
style_text_properties
*
text_properties_
;
style_graphic
_properties
*
graphic_properties_
;
graphic_format
_properties
*
graphic_properties_
;
style_paragraph_properties
*
paragraph_properties_
;
style_chart_properties
*
chart_properties_
;
...
...
@@ -297,8 +297,8 @@ void odf_chart_context::Impl::set_default_series_color()
color
col
=
color
(
default_MS_series_colors
[
current_series_count_
]);
current_level_
.
back
().
graphic_properties_
->
co
ntent_
.
co
mmon_draw_fill_attlist_
.
draw_fill_color_
=
col
;
current_level_
.
back
().
graphic_properties_
->
content_
.
svg_stroke_color_
=
col
;
current_level_
.
back
().
graphic_properties_
->
common_draw_fill_attlist_
.
draw_fill_color_
=
col
;
current_level_
.
back
().
graphic_properties_
->
svg_stroke_color_
=
col
;
}
////////////////////////////////////////////////////////////////////////////
...
...
@@ -641,7 +641,7 @@ void odf_chart_context::start_series(std::wstring type)
if
(
style_
)
{
impl_
->
current_level_
.
back
().
graphic_properties_
=
style_
->
content_
.
get_
style_
graphic_properties
();
impl_
->
current_level_
.
back
().
graphic_properties_
=
style_
->
content_
.
get_graphic_properties
();
impl_
->
set_default_series_color
();
}
...
...
@@ -968,7 +968,7 @@ void odf_chart_context::start_floor()
if
(
style_
)
{
impl_
->
current_level_
.
back
().
graphic_properties_
=
style_
->
content_
.
get_
style_
graphic_properties
();
impl_
->
current_level_
.
back
().
graphic_properties_
=
style_
->
content_
.
get_graphic_properties
();
}
}
void
odf_chart_context
::
start_wall
()
...
...
@@ -993,9 +993,9 @@ void odf_chart_context::start_wall()
if
(
style_
)
{
impl_
->
current_level_
.
back
().
graphic_properties_
=
style_
->
content_
.
get_
style_
graphic_properties
();
impl_
->
current_level_
.
back
().
graphic_properties_
=
style_
->
content_
.
get_graphic_properties
();
if
(
impl_
->
current_level_
.
back
().
graphic_properties_
)
impl_
->
current_level_
.
back
().
graphic_properties_
->
co
ntent_
.
co
mmon_draw_fill_attlist_
.
draw_fill_color_
=
color
(
L"#ffffff"
);
impl_
->
current_level_
.
back
().
graphic_properties_
->
common_draw_fill_attlist_
.
draw_fill_color_
=
color
(
L"#ffffff"
);
}
}
void
odf_chart_context
::
start_legend
()
...
...
@@ -1036,7 +1036,7 @@ void odf_chart_context::start_stock_range_line()
style_name
=
style_
->
style_name_
;
line
->
common_attlist_
.
chart_style_name_
=
style_name
;
impl_
->
current_level_
.
back
().
graphic_properties_
=
style_
->
content_
.
get_
style_
graphic_properties
();
impl_
->
current_level_
.
back
().
graphic_properties_
=
style_
->
content_
.
get_graphic_properties
();
impl_
->
set_default_series_color
();
}
start_element
(
elm
,
style_elm
,
style_name
);
...
...
@@ -1059,7 +1059,7 @@ void odf_chart_context::start_stock_gain_marker()
style_name
=
style_
->
style_name_
;
marker
->
common_attlist_
.
chart_style_name_
=
style_name
;
impl_
->
current_level_
.
back
().
graphic_properties_
=
style_
->
content_
.
get_
style_
graphic_properties
();
impl_
->
current_level_
.
back
().
graphic_properties_
=
style_
->
content_
.
get_graphic_properties
();
impl_
->
set_default_series_color
();
}
start_element
(
elm
,
style_elm
,
style_name
);
...
...
@@ -1082,7 +1082,7 @@ void odf_chart_context::start_stock_loss_marker()
style_name
=
style_
->
style_name_
;
marker
->
common_attlist_
.
chart_style_name_
=
style_name
;
impl_
->
current_level_
.
back
().
graphic_properties_
=
style_
->
content_
.
get_
style_
graphic_properties
();
impl_
->
current_level_
.
back
().
graphic_properties_
=
style_
->
content_
.
get_graphic_properties
();
impl_
->
set_default_series_color
();
}
start_element
(
elm
,
style_elm
,
style_name
);
...
...
@@ -1219,7 +1219,7 @@ void odf_chart_context::set_no_fill(bool Val)
if
(
Val
==
false
)
return
;
if
(
!
impl_
->
current_level_
.
back
().
graphic_properties_
)
return
;
impl_
->
current_level_
.
back
().
graphic_properties_
->
co
ntent_
.
co
mmon_draw_fill_attlist_
.
draw_fill_
=
draw_fill
(
draw_fill
::
none
);
impl_
->
current_level_
.
back
().
graphic_properties_
->
common_draw_fill_attlist_
.
draw_fill_
=
draw_fill
(
draw_fill
::
none
);
}
void
odf_chart_context
::
set_axis_tick_major
(
int
type
)
...
...
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp
View file @
19960fa3
This diff is collapsed.
Click to expand it.
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.h
View file @
19960fa3
...
...
@@ -121,6 +121,9 @@ public:
void
start_shape
(
int
type
);
void
end_shape
();
void
start_frame
();
void
end_frame
();
bool
change_text_box_2_wordart
();
void
start_image
(
std
::
wstring
file_path
);
...
...
@@ -249,9 +252,6 @@ public:
private:
void
start_frame
();
void
end_frame
();
class
Impl
;
_CP_PTR
(
Impl
)
impl_
;
...
...
ASCOfficeOdfFileW/source/OdfFormat/odf_style_context.cpp
View file @
19960fa3
...
...
@@ -102,9 +102,9 @@ void odf_style_context::create_style(std::wstring oox_name, style_family::type f
style_state_list_
.
push_back
(
state
);
///////////////////////////////////////
style_state_list_
.
back
()
->
set_name
(
odf_name
);
style_state_list_
.
back
()
->
set_automatic
(
automatic
);
style_state_list_
.
back
()
->
set_root
(
root
);
style_state_list_
.
back
()
->
set_name
(
odf_name
);
style_state_list_
.
back
()
->
set_automatic
(
automatic
);
style_state_list_
.
back
()
->
set_root
(
root
);
style_state_list_
.
back
()
->
style_oox_id_
=
oox_id
;
...
...
ASCOfficeOdfFileW/source/OdfFormat/odf_style_state.cpp
View file @
19960fa3
...
...
@@ -60,12 +60,14 @@ namespace odf_writer {
if
(
style_
)
{
style_
->
style_family_
=
style_family
(
style_family_
);
style_
->
content_
.
style_family_
=
style_family_
;
}
default_style
*
default_style_
=
dynamic_cast
<
default_style
*>
(
elm
.
get
());
if
(
default_style_
)
{
default_style_
->
style_family_
=
style_family
(
style_family_
);
default_style_
->
content_
.
style_family_
=
style_family_
;
}
list_style_exist
=
false
;
...
...
@@ -112,6 +114,12 @@ style_family::type odf_style_state::get_family_type()
{
return
style_family_
;
}
void
odf_style_state
::
set_family_type
(
odf_types
::
style_family
::
type
type
)
{
style_family_
=
type
;
}
void
odf_style_state
::
set_parent_style_name
(
std
::
wstring
name
)
{
if
(
name
.
length
()
<
1
)
return
;
...
...
@@ -229,16 +237,17 @@ style_paragraph_properties * odf_style_state::get_paragraph_properties()
return
NULL
;
}
style_graphic
_properties
*
odf_style_state
::
get_graphic_properties
()
graphic_format
_properties
*
odf_style_state
::
get_graphic_properties
()
{
style
*
style_
=
dynamic_cast
<
style
*>
(
odf_style_
.
get
());
if
(
style_
)
return
style_
->
content_
.
get_
style_
graphic_properties
();
if
(
style_
)
return
style_
->
content_
.
get_graphic_properties
();
default_style
*
default_style_
=
dynamic_cast
<
default_style
*>
(
odf_style_
.
get
());
if
(
default_style_
)
return
default_style_
->
content_
.
get_
style_
graphic_properties
();
if
(
default_style_
)
return
default_style_
->
content_
.
get_graphic_properties
();
return
NULL
;
}
style_table_properties
*
odf_style_state
::
get_table_properties
()
{
style
*
style_
=
dynamic_cast
<
style
*>
(
odf_style_
.
get
());
...
...
@@ -304,13 +313,14 @@ style_chart_properties * odf_style_state::get_chart_properties()
return
NULL
;
}
//style_drawing_page_properties * odf_style_state::get_drawing_page_properties()
//{
// style* style_ = dynamic_cast<style*>(odf_style_.get());
// if (!style_)return NULL;
//
// return style_->content_.get_style_drawing_page_properties();
//}
style_drawing_page_properties
*
odf_style_state
::
get_drawing_page_properties
()
{
style
*
style_
=
dynamic_cast
<
style
*>
(
odf_style_
.
get
());
if
(
!
style_
)
return
NULL
;
return
style_
->
content_
.
get_style_drawing_page_properties
();
}
///////////////////////
...
...
ASCOfficeOdfFileW/source/OdfFormat/odf_style_state.h
View file @
19960fa3
...
...
@@ -45,16 +45,17 @@ class style;
class
odf_conversion_context
;
class
odf_style_context
;
class
graphic_format_properties
;
class
style_text_properties
;
class
style_paragraph_properties
;
class
style_graphic_properties
;
class
style_table_properties
;
class
style_section_properties
;
class
style_table_cell_properties
;
class
style_table_row_properties
;
class
style_table_column_properties
;
class
style_chart_properties
;
//
class style_drawing_page_properties;
class
style_drawing_page_properties
;
class
odf_style_state
;
typedef
shared_ptr
<
odf_style_state
>::
Type
odf_style_state_ptr
;
...
...
@@ -80,7 +81,8 @@ public:
void
set_name
(
std
::
wstring
name
);
std
::
wstring
get_name
();
odf_types
::
style_family
::
type
get_family_type
();
odf_types
::
style_family
::
type
get_family_type
();
void
set_family_type
(
odf_types
::
style_family
::
type
type
);
void
set_number_format
(
int
id
)
{
num_fmt_id_
=
id
;}
int
get_number_format
()
{
return
num_fmt_id_
;}
...
...
@@ -91,16 +93,17 @@ public:
void
set_display_name
(
std
::
wstring
name
);
//////////////////////////////////////////////////////////////////////////////////////////
style_text_properties
*
get_text_properties
();
graphic_format_properties
*
get_graphic_properties
()
;
style_text_properties
*
get_text_properties
();
style_paragraph_properties
*
get_paragraph_properties
()
;
style_graphic_properties
*
get_graphic_properties
()
;
style_table_properties
*
get_table_properties
();
style_section_properties
*
get_section_properties
();
style_table_cell_properties
*
get_table_cell_properties
();
style_table_row_properties
*
get_table_row_properties
()
;
style_table_column_properties
*
get_table_column_properties
()
;
style_chart_properties
*
get_chart_properties
()
;
//
style_drawing_page_properties* get_drawing_page_properties();
style_drawing_page_properties
*
get_drawing_page_properties
();
bool
get_list_style_exist
();
int
get_list_style_level
();
...
...
ASCOfficeOdfFileW/source/OdfFormat/odf_table_context.cpp
View file @
19960fa3
...
...
@@ -44,10 +44,10 @@
#include "table.h"
#include "style_table_properties.h"
#include "style_graphic_properties.h"
#include "style_text_properties.h"
//#include "style_text_properties.h"
//#include "style_paragraph_properties.h"
//#include "style_graphic_properties.h"
namespace
cpdoccore
...
...
@@ -151,7 +151,9 @@ void odf_table_context::start_table(office_element_ptr &elm, bool styled)
if
(
!
table
)
return
;
odf_table_state
state
;
state
.
table
.
elm
=
elm
;
state
.
table
.
elm
=
elm
;
state
.
default_cell_properties
=
impl_
->
default_cell_properties
;
//write in row default cell props
if
(
styled
)
{
...
...
@@ -160,14 +162,12 @@ void odf_table_context::start_table(office_element_ptr &elm, bool styled)
{
state
.
table
.
style_elm
=
style_state
->
get_office_element
();
state
.
table
.
style_name
=
style_state
->
get_name
();
table
->
table_table_attlist_
.
table_style_name_
=
state
.
table
.
style_name
;
}
}
state
.
default_cell_properties
=
impl_
->
default_cell_properties
;
impl_
->
default_cell_properties
=
L""
;
impl_
->
start_table
(
state
);
}
void
odf_table_context
::
end_table
()
{
...
...
@@ -196,27 +196,31 @@ void odf_table_context::start_row(office_element_ptr &elm, bool styled)
{
if
(
impl_
->
empty
())
return
;
table_table_row
*
row
=
dynamic_cast
<
table_table_row
*>
(
elm
.
get
());
;
table_table_row
*
row
=
dynamic_cast
<
table_table_row
*>
(
elm
.
get
());
if
(
!
row
)
return
;
odf_element_state
state
;
state
.
elm
=
elm
;
if
(
styled
)
{
odf_style_state_ptr
style_state
=
impl_
->
styles_context
()
->
last_state
(
style_family
::
TableRow
);
if
(
style_state
)
{
state
.
style_elm
=
style_state
->
get_office_element
();
state
.
style_name
=
style_state
->
get_name
();
state
.
style_elm
=
style_state
->
get_office_element
();
state
.
style_name
=
style_state
->
get_name
();
row
->
table_table_row_attlist_
.
table_style_name_
=
state
.
style_name
;
}
}
if
(
!
impl_
->
current_table
().
default_cell_properties
.
empty
())
row
->
table_table_row_attlist_
.
table_default_cell_style_name_
=
impl_
->
current_table
().
default_cell_properties
;
impl_
->
current_table
().
rows
.
push_back
(
state
);
impl_
->
current_table
().
current_column
=
0
;
impl_
->
current_table
().
current_column
=
0
;
impl_
->
current_table
().
current_row
++
;
}
...
...
@@ -411,8 +415,9 @@ void odf_table_context::start_cell(office_element_ptr &elm, bool styled)
{
if
(
impl_
->
empty
())
return
;
table_table_cell
*
cell
=
dynamic_cast
<
table_table_cell
*>
(
elm
.
get
());;
table_covered_table_cell
*
covered_cell
=
dynamic_cast
<
table_covered_table_cell
*>
(
elm
.
get
());
table_table_cell
*
cell
=
dynamic_cast
<
table_table_cell
*>
(
elm
.
get
());;
table_covered_table_cell
*
covered_cell
=
dynamic_cast
<
table_covered_table_cell
*>
(
elm
.
get
());
if
(
!
cell
&&
!
covered_cell
)
return
;
odf_element_state
state
;
...
...
@@ -423,10 +428,32 @@ void odf_table_context::start_cell(office_element_ptr &elm, bool styled)
odf_style_state_ptr
style_state
=
impl_
->
styles_context
()
->
last_state
(
style_family
::
TableCell
);
if
(
style_state
)
{
state
.
style_elm
=
style_state
->
get_office_element
();
state
.
style_name
=
style_state
->
get_name
();
state
.
style_elm
=
style_state
->
get_office_element
();
state
.
style_name
=
style_state
->
get_name
();
cell
->
table_table_cell_attlist_
.
table_style_name_
=
state
.
style_name
;
}
if
(
!
impl_
->
current_table
().
default_cell_properties
.
empty
())
{
odf_style_state_ptr
default_style_state
;
impl_
->
styles_context
()
->
find_odf_style_state
(
impl_
->
current_table
().
default_cell_properties
,
style_family
::
TableCell
,
default_style_state
);
if
(
default_style_state
&&
style_state
)
{
graphic_format_properties
*
g
=
style_state
->
get_graphic_properties
()
;
style_text_properties
*
t
=
style_state
->
get_text_properties
();
style_table_cell_properties
*
c
=
style_state
->
get_table_cell_properties
();
graphic_format_properties
*
d_g
=
default_style_state
->
get_graphic_properties
()
;
style_text_properties
*
d_t
=
default_style_state
->
get_text_properties
();
style_table_cell_properties
*
d_c
=
default_style_state
->
get_table_cell_properties
();
if
(
g
&&
d_g
)
g
->
apply_from
(
*
d_g
);
if
(
t
&&
d_t
)
t
->
apply_from
(
d_t
);
if
(
c
&&
d_c
)
c
->
apply_from
(
d_c
);
}
}
}
//if (cell)
//{
...
...
@@ -438,6 +465,7 @@ void odf_table_context::start_cell(office_element_ptr &elm, bool styled)
impl_
->
current_table
().
current_column
++
;
}
void
odf_table_context
::
set_cell_column_span
(
int
spanned
)
{
if
(
impl_
->
empty
())
return
;
...
...
@@ -449,16 +477,24 @@ void odf_table_context::set_cell_column_span(int spanned)
cell
->
table_table_cell_attlist_extra_
.
table_number_columns_spanned_
=
spanned
;
//impl_->current_table().current_column += spanned-1;
//impl_->current_table().current_column += spanned - 1;
}
void
odf_table_context
::
set_cell_row_span
()
void
odf_table_context
::
set_cell_row_span
(
int
spanned
)
{
int
col
=
impl_
->
current_table
().
current_column
-
1
;
odf_column_state
&
state
=
impl_
->
current_table
().
columns
[
col
];
if
(
spanned
>
0
)
{
table_table_cell
*
cell
=
dynamic_cast
<
table_table_cell
*>
(
impl_
->
current_table
().
cells
.
back
().
elm
.
get
());
if
(
cell
)
cell
->
table_table_cell_attlist_extra_
.
table_number_rows_spanned_
=
spanned
;
}
else
{
int
col
=
impl_
->
current_table
().
current_column
-
1
;
odf_column_state
&
state
=
impl_
->
current_table
().
columns
[
col
];
state
.
spanned_row_cell
.
push_back
(
impl_
->
current_table
().
cells
.
back
().
elm
);
state
.
spanned_row_cell
.
push_back
(
impl_
->
current_table
().
cells
.
back
().
elm
);
}
}
void
odf_table_context
::
set_cell_row_span_restart
()
...
...
ASCOfficeOdfFileW/source/OdfFormat/odf_table_context.h
View file @
19960fa3
...
...
@@ -85,7 +85,7 @@ public:
void
start_cell
(
office_element_ptr
&
elm
,
bool
styled
=
false
);
void
set_cell_column_span
(
int
spanned
);
void
set_cell_row_span
();
void
set_cell_row_span
(
int
spanned
=
0
);
void
set_cell_row_span_restart
();
void
end_cell
();
...
...
ASCOfficeOdfFileW/source/OdfFormat/odp_conversion_context.cpp
View file @
19960fa3
...
...
@@ -53,8 +53,7 @@ namespace odf_writer {
odp_conversion_context
::
odp_conversion_context
(
package
::
odf_document
*
outputDocument
)
:
odf_conversion_context
(
PresentationDocument
,
outputDocument
),
slide_context_
(
*
this
)
//, current_text_context_(NULL)
:
odf_conversion_context
(
PresentationDocument
,
outputDocument
),
slide_context_
(
*
this
),
text_context_
(
NULL
)
{
}
...
...
@@ -102,14 +101,14 @@ void odp_conversion_context::end_slide()
void
odp_conversion_context
::
start_text_context
()
{
current_
text_context_
=
new
odf_text_context
(
this
);
text_context_
=
new
odf_text_context
(
this
);
}
void
odp_conversion_context
::
end_text_context
()
{
if
(
current_
text_context_
)
delete
current_
text_context_
;
current_
text_context_
=
NULL
;
if
(
text_context_
)
delete
text_context_
;
text_context_
=
NULL
;
}
void
odp_conversion_context
::
start_drawings
()
...
...
ASCOfficeOdfFileW/source/OdfFormat/odp_conversion_context.h
View file @
19960fa3
...
...
@@ -55,15 +55,16 @@ public:
void
start_master_slide
(
std
::
wstring
name
);
void
end_master_slide
();
///////////////////////////////////////////////////////
odp_page_state
&
current_slide
()
{
return
slide_context_
.
state
();}
odp_page_state
&
current_slide
()
{
return
slide_context_
.
state
();}
/////////////////////////////////////////////////////
virtual
void
start_text_context
();
virtual
void
end_text_context
();
virtual
odf_drawing_context
*
drawing_context
()
{
return
current_slide
().
drawing_context
();}
virtual
odf_text_context
*
text_context
()
{
return
current_text_context_
;}
virtual
odf_text_context
*
text_context
()
{
return
text_context_
;
}
odp_slide_context
*
slide_context
()
{
return
&
slide_context_
;}
void
start_drawings
();
void
end_drawings
();
...
...
@@ -72,7 +73,7 @@ public:
private:
odp_slide_context
slide_context_
;
odf_text_context
*
current_
text_context_
;
odf_text_context
*
text_context_
;
office_presentation
*
root_presentation_
;
};
...
...
ASCOfficeOdfFileW/source/OdfFormat/odp_slide_context.cpp
View file @
19960fa3
...
...
@@ -29,12 +29,11 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "odp_slide_context.h"
#include "logging.h"
#include "odp_conversion_context.h"
#include "logging.h"
#include "odp_slide_context.h"
#include "odf_text_context.h"
#include <iostream>
...
...
@@ -45,7 +44,7 @@ namespace cpdoccore {
namespace
odf_writer
{
odp_slide_context
::
odp_slide_context
(
odp_conversion_context
&
Context
)
:
context_
(
Context
)
odp_slide_context
::
odp_slide_context
(
odp_conversion_context
&
Context
)
:
context_
(
Context
)
,
table_context_
(
&
Context
),
comment_context_
(
&
Context
)
{
styles_context_
=
Context
.
styles_context
();
}
...
...
@@ -81,5 +80,172 @@ void odp_slide_context::end_page()
state
().
drawing_context
()
->
finalize
(
state
().
page_elm_
);
}
odf_table_context
*
odp_slide_context
::
table_context
()
{
return
&
table_context_
;
}
void
odp_slide_context
::
start_table
()
{
state
().
drawing_context
()
->
start_frame
();
office_element_ptr
elm
,
style_elm
,
default_cell
;
create_element
(
L"table"
,
L"table"
,
elm
,
&
context_
);
//--------------------------------------------------------------------
odf_style_state_ptr
style_state
;
//общие свойства ячеек
styles_context_
->
create_style
(
L""
,
odf_types
::
style_family
::
TableCell
,
true
,
false
,
-
1
);
//ради нормального задания дефолтовых свойств на cells
style_state
=
styles_context_
->
last_state
(
style_family
::
TableCell
);
if
(
style_state
)
{
default_cell
=
style_state
->
get_office_element
();
table_context
()
->
set_default_cell_properties
(
style_state
->
get_name
());
}
//стиль создаем всегда
styles_context_
->
create_style
(
L""
,
odf_types
::
style_family
::
Table
,
true
,
false
,
-
1
);
style_state
=
styles_context_
->
last_state
(
style_family
::
Table
);
if
(
style_state
)
style_elm
=
style_state
->
get_office_element
();
//--------------------------------------------------------------------
table_context
()
->
start_table
(
elm
,
true
);
state
().
drawing_context
()
->
start_element
(
elm
,
default_cell
);
}
void
odp_slide_context
::
start_table_columns
()
{
office_element_ptr
elm
;
create_element
(
L"table"
,
L"table-columns"
,
elm
,
&
context_
);
state
().
drawing_context
()
->
start_element
(
elm
);
}
void
odp_slide_context
::
add_table_column
(
double
width
)
{
office_element_ptr
elm
;
create_element
(
L"table"
,
L"table-column"
,
elm
,
&
context_
);
styles_context_
->
create_style
(
L""
,
style_family
::
TableColumn
,
true
,
false
,
-
1
);
//не срабатывает ..
//std::wstring parent_name = table_context()->get_default_cell_properties();
//if (parent_name.length() > 0)
//{
// odf_writer::style_table_cell_properties * props = styles_context()->last_state().get_table_cell_properties();
// style * style_ = NULL;
//
// if (styles_context()->find_odf_style(parent_name,style_family::TableCell,style_))
// {
// style_table_cell_properties * parent = style_->content_.get_style_table_cell_properties();
// props->apply_from(parent);
// }
//}
table_context
()
->
add_column
(
elm
,
true
);
table_context
()
->
set_column_width
(
width
);
state
().
drawing_context
()
->
start_element
(
elm
);
// для связи элментов
state
().
drawing_context
()
->
end_element
();
}
void
odp_slide_context
::
end_table_columns
()
{
state
().
drawing_context
()
->
end_element
();
}
void
odp_slide_context
::
start_table_header_rows
()
{
office_element_ptr
elm
;
create_element
(
L"table"
,
L"table-header-rows"
,
elm
,
&
context_
);
state
().
drawing_context
()
->
start_element
(
elm
);
}
void
odp_slide_context
::
end_table_header_rows
()
{
state
().
drawing_context
()
->
end_element
();
}
void
odp_slide_context
::
start_table_row
(
bool
styled
)
{
office_element_ptr
elm
,
style_elm
;
create_element
(
L"table"
,
L"table-row"
,
elm
,
&
context_
);
if
(
styled
)
{
styles_context_
->
create_style
(
L""
,
odf_types
::
style_family
::
TableRow
,
true
,
false
,
-
1
);
odf_style_state_ptr
style_state
=
styles_context_
->
last_state
(
style_family
::
TableRow
);
if
(
style_state
)
style_elm
=
style_state
->
get_office_element
();
}
state
().
drawing_context
()
->
start_element
(
elm
,
style_elm
);
table_context
()
->
start_row
(
elm
,
styled
);
}
void
odp_slide_context
::
start_table_cell
(
int
col
,
bool
covered
,
bool
styled
)
{
for
(
int
i
=
table_context
()
->
current_column
()
;
i
<
col
;
i
++
)
{
add_default_cell
();
}
//-------------------------------------------------------
office_element_ptr
elm
,
style_elm
;
if
(
covered
)
create_element
(
L"table"
,
L"covered-table-cell"
,
elm
,
&
context_
);
else
create_element
(
L"table"
,
L"table-cell"
,
elm
,
&
context_
);
if
(
styled
)
{
styles_context_
->
create_style
(
L""
,
odf_types
::
style_family
::
TableCell
,
true
,
false
,
-
1
);
odf_style_state_ptr
style_state
=
styles_context_
->
last_state
(
style_family
::
TableCell
);
if
(
style_state
)
style_elm
=
style_state
->
get_office_element
();
}
table_context
()
->
start_cell
(
elm
,
style_elm
?
true
:
false
);
state
().
drawing_context
()
->
start_element
(
elm
,
style_elm
);
}
void
odp_slide_context
::
end_table_cell
()
{
table_context
()
->
end_cell
();
state
().
drawing_context
()
->
end_element
();
}
void
odp_slide_context
::
end_table_row
()
{
for
(
int
i
=
table_context
()
->
current_column
()
;
i
<
table_context
()
->
count_columns
();
i
++
)
{
add_default_cell
();
}
//---------------------------------------------
table_context
()
->
end_row
();
state
().
drawing_context
()
->
end_element
();
}
void
odp_slide_context
::
add_default_cell
()
{
office_element_ptr
elm
;
create_element
(
L"table"
,
L"covered-table-cell"
,
elm
,
&
context_
);
table_context
()
->
start_cell
(
elm
,
false
);
state
().
drawing_context
()
->
start_element
(
elm
);
table_context
()
->
end_cell
();
state
().
drawing_context
()
->
end_element
();
}
void
odp_slide_context
::
end_table
()
{
table_context
()
->
end_table
();
state
().
drawing_context
()
->
end_element
();
state
().
drawing_context
()
->
end_frame
();
}
}
}
ASCOfficeOdfFileW/source/OdfFormat/odp_slide_context.h
View file @
19960fa3
...
...
@@ -31,9 +31,11 @@
*/
#pragma once
#include <string>
#include "odp_page_state.h"
#include "odf_table_context.h"
#include "odf_comment_context.h"
namespace
cpdoccore
{
namespace
odf_writer
{
...
...
@@ -55,11 +57,29 @@ public:
odp_page_state
&
state
();
odf_comment_context
*
comment_context
();
odf_table_context
*
table_context
();
void
start_table
();
void
start_table_columns
();
void
add_table_column
(
double
width
=
-
1
);
void
end_table_columns
();
void
start_table_header_rows
();
void
end_table_header_rows
();
void
start_table_row
(
bool
styled
=
false
);
void
add_default_cell
();
void
start_table_cell
(
int
col
,
bool
covered
,
bool
styled
=
true
);
void
end_table_cell
();
void
end_table_row
();
void
end_table
();
private:
odp_conversion_context
&
context_
;
odf_style_context
*
styles_context_
;
odf_table_context
table_context_
;
odf_comment_context
comment_context_
;
std
::
list
<
odp_page_state
>
page_state_list_
;
friend
class
odp_conversion_context
;
...
...
ASCOfficeOdfFileW/source/OdfFormat/ods_table_context.cpp
View file @
19960fa3
...
...
@@ -231,7 +231,6 @@ void ods_table_context::start_table(office_element_ptr & elm)
office_element_ptr
&
style
=
context_
.
styles_context
()
->
add_or_find
(
style_name_new
,
style_family
::
Table
,
true
);
style
->
create_child_element
(
L"style"
,
L"table-properties"
);
state
().
set_table_style
(
style
);
state
().
set_table_hidden
(
false
);
...
...
ASCOfficeOdfFileW/source/OdfFormat/odt_conversion_context.h
View file @
19960fa3
...
...
@@ -44,8 +44,8 @@ class office_text;
class
odf_text_context
;
typedef
shared_ptr
<
odf_text_context
>::
Type
odf_text_context_ptr
;
typedef
shared_ptr
<
odf_drawing_context
>::
Type
odf_drawing_context_ptr
;
typedef
shared_ptr
<
odf_text_context
>::
Type
odf_text_context_ptr
;
typedef
shared_ptr
<
odf_drawing_context
>::
Type
odf_drawing_context_ptr
;
struct
odt_section_state
{
...
...
ASCOfficeOdfFileW/source/OdfFormat/style_graphic_properties.cpp
View file @
19960fa3
...
...
@@ -49,6 +49,65 @@ graphic_format_properties::graphic_format_properties()
//style_mirror_ = L"none";
//common_draw_fill_attlist_.draw_fill_ = draw_fill::none;
}
void
graphic_format_properties
::
apply_from
(
const
graphic_format_properties
&
Other
)
{
_CP_APPLY_PROP2
(
draw_stroke_
);
_CP_APPLY_PROP2
(
draw_stroke_dash_
);
_CP_APPLY_PROP2
(
draw_marker_start_
);
_CP_APPLY_PROP2
(
draw_marker_end_
);
_CP_APPLY_PROP2
(
draw_textarea_horizontal_align_
);
_CP_APPLY_PROP2
(
draw_textarea_vertical_align_
);
_CP_APPLY_PROP2
(
draw_auto_grow_height_
);
_CP_APPLY_PROP2
(
draw_auto_grow_width_
);
_CP_APPLY_PROP2
(
draw_fit_to_size_
);
_CP_APPLY_PROP2
(
draw_fit_to_contour_
);
_CP_APPLY_PROP2
(
svg_stroke_color_
);
_CP_APPLY_PROP2
(
svg_stroke_width_
);
_CP_APPLY_PROP2
(
svg_stroke_opacity_
);
_CP_APPLY_PROP2
(
fo_min_width_
);
_CP_APPLY_PROP2
(
fo_min_height_
);
_CP_APPLY_PROP2
(
fo_max_width_
);
_CP_APPLY_PROP2
(
fo_max_height_
);
_CP_APPLY_PROP2
(
fo_wrap_option_
);
_CP_APPLY_PROP2
(
style_print_content_
);
_CP_APPLY_PROP2
(
style_protect_
);
_CP_APPLY_PROP2
(
style_editable_
);
_CP_APPLY_PROP2
(
style_wrap_
);
_CP_APPLY_PROP2
(
style_wrap_dynamic_treshold_
);
_CP_APPLY_PROP2
(
style_number_wrapped_paragraphs_
);
_CP_APPLY_PROP2
(
style_wrap_contour_
);
_CP_APPLY_PROP2
(
style_wrap_contour_mode_
);
_CP_APPLY_PROP2
(
style_run_through_
);
_CP_APPLY_PROP2
(
style_flow_with_text_
);
_CP_APPLY_PROP2
(
style_overflow_behavior_
);
_CP_APPLY_PROP2
(
style_mirror_
);
_CP_APPLY_PROP2
(
fo_clip_
);
_CP_APPLY_PROP2
(
draw_wrap_influence_on_position_
);
common_draw_fill_attlist_
.
apply_from
(
Other
.
common_draw_fill_attlist_
);
common_draw_rel_size_attlist_
.
apply_from
(
Other
.
common_draw_rel_size_attlist_
);
common_horizontal_margin_attlist_
.
apply_from
(
Other
.
common_horizontal_margin_attlist_
);
common_vertical_margin_attlist_
.
apply_from
(
Other
.
common_vertical_margin_attlist_
);
common_margin_attlist_
.
apply_from
(
Other
.
common_margin_attlist_
);
common_horizontal_pos_attlist_
.
apply_from
(
Other
.
common_horizontal_pos_attlist_
);
common_horizontal_rel_attlist_
.
apply_from
(
Other
.
common_horizontal_rel_attlist_
);
common_vertical_pos_attlist_
.
apply_from
(
Other
.
common_vertical_pos_attlist_
);
common_vertical_rel_attlist_
.
apply_from
(
Other
.
common_vertical_rel_attlist_
);
common_text_anchor_attlist_
.
apply_from
(
Other
.
common_text_anchor_attlist_
);
common_border_attlist_
.
apply_from
(
Other
.
common_border_attlist_
);
common_border_line_width_attlist_
.
apply_from
(
Other
.
common_border_line_width_attlist_
);
common_padding_attlist_
.
apply_from
(
Other
.
common_padding_attlist_
);
common_shadow_attlist_
.
apply_from
(
Other
.
common_shadow_attlist_
);
common_background_color_attlist_
.
apply_from
(
Other
.
common_background_color_attlist_
);
_CP_APPLY_PROP
(
style_background_image_
,
Other
.
style_background_image_
);
}
void
graphic_format_properties
::
serialize
(
std
::
wostream
&
_Wostream
,
const
wchar_t
*
ns
,
const
wchar_t
*
name
)
{
CP_XML_WRITER
(
_Wostream
)
...
...
@@ -121,8 +180,7 @@ void graphic_format_properties::serialize(std::wostream & _Wostream ,const wchar
}
}
// style:graphic-properties
//////////////////////////////////////////////////////////////////////////////////////////////////
//------------------------------------
const
wchar_t
*
style_graphic_properties
::
ns
=
L"style"
;
const
wchar_t
*
style_graphic_properties
::
name
=
L"graphic-properties"
;
...
...
@@ -131,6 +189,14 @@ void style_graphic_properties::serialize(std::wostream & strm)
content_
.
serialize
(
strm
,
ns
,
name
);
}
//------------------------------------
const
wchar_t
*
loext_graphic_properties
::
ns
=
L"loext"
;
const
wchar_t
*
loext_graphic_properties
::
name
=
L"graphic-properties"
;
void
loext_graphic_properties
::
serialize
(
std
::
wostream
&
strm
)
{
content_
.
serialize
(
strm
,
ns
,
name
);
}
}
}
ASCOfficeOdfFileW/source/OdfFormat/style_graphic_properties.h
View file @
19960fa3
...
...
@@ -147,8 +147,7 @@ public:
office_element_ptr
style_background_image_
;
};
/// \class style_graphic_properties
/// style:graphic-properties
class
style_graphic_properties
:
public
office_element_impl
<
style_graphic_properties
>
{
public:
...
...
@@ -170,7 +169,26 @@ public:
CP_REGISTER_OFFICE_ELEMENT2
(
style_graphic_properties
);
class
loext_graphic_properties
:
public
office_element_impl
<
loext_graphic_properties
>
{
public:
static
const
wchar_t
*
ns
;
static
const
wchar_t
*
name
;
static
const
xml
::
NodeType
xml_type
=
xml
::
typeElement
;
static
const
ElementType
type
=
typeStyleGraphicPropertis
;
CPDOCCORE_DEFINE_VISITABLE
()
virtual
void
create_child_element
(
const
std
::
wstring
&
Ns
,
const
std
::
wstring
&
Name
){}
virtual
void
add_child_element
(
const
office_element_ptr
&
child
){}
virtual
void
serialize
(
std
::
wostream
&
strm
);
graphic_format_properties
content_
;
};
CP_REGISTER_OFFICE_ELEMENT2
(
loext_graphic_properties
);
}
}
ASCOfficeOdfFileW/source/OdfFormat/styles.cpp
View file @
19960fa3
...
...
@@ -75,17 +75,33 @@ style_paragraph_properties * style_content::get_style_paragraph_properties()
return
dynamic_cast
<
style_paragraph_properties
*>
(
style_paragraph_properties_
.
get
());
}
style_graphic_properties
*
style_content
::
get_style
_graphic_properties
()
graphic_format_properties
*
style_content
::
get
_graphic_properties
()
{
if
(
!
style_graphic_properties_
)
create_element
(
L"style"
,
L"graphic-properties"
,
style_graphic_properties_
,
Context
);
if
(
!
style_graphic_properties_
)
{
if
(
style_family_
==
odf_types
::
style_family
::
TableCell
)
create_element
(
L"loext"
,
L"graphic-properties"
,
style_graphic_properties_
,
Context
);
else
create_element
(
L"style"
,
L"graphic-properties"
,
style_graphic_properties_
,
Context
);
}
style_graphic_properties
*
style_gr
=
dynamic_cast
<
style_graphic_properties
*>
(
style_graphic_properties_
.
get
());
loext_graphic_properties
*
loext_gr
=
dynamic_cast
<
loext_graphic_properties
*>
(
style_graphic_properties_
.
get
());
if
(
style_gr
)
{
return
&
style_gr
->
content_
;
}
else
if
(
loext_gr
)
{
return
&
loext_gr
->
content_
;
}
return
NULL
;
return
dynamic_cast
<
style_graphic_properties
*>
(
style_graphic_properties_
.
get
());
}
style_table_properties
*
style_content
::
get_style_table_properties
()
{
if
(
!
style_table_properties_
)
create_element
(
L"style"
,
L"table-properties"
,
style_table_properties_
,
Context
);
create_element
(
L"style"
,
L"table-properties"
,
style_table_properties_
,
Context
);
return
dynamic_cast
<
style_table_properties
*>
(
style_table_properties_
.
get
());
}
...
...
ASCOfficeOdfFileW/source/OdfFormat/styles.h
View file @
19960fa3
...
...
@@ -72,9 +72,10 @@
namespace
cpdoccore
{
namespace
odf_writer
{
class
graphic_format_properties
;
class
style_text_properties
;
class
style_paragraph_properties
;
class
style_graphic_properties
;
class
style_section_properties
;
class
style_table_cell_properties
;
class
style_table_row_properties
;
...
...
@@ -88,13 +89,14 @@ class style_content : noncopyable
public:
style_content
(
odf_conversion_context
*
_context
){
Context
=
_context
;}
void
create_child_element
(
const
std
::
wstring
&
Ns
,
const
std
::
wstring
&
Name
);
void
add_child_element
(
const
office_element_ptr
&
child
);
void
serialize
(
std
::
wostream
&
strm
);
void
create_child_element
(
const
std
::
wstring
&
Ns
,
const
std
::
wstring
&
Name
);
void
add_child_element
(
const
office_element_ptr
&
child
);
void
serialize
(
std
::
wostream
&
strm
);
style_text_properties
*
get_style_text_properties
();
graphic_format_properties
*
get_graphic_properties
()
;
style_text_properties
*
get_style_text_properties
();
style_paragraph_properties
*
get_style_paragraph_properties
()
;
style_graphic_properties
*
get_style_graphic_properties
()
;
style_table_properties
*
get_style_table_properties
();
style_section_properties
*
get_style_section_properties
();
style_table_cell_properties
*
get_style_table_cell_properties
();
...
...
@@ -103,9 +105,9 @@ public:
style_chart_properties
*
get_style_chart_properties
()
;
style_drawing_page_properties
*
get_style_drawing_page_properties
();
odf_types
::
style_family
style_family_
;
private:
odf_conversion_context
*
Context
;
odf_types
::
style_family
style_family_
;
office_element_ptr
style_text_properties_
;
office_element_ptr
style_paragraph_properties_
;
...
...
@@ -349,7 +351,6 @@ public:
virtual
void
serialize
(
std
::
wostream
&
strm
);
// attr
std
::
wstring
style_name_
;
_CP_OPT
(
std
::
wstring
)
style_display_name_
;
odf_types
::
style_family
style_family_
;
...
...
@@ -363,7 +364,6 @@ public:
_CP_OPT
(
std
::
wstring
)
style_class_
;
_CP_OPT
(
std
::
wstring
)
style_default_outline_level_
;
style_content
content_
;
office_element_ptr_array
style_map_
;
...
...
ASCOfficeOdfFileW/source/OdfFormat/table.h
View file @
19960fa3
...
...
@@ -54,11 +54,11 @@ class table_table_attlist
public:
table_table_attlist
()
{
table_print_
=
true
;
table_use_first_row_styles_
=
false
;
table_use_banding_rows_styles_
=
false
;
table_use_first_column_styles_
=
false
;
table_use_banding_columns_styles_
=
false
;
table_print_
=
true
;
table_use_first_row_styles_
=
false
;
table_use_banding_rows_styles_
=
false
;
table_use_first_column_styles_
=
false
;
table_use_banding_columns_styles_
=
false
;
}
unsigned
int
table_number_columns_repeated_
;
// default 1
...
...
@@ -70,19 +70,20 @@ public:
_CP_OPT
(
std
::
wstring
)
table_print_ranges_
;
_CP_OPT
(
odf_types
::
Bool
)
table_protected_
;
// default false
bool
table_print_
;
// default true
bool
table_print_
;
// default true
bool
table_use_first_row_styles_
;
// default false;
bool
table_use_banding_rows_styles_
;
//
defualt false;
bool
table_use_first_column_styles_
;
//
defualt false;
bool
table_use_banding_columns_styles_
;
//defualt false;
bool
table_use_first_row_styles_
;
// default false;
bool
table_use_banding_rows_styles_
;
//
defualt false;
bool
table_use_first_column_styles_
;
//
defualt false;
bool
table_use_banding_columns_styles_
;
//
defualt false;
void
serialize
(
CP_ATTR_NODE
);
friend
class
table_table
;
};
//
table-table-row-attlist
//
-----------------------------------------------------------------------------------------------------
class
table_table_row_attlist
{
public:
...
...
@@ -97,7 +98,7 @@ public:
void
serialize
(
CP_ATTR_NODE
);
};
//
table-table-cell-attlist
//
-----------------------------------------------------------------------------------------------------
class
table_table_cell_attlist
{
public:
...
...
@@ -115,12 +116,12 @@ public:
void
serialize
(
CP_ATTR_NODE
);
};
//
table-table-cell-attlist-extra
//
-----------------------------------------------------------------------------------------------------
class
table_table_cell_attlist_extra
{
public:
_CP_OPT
(
unsigned
int
)
table_number_columns_spanned_
;
// default 1
_CP_OPT
(
unsigned
int
)
table_number_rows_spanned_
;
// default 1
_CP_OPT
(
unsigned
int
)
table_number_columns_spanned_
;
// default 1
_CP_OPT
(
unsigned
int
)
table_number_rows_spanned_
;
// default 1
_CP_OPT
(
unsigned
int
)
table_number_matrix_columns_spanned_
;
_CP_OPT
(
unsigned
int
)
table_number_matrix_rows_spanned_
;
...
...
@@ -152,9 +153,7 @@ public:
void
serialize
(
CP_ATTR_NODE
);
};
/// \class table_table_source
/// \brief table:table-source
/// table-table-source
//-----------------------------------------------------------------------------------------------------
class
table_table_source
:
public
office_element_impl
<
table_table_source
>
{
public:
...
...
@@ -177,7 +176,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2
(
table_table_source
);
//
table-columns
//
-----------------------------------------------------------------------------------------------------
class
table_columns
{
public:
...
...
@@ -192,7 +191,7 @@ public:
};
//
table-columns-no-group
//
-----------------------------------------------------------------------------------------------------
class
table_columns_no_group
:
public
office_element
{
public:
...
...
@@ -226,7 +225,7 @@ private:
};
//
table-columns-and-groups
//
-----------------------------------------------------------------------------------------------------
class
table_columns_and_groups
{
public:
...
...
@@ -244,7 +243,7 @@ public:
};
//
table-table-column-attlist
//
-----------------------------------------------------------------------------------------------------
class
table_table_column_attlist
{
public:
...
...
@@ -258,9 +257,7 @@ public:
void
serialize
(
CP_ATTR_NODE
);
};
// \class table_table_column
// table:table-column
// table-table-column
//-----------------------------------------------------------------------------------------------------
class
table_table_column
:
public
office_element_impl
<
table_table_column
>
{
public:
...
...
@@ -283,9 +280,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2
(
table_table_column
);
// \class table_table_columns
// table:table-columns
// table-table-columns
//-----------------------------------------------------------------------------------------------------
class
table_table_columns
:
public
office_element_impl
<
table_table_columns
>
{
public:
...
...
@@ -307,9 +302,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2
(
table_table_columns
);
// \class table_table_header_columns
// table:table-header-columns
// table-table-header-columns
//-----------------------------------------------------------------------------------------------------
class
table_table_header_columns
:
public
office_element_impl
<
table_table_header_columns
>
{
public:
...
...
@@ -369,9 +362,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2
(
table_table_column_group
);
/// \class table_table_row
/// \brief table:table-row
/// table-table-row
//-----------------------------------------------------------------------------------------------------
class
table_table_row
:
public
office_element_impl
<
table_table_row
>
{
public:
...
...
@@ -394,8 +385,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2
(
table_table_row
);
// \class table_table_cell_content
// table-table-cell-content
//-----------------------------------------------------------------------------------------------------
class
table_table_cell_content
{
public:
...
...
@@ -410,9 +400,7 @@ private:
office_element_ptr_array
text_content_
;
// text-content
};
// \class table_table_cell
// table-table-cell
// table:table-cell
//-----------------------------------------------------------------------------------------------------
class
table_table_cell
:
public
office_element_impl
<
table_table_cell
>
{
public:
...
...
@@ -430,17 +418,15 @@ public:
virtual
void
serialize
(
std
::
wostream
&
_Wostream
);
table_table_cell_attlist
table_table_cell_attlist_
;
table_table_cell_attlist_extra
table_table_cell_attlist_extra_
;
table_table_cell_content
table_table_cell_content_
;
table_table_cell_attlist
table_table_cell_attlist_
;
table_table_cell_attlist_extra
table_table_cell_attlist_extra_
;
table_table_cell_content
table_table_cell_content_
;
};
CP_REGISTER_OFFICE_ELEMENT2
(
table_table_cell
);
// \class table_covered_table_cell
// table-covered-table-cell
// table:covered-table-cell
//-----------------------------------------------------------------------------------------------------
class
table_covered_table_cell
:
public
office_element_impl
<
table_covered_table_cell
>
{
public:
...
...
@@ -466,9 +452,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2
(
table_covered_table_cell
);
// \class table_table_rows
// table-table-rows
// table:table-rows
//-----------------------------------------------------------------------------------------------------
class
table_table_rows
:
public
office_element_impl
<
table_table_rows
>
{
public:
...
...
@@ -494,9 +478,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2
(
table_table_rows
);
// \class table_table_header_rows
// table-table-header-rows
// table:table-header-rows
//-----------------------------------------------------------------------------------------------------
class
table_table_header_rows
:
public
office_element_impl
<
table_table_header_rows
>
{
public:
...
...
@@ -517,9 +499,7 @@ public:
};
CP_REGISTER_OFFICE_ELEMENT2
(
table_table_header_rows
);
// \class table_rows
// table-rows
//-----------------------------------------------------------------------------------------------------
class
table_rows
{
public:
...
...
@@ -533,7 +513,7 @@ public:
};
//
table-rows-no-group
//
-----------------------------------------------------------------------------------------------------
class
table_rows_no_group
:
public
office_element
{
public:
...
...
@@ -567,7 +547,7 @@ private:
};
//
table-rows-and-groups
//
-----------------------------------------------------------------------------------------------------
class
table_rows_and_groups
{
public:
...
...
@@ -587,15 +567,14 @@ public:
};
//
table-table-row-group-attlist
//
-----------------------------------------------------------------------------------------------------
class
table_table_row_group_attlist
{
public:
table_table_row_group_attlist
()
:
table_display_
(
true
)
{}
bool
table_display_
;
// default true
};
// table:table-row-group
//-----------------------------------------------------------------------------------------------------
class
table_table_row_group
:
public
office_element_impl
<
table_table_row_group
>
{
public:
...
...
@@ -621,9 +600,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2
(
table_table_row_group
);
/// \class table_table
/// \brief table:table
/// table-table
//-----------------------------------------------------------------------------------------------------
class
table_table
:
public
office_element_impl
<
table_table
>
{
public:
...
...
@@ -654,9 +631,7 @@ public:
CP_REGISTER_OFFICE_ELEMENT2
(
table_table
);
/// \class table_shapes
/// \brief table:shapes
/// table-shapes
//-----------------------------------------------------------------------------------------------------
class
table_shapes
:
public
office_element_impl
<
table_shapes
>
{
public:
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertDrawing.cpp
View file @
19960fa3
...
...
@@ -29,7 +29,7 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "Converter.h"
#include "
Pptx
Converter.h"
#include "../utils.h"
#include "../../../Common/DocxFormat/Source/DocxFormat/Diagram/DiagramDrawing.h"
...
...
@@ -41,6 +41,7 @@
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Pic.h"
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/CxnSp.h"
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/SpTree.h"
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Table/Table.h"
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Colors/SrgbClr.h"
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Colors/PrstClr.h"
...
...
@@ -98,7 +99,9 @@ void OoxConverter::convert(PPTX::Logic::GraphicFrame *oox_graphic_frame)
}
else
if
(
oox_graphic_frame
->
table
.
IsInit
())
{
OoxConverter
::
convert
(
oox_graphic_frame
->
table
.
GetPointer
());
PptxConverter
*
pptx_converter
=
dynamic_cast
<
PptxConverter
*>
(
this
);
if
(
pptx_converter
)
pptx_converter
->
convert
(
oox_graphic_frame
->
table
.
GetPointer
());
}
else
if
(
oox_graphic_frame
->
element
.
IsInit
())
{
...
...
@@ -111,15 +114,7 @@ void OoxConverter::convert(PPTX::Logic::NvGraphicFramePr *oox_framePr)
if
(
oox_framePr
==
NULL
)
return
;
}
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
Table
*
oox_table
)
{
if
(
oox_table
==
NULL
)
return
;
odf_context
()
->
drawing_context
()
->
start_shape
(
0
);
//frame
odf_context
()
->
drawing_context
()
->
end_shape
();
}
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
Xfrm
*
oox_xfrm
)
{
if
(
oox_xfrm
==
NULL
)
return
;
//CTransform2D
...
...
@@ -280,7 +275,21 @@ void OoxConverter::convert(PPTX::Logic::SpTree *oox_shape_tree)
convert
(
oox_shape_tree
->
SpTreeElems
[
i
].
GetElem
().
operator
->
());
}
}
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
CxnSp
*
oox_connect
)
{
if
(
oox_connect
==
NULL
)
return
;
odf_context
()
->
drawing_context
()
->
start_drawing
();
odf_context
()
->
drawing_context
()
->
start_shape
(
SimpleTypes
::
shapetypeLine
);
convert
(
&
oox_connect
->
spPr
,
oox_connect
->
style
.
GetPointer
());
convert
(
&
oox_connect
->
nvCxnSpPr
);
odf_context
()
->
drawing_context
()
->
end_shape
();
odf_context
()
->
drawing_context
()
->
end_drawing
();
}
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
Shape
*
oox_shape
)
{
if
(
oox_shape
==
NULL
)
return
;
...
...
@@ -334,14 +343,19 @@ void OoxConverter::convert(PPTX::Logic::SpPr *oox_spPr, PPTX::Logic::ShapeStyle*
convert
(
prstGeom
);
convert
(
custGeom
);
odf_context
()
->
drawing_context
()
->
start_area_properties
();
bool
bLine
=
prstGeom
?
(
prstGeom
->
prst
.
get
()
==
L"line"
)
:
false
;
if
(
!
bLine
)
{
if
(
oox_spPr
->
Fill
.
is_init
())
convert
(
&
oox_spPr
->
Fill
);
else
if
(
oox_sp_style
)
convert
(
&
oox_sp_style
->
fillRef
,
1
);
odf_context
()
->
drawing_context
()
->
start_area_properties
();
{
if
(
oox_spPr
->
Fill
.
is_init
())
convert
(
&
oox_spPr
->
Fill
);
else
if
(
oox_sp_style
)
convert
(
&
oox_sp_style
->
fillRef
,
1
);
}
odf_context
()
->
drawing_context
()
->
end_area_properties
();
}
odf_context
()
->
drawing_context
()
->
end_area_properties
();
odf_context
()
->
drawing_context
()
->
start_line_properties
();
{
...
...
@@ -506,11 +520,11 @@ void OoxConverter::convert(PPTX::Logic::BlipFill *oox_bitmap_fill)
// convert(oox_bitmap_fill->blip->m_arrEffects[i]);
//}
}
if
(
oox_bitmap_fill
->
srcRect
.
IsInit
()
&&
Width
>
0
&&
Height
>
0
)
//часть изображения
if
(
oox_bitmap_fill
->
srcRect
.
IsInit
()
&&
Width
>
0
&&
Height
>
0
)
//часть изображения
{
odf_context
()
->
drawing_context
()
->
set_image_client_rect_inch
(
(
oox_bitmap_fill
->
srcRect
->
l
.
IsInit
()
?
XmlUtils
::
GetInteger
(
oox_bitmap_fill
->
srcRect
->
l
.
get
())
:
0
)
/
100.
*
Width
/
currentSystemDPI
,
(
oox_bitmap_fill
->
srcRect
->
t
.
IsInit
()
?
XmlUtils
::
GetInteger
(
oox_bitmap_fill
->
srcRect
->
t
.
get
())
:
0
)
/
100.
*
Height
/
currentSystemDPI
,
(
oox_bitmap_fill
->
srcRect
->
l
.
IsInit
()
?
XmlUtils
::
GetInteger
(
oox_bitmap_fill
->
srcRect
->
l
.
get
())
:
0
)
/
100.
*
Width
/
currentSystemDPI
,
(
oox_bitmap_fill
->
srcRect
->
t
.
IsInit
()
?
XmlUtils
::
GetInteger
(
oox_bitmap_fill
->
srcRect
->
t
.
get
())
:
0
)
/
100.
*
Height
/
currentSystemDPI
,
(
oox_bitmap_fill
->
srcRect
->
r
.
IsInit
()
?
XmlUtils
::
GetInteger
(
oox_bitmap_fill
->
srcRect
->
r
.
get
())
:
0
)
/
100.
*
Width
/
currentSystemDPI
,
(
oox_bitmap_fill
->
srcRect
->
b
.
IsInit
()
?
XmlUtils
::
GetInteger
(
oox_bitmap_fill
->
srcRect
->
b
.
get
())
:
0
)
/
100.
*
Height
/
currentSystemDPI
);
}
...
...
@@ -523,21 +537,21 @@ void OoxConverter::convert(PPTX::Logic::BlipFill *oox_bitmap_fill)
if
(
oox_bitmap_fill
->
tile
->
flip
.
IsInit
())
{}
if
(
oox_bitmap_fill
->
tile
->
sx
.
IsInit
()
&&
Width
>
0
)
if
(
oox_bitmap_fill
->
tile
->
sx
.
IsInit
()
&&
Width
>
0
)
{
odf_context
()
->
drawing_context
()
->
set_bitmap_tile_scale_x
(
*
oox_bitmap_fill
->
tile
->
sx
/
100.
*
Width
);
odf_context
()
->
drawing_context
()
->
set_bitmap_tile_scale_x
(
*
oox_bitmap_fill
->
tile
->
sx
/
100
000
.
*
Width
);
}
if
(
oox_bitmap_fill
->
tile
->
sy
.
IsInit
()
&&
Height
>
0
)
if
(
oox_bitmap_fill
->
tile
->
sy
.
IsInit
()
&&
Height
>
0
)
{
odf_context
()
->
drawing_context
()
->
set_bitmap_tile_scale_y
(
*
oox_bitmap_fill
->
tile
->
sy
/
100.
*
Height
);
odf_context
()
->
drawing_context
()
->
set_bitmap_tile_scale_y
(
*
oox_bitmap_fill
->
tile
->
sy
/
100
000
.
*
Height
);
}
if
(
oox_bitmap_fill
->
tile
->
tx
.
IsInit
()
&&
Width
>
0
)
if
(
oox_bitmap_fill
->
tile
->
tx
.
IsInit
()
&&
Width
>
0
)
{
odf_context
()
->
drawing_context
()
->
set_bitmap_tile_translate_x
(
*
oox_bitmap_fill
->
tile
->
tx
*
100.
/
Width
);
odf_context
()
->
drawing_context
()
->
set_bitmap_tile_translate_x
(
*
oox_bitmap_fill
->
tile
->
tx
*
100
000
.
/
Width
);
}
if
(
oox_bitmap_fill
->
tile
->
ty
.
IsInit
()
&&
Height
>
0
)
if
(
oox_bitmap_fill
->
tile
->
ty
.
IsInit
()
&&
Height
>
0
)
{
odf_context
()
->
drawing_context
()
->
set_bitmap_tile_translate_y
(
*
oox_bitmap_fill
->
tile
->
ty
*
100.
/
Height
);
odf_context
()
->
drawing_context
()
->
set_bitmap_tile_translate_y
(
*
oox_bitmap_fill
->
tile
->
ty
*
100
000
.
/
Height
);
}
}
if
(
oox_bitmap_fill
->
stretch
.
IsInit
())
...
...
@@ -667,11 +681,11 @@ void OoxConverter::convert(PPTX::Logic::EffectLst *oox_effect_lst)
{
if
(
!
oox_effect_lst
)
return
;
}
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
Ln
*
oox_line_prop
)
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
Ln
*
oox_line_prop
,
DWORD
ARGB
)
{
if
(
!
oox_line_prop
)
return
;
convert
(
&
oox_line_prop
->
Fill
);
convert
(
&
oox_line_prop
->
Fill
,
ARGB
);
if
(
oox_line_prop
->
w
.
IsInit
())
{
...
...
@@ -801,6 +815,20 @@ void OoxConverter::convert(PPTX::Logic::CNvSpPr *oox_cnvSpPr)
if
(
!
oox_cnvSpPr
)
return
;
}
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
CNvCxnSpPr
*
oox_cnvSpPr
)
{
if
(
!
oox_cnvSpPr
)
return
;
}
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
NvCxnSpPr
*
oox_nvSpPr
)
{
if
(
!
oox_nvSpPr
)
return
;
convert
(
&
oox_nvSpPr
->
cNvPr
);
convert
(
&
oox_nvSpPr
->
cNvCxnSpPr
);
convert
(
&
oox_nvSpPr
->
nvPr
);
}
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
NvPr
*
oox_nvPr
)
{
if
(
!
oox_nvPr
)
return
;
...
...
@@ -942,7 +970,9 @@ void OoxConverter::convert(PPTX::Logic::RunProperties *oox_run_pr, odf_writer::s
_CP_OPT
(
double
)
opacity
;
convert
(
&
solidFill
->
Color
,
hexColor
,
opacity
);
text_properties
->
content_
.
fo_color_
=
odf_types
::
color
(
std
::
wstring
(
L"#"
)
+
hexColor
);
int
res
=
0
;
if
((
res
=
hexColor
.
find
(
L"#"
))
<
0
)
hexColor
=
std
::
wstring
(
L"#"
)
+
hexColor
;
text_properties
->
content_
.
fo_color_
=
odf_types
::
color
(
hexColor
);
}
if
(
oox_run_pr
->
i
.
IsInit
())
{
...
...
@@ -1158,23 +1188,26 @@ void OoxConverter::convert(PPTX::Logic::Close *oox_geom_path)
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
StyleRef
*
style_ref
,
int
type
)
{
if
(
!
style_ref
)
return
;
std
::
wstring
hexColor
;
_CP_OPT
(
double
)
opacity
;
convert
(
&
style_ref
->
Color
,
hexColor
,
opacity
);
if
(
type
==
1
)
if
(
style_ref
->
idx
.
IsInit
()
==
false
)
{
odf_context
()
->
drawing_context
()
->
set_solid_fill
(
hexColor
);
if
(
opacity
)
odf_context
()
->
drawing_context
()
->
set_opacity
(
*
opacity
);
std
::
wstring
hexColor
;
_CP_OPT
(
double
)
opacity
;
convert
(
&
style_ref
->
Color
,
hexColor
,
opacity
);
if
(
type
!=
3
)
//?? todooo
{
odf_context
()
->
drawing_context
()
->
set_solid_fill
(
hexColor
);
if
(
opacity
)
odf_context
()
->
drawing_context
()
->
set_opacity
(
*
opacity
);
}
return
;
}
if
(
style_ref
->
idx
.
IsInit
()
==
false
)
return
;
size_t
index
=
*
style_ref
->
idx
;
int
index
=
*
style_ref
->
idx
;
PPTX
::
Theme
*
theme
=
oox_theme
();
if
(
!
theme
)
return
;
...
...
@@ -1206,14 +1239,15 @@ void OoxConverter::convert(PPTX::Logic::StyleRef *style_ref, int type)
}
else
if
(
type
==
2
)
{
//
index -= 1;
index
-=
1
;
if
((
index
>=
0
)
||
(
index
<
theme
->
themeElements
.
fmtScheme
.
lnStyleLst
.
size
()))
{
convert
(
&
theme
->
themeElements
.
fmtScheme
.
lnStyleLst
[
index
]);
convert
(
&
theme
->
themeElements
.
fmtScheme
.
lnStyleLst
[
index
]
,
style_ref
->
Color
.
GetARGB
()
);
}
}
else
if
(
type
==
3
)
{
index
-=
1
;
if
((
index
>=
0
)
||
(
index
<
theme
->
themeElements
.
fmtScheme
.
effectStyleLst
.
size
()))
{
convert
(
&
theme
->
themeElements
.
fmtScheme
.
effectStyleLst
[
index
]);
...
...
@@ -1249,4 +1283,5 @@ void OoxConverter::convert(PPTX::Logic::FontRef *style_font_ref)
odf_context
()
->
drawing_context
()
->
set_textarea_font
(
style_font
->
latin
.
typeface
,
style_font
->
ea
.
typeface
,
style_font
->
cs
.
typeface
);
}
}
}
ASCOfficeOdfFileW/source/Oox2OdfConverter/Converter.cpp
View file @
19960fa3
This diff is collapsed.
Click to expand it.
ASCOfficeOdfFileW/source/Oox2OdfConverter/Converter.h
View file @
19960fa3
...
...
@@ -268,8 +268,13 @@ namespace PPTX
class
GraphicFrame
;
class
SpTree
;
class
Shape
;
class
CxnSp
;
class
Pic
;
class
Table
;
class
TableProperties
;
class
TableRow
;
class
TableCell
;
class
TableCellProperties
;
class
SmartArt
;
class
ChartRec
;
class
SpPr
;
...
...
@@ -295,6 +300,8 @@ namespace PPTX
class
NvSpPr
;
class
CNvPr
;
class
CNvSpPr
;
class
CNvCxnSpPr
;
class
NvCxnSpPr
;
class
NvPr
;
class
Paragraph
;
class
TxBody
;
...
...
@@ -359,6 +366,7 @@ public:
void
convert
(
PPTX
::
Logic
::
GraphicFrame
*
oox_graphicFrame
);
void
convert
(
PPTX
::
Logic
::
SpTree
*
oox_shape_tree
);
void
convert
(
PPTX
::
Logic
::
Shape
*
oox_shape
);
void
convert
(
PPTX
::
Logic
::
CxnSp
*
oox_connect
);
void
convert
(
PPTX
::
Logic
::
Pic
*
oox_pic
);
void
convert
(
PPTX
::
Logic
::
SpPr
*
oox_spPr
,
PPTX
::
Logic
::
ShapeStyle
*
oox_sp_style
=
NULL
);
void
convert
(
PPTX
::
Logic
::
TextSpacing
*
oox_spacing
,
cpdoccore
::
odf_types
::
length_or_percent
&
length_or_percent
);
...
...
@@ -371,7 +379,7 @@ public:
void
convert
(
PPTX
::
Logic
::
SolidFill
*
oox_fill
,
DWORD
ARGB
=
0
);
void
convert
(
PPTX
::
Logic
::
PattFill
*
oox_fill
,
DWORD
ARGB
=
0
);
void
convert
(
PPTX
::
Logic
::
EffectLst
*
oox_effect_lst
);
void
convert
(
PPTX
::
Logic
::
Ln
*
oox_line
);
void
convert
(
PPTX
::
Logic
::
Ln
*
oox_line
,
DWORD
ARGB
=
0
);
void
convert
(
PPTX
::
Logic
::
FontRef
*
oox_fontRef
);
void
convert
(
PPTX
::
Logic
::
StyleRef
*
oox_styleRef
,
int
type
);
void
convert
(
PPTX
::
Logic
::
Path2D
*
oox_path2D
);
...
...
@@ -381,7 +389,9 @@ public:
void
convert
(
PPTX
::
Logic
::
UniColor
*
color
,
std
::
wstring
&
hexString
,
_CP_OPT
(
double
)
&
opacity
,
DWORD
ARGB
=
0
);
void
convert
(
PPTX
::
Logic
::
NvSpPr
*
oox_nvSpPr
);
void
convert
(
PPTX
::
Logic
::
CNvPr
*
oox_cnvPr
);
void
convert
(
PPTX
::
Logic
::
CNvCxnSpPr
*
oox_cnvPr
);
void
convert
(
PPTX
::
Logic
::
CNvSpPr
*
oox_cnvSpPr
);
void
convert
(
PPTX
::
Logic
::
NvCxnSpPr
*
oox_nvSpPr
);
void
convert
(
PPTX
::
Logic
::
NvPr
*
oox_nvPr
);
void
convert
(
PPTX
::
Logic
::
Paragraph
*
oox_para
);
void
convert
(
PPTX
::
Logic
::
TextParagraphPr
*
oox_para_props
,
cpdoccore
::
odf_writer
::
style_paragraph_properties
*
paragraph_properties
);
...
...
@@ -394,13 +404,13 @@ public:
void
convert
(
PPTX
::
Logic
::
NvGraphicFramePr
*
oox_framePr
);
void
convert
(
PPTX
::
Logic
::
ChartRec
*
oox_chart
);
void
convert
(
PPTX
::
Logic
::
SmartArt
*
oox_smart_art
);
void
convert
(
PPTX
::
Logic
::
Table
*
oox_table
);
void
convert
(
PPTX
::
Logic
::
LineTo
*
oox_geom_path
);
void
convert
(
PPTX
::
Logic
::
MoveTo
*
oox_geom_path
);
void
convert
(
PPTX
::
Logic
::
ArcTo
*
oox_geom_path
);
void
convert
(
PPTX
::
Logic
::
QuadBezTo
*
oox_geom_path
);
void
convert
(
PPTX
::
Logic
::
CubicBezTo
*
oox_geom_path
);
void
convert
(
PPTX
::
Logic
::
Close
*
oox_geom_path
);
//.chart............................................................................................................................
void
convert
(
OOX
::
Spreadsheet
::
CT_ChartSpace
*
oox_chart
);
void
convert
(
OOX
::
Spreadsheet
::
CT_Title
*
ct_title
);
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
View file @
19960fa3
...
...
@@ -3011,8 +3011,8 @@ void DocxConverter::convert(OOX::CDocDefaults *def_style)
/////////////////////////////////////////////////////////////////////////////////////////////////
//зачемто ?! для OpenOffice для врезок/фреймов нужен базовый стиль - без него другой тип геометрии oO !!!
odt_context
->
styles_context
()
->
create_style
(
L"Frame"
,
odf_types
::
style_family
::
Graphic
,
false
,
true
);
odf_writer
::
style_graphic
_properties
*
graphic_properties
=
odt_context
->
styles_context
()
->
last_state
()
->
get_graphic_properties
();
odt_context
->
styles_context
()
->
create_style
(
L"Frame"
,
odf_types
::
style_family
::
Graphic
,
false
,
true
);
odf_writer
::
graphic_format
_properties
*
graphic_properties
=
odt_context
->
styles_context
()
->
last_state
()
->
get_graphic_properties
();
//if (graphic_properties)graphic_properties->content_.common_background_color_attlist_.fo_background_color_ = odf_types::background_color(odf_types::background_color::Transparent);
}
...
...
@@ -3876,7 +3876,7 @@ void DocxConverter::convert(OOX::Logic::CTc *oox_table_cell)
}
}
odt_context
->
start_table_cell
(
oox_table_cell
->
m_nNumCol
,
covered
,
convert
(
oox_table_cell
->
m_oTableCellProperties
,
oox_table_cell
->
m_nNumCol
+
1
));
odt_context
->
start_table_cell
(
oox_table_cell
->
m_nNumCol
,
covered
,
convert
(
oox_table_cell
->
m_oTableCellProperties
,
oox_table_cell
->
m_nNumCol
+
1
));
if
(
oox_table_cell
->
m_oTableCellProperties
)
{
...
...
@@ -3909,7 +3909,7 @@ void DocxConverter::convert(OOX::Logic::CTc *oox_table_cell)
if
(
id_change_properties
>=
0
)
odt_context
->
end_change
(
id_change_properties
,
3
);
}
bool
DocxConverter
::
convert
(
OOX
::
Logic
::
CTableProperty
*
oox_table_pr
,
odf_writer
::
style_table_properties
*
table_properties
)
bool
DocxConverter
::
convert
(
OOX
::
Logic
::
CTableProperty
*
oox_table_pr
,
odf_writer
::
style_table_properties
*
table_properties
)
{
if
(
oox_table_pr
==
NULL
)
return
false
;
if
(
table_properties
==
NULL
)
return
false
;
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp
View file @
19960fa3
This diff is collapsed.
Click to expand it.
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.h
View file @
19960fa3
...
...
@@ -46,6 +46,7 @@ namespace OOX
}
namespace
PPTX
{
class
TableStyles
;
class
Presentation
;
class
Folder
;
...
...
@@ -55,6 +56,7 @@ namespace PPTX
class
Bg
;
class
Transition
;
class
Timing
;
class
TablePartStyle
;
}
}
...
...
@@ -95,15 +97,30 @@ namespace Oox2Odf
void
convert
(
OOX
::
WritingElement
*
oox_unknown
);
void
convert
(
PPTX
::
Logic
::
CSld
*
oox_slide
,
bool
placeholders
=
true
);
void
convert
(
PPTX
::
Logic
::
Bg
*
oox_background
);
private:
void
convert
(
PPTX
::
Logic
::
CSld
*
oox_slide
,
bool
placeholders
=
true
);
void
convert
(
PPTX
::
Logic
::
Bg
*
oox_background
);
void
convert
(
PPTX
::
Logic
::
Table
*
oox_table
);
void
convert
(
PPTX
::
Logic
::
TableRow
*
oox_table_row
);
void
convert
(
PPTX
::
Logic
::
TableCell
*
oox_table_cell
,
int
numCol
);
void
convert
(
PPTX
::
Logic
::
TablePartStyle
*
oox_table_part_style
);
bool
convert
(
PPTX
::
Logic
::
TableCellProperties
*
oox_table_cell_pr
,
int
col
);
bool
convert
(
PPTX
::
Logic
::
TableCellProperties
*
oox_table_cell_pr
);
void
convert
(
PPTX
::
Logic
::
TableProperties
*
oox_table_pr
);
bool
convert
(
PPTX
::
Logic
::
TableProperties
*
oox_table_pr
,
odf_writer
::
style_table_properties
*
table_properties
);
void
convert
(
PPTX
::
Logic
::
TableProperties
*
oox_table_pr
,
odf_writer
::
style_table_cell_properties
*
table_cell_properties
);
void
convert
(
PPTX
::
Logic
::
Ln
*
oox_ln_boreder
,
std
::
wstring
&
odf_border
);
private:
PPTX
::
Folder
*
pptx_document
;
PPTX
::
Presentation
*
presentation
;
cpdoccore
::
odf_writer
::
package
::
odf_document
*
output_document
;
PPTX
::
Theme
*
current_theme
;
PPTX
::
Theme
*
current_theme
;
PPTX
::
TableStyles
*
current_tableStyles
;
OOX
::
IFileContainer
*
current_slide
;
PPTX
::
Logic
::
ClrMap
*
current_clrMap
;
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/Table/TableCellProperties.h
View file @
19960fa3
...
...
@@ -52,6 +52,7 @@ namespace PPTX
TableCellProperties
()
{
is_empty
=
true
;
}
TableCellProperties
&
operator
=
(
const
TableCellProperties
&
oSrc
)
...
...
@@ -76,6 +77,9 @@ namespace PPTX
Anchor
=
oSrc
.
Anchor
;
AnchorCtr
=
oSrc
.
AnchorCtr
;
HorzOverflow
=
oSrc
.
HorzOverflow
;
is_empty
=
oSrc
.
is_empty
;
return
*
this
;
}
virtual
void
fromXML
(
XmlUtils
::
CXmlLiteReader
&
oReader
)
...
...
@@ -107,9 +111,13 @@ namespace PPTX
else
Fill
.
fromXML
(
oReader
);
}
FillParentPointersForChilds
();
}
void
ReadAttributes
(
XmlUtils
::
CXmlLiteReader
&
oReader
)
{
is_empty
=
(
oReader
.
GetAttributesCount
()
==
0
);
WritingElement_ReadAttributes_Start
(
oReader
)
WritingElement_ReadAttributes_Read_if
(
oReader
,
_T
(
"marL"
),
MarL
)
WritingElement_ReadAttributes_Read_else_if
(
oReader
,
_T
(
"marR"
),
MarR
)
...
...
@@ -123,6 +131,8 @@ namespace PPTX
}
virtual
void
fromXML
(
XmlUtils
::
CXmlNode
&
node
)
{
is_empty
=
(
node
.
GetAttributesCount
()
==
0
);
LnL
=
node
.
ReadNode
(
_T
(
"a:lnL"
));
LnR
=
node
.
ReadNode
(
_T
(
"a:lnR"
));
LnT
=
node
.
ReadNode
(
_T
(
"a:lnT"
));
...
...
@@ -324,7 +334,6 @@ namespace PPTX
pReader
->
Seek
(
_end_rec
);
}
public:
nullable
<
Ln
>
LnL
;
nullable
<
Ln
>
LnR
;
nullable
<
Ln
>
LnT
;
...
...
@@ -335,17 +344,22 @@ namespace PPTX
UniFill
Fill
;
// <xsd:element name="headers" type="CT_Headers" minOccurs="0"/>
nullable_int
MarL
;
//default="91440"
nullable_int
MarR
;
//default="91440"
nullable_int
MarT
;
//default="45720"
nullable_int
MarB
;
//default="45720"
nullable_limit
<
Limit
::
TextVerticalType
>
Vert
;
//default="horz"
nullable_limit
<
Limit
::
TextAnchor
>
Anchor
;
//default="t"
nullable_bool
AnchorCtr
;
//default="false"
nullable_limit
<
Limit
::
HorzOverflow
>
HorzOverflow
;
//default="clip"
nullable_int
MarL
;
//default="91440"
nullable_int
MarR
;
//default="91440"
nullable_int
MarT
;
//default="45720"
nullable_int
MarB
;
//default="45720"
nullable_limit
<
Limit
::
TextVerticalType
>
Vert
;
//default="horz"
nullable_limit
<
Limit
::
TextAnchor
>
Anchor
;
//default="t"
nullable_bool
AnchorCtr
;
//default="false"
nullable_limit
<
Limit
::
HorzOverflow
>
HorzOverflow
;
//default="clip"
bool
is_empty
;
protected:
virtual
void
FillParentPointersForChilds
()
{
is_empty
=
is_empty
&
!
(
LnL
.
IsInit
()
||
LnR
.
IsInit
()
||
LnT
.
IsInit
()
||
LnB
.
IsInit
()
||
LnTlToBr
.
IsInit
()
||
LnBlToTr
.
IsInit
()
||
cell3D
.
IsInit
()
||
Fill
.
is_init
());
if
(
LnL
.
IsInit
())
LnL
->
SetParentPointer
(
this
);
if
(
LnR
.
IsInit
())
...
...
Common/DocxFormat/Source/DocxFormat/Logic/Table.h
View file @
19960fa3
...
...
@@ -618,7 +618,7 @@ namespace OOX
CTableCellProperties
*
GetProperties
()
{
for
(
size_t
nIndex
=
m_arrItems
.
size
()
-
1
;
nIndex
>=
0
;
nIndex
--
)
for
(
int
nIndex
=
(
int
)
m_arrItems
.
size
()
-
1
;
nIndex
>=
0
;
nIndex
--
)
{
if
(
m_arrItems
[
nIndex
]
&&
OOX
::
et_w_tcPr
==
m_arrItems
[
nIndex
]
->
getType
()
)
{
...
...
DesktopEditor/xml/include/xmlutils.h
View file @
19960fa3
...
...
@@ -208,6 +208,8 @@ namespace XmlUtils
std
::
wstring
ReadAttributeBase
(
const
wchar_t
*
bstrName
);
std
::
wstring
ReadAttribute
(
const
std
::
wstring
&
strAttibuteName
);
int
GetAttributesCount
();
std
::
string
GetAttributeA
(
const
std
::
string
&
sName
,
const
std
::
string
&
_default
=
""
);
std
::
string
GetAttributeA
(
const
std
::
wstring
&
sName
,
const
std
::
string
&
_default
=
""
);
...
...
DesktopEditor/xml/src/xmldom.cpp
View file @
19960fa3
...
...
@@ -434,6 +434,15 @@ namespace XmlUtils
{
return
GetAttribute
(
std
::
wstring
(
strAttributeName
),
strDefaultValue
);
}
int
CXmlNode
::
GetAttributesCount
()
{
if
(
IsValid
())
{
return
m_pBase
->
m_attributes
.
size
();
}
else
return
0
;
}
bool
CXmlNode
::
GetAttributeIfExist
(
const
std
::
wstring
&
sName
,
std
::
wstring
&
sOutput
)
{
bool
bRes
=
false
;
...
...
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