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
e7c65a97
Commit
e7c65a97
authored
Mar 30, 2016
by
ElenaSubbotina
Committed by
Alexander Trofimov
May 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XlsFormat - исправление Calculadora.xls
parent
ea5ebaae
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
170 additions
and
102 deletions
+170
-102
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtContainer.cpp
...Format/Logic/Biff_structures/ODRAW/OfficeArtContainer.cpp
+121
-93
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtContainer.h
...lsFormat/Logic/Biff_structures/ODRAW/OfficeArtContainer.h
+3
-0
ASCOfficeXlsFile2/source/XlsFormat/Logic/GlobalsSubstream.cpp
...fficeXlsFile2/source/XlsFormat/Logic/GlobalsSubstream.cpp
+34
-0
ASCOfficeXlsFile2/source/XlsFormat/Logic/WorksheetSubstream.cpp
...iceXlsFile2/source/XlsFormat/Logic/WorksheetSubstream.cpp
+7
-2
ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp
ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp
+5
-7
No files found.
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtContainer.cpp
View file @
e7c65a97
...
...
@@ -28,116 +28,122 @@ OfficeArtContainer::OfficeArtContainer(const unsigned char recVer, const unsigne
{
}
void
OfficeArtContainer
::
loadFields
(
XLS
::
CFRecord
&
record
)
OfficeArtRecordPtr
OfficeArtContainer
::
CreateOfficeArt
(
unsigned
short
type
)
{
size_t
container_beginning_ptr
=
record
.
getRdPtr
();
while
(
record
.
getRdPtr
()
<
container_beginning_ptr
+
rh_own
.
recLen
-
8
)
OfficeArtRecordPtr
art_record
;
switch
(
type
)
{
if
(
record
.
getRdPtr
()
>=
record
.
getDataSize
())
break
;
case
DgContainer
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtDgContainer
(
anchor_type_
));
break
;
OfficeArtRecordHeader
rh_child
;
record
>>
rh_child
;
case
FDG
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtFDG
);
break
;
size_t
child_beginning_ptr
=
record
.
getRdPtr
();
record
.
RollRdPtrBack
(
rh_child
.
size
());
case
FRITContainer
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtFRITContainer
);
break
;
OfficeArtRecordPtr
art_record
;
switch
(
rh_child
.
recType
)
{
case
DgContainer
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtDgContainer
(
anchor_type_
));
break
;
case
SpgrContainer
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtSpgrContainer
(
anchor_type_
));
break
;
case
FDG
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtFDG
);
break
;
case
SpContainer
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtSpContainer
(
anchor_type_
)
);
break
;
case
FRIT
Container
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtFRIT
Container
);
break
;
case
Solver
Container
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtSolver
Container
);
break
;
case
SpgrContainer
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtSpgrContainer
(
anchor_type_
)
);
break
;
case
FSPGR
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtFSPGR
);
break
;
case
SpContainer
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtSpContainer
(
anchor_type_
)
);
break
;
case
FSP
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtFSP
);
break
;
case
SolverContainer
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtSolverContainer
);
break
;
case
FOPT
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtFOPT
);
break
;
case
FSPGR
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtFSPGR
);
break
;
case
ChildAnchor
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtChildAnchor
);
break
;
case
FSP
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtFSP
);
break
;
case
ClientAnchor
:
switch
(
anchor_type_
)
{
case
CA_Chart
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtClientAnchorChart
);
break
;
case
FOPT
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtFOPT
);
break
;
case
CA_Sheet
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtClientAnchorSheet
);
break
;
case
ChildAnchor
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtChildAnchor
);
break
;
case
CA_HF
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtClientAnchorHF
);
break
;
}
break
;
case
ClientData
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtClientData
);
break
;
case
FConnectorRule
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtFConnectorRule
);
break
;
case
ClientTextbox
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtClientTextbox
);
break
;
case
FDGGBlock
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtFDGGBlock
);
break
;
case
ColorMRUContainer
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtColorMRUContainer
);
break
;
case
SplitMenuColorContainer
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtSplitMenuColorContainer
);
break
;
case
BStoreContainer
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtBStoreContainer
);
break
;
case
TertiaryFOPT
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtTertiaryFOPT
);
break
;
default:
{
Log
::
warning
(
std
::
wstring
(
L"Unknown OfficeArt record of type 0x"
)
+
STR
::
int2hex_wstr
(
type
,
sizeof
(
type
)));
}
break
;
}
return
art_record
;
}
case
ClientAnchor
:
switch
(
anchor_type_
)
{
case
CA_Chart
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtClientAnchorChart
);
break
;
void
OfficeArtContainer
::
loadFields
(
XLS
::
CFRecord
&
record
)
{
size_t
container_beginning_ptr
=
record
.
getRdPtr
();
case
CA_Sheet
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtClientAnchorSheet
);
break
;
while
(
record
.
getRdPtr
()
<
container_beginning_ptr
+
rh_own
.
recLen
-
8
)
{
if
(
record
.
getRdPtr
()
>=
record
.
getDataSize
())
break
;
case
CA_HF
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtClientAnchorHF
);
break
;
}
break
;
case
ClientData
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtClientData
);
break
;
case
FConnectorRule
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtFConnectorRule
);
break
;
case
ClientTextbox
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtClientTextbox
);
break
;
case
FDGGBlock
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtFDGGBlock
);
break
;
case
ColorMRUContainer
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtColorMRUContainer
);
break
;
case
SplitMenuColorContainer
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtSplitMenuColorContainer
);
break
;
case
BStoreContainer
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtBStoreContainer
);
break
;
case
TertiaryFOPT
:
art_record
=
OfficeArtRecordPtr
(
new
OfficeArtTertiaryFOPT
);
break
;
default:
{
Log
::
warning
(
std
::
wstring
(
L"Unknown OfficeArt record of type 0x"
)
+
STR
::
int2hex_wstr
(
rh_child
.
recType
,
sizeof
(
rh_child
.
recType
)));
}
break
;
OfficeArtRecordHeader
rh_child
;
record
>>
rh_child
;
}
size_t
child_beginning_ptr
=
record
.
getRdPtr
();
record
.
RollRdPtrBack
(
rh_child
.
size
());
OfficeArtRecordPtr
art_record
=
CreateOfficeArt
(
rh_child
.
recType
);
if
(
art_record
)
{
record
>>
*
art_record
;
...
...
@@ -159,7 +165,29 @@ void OfficeArtContainer::loadFields(XLS::CFRecord& record)
Log
::
warning
(
std
::
wstring
(
L"Wrong data parsed in OfficeArt record of type 0x"
)
+
STR
::
int2hex_wstr
(
rh_child
.
recType
,
sizeof
(
rh_child
.
recType
)));
record
.
RollRdPtrBack
(
record
.
getRdPtr
()
-
(
child_beginning_ptr
+
rh_child
.
recLen
));
//Calculadora.xls
//test next record !!!
size_t
record_pos
=
record
.
getRdPtr
();
OfficeArtRecordHeader
rh_test
;
record
>>
rh_test
;
record
.
RollRdPtrBack
(
8
);
//sizeof(OfficeArtRecordHeader)
OfficeArtRecordPtr
test_officeArt
=
CreateOfficeArt
(
rh_test
.
recType
);
if
(
!
test_officeArt
)
{
record
.
RollRdPtrBack
(
record_pos
-
(
child_beginning_ptr
+
rh_child
.
recLen
));
record
>>
rh_test
;
record
.
RollRdPtrBack
(
8
);
//sizeof(OfficeArtRecordHeader)
OfficeArtRecordPtr
test_officeArt
=
CreateOfficeArt
(
rh_test
.
recType
);
if
(
!
test_officeArt
)
{
// ... ???
record
.
skipNunBytes
(
record
.
getDataSize
()
-
record
.
getRdPtr
());
return
;
}
}
}
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtContainer.h
View file @
e7c65a97
...
...
@@ -28,6 +28,9 @@ public:
OfficeArtClientAnchorType
anchor_type_
;
std
::
vector
<
OfficeArtRecordPtr
>
child_records
;
private:
OfficeArtRecordPtr
CreateOfficeArt
(
unsigned
short
type
);
};
typedef
boost
::
shared_ptr
<
OfficeArtContainer
>
OfficeArtContainerPtr
;
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/GlobalsSubstream.cpp
View file @
e7c65a97
...
...
@@ -59,6 +59,10 @@
#include <Logic/Biff_records/BOF.h>
#include <Logic/Biff_records/MDTInfo.h>
#include <Logic/Biff_records/ExternSheet.h>
#include <Logic/Biff_records/XFExt.h>
#include <Logic/Biff_records/XFCRC.h>
#include <Logic/Biff_records/DXF.h>
#include <Logic/Biff_unions/STYLES.h>
namespace
XLS
{;
...
...
@@ -327,6 +331,36 @@ const bool GlobalsSubstream::loadContent(BinProcessor& proc)
case
rt_Compat12
:
proc
.
optional
<
Compat12
>
();
break
;
case
rt_GUIDTypeLib
:
proc
.
optional
<
GUIDTypeLib
>
();
break
;
//case rt_XFCRC:
//{// !!! Calculadora.xls
// if(proc.optional<XFCRC>())
// {
// elements_.pop_back(); // Crc
// count = proc.repeated<XFExt>(0, 0);//(16, 4050);
// while (count > 0)
// {
// // FORMATING/XFS ?? - !!
// //if (elements_.empty()) break;
// //XFExt* ext = dynamic_cast<XFExt*>(elements_.back().get());
// //m_arXFext.push_back(elements_.front());
// elements_.pop_front();
// count--;
// }
// }
// count = proc.repeated<DXF>(0, 0);
// while(count > 0)
// {
// //m_arDXF.insert(m_arDXF.begin(), elements_.back());
// elements_.pop_back();
// count--;
// }
// if (proc.optional<STYLES>())
// {
// //m_Styles = elements_.back();
// elements_.pop_back();
// }
//}break;
default:
//skip
{
proc
.
SkipRecord
();
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/WorksheetSubstream.cpp
View file @
e7c65a97
...
...
@@ -93,7 +93,8 @@ const bool WorksheetSubstream::loadContent(BinProcessor& proc)
{
CFRecordType
::
TypeId
type
=
proc
.
getNextRecordType
();
if
(
type
==
rt_NONE
)
break
;
if
(
type
==
rt_NONE
||
type
==
rt_BOF
)
// ??
break
;
if
(
type
==
rt_EOF
)
{
proc
.
mandatory
<
EOF_T
>
();
...
...
@@ -209,7 +210,11 @@ const bool WorksheetSubstream::loadContent(BinProcessor& proc)
OBJECTS
objects
(
false
);
if
(
proc
.
optional
(
objects
))
{
m_OBJECTS
=
elements_
.
back
();
if
(
!
m_OBJECTS
)
m_OBJECTS
=
elements_
.
back
();
else
{
Log
::
warning
(
L"Double set OBJECTS!!!"
);
}
elements_
.
pop_back
();
}
}
break
;
...
...
ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp
View file @
e7c65a97
...
...
@@ -567,13 +567,12 @@ std::wstring XlsConverter::WriteMediaFile(char *data, int size, std::wstring typ
biSizeImage
=
size
-
offset
;
bPNG
=
true
;
if
(
stride
<
header
->
biWidth
)
if
(
-
stride
>=
header_core
->
bcWidth
&&
header_core
->
bcBitCount
>=
24
)
{
bPNG
=
fals
e
;
bPNG
=
tru
e
;
}
}
else
if
(
header
->
biBitCount
>=
24
)
else
{
offset
=
40
;
//sizeof(BITMAPINFOHEADER)
...
...
@@ -587,10 +586,9 @@ std::wstring XlsConverter::WriteMediaFile(char *data, int size, std::wstring typ
int
stride
=
(
size
-
offset
)
/
header
->
biHeight
;
bPNG
=
true
;
if
(
stride
<
header
->
biWidth
)
if
(
stride
>=
header
->
biWidth
&&
header
->
biBitCount
>=
24
)
{
bPNG
=
fals
e
;
bPNG
=
tru
e
;
}
frame
.
put_Stride
(
stride
/*header->biBitCount * header->biWidth /8*/
);
...
...
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