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
2326b425
Commit
2326b425
authored
Jun 02, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OdfFormatWriter - правка багов по результатам тестирования пользовательских файлов
parent
98efbc3f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
57 deletions
+62
-57
ASCOfficeOdfFileW/source/OdfFormat/style_table_properties.h
ASCOfficeOdfFileW/source/OdfFormat/style_table_properties.h
+21
-20
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
+28
-25
ASCOfficeOdfFileW/source/Oox2OdfConverter/XlsxConverter.cpp
ASCOfficeOdfFileW/source/Oox2OdfConverter/XlsxConverter.cpp
+11
-10
ASCOfficeOdfFileW/win32/ASCOfficeOdfFileW.sln
ASCOfficeOdfFileW/win32/ASCOfficeOdfFileW.sln
+2
-2
No files found.
ASCOfficeOdfFileW/source/OdfFormat/style_table_properties.h
View file @
2326b425
...
...
@@ -41,11 +41,11 @@ public:
_CP_OPT
(
odf_types
::
table_align
)
table_align_
;
_CP_OPT
(
odf_types
::
color
)
tableooo_tab_color_
;
odf_types
::
common_horizontal_margin_attlist
common_horizontal_margin_attlist_
;
odf_types
::
common_horizontal_margin_attlist
common_horizontal_margin_attlist_
;
odf_types
::
common_vertical_margin_attlist
common_vertical_margin_attlist_
;
odf_types
::
common_margin_attlist
common_margin_attlist_
;
odf_types
::
common_page_number_attlist
common_page_number_attlist_
;
odf_types
::
common_break_attlist
common_break_attlist_
;
odf_types
::
common_break_attlist
common_break_attlist_
;
odf_types
::
common_background_color_attlist
common_background_color_attlist_
;
odf_types
::
common_shadow_attlist
common_shadow_attlist_
;
odf_types
::
common_keep_with_next_attlist
common_keep_with_next_attlist_
;
...
...
@@ -88,8 +88,8 @@ class style_table_column_properties_attlist
public:
void
serialize
(
std
::
wostream
&
strm
,
const
wchar_t
*
ns
,
const
wchar_t
*
name
);
_CP_OPT
(
odf_types
::
length
)
style_column_width_
;
_CP_OPT
(
odf_types
::
length
)
style_rel_column_width_
;
_CP_OPT
(
odf_types
::
length
)
style_column_width_
;
_CP_OPT
(
odf_types
::
length
)
style_rel_column_width_
;
_CP_OPT
(
odf_types
::
Bool
)
style_use_optimal_column_width_
;
odf_types
::
common_break_attlist
common_break_attlist_
;
...
...
@@ -121,10 +121,10 @@ class style_table_row_properties_attlist
public:
void
serialize
(
std
::
wostream
&
strm
,
const
wchar_t
*
ns
,
const
wchar_t
*
name
);
_CP_OPT
(
odf_types
::
length
)
style_row_height_
;
_CP_OPT
(
odf_types
::
length
)
style_min_row_height_
;
_CP_OPT
(
odf_types
::
Bool
)
style_use_optimal_row_height_
;
_CP_OPT
(
odf_types
::
keep_together
)
fo_keep_together_
;
_CP_OPT
(
odf_types
::
length
)
style_row_height_
;
_CP_OPT
(
odf_types
::
length
)
style_min_row_height_
;
_CP_OPT
(
odf_types
::
Bool
)
style_use_optimal_row_height_
;
_CP_OPT
(
odf_types
::
keep_together
)
fo_keep_together_
;
odf_types
::
common_background_color_attlist
common_background_color_attlist_
;
odf_types
::
common_break_attlist
common_break_attlist_
;
...
...
@@ -145,8 +145,8 @@ public:
virtual
void
serialize
(
std
::
wostream
&
strm
);
public:
style_table_row_properties_attlist
style_table_row_properties_attlist_
;
office_element_ptr
style_background_image_
;
style_table_row_properties_attlist
style_table_row_properties_attlist_
;
office_element_ptr
style_background_image_
;
};
...
...
@@ -164,26 +164,27 @@ public:
_CP_OPT
(
odf_types
::
vertical_align
)
style_vertical_align_
;
_CP_OPT
(
odf_types
::
text_align_source
)
style_text_align_source_
;
_CP_OPT
(
odf_types
::
direction
)
style_direction_
;
_CP_OPT
(
std
::
wstring
)
style_glyph_orientation_vertical_
;
_CP_OPT
(
std
::
wstring
)
style_glyph_orientation_vertical_
;
odf_types
::
common_shadow_attlist
common_shadow_attlist_
;
odf_types
::
common_background_color_attlist
common_background_color_attlist_
;
odf_types
::
common_background_color_attlist
common_background_color_attlist_
;
odf_types
::
common_border_attlist
common_border_attlist_
;
_CP_OPT
(
std
::
wstring
)
style_diagonal_tl_br_
;
_CP_OPT
(
std
::
wstring
)
style_diagonal_tl_br_
;
_CP_OPT
(
odf_types
::
border_widths
)
style_diagonal_tl_br_widths_
;
_CP_OPT
(
std
::
wstring
)
style_diagonal_bl_tr_
;
_CP_OPT
(
std
::
wstring
)
style_diagonal_bl_tr_
;
_CP_OPT
(
odf_types
::
border_widths
)
style_diagonal_bl_tr_widths_
;
odf_types
::
common_border_line_width_attlist
common_border_line_width_attlist_
;
odf_types
::
common_border_line_width_attlist
common_border_line_width_attlist_
;
odf_types
::
common_padding_attlist
common_padding_attlist_
;
odf_types
::
common_rotation_angle_attlist
common_rotation_angle_attlist_
;
_CP_OPT
(
odf_types
::
wrap_option
)
fo_wrap_option_
;
_CP_OPT
(
odf_types
::
rotation_align
)
style_rotation_align_
;
_CP_OPT
(
std
::
wstring
)
style_cell_protect_
;
_CP_OPT
(
odf_types
::
wrap_option
)
fo_wrap_option_
;
_CP_OPT
(
odf_types
::
rotation_align
)
style_rotation_align_
;
_CP_OPT
(
std
::
wstring
)
style_cell_protect_
;
_CP_OPT
(
odf_types
::
Bool
)
style_print_content_
;
_CP_OPT
(
unsigned
int
)
style_decimal_places_
;
_CP_OPT
(
unsigned
int
)
style_decimal_places_
;
_CP_OPT
(
odf_types
::
Bool
)
style_repeat_content_
;
_CP_OPT
(
odf_types
::
Bool
)
style_shrink_to_fit_
;
...
...
@@ -215,7 +216,7 @@ public:
virtual
void
serialize
(
std
::
wostream
&
strm
);
style_table_cell_properties_attlist
style_table_cell_properties_attlist_
;
office_element_ptr
style_background_image_
;
office_element_ptr
style_background_image_
;
};
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp
View file @
2326b425
...
...
@@ -1161,34 +1161,37 @@ void DocxConverter::convert(OOX::Logic::CSectionProperty *oox_section_pr, bool r
{
odt_context
->
add_section
(
continuous
);
double
default_space_pt
=
-
1
;
if
(
oox_section_pr
->
m_oCols
->
m_oSpace
.
IsInit
())
default_space_pt
=
oox_section_pr
->
m_oCols
->
m_oSpace
->
ToPoints
();
bool
separator
=
oox_section_pr
->
m_oCols
->
m_oSep
.
IsInit
()
&&
oox_section_pr
->
m_oCols
->
m_oSep
->
ToBool
();
odt_context
->
add_section_columns
(
num_columns
,
oox_section_pr
->
m_oCols
->
m_arrColumns
.
size
()
>
0
?
-
1
:
default_space_pt
,
separator
);
std
::
vector
<
std
::
pair
<
double
,
double
>>
width_space
;
for
(
unsigned
int
i
=
0
;
i
<
oox_section_pr
->
m_oCols
->
m_arrColumns
.
size
();
i
++
)
if
(
oox_section_pr
->
m_oCols
.
IsInit
())
{
if
(
oox_section_pr
->
m_oCols
->
m_arrColumns
[
i
]
==
NULL
)
continue
;
double
space
=
default_space_pt
;
if
(
oox_section_pr
->
m_oCols
->
m_arrColumns
[
i
]
->
m_oSpace
.
IsInit
())
space
=
oox_section_pr
->
m_oCols
->
m_arrColumns
[
i
]
->
m_oSpace
->
ToPoints
();
double
w
=
-
1
;
if
(
oox_section_pr
->
m_oCols
->
m_arrColumns
[
i
]
->
m_oW
.
IsInit
())
w
=
oox_section_pr
->
m_oCols
->
m_arrColumns
[
i
]
->
m_oW
->
ToPoints
();
double
default_space_pt
=
-
1
;
if
(
oox_section_pr
->
m_oCols
->
m_oSpace
.
IsInit
())
default_space_pt
=
oox_section_pr
->
m_oCols
->
m_oSpace
->
ToPoints
();
bool
separator
=
oox_section_pr
->
m_oCols
->
m_oSep
.
IsInit
()
&&
oox_section_pr
->
m_oCols
->
m_oSep
->
ToBool
();
odt_context
->
add_section_columns
(
num_columns
,
oox_section_pr
->
m_oCols
->
m_arrColumns
.
size
()
>
0
?
-
1
:
default_space_pt
,
separator
);
std
::
vector
<
std
::
pair
<
double
,
double
>>
width_space
;
for
(
unsigned
int
i
=
0
;
i
<
oox_section_pr
->
m_oCols
->
m_arrColumns
.
size
();
i
++
)
{
if
(
oox_section_pr
->
m_oCols
->
m_arrColumns
[
i
]
==
NULL
)
continue
;
double
space
=
default_space_pt
;
if
(
oox_section_pr
->
m_oCols
->
m_arrColumns
[
i
]
->
m_oSpace
.
IsInit
())
space
=
oox_section_pr
->
m_oCols
->
m_arrColumns
[
i
]
->
m_oSpace
->
ToPoints
();
width_space
.
push_back
(
std
::
pair
<
double
,
double
>
(
w
,
space
));
double
w
=
-
1
;
if
(
oox_section_pr
->
m_oCols
->
m_arrColumns
[
i
]
->
m_oW
.
IsInit
())
w
=
oox_section_pr
->
m_oCols
->
m_arrColumns
[
i
]
->
m_oW
->
ToPoints
();
width_space
.
push_back
(
std
::
pair
<
double
,
double
>
(
w
,
space
));
}
//for (unsigned int i= oox_section_pr->m_oCols->m_arrColumns.size(); i< num_columns; i ++)
//{
// width_space.push_back(std::pair<double,double>(-1, default_space_pt));
//}
odt_context
->
add_section_column
(
width_space
);
}
//for (unsigned int i= oox_section_pr->m_oCols->m_arrColumns.size(); i< num_columns; i ++)
//{
// width_space.push_back(std::pair<double,double>(-1, default_space_pt));
//}
odt_context
->
add_section_column
(
width_space
);
if
(
root
)
odt_context
->
flush_section
();
}
...
...
ASCOfficeOdfFileW/source/Oox2OdfConverter/XlsxConverter.cpp
View file @
2326b425
...
...
@@ -914,35 +914,35 @@ void XlsxConverter::convert_styles()
OOX
::
Spreadsheet
::
CStyles
*
xlsx_styles
=
xlsx_document
->
GetStyles
();
if
(
!
xlsx_styles
)
return
;
//todooo ?? Count ??
////////////
for
(
unsigned
int
i
=
0
;
xlsx_styles
->
m_oNumFmts
.
IsInit
()
&&
i
<
xlsx_styles
->
m_oNumFmts
->
m_oCount
->
GetValu
e
();
i
++
)
for
(
unsigned
int
i
=
0
;
xlsx_styles
->
m_oNumFmts
.
IsInit
()
&&
i
<
xlsx_styles
->
m_oNumFmts
->
m_arrItems
.
siz
e
();
i
++
)
{
convert
(
xlsx_styles
->
m_oNumFmts
->
m_arrItems
[
i
]);
}
/////////////
for
(
unsigned
int
i
=
0
;
xlsx_styles
->
m_oCellStyleXfs
.
IsInit
()
&&
i
<
xlsx_styles
->
m_oCellStyleXfs
->
m_oCount
->
GetValu
e
();
i
++
)
for
(
unsigned
int
i
=
0
;
xlsx_styles
->
m_oCellStyleXfs
.
IsInit
()
&&
i
<
xlsx_styles
->
m_oCellStyleXfs
->
m_arrItems
.
siz
e
();
i
++
)
{
//automatical, root - noname - named
convert
(
xlsx_styles
->
m_oCellStyleXfs
->
m_arrItems
[
i
]
,
i
,
true
,
true
);
}
for
(
unsigned
int
i
=
0
;
xlsx_styles
->
m_oCellStyles
.
IsInit
()
&&
i
<
xlsx_styles
->
m_oCellStyles
->
m_oCount
->
GetValu
e
();
i
++
)
//styles.xml
for
(
unsigned
int
i
=
0
;
xlsx_styles
->
m_oCellStyles
.
IsInit
()
&&
i
<
xlsx_styles
->
m_oCellStyles
->
m_arrItems
.
siz
e
();
i
++
)
//styles.xml
{
//non automatical, root - named
convert
(
xlsx_styles
->
m_oCellStyles
->
m_arrItems
[
i
]);
}
//
for
(
unsigned
int
i
=
0
;
xlsx_styles
->
m_oCellXfs
.
IsInit
()
&&
i
<
xlsx_styles
->
m_oCellXfs
->
m_oCount
->
GetValu
e
();
i
++
)
for
(
unsigned
int
i
=
0
;
xlsx_styles
->
m_oCellXfs
.
IsInit
()
&&
i
<
xlsx_styles
->
m_oCellXfs
->
m_arrItems
.
siz
e
();
i
++
)
{
//automatical, non root
convert
(
xlsx_styles
->
m_oCellXfs
->
m_arrItems
[
i
],
i
,
true
,
false
);
convert
(
xlsx_styles
->
m_oCellXfs
->
m_arrItems
[
i
],
i
,
true
,
false
);
}
////////////
for
(
unsigned
int
i
=
0
;
xlsx_styles
->
m_oDxfs
.
IsInit
()
&&
i
<
xlsx_styles
->
m_oDxfs
->
m_oCount
->
GetValu
e
();
i
++
)
for
(
unsigned
int
i
=
0
;
xlsx_styles
->
m_oDxfs
.
IsInit
()
&&
i
<
xlsx_styles
->
m_oDxfs
->
m_arrItems
.
siz
e
();
i
++
)
{
convert
(
xlsx_styles
->
m_oDxfs
->
m_arrItems
[
i
],
i
);
convert
(
xlsx_styles
->
m_oDxfs
->
m_arrItems
[
i
],
i
);
}
}
...
...
@@ -1287,9 +1287,10 @@ void XlsxConverter::convert(OOX::Spreadsheet::CColor *color, _CP_OPT(odf_types::
ucA
=
color
->
m_oRgb
->
Get_A
();
result
=
true
;
}
if
(
color
->
m_oThemeColor
.
IsInit
())
OOX
::
CTheme
*
xlsx_theme
=
xlsx_document
->
GetTheme
();
if
(
color
->
m_oThemeColor
.
IsInit
()
&&
xlsx_theme
)
{
OOX
::
CTheme
*
xlsx_theme
=
xlsx_document
->
GetTheme
();
int
theme_ind
=
color
->
m_oThemeColor
->
GetValue
();
switch
(
theme_ind
)
{
...
...
ASCOfficeOdfFileW/win32/ASCOfficeOdfFileW.sln
View file @
2326b425
...
...
@@ -659,8 +659,8 @@ Global
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Unicode Release|Win32.Build.0 = Release|Win32
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Unicode Release|x64.ActiveCfg = Release|x64
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Unicode Release|x64.Build.0 = Release|x64
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|Win32.ActiveCfg = Debug Multithreaded|
Win32
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|Win32.Build.0 = Debug Multithreaded|
Win32
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|Win32.ActiveCfg = Debug Multithreaded|
x64
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|Win32.Build.0 = Debug Multithreaded|
x64
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|x64.ActiveCfg = Debug Multithreaded|x64
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|x64.Build.0 = Debug Multithreaded|x64
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Singlethreaded|Win32.ActiveCfg = Debug Singlethreaded|Win32
...
...
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