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
7c8602d9
Commit
7c8602d9
authored
Sep 21, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OdfFormatReader - expansion custom shape convert
parent
a8a684bf
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
117 additions
and
7 deletions
+117
-7
ASCOfficeOdfFile/src/odf/draw_shapes_pptx.cpp
ASCOfficeOdfFile/src/odf/draw_shapes_pptx.cpp
+57
-2
ASCOfficeOdfFile/src/odf/draw_shapes_xlsx.cpp
ASCOfficeOdfFile/src/odf/draw_shapes_xlsx.cpp
+58
-3
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/FORMATTING.cpp
...lsFile2/source/XlsFormat/Logic/Biff_unions/FORMATTING.cpp
+0
-2
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/OBJECTS.cpp
...ceXlsFile2/source/XlsFormat/Logic/Biff_unions/OBJECTS.cpp
+2
-0
No files found.
ASCOfficeOdfFile/src/odf/draw_shapes_pptx.cpp
View file @
7c8602d9
...
@@ -304,13 +304,68 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
...
@@ -304,13 +304,68 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
{
{
find_draw_type_oox
();
find_draw_type_oox
();
if
(
draw_type_oox_index_
)
{
Context
.
get_slide_context
().
set_property
(
_property
(
L"odf-custom-draw-index"
,
draw_type_oox_index_
.
get
()));
if
(
word_art_
==
true
)
Context
.
get_slide_context
().
set_property
(
_property
(
L"wordArt"
,
true
));
}
if
(
sub_type_
)
if
(
sub_type_
)
{
{
Context
.
get_slide_context
().
start_shape
(
sub_type_
.
get
());
Context
.
get_slide_context
().
start_shape
(
sub_type_
.
get
());
}
}
if
(
draw_type_oox_index_
)
if
(
draw_enhanced_geometry_attlist_
.
draw_enhanced_path_
)
{
{
Context
.
get_slide_context
().
set_property
(
_property
(
L"odf-custom-draw-index"
,
draw_type_oox_index_
.
get
()));
std
::
vector
<
svg_path
::
_polyline
>
o_Polyline
;
bool
res
=
false
;
try
{
res
=
svg_path
::
parseSvgD
(
o_Polyline
,
draw_enhanced_geometry_attlist_
.
draw_enhanced_path_
.
get
(),
true
);
}
catch
(...)
{
res
=
false
;
}
if
(
o_Polyline
.
size
()
>
1
&&
res
)
{
//сформируем xml-oox сдесь ... а то придется плодить массивы в drawing .. хоть и не красиво..
std
::
wstringstream
output_
;
svg_path
::
oox_serialize
(
output_
,
o_Polyline
);
Context
.
get_slide_context
().
set_property
(
odf_reader
::
_property
(
L"custom_path"
,
output_
.
str
()));
if
(
draw_enhanced_geometry_attlist_
.
drawooo_sub_view_size_
)
{
std
::
vector
<
std
::
wstring
>
splitted
;
boost
::
algorithm
::
split
(
splitted
,
*
draw_enhanced_geometry_attlist_
.
drawooo_sub_view_size_
,
boost
::
algorithm
::
is_any_of
(
L" "
),
boost
::
algorithm
::
token_compress_on
);
if
(
splitted
.
size
()
==
2
)
{
int
w
=
boost
::
lexical_cast
<
int
>
(
splitted
[
0
]);
int
h
=
boost
::
lexical_cast
<
int
>
(
splitted
[
1
]);
Context
.
get_slide_context
().
set_property
(
odf_reader
::
_property
(
L"custom_path_w"
,
w
));
Context
.
get_slide_context
().
set_property
(
odf_reader
::
_property
(
L"custom_path_h"
,
h
));
}
else
if
(
splitted
.
size
()
==
4
)
{
///???? rect ???
int
l
=
boost
::
lexical_cast
<
int
>
(
splitted
[
0
]);
int
t
=
boost
::
lexical_cast
<
int
>
(
splitted
[
1
]);
int
r
=
boost
::
lexical_cast
<
int
>
(
splitted
[
2
]);
int
b
=
boost
::
lexical_cast
<
int
>
(
splitted
[
3
]);
}
}
}
else
if
(
!
draw_type_oox_index_
)
{
draw_type_oox_index_
=
0
;
}
}
}
if
(
draw_enhanced_geometry_attlist_
.
draw_modifiers_
)
if
(
draw_enhanced_geometry_attlist_
.
draw_modifiers_
)
{
{
...
...
ASCOfficeOdfFile/src/odf/draw_shapes_xlsx.cpp
View file @
7c8602d9
...
@@ -107,7 +107,7 @@ void draw_shape::common_xlsx_convert(oox::xlsx_conversion_context & Context)
...
@@ -107,7 +107,7 @@ void draw_shape::common_xlsx_convert(oox::xlsx_conversion_context & Context)
const
double
a_x_pt
=
common_draw_attlist_
.
common_text_spreadsheet_shape_attlist_
.
table_end_x_
.
get_value_or
(
length
(
0
)).
get_value_unit
(
length
::
pt
);
const
double
a_x_pt
=
common_draw_attlist_
.
common_text_spreadsheet_shape_attlist_
.
table_end_x_
.
get_value_or
(
length
(
0
)).
get_value_unit
(
length
::
pt
);
const
double
a_y_pt
=
common_draw_attlist_
.
common_text_spreadsheet_shape_attlist_
.
table_end_y_
.
get_value_or
(
length
(
0
)).
get_value_unit
(
length
::
pt
);
const
double
a_y_pt
=
common_draw_attlist_
.
common_text_spreadsheet_shape_attlist_
.
table_end_y_
.
get_value_or
(
length
(
0
)).
get_value_unit
(
length
::
pt
);
Context
.
get_drawing_context
().
set_anchor
(
Anchor
,
a_x_pt
,
a_y_pt
);
Context
.
get_drawing_context
().
set_anchor
(
Anchor
,
a_x_pt
,
a_y_pt
);
}
}
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
std
::
vector
<
const
odf_reader
::
style_instance
*>
instances
;
std
::
vector
<
const
odf_reader
::
style_instance
*>
instances
;
...
@@ -260,13 +260,68 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
...
@@ -260,13 +260,68 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
{
{
find_draw_type_oox
();
find_draw_type_oox
();
if
(
draw_type_oox_index_
)
{
Context
.
get_drawing_context
().
set_property
(
_property
(
L"odf-custom-draw-index"
,
draw_type_oox_index_
.
get
()));
if
(
word_art_
==
true
)
Context
.
get_drawing_context
().
set_property
(
_property
(
L"wordArt"
,
true
));
}
if
(
sub_type_
)
if
(
sub_type_
)
{
{
Context
.
get_drawing_context
().
start_shape
(
sub_type_
.
get
());
Context
.
get_drawing_context
().
start_shape
(
sub_type_
.
get
());
}
}
if
(
draw_type_oox_index_
)
if
(
draw_enhanced_geometry_attlist_
.
draw_enhanced_path_
)
{
{
Context
.
get_drawing_context
().
set_property
(
_property
(
L"odf-custom-draw-index"
,
draw_type_oox_index_
.
get
()));
std
::
vector
<
svg_path
::
_polyline
>
o_Polyline
;
bool
res
=
false
;
try
{
res
=
svg_path
::
parseSvgD
(
o_Polyline
,
draw_enhanced_geometry_attlist_
.
draw_enhanced_path_
.
get
(),
true
);
}
catch
(...)
{
res
=
false
;
}
if
(
o_Polyline
.
size
()
>
1
&&
res
)
{
//сформируем xml-oox сдесь ... а то придется плодить массивы в drawing .. хоть и не красиво..
std
::
wstringstream
output_
;
svg_path
::
oox_serialize
(
output_
,
o_Polyline
);
Context
.
get_drawing_context
().
set_property
(
odf_reader
::
_property
(
L"custom_path"
,
output_
.
str
()));
if
(
draw_enhanced_geometry_attlist_
.
drawooo_sub_view_size_
)
{
std
::
vector
<
std
::
wstring
>
splitted
;
boost
::
algorithm
::
split
(
splitted
,
*
draw_enhanced_geometry_attlist_
.
drawooo_sub_view_size_
,
boost
::
algorithm
::
is_any_of
(
L" "
),
boost
::
algorithm
::
token_compress_on
);
if
(
splitted
.
size
()
==
2
)
{
int
w
=
boost
::
lexical_cast
<
int
>
(
splitted
[
0
]);
int
h
=
boost
::
lexical_cast
<
int
>
(
splitted
[
1
]);
Context
.
get_drawing_context
().
set_property
(
odf_reader
::
_property
(
L"custom_path_w"
,
w
));
Context
.
get_drawing_context
().
set_property
(
odf_reader
::
_property
(
L"custom_path_h"
,
h
));
}
else
if
(
splitted
.
size
()
==
4
)
{
///???? rect ???
int
l
=
boost
::
lexical_cast
<
int
>
(
splitted
[
0
]);
int
t
=
boost
::
lexical_cast
<
int
>
(
splitted
[
1
]);
int
r
=
boost
::
lexical_cast
<
int
>
(
splitted
[
2
]);
int
b
=
boost
::
lexical_cast
<
int
>
(
splitted
[
3
]);
}
}
}
else
if
(
!
draw_type_oox_index_
)
{
draw_type_oox_index_
=
0
;
}
}
}
if
(
draw_enhanced_geometry_attlist_
.
draw_modifiers_
)
if
(
draw_enhanced_geometry_attlist_
.
draw_modifiers_
)
{
{
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/FORMATTING.cpp
View file @
7c8602d9
...
@@ -110,8 +110,6 @@ const bool FORMATTING::loadContent(BinProcessor& proc)
...
@@ -110,8 +110,6 @@ const bool FORMATTING::loadContent(BinProcessor& proc)
elements_
.
pop_back
();
elements_
.
pop_back
();
count
--
;
count
--
;
}
}
global_info
->
cellStyleDxfs_count
=
m_arDXF
.
size
();
// + будут юзерские
//----------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------
if
(
proc
.
optional
<
STYLES
>
())
if
(
proc
.
optional
<
STYLES
>
())
{
{
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/OBJECTS.cpp
View file @
7c8602d9
...
@@ -110,6 +110,7 @@ public:
...
@@ -110,6 +110,7 @@ public:
const
bool
loadContent
(
BinProcessor
&
proc
)
const
bool
loadContent
(
BinProcessor
&
proc
)
{
{
// EXCEPT::LE::UnexpectedProgramPath("Wrong loadContent usage", __FUNCTION__);
// EXCEPT::LE::UnexpectedProgramPath("Wrong loadContent usage", __FUNCTION__);
return
false
;
}
}
...
@@ -138,6 +139,7 @@ BaseObjectPtr OBJECTS::clone()
...
@@ -138,6 +139,7 @@ BaseObjectPtr OBJECTS::clone()
const
bool
OBJECTS
::
loadContent
(
BinProcessor
&
proc
)
const
bool
OBJECTS
::
loadContent
(
BinProcessor
&
proc
)
{
{
// EXCEPT::LE::UnexpectedProgramPath("Wrong loadContent usage", __FUNCTION__);
// EXCEPT::LE::UnexpectedProgramPath("Wrong loadContent usage", __FUNCTION__);
return
false
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment