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
82b3dbda
Commit
82b3dbda
authored
Nov 23, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OdfFormatReader - fix users files
parent
4d134387
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
7 deletions
+46
-7
ASCOfficeOdfFile/src/docx/xlsx_table_state.cpp
ASCOfficeOdfFile/src/docx/xlsx_table_state.cpp
+2
-1
ASCOfficeOdfFile/src/docx/xlsx_table_state.h
ASCOfficeOdfFile/src/docx/xlsx_table_state.h
+4
-0
ASCOfficeOdfFile/src/docx/xlsx_utils.cpp
ASCOfficeOdfFile/src/docx/xlsx_utils.cpp
+8
-1
ASCOfficeOdfFile/src/odf/table_xlsx.cpp
ASCOfficeOdfFile/src/odf/table_xlsx.cpp
+32
-5
No files found.
ASCOfficeOdfFile/src/docx/xlsx_table_state.cpp
View file @
82b3dbda
...
...
@@ -133,7 +133,8 @@ xlsx_table_state::xlsx_table_state(xlsx_conversion_context * Context, std::wstri
xlsx_drawing_context_
(
Context
->
get_drawing_context_handle
()),
xlsx_comments_context_
(
Context
->
get_comments_context_handle
()),
table_column_last_width_
(
0.0
),
in_cell
(
false
)
in_cell
(
false
),
bEndTable
(
false
)
{
memset
(
&
group_row_
,
0
,
sizeof
(
_group_row
));
...
...
ASCOfficeOdfFile/src/docx/xlsx_table_state.h
View file @
82b3dbda
...
...
@@ -92,6 +92,9 @@ public:
void
add_empty_row
(
int
count
);
void
set_end_table
(){
bEndTable
=
true
;
}
bool
get_end_table
(){
return
bEndTable
;
}
std
::
wstring
current_row_style
()
const
;
std
::
wstring
default_row_cell_style
()
const
;
std
::
wstring
default_column_cell_style
()
const
;
...
...
@@ -153,6 +156,7 @@ public:
friend
class
xlsx_table_context
;
private:
bool
bEndTable
;
xlsx_conversion_context
*
context_
;
std
::
wstring
tableName_
;
...
...
ASCOfficeOdfFile/src/docx/xlsx_utils.cpp
View file @
82b3dbda
...
...
@@ -195,6 +195,13 @@ std::wstring cellType2Str(XlsxCellType::type type)
boost
::
int64_t
convertDate
(
int
Year
,
int
Month
,
int
Day
)
{
if
(
Year
<
1400
||
Year
>
10000
)
return
-
1
;
if
(
Month
<
1
||
Month
>
12
)
return
-
1
;
if
(
Day
<
1
||
Day
>
31
)
return
-
1
;
boost
::
int64_t
daysFrom1900
=
boost
::
gregorian
::
date_duration
(
boost
::
gregorian
::
date
(
Year
,
Month
,
Day
)
-
boost
::
gregorian
::
date
(
1900
,
1
,
1
)).
days
()
+
1
;
if
(
Year
<=
1900
&&
...
...
ASCOfficeOdfFile/src/odf/table_xlsx.cpp
View file @
82b3dbda
...
...
@@ -78,13 +78,16 @@ int table_table_cell_content::xlsx_convert(oox::xlsx_conversion_context & Contex
void
table_table_row
::
xlsx_convert
(
oox
::
xlsx_conversion_context
&
Context
)
{
bool
bEndTable
=
Context
.
get_table_context
().
state
()
->
get_end_table
();
if
(
attlist_
.
table_number_rows_repeated_
>
1
&&
empty
())
{
Context
.
get_table_context
().
state
()
->
add_empty_row
(
attlist_
.
table_number_rows_repeated_
);
return
;
}
if
(
attlist_
.
table_number_rows_repeated_
>
0x
f000
&&
empty_content_cells
())
if
(
attlist_
.
table_number_rows_repeated_
>
0x
0f00
&&
empty_content_cells
()
||
bEndTable
)
//0xf000 - conv_KDZO3J3xLIbZ5fC0HR0__xlsx.ods
{
Context
.
get_table_context
().
state
()
->
set_end_table
();
Context
.
get_table_context
().
state
()
->
add_empty_row
(
attlist_
.
table_number_rows_repeated_
);
return
;
//conv_hSX8n3lVbhALjt0aafg__xlsx.ods, conv_MA2CauoNfX_7ejKS5eg__xlsx.ods
}
...
...
@@ -731,7 +734,15 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
int
y
,
m
,
d
;
if
(
oox
::
parseDate
(
attr
.
office_date_value_
.
get
(),
y
,
m
,
d
))
{
number_val
=
boost
::
lexical_cast
<
std
::
wstring
>
(
oox
::
convertDate
(
y
,
m
,
d
));
boost
::
int64_t
intDate
=
oox
::
convertDate
(
y
,
m
,
d
);
if
(
intDate
>
0
)
{
number_val
=
boost
::
lexical_cast
<
std
::
wstring
>
(
intDate
);
}
else
{
str_val
=
attr
.
office_date_value_
.
get
();
}
}
}
}
...
...
@@ -742,11 +753,19 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
if
(
attr
.
office_time_value_
)
{
const
std
::
wstring
tv
=
attr
.
office_time_value_
.
get
();
int
h
,
m
;
int
h
,
m
;
double
s
;
if
(
oox
::
parseTime
(
tv
,
h
,
m
,
s
))
{
number_val
=
boost
::
lexical_cast
<
std
::
wstring
>
(
oox
::
convertTime
(
h
,
m
,
s
));
boost
::
int64_t
intTime
=
oox
::
convertTime
(
h
,
m
,
s
);
if
(
intTime
>
0
)
{
number_val
=
boost
::
lexical_cast
<
std
::
wstring
>
(
intTime
);
}
else
{
str_val
=
tv
;
}
}
}
}
...
...
@@ -999,7 +1018,15 @@ void table_covered_table_cell::xlsx_convert(oox::xlsx_conversion_context & Conte
int
y
,
m
,
d
;
if
(
oox
::
parseDate
(
attr
.
office_date_value_
.
get
(),
y
,
m
,
d
))
{
number_val
=
boost
::
lexical_cast
<
std
::
wstring
>
(
oox
::
convertDate
(
y
,
m
,
d
));
boost
::
int64_t
intDate
=
oox
::
convertDate
(
y
,
m
,
d
);
if
(
intDate
>
0
)
{
number_val
=
boost
::
lexical_cast
<
std
::
wstring
>
(
intDate
);
}
else
{
str_val
=
attr
.
office_date_value_
.
get
();
}
}
}
}
...
...
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