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
Show 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
);
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
)
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
PattFill
*
oox_
pattern_
fill
,
DWORD
nARGB
)
{
if
(
!
oox_fill
)
return
;
}
void
OoxConverter
::
convert
(
PPTX
::
Logic
::
EffectLst
*
oox_effect_lst
)
{
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
;
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
...
...
@@ -227,12 +227,14 @@ void PptxConverter::convert_slides()
continue
;
// странное ... слайд 38 в FY10_September_Partner_Call.pptx
}
current_theme
=
slide
->
theme
.
operator
->
();
current_clrMap
=
NULL
;
std
::
wstring
master_style_name
;
std
::
wstring
layout_style_name
;
if
(
slide
->
Master
.
IsInit
())
{
current_clrMap
=
&
slide
->
Master
->
clrMap
;
// Master & Layout
std
::
wstring
master_layout
=
slide
->
Master
->
m_sOutputFilename
+
slide
->
Layout
->
m_sOutputFilename
;
...
...
@@ -251,11 +253,10 @@ void PptxConverter::convert_slides()
master_style_name
+=
std
::
to_wstring
(
m_mapMasters
.
size
());
odp_context
->
start_master_slide
(
master_style_name
);
current_clrMap
=
&
slide
->
Master
->
clrMap
;
current_slide
=
slide
->
Master
.
operator
->
();
convert
(
&
slide
->
Master
->
cSld
,
false
);
//slide->Layout->showMasterSp.IsInit() ? *slide->Layout->showMasterSp : true);
if
(
slide
->
Layout
->
clrMapOvr
.
IsInit
())
if
(
slide
->
Layout
->
clrMapOvr
.
IsInit
()
&&
slide
->
Layout
->
clrMapOvr
->
overrideClrMapping
.
IsInit
()
)
current_clrMap
=
slide
->
Layout
->
clrMapOvr
->
overrideClrMapping
.
GetPointer
();
current_slide
=
slide
->
Layout
.
operator
->
();
convert
(
&
slide
->
Layout
->
cSld
,
false
);
...
...
@@ -264,10 +265,13 @@ void PptxConverter::convert_slides()
m_mapMasters
.
insert
(
std
::
make_pair
(
master_layout
,
master_style_name
));
}
else
{
master_style_name
=
pFind
->
second
;
}
}
current_clrMap
=
&
slide
->
Master
->
clrMap
;
//after layout
if
(
slide
->
clrMapOvr
.
IsInit
())
if
(
slide
->
clrMapOvr
.
IsInit
()
&&
slide
->
clrMapOvr
->
overrideClrMapping
.
IsInit
()
)
current_clrMap
=
slide
->
clrMapOvr
->
overrideClrMapping
.
GetPointer
();
current_tableStyles
=
slide
->
tableStyles_
.
operator
->
();
...
...
@@ -391,7 +395,7 @@ void PptxConverter::convert(PPTX::Logic::Table *oox_table)
double
width
=
-
1
;
if
(
oox_table
->
TableCols
[
i
].
Width
.
IsInit
())
width
=
oox_table
->
TableCols
[
i
].
Width
.
get
()
/
12700
0
.
;
width
=
oox_table
->
TableCols
[
i
].
Width
.
get
()
/
12700.
;
odp_context
->
slide_context
()
->
add_table_column
(
width
);
...
...
@@ -413,7 +417,7 @@ void PptxConverter::convert(PPTX::Logic::TableRow *oox_table_row)
if
(
oox_table_row
->
Height
.
IsInit
())
{
odf_writer
::
style_table_row_properties
*
table_row_properties
=
odp_context
->
styles_context
()
->
last_state
()
->
get_table_row_properties
();
table_row_properties
->
style_table_row_properties_attlist_
.
style_row_height_
=
odf_types
::
length
(
oox_table_row
->
Height
.
get
()
/
12700
0
.
,
odf_types
::
length
::
pt
);
table_row_properties
->
style_table_row_properties_attlist_
.
style_row_height_
=
odf_types
::
length
(
oox_table_row
->
Height
.
get
()
/
12700.
,
odf_types
::
length
::
pt
);
// table_row_properties->style_table_row_properties_attlist_.style_min_row_height_
}
...
...
@@ -567,47 +571,115 @@ void PptxConverter::convert(PPTX::Logic::Ln *oox_border, std::wstring & odf_bord
if
(
!
oox_border
)
return
;
odp_context
->
drawing_context
()
->
start_line_properties
();
OoxConverter
::
convert
(
oox_border
);
odp_context
->
drawing_context
()
->
end_line_properties
();
//-----------------------------------------------------------------------------------------------------
std
::
wstringstream
border_style
;
std
::
wstring
border_color
;
odf_types
::
length
length
;
length
=
odf_types
::
length
(
oox_border
->
w
.
IsInit
()
?
oox_border
->
w
.
get
()
/
127000.
:
1
,
odf_types
::
length
::
pt
);
length
=
odf_types
::
length
(
length
.
get_value_unit
(
odf_types
::
length
::
cm
),
odf_types
::
length
::
cm
);
odf_types
::
length
length
=
odf_types
::
length
(
oox_border
->
w
.
IsInit
()
?
oox_border
->
w
.
get
()
/
12700.
:
1
,
odf_types
::
length
::
pt
);
border_style
<<
length
;
_CP_OPT
(
odf_types
::
color
)
color
=
odp_context
->
drawing_context
()
->
get_line_color
();
if
(
oox_border
->
prstDash
.
IsInit
()
&&
oox_border
->
prstDash
->
val
.
IsInit
())
{
switch
(
oox_border
->
prstDash
->
val
->
GetBYTECode
())
{
case
0
:
border_style
<<
L" dashed"
;
break
;
case
0
:
case
3
:
case
7
:
case
1
:
border_style
<<
L" dashed"
;
break
;
case
10
:
case
2
:
border_style
<<
L" dotted"
;
break
;
default:
border_style
<<
L" solid"
;
case
4
:
case
8
:
border_style
<<
L" dash-dot"
;
break
;
case
5
:
case
9
:
border_style
<<
L" dash-dot-dot"
;
break
;
case
6
:
default:
border_style
<<
L" solid"
;
}
}
else
border_style
<<
L" solid"
;
///////////////////////////////////////////////////////////////////
_CP_OPT
(
odf_types
::
color
)
color
;
if
(
oox_border
->
Fill
.
is_init
())
if
(
color
)
border_style
<<
L" "
<<
color
.
get
();
else
border_style
<<
L" #000000"
;
odf_border_prop
=
border_style
.
str
();
}
void
PptxConverter
::
convert
(
PPTX
::
Logic
::
TcBdr
*
oox_table_borders
)
{
if
(
!
oox_table_borders
)
return
;
//НИ ГРАФИКА НИ СВОЙСТВА ЯЧЕЕК .. ПАРАГРАФ блять !! - идиетский odf !!!
//odf_writer::style_table_cell_properties *odf_cell_props = odp_context->styles_context()->last_state(odf_types::style_family::TableCell)->get_table_cell_properties();
odf_writer
::
style_paragraph_properties
*
odf_para_props
=
odp_context
->
styles_context
()
->
last_state
(
odf_types
::
style_family
::
TableCell
)
->
get_paragraph_properties
();
std
::
wstring
left
,
right
,
top
,
bottom
,
other2BR
,
other2BL
;
if
(
oox_table_borders
->
left
.
IsInit
())
{
OoxConverter
::
convert
(
&
oox_border
->
Fill
);
convert
(
oox_table_borders
->
left
->
ln
.
GetPointer
(),
left
);
//if (left.empty())
// convert(oox_table_borders->left->lnRef.GetPointer(), left); //todooo
}
if
(
oox_table_borders
->
right
.
IsInit
())
{
convert
(
oox_table_borders
->
right
->
ln
.
GetPointer
(),
right
);
}
if
(
oox_table_borders
->
top
.
IsInit
())
{
convert
(
oox_table_borders
->
top
->
ln
.
GetPointer
(),
top
);
}
if
(
oox_table_borders
->
bottom
.
IsInit
())
{
convert
(
oox_table_borders
->
bottom
->
ln
.
GetPointer
(),
bottom
);
}
if
(
oox_table_borders
->
tl2br
.
IsInit
())
{
convert
(
oox_table_borders
->
tl2br
->
ln
.
GetPointer
(),
other2BR
);
}
if
(
oox_table_borders
->
tr2bl
.
IsInit
())
{
convert
(
oox_table_borders
->
tr2bl
->
ln
.
GetPointer
(),
other2BL
);
}
odp_context
->
drawing_context
()
->
end_line_properties
();
border_color
=
L"000000"
;
if
(
bottom
==
top
&&
top
==
left
&&
left
==
right
&&
bottom
.
length
()
>
0
)
{
odf_para_props
->
content_
.
common_border_attlist_
.
fo_border_
=
left
;
odf_border_prop
=
border_style
.
str
()
+
L" #"
+
border_color
;
odf_para_props
->
content_
.
common_border_attlist_
.
fo_border_bottom_
=
odf_para_props
->
content_
.
common_border_attlist_
.
fo_border_top_
=
odf_para_props
->
content_
.
common_border_attlist_
.
fo_border_left_
=
odf_para_props
->
content_
.
common_border_attlist_
.
fo_border_right_
=
boost
::
none
;
}
else
{
if
(
odf_para_props
->
content_
.
common_border_attlist_
.
fo_border_
)
{
odf_para_props
->
content_
.
common_border_attlist_
.
fo_border_bottom_
=
odf_para_props
->
content_
.
common_border_attlist_
.
fo_border_top_
=
odf_para_props
->
content_
.
common_border_attlist_
.
fo_border_left_
=
odf_para_props
->
content_
.
common_border_attlist_
.
fo_border_right_
=
odf_para_props
->
content_
.
common_border_attlist_
.
fo_border_
;
}
odf_para_props
->
content_
.
common_border_attlist_
.
fo_border_
=
boost
::
none
;
if
(
!
bottom
.
empty
()
)
odf_para_props
->
content_
.
common_border_attlist_
.
fo_border_bottom_
=
bottom
;
if
(
!
top
.
empty
()
)
odf_para_props
->
content_
.
common_border_attlist_
.
fo_border_top_
=
top
;
if
(
!
left
.
empty
()
)
odf_para_props
->
content_
.
common_border_attlist_
.
fo_border_left_
=
left
;
if
(
!
right
.
empty
()
)
odf_para_props
->
content_
.
common_border_attlist_
.
fo_border_right_
=
right
;
}
//if (other2BR.empty() == false) odf_para_props->content_.style_diagonal_tl_br_ = other2BR;
//if (other2BL.empty() == false) odf_para_props->content_.style_diagonal_bl_tr_ = other2BL;
}
bool
PptxConverter
::
convert
(
PPTX
::
Logic
::
TableCellProperties
*
oox_table_cell_pr
)
{
odf_writer
::
style_table_cell_properties
*
odf_cell_properties
=
odp_context
->
styles_context
()
->
last_state
()
->
get_table_cell_properties
();
if
(
!
oox_table_cell_pr
)
return
false
;
if
(
!
odf_cell_properties
)
return
false
;
odf_writer
::
style_table_cell_properties
*
odf_cell_props
=
odp_context
->
styles_context
()
->
last_state
()
->
get_table_cell_properties
();
odf_writer
::
style_paragraph_properties
*
odf_para_props
=
odp_context
->
styles_context
()
->
last_state
(
odf_types
::
style_family
::
TableCell
)
->
get_paragraph_properties
();
if
(
!
odf_para_props
)
return
false
;
if
(
oox_table_cell_pr
->
Fill
.
is_init
())
{
...
...
@@ -616,50 +688,46 @@ bool PptxConverter::convert(PPTX::Logic::TableCellProperties *oox_table_cell_pr)
odp_context
->
drawing_context
()
->
end_area_properties
();
}
if
(
oox_table_cell_pr
->
Vert
.
IsInit
())
{
switch
(
oox_table_cell_pr
->
Vert
->
GetBYTECode
())
{
case
1
:
odf_cell_properties
->
style_table_cell_properties_attlis
t_
.
style_direction_
=
odf_types
::
direction
(
odf_types
::
direction
::
Ltr
);
break
;
case
6
:
//rtl vert
break
;
default:
odf_cell_properties
->
style_table_cell_properties_attlis
t_
.
style_direction_
=
odf_types
::
direction
(
odf_types
::
direction
::
Ttb
);
break
;
}
}
//
if (oox_table_cell_pr->Vert.IsInit())
//
{
//
switch(oox_table_cell_pr->Vert->GetBYTECode())
//
{
//
case 1 :
// odf_para_props->conten
t_.style_direction_ = odf_types::direction(odf_types::direction::Ltr);break;
//
case 6 ://rtl vert
//
break;
//
default:
// odf_para_props->conten
t_.style_direction_ = odf_types::direction(odf_types::direction::Ttb);break;
//
}
//
}
if
(
oox_table_cell_pr
->
MarL
.
IsInit
())
{
odf_types
::
length
length
=
oox_table_cell_pr
->
MarL
.
get
()
/
127000.
;
odf_cell_properties
->
style_table_cell_properties_attlist_
.
common_padding_attlist_
.
fo_padding_left_
=
odf_types
::
length
(
length
.
get_value_unit
(
odf_types
::
length
::
cm
),
odf_types
::
length
::
cm
);
odf_cell_props
->
style_table_cell_properties_attlist_
.
common_padding_attlist_
.
fo_padding_left_
=
odf_types
::
length
(
oox_table_cell_pr
->
MarL
.
get
()
/
12700.
,
odf_types
::
length
::
pt
);
}
if
(
oox_table_cell_pr
->
MarR
.
IsInit
())
{
odf_types
::
length
length
=
oox_table_cell_pr
->
MarR
.
get
()
/
127000.
;
odf_cell_properties
->
style_table_cell_properties_attlist_
.
common_padding_attlist_
.
fo_padding_right_
=
odf_types
::
length
(
length
.
get_value_unit
(
odf_types
::
length
::
cm
),
odf_types
::
length
::
cm
);
odf_cell_props
->
style_table_cell_properties_attlist_
.
common_padding_attlist_
.
fo_padding_right_
=
odf_types
::
length
(
oox_table_cell_pr
->
MarR
.
get
()
/
12700.
,
odf_types
::
length
::
pt
);
}
if
(
oox_table_cell_pr
->
MarT
.
IsInit
())
{
odf_types
::
length
length
=
oox_table_cell_pr
->
MarT
.
get
()
/
127000.
;
odf_cell_properties
->
style_table_cell_properties_attlist_
.
common_padding_attlist_
.
fo_padding_top_
=
odf_types
::
length
(
length
.
get_value_unit
(
odf_types
::
length
::
cm
),
odf_types
::
length
::
cm
);
odf_cell_props
->
style_table_cell_properties_attlist_
.
common_padding_attlist_
.
fo_padding_top_
=
odf_types
::
length
(
oox_table_cell_pr
->
MarT
.
get
()
/
12700.
,
odf_types
::
length
::
pt
);
}
if
(
oox_table_cell_pr
->
MarB
.
IsInit
())
{
odf_types
::
length
length
=
oox_table_cell_pr
->
MarB
.
get
()
/
127000.
;
odf_cell_properties
->
style_table_cell_properties_attlist_
.
common_padding_attlist_
.
fo_padding_bottom_
=
odf_types
::
length
(
length
.
get_value_unit
(
odf_types
::
length
::
cm
),
odf_types
::
length
::
cm
);
odf_cell_props
->
style_table_cell_properties_attlist_
.
common_padding_attlist_
.
fo_padding_bottom_
=
odf_types
::
length
(
oox_table_cell_pr
->
MarB
.
get
()
/
12700.
,
odf_types
::
length
::
pt
);
}
if
(
oox_table_cell_pr
->
Vert
.
IsInit
())
{
switch
(
oox_table_cell_pr
->
Vert
->
GetBYTECode
())
{
//case SimpleTypes::verticaljcBoth : //??????
// odf_
cell_properties->style_table_cell_properties_attlis
t_.style_vertical_align_ = odf_types::vertical_align(odf_types::vertical_align::Justify); break;
// odf_
para_props->conten
t_.style_vertical_align_ = odf_types::vertical_align(odf_types::vertical_align::Justify); break;
//case SimpleTypes::verticaljcBottom :
// odf_
cell_properties->style_table_cell_properties_attlis
t_.style_vertical_align_ = odf_types::vertical_align(odf_types::vertical_align::Bottom); break;
// odf_
para_props->conten
t_.style_vertical_align_ = odf_types::vertical_align(odf_types::vertical_align::Bottom); break;
//case SimpleTypes::verticaljcCenter :
// odf_
cell_properties->style_table_cell_properties_attlis
t_.style_vertical_align_ = odf_types::vertical_align(odf_types::vertical_align::Middle); break;
// odf_
para_props->conten
t_.style_vertical_align_ = odf_types::vertical_align(odf_types::vertical_align::Middle); break;
//case SimpleTypes::verticaljcTop :
// odf_
cell_properties->style_table_cell_properties_attlis
t_.style_vertical_align_ = odf_types::vertical_align(odf_types::vertical_align::Top); break;
// odf_
para_props->conten
t_.style_vertical_align_ = odf_types::vertical_align(odf_types::vertical_align::Top); break;
}
}
//borders
...
...
@@ -672,36 +740,36 @@ bool PptxConverter::convert(PPTX::Logic::TableCellProperties *oox_table_cell_pr)
if
(
bottom
==
top
&&
top
==
left
&&
left
==
right
&&
bottom
.
length
()
>
0
)
{
odf_
cell_properties
->
style_table_cell_properties_attlis
t_
.
common_border_attlist_
.
fo_border_
=
left
;
odf_
para_props
->
conten
t_
.
common_border_attlist_
.
fo_border_
=
left
;
odf_
cell_properties
->
style_table_cell_properties_attlis
t_
.
common_border_attlist_
.
fo_border_bottom_
=
odf_
cell_properties
->
style_table_cell_properties_attlist_
.
common_border_attlist_
.
fo_border_top_
=
odf_
cell_properties
->
style_table_cell_properties_attlis
t_
.
common_border_attlist_
.
fo_border_left_
=
odf_
cell_properties
->
style_table_cell_properties_attlis
t_
.
common_border_attlist_
.
fo_border_right_
=
boost
::
none
;
odf_
para_props
->
conten
t_
.
common_border_attlist_
.
fo_border_bottom_
=
odf_
para_props
->
content_
.
common_border_attlist_
.
fo_border_top_
=
odf_
para_props
->
conten
t_
.
common_border_attlist_
.
fo_border_left_
=
odf_
para_props
->
conten
t_
.
common_border_attlist_
.
fo_border_right_
=
boost
::
none
;
}
else
{
if
(
odf_
cell_properties
->
style_table_cell_properties_attlis
t_
.
common_border_attlist_
.
fo_border_
)
if
(
odf_
para_props
->
conten
t_
.
common_border_attlist_
.
fo_border_
)
{
odf_
cell_properties
->
style_table_cell_properties_attlis
t_
.
common_border_attlist_
.
fo_border_bottom_
=
odf_
cell_properties
->
style_table_cell_properties_attlis
t_
.
common_border_attlist_
.
fo_border_top_
=
odf_
cell_properties
->
style_table_cell_properties_attlist_
.
common_border_attlist_
.
fo_border_left_
=
odf_
cell_properties
->
style_table_cell_properties_attlist_
.
common_border_attlist_
.
fo_border_right_
=
odf_cell_properties
->
style_table_cell_properties_attlis
t_
.
common_border_attlist_
.
fo_border_
;
odf_
para_props
->
conten
t_
.
common_border_attlist_
.
fo_border_bottom_
=
odf_
para_props
->
conten
t_
.
common_border_attlist_
.
fo_border_top_
=
odf_
para_props
->
content_
.
common_border_attlist_
.
fo_border_left_
=
odf_
para_props
->
content_
.
common_border_attlist_
.
fo_border_right_
=
odf_para_props
->
conten
t_
.
common_border_attlist_
.
fo_border_
;
}
odf_
cell_properties
->
style_table_cell_properties_attlis
t_
.
common_border_attlist_
.
fo_border_
=
boost
::
none
;
odf_
para_props
->
conten
t_
.
common_border_attlist_
.
fo_border_
=
boost
::
none
;
if
(
!
bottom
.
empty
()
)
odf_
cell_properties
->
style_table_cell_properties_attlis
t_
.
common_border_attlist_
.
fo_border_bottom_
=
bottom
;
if
(
!
top
.
empty
()
)
odf_
cell_properties
->
style_table_cell_properties_attlis
t_
.
common_border_attlist_
.
fo_border_top_
=
top
;
if
(
!
left
.
empty
()
)
odf_
cell_properties
->
style_table_cell_properties_attlist_
.
common_border_attlist_
.
fo_border_left_
=
left
;
if
(
!
right
.
empty
()
)
odf_
cell_properties
->
style_table_cell_properties_attlis
t_
.
common_border_attlist_
.
fo_border_right_
=
right
;
if
(
!
bottom
.
empty
()
)
odf_
para_props
->
conten
t_
.
common_border_attlist_
.
fo_border_bottom_
=
bottom
;
if
(
!
top
.
empty
()
)
odf_
para_props
->
conten
t_
.
common_border_attlist_
.
fo_border_top_
=
top
;
if
(
!
left
.
empty
()
)
odf_
para_props
->
content_
.
common_border_attlist_
.
fo_border_left_
=
left
;
if
(
!
right
.
empty
()
)
odf_
para_props
->
conten
t_
.
common_border_attlist_
.
fo_border_right_
=
right
;
}
//convert(oox_border->m_oTL2BR.GetPointer() , other);
//if (other.
length() >0 ) odf_cell_properties->style_table_cell_properties_attlis
t_.style_diagonal_tl_br_ = other;
//if (other.
empty() == false) odf_para_props->conten
t_.style_diagonal_tl_br_ = other;
//
//convert(oox_border->m_oTR2BL.GetPointer() , other);
//if (other.
length() >0
)
//if (other.
empty() == false
)
//{
// odf_
cell_properties->style_table_cell_properties_attlis
t_.style_diagonal_bl_tr_ = other;
// odf_
para_props->conten
t_.style_diagonal_bl_tr_ = other;
//}
return
true
;
}
...
...
@@ -761,7 +829,6 @@ void PptxConverter::convert(PPTX::Logic::CSld *oox_slide, bool placeholders)
//convert(oox_slide->spTree.SpTreeElems[i].GetElem().operator->());
}
convert
(
oox_slide
->
controls
.
GetPointer
());
}
...
...
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