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
00596f43
Commit
00596f43
authored
Aug 11, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XlsFormat - fix bugs, add ColorScale
parent
b49b8246
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
361 additions
and
19 deletions
+361
-19
ASCOfficeXlsFile2/source/XlsFormat/Binary/CFStream.cpp
ASCOfficeXlsFile2/source/XlsFormat/Binary/CFStream.cpp
+1
-0
ASCOfficeXlsFile2/source/XlsFormat/Binary/CompoundFile.cpp
ASCOfficeXlsFile2/source/XlsFormat/Binary/CompoundFile.cpp
+23
-5
ASCOfficeXlsFile2/source/XlsFormat/Binary/CompoundFile.h
ASCOfficeXlsFile2/source/XlsFormat/Binary/CompoundFile.h
+3
-0
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/CF12.cpp
...ficeXlsFile2/source/XlsFormat/Logic/Biff_records/CF12.cpp
+54
-6
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/CalcMode.cpp
...XlsFile2/source/XlsFormat/Logic/Biff_records/CalcMode.cpp
+2
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/XFExt.cpp
...iceXlsFile2/source/XlsFormat/Logic/Biff_records/XFExt.cpp
+2
-0
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CFColor.cpp
...sFile2/source/XlsFormat/Logic/Biff_structures/CFColor.cpp
+0
-2
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CFDatabar.h
...sFile2/source/XlsFormat/Logic/Biff_structures/CFDatabar.h
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CFGradient.cpp
...le2/source/XlsFormat/Logic/Biff_structures/CFGradient.cpp
+131
-0
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CFGradient.h
...File2/source/XlsFormat/Logic/Biff_structures/CFGradient.h
+101
-0
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFN12.cpp
...lsFile2/source/XlsFormat/Logic/Biff_structures/DXFN12.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFPat.h
...eXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFPat.h
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/BinProcessor.cpp
ASCOfficeXlsFile2/source/XlsFormat/Logic/BinProcessor.cpp
+0
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/GlobalsSubstream.cpp
...fficeXlsFile2/source/XlsFormat/Logic/GlobalsSubstream.cpp
+1
-0
ASCOfficeXlsFile2/source/XlsFormat/Logic/XlsElementsType.h
ASCOfficeXlsFile2/source/XlsFormat/Logic/XlsElementsType.h
+2
-0
ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp
ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp
+25
-1
ASCOfficeXlsFile2/source/win32/XlsFormat.vcproj
ASCOfficeXlsFile2/source/win32/XlsFormat.vcproj
+8
-0
Common/OfficeFileFormatChecker2.cpp
Common/OfficeFileFormatChecker2.cpp
+5
-0
No files found.
ASCOfficeXlsFile2/source/XlsFormat/Binary/CFStream.cpp
View file @
00596f43
...
...
@@ -95,6 +95,7 @@ void CFStream::write(const void* buf, const size_t size)
str
<<
L"Only "
<<
num_written
<<
L" unsigned chars were saved instead of "
<<
size
<<
L" unsigned chars requested."
;
throw
;
// EXCEPT::RT::CompoundFileFormatError(str.str(), hres);
}
stream_
->
flush
();
// Tipa successful
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Binary/CompoundFile.cpp
View file @
00596f43
...
...
@@ -53,14 +53,17 @@ bool CompoundFile::isError()
return
true
;
}
CompoundFile
::
CompoundFile
(
const
std
::
wstring
&
file_path
,
const
ReadWriteMode
mode
)
:
rwMode
(
mode
)
bool
CompoundFile
::
Open
(
const
std
::
wstring
&
file_path
,
const
ReadWriteMode
mode
)
{
if
(
storage_
)
delete
storage_
;
storage_
=
NULL
;
rwMode
=
mode
;
unsigned
int
grfMode
=
0
;
storage_
=
new
POLE
::
Storage
(
file_path
.
c_str
());
if
(
storage_
==
NULL
)
return
;
if
(
storage_
==
NULL
)
return
false
;
switch
(
rwMode
)
{
...
...
@@ -82,6 +85,16 @@ CompoundFile::CompoundFile(const std::wstring & file_path, const ReadWriteMode m
}
}
break
;
}
if
(
storage_
==
NULL
)
return
false
;
return
true
;
}
CompoundFile
::
CompoundFile
(
const
std
::
wstring
&
file_path
,
const
ReadWriteMode
mode
)
{
storage_
=
NULL
;
Open
(
file_path
,
mode
);
}
...
...
@@ -108,6 +121,11 @@ CFStreamPtr CompoundFile::createWorkbookStream()
return
createNamedStream
(
"Workbook"
);
}
void
CompoundFile
::
closeWorkbookStream
()
{
return
closeNamedStream
(
"Workbook"
);
}
// Opens "SummaryInformation" stream and returns the only reference
CFStreamPtr
CompoundFile
::
getSummaryInformationStream
()
...
...
@@ -147,7 +165,7 @@ CFStreamPtr CompoundFile::createDocumentSummaryInformationStream()
// Closes "SummaryInformation" stream
void
CompoundFile
::
closeDocumentSummaryInformationStream
()
{
closeNamedStream
(
"DocumentSummaryInformation"
);
return
closeNamedStream
(
"DocumentSummaryInformation"
);
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Binary/CompoundFile.h
View file @
00596f43
...
...
@@ -53,11 +53,14 @@ public:
public:
CompoundFile
(
const
std
::
wstring
&
file_path
,
const
ReadWriteMode
mode
);
~
CompoundFile
();
bool
Open
(
const
std
::
wstring
&
file_path
,
const
ReadWriteMode
mode
);
bool
isError
();
CFStreamPtr
getWorkbookStream
();
CFStreamPtr
createWorkbookStream
();
void
closeWorkbookStream
();
CFStreamPtr
getSummaryInformationStream
();
CFStreamPtr
createSummaryInformationStream
();
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/CF12.cpp
View file @
00596f43
...
...
@@ -35,6 +35,7 @@
#include <Logic/Biff_structures/CFMultistate.h>
#include <Logic/Biff_structures/CFDatabar.h>
#include <Logic/Biff_structures/CFGradient.h>
#include <utils.h>
namespace
XLS
...
...
@@ -98,14 +99,15 @@ void CF12::readFields(CFRecord& record)
switch
(
ct
)
{
case
0x03
:
//
rgbCT = BiffStructurePtr(new CFGradient);
//
rgbCT->load(record);
rgbCT
=
BiffStructurePtr
(
new
CFGradient
);
rgbCT
->
load
(
record
);
break
;
case
0x04
:
rgbCT
=
BiffStructurePtr
(
new
CFDatabar
);
rgbCT
->
load
(
record
);
break
;
case
0x05
:
//todooo
//rgbCT = BiffStructurePtr(new CFFilter);
//rgbCT->load(record);
break
;
...
...
@@ -117,9 +119,10 @@ void CF12::readFields(CFRecord& record)
ipriority_
=
++
record
.
getGlobalWorkbookInfo
()
->
cmt_rules
;
dxf
.
serialize
(
record
.
getGlobalWorkbookInfo
()
->
users_Dxfs_stream
);
dxfId_
=
global_info
->
cellStyleDxfs_count
++
;
if
(
0
==
dxf
.
serialize
(
record
.
getGlobalWorkbookInfo
()
->
users_Dxfs_stream
))
dxfId_
=
global_info
->
cellStyleDxfs_count
++
;
else
dxfId_
=
-
1
;
}
int
CF12
::
serialize
(
std
::
wostream
&
stream
)
{
...
...
@@ -135,6 +138,7 @@ int CF12::serialize(std::wostream & stream)
{
case
1
:
CP_XML_ATTR
(
L"type"
,
L"cellIs"
);
break
;
case
2
:
CP_XML_ATTR
(
L"type"
,
L"expression"
);
break
;
case
3
:
CP_XML_ATTR
(
L"type"
,
L"colorScale"
);
break
;
case
4
:
CP_XML_ATTR
(
L"type"
,
L"dataBar"
);
break
;
case
6
:
CP_XML_ATTR
(
L"type"
,
L"iconSet"
);
break
;
}
...
...
@@ -155,8 +159,52 @@ int CF12::serialize(std::wostream & stream)
CP_XML_ATTR
(
L"priority"
,
ipriority_
);
CP_XML_ATTR
(
L"stopIfTrue"
,
fStopIfTrue
);
CP_XML_ATTR
(
L"dxfId"
,
dxfId_
);
if
(
dxfId_
>=
0
)
CP_XML_ATTR
(
L"dxfId"
,
dxfId_
);
if
(
ct
==
3
)
{
CFGradient
*
gradient
=
dynamic_cast
<
CFGradient
*>
(
rgbCT
.
get
());
CP_XML_NODE
(
L"colorScale"
)
{
for
(
int
i
=
0
;
i
<
gradient
->
rgInterp
.
size
();
i
++
)
{
CP_XML_NODE
(
L"cfvo"
)
{
CFVO
&
cfvo
=
gradient
->
rgInterp
[
i
]
->
cfvo
;
switch
(
cfvo
.
cfvoType
)
{
case
2
:
CP_XML_ATTR
(
L"type"
,
L"min"
);
break
;
case
3
:
CP_XML_ATTR
(
L"type"
,
L"max"
);
break
;
case
7
:
CP_XML_ATTR
(
L"type"
,
L"formule"
);
break
;
case
4
:
CP_XML_ATTR
(
L"type"
,
L"percent"
);
break
;
case
5
:
CP_XML_ATTR
(
L"type"
,
L"percentile"
);
break
;
default:
CP_XML_ATTR
(
L"type"
,
L"percentile"
);
break
;
}
if
(
cfvo
.
cfvoType
==
7
)
CP_XML_ATTR
(
L"val"
,
cfvo
.
fmla
.
getAssembledFormula
());
else
CP_XML_ATTR
(
L"val"
,
cfvo
.
numValue
);
}
}
for
(
int
i
=
0
;
i
<
gradient
->
rgCurve
.
size
();
i
++
)
{
CP_XML_NODE
(
L"color"
)
{
CFColor
&
color
=
gradient
->
rgCurve
[
i
]
->
color
;
switch
(
color
.
type
)
{
case
1
:
CP_XML_ATTR
(
L"indexed"
,
color
.
icv
);
break
;
case
2
:
CP_XML_ATTR
(
L"rgb"
,
color
.
rgb
.
strARGB
);
break
;
case
3
:
CP_XML_ATTR
(
L"theme"
,
color
.
theme
);
CP_XML_ATTR
(
L"tint"
,
color
.
numTint
);
break
;
default:
CP_XML_ATTR
(
L"auto"
,
true
);
}
}
}
}
}
if
(
ct
==
4
)
{
CFDatabar
*
dataBar
=
dynamic_cast
<
CFDatabar
*>
(
rgbCT
.
get
());
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/CalcMode.cpp
View file @
00596f43
...
...
@@ -91,7 +91,8 @@ void CalcMode::readFields(CFRecord& record)
fAutoRecalc
=
std
::
wstring
(
L"autoNoTable"
);
break
;
default:
throw
;
// EXCEPT::RT::WrongBiffRecord("Unsupported value of fAutoRecalc.", record.getTypeString());
fAutoRecalc
=
std
::
wstring
(
L"auto"
);
// EXCEPT::RT::WrongBiffRecord("Unsupported value of fAutoRecalc.", record.getTypeString());
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/XFExt.cpp
View file @
00596f43
...
...
@@ -69,6 +69,8 @@ void XFExt::readFields(CFRecord& record)
record
>>
cexts
;
while
(
!
record
.
isEOF
())
{
if
(
record
.
getRdPtr
()
+
8
<
record
.
getDataSize
())
break
;
// 8 = миним размер структуры
ExtPropPtr
element
(
new
ExtProp
);
record
>>
*
element
;
rgExt
.
push_back
(
element
);
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CFColor.cpp
View file @
00596f43
...
...
@@ -47,7 +47,6 @@ CFColor::CFColor(CFRecord& record)
load
(
record
);
}
BiffStructurePtr
CFColor
::
clone
()
{
return
BiffStructurePtr
(
new
CFColor
(
*
this
));
...
...
@@ -58,7 +57,6 @@ void CFColor::store(CFRecord& record)
{
}
void
CFColor
::
load
(
CFRecord
&
record
)
{
record
>>
xclrType
;
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CFDatabar.h
View file @
00596f43
...
...
@@ -46,7 +46,7 @@ class CFDatabar : public BiffStructure
public:
BiffStructurePtr
clone
();
static
const
ElementType
type
=
typeCF
Multistate
;
//todoooo
static
const
ElementType
type
=
typeCF
Databar
;
virtual
void
load
(
CFRecord
&
record
);
virtual
void
store
(
CFRecord
&
record
);
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CFGradient.cpp
0 → 100644
View file @
00596f43
/*
* (c) Copyright Ascensio System SIA 2010-2016
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "CFGradient.h"
#include <Binary/CFRecord.h>
namespace
XLS
{
BiffStructurePtr
CFGradientInterpItem
::
clone
()
{
return
BiffStructurePtr
(
new
CFGradientInterpItem
(
*
this
));
}
void
CFGradientInterpItem
::
store
(
CFRecord
&
record
)
{
}
void
CFGradientInterpItem
::
load
(
CFRecord
&
record
)
{
cfvo
.
load
(
record
);
record
>>
numDomain
;
//record.skipNunBytes(8);
//int val;
//record >> val; numDomain = val << 32;
//record >> val; numDomain = val;
}
//---------------------------------------------------------------------------------------------
BiffStructurePtr
CFGradientItem
::
clone
()
{
return
BiffStructurePtr
(
new
CFGradientItem
(
*
this
));
}
void
CFGradientItem
::
store
(
CFRecord
&
record
)
{
}
void
CFGradientItem
::
load
(
CFRecord
&
record
)
{
//int val;
//record >> val; numGrange = val << 32;
//record >> val; numGrange = val;
//record.skipNunBytes(8);
color
.
load
(
record
);
record
>>
numGrange
;
}
//--------------------------------------------------------------------------------------------
BiffStructurePtr
CFGradient
::
clone
()
{
return
BiffStructurePtr
(
new
CFGradient
(
*
this
));
}
void
CFGradient
::
store
(
CFRecord
&
record
)
{
}
void
CFGradient
::
load
(
CFRecord
&
record
)
{
record
.
skipNunBytes
(
2
);
// unused
record
.
skipNunBytes
(
1
);
// reserved
record
>>
cInterpCurve
;
record
>>
cGradientCurve
;
unsigned
char
flags
;
record
>>
flags
;
fClamp
=
GETBIT
(
flags
,
0
);
fBackground
=
GETBIT
(
flags
,
1
);
for
(
int
i
=
0
;
i
<
cInterpCurve
;
i
++
)
{
CFGradientInterpItemPtr
item
=
CFGradientInterpItemPtr
(
new
CFGradientInterpItem
());
item
->
load
(
record
);
//item.cfvo.load(record);
//record >> val; item.numDomain = val << 32;
//record >> val; item.numDomain += val;
rgInterp
.
push_back
(
item
);
}
for
(
int
i
=
0
;
i
<
cGradientCurve
;
i
++
)
{
CFGradientItemPtr
item
=
CFGradientItemPtr
(
new
CFGradientItem
());
item
->
load
(
record
);
//record >> val; item.numGrange = val << 32;
//record >> val; item.numGrange += val;
////record >> item.numGrange;
//item.color.load(record);
rgCurve
.
push_back
(
item
);
}
}
}
// namespace XLS
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CFGradient.h
0 → 100644
View file @
00596f43
/*
* (c) Copyright Ascensio System SIA 2010-2016
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include "BiffStructure.h"
#include "CFVO.h"
#include "CFColor.h"
namespace
XLS
{
class
CFRecord
;
struct
CFGradientInterpItem
:
public
BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME
(
CFGradientInterpItem
)
public:
BiffStructurePtr
clone
();
static
const
ElementType
type
=
typeAnyObject
;
virtual
void
load
(
CFRecord
&
record
);
virtual
void
store
(
CFRecord
&
record
);
CFVO
cfvo
;
double
numDomain
;
};
typedef
boost
::
shared_ptr
<
CFGradientInterpItem
>
CFGradientInterpItemPtr
;
struct
CFGradientItem
:
public
BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME
(
CFGradientItem
)
public:
BiffStructurePtr
clone
();
static
const
ElementType
type
=
typeAnyObject
;
virtual
void
load
(
CFRecord
&
record
);
virtual
void
store
(
CFRecord
&
record
);
double
numGrange
;
CFColor
color
;
};
typedef
boost
::
shared_ptr
<
CFGradientItem
>
CFGradientItemPtr
;
class
CFGradient
:
public
BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME
(
CFGradient
)
public:
BiffStructurePtr
clone
();
static
const
ElementType
type
=
typeCFGradient
;
virtual
void
load
(
CFRecord
&
record
);
virtual
void
store
(
CFRecord
&
record
);
unsigned
char
cInterpCurve
;
//MUST be 0x2 or 0x3.
unsigned
char
cGradientCurve
;
// == cInterpCurve
bool
fClamp
;
bool
fBackground
;
std
::
vector
<
CFGradientInterpItemPtr
>
rgInterp
;
std
::
vector
<
CFGradientItemPtr
>
rgCurve
;
};
typedef
boost
::
shared_ptr
<
CFGradient
>
CFGradientPtr
;
}
// namespace XLS
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFN12.cpp
View file @
00596f43
...
...
@@ -91,7 +91,7 @@ void DXFN12::load(CFRecord& record)
int
DXFN12
::
serialize
(
std
::
wostream
&
stream
)
{
if
(
!
dxfn
)
return
0
;
if
(
!
dxfn
)
return
-
1
;
if
(
!
xfext
)
{
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFPat.h
View file @
00596f43
...
...
@@ -46,7 +46,7 @@ public:
BiffStructurePtr
clone
();
static
const
ElementType
type
=
typeDXFPat
;
virtual
void
load
(
CFRecord
&
record
);
virtual
void
store
(
CFRecord
&
record
);
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/BinProcessor.cpp
View file @
00596f43
...
...
@@ -186,7 +186,6 @@ const bool BinReaderProcessor::getNextSubstreamType(unsigned short& type)
}
if
(
rt_BOF
!=
record
->
getTypeId
())
{
//throw XLS::RequestedRecordNotFound(rt_BOF, record->getTypeId());
return
false
;
}
unsigned
short
vers
;
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/GlobalsSubstream.cpp
View file @
00596f43
...
...
@@ -263,6 +263,7 @@ const bool GlobalsSubstream::loadContent(BinProcessor& proc)
case
rt_UsesELFs
:
proc
.
optional
<
UsesELFs
>
();
break
;
case
rt_RecalcId
:
proc
.
optional
<
RecalcId
>
();
break
;
case
rt_Font
:
case
rt_XFCRC
:
{
if
(
proc
.
mandatory
<
FORMATTING
>
())
{
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/XlsElementsType.h
View file @
00596f43
...
...
@@ -522,6 +522,8 @@ enum ElementType
typeCFExTemplateParams
,
typeCFMStateItem
,
typeCFMultistate
,
typeCFDatabar
,
typeCFGradient
,
typeCFVO
,
typeCondFmtStructure
,
typeControlInfo
,
...
...
ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp
View file @
00596f43
...
...
@@ -131,7 +131,31 @@ XlsConverter::XlsConverter(const std::wstring & xls_file, const std::wstring & _
try
{
XLS
::
CompoundFile
cfile
(
xls_file
,
XLS
::
CompoundFile
::
cf_ReadMode
);
if
(
cfile
.
isError
())
return
;
if
(
cfile
.
isError
())
{
//if (0 <= xls_file.rfind(L".xls"))//todooo lower
//{
// unsigned char* fileData = NULL;
// DWORD fileSize = 0;
// if (!NSFile::CFileBinary::ReadAllBytes(xls_file, &fileData, fileSize)) return;
// if (!fileData) return;
// //test/open as list
// std::wstring xls_file_new = _xlsx_path + FILE_SEPARATOR_STR + L"temp.xls";
// if (cfile.Open(xls_file_new, XLS::CompoundFile::cf_WriteMode))
// {
// XLS::CFStreamPtr stream = cfile.createWorkbookStream();
// if (stream)
// stream->write(fileData, fileSize);
// cfile.closeWorkbookStream();
// }
// delete []fileData;
// if (!cfile.Open(xls_file_new, XLS::CompoundFile::cf_ReadMode))
// return;
//}else
return
;
}
XLS
::
CFStreamPtr
summary
;
XLS
::
CFStreamPtr
doc_summary
;
...
...
ASCOfficeXlsFile2/source/win32/XlsFormat.vcproj
View file @
00596f43
...
...
@@ -3169,6 +3169,14 @@
RelativePath=
"..\XlsFormat\Logic\Biff_structures\CFExTemplateParams.h"
>
</File>
<File
RelativePath=
"..\XlsFormat\Logic\Biff_structures\CFGradient.cpp"
>
</File>
<File
RelativePath=
"..\XlsFormat\Logic\Biff_structures\CFGradient.h"
>
</File>
<File
RelativePath=
"..\XlsFormat\Logic\Biff_structures\CFMStateItem.cpp"
>
...
...
Common/OfficeFileFormatChecker2.cpp
View file @
00596f43
...
...
@@ -144,6 +144,11 @@ bool COfficeFileFormatChecker::isXlsFormatFile (POLE::Storage * storage)
if
(
stream2
.
read
(
buffer
,
10
)
>
0
)
return
true
;
POLE
::
Stream
stream3
(
storage
,
"WORKBOOK"
);
if
(
stream3
.
read
(
buffer
,
10
)
>
0
)
return
true
;
return
false
;
}
bool
COfficeFileFormatChecker
::
isPptFormatFile
(
POLE
::
Storage
*
storage
)
...
...
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