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
2ce57085
Commit
2ce57085
authored
Aug 18, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Odf, xls, doc - fix users files
parent
48d94d24
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
93 additions
and
23 deletions
+93
-23
ASCOfficeDocFile/DocDocxConverter/FootnotesMapping.h
ASCOfficeDocFile/DocDocxConverter/FootnotesMapping.h
+4
-0
ASCOfficeOdfFile/OdfFileTest/OdfFileTest.vcproj
ASCOfficeOdfFile/OdfFileTest/OdfFileTest.vcproj
+1
-0
ASCOfficeOdfFile/src/docx/xlsx_package.cpp
ASCOfficeOdfFile/src/docx/xlsx_package.cpp
+2
-0
ASCOfficeOdfFile/src/docx/xlsx_table_state.cpp
ASCOfficeOdfFile/src/docx/xlsx_table_state.cpp
+4
-1
ASCOfficeOdfFile/src/docx/xlsx_table_state.h
ASCOfficeOdfFile/src/docx/xlsx_table_state.h
+2
-0
ASCOfficeOdfFile/src/odf/table.cpp
ASCOfficeOdfFile/src/odf/table.cpp
+44
-3
ASCOfficeOdfFile/src/odf/table.h
ASCOfficeOdfFile/src/odf/table.h
+6
-2
ASCOfficeOdfFile/src/odf/table_data_pilot_tables.cpp
ASCOfficeOdfFile/src/odf/table_data_pilot_tables.cpp
+1
-0
ASCOfficeOdfFile/src/odf/table_xlsx.cpp
ASCOfficeOdfFile/src/odf/table_xlsx.cpp
+23
-10
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/FDB.cpp
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/FDB.cpp
+6
-7
No files found.
ASCOfficeDocFile/DocDocxConverter/FootnotesMapping.h
View file @
2ce57085
...
...
@@ -75,6 +75,8 @@ namespace DocFileFormat
while
(
(
cp
-
m_document
->
FIB
->
m_RgLw97
.
ccpText
)
<
(
*
m_document
->
IndividualFootnotesPlex
)[
id
+
1
]
)
{
int
cpStart
=
cp
;
int
fc
=
m_document
->
FindFileCharPos
(
cp
);
if
(
fc
<
0
)
break
;
...
...
@@ -93,6 +95,8 @@ namespace DocFileFormat
//this PAPX is for a normal paragraph
cp
=
writeParagraph
(
cp
);
}
while
(
cp
<=
cpStart
)
//conv_fQioC665ib4ngHkDGY4__docx.doc
cp
++
;
}
m_pXmlWriter
->
WriteNodeEnd
(
L"w:footnote"
);
...
...
ASCOfficeOdfFile/OdfFileTest/OdfFileTest.vcproj
View file @
2ce57085
...
...
@@ -43,6 +43,7 @@
<Tool
Name=
"VCCLCompilerTool"
Optimization=
"0"
AdditionalIncludeDirectories=
"../../DesktopEditor/xml/build/vs2005;../../DesktopEditor/xml/libxml2/include"
PreprocessorDefinitions=
"WIN32;_DEBUG;_CONSOLE;_UNICODE;UNICODE"
MinimalRebuild=
"true"
BasicRuntimeChecks=
"3"
...
...
ASCOfficeOdfFile/src/docx/xlsx_package.cpp
View file @
2ce57085
...
...
@@ -74,6 +74,8 @@ xlsx_document::xlsx_document()
void
xlsx_document
::
write
(
const
std
::
wstring
&
RootPath
)
{
_CP_LOG
<<
L"[info][xlsx] process writing"
<<
std
::
endl
;
xl_files_
.
write
(
RootPath
);
docProps_files_
.
write
(
RootPath
);
rels_files_
.
write
(
RootPath
);
...
...
ASCOfficeOdfFile/src/docx/xlsx_table_state.cpp
View file @
2ce57085
...
...
@@ -160,7 +160,10 @@ void xlsx_table_state::set_table_row_group(int count, bool collapsed, int level)
group_row_
.
collapsed
=
collapsed
;
group_row_
.
level
=
level
;
}
void
xlsx_table_state
::
add_empty_row
(
int
count
)
{
current_table_row_
+=
count
;
}
void
xlsx_table_state
::
start_row
(
const
std
::
wstring
&
StyleName
,
const
std
::
wstring
&
defaultCellStyleName
)
{
empty_row_
=
true
;
...
...
ASCOfficeOdfFile/src/docx/xlsx_table_state.h
View file @
2ce57085
...
...
@@ -89,6 +89,8 @@ public:
void
non_empty_row
();
bool
is_empty_row
()
const
;
void
end_row
();
void
add_empty_row
(
int
count
);
std
::
wstring
current_row_style
()
const
;
std
::
wstring
default_row_cell_style
()
const
;
...
...
ASCOfficeOdfFile/src/odf/table.cpp
View file @
2ce57085
...
...
@@ -356,7 +356,6 @@ void table_columns_and_groups::add_child_element( xml::sax * Reader, const std::
*/
}
// table-table-cell-content
//////////////////////////////////////////////////////////////////////////////////////////////////
std
::
wostream
&
table_table_cell_content
::
text_to_stream
(
std
::
wostream
&
_Wostream
)
const
...
...
@@ -393,9 +392,14 @@ void table_table_cell::add_child_element( xml::sax * Reader, const std::wstring
void
table_table_cell
::
add_text
(
const
std
::
wstring
&
Text
)
{
}
bool
table_table_cell
::
empty
()
{
if
(
!
content_
.
elements_
.
empty
())
return
false
;
if
(
attlist_
.
table_formula_
)
return
false
;
return
true
;
}
// table:covered-table-cell
// table-covered-table-cell
//////////////////////////////////////////////////////////////////////////////////////////////////
const
wchar_t
*
table_covered_table_cell
::
ns
=
L"table"
;
const
wchar_t
*
table_covered_table_cell
::
name
=
L"covered-table-cell"
;
...
...
@@ -412,13 +416,19 @@ void table_covered_table_cell::add_attributes( const xml::attributes_wc_ptr & At
void
table_covered_table_cell
::
add_child_element
(
xml
::
sax
*
Reader
,
const
std
::
wstring
&
Ns
,
const
std
::
wstring
&
Name
)
{
empty_
=
false
;
content_
.
add_child_element
(
Reader
,
Ns
,
Name
,
getContext
());
}
void
table_covered_table_cell
::
add_text
(
const
std
::
wstring
&
Text
)
{
}
bool
table_covered_table_cell
::
empty
()
{
if
(
!
content_
.
elements_
.
empty
())
return
false
;
if
(
attlist_
.
table_formula_
)
return
false
;
return
true
;
}
//////////////////////////////////////////////////////////////////////////////////////////////////
// table:table-row
...
...
@@ -445,7 +455,38 @@ void table_table_row::add_child_element( xml::sax * Reader, const std::wstring &
else
CP_NOT_APPLICABLE_ELM
();
}
bool
table_table_row
::
empty
()
{
if
(
content_
.
empty
()
&&
!
attlist_
.
table_style_name_
&&
!
attlist_
.
table_default_cell_style_name_
)
return
true
;
return
false
;
}
bool
table_table_row
::
empty_content_cells
()
{
bool
res
=
true
;
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
table_table_cell
*
cell
=
dynamic_cast
<
table_table_cell
*>
(
content_
[
i
].
get
());
table_covered_table_cell
*
cover_cell
=
dynamic_cast
<
table_covered_table_cell
*>
(
content_
[
i
].
get
());
if
(
!
cell
&&
!
cover_cell
)
{
res
=
false
;
break
;
}
if
(
cell
&&
cell
->
empty
()
==
false
)
{
res
=
false
;
break
;
}
if
(
cover_cell
&&
cover_cell
->
empty
()
==
false
)
{
res
=
false
;
break
;
}
}
return
res
;
}
// table:table-rows
//////////////////////////////////////////////////////////////////////////////////////////////////
const
wchar_t
*
table_table_rows
::
ns
=
L"table"
;
...
...
ASCOfficeOdfFile/src/odf/table.h
View file @
2ce57085
...
...
@@ -361,6 +361,9 @@ private:
virtual
void
add_child_element
(
xml
::
sax
*
Reader
,
const
std
::
wstring
&
Ns
,
const
std
::
wstring
&
Name
);
public:
bool
empty
();
bool
empty_content_cells
();
table_table_row_attlist
attlist_
;
office_element_ptr_array
content_
;
// table-table-cell or table-covered-table-cell
...
...
@@ -408,6 +411,7 @@ private:
public:
bool
last_cell_
;
bool
empty
();
table_table_cell_attlist
attlist_
;
table_table_cell_attlist_extra
attlist_extra_
;
...
...
@@ -427,7 +431,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE
();
table_covered_table_cell
()
:
last_cell_
(
false
)
,
empty_
(
true
)
{}
table_covered_table_cell
()
:
last_cell_
(
false
){}
virtual
void
docx_convert
(
oox
::
docx_conversion_context
&
Context
)
;
virtual
void
pptx_convert
(
oox
::
pptx_conversion_context
&
Context
)
;
...
...
@@ -443,7 +447,7 @@ private:
public:
bool
last_cell_
;
bool
empty
_
;
bool
empty
()
;
table_table_cell_attlist
attlist_
;
table_table_cell_content
content_
;
...
...
ASCOfficeOdfFile/src/odf/table_data_pilot_tables.cpp
View file @
2ce57085
...
...
@@ -54,6 +54,7 @@ void table_data_pilot_tables::add_child_element( xml::sax * Reader, const std::w
}
void
table_data_pilot_tables
::
xlsx_convert
(
oox
::
xlsx_conversion_context
&
Context
)
{
return
;
for
(
size_t
i
=
0
;
i
<
content_
.
size
();
i
++
)
{
content_
[
i
]
->
xlsx_convert
(
Context
);
...
...
ASCOfficeOdfFile/src/odf/table_xlsx.cpp
View file @
2ce57085
...
...
@@ -78,6 +78,17 @@ int table_table_cell_content::xlsx_convert(oox::xlsx_conversion_context & Contex
void
table_table_row
::
xlsx_convert
(
oox
::
xlsx_conversion_context
&
Context
)
{
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_
>
0xf000
&&
empty_content_cells
())
{
Context
.
get_table_context
().
state
()
->
add_empty_row
(
attlist_
.
table_number_rows_repeated_
);
return
;
//conv_hSX8n3lVbhALjt0aafg__xlsx.ods, conv_MA2CauoNfX_7ejKS5eg__xlsx.ods
}
std
::
wostream
&
strm
=
Context
.
current_sheet
().
sheetData
();
///обработка чтилей для роу -
size_t
Default_Cell_style_in_row_
=
0
;
...
...
@@ -259,20 +270,22 @@ void table_rows::xlsx_convert(oox::xlsx_conversion_context & Context)
table_table_row
*
row_last
=
dynamic_cast
<
table_table_row
*>
(
table_table_row_
[
table_table_row_
.
size
()
-
1
].
get
());
table_table_row
*
row_last_1
=
dynamic_cast
<
table_table_row
*>
(
table_table_row_
[
table_table_row_
.
size
()
-
2
].
get
());
if
(
row_last
->
attlist_
.
table_number_rows_repeated_
>
1000
&&
row_last_1
->
attlist_
.
table_number_rows_repeated_
>
1000
||
row_last_1
->
attlist_
.
table_number_rows_repeated_
>
0xf000
)
if
(
row_last
->
empty_content_cells
()
&&
row_last_1
->
empty_content_cells
())
{
std
::
wstring
style
=
row_last
->
attlist_
.
table_style_name_
.
get_value_or
(
L""
);
std
::
wstring
style_1
=
row_last
->
attlist_
.
table_style_name_
.
get_value_or
(
L""
);
if
(
style
==
style_1
)
//check for empty also ????
if
(
row_last
->
attlist_
.
table_number_rows_repeated_
>
1000
&&
row_last_1
->
attlist_
.
table_number_rows_repeated_
>
1000
||
row_last_1
->
attlist_
.
table_number_rows_repeated_
>
0xf000
)
{
row_last_1
->
attlist_
.
table_number_rows_repeated_
=
1024
;
table_table_row_
.
pop_back
();
std
::
wstring
style
=
row_last
->
attlist_
.
table_style_name_
.
get_value_or
(
L""
);
std
::
wstring
style_1
=
row_last
->
attlist_
.
table_style_name_
.
get_value_or
(
L""
);
if
(
style
==
style_1
)
//check for empty also ????
{
row_last_1
->
attlist_
.
table_number_rows_repeated_
=
1024
;
table_table_row_
.
pop_back
();
}
}
}
}
for
(
size_t
i
=
0
;
i
<
table_table_row_
.
size
();
i
++
)
{
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/FDB.cpp
View file @
2ce57085
...
...
@@ -249,17 +249,16 @@ int FDB::serialize(std::wostream & strm, bool bSql)
// CP_XML_ATTR(L"containsString", 0);
// }
//}
if
(
bInteger
)
if
(
bInteger
&&
bNumber
)
{
if
(
bNumber
)
bInteger
=
false
;
else
bNumber
=
true
;
bInteger
=
false
;
}
if
((
bDate
&
bNumber
)
||
(
bNumber
&
bString
))
{
CP_XML_ATTR
(
L"containsSemiMixedTypes"
,
1
);
}
else
if
(
bDate
&
bString
)
else
if
(
bDate
&
bString
)
{
CP_XML_ATTR
(
L"containsMixedTypes"
,
1
);
}
...
...
@@ -277,9 +276,9 @@ int FDB::serialize(std::wostream & strm, bool bSql)
CP_XML_ATTR
(
L"containsString"
,
0
);
}
if
(
bEmpty
)
CP_XML_ATTR
(
L"containsBlank"
,
1
);
if
(
bNumber
)
CP_XML_ATTR
(
L"containsNumber"
,
1
);
if
(
b
Integer
)
CP_XML_ATTR
(
L"containsInteg
er"
,
1
);
if
(
b
Number
)
CP_XML_ATTR
(
L"containsNumb
er"
,
1
);
if
(
bInteger
&&
!
bDate
&
bString
)
CP_XML_ATTR
(
L"containsInteger"
,
1
);
if
(
fdb
->
fnumMinMaxValid
)
{
...
...
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