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
e6c33419
Commit
e6c33419
authored
Dec 05, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DocFormatReader - fix users file
parent
a639fc9e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
17 deletions
+20
-17
ASCOfficeDocFile/DocDocxConverter/TablePropertiesMapping.cpp
ASCOfficeDocFile/DocDocxConverter/TablePropertiesMapping.cpp
+4
-4
ASCOfficeOdfFile/src/odf/draw_frame_docx.cpp
ASCOfficeOdfFile/src/odf/draw_frame_docx.cpp
+11
-4
ASCOfficeOdfFile/src/odf/style_table_properties.cpp
ASCOfficeOdfFile/src/odf/style_table_properties.cpp
+5
-9
No files found.
ASCOfficeDocFile/DocDocxConverter/TablePropertiesMapping.cpp
View file @
e6c33419
...
...
@@ -87,19 +87,19 @@ namespace DocFileFormat
case
sprmOldTDefTable
:
case
sprmTDefTable
:
{
//table definition
{
//table definition
SprmTDefTable
tDef
(
iter
->
Arguments
,
iter
->
argumentsSize
);
//Workaround for retrieving the indent of the table:
//In some files there is a indent but no sprmTWidthIndent is set.
//For this cases we can calculate the indent of the table by getting the
//first boundary of the TDef and adding the padding of the cells
tblIndent
=
FormatUtils
::
BytesToInt16
(
iter
->
Arguments
,
1
,
iter
->
argumentsSize
);
//add the gabHalf
tblIndent
+=
gabHalf
;
//If there follows a real sprmTWidthIndent, this value will be overwritten
tblIndent
=
(
std
::
max
)((
int
)
tblIndent
,
0
);
//tblIndent = (std::max)((int)tblIndent,0); //cerere.doc
}
break
;
...
...
ASCOfficeOdfFile/src/odf/draw_frame_docx.cpp
View file @
e6c33419
...
...
@@ -865,13 +865,17 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, const unio
if
(
attlists_
.
rel_size_
.
style_rel_width_
)
{
int
type
=
attlists_
.
rel_size_
.
style_rel_width_
->
get_type
();
drawing
.
pctWidth
=
attlists_
.
rel_size_
.
style_rel_width_
->
get_percent
().
get_value
();
int
type
=
attlists_
.
rel_size_
.
style_rel_width_
->
get_type
();
if
(
type
==
odf_types
::
percent_or_scale
::
Percent
)
drawing
.
pctWidth
=
attlists_
.
rel_size_
.
style_rel_width_
->
get_percent
().
get_value
();
}
if
(
attlists_
.
rel_size_
.
style_rel_height_
)
{
int
type
=
attlists_
.
rel_size_
.
style_rel_height_
->
get_type
();
drawing
.
pctHeight
=
attlists_
.
rel_size_
.
style_rel_height_
->
get_percent
().
get_value
();
int
type
=
attlists_
.
rel_size_
.
style_rel_height_
->
get_type
();
if
(
type
==
odf_types
::
percent_or_scale
::
Percent
)
drawing
.
pctHeight
=
attlists_
.
rel_size_
.
style_rel_height_
->
get_percent
().
get_value
();
}
}
...
...
@@ -1286,7 +1290,10 @@ void draw_text_box::docx_convert(oox::docx_conversion_context & Context)
if
(
drawing
.
cx
>
max_x
)
drawing
.
cy
=
max_x
;
}
if
(
auto_fit_shape
)
{
drawing
.
additional
.
push_back
(
_property
(
L"text-wrap"
,
0
));
drawing
.
additional
.
push_back
(
_property
(
L"auto-grow-height"
,
auto_fit_shape
));
}
else
if
(
auto_fit_text
)
drawing
.
additional
.
push_back
(
_property
(
L"fit-to-size"
,
auto_fit_text
));
...
...
ASCOfficeOdfFile/src/odf/style_table_properties.cpp
View file @
e6c33419
...
...
@@ -115,13 +115,13 @@ void table_format_properties::docx_convert(oox::docx_conversion_context & Contex
if
(
style_rel_width_
)
{
int
w_w
=
(
int
)(
0.5
+
50.0
*
style_rel_width_
->
get_value
());
_tblPr
<<
L"<w:tblW w:type=
\"
pct
\"
w:w=
\"
"
<<
w_w
<<
"
\"
/>"
;
_tblPr
<<
L"<w:tblW w:type=
\"
pct
\"
w:w=
\"
"
<<
w_w
<<
"
\"
/>"
;
}
else
if
(
style_width_
)
{
int
w_w
=
(
int
)(
0.5
+
20.0
*
style_width_
->
get_value_unit
(
length
::
pt
));
if
(
w_w
>
31680
)
w_w
=
31680
;
_tblPr
<<
L"<w:tblW w:type=
\"
dxa
\"
w:w=
\"
"
<<
w_w
<<
"
\"
/>"
;
_tblPr
<<
L"<w:tblW w:type=
\"
dxa
\"
w:w=
\"
"
<<
w_w
<<
"
\"
/>"
;
}
else
{
...
...
@@ -137,7 +137,7 @@ void table_format_properties::docx_convert(oox::docx_conversion_context & Contex
if
(
table_align_
)
{
std
::
wstring
w_val
=
L"left"
;
if
(
table_align_
->
get_type
()
==
table_align
::
Margins
)
if
(
table_align_
->
get_type
()
==
table_align
::
Margins
||
table_align_
->
get_type
()
==
table_align
::
Left
)
{
if
(
common_horizontal_margin_attlist_
.
fo_margin_left_
&&
common_horizontal_margin_attlist_
.
fo_margin_right_
)
{
...
...
@@ -147,19 +147,15 @@ void table_format_properties::docx_convert(oox::docx_conversion_context & Contex
if
(
w_val
!=
L"center"
&&
common_horizontal_margin_attlist_
.
fo_margin_left_
)
{
odf_types
::
length
indent
=
common_horizontal_margin_attlist_
.
fo_margin_left_
->
get_length
();
_tblPr
<<
L"<w:tblInd w:w=
\"
"
<<
indent
.
get_value_unit
(
odf_types
::
length
::
pt
)
*
20
<<
"
\"
w:type=
\"
dxa
\"
/>"
;
_tblPr
<<
L"<w:tblInd w:w=
\"
"
<<
indent
.
get_value_unit
(
odf_types
::
length
::
pt
)
*
20
<<
"
\"
w:type=
\"
dxa
\"
/>"
;
}
}
else
else
//if (table_align_->get_type() == table_align::Center)
w_val
=
boost
::
lexical_cast
<
std
::
wstring
>
(
*
table_align_
);
_tblPr
<<
L"<w:jc w:val=
\"
"
<<
w_val
<<
"
\"
/>"
;
}
if
(
table_align_
&&
table_align_
->
get_type
()
==
table_align
::
Center
)
{
// TODO ()
}
_tblPr
<<
"<w:tblLayout w:type=
\"
fixed
\"
/>"
;
if
(
common_background_color_attlist_
.
fo_background_color_
)
...
...
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