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
e7dae4b3
Commit
e7dae4b3
authored
Sep 25, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OdfFormatReader - fix after testing
parent
7dbbacf3
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
273 additions
and
40 deletions
+273
-40
ASCOfficeOdfFile/src/docx/docx_conversion_context.cpp
ASCOfficeOdfFile/src/docx/docx_conversion_context.cpp
+6
-2
ASCOfficeOdfFile/src/docx/docx_conversion_context.h
ASCOfficeOdfFile/src/docx/docx_conversion_context.h
+4
-2
ASCOfficeOdfFile/src/docx/docx_drawing.cpp
ASCOfficeOdfFile/src/docx/docx_drawing.cpp
+11
-5
ASCOfficeOdfFile/src/docx/oox_chart_series.cpp
ASCOfficeOdfFile/src/docx/oox_chart_series.cpp
+16
-5
ASCOfficeOdfFile/src/docx/oox_drawing.cpp
ASCOfficeOdfFile/src/docx/oox_drawing.cpp
+6
-3
ASCOfficeOdfFile/src/docx/oox_types_chart.cpp
ASCOfficeOdfFile/src/docx/oox_types_chart.cpp
+2
-2
ASCOfficeOdfFile/src/odf/draw_frame_docx.cpp
ASCOfficeOdfFile/src/odf/draw_frame_docx.cpp
+34
-13
ASCOfficeOdfFile/src/odf/draw_shapes.cpp
ASCOfficeOdfFile/src/odf/draw_shapes.cpp
+38
-2
ASCOfficeOdfFile/src/odf/draw_shapes.h
ASCOfficeOdfFile/src/odf/draw_shapes.h
+72
-2
ASCOfficeOdfFile/src/odf/draw_shapes_docx.cpp
ASCOfficeOdfFile/src/odf/draw_shapes_docx.cpp
+23
-0
ASCOfficeOdfFile/src/odf/draw_shapes_pptx.cpp
ASCOfficeOdfFile/src/odf/draw_shapes_pptx.cpp
+18
-0
ASCOfficeOdfFile/src/odf/draw_shapes_xlsx.cpp
ASCOfficeOdfFile/src/odf/draw_shapes_xlsx.cpp
+20
-0
ASCOfficeOdfFile/src/odf/math_layout_elements.cpp
ASCOfficeOdfFile/src/odf/math_layout_elements.cpp
+1
-1
ASCOfficeOdfFile/src/odf/math_table_elements.cpp
ASCOfficeOdfFile/src/odf/math_table_elements.cpp
+8
-2
ASCOfficeOdfFile/src/odf/office_elements_type.h
ASCOfficeOdfFile/src/odf/office_elements_type.h
+7
-0
ASCOfficeOdfFile/src/odf/text_elements.cpp
ASCOfficeOdfFile/src/odf/text_elements.cpp
+1
-1
DesktopEditor/raster/Metafile/MetaFile.cpp
DesktopEditor/raster/Metafile/MetaFile.cpp
+6
-0
No files found.
ASCOfficeOdfFile/src/docx/docx_conversion_context.cpp
View file @
e7dae4b3
...
@@ -96,7 +96,7 @@ void text_tracked_context::start_change (std::wstring id)
...
@@ -96,7 +96,7 @@ void text_tracked_context::start_change (std::wstring id)
{
{
current_state_
.
clear
();
current_state_
.
clear
();
current_state_
.
id
=
id
;
current_state_
.
id
=
id
;
}
}
void
text_tracked_context
::
end_change
()
void
text_tracked_context
::
end_change
()
{
{
...
@@ -1285,7 +1285,8 @@ void docx_conversion_context::start_text_changes (std::wstring id)
...
@@ -1285,7 +1285,8 @@ void docx_conversion_context::start_text_changes (std::wstring id)
L" w:author=
\"
"
+
state
.
author
+
L"
\"
"
;
L" w:author=
\"
"
+
state
.
author
+
L"
\"
"
;
finish_run
();
finish_run
();
state
.
active
=
true
;
state
.
active
=
true
;
state
.
in_drawing
=
get_drawing_state_content
();
if
(
state
.
type
==
1
)
if
(
state
.
type
==
1
)
{
{
...
@@ -1419,6 +1420,9 @@ void docx_conversion_context::end_changes()
...
@@ -1419,6 +1420,9 @@ void docx_conversion_context::end_changes()
if
(
state
.
type
==
0
)
continue
;
//unknown change ... libra format change skip
if
(
state
.
type
==
0
)
continue
;
//unknown change ... libra format change skip
if
(
state
.
type
==
3
)
continue
;
if
(
state
.
type
==
3
)
continue
;
if
(
!
state
.
active
)
continue
;
if
(
!
state
.
active
)
continue
;
if
(
state
.
in_drawing
!=
get_drawing_state_content
())
continue
;
if
(
state
.
type
==
1
)
output_stream
()
<<
L"</w:ins>"
;
if
(
state
.
type
==
1
)
output_stream
()
<<
L"</w:ins>"
;
if
(
state
.
type
==
2
)
output_stream
()
<<
L"</w:del>"
;
if
(
state
.
type
==
2
)
output_stream
()
<<
L"</w:del>"
;
...
...
ASCOfficeOdfFile/src/docx/docx_conversion_context.h
View file @
e7dae4b3
...
@@ -492,10 +492,11 @@ public:
...
@@ -492,10 +492,11 @@ public:
std
::
wstring
id
;
std
::
wstring
id
;
std
::
wstring
author
;
std
::
wstring
author
;
std
::
wstring
date
;
std
::
wstring
date
;
int
type
;
int
type
=
0
;
std
::
wstring
style_name
;
std
::
wstring
style_name
;
std
::
vector
<
std
::
wstring
>
content
;
//delete elements
std
::
vector
<
std
::
wstring
>
content
;
//delete elements
bool
active
;
bool
active
=
false
;
bool
in_drawing
=
false
;
void
clear
()
void
clear
()
{
{
...
@@ -505,6 +506,7 @@ public:
...
@@ -505,6 +506,7 @@ public:
date
.
clear
();
date
.
clear
();
content
.
clear
();
content
.
clear
();
active
=
false
;
active
=
false
;
in_drawing
=
false
;
}
}
};
};
std
::
wstring
dumpPPr_
;
std
::
wstring
dumpPPr_
;
...
...
ASCOfficeOdfFile/src/docx/docx_drawing.cpp
View file @
e7dae4b3
...
@@ -392,8 +392,11 @@ void docx_serialize_wps(std::wostream & strm, _docx_drawing & val)
...
@@ -392,8 +392,11 @@ void docx_serialize_wps(std::wostream & strm, _docx_drawing & val)
{
{
CP_XML_NODE
(
L"wp:extent"
)
CP_XML_NODE
(
L"wp:extent"
)
{
{
CP_XML_ATTR
(
L"cx"
,
val
.
cx
);
if
(
val
.
cx
>
0
||
val
.
cy
>
0
)
CP_XML_ATTR
(
L"cy"
,
val
.
cy
);
{
CP_XML_ATTR
(
L"cx"
,
val
.
cx
);
CP_XML_ATTR
(
L"cy"
,
val
.
cy
);
}
serialize_null_extent
(
CP_XML_STREAM
());
serialize_null_extent
(
CP_XML_STREAM
());
}
}
...
@@ -463,10 +466,13 @@ void docx_serialize_wps(std::wostream & strm, _docx_drawing & val)
...
@@ -463,10 +466,13 @@ void docx_serialize_wps(std::wostream & strm, _docx_drawing & val)
}
}
}
}
}
}
CP_XML_NODE
(
L"wp:extent"
)
if
(
val
.
cx
>
0
||
val
.
cy
>
0
)
{
{
CP_XML_ATTR
(
L"cx"
,
val
.
cx
);
CP_XML_NODE
(
L"wp:extent"
)
CP_XML_ATTR
(
L"cy"
,
val
.
cy
);
{
CP_XML_ATTR
(
L"cx"
,
val
.
cx
);
CP_XML_ATTR
(
L"cy"
,
val
.
cy
);
}
}
}
serialize_wrap
(
CP_XML_STREAM
(),
val
);
serialize_wrap
(
CP_XML_STREAM
(),
val
);
...
...
ASCOfficeOdfFile/src/docx/oox_chart_series.cpp
View file @
e7dae4b3
...
@@ -70,8 +70,7 @@ void oox_chart_series::setFormula(int ind, std::wstring &value, std::wstring & f
...
@@ -70,8 +70,7 @@ void oox_chart_series::setFormula(int ind, std::wstring &value, std::wstring & f
if
(
ind
==
0
)
if
(
ind
==
0
)
{
{
long
res
=
value
.
find
(
L"local-table"
);
if
(
std
::
wstring
::
npos
!=
value
.
find
(
L"local-table"
))
return
;
if
(
res
>=
0
)
return
;
values_
[
ind
].
strRef_
.
formula
=
converter
.
convert_chart_distance
(
value
);
values_
[
ind
].
strRef_
.
formula
=
converter
.
convert_chart_distance
(
value
);
values_
[
ind
].
strRef_
.
present
=
true
;
values_
[
ind
].
strRef_
.
present
=
true
;
...
@@ -79,8 +78,8 @@ void oox_chart_series::setFormula(int ind, std::wstring &value, std::wstring & f
...
@@ -79,8 +78,8 @@ void oox_chart_series::setFormula(int ind, std::wstring &value, std::wstring & f
}
}
else
else
{
{
long
res
=
value
.
find
(
L"local-table"
);
if
(
std
::
wstring
::
npos
!=
value
.
find
(
L"local-table"
)
&&
!
bLocalTable_
)
return
;
if
(
res
>=
0
&&
!
bLocalTable_
)
return
;
//в xlsx низя .... нужно сделать тогда отдельную table.xml
//в xlsx низя .... нужно сделать тогда отдельную table.xml
values_
[
ind
].
numRef_
.
formula
=
converter
.
convert_chart_distance
(
value
);
values_
[
ind
].
numRef_
.
formula
=
converter
.
convert_chart_distance
(
value
);
values_
[
ind
].
numRef_
.
present
=
true
;
values_
[
ind
].
numRef_
.
present
=
true
;
...
@@ -221,12 +220,24 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream)
...
@@ -221,12 +220,24 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream)
shape
.
set
(
content_
.
graphic_properties_
,
content_
.
fill_
);
shape
.
set
(
content_
.
graphic_properties_
,
content_
.
fill_
);
shape
.
oox_serialize
(
_Wostream
);
shape
.
oox_serialize
(
_Wostream
);
for
(
int
i
=
0
;
i
<
5
;
i
++
)
for
(
int
i
=
0
;
i
<
5
;
i
++
)
{
{
if
(
values_
[
i
].
present
)
if
(
values_
[
i
].
present
)
{
{
if
(
bLocalTable_
)
{
if
(
values_
[
i
].
numRef_
.
present
&&
values_
[
i
].
numRef_
.
num_cache_count
==
0
)
{
continue
;
}
if
(
values_
[
i
].
strRef_
.
present
&&
values_
[
i
].
strRef_
.
str_cache_count
==
0
)
{
continue
;
}
}
CP_XML_NODE
(
values_
[
i
].
type
)
CP_XML_NODE
(
values_
[
i
].
type
)
{
{
if
(
values_
[
i
].
numRef_
.
present
&&
!
bLocalTable_
)
if
(
values_
[
i
].
numRef_
.
present
&&
!
bLocalTable_
)
{
{
CP_XML_NODE
(
L"c:numRef"
)
CP_XML_NODE
(
L"c:numRef"
)
...
...
ASCOfficeOdfFile/src/docx/oox_drawing.cpp
View file @
e7dae4b3
...
@@ -549,10 +549,13 @@ void _oox_drawing::serialize_xfrm(std::wostream & strm, const std::wstring & nam
...
@@ -549,10 +549,13 @@ void _oox_drawing::serialize_xfrm(std::wostream & strm, const std::wstring & nam
CP_XML_ATTR
(
L"x"
,
0
);
CP_XML_ATTR
(
L"x"
,
0
);
CP_XML_ATTR
(
L"y"
,
0
);
CP_XML_ATTR
(
L"y"
,
0
);
}
}
CP_XML_NODE
(
L"a:chExt"
)
if
(
cx
>
0
||
cy
>
0
)
{
{
CP_XML_ATTR
(
L"cx"
,
cx
);
CP_XML_NODE
(
L"a:chExt"
)
CP_XML_ATTR
(
L"cy"
,
cy
);
{
CP_XML_ATTR
(
L"cx"
,
cx
);
CP_XML_ATTR
(
L"cy"
,
cy
);
}
}
}
}
}
}
}
...
...
ASCOfficeOdfFile/src/docx/oox_types_chart.cpp
View file @
e7dae4b3
...
@@ -102,7 +102,7 @@ void oox_chart::oox_serialize_common(std::wostream & _Wostream)
...
@@ -102,7 +102,7 @@ void oox_chart::oox_serialize_common(std::wostream & _Wostream)
}
}
for
(
size_t
i
=
0
;
i
<
series_
.
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
series_
.
size
();
i
++
)
{
{
if
(
is3D_
||
type_
==
CHART_TYPE_AREA
||
type_
==
CHART_TYPE_
STOCK
)
if
(
is3D_
||
type_
==
CHART_TYPE_AREA
||
type_
==
CHART_TYPE_
DOUGHNUT
||
type_
==
CHART_TYPE_RADAR
)
{
{
series_
[
i
]
->
labelPosEnabled_
=
false
;
series_
[
i
]
->
labelPosEnabled_
=
false
;
}
}
...
@@ -473,7 +473,7 @@ void oox_stock_chart::oox_serialize(std::wostream & _Wostream)
...
@@ -473,7 +473,7 @@ void oox_stock_chart::oox_serialize(std::wostream & _Wostream)
//{
//{
// //shape.oox_serialize(CP_XML_STREAM());
// //shape.oox_serialize(CP_XML_STREAM());
//}
//}
CP_XML_NODE
(
L"upDownBars"
)
CP_XML_NODE
(
L"
c:
upDownBars"
)
{
{
CP_XML_NODE
(
L"c:gapWidth"
)
CP_XML_NODE
(
L"c:gapWidth"
)
{
{
...
...
ASCOfficeOdfFile/src/odf/draw_frame_docx.cpp
View file @
e7dae4b3
...
@@ -1040,23 +1040,44 @@ void draw_shape::docx_convert(oox::docx_conversion_context & Context)
...
@@ -1040,23 +1040,44 @@ void draw_shape::docx_convert(oox::docx_conversion_context & Context)
std
::
wostream
&
strm
=
Context
.
output_stream
();
std
::
wostream
&
strm
=
Context
.
output_stream
();
bool
pState
=
Context
.
get_paragraph_state
();
bool
runState
=
Context
.
get_run_state
();
Context
.
set_paragraph_state
(
false
);
bool
paraState
=
Context
.
get_paragraph_state
();
bool
keepState
=
Context
.
get_paragraph_keep
();
bool
new_run
=
true
;
//Context.set_run_state (false);
Context
.
set_paragraph_state
(
false
);
bool
new_run
=
false
;
if
((
pState
==
false
&&
Context
.
get_drawing_context
().
get_current_level
()
==
1
)
||
(
Context
.
get_drawing_context
().
in_group
()))
if
((
p
ara
State
==
false
&&
Context
.
get_drawing_context
().
get_current_level
()
==
1
)
||
(
Context
.
get_drawing_context
().
in_group
()))
{
{
new_run
=
false
;
}
}
else
else
Context
.
add_new_run
(
_T
(
""
));
{
if
(
!
Context
.
get_drawing_context
().
in_group
()
&&
!
runState
)
{
if
(
!
paraState
)
{
Context
.
start_paragraph
();
}
Context
.
add_new_run
(
L""
);
new_run
=
true
;
}
}
drawing
.
serialize
(
strm
/*, Context.get_drawing_state_content()*/
);
drawing
.
serialize
(
strm
/*, Context.get_drawing_state_content()*/
);
if
(
new_run
)
Context
.
finish_run
();
if
(
new_run
)
{
Context
.
finish_run
();
if
(
!
paraState
)
{
Context
.
finish_paragraph
();
}
}
Context
.
set_paragraph_state
(
pState
);
Context
.
set_paragraph_state
(
p
ara
State
);
Context
.
get_drawing_context
().
stop_shape
();
Context
.
get_drawing_context
().
stop_shape
();
}
}
...
@@ -1384,7 +1405,7 @@ void draw_frame::docx_convert(oox::docx_conversion_context & Context)
...
@@ -1384,7 +1405,7 @@ void draw_frame::docx_convert(oox::docx_conversion_context & Context)
//-----------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------
bool
runState
=
Context
.
get_run_state
();
bool
runState
=
Context
.
get_run_state
();
bool
p
State
=
Context
.
get_paragraph_state
();
bool
p
araState
=
Context
.
get_paragraph_state
();
bool
keepState
=
Context
.
get_paragraph_keep
();
bool
keepState
=
Context
.
get_paragraph_keep
();
Context
.
set_run_state
(
false
);
Context
.
set_run_state
(
false
);
...
@@ -1392,7 +1413,7 @@ void draw_frame::docx_convert(oox::docx_conversion_context & Context)
...
@@ -1392,7 +1413,7 @@ void draw_frame::docx_convert(oox::docx_conversion_context & Context)
if
(
!
Context
.
get_drawing_context
().
in_group
()
&&
!
runState
)
if
(
!
Context
.
get_drawing_context
().
in_group
()
&&
!
runState
)
{
{
if
(
!
pState
)
//0115GS3-KeyboardShortcuts.odt
if
(
!
p
ara
State
)
//0115GS3-KeyboardShortcuts.odt
{
{
Context
.
start_paragraph
();
Context
.
start_paragraph
();
}
}
...
@@ -1404,14 +1425,14 @@ void draw_frame::docx_convert(oox::docx_conversion_context & Context)
...
@@ -1404,14 +1425,14 @@ void draw_frame::docx_convert(oox::docx_conversion_context & Context)
if
(
!
Context
.
get_drawing_context
().
in_group
()
&&
!
runState
)
if
(
!
Context
.
get_drawing_context
().
in_group
()
&&
!
runState
)
{
{
Context
.
finish_run
();
Context
.
finish_run
();
if
(
!
pState
)
//0115GS3-KeyboardShortcuts.odt
if
(
!
p
ara
State
)
//0115GS3-KeyboardShortcuts.odt
{
{
Context
.
finish_paragraph
();
Context
.
finish_paragraph
();
}
}
}
}
Context
.
set_run_state
(
runState
);
Context
.
set_run_state
(
runState
);
Context
.
set_paragraph_state
(
pState
);
Context
.
set_paragraph_state
(
p
ara
State
);
Context
.
set_paragraph_keep
(
keepState
);
Context
.
set_paragraph_keep
(
keepState
);
Context
.
get_drawing_context
().
stop_frame
();
Context
.
get_drawing_context
().
stop_frame
();
...
...
ASCOfficeOdfFile/src/odf/draw_shapes.cpp
View file @
e7dae4b3
...
@@ -607,9 +607,8 @@ void draw_caption::add_attributes( const xml::attributes_wc_ptr & Attributes )
...
@@ -607,9 +607,8 @@ void draw_caption::add_attributes( const xml::attributes_wc_ptr & Attributes )
void
draw_connector_attlist
::
add_attributes
(
const
xml
::
attributes_wc_ptr
&
Attributes
)
void
draw_connector_attlist
::
add_attributes
(
const
xml
::
attributes_wc_ptr
&
Attributes
)
{
{
CP_APPLY_ATTR
(
L"svg:d"
,
svg_d_
);
CP_APPLY_ATTR
(
L"svg:d"
,
svg_d_
);
CP_APPLY_ATTR
(
L"svg:viewBox"
,
svg_viewbox_
);
CP_APPLY_ATTR
(
L"svg:viewBox"
,
svg_viewbox_
);
CP_APPLY_ATTR
(
L"draw:type"
,
draw_type_
);
CP_APPLY_ATTR
(
L"draw:type"
,
draw_type_
);
}
}
// draw:connector
// draw:connector
const
wchar_t
*
draw_connector
::
ns
=
L"draw"
;
const
wchar_t
*
draw_connector
::
ns
=
L"draw"
;
...
@@ -669,5 +668,42 @@ void draw_connector::reset_svg_path()
...
@@ -669,5 +668,42 @@ void draw_connector::reset_svg_path()
}
}
///////////////////////////////////////
///////////////////////////////////////
// dr3d:scene
const
wchar_t
*
dr3d_scene
::
ns
=
L"dr3d"
;
const
wchar_t
*
dr3d_scene
::
name
=
L"scene"
;
void
dr3d_scene
::
add_attributes
(
const
xml
::
attributes_wc_ptr
&
Attributes
)
{
draw_shape
::
add_attributes
(
Attributes
);
sub_type_
=
10
;
}
// dr3d:extrude
const
wchar_t
*
dr3d_extrude
::
ns
=
L"dr3d"
;
const
wchar_t
*
dr3d_extrude
::
name
=
L"extrude"
;
void
dr3d_extrude
::
add_attributes
(
const
xml
::
attributes_wc_ptr
&
Attributes
)
{
CP_APPLY_ATTR
(
L"svg:d"
,
svg_d_
);
CP_APPLY_ATTR
(
L"svg:viewBox"
,
svg_viewbox_
);
}
void
dr3d_extrude
::
reset_svg_path
()
{
if
(
!
svg_d_
)
return
;
}
// dr3d:light
const
wchar_t
*
dr3d_light
::
ns
=
L"dr3d"
;
const
wchar_t
*
dr3d_light
::
name
=
L"light"
;
void
dr3d_light
::
add_attributes
(
const
xml
::
attributes_wc_ptr
&
Attributes
)
{
CP_APPLY_ATTR
(
L"dr3d:diffuse_color"
,
dr3d_diffuse_color_
);
CP_APPLY_ATTR
(
L"dr3d:direction"
,
dr3d_direction_
);
CP_APPLY_ATTR
(
L"dr3d:specular"
,
dr3d_specular_
);
CP_APPLY_ATTR
(
L"dr3d:enabled"
,
dr3d_enabled_
);
}
}
}
}
}
ASCOfficeOdfFile/src/odf/draw_shapes.h
View file @
e7dae4b3
...
@@ -543,8 +543,8 @@ public:
...
@@ -543,8 +543,8 @@ public:
virtual
void
docx_convert
(
oox
::
docx_conversion_context
&
Context
);
virtual
void
docx_convert
(
oox
::
docx_conversion_context
&
Context
);
virtual
void
pptx_convert
(
oox
::
pptx_conversion_context
&
Context
);
virtual
void
pptx_convert
(
oox
::
pptx_conversion_context
&
Context
);
draw_connector_attlist
draw_connector_attlist_
;
draw_connector_attlist
draw_connector_attlist_
;
draw_line_attlist
draw_line_attlist_
;
draw_line_attlist
draw_line_attlist_
;
void
reset_svg_path
();
void
reset_svg_path
();
void
reset_svg_attributes
();
void
reset_svg_attributes
();
...
@@ -552,5 +552,75 @@ public:
...
@@ -552,5 +552,75 @@ public:
CP_REGISTER_OFFICE_ELEMENT2
(
draw_connector
);
CP_REGISTER_OFFICE_ELEMENT2
(
draw_connector
);
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////
class
dr3d_scene
:
public
draw_shape
{
public:
static
const
wchar_t
*
ns
;
static
const
wchar_t
*
name
;
static
const
ElementType
type
=
typeDr3dScene
;
static
const
xml
::
NodeType
xml_type
=
xml
::
typeElement
;
virtual
void
add_attributes
(
const
xml
::
attributes_wc_ptr
&
Attributes
);
virtual
void
xlsx_convert
(
oox
::
xlsx_conversion_context
&
Context
);
virtual
void
docx_convert
(
oox
::
docx_conversion_context
&
Context
);
virtual
void
pptx_convert
(
oox
::
pptx_conversion_context
&
Context
);
};
CP_REGISTER_OFFICE_ELEMENT2
(
dr3d_scene
);
//////////////////////////////////////////////////////////////////////////////////////////////////////////
class
dr3d_extrude
:
public
office_element_impl
<
dr3d_extrude
>
{
public:
static
const
wchar_t
*
ns
;
static
const
wchar_t
*
name
;
static
const
ElementType
type
=
typeDr3dExtrude
;
static
const
xml
::
NodeType
xml_type
=
xml
::
typeElement
;
virtual
void
add_child_element
(
xml
::
sax
*
Reader
,
const
std
::
wstring
&
Ns
,
const
std
::
wstring
&
Name
){}
virtual
void
add_attributes
(
const
xml
::
attributes_wc_ptr
&
Attributes
);
virtual
void
xlsx_convert
(
oox
::
xlsx_conversion_context
&
Context
);
virtual
void
docx_convert
(
oox
::
docx_conversion_context
&
Context
);
virtual
void
pptx_convert
(
oox
::
pptx_conversion_context
&
Context
);
_CP_OPT
(
std
::
wstring
)
svg_d_
;
_CP_OPT
(
std
::
wstring
)
svg_viewbox_
;
void
reset_svg_path
();
};
CP_REGISTER_OFFICE_ELEMENT2
(
dr3d_extrude
);
//////////////////////////////////////////////////////////////////////////////////////////////////////////
class
dr3d_light
:
public
office_element_impl
<
dr3d_light
>
{
public:
static
const
wchar_t
*
ns
;
static
const
wchar_t
*
name
;
static
const
ElementType
type
=
typeDr3dLight
;
static
const
xml
::
NodeType
xml_type
=
xml
::
typeElement
;
virtual
void
add_child_element
(
xml
::
sax
*
Reader
,
const
std
::
wstring
&
Ns
,
const
std
::
wstring
&
Name
){}
virtual
void
add_attributes
(
const
xml
::
attributes_wc_ptr
&
Attributes
);
virtual
void
xlsx_convert
(
oox
::
xlsx_conversion_context
&
Context
);
virtual
void
docx_convert
(
oox
::
docx_conversion_context
&
Context
);
virtual
void
pptx_convert
(
oox
::
pptx_conversion_context
&
Context
);
_CP_OPT
(
std
::
wstring
)
dr3d_diffuse_color_
;
_CP_OPT
(
std
::
wstring
)
dr3d_direction_
;
_CP_OPT
(
std
::
wstring
)
dr3d_specular_
;
_CP_OPT
(
odf_types
::
Bool
)
dr3d_enabled_
;
};
CP_REGISTER_OFFICE_ELEMENT2
(
dr3d_light
);
}
}
}
}
\ No newline at end of file
ASCOfficeOdfFile/src/odf/draw_shapes_docx.cpp
View file @
e7dae4b3
...
@@ -338,5 +338,28 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
...
@@ -338,5 +338,28 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
shape
->
bad_shape_
=
true
;
shape
->
bad_shape_
=
true
;
}
}
}
}
void
dr3d_scene
::
docx_convert
(
oox
::
docx_conversion_context
&
Context
)
{
//if (Context.get_drawing_context().get_current_level() >0 )return;
if
(
Context
.
get_drawing_context
().
get_current_level
()
>
0
&&
!
Context
.
get_drawing_context
().
in_group
()
)
{
if
(
Context
.
delayed_converting_
==
false
)
Context
.
add_delayed_element
(
this
);
return
;
}
common_docx_convert
(
Context
);
//...
draw_shape
::
docx_convert
(
Context
);
}
void
dr3d_extrude
::
docx_convert
(
oox
::
docx_conversion_context
&
Context
)
{
reset_svg_path
();
}
void
dr3d_light
::
docx_convert
(
oox
::
docx_conversion_context
&
Context
)
{
}
}
}
}
}
\ No newline at end of file
ASCOfficeOdfFile/src/odf/draw_shapes_pptx.cpp
View file @
e7dae4b3
...
@@ -401,6 +401,24 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
...
@@ -401,6 +401,24 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
{
{
Context
.
get_slide_context
().
start_shape
(
1
);
//restart type shape
Context
.
get_slide_context
().
start_shape
(
1
);
//restart type shape
}
}
}
void
dr3d_scene
::
pptx_convert
(
oox
::
pptx_conversion_context
&
Context
)
{
Context
.
get_slide_context
().
start_shape
(
sub_type_
);
common_pptx_convert
(
Context
);
Context
.
get_slide_context
().
end_shape
();
}
void
dr3d_extrude
::
pptx_convert
(
oox
::
pptx_conversion_context
&
Context
)
{
reset_svg_path
();
}
void
dr3d_light
::
pptx_convert
(
oox
::
pptx_conversion_context
&
Context
)
{
}
}
}
}
}
}
\ No newline at end of file
ASCOfficeOdfFile/src/odf/draw_shapes_xlsx.cpp
View file @
e7dae4b3
...
@@ -334,6 +334,26 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
...
@@ -334,6 +334,26 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
{
{
}
}
}
}
}
void
dr3d_scene
::
xlsx_convert
(
oox
::
xlsx_conversion_context
&
Context
)
{
//const std::wstring style = common_shape_draw_attlist_.draw_text_style_name_.get_value_or(L"");
Context
.
get_drawing_context
().
start_shape
(
1
);
//rect с наваротами-атрибутами .. а-ля TextBox
common_xlsx_convert
(
Context
);
Context
.
get_drawing_context
().
end_shape
();
Context
.
get_drawing_context
().
clear
();
}
void
dr3d_extrude
::
xlsx_convert
(
oox
::
xlsx_conversion_context
&
Context
)
{
reset_svg_path
();
}
void
dr3d_light
::
xlsx_convert
(
oox
::
xlsx_conversion_context
&
Context
)
{
}
}
}
}
}
}
\ No newline at end of file
ASCOfficeOdfFile/src/odf/math_layout_elements.cpp
View file @
e7dae4b3
...
@@ -120,7 +120,7 @@ void math_mrow::oox_convert(oox::math_context & Context)
...
@@ -120,7 +120,7 @@ void math_mrow::oox_convert(oox::math_context & Context)
for
(
int
i
=
i_start
;
i
<
i_end
;
i
++
)
for
(
int
i
=
i_start
;
i
<
i_end
;
i
++
)
{
{
office_math_element
*
math_element
=
dynamic_cast
<
office_math_element
*>
(
content_
[
i
].
get
());
office_math_element
*
math_element
=
dynamic_cast
<
office_math_element
*>
(
content_
[
i
].
get
());
math_element
->
oox_convert
(
Context
);
math_element
->
oox_convert
(
Context
);
}
}
if
(
bDPr
)
if
(
bDPr
)
...
...
ASCOfficeOdfFile/src/odf/math_table_elements.cpp
View file @
e7dae4b3
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
*/
*/
#include "math_table_elements.h"
#include "math_table_elements.h"
#include "math_layout_elements.h"
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h>
...
@@ -92,10 +93,15 @@ void math_mtr::oox_convert(oox::math_context & Context)
...
@@ -92,10 +93,15 @@ void math_mtr::oox_convert(oox::math_context & Context)
strm
<<
L"<m:mr>"
;
strm
<<
L"<m:mr>"
;
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
{
//strm << L"<m:e>"; // EqArray записался в числитель вместо знаменателя.docx - дублирование
math_mrow
*
mrow_test
=
dynamic_cast
<
math_mrow
*>
(
content_
[
i
].
get
());
if
(
mrow_test
)
Context
.
output_stream
()
<<
L"<m:e>"
;
// EqArray записался в числитель вместо знаменателя.docx - дублирование
office_math_element
*
math_element
=
dynamic_cast
<
office_math_element
*>
(
content_
[
i
].
get
());
office_math_element
*
math_element
=
dynamic_cast
<
office_math_element
*>
(
content_
[
i
].
get
());
math_element
->
oox_convert
(
Context
);
math_element
->
oox_convert
(
Context
);
//strm << L"</m:e>";
if
(
mrow_test
)
strm
<<
L"</m:e>"
;
}
}
strm
<<
L"</m:mr>"
;
strm
<<
L"</m:mr>"
;
}
}
...
...
ASCOfficeOdfFile/src/odf/office_elements_type.h
View file @
e7dae4b3
...
@@ -346,6 +346,13 @@ enum ElementType
...
@@ -346,6 +346,13 @@ enum ElementType
typeDrawHandle
,
typeDrawHandle
,
typeDrawEquation
,
typeDrawEquation
,
typeDr3dScene
,
typeDr3dLight
,
typeDr3dExtrude
,
typeDr3dCube
,
typeDr3dRotate
,
typeDr3dSphere
,
typeDrawPage
,
typeDrawPage
,
typePresentationFooterDecl
,
typePresentationFooterDecl
,
typePresentationDateTimeDecl
,
typePresentationDateTimeDecl
,
...
...
ASCOfficeOdfFile/src/odf/text_elements.cpp
View file @
e7dae4b3
...
@@ -1248,7 +1248,7 @@ void text_changed_region::docx_convert(oox::docx_conversion_context & Context)
...
@@ -1248,7 +1248,7 @@ void text_changed_region::docx_convert(oox::docx_conversion_context & Context)
if
(
content_
.
empty
()
||
!
text_id_
)
return
;
if
(
content_
.
empty
()
||
!
text_id_
)
return
;
Context
.
get_text_tracked_context
().
start_change
(
*
text_id_
);
Context
.
get_text_tracked_context
().
start_change
(
*
text_id_
);
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
{
content_
[
i
]
->
docx_convert
(
Context
);
content_
[
i
]
->
docx_convert
(
Context
);
...
...
DesktopEditor/raster/Metafile/MetaFile.cpp
View file @
e7dae4b3
...
@@ -187,6 +187,12 @@ namespace MetaFile
...
@@ -187,6 +187,12 @@ namespace MetaFile
*
pdY
=
pRect
->
nTop
;
*
pdY
=
pRect
->
nTop
;
*
pdW
=
pRect
->
nRight
-
pRect
->
nLeft
;
*
pdW
=
pRect
->
nRight
-
pRect
->
nLeft
;
*
pdH
=
pRect
->
nBottom
-
pRect
->
nTop
;
*
pdH
=
pRect
->
nBottom
-
pRect
->
nTop
;
if
(
*
pdW
>
10000
||
*
pdH
>
10000
)
{
*
pdW
/=
10
;
*
pdH
/=
10
;
}
}
}
else
else
{
{
...
...
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