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
38813fd1
Commit
38813fd1
authored
Apr 05, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OdfFormatWriter - presentation tables styled
parent
19960fa3
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
375 additions
and
264 deletions
+375
-264
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp
+30
-23
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.h
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.h
+5
-2
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertDrawing.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertDrawing.cpp
+173
-33
ASCOfficeOdfFileW/source/Oox2OdfConverter/Converter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/Converter.cpp
+8
-121
ASCOfficeOdfFileW/source/Oox2OdfConverter/Converter.h
ASCOfficeOdfFileW/source/Oox2OdfConverter/Converter.h
+11
-7
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp
+140
-73
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.h
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.h
+8
-3
ASCOfficePPTXFile/PPTXFormat/Logic/EffectProperties.h
ASCOfficePPTXFile/PPTXFormat/Logic/EffectProperties.h
+0
-2
No files found.
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp
View file @
38813fd1
...
...
@@ -725,7 +725,7 @@ void odf_drawing_context::start_shape(int type)
bool
odf_drawing_context
::
change_text_box_2_wordart
()
{
if
(
impl_
->
current_drawing_state_
.
oox_shape_preset
>
2000
&&
impl_
->
current_drawing_state_
.
oox_shape_preset
<
3000
)
return
fals
e
;
return
tru
e
;
if
(
impl_
->
current_drawing_state_
.
text_box_tableframe
)
return
false
;
if
(
impl_
->
current_drawing_state_
.
elements_
.
empty
())
return
false
;
...
...
@@ -1154,7 +1154,10 @@ _CP_OPT(unsigned int) odf_drawing_context::get_fill_color()
{
return
impl_
->
current_drawing_state_
.
fill_color_
;
}
_CP_OPT
(
odf_types
::
color
)
odf_drawing_context
::
get_line_color
()
{
return
impl_
->
current_graphic_properties
->
svg_stroke_color_
;
}
void
odf_drawing_context
::
set_solid_fill
(
std
::
wstring
hexColor
)
{
if
(
!
impl_
->
current_graphic_properties
)
return
;
...
...
@@ -1180,9 +1183,9 @@ void odf_drawing_context::set_solid_fill(std::wstring hexColor)
case
Line
:
impl_
->
current_graphic_properties
->
svg_stroke_color_
=
hexColor
;
if
(
!
impl_
->
current_graphic_properties
->
draw_stroke_
)
impl_
->
current_graphic_properties
->
draw_stroke_
=
line_style
(
line_style
::
Solid
);
//default
impl_
->
current_graphic_properties
->
draw_stroke_
=
line_style
(
line_style
::
Solid
);
//default
if
(
!
impl_
->
current_graphic_properties
->
svg_stroke_width_
)
impl_
->
current_graphic_properties
->
svg_stroke_width_
=
length
(
length
(
1
,
length
::
pt
).
get_value_unit
(
length
::
cm
),
length
::
cm
);
//default
impl_
->
current_graphic_properties
->
svg_stroke_width_
=
length
(
length
(
1
,
length
::
pt
).
get_value_unit
(
length
::
cm
),
length
::
cm
);
//default
break
;
}
}
...
...
@@ -1654,7 +1657,7 @@ void odf_drawing_context::set_size( _CP_OPT(double) & width_pt, _CP_OPT(double)
{
width_pt
=
*
width_pt
*
impl_
->
group_list_
[
i
]
->
scale_cx
;
}
impl_
->
current_drawing_state_
.
svg_width_
=
length
(
length
(
*
width_pt
,
length
::
pt
).
get_value_unit
(
length
::
cm
),
length
::
cm
);
impl_
->
current_drawing_state_
.
svg_width_
=
length
(
length
(
*
width_pt
,
length
::
pt
).
get_value_unit
(
length
::
cm
),
length
::
cm
);
}
if
(
height_pt
)
{
...
...
@@ -1662,21 +1665,21 @@ void odf_drawing_context::set_size( _CP_OPT(double) & width_pt, _CP_OPT(double)
{
height_pt
=
*
height_pt
*
impl_
->
group_list_
[
i
]
->
scale_cy
;
}
impl_
->
current_drawing_state_
.
svg_height_
=
length
(
length
(
*
height_pt
,
length
::
pt
).
get_value_unit
(
length
::
cm
),
length
::
cm
);
impl_
->
current_drawing_state_
.
svg_height_
=
length
(
length
(
*
height_pt
,
length
::
pt
).
get_value_unit
(
length
::
cm
),
length
::
cm
);
}
}
else
{
if
(
!
impl_
->
current_drawing_state_
.
svg_width_
&&
width_pt
)
impl_
->
current_drawing_state_
.
svg_width_
=
length
(
length
(
*
width_pt
,
length
::
pt
).
get_value_unit
(
length
::
cm
),
length
::
cm
);
impl_
->
current_drawing_state_
.
svg_width_
=
length
(
length
(
*
width_pt
,
length
::
pt
).
get_value_unit
(
length
::
cm
),
length
::
cm
);
if
(
!
impl_
->
current_drawing_state_
.
svg_height_
&&
height_pt
)
impl_
->
current_drawing_state_
.
svg_height_
=
length
(
length
(
*
height_pt
,
length
::
pt
).
get_value_unit
(
length
::
cm
),
length
::
cm
);
impl_
->
current_drawing_state_
.
svg_height_
=
length
(
length
(
*
height_pt
,
length
::
pt
).
get_value_unit
(
length
::
cm
),
length
::
cm
);
}
}
void
odf_drawing_context
::
set_line_width
(
double
pt
)
{
if
(
!
impl_
->
current_graphic_properties
)
return
;
impl_
->
current_graphic_properties
->
svg_stroke_width_
=
length
(
length
(
pt
,
length
::
pt
).
get_value_unit
(
length
::
cm
),
length
::
cm
);
impl_
->
current_graphic_properties
->
svg_stroke_width_
=
length
(
length
(
pt
,
length
::
pt
).
get_value_unit
(
length
::
cm
),
length
::
cm
);
}
void
odf_drawing_context
::
set_line_tail
(
int
type
,
int
len
,
int
width
)
...
...
@@ -1688,11 +1691,11 @@ void odf_drawing_context::set_line_tail(int type, int len, int width)
switch
(
width
)
{
case
0
:
//lineendwidthLarge
impl_
->
current_graphic_properties
->
draw_marker_end_width_
=
length
(
0.4
,
length
::
cm
);
break
;
impl_
->
current_graphic_properties
->
draw_marker_end_width_
=
length
(
0.4
,
length
::
cm
);
break
;
case
1
:
//lineendwidthMedium
impl_
->
current_graphic_properties
->
draw_marker_end_width_
=
length
(
0.3
,
length
::
cm
);
break
;
impl_
->
current_graphic_properties
->
draw_marker_end_width_
=
length
(
0.3
,
length
::
cm
);
break
;
case
2
:
//lineendwidthSmall
impl_
->
current_graphic_properties
->
draw_marker_end_width_
=
length
(
0.2
,
length
::
cm
);
break
;
impl_
->
current_graphic_properties
->
draw_marker_end_width_
=
length
(
0.2
,
length
::
cm
);
break
;
}
}
void
odf_drawing_context
::
set_line_head
(
int
type
,
int
len
,
int
width
)
...
...
@@ -1704,11 +1707,11 @@ void odf_drawing_context::set_line_head(int type, int len, int width)
switch
(
width
)
{
case
0
:
//lineendwidthLarge
impl_
->
current_graphic_properties
->
draw_marker_start_width_
=
length
(
0.4
,
length
::
cm
);
break
;
impl_
->
current_graphic_properties
->
draw_marker_start_width_
=
length
(
0.4
,
length
::
cm
);
break
;
case
1
:
//lineendwidthMedium
impl_
->
current_graphic_properties
->
draw_marker_start_width_
=
length
(
0.3
,
length
::
cm
);
break
;
impl_
->
current_graphic_properties
->
draw_marker_start_width_
=
length
(
0.3
,
length
::
cm
);
break
;
case
2
:
//lineendwidthSmall
impl_
->
current_graphic_properties
->
draw_marker_start_width_
=
length
(
0.2
,
length
::
cm
);
break
;
impl_
->
current_graphic_properties
->
draw_marker_start_width_
=
length
(
0.2
,
length
::
cm
);
break
;
}
}
...
...
@@ -1931,14 +1934,18 @@ void odf_drawing_context::set_textarea_writing_mode(int mode)
}
void
odf_drawing_context
::
set_textarea_padding
(
_CP_OPT
(
double
)
&
left
,
_CP_OPT
(
double
)
&
top
,
_CP_OPT
(
double
)
&
right
,
_CP_OPT
(
double
)
&
bottom
)
//in
cm
void
odf_drawing_context
::
set_textarea_padding
(
_CP_OPT
(
double
)
&
left
,
_CP_OPT
(
double
)
&
top
,
_CP_OPT
(
double
)
&
right
,
_CP_OPT
(
double
)
&
bottom
)
//in
pt
{
if
(
!
impl_
->
current_graphic_properties
)
return
;
if
(
left
)
impl_
->
current_graphic_properties
->
common_padding_attlist_
.
fo_padding_left_
=
length
(
*
left
,
length
::
cm
);
if
(
top
)
impl_
->
current_graphic_properties
->
common_padding_attlist_
.
fo_padding_top_
=
length
(
*
top
,
length
::
cm
);
if
(
right
)
impl_
->
current_graphic_properties
->
common_padding_attlist_
.
fo_padding_right_
=
length
(
*
right
,
length
::
cm
);
if
(
bottom
)
impl_
->
current_graphic_properties
->
common_padding_attlist_
.
fo_padding_bottom_
=
length
(
*
bottom
,
length
::
cm
);
if
(
left
)
impl_
->
current_graphic_properties
->
common_padding_attlist_
.
fo_padding_left_
=
length
(
*
left
,
length
::
pt
);
if
(
top
)
impl_
->
current_graphic_properties
->
common_padding_attlist_
.
fo_padding_top_
=
length
(
*
top
,
length
::
pt
);
if
(
right
)
impl_
->
current_graphic_properties
->
common_padding_attlist_
.
fo_padding_right_
=
length
(
*
right
,
length
::
pt
);
if
(
bottom
)
impl_
->
current_graphic_properties
->
common_padding_attlist_
.
fo_padding_bottom_
=
length
(
*
bottom
,
length
::
pt
);
}
void
odf_drawing_context
::
set_textarea_rotate
(
double
dVal
)
{
if
(
!
impl_
->
current_graphic_properties
)
return
;
}
...
...
@@ -2019,9 +2026,9 @@ void odf_drawing_context::start_text_box()
//if (impl_->is_footer_ ==false && impl_->is_header_ ==false)
// set_text_box_parent_style(L"Frame");
start_area_properties
()
;
set_no_fill
(
);
end_area_properties
();
impl_
->
current_graphic_properties
->
common_draw_fill_attlist_
.
draw_fill_
=
draw_fill
::
none
;
//impl_->current_graphic_properties->draw_stroke_ = line_style (line_style::None
);
}
void
odf_drawing_context
::
set_text_box_min_size
(
bool
val
)
...
...
ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.h
View file @
38813fd1
...
...
@@ -174,7 +174,7 @@ public:
void
set_flip_H
(
bool
bVal
);
void
set_flip_V
(
bool
bVal
);
void
set_rotate
(
double
i
Val
);
void
set_rotate
(
double
d
Val
);
void
set_no_fill
();
void
set_type_fill
(
int
type
);
//for area - temp for objects
...
...
@@ -197,6 +197,8 @@ public:
_CP_OPT
(
unsigned
int
)
get_fill_color
();
void
set_fill_color
(
unsigned
int
color
);
_CP_OPT
(
odf_types
::
color
)
get_line_color
();
//void start_shadow_properties();
//void end_shadow_properties();
// пока одной функией ..
...
...
@@ -204,11 +206,12 @@ public:
void
set_text
(
odf_text_context
*
text_context
);
void
set_textarea_vertical_align
(
int
align
);
void
set_textarea_padding
(
_CP_OPT
(
double
)
&
left
,
_CP_OPT
(
double
)
&
top
,
_CP_OPT
(
double
)
&
right
,
_CP_OPT
(
double
)
&
bottom
);
//in
cm
void
set_textarea_padding
(
_CP_OPT
(
double
)
&
left
,
_CP_OPT
(
double
)
&
top
,
_CP_OPT
(
double
)
&
right
,
_CP_OPT
(
double
)
&
bottom
);
//in
pt
void
set_textarea_writing_mode
(
int
mode
);
void
set_textarea_wrap
(
bool
val
);
void
set_textarea_fontcolor
(
std
::
wstring
hexColor
);
void
set_textarea_font
(
std
::
wstring
&
latin
,
std
::
wstring
&
cs
,
std
::
wstring
&
ea
);
void
set_textarea_rotate
(
double
dVal
);
void
set_layer
(
std
::
wstring
val
);
//////////////////////////////////////////////////////////////////////////////////////
void
start_gradient_style
();
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertDrawing.cpp
View file @
38813fd1
...
...
@@ -124,22 +124,34 @@ void OoxConverter::convert(PPTX::Logic::Xfrm *oox_xfrm)
if
(
oox_xfrm
->
offX
.
IsInit
())
x
=
Emu2Pt
(
*
oox_xfrm
->
offX
);
if
(
oox_xfrm
->
offY
.
IsInit
())
y
=
Emu2Pt
(
*
oox_xfrm
->
offY
);
odf_context
()
->
drawing_context
()
->
set_position
(
x
,
y
);
if
(
oox_xfrm
->
extX
.
IsInit
())
width
=
Emu2Pt
(
*
oox_xfrm
->
extX
);
if
(
oox_xfrm
->
extY
.
IsInit
())
height
=
Emu2Pt
(
*
oox_xfrm
->
extY
);
odf_context
()
->
drawing_context
()
->
set_position
(
x
,
y
);
odf_context
()
->
drawing_context
()
->
set_size
(
width
,
height
);
if
(
oox_xfrm
->
flipH
.
get_value_or
(
false
))
odf_context
()
->
drawing_context
()
->
set_flip_H
(
true
);
if
(
oox_xfrm
->
flipV
.
get_value_or
(
false
))
odf_context
()
->
drawing_context
()
->
set_flip_V
(
true
);
if
(
oox_xfrm
->
flipH
.
get_value_or
(
false
))
odf_context
()
->
drawing_context
()
->
set_flip_H
(
true
);
if
(
oox_xfrm
->
flipV
.
get_value_or
(
false
))
odf_context
()
->
drawing_context
()
->
set_flip_V
(
true
);
if
(
oox_xfrm
->
rot
.
get_value_or
(
0
)
>
0
)
odf_context
()
->
drawing_context
()
->
set_rotate
(
360.
-
oox_xfrm
->
rot
.
get_value_or
(
0
)
/
60000.
);
}
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
Xfrm
*
oox_txbx
,
PPTX
::
Logic
::
Xfrm
*
oox_xfrm
)
{
if
(
oox_txbx
==
NULL
)
return
;
if
(
oox_xfrm
==
NULL
)
return
;
if
(
oox_txbx
->
rot
.
IsInit
()
&&
oox_xfrm
->
rot
.
IsInit
())
{
int
angle1
=
*
oox_txbx
->
rot
/
60000
;
int
angle2
=
*
oox_xfrm
->
rot
/
60000
;
oox_txbx
->
rot
=
(
angle1
+
angle2
)
*
60000
;
}
convert
(
oox_txbx
);
}
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
Pic
*
oox_picture
)
{
if
(
!
oox_picture
)
return
;
...
...
@@ -325,11 +337,30 @@ void OoxConverter::convert(PPTX::Logic::Shape *oox_shape)
//имя, описалово, номер ...
convert
(
&
oox_shape
->
nvSpPr
);
convert
(
oox_shape
->
txBody
.
GetPointer
(),
oox_shape
->
style
.
GetPointer
());
if
(
oox_shape
->
txXfrm
.
IsInit
()
==
false
)
{
convert
(
oox_shape
->
txBody
.
GetPointer
(),
oox_shape
->
style
.
GetPointer
());
}
odf_context
()
->
drawing_context
()
->
end_shape
();
odf_context
()
->
drawing_context
()
->
end_drawing
();
if
(
oox_shape
->
txXfrm
.
IsInit
())
{
odf_context
()
->
drawing_context
()
->
start_drawing
();
odf_context
()
->
drawing_context
()
->
start_text_box
();
convert
(
oox_shape
->
txXfrm
.
GetPointer
(),
oox_shape
->
spPr
.
xfrm
.
GetPointer
());
convert
(
oox_shape
->
txBody
.
GetPointer
(),
oox_shape
->
style
.
GetPointer
());
odf_context
()
->
drawing_context
()
->
start_line_properties
();
odf_context
()
->
drawing_context
()
->
set_no_fill
();
odf_context
()
->
drawing_context
()
->
end_line_properties
();
odf_context
()
->
drawing_context
()
->
end_text_box
();
odf_context
()
->
drawing_context
()
->
end_drawing
();
}
}
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
SpPr
*
oox_spPr
,
PPTX
::
Logic
::
ShapeStyle
*
oox_sp_style
)
{
...
...
@@ -359,14 +390,7 @@ void OoxConverter::convert(PPTX::Logic::SpPr *oox_spPr, PPTX::Logic::ShapeStyle*
odf_context
()
->
drawing_context
()
->
start_line_properties
();
{
if
(
oox_spPr
->
ln
.
IsInit
())
{
convert
(
oox_spPr
->
ln
.
GetPointer
());
//CLineProperties
}
else
if
(
oox_sp_style
)
{
convert
(
&
oox_sp_style
->
lnRef
,
2
);
}
convert
(
oox_spPr
->
ln
.
GetPointer
(),
0
,
oox_sp_style
);
}
odf_context
()
->
drawing_context
()
->
end_line_properties
();
//-----------------------------------------------------------------------------------------------------------------------------
...
...
@@ -427,6 +451,64 @@ void OoxConverter::convert(PPTX::Logic::CustGeom *oox_cust_geom)
convert
(
&
oox_cust_geom
->
pathLst
[
i
]);
}
}
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
EffectLst
*
oox_effect_list
)
{
if
(
!
oox_effect_list
)
return
;
convert
(
oox_effect_list
->
innerShdw
.
GetPointer
());
convert
(
oox_effect_list
->
outerShdw
.
GetPointer
());
convert
(
oox_effect_list
->
prstShdw
.
GetPointer
());
}
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
InnerShdw
*
oox_shadow
)
{
if
(
oox_shadow
==
NULL
)
return
;
std
::
wstring
hexColor
;
_CP_OPT
(
double
)
opacity
;
convert
(
&
oox_shadow
->
Color
,
hexColor
,
opacity
);
odf_context
()
->
drawing_context
()
->
set_shadow
(
2
,
hexColor
,
opacity
,
oox_shadow
->
dist
.
IsInit
()
?
oox_shadow
->
dist
.
get
()
/
12700.
:
0
);
}
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
OuterShdw
*
oox_shadow
)
{
if
(
oox_shadow
==
NULL
)
return
;
std
::
wstring
hexColor
;
_CP_OPT
(
double
)
opacity
;
convert
(
&
oox_shadow
->
Color
,
hexColor
,
opacity
);
odf_context
()
->
drawing_context
()
->
set_shadow
(
1
,
hexColor
,
opacity
,
oox_shadow
->
dist
.
IsInit
()
?
oox_shadow
->
dist
.
get
()
/
12700.
:
0
);
}
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
PrstShdw
*
oox_shadow
)
{
if
(
oox_shadow
==
NULL
)
return
;
std
::
wstring
hexColor
;
_CP_OPT
(
double
)
opacity
;
convert
(
&
oox_shadow
->
Color
,
hexColor
,
opacity
);
//odf_context()->drawing_context()->set_shadow(1, hexColor, opacity, oox_shadow->dist.IsInit() ? oox_shadow->dist.get() / 12700. : 0);
}
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
EffectStyle
*
oox_effects
)
{
if
(
!
oox_effects
)
return
;
if
(
oox_effects
->
EffectList
.
is_init
())
{
convert
(
oox_effects
->
EffectList
.
List
.
GetPointer
());
}
if
(
oox_effects
->
scene3d
.
IsInit
())
{
}
if
(
oox_effects
->
sp3d
.
IsInit
())
{
}
}
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
Path2D
*
oox_geom_path
)
{
if
(
!
oox_geom_path
)
return
;
...
...
@@ -673,20 +755,51 @@ void OoxConverter::convert(PPTX::Logic::SolidFill *oox_fill, DWORD nARGB)
odf_context
()
->
drawing_context
()
->
set_opacity
(
*
opacity
);
}
}
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
PattFill
*
oox_fill
,
DWORD
nARGB
)
{
if
(
!
oox_fill
)
return
;
}
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
EffectLst
*
oox_effect_lst
)
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
PattFill
*
oox_pattern_fill
,
DWORD
nARGB
)
{
if
(
!
oox_effect_lst
)
return
;
if
(
!
oox_pattern_fill
)
return
;
odf_context
()
->
drawing_context
()
->
start_hatch_style
();
{
if
(
oox_pattern_fill
->
prst
.
IsInit
())
{
odf_context
()
->
drawing_context
()
->
set_hatch_type
(
oox_pattern_fill
->
prst
->
GetBYTECode
());
}
if
(
oox_pattern_fill
->
fgClr
.
is_init
())
{
std
::
wstring
hexColor
;
_CP_OPT
(
double
)
opacity
;
convert
(
&
oox_pattern_fill
->
fgClr
,
hexColor
,
opacity
,
nARGB
);
odf_context
()
->
drawing_context
()
->
set_hatch_line_color
(
hexColor
);
}
if
(
oox_pattern_fill
->
bgClr
.
is_init
())
{
std
::
wstring
hexColor
;
_CP_OPT
(
double
)
opacity
;
convert
(
&
oox_pattern_fill
->
bgClr
,
hexColor
,
opacity
,
nARGB
);
odf_context
()
->
drawing_context
()
->
set_hatch_area_color
(
hexColor
);
}
}
odf_context
()
->
drawing_context
()
->
end_hatch_style
();
}
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
Ln
*
oox_line_prop
,
DWORD
ARGB
)
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
Ln
*
oox_line_prop
,
DWORD
ARGB
,
PPTX
::
Logic
::
ShapeStyle
*
oox_sp_style
)
{
if
(
oox_sp_style
)
{
convert
(
&
oox_sp_style
->
lnRef
,
2
);
}
if
(
!
oox_line_prop
)
return
;
convert
(
&
oox_line_prop
->
Fill
,
ARGB
);
if
(
oox_line_prop
->
Fill
.
is_init
())
{
convert
(
&
oox_line_prop
->
Fill
,
ARGB
);
}
if
(
oox_line_prop
->
w
.
IsInit
())
{
odf_context
()
->
drawing_context
()
->
set_line_width
(
oox_line_prop
->
w
.
get
()
/
12700.
);
//pt
...
...
@@ -750,10 +863,10 @@ void OoxConverter::convert(PPTX::Logic::BodyPr *oox_bodyPr)
_CP_OPT
(
double
)
lIns
,
tIns
,
rIns
,
bIns
;
if
(
oox_bodyPr
->
lIns
.
IsInit
())
lIns
=
oox_bodyPr
->
lIns
.
get
()
/
12700.
/
28.34467120181406
;
//cm
if
(
oox_bodyPr
->
tIns
.
IsInit
())
tIns
=
oox_bodyPr
->
tIns
.
get
()
/
12700.
/
28.34467120181406
;
if
(
oox_bodyPr
->
rIns
.
IsInit
())
rIns
=
oox_bodyPr
->
rIns
.
get
()
/
12700.
/
28.34467120181406
;
if
(
oox_bodyPr
->
bIns
.
IsInit
())
bIns
=
oox_bodyPr
->
bIns
.
get
()
/
12700.
/
28.34467120181406
;
if
(
oox_bodyPr
->
lIns
.
IsInit
())
lIns
=
oox_bodyPr
->
lIns
.
get
()
/
12700.
;
//pt
if
(
oox_bodyPr
->
tIns
.
IsInit
())
tIns
=
oox_bodyPr
->
tIns
.
get
()
/
12700.
;
if
(
oox_bodyPr
->
rIns
.
IsInit
())
rIns
=
oox_bodyPr
->
rIns
.
get
()
/
12700.
;
if
(
oox_bodyPr
->
bIns
.
IsInit
())
bIns
=
oox_bodyPr
->
bIns
.
get
()
/
12700.
;
odf_context
()
->
drawing_context
()
->
set_textarea_padding
(
lIns
,
tIns
,
rIns
,
bIns
);
...
...
@@ -765,12 +878,12 @@ void OoxConverter::convert(PPTX::Logic::BodyPr *oox_bodyPr)
//+ style section
//+element text:section в котором параграфы
}
//if (oox_bodyPr->spAutoFit.IsInit()
)
//
{
//
//изменяемы размеры
//
odf_context()->drawing_context()->set_text_box_min_size(true);//уже выставленые в min
if
(
oox_bodyPr
->
Fit
.
type
==
PPTX
::
Logic
::
TextFit
::
FitSpAuto
)
{
//изменяемы размеры
odf_context
()
->
drawing_context
()
->
set_text_box_min_size
(
true
);
//уже выставленые в min
//
}
}
if
(
oox_bodyPr
->
fromWordArt
.
IsInit
()
&&
oox_bodyPr
->
prstTxWarp
.
IsInit
())
{
for
(
size_t
i
=
0
;
i
<
oox_bodyPr
->
prstTxWarp
->
avLst
.
size
();
i
++
)
...
...
@@ -955,6 +1068,33 @@ void OoxConverter::convert(PPTX::Logic::RunProperties *oox_run_pr, odf_writer::s
if
(
!
oox_run_pr
)
return
;
if
(
!
text_properties
)
return
;
PPTX
::
Logic
::
GradFill
*
gradFill
=
&
oox_run_pr
->
Fill
.
as
<
PPTX
::
Logic
::
GradFill
>
();
if
(
gradFill
)
{
if
(
odf_context
()
->
drawing_context
()
->
change_text_box_2_wordart
())
{
odf_context
()
->
drawing_context
()
->
start_area_properties
();
{
convert
(
gradFill
);
}
odf_context
()
->
drawing_context
()
->
end_area_properties
();
}
}
if
(
oox_run_pr
->
ln
.
IsInit
())
{
if
(
odf_context
()
->
drawing_context
()
->
change_text_box_2_wordart
())
{
odf_context
()
->
drawing_context
()
->
start_line_properties
();
{
odf_context
()
->
drawing_context
()
->
set_line_dash_preset
(
6
);
convert
(
oox_run_pr
->
ln
.
GetPointer
());
}
odf_context
()
->
drawing_context
()
->
end_line_properties
();
}
}
//
if
(
oox_run_pr
->
b
.
IsInit
())
{
if
(
oox_run_pr
->
b
.
get
()
==
true
)
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/Converter.cpp
View file @
38813fd1
...
...
@@ -285,23 +285,23 @@ void OoxConverter::convert(OOX::WritingElement *oox_unknown)
}
break
;
case
OOX
:
:
et_p_r
:
{
PPTX
::
Logic
::
Run
*
pRun
=
dynamic_cast
<
PPTX
::
Logic
::
Run
*>
(
oox_unknown
);
convert
(
pRun
);
convert
(
dynamic_cast
<
PPTX
::
Logic
::
Run
*>
(
oox_unknown
));
}
break
;
case
OOX
:
:
et_p_fld
:
{
PPTX
::
Logic
::
Fld
*
pFld
=
dynamic_cast
<
PPTX
::
Logic
::
Fld
*>
(
oox_unknown
);
convert
(
pFld
);
convert
(
dynamic_cast
<
PPTX
::
Logic
::
Fld
*>
(
oox_unknown
));
}
break
;
case
OOX
:
:
et_p_br
:
{
PPTX
::
Logic
::
Br
*
pBr
=
dynamic_cast
<
PPTX
::
Logic
::
Br
*>
(
oox_unknown
);
convert
(
pBr
);
convert
(
dynamic_cast
<
PPTX
::
Logic
::
Br
*>
(
oox_unknown
));
}
break
;
case
OOX
:
:
et_p_MathPara
:
{
PPTX
::
Logic
::
MathParaWrapper
*
pMathPara
=
dynamic_cast
<
PPTX
::
Logic
::
MathParaWrapper
*>
(
oox_unknown
);
convert
(
pMathPara
);
convert
(
dynamic_cast
<
PPTX
::
Logic
::
MathParaWrapper
*>
(
oox_unknown
));
}
break
;
case
OOX
:
:
et_a_effectStyle
:
{
convert
(
dynamic_cast
<
PPTX
::
Logic
::
EffectStyle
*>
(
oox_unknown
));
}
break
;
default:
{
...
...
@@ -335,119 +335,6 @@ void OoxConverter::convert(OOX::WritingElement *oox_unknown)
// }
// odf_context()->drawing_context()->end_group();
//}
////-----------------------------------------------------------------------------------------------------------------
//void OoxConverter::convert(OOX::Drawing::CEffectList *oox_effect_list, std::wstring *change_sheme_color)
//{
// if (oox_effect_list == NULL) return;
//
// for (size_t i = 0; i < oox_effect_list->m_arrEffects.size(); i++)
// {
// switch(oox_effect_list->m_arrEffects[i]->getType())
// {
// case OOX::et_a_outerShdw:
// {
// OOX::Drawing::COuterShadowEffect * shadow = dynamic_cast<OOX::Drawing::COuterShadowEffect *>(oox_effect_list->m_arrEffects[i]);
// convert(shadow, change_sheme_color);
// }break;
// case OOX::et_a_innerShdw:
// {
// OOX::Drawing::CInnerShadowEffect * shadow = dynamic_cast<OOX::Drawing::CInnerShadowEffect *>(oox_effect_list->m_arrEffects[i]);
// convert(shadow, change_sheme_color);
// }break;
// case OOX::et_a_prstShdw:
// {
// OOX::Drawing::CPresetShadowEffect * shadow = dynamic_cast<OOX::Drawing::CPresetShadowEffect *>(oox_effect_list->m_arrEffects[i]);
// //convert(shadow, change_sheme_color);
// }break;
// case OOX::et_a_reflection:
// {
// OOX::Drawing::CReflectionEffect * refelection = dynamic_cast<OOX::Drawing::CReflectionEffect *>(oox_effect_list->m_arrEffects[i]);
// }
// //CGlowEffect, CBlurEffect, CFillOverlayEffect, CSoftEdgesEffect
// }
// }
//}
//void OoxConverter::convert(OOX::Drawing::COuterShadowEffect *oox_shadow, std::wstring *change_sheme_color)
//{
// if (oox_shadow == NULL) return;
//
// std::wstring hexColor;
// _CP_OPT(double) opacity;
//
// std::wstring keep_sheme_color;
// if (oox_shadow->m_eType == OOX::Drawing::colorSheme && change_sheme_color)
// {
// keep_sheme_color = oox_shadow->m_oShemeClr.m_oVal.ToString();
// oox_shadow->m_oShemeClr.m_oVal.FromString(*change_sheme_color);
// }
// convert(dynamic_cast<OOX::Drawing::CColor*>(oox_shadow), hexColor, opacity);
// if (keep_sheme_color.length() > 0) oox_shadow->m_oShemeClr.m_oVal.FromString(keep_sheme_color);
//
// odf_context()->drawing_context()->set_shadow(1, hexColor, opacity, oox_shadow->m_oDist.ToPoints());
//
// //SimpleTypes::CPositiveFixedAngle<0> m_oDir;
// //SimpleTypes::CPositiveCoordinate<0> m_oBlurRad;
////-------------
// //SimpleTypes::CRectAlignment<SimpleTypes::rectalignmentB> m_oAlgn;
// //SimpleTypes::CFixedAngle<> m_oKx;
// //SimpleTypes::CFixedAngle<> m_oKy;
// //SimpleTypes::COnOff<SimpleTypes::onoffTrue> m_oRotWithShape;
// //SimpleTypes::CPercentage m_oSx;
// //SimpleTypes::CPercentage m_oSy;
//
//}
//void OoxConverter::convert(OOX::Drawing::CInnerShadowEffect *oox_shadow, std::wstring *change_sheme_color)
//{
// if (oox_shadow == NULL) return;
//
// std::wstring hexColor;
// _CP_OPT(double) opacity;
//
// std::wstring keep_sheme_color;
// if (oox_shadow->m_eType == OOX::Drawing::colorSheme && change_sheme_color)
// {
// keep_sheme_color = oox_shadow->m_oShemeClr.m_oVal.ToString();
// oox_shadow->m_oShemeClr.m_oVal.FromString(*change_sheme_color);
// }
// convert(dynamic_cast<OOX::Drawing::CColor*>(oox_shadow), hexColor, opacity);
// if (keep_sheme_color.length() > 0) oox_shadow->m_oShemeClr.m_oVal.FromString(keep_sheme_color);
//
// odf_context()->drawing_context()->set_shadow(2, hexColor, opacity, oox_shadow->m_oDist.ToPoints());
//
//}
//void OoxConverter::convert(OOX::Drawing::CPatternFillProperties *oox_pattern_fill, std::wstring *change_sheme_color)
//{
// if (!oox_pattern_fill)return;
//
// odf_context()->drawing_context()->start_hatch_style();
// {
// if (oox_pattern_fill->m_oPrst.IsInit())
// {
// odf_context()->drawing_context()->set_hatch_type(oox_pattern_fill->m_oPrst->GetValue());
// }
// if (oox_pattern_fill->m_oFgClr.IsInit())
// {
// std::wstring hexColor;
// _CP_OPT(double) opacity;
// convert((OOX::Drawing::CColor*)oox_pattern_fill->m_oFgClr.GetPointer(),hexColor, opacity);
//
// odf_context()->drawing_context()->set_hatch_line_color(hexColor);
// }
// if (oox_pattern_fill->m_oBgClr.IsInit())
// {
// if (change_sheme_color && oox_pattern_fill->m_oBgClr.IsInit() && oox_pattern_fill->m_oBgClr->m_eType == OOX::Drawing::colorSheme)
// oox_pattern_fill->m_oBgClr->m_oShemeClr.m_oVal.FromString(*change_sheme_color);
//
// std::wstring hexColor;
// _CP_OPT(double) opacity;
// convert((OOX::Drawing::CColor*)oox_pattern_fill->m_oBgClr.GetPointer(),hexColor, opacity);
//
// odf_context()->drawing_context()->set_hatch_area_color(hexColor);
// }
// }
// odf_context()->drawing_context()->end_hatch_style();
//
//}
bool
OoxConverter
::
convert
(
std
::
wstring
sSchemeColor
,
DWORD
&
argb
)
{
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/Converter.h
View file @
38813fd1
...
...
@@ -270,11 +270,6 @@ namespace PPTX
class
Shape
;
class
CxnSp
;
class
Pic
;
class
Table
;
class
TableProperties
;
class
TableRow
;
class
TableCell
;
class
TableCellProperties
;
class
SmartArt
;
class
ChartRec
;
class
SpPr
;
...
...
@@ -319,6 +314,10 @@ namespace PPTX
class
QuadBezTo
;
class
CubicBezTo
;
class
Close
;
class
EffectStyle
;
class
InnerShdw
;
class
OuterShdw
;
class
PrstShdw
;
}
}
...
...
@@ -371,6 +370,7 @@ public:
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
);
void
convert
(
PPTX
::
Logic
::
Xfrm
*
oox_xfrm
);
void
convert
(
PPTX
::
Logic
::
Xfrm
*
oox_txbx
,
PPTX
::
Logic
::
Xfrm
*
oox_xfrm
);
int
convert
(
PPTX
::
Logic
::
PrstTxWarp
*
oox_text_preset
);
void
convert
(
PPTX
::
Logic
::
PrstGeom
*
oox_geom
);
void
convert
(
PPTX
::
Logic
::
CustGeom
*
oox_geom
);
...
...
@@ -378,8 +378,7 @@ public:
void
convert
(
PPTX
::
Logic
::
GradFill
*
oox_fill
,
DWORD
ARGB
=
0
);
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
,
DWORD
ARGB
=
0
);
void
convert
(
PPTX
::
Logic
::
Ln
*
oox_line
,
DWORD
ARGB
=
0
,
PPTX
::
Logic
::
ShapeStyle
*
oox_sp_style
=
NULL
);
void
convert
(
PPTX
::
Logic
::
FontRef
*
oox_fontRef
);
void
convert
(
PPTX
::
Logic
::
StyleRef
*
oox_styleRef
,
int
type
);
void
convert
(
PPTX
::
Logic
::
Path2D
*
oox_path2D
);
...
...
@@ -410,6 +409,11 @@ public:
void
convert
(
PPTX
::
Logic
::
QuadBezTo
*
oox_geom_path
);
void
convert
(
PPTX
::
Logic
::
CubicBezTo
*
oox_geom_path
);
void
convert
(
PPTX
::
Logic
::
Close
*
oox_geom_path
);
void
convert
(
PPTX
::
Logic
::
EffectStyle
*
oox_effect
);
void
convert
(
PPTX
::
Logic
::
EffectLst
*
oox_effect_list
);
void
convert
(
PPTX
::
Logic
::
InnerShdw
*
oox_effect
);
void
convert
(
PPTX
::
Logic
::
OuterShdw
*
oox_effect
);
void
convert
(
PPTX
::
Logic
::
PrstShdw
*
oox_effect
);
//.chart............................................................................................................................
void
convert
(
OOX
::
Spreadsheet
::
CT_ChartSpace
*
oox_chart
);
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp
View file @
38813fd1
This diff is collapsed.
Click to expand it.
ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.h
View file @
38813fd1
...
...
@@ -57,6 +57,12 @@ namespace PPTX
class
Transition
;
class
Timing
;
class
TablePartStyle
;
class
Table
;
class
TableProperties
;
class
TableRow
;
class
TableCell
;
class
TableCellProperties
;
class
TcBdr
;
}
}
...
...
@@ -109,10 +115,9 @@ namespace Oox2Odf
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
::
TcBdr
*
oox_table_borders
);
void
convert
(
PPTX
::
Logic
::
Ln
*
oox_ln_bor
e
der
,
std
::
wstring
&
odf_border
);
void
convert
(
PPTX
::
Logic
::
Ln
*
oox_ln_border
,
std
::
wstring
&
odf_border
);
private:
PPTX
::
Folder
*
pptx_document
;
PPTX
::
Presentation
*
presentation
;
...
...
ASCOfficePPTXFile/PPTXFormat/Logic/EffectProperties.h
View file @
38813fd1
...
...
@@ -122,8 +122,6 @@ namespace PPTX
List
->
toXmlWriter
(
pWriter
);
}
//public:
private:
nullable
<
WrapperWritingElement
>
List
;
protected:
virtual
void
FillParentPointersForChilds
(){};
...
...
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