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
337c92e5
Commit
337c92e5
authored
Oct 16, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OdsFormat - fix absolute anchor for ole
parent
8fe1eb75
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
13 deletions
+33
-13
ASCOfficeOdfFile/src/docx/xlsx_drawing_context.cpp
ASCOfficeOdfFile/src/docx/xlsx_drawing_context.cpp
+25
-5
ASCOfficeOdfFile/src/docx/xlsx_drawing_context.h
ASCOfficeOdfFile/src/docx/xlsx_drawing_context.h
+2
-2
ASCOfficeOdfFile/src/docx/xlsx_drawings.cpp
ASCOfficeOdfFile/src/docx/xlsx_drawings.cpp
+6
-6
No files found.
ASCOfficeOdfFile/src/docx/xlsx_drawing_context.cpp
View file @
337c92e5
...
...
@@ -576,11 +576,31 @@ void xlsx_drawing_context::process_chart(drawing_object_description & obj,_xlsx_
impl_
->
get_drawings
()
->
add
(
isMediaInternal
,
drawing
.
objectId
,
ref
,
obj
.
type_
);
// не объект
}
void
xlsx_drawing_context
::
process_object
(
drawing_object_description
&
obj
,
_xlsx_drawing
&
drawing
,
xlsx_drawings_ptr
xlsx_drawings_
)
void
xlsx_drawing_context
::
process_object
(
drawing_object_description
&
obj
,
xlsx_table_metrics
&
table_metrics
,
_xlsx_drawing
&
drawing
,
xlsx_drawings_ptr
xlsx_drawings_
)
{
std
::
wstring
ref
;
bool
isMediaInternal
=
true
;
if
(
drawing
.
type_anchor
==
2
)
// absolute
{
//пересчет нужен для оле
xlsx_table_position
from
,
to
;
process_position_properties
(
obj
,
table_metrics
,
from
,
to
);
drawing
.
from_
.
type
=
xlsx_drawing_position
::
from
;
drawing
.
from_
.
position
.
col
=
from
.
col
;
drawing
.
from_
.
position
.
colOff
=
static_cast
<
size_t
>
(
odf_types
::
length
(
from
.
colOff
,
odf_types
::
length
::
pt
).
get_value_unit
(
odf_types
::
length
::
emu
));
drawing
.
from_
.
position
.
row
=
from
.
row
;
drawing
.
from_
.
position
.
rowOff
=
static_cast
<
size_t
>
(
odf_types
::
length
(
from
.
rowOff
,
odf_types
::
length
::
pt
).
get_value_unit
(
odf_types
::
length
::
emu
));
drawing
.
to_
.
type
=
xlsx_drawing_position
::
to
;
drawing
.
to_
.
position
.
col
=
to
.
col
;
drawing
.
to_
.
position
.
colOff
=
static_cast
<
size_t
>
(
odf_types
::
length
(
to
.
colOff
,
odf_types
::
length
::
pt
).
get_value_unit
(
odf_types
::
length
::
emu
));
drawing
.
to_
.
position
.
row
=
to
.
row
;
drawing
.
to_
.
position
.
rowOff
=
static_cast
<
size_t
>
(
odf_types
::
length
(
to
.
rowOff
,
odf_types
::
length
::
pt
).
get_value_unit
(
odf_types
::
length
::
emu
));
}
drawing
.
objectId
=
impl_
->
get_mediaitems
().
add_or_find
(
obj
.
xlink_href_
,
obj
.
type_
,
isMediaInternal
,
ref
);
drawing
.
objectProgId
=
obj
.
descriptor_
;
...
...
@@ -602,7 +622,7 @@ void xlsx_drawing_context::process_group(drawing_object_description & obj, xlsx_
{
xlsx_drawings_ptr
xlsx_drawings_child
(
xlsx_drawings
::
create
(
true
));
process_objects
(
obj
.
child_objects_
,
table_metrics
,
xlsx_drawings_child
);
process_
group_
objects
(
obj
.
child_objects_
,
table_metrics
,
xlsx_drawings_child
);
std
::
wstringstream
strm
;
...
...
@@ -620,9 +640,9 @@ void xlsx_drawing_context::process_group(drawing_object_description & obj, xlsx_
}
void
xlsx_drawing_context
::
process_objects
(
xlsx_table_metrics
&
table_metrics
)
{
process_objects
(
impl_
->
objects_
,
table_metrics
,
impl_
->
get_drawings
());
process_
group_
objects
(
impl_
->
objects_
,
table_metrics
,
impl_
->
get_drawings
());
}
void
xlsx_drawing_context
::
process_objects
(
std
::
vector
<
drawing_object_description
>
objects
,
xlsx_table_metrics
&
table_metrics
,
xlsx_drawings_ptr
xlsx_drawings_
)
void
xlsx_drawing_context
::
process_
group_
objects
(
std
::
vector
<
drawing_object_description
>
objects
,
xlsx_table_metrics
&
table_metrics
,
xlsx_drawings_ptr
xlsx_drawings_
)
{
for
(
size_t
i
=
0
;
i
<
objects
.
size
();
i
++
)
{
...
...
@@ -661,7 +681,7 @@ void xlsx_drawing_context::process_objects(std::vector<drawing_object_descriptio
case
typeGroupShape
:
process_group
(
obj
,
table_metrics
,
drawing
,
xlsx_drawings_
);
break
;
case
typeMsObject
:
case
typeOleObject
:
process_object
(
obj
,
drawing
,
xlsx_drawings_
);
break
;
process_object
(
obj
,
table_metrics
,
drawing
,
xlsx_drawings_
);
break
;
}
}
}
...
...
ASCOfficeOdfFile/src/docx/xlsx_drawing_context.h
View file @
337c92e5
...
...
@@ -133,13 +133,13 @@ private:
class
Impl
;
_CP_PTR
(
Impl
)
impl_
;
void
process_objects
(
std
::
vector
<
drawing_object_description
>
objects
,
xlsx_table_metrics
&
table_metrics
,
xlsx_drawings_ptr
xlsx_drawings_
);
void
process_group
(
drawing_object_description
&
obj
,
xlsx_table_metrics
&
table_metrics
,
_xlsx_drawing
&
drawing
,
xlsx_drawings_ptr
xlsx_drawings_
);
void
process_group_objects
(
std
::
vector
<
drawing_object_description
>
objects
,
xlsx_table_metrics
&
table_metrics
,
xlsx_drawings_ptr
xlsx_drawings_
);
void
process_image
(
drawing_object_description
&
obj
,
_xlsx_drawing
&
drawing
,
xlsx_drawings_ptr
xlsx_drawings_
);
void
process_chart
(
drawing_object_description
&
obj
,
_xlsx_drawing
&
drawing
,
xlsx_drawings_ptr
xlsx_drawings_
);
void
process_shape
(
drawing_object_description
&
obj
,
_xlsx_drawing
&
drawing
,
xlsx_drawings_ptr
xlsx_drawings_
);
void
process_object
(
drawing_object_description
&
obj
,
_xlsx_drawing
&
drawing
,
xlsx_drawings_ptr
xlsx_drawings_
);
void
process_object
(
drawing_object_description
&
obj
,
xlsx_table_metrics
&
table_metrics
,
_xlsx_drawing
&
drawing
,
xlsx_drawings_ptr
xlsx_drawings_
);
void
process_common_properties
(
drawing_object_description
&
obj
,
_xlsx_drawing
&
drawing
,
xlsx_table_metrics
&
table_metrics
);
...
...
ASCOfficeOdfFile/src/docx/xlsx_drawings.cpp
View file @
337c92e5
...
...
@@ -65,7 +65,7 @@ public:
if
(
sheet_rel
)
{
for
(
in
t
i
=
0
;
i
<
xlsx_sheet_rels_
.
size
();
i
++
)
for
(
size_
t
i
=
0
;
i
<
xlsx_sheet_rels_
.
size
();
i
++
)
{
if
(
xlsx_sheet_rels_
[
i
].
rid
==
rid
&&
xlsx_sheet_rels_
[
i
].
ref
==
ref
)
present
=
true
;
...
...
@@ -75,7 +75,7 @@ public:
}
else
{
for
(
in
t
i
=
0
;
i
<
xlsx_drawing_rels_
.
size
();
i
++
)
for
(
size_
t
i
=
0
;
i
<
xlsx_drawing_rels_
.
size
();
i
++
)
{
if
(
xlsx_drawing_rels_
[
i
].
rid
==
rid
&&
xlsx_drawing_rels_
[
i
].
ref
==
ref
)
present
=
true
;
...
...
@@ -89,7 +89,7 @@ public:
{
if
(
inGroup
)
{
for
(
in
t
i
=
0
;
i
<
xlsx_drawings_
.
size
();
i
++
)
for
(
size_
t
i
=
0
;
i
<
xlsx_drawings_
.
size
();
i
++
)
{
xlsx_drawings_
[
i
].
serialize
(
strm
);
}
...
...
@@ -114,7 +114,7 @@ public:
}
void
serialize_objects
(
std
::
wostream
&
strm
)
{
for
(
in
t
i
=
0
;
i
<
xlsx_drawings_
.
size
();
i
++
)
for
(
size_
t
i
=
0
;
i
<
xlsx_drawings_
.
size
();
i
++
)
{
if
(
xlsx_drawings_
[
i
].
type
!=
typeOleObject
&&
xlsx_drawings_
[
i
].
type
!=
typeMsObject
)
continue
;
...
...
@@ -129,7 +129,7 @@ public:
void
dump_rels_drawing
(
rels
&
Rels
)
{
for
(
in
t
i
=
0
;
i
<
xlsx_drawing_rels_
.
size
();
i
++
)
for
(
size_
t
i
=
0
;
i
<
xlsx_drawing_rels_
.
size
();
i
++
)
{
if
(
xlsx_drawing_rels_
[
i
].
type
==
typeImage
||
xlsx_drawing_rels_
[
i
].
type
==
typeMedia
||
...
...
@@ -146,7 +146,7 @@ public:
}
void
dump_rels_sheet
(
rels
&
Rels
)
{
for
(
in
t
i
=
0
;
i
<
xlsx_sheet_rels_
.
size
();
i
++
)
for
(
size_
t
i
=
0
;
i
<
xlsx_sheet_rels_
.
size
();
i
++
)
{
Rels
.
add
(
relationship
(
xlsx_sheet_rels_
[
i
].
rid
,
mediaitems
::
get_rel_type
(
xlsx_sheet_rels_
[
i
].
type
),
...
...
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