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
b93d4634
Commit
b93d4634
authored
Jun 29, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OdfFormat - fix roundRect
parent
0aa59b0d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
21 deletions
+61
-21
ASCOfficeOdfFile/src/odf/draw_shapes_docx.cpp
ASCOfficeOdfFile/src/odf/draw_shapes_docx.cpp
+13
-5
ASCOfficeOdfFileW/source/OdfFormat/odt_conversion_context.cpp
...fficeOdfFileW/source/OdfFormat/odt_conversion_context.cpp
+35
-14
ASCOfficeOdfFileW/source/OdfFormat/odt_conversion_context.h
ASCOfficeOdfFileW/source/OdfFormat/odt_conversion_context.h
+3
-0
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertVml.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertVml.cpp
+8
-0
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
+2
-2
No files found.
ASCOfficeOdfFile/src/odf/draw_shapes_docx.cpp
View file @
b93d4634
...
@@ -95,13 +95,13 @@ void draw_shape::common_docx_convert(oox::docx_conversion_context & Context)
...
@@ -95,13 +95,13 @@ void draw_shape::common_docx_convert(oox::docx_conversion_context & Context)
Context
.
set_paragraph_state
(
false
);
Context
.
set_paragraph_state
(
false
);
Context
.
set_run_state
(
false
);
Context
.
set_run_state
(
false
);
BOOST_FOREACH
(
const
office_element_ptr
&
elm
,
content_
)
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
{
ElementType
type
=
elm
->
get_type
();
ElementType
type
=
content_
[
i
]
->
get_type
();
if
(
type
!=
typeDrawCustomShape
)
if
(
type
!=
typeDrawCustomShape
)
{
{
elm
->
docx_convert
(
Context
);
content_
[
i
]
->
docx_convert
(
Context
);
}
}
}
}
...
@@ -120,9 +120,16 @@ void draw_rect::docx_convert(oox::docx_conversion_context & Context)
...
@@ -120,9 +120,16 @@ void draw_rect::docx_convert(oox::docx_conversion_context & Context)
return
;
return
;
}
}
common_docx_convert
(
Context
);
common_docx_convert
(
Context
);
//...
draw_shape
::
docx_convert
(
Context
);
if
(
draw_rect_attlist_
.
draw_corner_radius_
)
{
draw_shape
*
shape
=
Context
.
get_drawing_context
().
get_current_shape
();
//owner
double
val
=
draw_rect_attlist_
.
draw_corner_radius_
->
get_value
()
*
6500
;
shape
->
additional_
.
push_back
(
_property
(
L"oox-draw-modifiers"
,
std
::
to_wstring
((
int
)
val
)));
}
draw_shape
::
docx_convert
(
Context
);
}
}
void
draw_ellipse
::
docx_convert
(
oox
::
docx_conversion_context
&
Context
)
void
draw_ellipse
::
docx_convert
(
oox
::
docx_conversion_context
&
Context
)
{
{
...
@@ -157,6 +164,7 @@ void draw_line::docx_convert(oox::docx_conversion_context & Context)
...
@@ -157,6 +164,7 @@ void draw_line::docx_convert(oox::docx_conversion_context & Context)
reset_svg_attributes
();
reset_svg_attributes
();
common_docx_convert
(
Context
);
common_docx_convert
(
Context
);
//...
draw_shape
::
docx_convert
(
Context
);
draw_shape
::
docx_convert
(
Context
);
}
}
...
...
ASCOfficeOdfFileW/source/OdfFormat/odt_conversion_context.cpp
View file @
b93d4634
...
@@ -283,6 +283,8 @@ void odt_conversion_context::end_drawings()
...
@@ -283,6 +283,8 @@ void odt_conversion_context::end_drawings()
}
}
void
odt_conversion_context
::
start_paragraph
(
bool
styled
)
void
odt_conversion_context
::
start_paragraph
(
bool
styled
)
{
{
if
(
current_field_
.
enabled
&&
!
current_field_
.
result
)
return
;
//Стандартное_составное_письмо.docx
if
(
is_paragraph_in_current_section_
&&
!
styled
)
if
(
is_paragraph_in_current_section_
&&
!
styled
)
{
{
styles_context
()
->
create_style
(
L""
,
odf_types
::
style_family
::
Paragraph
,
true
,
false
,
-
1
);
styles_context
()
->
create_style
(
L""
,
odf_types
::
style_family
::
Paragraph
,
true
,
false
,
-
1
);
...
@@ -374,8 +376,9 @@ void odt_conversion_context::set_field_instr(std::wstring instr)
...
@@ -374,8 +376,9 @@ void odt_conversion_context::set_field_instr(std::wstring instr)
{
{
if
(
current_field_
.
enabled
==
false
)
return
;
if
(
current_field_
.
enabled
==
false
)
return
;
current_field_
.
type
=
0
;
//users field
int
res1
=
instr
.
find
(
L"HYPERLINK"
);
int
res1
=
instr
.
find
(
L"HYPERLINK"
);
if
(
res1
>=
0
)
//это не поле - это hyperlink
if
(
res1
>=
0
)
//это не поле - это hyperlink
{
{
current_field_
.
type
=
1
;
current_field_
.
type
=
1
;
...
@@ -390,24 +393,24 @@ void odt_conversion_context::set_field_instr(std::wstring instr)
...
@@ -390,24 +393,24 @@ void odt_conversion_context::set_field_instr(std::wstring instr)
}
}
}
}
res1
=
instr
.
find
(
L"NUMPAGES"
);
res1
=
instr
.
find
(
L"NUMPAGES"
);
if
(
res1
>=
0
&&
current_field_
.
type
==
0
)
if
(
res1
>=
0
&&
current_field_
.
type
==
0
)
{
{
current_field_
.
type
=
3
;
current_field_
.
type
=
3
;
}
}
res1
=
instr
.
find
(
L"PAGEREF"
);
res1
=
instr
.
find
(
L"PAGEREF"
);
if
(
res1
>=
0
&&
current_field_
.
type
==
0
)
//это не поле - это bookmark
if
(
res1
>=
0
&&
current_field_
.
type
==
0
)
//это не поле - это bookmark
{
{
current_field_
.
type
=
5
;
current_field_
.
type
=
5
;
if
(
instr
.
length
()
>
9
)
if
(
instr
.
length
()
>
9
)
current_field_
.
value
=
instr
.
substr
(
9
,
instr
.
length
()
-
5
);
current_field_
.
value
=
instr
.
substr
(
9
,
instr
.
length
()
-
5
);
}
}
res1
=
instr
.
find
(
L"PAGE"
);
res1
=
instr
.
find
(
L"PAGE"
);
if
(
res1
>=
0
&&
current_field_
.
type
==
0
)
if
(
res1
>=
0
&&
current_field_
.
type
==
0
)
{
{
current_field_
.
type
=
2
;
current_field_
.
type
=
2
;
}
}
res1
=
instr
.
find
(
L"TIME"
);
res1
=
instr
.
find
(
L"TIME"
);
if
(
res1
>=
0
&&
current_field_
.
type
==
0
)
if
(
res1
>=
0
&&
current_field_
.
type
==
0
)
{
{
current_field_
.
type
=
4
;
current_field_
.
type
=
4
;
}
}
...
@@ -418,20 +421,34 @@ void odt_conversion_context::set_field_instr(std::wstring instr)
...
@@ -418,20 +421,34 @@ void odt_conversion_context::set_field_instr(std::wstring instr)
}
}
//////////////////////////////////////////
//////////////////////////////////////////
res1
=
instr
.
find
(
L"@"
);
res1
=
instr
.
find
(
L"@"
);
if
(
res1
>=
0
)
if
(
res1
>=
0
)
{
current_field_
.
format
=
instr
.
substr
(
res1
+
1
,
instr
.
length
());
}
if
(
current_field_
.
type
==
0
)
{
{
current_field_
.
format
=
instr
.
substr
(
res1
+
1
,
instr
.
length
());
res1
=
instr
.
find
(
L" "
);
if
(
res1
>=
0
)
{
current_field_
.
name
=
instr
.
substr
(
0
,
res1
);
}
}
}
}
}
void
odt_conversion_context
::
start_field
(
bool
in_span
)
void
odt_conversion_context
::
start_field
(
bool
in_span
)
{
{
current_field_
.
enabled
=
true
;
current_field_
.
enabled
=
true
;
current_field_
.
result
=
false
;
current_field_
.
in_span
=
in_span
;
current_field_
.
in_span
=
in_span
;
current_field_
.
value
=
L""
;
current_field_
.
value
.
clear
();
current_field_
.
type
=
0
;
current_field_
.
name
.
clear
();
current_field_
.
type
=
0
;
// users field
}
void
odt_conversion_context
::
separate_field
()
{
current_field_
.
result
=
true
;
}
}
void
odt_conversion_context
::
set_master_page_name
(
std
::
wstring
master_name
)
void
odt_conversion_context
::
set_master_page_name
(
std
::
wstring
master_name
)
{
{
if
(
current_root_elements_
.
size
()
<
1
)
// return; - эффект_штурмовика.docx - 1 страница !! (и ваще -
if
(
current_root_elements_
.
size
()
<
1
)
// return; - эффект_штурмовика.docx - 1 страница !! (и ваще -
...
@@ -566,13 +583,17 @@ void odt_conversion_context::end_field()
...
@@ -566,13 +583,17 @@ void odt_conversion_context::end_field()
}
}
current_field_
.
value
=
L""
;
current_field_
.
value
=
L""
;
current_field_
.
format
=
L""
;
current_field_
.
format
=
L""
;
current_field_
.
name
=
L""
;
current_field_
.
result
=
false
;
current_field_
.
enabled
=
false
;
current_field_
.
enabled
=
false
;
current_field_
.
started
=
false
;
current_field_
.
started
=
false
;
current_field_
.
in_span
=
false
;
current_field_
.
in_span
=
false
;
}
}
void
odt_conversion_context
::
end_paragraph
()
void
odt_conversion_context
::
end_paragraph
()
{
{
if
(
current_field_
.
enabled
&&
!
current_field_
.
result
)
return
;
//Стандартное_составное_письмо.docx
text_context
()
->
end_paragraph
();
text_context
()
->
end_paragraph
();
flush_section
();
flush_section
();
...
...
ASCOfficeOdfFileW/source/OdfFormat/odt_conversion_context.h
View file @
b93d4634
...
@@ -95,6 +95,7 @@ public:
...
@@ -95,6 +95,7 @@ public:
void
start_field
(
bool
in_span
);
void
start_field
(
bool
in_span
);
void
end_field
();
void
end_field
();
void
separate_field
();
void
set_field_instr
(
std
::
wstring
instr
);
void
set_field_instr
(
std
::
wstring
instr
);
void
start_run
(
bool
styled
=
false
);
void
start_run
(
bool
styled
=
false
);
...
@@ -182,12 +183,14 @@ private:
...
@@ -182,12 +183,14 @@ private:
struct
_field_state
struct
_field_state
{
{
std
::
wstring
name
;
bool
enabled
;
bool
enabled
;
int
type
;
int
type
;
std
::
wstring
value
;
std
::
wstring
value
;
std
::
wstring
format
;
std
::
wstring
format
;
bool
started
;
bool
started
;
bool
in_span
;
bool
in_span
;
bool
result
;
}
current_field_
;
}
current_field_
;
struct
_text_changes_state
struct
_text_changes_state
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/ConvertVml.cpp
View file @
b93d4634
...
@@ -593,6 +593,14 @@ void OoxConverter::convert(OOX::Vml::CRoundRect *vml_roundrect)
...
@@ -593,6 +593,14 @@ void OoxConverter::convert(OOX::Vml::CRoundRect *vml_roundrect)
OOX
::
Vml
::
CVmlCommonElements
*
vml_common
=
dynamic_cast
<
OOX
::
Vml
::
CVmlCommonElements
*>
(
vml_roundrect
);
OOX
::
Vml
::
CVmlCommonElements
*
vml_common
=
dynamic_cast
<
OOX
::
Vml
::
CVmlCommonElements
*>
(
vml_roundrect
);
convert
(
vml_common
);
convert
(
vml_common
);
double
arc_size
=
vml_roundrect
->
m_oArcSize
.
GetValue
();
if
(
arc_size
>
0
)
{
odf_types
::
length
corner
=
odf_types
::
length
(
arc_size
*
20
,
odf_types
::
length
::
cm
);
odf_context
()
->
drawing_context
()
->
set_corner_radius
(
corner
);
}
}
}
void
OoxConverter
::
convert
(
OOX
::
Vml
::
CCurve
*
vml_curve
)
void
OoxConverter
::
convert
(
OOX
::
Vml
::
CCurve
*
vml_curve
)
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
View file @
b93d4634
...
@@ -762,7 +762,7 @@ void DocxConverter::convert(OOX::Logic::CFldChar *oox_fld)
...
@@ -762,7 +762,7 @@ void DocxConverter::convert(OOX::Logic::CFldChar *oox_fld)
{
{
if
(
oox_fld
->
m_oFldCharType
->
GetValue
()
==
SimpleTypes
::
fldchartypeBegin
)
odt_context
->
start_field
(
false
);
if
(
oox_fld
->
m_oFldCharType
->
GetValue
()
==
SimpleTypes
::
fldchartypeBegin
)
odt_context
->
start_field
(
false
);
if
(
oox_fld
->
m_oFldCharType
->
GetValue
()
==
SimpleTypes
::
fldchartypeEnd
)
odt_context
->
end_field
();
if
(
oox_fld
->
m_oFldCharType
->
GetValue
()
==
SimpleTypes
::
fldchartypeEnd
)
odt_context
->
end_field
();
if
(
oox_fld
->
m_oFldCharType
->
GetValue
()
==
SimpleTypes
::
fldchartypeSeparate
)
{}
if
(
oox_fld
->
m_oFldCharType
->
GetValue
()
==
SimpleTypes
::
fldchartypeSeparate
)
odt_context
->
separate_field
();
}
}
}
}
...
...
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