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
9447c725
Commit
9447c725
authored
Sep 20, 2016
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XlsFormatReader - fix protection files
parent
21012285
Changes
46
Show whitespace changes
Inline
Side-by-side
Showing
46 changed files
with
157 additions
and
90 deletions
+157
-90
ASCOfficeXlsFile2/source/XlsFormat/Crypt/Decryptor.cpp
ASCOfficeXlsFile2/source/XlsFormat/Crypt/Decryptor.cpp
+2
-2
ASCOfficeXlsFile2/source/XlsFormat/Crypt/Decryptor.h
ASCOfficeXlsFile2/source/XlsFormat/Crypt/Decryptor.h
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Crypt/RC4Crypt.cpp
ASCOfficeXlsFile2/source/XlsFormat/Crypt/RC4Crypt.cpp
+10
-10
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BiffRecordSplit.cpp
...2/source/XlsFormat/Logic/Biff_records/BiffRecordSplit.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BookBool.cpp
...XlsFile2/source/XlsFormat/Logic/Biff_records/BookBool.cpp
+2
-2
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BoundSheet8.cpp
...File2/source/XlsFormat/Logic/Biff_records/BoundSheet8.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/CalcMode.cpp
...XlsFile2/source/XlsFormat/Logic/Biff_records/CalcMode.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/CalcRefMode.cpp
...File2/source/XlsFormat/Logic/Biff_records/CalcRefMode.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/EntExU2.cpp
...eXlsFile2/source/XlsFormat/Logic/Biff_records/EntExU2.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Font.cpp
...ficeXlsFile2/source/XlsFormat/Logic/Biff_records/Font.cpp
+9
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Font.h
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Font.h
+2
-0
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/HeaderFooter.cpp
...ile2/source/XlsFormat/Logic/Biff_records/HeaderFooter.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/LPr.cpp
...fficeXlsFile2/source/XlsFormat/Logic/Biff_records/LPr.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Lbl.cpp
...fficeXlsFile2/source/XlsFormat/Logic/Biff_records/Lbl.cpp
+4
-2
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Password.cpp
...XlsFile2/source/XlsFormat/Logic/Biff_records/Password.cpp
+3
-3
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Password.h
...ceXlsFile2/source/XlsFormat/Logic/Biff_records/Password.h
+2
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Prot4RevPass.cpp
...ile2/source/XlsFormat/Logic/Biff_records/Prot4RevPass.cpp
+3
-3
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Prot4RevPass.h
...sFile2/source/XlsFormat/Logic/Biff_records/Prot4RevPass.h
+2
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/SST.cpp
...fficeXlsFile2/source/XlsFormat/Logic/Biff_records/SST.cpp
+2
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/UserBView.cpp
...lsFile2/source/XlsFormat/Logic/Biff_records/UserBView.cpp
+3
-3
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/UserSViewBegin.cpp
...e2/source/XlsFormat/Logic/Biff_records/UserSViewBegin.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/Bes.cpp
...ceXlsFile2/source/XlsFormat/Logic/Biff_structures/Bes.cpp
+2
-2
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/BiffString.cpp
...le2/source/XlsFormat/Logic/Biff_structures/BiffString.cpp
+4
-4
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/BiffStructure.cpp
.../source/XlsFormat/Logic/Biff_structures/BiffStructure.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/BitMarkedStructs.h
...source/XlsFormat/Logic/Biff_structures/BitMarkedStructs.h
+2
-2
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CFParsedFormulaNoCCE.cpp
.../XlsFormat/Logic/Biff_structures/CFParsedFormulaNoCCE.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CellRangeRef.cpp
...2/source/XlsFormat/Logic/Biff_structures/CellRangeRef.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FtNts.cpp
...XlsFile2/source/XlsFormat/Logic/Biff_structures/FtNts.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/HyperlinkMoniker.cpp
...urce/XlsFormat/Logic/Biff_structures/HyperlinkMoniker.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/HyperlinkObject.cpp
...ource/XlsFormat/Logic/Biff_structures/HyperlinkObject.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtContainer.cpp
...Format/Logic/Biff_structures/ODRAW/OfficeArtContainer.cpp
+3
-2
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/OperatorPtgs.h
...le2/source/XlsFormat/Logic/Biff_structures/OperatorPtgs.h
+6
-0
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ParsedFormula.cpp
.../source/XlsFormat/Logic/Biff_structures/ParsedFormula.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgBool.cpp
...sFile2/source/XlsFormat/Logic/Biff_structures/PtgBool.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgExtraArray.cpp
.../source/XlsFormat/Logic/Biff_structures/PtgExtraArray.cpp
+2
-2
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgFuncVar.cpp
...le2/source/XlsFormat/Logic/Biff_structures/PtgFuncVar.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/RevLblName.cpp
...le2/source/XlsFormat/Logic/Biff_structures/RevLblName.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerAr.cpp
...XlsFile2/source/XlsFormat/Logic/Biff_structures/SerAr.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/StringPtgParser.cpp
...ource/XlsFormat/Logic/Biff_structures/StringPtgParser.cpp
+7
-7
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/XFProp.cpp
...lsFile2/source/XlsFormat/Logic/Biff_structures/XFProp.cpp
+1
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/FORMATTING.cpp
...lsFile2/source/XlsFormat/Logic/Biff_unions/FORMATTING.cpp
+5
-1
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/OBJECTS.cpp
...ceXlsFile2/source/XlsFormat/Logic/Biff_unions/OBJECTS.cpp
+2
-2
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/PROTECTION.cpp
...lsFile2/source/XlsFormat/Logic/Biff_unions/PROTECTION.cpp
+25
-5
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/PROTECTION.h
...eXlsFile2/source/XlsFormat/Logic/Biff_unions/PROTECTION.h
+6
-0
ASCOfficeXlsFile2/source/XlsFormat/Logic/GlobalsSubstream.cpp
...fficeXlsFile2/source/XlsFormat/Logic/GlobalsSubstream.cpp
+26
-13
ASCOfficeXlsFile2/source/XlsFormat/Logic/GlobalsSubstream.h
ASCOfficeXlsFile2/source/XlsFormat/Logic/GlobalsSubstream.h
+2
-0
No files found.
ASCOfficeXlsFile2/source/XlsFormat/Crypt/Decryptor.cpp
View file @
9447c725
...
@@ -54,10 +54,10 @@ namespace CRYPT
...
@@ -54,10 +54,10 @@ namespace CRYPT
return
crypt
->
IsVerify
();
return
crypt
->
IsVerify
();
}
}
bool
RC4Decryptor
::
SetPassword
(
std
::
wstring
password
)
bool
RC4Decryptor
::
SetPassword
(
std
::
wstring
password
,
int
type
)
{
{
crypt
.
reset
();
crypt
.
reset
();
crypt
=
CryptPtr
(
new
RC4Crypt
(
crypt_data
,
password
,
1
));
crypt
=
CryptPtr
(
new
RC4Crypt
(
crypt_data
,
password
,
type
));
if
(
crypt
)
return
crypt
->
IsVerify
();
if
(
crypt
)
return
crypt
->
IsVerify
();
else
return
false
;
else
return
false
;
...
...
ASCOfficeXlsFile2/source/XlsFormat/Crypt/Decryptor.h
View file @
9447c725
...
@@ -46,7 +46,7 @@ namespace CRYPT
...
@@ -46,7 +46,7 @@ namespace CRYPT
bool
IsVerify
();
bool
IsVerify
();
bool
SetPassword
(
std
::
wstring
password
);
bool
SetPassword
(
std
::
wstring
password
,
int
type
=
1
);
private:
private:
CryptPtr
crypt
;
CryptPtr
crypt
;
...
...
ASCOfficeXlsFile2/source/XlsFormat/Crypt/RC4Crypt.cpp
View file @
9447c725
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
namespace
CRYPT
namespace
CRYPT
{
{
RC4Crypt
::
RC4Crypt
(
CRYPT
::
CryptRC4Data
&
data
,
std
::
wstring
password
,
int
type
)
RC4Crypt
::
RC4Crypt
(
CRYPT
::
CryptRC4Data
&
data
,
std
::
wstring
password
,
int
type
)
{
{
m_VerifyPassword
=
false
;
m_VerifyPassword
=
false
;
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BiffRecordSplit.cpp
View file @
9447c725
...
@@ -71,7 +71,7 @@ const bool BiffRecordSplit::storeRecordAndDecideProceeding(CFRecordPtr record)
...
@@ -71,7 +71,7 @@ const bool BiffRecordSplit::storeRecordAndDecideProceeding(CFRecordPtr record)
else
if
(
stored_record
==
NULL
)
else
if
(
stored_record
==
NULL
)
{
{
stored_record
=
record
;
stored_record
=
record
;
//
throw;//
EXCEPT::RT::WrongBiffRecord("Split records do not match", record->getTypeString());
// EXCEPT::RT::WrongBiffRecord("Split records do not match", record->getTypeString());
}
}
else
else
{
{
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BookBool.cpp
View file @
9447c725
...
@@ -76,7 +76,7 @@ void BookBool::writeFields(CFRecord& record)
...
@@ -76,7 +76,7 @@ void BookBool::writeFields(CFRecord& record)
}
}
else
else
{
{
throw
;
// EXCEPT::LE::AttributeDataWrong(L"grUpdateLinks", record.getTypeString().c_str(), grUpdateLinks);
// EXCEPT::LE::AttributeDataWrong(L"grUpdateLinks", record.getTypeString().c_str(), grUpdateLinks);
}
}
SETBITS
(
flags
,
5
,
6
,
grUpdateLinks_num
);
SETBITS
(
flags
,
5
,
6
,
grUpdateLinks_num
);
SETBIT
(
flags
,
8
,
fHideBorderUnselLists
);
SETBIT
(
flags
,
8
,
fHideBorderUnselLists
);
...
@@ -107,7 +107,7 @@ void BookBool::readFields(CFRecord& record)
...
@@ -107,7 +107,7 @@ void BookBool::readFields(CFRecord& record)
grUpdateLinks
=
std
::
wstring
(
L"always"
);
grUpdateLinks
=
std
::
wstring
(
L"always"
);
break
;
break
;
default:
default:
throw
;
// EXCEPT::RT::WrongBiffRecord("Unsupported value of grUpdateLinks.", record.getTypeString());
// EXCEPT::RT::WrongBiffRecord("Unsupported value of grUpdateLinks.", record.getTypeString());
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BoundSheet8.cpp
View file @
9447c725
...
@@ -72,7 +72,7 @@ void BoundSheet8::writeFields(CFRecord& record)
...
@@ -72,7 +72,7 @@ void BoundSheet8::writeFields(CFRecord& record)
}
}
else
else
{
{
throw
;
// EXCEPT::LE::AttributeDataWrong(L"hsState", record.getTypeString().c_str(), hsState);
// EXCEPT::LE::AttributeDataWrong(L"hsState", record.getTypeString().c_str(), hsState);
}
}
ShortXLUnicodeString
stName
=
name_
;
ShortXLUnicodeString
stName
=
name_
;
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/CalcMode.cpp
View file @
9447c725
...
@@ -69,7 +69,7 @@ void CalcMode::writeFields(CFRecord& record)
...
@@ -69,7 +69,7 @@ void CalcMode::writeFields(CFRecord& record)
}
}
else
else
{
{
throw
;
// EXCEPT::LE::AttributeDataWrong(L"fAutoRecalc", record.getTypeString().c_str(), fAutoRecalc);
// EXCEPT::LE::AttributeDataWrong(L"fAutoRecalc", record.getTypeString().c_str(), fAutoRecalc);
}
}
record
<<
fAutoRecalc_num
;
record
<<
fAutoRecalc_num
;
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/CalcRefMode.cpp
View file @
9447c725
...
@@ -65,7 +65,7 @@ void CalcRefMode::writeFields(CFRecord& record)
...
@@ -65,7 +65,7 @@ void CalcRefMode::writeFields(CFRecord& record)
}
}
else
else
{
{
throw
;
// EXCEPT::LE::AttributeDataWrong(L"fRefA1", record.getTypeString().c_str(), fRefA1);
// EXCEPT::LE::AttributeDataWrong(L"fRefA1", record.getTypeString().c_str(), fRefA1);
}
}
record
<<
fRef
;
record
<<
fRef
;
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/EntExU2.cpp
View file @
9447c725
...
@@ -54,7 +54,7 @@ BaseObjectPtr EntExU2::clone()
...
@@ -54,7 +54,7 @@ BaseObjectPtr EntExU2::clone()
void
EntExU2
::
writeFields
(
CFRecord
&
record
)
void
EntExU2
::
writeFields
(
CFRecord
&
record
)
{
{
throw
;
// EXCEPT::LE::UnexpectedProgramPath("EntExU2 record is skipped.", __FUNCTION__);
// EXCEPT::LE::UnexpectedProgramPath("EntExU2 record is skipped.", __FUNCTION__);
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Font.cpp
View file @
9447c725
...
@@ -73,6 +73,8 @@ void Font::writeFields(CFRecord& record)
...
@@ -73,6 +73,8 @@ void Font::writeFields(CFRecord& record)
void
Font
::
readFields
(
CFRecord
&
record
)
void
Font
::
readFields
(
CFRecord
&
record
)
{
{
correct
=
false
;
global_info
=
record
.
getGlobalWorkbookInfo
();
global_info
=
record
.
getGlobalWorkbookInfo
();
unsigned
short
flags
;
unsigned
short
flags
;
...
@@ -86,7 +88,13 @@ void Font::readFields(CFRecord& record)
...
@@ -86,7 +88,13 @@ void Font::readFields(CFRecord& record)
fExtend
=
GETBIT
(
flags
,
7
);
fExtend
=
GETBIT
(
flags
,
7
);
record
>>
icv
>>
bls
>>
sss
>>
uls
>>
bFamily
>>
bCharSet
;
record
>>
icv
>>
bls
>>
sss
>>
uls
>>
bFamily
>>
bCharSet
;
record
.
skipNunBytes
(
1
);
unsigned
char
reserved
;
record
>>
reserved
;
if
(
bls
>=
100
&&
bls
<=
1000
)
correct
=
true
;
if
(
record
.
getGlobalWorkbookInfo
()
->
Version
<
0x0600
)
if
(
record
.
getGlobalWorkbookInfo
()
->
Version
<
0x0600
)
{
{
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Font.h
View file @
9447c725
...
@@ -83,6 +83,8 @@ public:
...
@@ -83,6 +83,8 @@ public:
FillInfoExt
color_ext
;
FillInfoExt
color_ext
;
ShortXLUnicodeString
fontName
;
ShortXLUnicodeString
fontName
;
bool
correct
;
};
};
}
// namespace XLS
}
// namespace XLS
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/HeaderFooter.cpp
View file @
9447c725
...
@@ -60,7 +60,7 @@ void HeaderFooter::writeFields(CFRecord& record)
...
@@ -60,7 +60,7 @@ void HeaderFooter::writeFields(CFRecord& record)
_GUID_
guid_num
;
_GUID_
guid_num
;
if
(
!
STR
::
bstr2guid
(
guidSView
,
guid_num
))
if
(
!
STR
::
bstr2guid
(
guidSView
,
guid_num
))
{
{
throw
;
// EXCEPT::LE::AttributeDataWrong(L"guid", L"HeaderFooter", guidSView);
// EXCEPT::LE::AttributeDataWrong(L"guid", L"HeaderFooter", guidSView);
}
}
record
<<
guid_num
;
record
<<
guid_num
;
unsigned
short
flags
=
0
;
unsigned
short
flags
=
0
;
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/LPr.cpp
View file @
9447c725
...
@@ -46,7 +46,7 @@ BaseObjectPtr LPr::clone()
...
@@ -46,7 +46,7 @@ BaseObjectPtr LPr::clone()
void
LPr
::
writeFields
(
CFRecord
&
record
)
void
LPr
::
writeFields
(
CFRecord
&
record
)
{
{
// The record is unused
// The record is unused
throw
;
// EXCEPT::LE::WhatIsTheFuck("LPr must appears in the intermediate XML file while it must not.", __FUNCTION__);
// EXCEPT::LE::WhatIsTheFuck("LPr must appears in the intermediate XML file while it must not.", __FUNCTION__);
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Lbl.cpp
View file @
9447c725
...
@@ -153,7 +153,7 @@ void Lbl::writeFields(CFRecord& record)
...
@@ -153,7 +153,7 @@ void Lbl::writeFields(CFRecord& record)
}
}
else
else
{
{
throw
;
// EXCEPT::RT::WrongBiffRecord(L"Unsupported value of built-in name.", record.getTypeString());
// EXCEPT::RT::WrongBiffRecord(L"Unsupported value of built-in name.", record.getTypeString());
}
}
// fix
// fix
...
@@ -267,7 +267,9 @@ void Lbl::readFields(CFRecord& record)
...
@@ -267,7 +267,9 @@ void Lbl::readFields(CFRecord& record)
Name
=
(
L"_xlnm._FilterDatabase"
);
Name
=
(
L"_xlnm._FilterDatabase"
);
break
;
break
;
default:
default:
throw
;
// EXCEPT::RT::WrongBiffRecord(L"Unsupported value of built-in name.", record.getTypeString());
Name
;
break
;
// EXCEPT::RT::WrongBiffRecord(L"Unsupported value of built-in name.", record.getTypeString());
}
}
}
}
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Password.cpp
View file @
9447c725
...
@@ -53,16 +53,16 @@ BaseObjectPtr Password::clone()
...
@@ -53,16 +53,16 @@ BaseObjectPtr Password::clone()
void
Password
::
writeFields
(
CFRecord
&
record
)
void
Password
::
writeFields
(
CFRecord
&
record
)
{
{
unsigned
short
wPassword_num
=
static_cast
<
unsigned
short
>
(
STR
::
hex_str2int
(
wPassword
));
wPassword_num
=
static_cast
<
unsigned
short
>
(
STR
::
hex_str2int
(
wPassword
));
record
<<
wPassword_num
;
record
<<
wPassword_num
;
}
}
void
Password
::
readFields
(
CFRecord
&
record
)
void
Password
::
readFields
(
CFRecord
&
record
)
{
{
unsigned
short
wPassword_num
;
record
>>
wPassword_num
;
record
>>
wPassword_num
;
wPassword
=
std
::
wstring
(
STR
::
int2hex_wstr
(
wPassword_num
,
sizeof
(
wPassword_num
)).
c_str
());
wPassword
=
STR
::
int2hex_wstr
(
wPassword_num
,
sizeof
(
wPassword_num
));
}
}
}
// namespace XLS
}
// namespace XLS
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Password.h
View file @
9447c725
...
@@ -54,7 +54,8 @@ public:
...
@@ -54,7 +54,8 @@ public:
static
const
ElementType
type
=
typePassword
;
static
const
ElementType
type
=
typePassword
;
//-----------------------------
//-----------------------------
BIFF_BSTR
wPassword
;
unsigned
short
wPassword_num
;
std
::
wstring
wPassword
;
};
};
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Prot4RevPass.cpp
View file @
9447c725
...
@@ -53,16 +53,16 @@ BaseObjectPtr Prot4RevPass::clone()
...
@@ -53,16 +53,16 @@ BaseObjectPtr Prot4RevPass::clone()
void
Prot4RevPass
::
writeFields
(
CFRecord
&
record
)
void
Prot4RevPass
::
writeFields
(
CFRecord
&
record
)
{
{
unsigned
short
protPwdRev_num
=
static_cast
<
unsigned
short
>
(
STR
::
hex_str2int
(
protPwdRev
));
protPwdRev_num
=
static_cast
<
unsigned
short
>
(
STR
::
hex_str2int
(
protPwdRev
));
record
<<
protPwdRev_num
;
record
<<
protPwdRev_num
;
}
}
void
Prot4RevPass
::
readFields
(
CFRecord
&
record
)
void
Prot4RevPass
::
readFields
(
CFRecord
&
record
)
{
{
unsigned
short
protPwdRev_num
;
record
>>
protPwdRev_num
;
record
>>
protPwdRev_num
;
protPwdRev
=
std
::
wstring
(
STR
::
int2hex_wstr
(
protPwdRev_num
,
sizeof
(
protPwdRev_num
)).
c_str
());
protPwdRev
=
STR
::
int2hex_wstr
(
protPwdRev_num
,
sizeof
(
protPwdRev_num
));
}
}
}
// namespace XLS
}
// namespace XLS
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Prot4RevPass.h
View file @
9447c725
...
@@ -54,7 +54,8 @@ public:
...
@@ -54,7 +54,8 @@ public:
static
const
ElementType
type
=
typeProt4RevPass
;
static
const
ElementType
type
=
typeProt4RevPass
;
//-----------------------------
//-----------------------------
BIFF_BSTR
protPwdRev
;
unsigned
short
protPwdRev_num
;
std
::
wstring
protPwdRev
;
};
};
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/SST.cpp
View file @
9447c725
...
@@ -63,7 +63,8 @@ void SST::writeFields(CFRecord& record)
...
@@ -63,7 +63,8 @@ void SST::writeFields(CFRecord& record)
XLUnicodeRichExtendedStringPtr
element
=
boost
::
dynamic_pointer_cast
<
XLUnicodeRichExtendedString
>
(
*
it
);
XLUnicodeRichExtendedStringPtr
element
=
boost
::
dynamic_pointer_cast
<
XLUnicodeRichExtendedString
>
(
*
it
);
if
(
!
element
)
if
(
!
element
)
{
{
throw
;
// EXCEPT::LE::WrongAPIUsage("boost::shared_dynamic_cast failed to cast to XLUnicodeRichExtendedStringPtr", __FUNCTION__);
// EXCEPT::LE::WrongAPIUsage("boost::shared_dynamic_cast failed to cast to XLUnicodeRichExtendedStringPtr", __FUNCTION__);
return
;
}
}
CFRecord
&
current_record
=
recs
.
size
()
?
*
recs
.
back
()
:
record
;
// Points to the original 'record' or the last created 'Continue'
CFRecord
&
current_record
=
recs
.
size
()
?
*
recs
.
back
()
:
record
;
// Points to the original 'record' or the last created 'Continue'
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/UserBView.cpp
View file @
9447c725
...
@@ -60,7 +60,7 @@ void UserBView::writeFields(CFRecord& record)
...
@@ -60,7 +60,7 @@ void UserBView::writeFields(CFRecord& record)
_GUID_
guid_num
;
_GUID_
guid_num
;
if
(
!
STR
::
bstr2guid
(
guid
,
guid_num
))
if
(
!
STR
::
bstr2guid
(
guid
,
guid_num
))
{
{
throw
;
// EXCEPT::LE::AttributeDataWrong(L"guid", L"UserBView", guid);
// EXCEPT::LE::AttributeDataWrong(L"guid", L"UserBView", guid);
}
}
record
<<
guid_num
<<
x
<<
y
<<
dx
<<
dy
<<
wTabRatio
;
record
<<
guid_num
<<
x
<<
y
<<
dx
<<
dy
<<
wTabRatio
;
...
@@ -82,7 +82,7 @@ void UserBView::writeFields(CFRecord& record)
...
@@ -82,7 +82,7 @@ void UserBView::writeFields(CFRecord& record)
}
}
else
else
{
{
throw
;
// EXCEPT::RT::WrongBiffRecord("Unsupported value of mdNoteDisp.", record.getTypeString());
// EXCEPT::RT::WrongBiffRecord("Unsupported value of mdNoteDisp.", record.getTypeString());
}
}
SETBITS
(
flags1
,
2
,
3
,
mdNoteDisp_num
);
SETBITS
(
flags1
,
2
,
3
,
mdNoteDisp_num
);
SETBIT
(
flags1
,
4
,
fDspHScroll
);
SETBIT
(
flags1
,
4
,
fDspHScroll
);
...
@@ -106,7 +106,7 @@ void UserBView::writeFields(CFRecord& record)
...
@@ -106,7 +106,7 @@ void UserBView::writeFields(CFRecord& record)
}
}
else
else
{
{
throw
;
// EXCEPT::RT::WrongBiffRecord("Unsupported value of fHideObj.", record.getTypeString());
// EXCEPT::RT::WrongBiffRecord("Unsupported value of fHideObj.", record.getTypeString());
}
}
SETBITS
(
flags1
,
8
,
9
,
fHideObj_num
);
SETBITS
(
flags1
,
8
,
9
,
fHideObj_num
);
SETBIT
(
flags1
,
10
,
fPrintIncl
);
SETBIT
(
flags1
,
10
,
fPrintIncl
);
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/UserSViewBegin.cpp
View file @
9447c725
...
@@ -58,7 +58,7 @@ void UserSViewBegin::writeFields(CFRecord& record)
...
@@ -58,7 +58,7 @@ void UserSViewBegin::writeFields(CFRecord& record)
_GUID_
guid_num
;
_GUID_
guid_num
;
if
(
!
STR
::
bstr2guid
(
guid
,
guid_num
))
if
(
!
STR
::
bstr2guid
(
guid
,
guid_num
))
{
{
throw
;
// EXCEPT::LE::AttributeDataWrong(L"guid", L"UserSViewBegin", guid);
// EXCEPT::LE::AttributeDataWrong(L"guid", L"UserSViewBegin", guid);
}
}
record
<<
guid_num
<<
iTabid
;
record
<<
guid_num
<<
iTabid
;
record
.
reserveNunBytes
(
2
);
// reserved
record
.
reserveNunBytes
(
2
);
// reserved
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/Bes.cpp
View file @
9447c725
...
@@ -79,7 +79,7 @@ const std::wstring Bes::toString()
...
@@ -79,7 +79,7 @@ const std::wstring Bes::toString()
case
0x2B
:
case
0x2B
:
return
L"#GETTING_DATA"
;
return
L"#GETTING_DATA"
;
default:
default:
throw
;
// EXCEPT::RT::WrongBiffRecord("Unsupported type of Bes.", "unknown");
// EXCEPT::RT::WrongBiffRecord("Unsupported type of Bes.", "unknown");
}
}
}
}
else
else
...
@@ -144,7 +144,7 @@ void Bes::fromString(const std::wstring str)
...
@@ -144,7 +144,7 @@ void Bes::fromString(const std::wstring str)
}
}
else
else
{
{
throw
;
// EXCEPT::RT::WrongBiffRecord("Unsupported type of Bes.", "unknown");
// EXCEPT::RT::WrongBiffRecord("Unsupported type of Bes.", "unknown");
}
}
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/BiffString.cpp
View file @
9447c725
...
@@ -85,14 +85,14 @@ BiffStructurePtr BiffString::clone()
...
@@ -85,14 +85,14 @@ BiffStructurePtr BiffString::clone()
void
BiffString
::
store
(
CFRecord
&
record
)
void
BiffString
::
store
(
CFRecord
&
record
)
{
{
throw
;
// EXCEPT::LE::WhatIsTheFuck("Wrong usage of BiffString. The function must not be called.", __FUNCTION__);
// EXCEPT::LE::WhatIsTheFuck("Wrong usage of BiffString. The function must not be called.", __FUNCTION__);
}
}
void
BiffString
::
load
(
CFRecord
&
record
)
void
BiffString
::
load
(
CFRecord
&
record
)
{
{
throw
;
// EXCEPT::LE::WhatIsTheFuck("Wrong usage of BiffString. Stack overflow stopped.", __FUNCTION__);
// EXCEPT::LE::WhatIsTheFuck("Wrong usage of BiffString. Stack overflow stopped.", __FUNCTION__);
// record >> *this; // :-)
// record >> *this; // :-)
}
}
...
@@ -185,7 +185,7 @@ const size_t BiffString::getSize() const
...
@@ -185,7 +185,7 @@ const size_t BiffString::getSize() const
{
{
if
(
!
cch_
)
if
(
!
cch_
)
{
{
throw
;
// EXCEPT::LE::StructureSizeNotSet("BiffString", __FUNCTION__/*__FUNCDNAME__*/);
// EXCEPT::LE::StructureSizeNotSet("BiffString", __FUNCTION__/*__FUNCDNAME__*/);
}
}
return
*
cch_
;
return
*
cch_
;
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/BiffStructure.cpp
View file @
9447c725
...
@@ -47,7 +47,7 @@ void BiffStructure_NoVtbl::store(CFRecord& record)
...
@@ -47,7 +47,7 @@ void BiffStructure_NoVtbl::store(CFRecord& record)
// this function will never be called ( look at operator>>(CFRecord& record, T& val))
// this function will never be called ( look at operator>>(CFRecord& record, T& val))
void
BiffStructure_NoVtbl
::
load
(
CFRecord
&
record
)
void
BiffStructure_NoVtbl
::
load
(
CFRecord
&
record
)
{
{
throw
;
// EXCEPT::LE::HowCouldItHappen("Unexpected behaviour.", __FUNCTION__);
// EXCEPT::LE::HowCouldItHappen("Unexpected behaviour.", __FUNCTION__);
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/BitMarkedStructs.h
View file @
9447c725
...
@@ -162,7 +162,7 @@ struct BErr : public BiffStructure_NoVtbl
...
@@ -162,7 +162,7 @@ struct BErr : public BiffStructure_NoVtbl
}
}
else
else
{
{
throw
;
// EXCEPT::RT::WrongBiffRecord("Unsupported type of BErr.", "unknown");
// EXCEPT::RT::WrongBiffRecord("Unsupported type of BErr.", "unknown");
}
}
};
};
...
@@ -185,7 +185,7 @@ struct BErr : public BiffStructure_NoVtbl
...
@@ -185,7 +185,7 @@ struct BErr : public BiffStructure_NoVtbl
case
0x2A
:
case
0x2A
:
return
L"#N/A"
;
return
L"#N/A"
;
default:
default:
throw
;
// EXCEPT::RT::WrongBiffRecord("Unsupported type of BErr.", "unknown");
// EXCEPT::RT::WrongBiffRecord("Unsupported type of BErr.", "unknown");
}
}
}
}
};
};
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CFParsedFormulaNoCCE.cpp
View file @
9447c725
...
@@ -58,7 +58,7 @@ void CFParsedFormulaNoCCE::store(CFRecord& record)
...
@@ -58,7 +58,7 @@ void CFParsedFormulaNoCCE::store(CFRecord& record)
void
CFParsedFormulaNoCCE
::
load
(
CFRecord
&
record
)
void
CFParsedFormulaNoCCE
::
load
(
CFRecord
&
record
)
{
{
throw
;
// EXCEPT::LE::WhatIsTheFuck("Unexpected stub function call.", __FUNCTION__);
// EXCEPT::LE::WhatIsTheFuck("Unexpected stub function call.", __FUNCTION__);
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CellRangeRef.cpp
View file @
9447c725
...
@@ -181,7 +181,7 @@ void CellRangeRef::fromString(const std::wstring& str)
...
@@ -181,7 +181,7 @@ void CellRangeRef::fromString(const std::wstring& str)
{
{
if
(
-
1
==
columnFirst
||
-
1
==
columnLast
)
// no correct data found in the supplied string
if
(
-
1
==
columnFirst
||
-
1
==
columnLast
)
// no correct data found in the supplied string
{
{
throw
;
// EXCEPT::LE::WrongIntermediateXMLFormat(std::string("CellRangeRef failed to initialize from \"") +
// EXCEPT::LE::WrongIntermediateXMLFormat(std::string("CellRangeRef failed to initialize from \"") +
//static_cast<char*>(std::wstring (str.c_str())) + "\".", __FUNCTION__);
//static_cast<char*>(std::wstring (str.c_str())) + "\".", __FUNCTION__);
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FtNts.cpp
View file @
9447c725
...
@@ -53,7 +53,7 @@ void FtNts::store(CFRecord& record)
...
@@ -53,7 +53,7 @@ void FtNts::store(CFRecord& record)
_GUID_
guid_num
;
_GUID_
guid_num
;
if
(
!
STR
::
bstr2guid
(
guid
,
guid_num
))
if
(
!
STR
::
bstr2guid
(
guid
,
guid_num
))
{
{
throw
;
// EXCEPT::LE::AttributeDataWrong(L"guid", L"FtNts", guid);
// EXCEPT::LE::AttributeDataWrong(L"guid", L"FtNts", guid);
}
}
record
<<
guid_num
<<
fSharedNote
;
record
<<
guid_num
<<
fSharedNote
;
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/HyperlinkMoniker.cpp
View file @
9447c725
...
@@ -102,7 +102,7 @@ void HyperlinkMoniker::load(XLS::CFRecord& record)
...
@@ -102,7 +102,7 @@ void HyperlinkMoniker::load(XLS::CFRecord& record)
}
}
else
else
{
{
throw
;
// EXCEPT::RT::WrongBiffRecord("Unsupported type of HyperlinkMoniker.", record.getTypeString());
// EXCEPT::RT::WrongBiffRecord("Unsupported type of HyperlinkMoniker.", record.getTypeString());
}
}
record
>>
*
data
;
record
>>
*
data
;
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/HyperlinkObject.cpp
View file @
9447c725
...
@@ -86,7 +86,7 @@ void HyperlinkObject::store(XLS::CFRecord& record)
...
@@ -86,7 +86,7 @@ void HyperlinkObject::store(XLS::CFRecord& record)
_GUID_
guid_num
;
_GUID_
guid_num
;
if
(
!
STR
::
bstr2guid
(
guid
,
guid_num
))
if
(
!
STR
::
bstr2guid
(
guid
,
guid_num
))
{
{
throw
;
// EXCEPT::LE::AttributeDataWrong(L"guid", L"HyperlinkObject", guid);
// EXCEPT::LE::AttributeDataWrong(L"guid", L"HyperlinkObject", guid);
}
}
record
<<
guid_num
;
record
<<
guid_num
;
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtContainer.cpp
View file @
9447c725
...
@@ -206,12 +206,13 @@ void OfficeArtContainer::loadFields(XLS::CFRecord& record)
...
@@ -206,12 +206,13 @@ void OfficeArtContainer::loadFields(XLS::CFRecord& record)
}
}
else
// If the found record is not implemented or unknown
else
// If the found record is not implemented or unknown
{
{
if
(
rh_child
.
size
()
>
record
.
getDataSize
()
-
container_beginning_ptr
)
break
;
try
try
{
{
size_t
sz
=
rh_child
.
size
();
size_t
sz
=
rh_child
.
size
();
record
.
skipNunBytes
(
rh_child
.
size
());
// skip header
record
.
skipNunBytes
(
rh_child
.
size
());
// skip art record header + data
record
.
skipNunBytes
(
rh_child
.
recLen
);
// skip record data
Log
::
warning
(
std
::
wstring
(
L"Unsupported OfficeArtRecord skipped (recType=0x"
)
+
Log
::
warning
(
std
::
wstring
(
L"Unsupported OfficeArtRecord skipped (recType=0x"
)
+
STR
::
int2hex_wstr
(
rh_child
.
recType
,
sizeof
(
rh_child
.
recType
))
+
std
::
wstring
(
L")"
));
STR
::
int2hex_wstr
(
rh_child
.
recType
,
sizeof
(
rh_child
.
recType
))
+
std
::
wstring
(
L")"
));
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/OperatorPtgs.h
View file @
9447c725
...
@@ -57,6 +57,9 @@ public:
...
@@ -57,6 +57,9 @@ public:
virtual
void
assemble
(
AssemblerStack
&
ptg_stack
,
PtgQueue
&
extra_data
,
bool
full_ref
=
false
)
virtual
void
assemble
(
AssemblerStack
&
ptg_stack
,
PtgQueue
&
extra_data
,
bool
full_ref
=
false
)
{
{
if
(
ptg_stack
.
empty
())
return
;
std
::
wstring
operand2
(
ptg_stack
.
top
());
std
::
wstring
operand2
(
ptg_stack
.
top
());
ptg_stack
.
pop
();
ptg_stack
.
pop
();
ptg_stack
.
top
()
+=
getOperatorSymbols
()
+
operand2
;
ptg_stack
.
top
()
+=
getOperatorSymbols
()
+
operand2
;
...
@@ -74,6 +77,9 @@ public:
...
@@ -74,6 +77,9 @@ public:
UOperatorPtg_T
()
:
OperatorPtg
(
fixedType
)
{};
UOperatorPtg_T
()
:
OperatorPtg
(
fixedType
)
{};
void
assemble
(
AssemblerStack
&
ptg_stack
,
PtgQueue
&
extra_data
,
bool
full_ref
=
false
)
void
assemble
(
AssemblerStack
&
ptg_stack
,
PtgQueue
&
extra_data
,
bool
full_ref
=
false
)
{
{
if
(
ptg_stack
.
empty
())
return
;
ptg_stack
.
top
()
=
T
::
getSymbols
()
+
ptg_stack
.
top
();
ptg_stack
.
top
()
=
T
::
getSymbols
()
+
ptg_stack
.
top
();
};
};
virtual
const
unsigned
short
getPtgId
()
const
{
return
fixedType
;};
virtual
const
unsigned
short
getPtgId
()
const
{
return
fixedType
;};
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ParsedFormula.cpp
View file @
9447c725
...
@@ -90,7 +90,7 @@ const std::wstring ParsedFormula::getAssembledFormula(bool full_ref) const
...
@@ -90,7 +90,7 @@ const std::wstring ParsedFormula::getAssembledFormula(bool full_ref) const
if
(
1
!=
ptg_stack
.
size
())
if
(
1
!=
ptg_stack
.
size
())
{
{
return
L""
;
return
L""
;
//
throw;
EXCEPT::LE::WrongAPIUsage("Wrong formula assembling.", __FUNCTION__);
//EXCEPT::LE::WrongAPIUsage("Wrong formula assembling.", __FUNCTION__);
}
}
return
ptg_stack
.
top
();
return
ptg_stack
.
top
();
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgBool.cpp
View file @
9447c725
...
@@ -59,7 +59,7 @@ PtgBool::PtgBool(const std::wstring& word)
...
@@ -59,7 +59,7 @@ PtgBool::PtgBool(const std::wstring& word)
}
}
else
else
{
{
throw
;
// EXCEPT::LE::FormulaParsingError("Wrong boolean format.", __FUNCTION__);
// EXCEPT::LE::FormulaParsingError("Wrong boolean format.", __FUNCTION__);
}
}
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgExtraArray.cpp
View file @
9447c725
...
@@ -117,7 +117,7 @@ void PtgExtraArray::fromString(const std::wstring& str)
...
@@ -117,7 +117,7 @@ void PtgExtraArray::fromString(const std::wstring& str)
{
{
if
(
str
.
length
()
<=
2
)
if
(
str
.
length
()
<=
2
)
{
{
throw
;
// EXCEPT::LE::WhatIsTheFuck("Unknown PtgExtraArray format extracted from formula.", __FUNCTION__);
// EXCEPT::LE::WhatIsTheFuck("Unknown PtgExtraArray format extracted from formula.", __FUNCTION__);
}
}
std
::
wstring
::
const_iterator
first
=
str
.
begin
()
+
1
;
std
::
wstring
::
const_iterator
first
=
str
.
begin
()
+
1
;
...
@@ -155,7 +155,7 @@ void PtgExtraArray::fromString(const std::wstring& str)
...
@@ -155,7 +155,7 @@ void PtgExtraArray::fromString(const std::wstring& str)
}
}
else
else
{
{
throw
;
// EXCEPT::LE::WhatIsTheFuck("Unknown operand format in PtgArray.", __FUNCTION__);
// EXCEPT::LE::WhatIsTheFuck("Unknown operand format in PtgArray.", __FUNCTION__);
}
}
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgFuncVar.cpp
View file @
9447c725
...
@@ -83,7 +83,7 @@ void PtgFuncVar::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, bool
...
@@ -83,7 +83,7 @@ void PtgFuncVar::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, bool
int
sz
=
ptg_stack
.
size
();
int
sz
=
ptg_stack
.
size
();
if
(
nparams
)
if
(
nparams
&&
!
ptg_stack
.
empty
()
)
{
{
arguments
+=
ptg_stack
.
top
();
arguments
+=
ptg_stack
.
top
();
ptg_stack
.
pop
();
ptg_stack
.
pop
();
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/RevLblName.cpp
View file @
9447c725
...
@@ -118,7 +118,7 @@ void RevLblName::load(CFRecord& record)
...
@@ -118,7 +118,7 @@ void RevLblName::load(CFRecord& record)
st
=
L"_xlnm._FilterDatabase"
;
st
=
L"_xlnm._FilterDatabase"
;
break
;
break
;
default:
default:
throw
;
// EXCEPT::RT::WrongBiffRecord("Unsupported value of built-in name.", record.getTypeString());
// EXCEPT::RT::WrongBiffRecord("Unsupported value of built-in name.", record.getTypeString());
}
}
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerAr.cpp
View file @
9447c725
...
@@ -63,7 +63,7 @@ SerArPtr SerAr::createSerAr(const unsigned char type)
...
@@ -63,7 +63,7 @@ SerArPtr SerAr::createSerAr(const unsigned char type)
return
SerArPtr
(
new
SerStr
);
return
SerArPtr
(
new
SerStr
);
break
;
break
;
default:
default:
throw
;
// EXCEPT::RT::WrongBiffRecord("Unsupported type of SerAr.", "SerAr container");
// EXCEPT::RT::WrongBiffRecord("Unsupported type of SerAr.", "SerAr container");
}
}
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/StringPtgParser.cpp
View file @
9447c725
...
@@ -171,7 +171,7 @@ namespace XLS
...
@@ -171,7 +171,7 @@ namespace XLS
// }
// }
// else
// else
// {
// {
//
throw;
// EXCEPT::RT::WrongFormulaString("Unknown operator format in formula.", assembled_formula);
// // EXCEPT::RT::WrongFormulaString("Unknown operator format in formula.", assembled_formula);
// }
// }
// OperatorPtgPtr operator_top;
// OperatorPtgPtr operator_top;
// while(ptg_stack.size() && (operator_top = boost::dynamic_pointer_cast<OperatorPtg>(ptg_stack.top())) &&
// while(ptg_stack.size() && (operator_top = boost::dynamic_pointer_cast<OperatorPtg>(ptg_stack.top())) &&
...
@@ -217,7 +217,7 @@ namespace XLS
...
@@ -217,7 +217,7 @@ namespace XLS
// }
// }
// if(!ptg_stack.size() || !left_p)
// if(!ptg_stack.size() || !left_p)
// {
// {
//
throw;
// EXCEPT::RT::WrongParenthesisSequence(assembled_formula);
// // EXCEPT::RT::WrongParenthesisSequence(assembled_formula);
// }
// }
// ptg_stack.pop(); // pop PtgParen that is now stored in left_p
// ptg_stack.pop(); // pop PtgParen that is now stored in left_p
// last_ptg = left_p;
// last_ptg = left_p;
...
@@ -232,7 +232,7 @@ namespace XLS
...
@@ -232,7 +232,7 @@ namespace XLS
// size_t num_parameters = left_p->getParametersNum() + 1;
// size_t num_parameters = left_p->getParametersNum() + 1;
// if(num_parameters > 255)
// if(num_parameters > 255)
// {
// {
//
throw;
// EXCEPT::RT::WrongFormulaString("Too many parameters to a function", assembled_formula);
// // EXCEPT::RT::WrongFormulaString("Too many parameters to a function", assembled_formula);
// }
// }
// func_var->setParamsNum(static_cast<unsigned char>(num_parameters));
// func_var->setParamsNum(static_cast<unsigned char>(num_parameters));
// last_ptg = ptg_stack.top();
// last_ptg = ptg_stack.top();
...
@@ -267,7 +267,7 @@ namespace XLS
...
@@ -267,7 +267,7 @@ namespace XLS
// }
// }
// if(!ptg_stack.size() || !left_p)
// if(!ptg_stack.size() || !left_p)
// {
// {
//
throw;
// EXCEPT::RT::WrongParenthesisSequence(assembled_formula);
// // EXCEPT::RT::WrongParenthesisSequence(assembled_formula);
// }
// }
// left_p->incrementParametersNum(); // The count of parameters will be transferred to PtgFuncVar
// left_p->incrementParametersNum(); // The count of parameters will be transferred to PtgFuncVar
// last_ptg = left_p; // PtgParen. Mostly to differ unary and binary minuses and pluses
// last_ptg = left_p; // PtgParen. Mostly to differ unary and binary minuses and pluses
...
@@ -314,7 +314,7 @@ namespace XLS
...
@@ -314,7 +314,7 @@ namespace XLS
// }
// }
// else
// else
// {
// {
//
throw;
// EXCEPT::RT::WrongFormulaString("Unknown format of 3D reference in formula.", assembled_formula);
// // EXCEPT::RT::WrongFormulaString("Unknown format of 3D reference in formula.", assembled_formula);
// }
// }
// }
// }
// else if(SyntaxPtg::extract_PtgName(it, itEnd, number))// Shall be placed strongly before PtgArea and PtgRef
// else if(SyntaxPtg::extract_PtgName(it, itEnd, number))// Shall be placed strongly before PtgArea and PtgRef
...
@@ -377,7 +377,7 @@ namespace XLS
...
@@ -377,7 +377,7 @@ namespace XLS
// func = PtgFuncVar::create(L"USER_DEFINED_FUNCTION", OperandPtg::pdt_VALUE);
// func = PtgFuncVar::create(L"USER_DEFINED_FUNCTION", OperandPtg::pdt_VALUE);
// if(!func)
// if(!func)
// {
// {
//
throw;
// EXCEPT::LE::WhatIsTheFuck("Ftab_Cetab doesn't contain info about user-defined function (0xFF).", __FUNCTION__);
// // EXCEPT::LE::WhatIsTheFuck("Ftab_Cetab doesn't contain info about user-defined function (0xFF).", __FUNCTION__);
// }
// }
// ptg_stack.push(func);
// ptg_stack.push(func);
// rgce.addPtg(PtgPtr(new PtgNameX(operand_str, OperandPtg::pdt_VALUE)));
// rgce.addPtg(PtgPtr(new PtgNameX(operand_str, OperandPtg::pdt_VALUE)));
...
@@ -385,7 +385,7 @@ namespace XLS
...
@@ -385,7 +385,7 @@ namespace XLS
// }
// }
// else
// else
// {
// {
//
throw;
// EXCEPT::RT::WrongFormulaString("Unknown operand format in formula.", assembled_formula);
// // EXCEPT::RT::WrongFormulaString("Unknown operand format in formula.", assembled_formula);
// }
// }
// last_ptg = found_operand;
// last_ptg = found_operand;
// operand_expected = false;
// operand_expected = false;
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/XFProp.cpp
View file @
9447c725
...
@@ -140,7 +140,7 @@ void XFProp::load(CFRecord& record)
...
@@ -140,7 +140,7 @@ void XFProp::load(CFRecord& record)
return
;
return
;
}
}
default:
default:
throw
;
// EXCEPT::RT::WrongBiffRecord("Unsupported type of XFProp.", record.getTypeString());
// EXCEPT::RT::WrongBiffRecord("Unsupported type of XFProp.", record.getTypeString());
}
}
record
>>
*
xfPropDataBlob
;
record
>>
*
xfPropDataBlob
;
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/FORMATTING.cpp
View file @
9447c725
...
@@ -71,8 +71,12 @@ const bool FORMATTING::loadContent(BinProcessor& proc)
...
@@ -71,8 +71,12 @@ const bool FORMATTING::loadContent(BinProcessor& proc)
int
count
=
0
;
int
count
=
0
;
count
=
proc
.
repeated
<
Font
>
(
0
,
510
);
// Wrong records sequence workaround (originally at least one Font is mandatory)
count
=
proc
.
repeated
<
Font
>
(
0
,
510
);
// Wrong records sequence workaround (originally at least one Font is mandatory)
while
(
count
>
0
)
while
(
count
>
0
)
{
Font
*
font
=
dynamic_cast
<
Font
*>
(
elements_
.
front
().
get
());
if
((
font
)
&&
(
font
->
correct
))
{
{
m_arFonts
.
push_back
(
elements_
.
front
());
m_arFonts
.
push_back
(
elements_
.
front
());
}
elements_
.
pop_front
();
elements_
.
pop_front
();
count
--
;
count
--
;
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/OBJECTS.cpp
View file @
9447c725
...
@@ -109,7 +109,7 @@ public:
...
@@ -109,7 +109,7 @@ public:
const
bool
loadContent
(
BinProcessor
&
proc
)
const
bool
loadContent
(
BinProcessor
&
proc
)
{
{
throw
;
// EXCEPT::LE::UnexpectedProgramPath("Wrong loadContent usage", __FUNCTION__);
// EXCEPT::LE::UnexpectedProgramPath("Wrong loadContent usage", __FUNCTION__);
}
}
...
@@ -137,7 +137,7 @@ BaseObjectPtr OBJECTS::clone()
...
@@ -137,7 +137,7 @@ BaseObjectPtr OBJECTS::clone()
const
bool
OBJECTS
::
loadContent
(
BinProcessor
&
proc
)
const
bool
OBJECTS
::
loadContent
(
BinProcessor
&
proc
)
{
{
throw
;
// EXCEPT::LE::UnexpectedProgramPath("Wrong loadContent usage", __FUNCTION__);
// EXCEPT::LE::UnexpectedProgramPath("Wrong loadContent usage", __FUNCTION__);
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/PROTECTION.cpp
View file @
9447c725
...
@@ -60,11 +60,31 @@ BaseObjectPtr PROTECTION::clone()
...
@@ -60,11 +60,31 @@ BaseObjectPtr PROTECTION::clone()
// PROTECTION = WinProtect Protect Password Prot4Rev Prot4RevPass
// PROTECTION = WinProtect Protect Password Prot4Rev Prot4RevPass
const
bool
PROTECTION
::
loadContent
(
BinProcessor
&
proc
)
const
bool
PROTECTION
::
loadContent
(
BinProcessor
&
proc
)
{
{
proc
.
optional
<
WinProtect
>
();
if
(
proc
.
optional
<
WinProtect
>
())
proc
.
optional
<
Protect
>
();
{
proc
.
optional
<
Password
>
();
m_WinProtect
=
elements_
.
back
();
proc
.
optional
<
Prot4Rev
>
();
elements_
.
pop_back
();
proc
.
optional
<
Prot4RevPass
>
();
}
if
(
proc
.
optional
<
Protect
>
())
{
m_Protect
=
elements_
.
back
();
elements_
.
pop_back
();
}
if
(
proc
.
optional
<
Password
>
())
{
m_Password
=
elements_
.
back
();
elements_
.
pop_back
();
}
if
(
proc
.
optional
<
Prot4Rev
>
())
{
m_Prot4Rev
=
elements_
.
back
();
elements_
.
pop_back
();
}
if
(
proc
.
optional
<
Prot4RevPass
>
())
{
m_Prot4RevPass
=
elements_
.
back
();
elements_
.
pop_back
();
}
return
true
;
return
true
;
}
}
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/PROTECTION.h
View file @
9447c725
...
@@ -50,6 +50,12 @@ public:
...
@@ -50,6 +50,12 @@ public:
virtual
const
bool
loadContent
(
BinProcessor
&
proc
);
virtual
const
bool
loadContent
(
BinProcessor
&
proc
);
static
const
ElementType
type
=
typePROTECTION
;
static
const
ElementType
type
=
typePROTECTION
;
BaseObjectPtr
m_WinProtect
;
BaseObjectPtr
m_Protect
;
BaseObjectPtr
m_Password
;
BaseObjectPtr
m_Prot4Rev
;
BaseObjectPtr
m_Prot4RevPass
;
};
};
}
// namespace XLS
}
// namespace XLS
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/GlobalsSubstream.cpp
View file @
9447c725
...
@@ -210,7 +210,14 @@ const bool GlobalsSubstream::loadContent(BinProcessor& proc)
...
@@ -210,7 +210,14 @@ const bool GlobalsSubstream::loadContent(BinProcessor& proc)
}
}
}
}
}
break
;
}
break
;
case
rt_WriteProtect
:
proc
.
optional
<
WriteProtect
>
();
break
;
case
rt_WriteProtect
:
{
if
(
proc
.
optional
<
WriteProtect
>
())
{
m_WriteProtect
=
elements_
.
back
();
elements_
.
pop_back
();
}
}
break
;
case
rt_FilePass
:
case
rt_FilePass
:
{
{
if
(
proc
.
optional
<
FilePass
>
())
if
(
proc
.
optional
<
FilePass
>
())
...
@@ -218,11 +225,8 @@ const bool GlobalsSubstream::loadContent(BinProcessor& proc)
...
@@ -218,11 +225,8 @@ const bool GlobalsSubstream::loadContent(BinProcessor& proc)
if
((
proc
.
getGlobalWorkbookInfo
()
->
decryptor
)
&&
if
((
proc
.
getGlobalWorkbookInfo
()
->
decryptor
)
&&
(
proc
.
getGlobalWorkbookInfo
()
->
decryptor
->
IsVerify
()
==
false
))
(
proc
.
getGlobalWorkbookInfo
()
->
decryptor
->
IsVerify
()
==
false
))
{
{
if
(
proc
.
getGlobalWorkbookInfo
()
->
password
.
empty
())
if
(
!
proc
.
getGlobalWorkbookInfo
()
->
decryptor
->
SetPassword
(
L"VelvetSweatshop"
,
2
))
{
if
(
!
proc
.
getGlobalWorkbookInfo
()
->
decryptor
->
SetPassword
(
L"VelvetSweatshop"
))
return
false
;
return
false
;
}
else
return
false
;
}
}
}
}
}
break
;
}
break
;
...
@@ -245,7 +249,14 @@ const bool GlobalsSubstream::loadContent(BinProcessor& proc)
...
@@ -245,7 +249,14 @@ const bool GlobalsSubstream::loadContent(BinProcessor& proc)
case
rt_CodeName
:
proc
.
optional
<
CodeName
>
();
break
;
case
rt_CodeName
:
proc
.
optional
<
CodeName
>
();
break
;
case
rt_BuiltInFnGroupCount
:
proc
.
optional
<
FNGROUPS
>
();
break
;
case
rt_BuiltInFnGroupCount
:
proc
.
optional
<
FNGROUPS
>
();
break
;
case
rt_OleObjectSize
:
proc
.
optional
<
OleObjectSize
>
();
break
;
case
rt_OleObjectSize
:
proc
.
optional
<
OleObjectSize
>
();
break
;
case
rt_WinProtect
:
proc
.
optional
<
PROTECTION
>
();
break
;
case
rt_WinProtect
:
{
if
(
proc
.
optional
<
PROTECTION
>
())
{
m_PROTECTION
=
elements_
.
back
();
elements_
.
pop_back
();
}
}
break
;
case
rt_FileSharing
:
proc
.
optional
<
FileSharing
>
();
break
;
case
rt_FileSharing
:
proc
.
optional
<
FileSharing
>
();
break
;
case
rt_CodePage
:
case
rt_CodePage
:
{
{
...
@@ -302,16 +313,18 @@ const bool GlobalsSubstream::loadContent(BinProcessor& proc)
...
@@ -302,16 +313,18 @@ const bool GlobalsSubstream::loadContent(BinProcessor& proc)
case
rt_XFCRC
:
case
rt_XFCRC
:
{
{
if
(
proc
.
mandatory
<
FORMATTING
>
())
if
(
proc
.
mandatory
<
FORMATTING
>
())
{
if
(
!
m_Formating
)
{
{
m_Formating
=
elements_
.
back
();
m_Formating
=
elements_
.
back
();
elements_
.
pop_back
();
elements_
.
pop_back
();
FORMATTING
*
fmts
=
dynamic_cast
<
FORMATTING
*>
(
m_Formating
.
get
());
FORMATTING
*
fmts
=
dynamic_cast
<
FORMATTING
*>
(
m_Formating
.
get
());
if
(
fmts
)
if
(
fmts
)
{
{
proc
.
getGlobalWorkbookInfo
()
->
m_arFonts
=
&
fmts
->
m_arFonts
;
proc
.
getGlobalWorkbookInfo
()
->
m_arFonts
=
&
fmts
->
m_arFonts
;
}
}
}
}
}
}
break
;
}
break
;
case
rt_SXStreamID
:
proc
.
repeated
<
PIVOTCACHEDEFINITION
>
(
0
,
0
);
break
;
case
rt_SXStreamID
:
proc
.
repeated
<
PIVOTCACHEDEFINITION
>
(
0
,
0
);
break
;
case
rt_DocRoute
:
proc
.
repeated
<
DOCROUTE
>
(
0
,
0
);
break
;
case
rt_DocRoute
:
proc
.
repeated
<
DOCROUTE
>
(
0
,
0
);
break
;
...
...
ASCOfficeXlsFile2/source/XlsFormat/Logic/GlobalsSubstream.h
View file @
9447c725
...
@@ -63,6 +63,8 @@ public:
...
@@ -63,6 +63,8 @@ public:
BaseObjectPtr
m_ExtSST
;
BaseObjectPtr
m_ExtSST
;
BaseObjectPtr
m_CodePage
;
BaseObjectPtr
m_CodePage
;
BaseObjectPtr
m_Country
;
BaseObjectPtr
m_Country
;
BaseObjectPtr
m_WriteProtect
;
BaseObjectPtr
m_PROTECTION
;
std
::
vector
<
BaseObjectPtr
>
m_arHFPicture
;
std
::
vector
<
BaseObjectPtr
>
m_arHFPicture
;
std
::
vector
<
BaseObjectPtr
>
m_arLBL
;
std
::
vector
<
BaseObjectPtr
>
m_arLBL
;
...
...
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