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
da18ecd8
Commit
da18ecd8
authored
Nov 29, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OdfFormatReader - fix same small bags
parent
7ae68b53
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
53 additions
and
36 deletions
+53
-36
ASCOfficeOdfFile/src/docx/pptx_output_xml.cpp
ASCOfficeOdfFile/src/docx/pptx_output_xml.cpp
+24
-14
ASCOfficeOdfFile/src/docx/pptx_text_context.cpp
ASCOfficeOdfFile/src/docx/pptx_text_context.cpp
+5
-4
ASCOfficeOdfFile/src/odf/datatypes/length.cpp
ASCOfficeOdfFile/src/odf/datatypes/length.cpp
+3
-4
ASCOfficeOdfFile/src/odf/draw_frame_pptx.cpp
ASCOfficeOdfFile/src/odf/draw_frame_pptx.cpp
+2
-2
ASCOfficeOdfFile/src/odf/draw_shapes_pptx.cpp
ASCOfficeOdfFile/src/odf/draw_shapes_pptx.cpp
+10
-6
ASCOfficeOdfFile/src/odf/style_text_properties.cpp
ASCOfficeOdfFile/src/odf/style_text_properties.cpp
+2
-2
ASCOfficeOdfFile/src/odf/styles.cpp
ASCOfficeOdfFile/src/odf/styles.cpp
+7
-4
No files found.
ASCOfficeOdfFile/src/docx/pptx_output_xml.cpp
View file @
da18ecd8
...
...
@@ -89,11 +89,14 @@ void pptx_xml_slide::write_to(std::wostream & strm)
{
CP_XML_NODE
(
L"p:sld"
)
{
CP_XML_ATTR
(
L"xmlns:p"
,
L"http://schemas.openxmlformats.org/presentationml/2006/main"
);
CP_XML_ATTR
(
L"xmlns:r"
,
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships"
);
CP_XML_ATTR
(
L"xmlns:a"
,
L"http://schemas.openxmlformats.org/drawingml/2006/main"
);
CP_XML_NODE
(
L"p:cSld"
)
CP_XML_ATTR
(
L"xmlns:a"
,
L"http://schemas.openxmlformats.org/drawingml/2006/main"
);
CP_XML_ATTR
(
L"xmlns:p"
,
L"http://schemas.openxmlformats.org/presentationml/2006/main"
);
CP_XML_ATTR
(
L"xmlns:r"
,
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships"
);
CP_XML_ATTR
(
L"xmlns:p14"
,
L"http://schemas.microsoft.com/office/powerpoint/2010/main"
);
CP_XML_ATTR
(
L"xmlns:p15"
,
L"http://schemas.microsoft.com/office/powerpoint/2012/main"
);
CP_XML_ATTR
(
L"xmlns:mc"
,
L"http://schemas.openxmlformats.org/markup-compatibility/2006"
);
CP_XML_NODE
(
L"p:cSld"
)
{
CP_XML_ATTR
(
L"name"
,
name
());
...
...
@@ -147,15 +150,19 @@ void pptx_xml_slideLayout::write_to(std::wostream & strm)
{
CP_XML_NODE
(
L"p:sldLayout"
)
{
CP_XML_ATTR
(
L"xmlns:a"
,
L"http://schemas.openxmlformats.org/drawingml/2006/main"
);
CP_XML_ATTR
(
L"xmlns:p"
,
L"http://schemas.openxmlformats.org/presentationml/2006/main"
);
CP_XML_ATTR
(
L"xmlns:r"
,
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships"
);
CP_XML_ATTR
(
L"xmlns:p14"
,
L"http://schemas.microsoft.com/office/powerpoint/2010/main"
);
CP_XML_ATTR
(
L"xmlns:p15"
,
L"http://schemas.microsoft.com/office/powerpoint/2012/main"
);
CP_XML_ATTR
(
L"xmlns:mc"
,
L"http://schemas.openxmlformats.org/markup-compatibility/2006"
);
//if (slideLayoutData_.str().length()<0)
// CP_XML_ATTR(L"type",L"cust");//---------------------------!!!!!!!!!!!!
//else
// CP_XML_ATTR(L"type",L"cust");
CP_XML_ATTR
(
L"xmlns:p"
,
L"http://schemas.openxmlformats.org/presentationml/2006/main"
);
CP_XML_ATTR
(
L"xmlns:r"
,
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships"
);
CP_XML_ATTR
(
L"xmlns:a"
,
L"http://schemas.openxmlformats.org/drawingml/2006/main"
);
CP_XML_NODE
(
L"p:cSld"
)
// CP_XML_ATTR(L"type",L"cust");
CP_XML_NODE
(
L"p:cSld"
)
{
CP_XML_NODE
(
L"p:spTree"
)
{
...
...
@@ -239,9 +246,12 @@ void pptx_xml_slideMaster::write_to(std::wostream & strm)
{
CP_XML_NODE
(
L"p:sldMaster"
)
{
CP_XML_ATTR
(
L"xmlns:a"
,
L"http://schemas.openxmlformats.org/drawingml/2006/main"
);
CP_XML_ATTR
(
L"xmlns:r"
,
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships"
);
CP_XML_ATTR
(
L"xmlns:p"
,
L"http://schemas.openxmlformats.org/presentationml/2006/main"
);
CP_XML_ATTR
(
L"xmlns:a"
,
L"http://schemas.openxmlformats.org/drawingml/2006/main"
);
CP_XML_ATTR
(
L"xmlns:p"
,
L"http://schemas.openxmlformats.org/presentationml/2006/main"
);
CP_XML_ATTR
(
L"xmlns:r"
,
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships"
);
CP_XML_ATTR
(
L"xmlns:p14"
,
L"http://schemas.microsoft.com/office/powerpoint/2010/main"
);
CP_XML_ATTR
(
L"xmlns:p15"
,
L"http://schemas.microsoft.com/office/powerpoint/2012/main"
);
CP_XML_ATTR
(
L"xmlns:mc"
,
L"http://schemas.openxmlformats.org/markup-compatibility/2006"
);
CP_XML_NODE
(
L"p:cSld"
)
{
...
...
ASCOfficeOdfFile/src/docx/pptx_text_context.cpp
View file @
da18ecd8
...
...
@@ -363,19 +363,20 @@ void pptx_text_context::Impl::write_pPr(std::wostream & strm)
odf_reader
::
paragraph_format_properties
paragraph_properties_
;
ApplyParagraphProperties
(
paragraph_style_name_
,
paragraph_properties_
,
odf_types
::
style_family
::
Paragraph
);
ApplyListProperties
(
paragraph_properties_
,
level
);
//выравнивания листа накатим на свойства параграфа
ApplyListProperties
(
paragraph_properties_
,
level
);
//выравнивания листа накатим на свойства параграфа
paragraph_properties_
.
pptx_convert
(
pptx_context_
);
const
std
::
wstring
&
paragraphAttr
=
get_styles_context
().
paragraph_attr
().
str
();
const
std
::
wstring
&
paragraphNodes
=
get_styles_context
().
paragraph_nodes
().
str
();
if
(
level
<
0
&&
paragraphAttr
.
length
()
<
1
&&
paragraphNodes
.
length
()
<
1
)
return
;
if
(
level
<
0
&&
paragraphAttr
.
length
()
<
1
&&
!
paragraphNodes
.
empty
()
)
return
;
strm
<<
L"<a:pPr "
;
if
(
level
>=
0
)
if
(
level
>=
0
)
{
if
(
level
>
8
)
level
=
0
;
strm
<<
L"lvl=
\"
"
<<
level
<<
L"
\"
"
;
}
...
...
@@ -384,7 +385,7 @@ void pptx_text_context::Impl::write_pPr(std::wostream & strm)
strm
<<
">"
;
strm
<<
paragraphNodes
;
if
(
level
>=
0
)
if
(
level
>=
0
)
{
...
...
ASCOfficeOdfFile/src/odf/datatypes/length.cpp
View file @
da18ecd8
...
...
@@ -31,12 +31,11 @@
*/
#include "length.h"
#include "../../../../Common/DocxFormat/Source/Base/Types_32.h"
#include <iostream>
#include <sstream>
#include <boost/lexical_cast.hpp>
namespace
cpdoccore
{
namespace
odf_types
{
std
::
wostream
&
operator
<<
(
std
::
wostream
&
_Wostream
,
const
length
::
unit
_Unit
)
...
...
@@ -223,9 +222,9 @@ double to_pt(const length & Val)
return
0.0
;
}
int
pt_to_emu
(
double
Val
)
_INT64
pt_to_emu
(
double
Val
)
{
return
static_cast
<
int
>
(
Val
*
360000
*
2.54
)
/
72
;
return
static_cast
<
_INT64
>
(
Val
*
360000
*
2.54
)
/
72
;
}
}
...
...
ASCOfficeOdfFile/src/odf/draw_frame_pptx.cpp
View file @
da18ecd8
...
...
@@ -109,8 +109,8 @@ void draw_frame::pptx_convert(oox::pptx_conversion_context & Context)
double
x_pt
=
common_draw_attlists_
.
position_
.
svg_x_
.
get_value_or
(
length
(
0
)).
get_value_unit
(
length
::
pt
);
double
y_pt
=
common_draw_attlists_
.
position_
.
svg_y_
.
get_value_or
(
length
(
0
)).
get_value_unit
(
length
::
pt
);
if
(
x_pt
<
0
)
x_pt
=
0
;
if
(
y_pt
<
0
)
y_pt
=
0
;
if
(
x_pt
<
0
)
x_pt
=
0
;
if
(
y_pt
<
0
)
y_pt
=
0
;
Context
.
get_slide_context
().
set_rect
(
width_pt
,
height_pt
,
x_pt
,
y_pt
);
}
...
...
ASCOfficeOdfFile/src/odf/draw_shapes_pptx.cpp
View file @
da18ecd8
...
...
@@ -166,8 +166,6 @@ void draw_shape::common_pptx_convert(oox::pptx_conversion_context & Context)
{
Context
.
get_slide_context
().
set_property
(
_property
(
L"text-content"
,
text_content_
));
}
//Context.get_slide_context().end_drawing();
}
void
draw_rect
::
pptx_convert
(
oox
::
pptx_conversion_context
&
Context
)
{
...
...
@@ -304,6 +302,8 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
{
find_draw_type_oox
();
bool
set_shape
=
false
;
if
(
draw_type_oox_index_
)
{
Context
.
get_slide_context
().
set_property
(
_property
(
L"odf-custom-draw-index"
,
draw_type_oox_index_
.
get
()));
...
...
@@ -311,10 +311,12 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
if
(
word_art_
==
true
)
Context
.
get_slide_context
().
set_property
(
_property
(
L"wordArt"
,
true
));
set_shape
=
true
;
}
if
(
sub_type_
)
{
Context
.
get_slide_context
().
start_shape
(
sub_type_
.
get
());
set_shape
=
true
;
}
if
(
draw_enhanced_geometry_attlist_
.
draw_enhanced_path_
)
...
...
@@ -339,6 +341,8 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
svg_path
::
oox_serialize
(
output_
,
o_Polyline
);
Context
.
get_slide_context
().
set_property
(
odf_reader
::
_property
(
L"custom_path"
,
output_
.
str
()));
set_shape
=
true
;
if
(
draw_enhanced_geometry_attlist_
.
drawooo_sub_view_size_
)
{
std
::
vector
<
std
::
wstring
>
splitted
;
...
...
@@ -362,10 +366,6 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
}
}
}
else
if
(
!
draw_type_oox_index_
)
{
draw_type_oox_index_
=
0
;
}
}
if
(
draw_enhanced_geometry_attlist_
.
draw_modifiers_
)
{
...
...
@@ -380,6 +380,10 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
}
}
}
if
(
!
set_shape
)
{
Context
.
get_slide_context
().
start_shape
(
1
);
//restart type shape
}
}
}
}
\ No newline at end of file
ASCOfficeOdfFile/src/odf/style_text_properties.cpp
View file @
da18ecd8
...
...
@@ -345,11 +345,11 @@ void text_format_properties_content::pptx_convert(oox::pptx_conversion_context &
}
if
(
fo_text_transform_
)
{
if
(
fo_
font_variant
_
->
get_type
()
==
text_transform
::
Uppercase
)
if
(
fo_
text_transform
_
->
get_type
()
==
text_transform
::
Uppercase
)
{
CP_XML_ATTR
(
L"cap"
,
"all"
);
}
else
if
(
fo_
font_variant
_
->
get_type
()
==
text_transform
::
Lowercase
)
else
if
(
fo_
text_transform
_
->
get_type
()
==
text_transform
::
Lowercase
)
{
CP_XML_ATTR
(
L"cap"
,
"small"
);
}
...
...
ASCOfficeOdfFile/src/odf/styles.cpp
View file @
da18ecd8
...
...
@@ -1177,20 +1177,23 @@ void style_page_layout_properties_attlist::pptx_convert(oox::pptx_conversion_con
if
(
fo_page_width_
||
fo_page_height_
||
style_print_orientation_
)
{
std
::
wstring
w_w
=
L""
,
w_h
=
L""
;
std
::
wstring
w_w
,
w_h
;
int
h
=
0
,
w
=
0
;
_INT64
h
=
0
,
w
=
0
;
if
(
fo_page_width_
)
{
w
=
fo_page_width_
->
get_value_unit
(
length
::
emu
);
if
(
w
<
914400
)
w
=
914400
;
w_w
=
boost
::
lexical_cast
<
std
::
wstring
>
(
w
);
w_w
=
std
::
to_wstring
(
w
);
}
if
(
fo_page_height_
)
{
h
=
fo_page_height_
->
get_value_unit
(
length
::
emu
);
w_h
=
boost
::
lexical_cast
<
std
::
wstring
>
(
h
);
if
(
h
<
914400
)
h
=
914400
;
w_h
=
std
::
to_wstring
(
h
);
}
std
::
wstring
w_orient
=
L"custom"
;
...
...
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