diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Auxiliary/HelpFunc.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Auxiliary/HelpFunc.cpp index 12be66ac96..059b248831 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Auxiliary/HelpFunc.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Auxiliary/HelpFunc.cpp @@ -637,7 +637,12 @@ const std::wstring xti_indexes2sheet_name(const short itabFirst, const short ita static boost::wregex correct_sheet_name(L"^\\w[\\w\\d.]*(:\\w[\\w\\d.]*)?$"); if(!boost::regex_search(escaped_prefix.begin(), escaped_prefix.end(), correct_sheet_name)) { - return L'\'' + escaped_prefix + L'\''; + //int res_1 = escaped_prefix.find(L"\''"); + //int res_2 = escaped_prefix.rfind(L"\''"); + //if (res_1 != 0 || res_2 !=escaped_prefix.length() - 1) + { + return L'\'' + escaped_prefix + L'\''; + } } return escaped_prefix; } diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Crypt/rtl/cipher.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Crypt/rtl/cipher.cpp index a3fbd4994f..fb139a5145 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Crypt/rtl/cipher.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Crypt/rtl/cipher.cpp @@ -82,8 +82,8 @@ CipherARCFOUR::rtlCipherError CipherARCFOUR::Decode(const void *pvData, const si CipherARCFOUR::rtlCipherError CipherARCFOUR::Update(const unsigned char *pData, const size_t nDatLen, unsigned char *pBuffer, const size_t nBufLen) { - register unsigned int *S; - register unsigned int x, y, t; + _UINT32 *S; + _UINT32 x, y, t; size_t k; /* Check arguments. */ diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Crypt/rtl/cipher.h b/ASCOfficeXlsFile2/source/XlsFormat/Crypt/rtl/cipher.h index 6f8736480c..529f7e3a7a 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Crypt/rtl/cipher.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Crypt/rtl/cipher.h @@ -1,6 +1,7 @@ #pragma once #include +#include "../../../Common/DocxFormat/Source/Base/Types_32.h" class CipherARCFOUR { @@ -33,11 +34,11 @@ private: rtlCipherError Update(const unsigned char *pData, const size_t nDatLen, unsigned char *pBuffer, const size_t nBufLen); private: - static const unsigned int CIPHER_CBLOCK_ARCFOUR = 256; + static const _UINT32 CIPHER_CBLOCK_ARCFOUR = 256; typedef struct { - unsigned int m_S[CIPHER_CBLOCK_ARCFOUR]; - unsigned int m_X, m_Y; + _UINT32 m_S[CIPHER_CBLOCK_ARCFOUR]; + _UINT32 m_X, m_Y; } CipherContext; rtlCipherDirection m_direction; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Crypt/rtl/digest.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Crypt/rtl/digest.cpp index 126dafb3ec..ac892a0b22 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Crypt/rtl/digest.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Crypt/rtl/digest.cpp @@ -47,16 +47,16 @@ void DigestMD5::InitContext() { memset(&m_context, 0, sizeof (DigestContextMD5)); - m_context.m_nA = (unsigned int)0x67452301L; - m_context.m_nB = (unsigned int)0xefcdab89L; - m_context.m_nC = (unsigned int)0x98badcfeL; - m_context.m_nD = (unsigned int)0x10325476L; + m_context.m_nA = (_UINT32)0x67452301L; + m_context.m_nB = (_UINT32)0xefcdab89L; + m_context.m_nC = (_UINT32)0x98badcfeL; + m_context.m_nD = (_UINT32)0x10325476L; } void DigestMD5::UpdateContext() { - register unsigned int A, B, C, D; - register unsigned int *X; + _UINT32 A, B, C, D; + _UINT32 *X; A = m_context.m_nA; B = m_context.m_nB; @@ -146,8 +146,8 @@ void DigestMD5::EndContext() }; register const unsigned char *p = end; - register unsigned int *X; - register int i; + register _UINT32 *X; + register _INT32 i; X = m_context.m_pData; i = (m_context.m_nDatLen >> 2); @@ -273,6 +273,7 @@ DigestMD5::rtlDigestError DigestMD5::Raw(unsigned char *pBuffer, const unsigned RTL_DIGEST_LTOC (m_context.m_nB, p); RTL_DIGEST_LTOC (m_context.m_nC, p); RTL_DIGEST_LTOC (m_context.m_nD, p); + InitContext(); return rtl_Digest_E_None; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Crypt/rtl/digest.h b/ASCOfficeXlsFile2/source/XlsFormat/Crypt/rtl/digest.h index f1e814fe69..0cdcfcc5a2 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Crypt/rtl/digest.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Crypt/rtl/digest.h @@ -1,5 +1,6 @@ #pragma once +#include "../../../Common/DocxFormat/Source/Base/Types_32.h" class DigestMD5 { @@ -26,15 +27,15 @@ private: void EndContext(); private: - static const unsigned int DIGEST_CBLOCK_MD5 = 64; - static const unsigned int DIGEST_LBLOCK_MD5 = 16; + static const _UINT32 DIGEST_CBLOCK_MD5 = 64; + static const _UINT32 DIGEST_LBLOCK_MD5 = 16; typedef struct digestMD5_context_st { - unsigned int m_nDatLen; - unsigned int m_pData[DIGEST_LBLOCK_MD5]; - unsigned int m_nA, m_nB, m_nC, m_nD; - unsigned int m_nL, m_nH; + _UINT32 m_nDatLen; + _UINT32 m_pData[DIGEST_LBLOCK_MD5]; + _UINT32 m_nA, m_nB, m_nC, m_nD; + _UINT32 m_nL, m_nH; } DigestContextMD5; DigestContextMD5 m_context; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/AutoFilter12.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/AutoFilter12.cpp index ee486066ca..5893009aa6 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/AutoFilter12.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/AutoFilter12.cpp @@ -27,17 +27,18 @@ void AutoFilter12::writeFields(CFRecord& record) void AutoFilter12::readFields(CFRecord& record) { - unsigned short flags; - unsigned int unused2; + _UINT16 flags; + _UINT32 unused2; + record >> frtRefHeader >> iEntry >> fHideArrow >> ft >> cft >> cCriteria >> cDateGroupings >> flags >> unused2 >> idList; - unsigned short _iEntry = iEntry; - unsigned int _fHideArrow = fHideArrow; - unsigned int _ft = ft; - unsigned int _cft = cft; - unsigned int _cCriteria = cCriteria; - unsigned int _cDateGroupings = cDateGroupings; - unsigned int _idList = idList; + _UINT16 _iEntry = iEntry; + _UINT32 _fHideArrow = fHideArrow; + _UINT32 _ft = ft; + _UINT32 _cft = cft; + _UINT32 _cCriteria = cCriteria; + _UINT32 _cDateGroupings = cDateGroupings; + _UINT32 _idList = idList; // TODO доделать record.skipNunBytes(record.getDataSize() - record.getRdPtr()); diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BOF.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BOF.cpp index a758fc9a97..546a07815d 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BOF.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BOF.cpp @@ -29,7 +29,8 @@ void BOF::writeFields(CFRecord& record) record.registerDelayedFilePointerSource(rt_BoundSheet8); } record << vers << dt << rupBuild << rupYear; - unsigned int flags = 0; + + _UINT32 flags = 0; SETBIT(flags, 0, fWin); SETBIT(flags, 1, fRisc); SETBIT(flags, 2, fBeta); @@ -43,6 +44,7 @@ void BOF::writeFields(CFRecord& record) SETBITS(flags, 14,17, verXLHigh); record << flags; record << verLowestBiff; + unsigned char flags2 = 0; SETBITS(flags2, 0, 3, verLastXLSaved); record << flags2; @@ -56,7 +58,7 @@ void BOF::readFields(CFRecord& record) if (vers == (_UINT16)0x600) { - unsigned int flags; + _UINT32 flags; record >> flags; fWin = GETBIT(flags, 0); @@ -76,6 +78,7 @@ void BOF::readFields(CFRecord& record) unsigned char flags2; record >> flags2; verLastXLSaved = GETBITS(flags2, 0, 3); + stream_ptr = record.getStreamPointer(); record.skipNunBytes(2); // reserved } diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BOF.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BOF.h index 6ee494a848..94c7de456f 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BOF.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BOF.h @@ -57,6 +57,7 @@ public: BIFF_WORD verXLHigh; BIFF_BYTE verLowestBiff; BIFF_BYTE verLastXLSaved; + ForwardOnlyParam stream_ptr; }; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BkHim.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BkHim.cpp index 22ac93c785..8fa91434ad 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BkHim.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BkHim.cpp @@ -34,8 +34,8 @@ void BkHim::readFields(CFRecord& record) //Log::error("BkHim record is not implemented."); //record >> some_value; - unsigned short cf; - unsigned int lcb; + _UINT16 cf; + _UINT32 lcb; record >> cf; record.skipNunBytes(2); diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BookExt.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BookExt.cpp index 8da8ed73bc..dd540a0979 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BookExt.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BookExt.cpp @@ -27,7 +27,8 @@ void BookExt::writeFields(CFRecord& record) FrtHeader header(rt_BookExt); record << header; record << cb; - unsigned int flags = 0; + + _UINT32 flags = 0; SETBIT(flags, 0, fDontAutoRecover); SETBIT(flags, 1, fHidePivotList); SETBIT(flags, 2, fFilterPrivacy); @@ -51,7 +52,7 @@ void BookExt::readFields(CFRecord& record) record >> header; record >> cb; - unsigned int flags; + _UINT32 flags; if (record.loadAnyData(flags)) { diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BoundSheet8.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BoundSheet8.h index e66b9196e3..0a66f0a7f5 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BoundSheet8.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/BoundSheet8.h @@ -24,7 +24,7 @@ public: static const ElementType type = typeBoundSheet8; //----------------------------- - ForwardOnlyParam lbPlyPos; + ForwardOnlyParam<_UINT32> lbPlyPos; BIFF_BSTR hsState; BIFF_BYTE dt; ShortXLUnicodeString stName; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Compat12.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Compat12.cpp index a8b1022d96..1022778f5d 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Compat12.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Compat12.cpp @@ -32,8 +32,13 @@ void Compat12::writeFields(CFRecord& record) void Compat12::readFields(CFRecord& record) { FrtHeader frtHeader(rt_Compat12); + record >> frtHeader; - record >> fNoCompatChk; + + _UINT32 flag = 0; + record >> flag; + + fNoCompatChk = (bool)flag; } } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Compat12.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Compat12.h index 505dd0fecc..1633ff78d7 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Compat12.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Compat12.h @@ -23,7 +23,7 @@ public: static const ElementType type = typeCompat12; //----------------------------- - Boolean fNoCompatChk; + bool fNoCompatChk; }; } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/DBCell.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/DBCell.h index 71e3edf2a9..a14fd8893d 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/DBCell.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/DBCell.h @@ -26,17 +26,9 @@ public: static const ElementType type = typeDBCell; //----------------------------- - ForwardOnlyParam dbRtrw; + ForwardOnlyParam<_UINT32> dbRtrw; BiffStructurePtrVector rgdb; - BackwardOnlyParam num_pointers; - -public: - //BO_ATTRIB_MARKUP_BEGIN - //BO_ATTRIB_MARKUP_ATTRIB(dbRtrw) - //BO_ATTRIB_MARKUP_ATTRIB(num_pointers) - //BO_ATTRIB_MARKUP_VECTOR_COMPLEX(rgdb, FileOffset) - //BO_ATTRIB_MARKUP_END - + BackwardOnlyParam<_UINT32> num_pointers; }; } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Dv.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Dv.cpp index e854000ae7..fb7a8c35ac 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Dv.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Dv.cpp @@ -20,11 +20,13 @@ void Dv::writeFields(CFRecord& record) void Dv::readFields(CFRecord& record) { - unsigned int flags; + _UINT32 flags; record >> flags; + valType = static_cast(GETBITS(flags, 0, 3)); errStyle = static_cast(GETBITS(flags, 4, 6)); - fStrLookup = GETBIT(flags, 7); + + fStrLookup = GETBIT(flags, 7); fAllowBlank = GETBIT(flags, 8); fSuppressCombo = GETBIT(flags, 9); mdImeMode = static_cast(GETBITS(flags, 10, 17)); diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ExtSST.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ExtSST.cpp index 3461a36a84..0e04a185e3 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ExtSST.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ExtSST.cpp @@ -26,8 +26,8 @@ void ExtSST::writeFields(CFRecord& record) for(size_t i = 0; i < num_sets; ++i) { - record.registerDelayedDataReceiver(NULL, sizeof(unsigned int)/*ISSTInf::ib*/); - record.registerDelayedDataReceiver(NULL, sizeof(unsigned short)/*ISSTInf::cbOffset*/); + record.registerDelayedDataReceiver(NULL, sizeof(_UINT32)/*ISSTInf::ib*/); + record.registerDelayedDataReceiver(NULL, sizeof(_UINT16)/*ISSTInf::cbOffset*/); record.reserveNunBytes(2); } } diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ExtSST.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ExtSST.h index fc8e8c688e..951c2f51a8 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ExtSST.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ExtSST.h @@ -26,13 +26,7 @@ public: //----------------------------- BIFF_WORD dsst; BiffStructurePtrVector rgISSTInf; - BackwardOnlyParam num_sets; -public: - //BO_ATTRIB_MARKUP_BEGIN - //BO_ATTRIB_MARKUP_ATTRIB(dsst) - //BO_ATTRIB_MARKUP_VECTOR_COMPLEX(rgISSTInf, ISSTInf); - //BO_ATTRIB_MARKUP_ATTRIB(num_sets) - //BO_ATTRIB_MARKUP_END + BackwardOnlyParam<_UINT32> num_sets; }; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ExternSheet.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ExternSheet.h index 3ac21d8971..0b15825abb 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ExternSheet.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ExternSheet.h @@ -24,14 +24,8 @@ public: static const ElementType type = typeExternSheet; //----------------------------- - ForwardOnlyParam cXTI; + ForwardOnlyParam<_UINT16> cXTI; BiffStructurePtrVector rgXTI; -public: - //BO_ATTRIB_MARKUP_BEGIN - //BO_ATTRIB_MARKUP_ATTRIB(cXTI) - //BO_ATTRIB_MARKUP_VECTOR_COMPLEX(rgXTI, XTI) - //BO_ATTRIB_MARKUP_END - }; } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ForceFullCalculation.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ForceFullCalculation.cpp index 3b711d7ccd..ac0b11db60 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ForceFullCalculation.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ForceFullCalculation.cpp @@ -32,7 +32,11 @@ void ForceFullCalculation::readFields(CFRecord& record) { record.skipNunBytes(12); #pragma message("############################ frtHeader skipped here") - record >> fNoDeps; + + _UINT32 temp; + record >> temp; + + fNoDeps = temp; } } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ForceFullCalculation.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ForceFullCalculation.h index 5587ff43dc..f09b14a999 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ForceFullCalculation.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ForceFullCalculation.h @@ -23,11 +23,7 @@ public: static const ElementType type = typeForceFullCalculation; //----------------------------- - Boolean fNoDeps; -public: - //BO_ATTRIB_MARKUP_BEGIN - //BO_ATTRIB_MARKUP_ATTRIB(fNoDeps) - //BO_ATTRIB_MARKUP_END + bool fNoDeps; }; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Formula.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Formula.cpp index 7e088d36e8..1d7f5643b6 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Formula.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Formula.cpp @@ -24,14 +24,16 @@ BaseObjectPtr Formula::clone() void Formula::writeFields(CFRecord& record) { record << cell << val; - unsigned short flags = 0; + + _UINT16 flags = 0; SETBIT(flags, 0, fAlwaysCalc); SETBIT(flags, 2, fFill); SETBIT(flags, 3, fShrFmla); SETBIT(flags, 5, fClearErrors); + record << flags; - unsigned int chn = 0; + _UINT32 chn = 0; record << chn; formula.store(record); //formula.store(record, cell.getLocation()); @@ -48,7 +50,7 @@ void Formula::readFields(CFRecord& record) fShrFmla = GETBIT(flags, 3); fClearErrors = GETBIT(flags, 5); - unsigned int chn = 0; + _UINT32 chn = 0; record >> chn; formula.load(record); diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Index.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Index.cpp index 6cbfb81dec..064016f4f7 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Index.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Index.cpp @@ -24,11 +24,11 @@ void Index::writeFields(CFRecord& record) { record.reserveNunBytes(4); // reserved record << rwMic << rwMac; - record.registerDelayedDataReceiver(NULL, sizeof(unsigned int)/*ibXF*/); + record.registerDelayedDataReceiver(NULL, sizeof(_UINT32)/*ibXF*/); for(unsigned int i = 0; i < num_pointers ; ++i) { - record.registerDelayedDataReceiver(NULL, sizeof(unsigned int)/*FilePointer*/); + record.registerDelayedDataReceiver(NULL, sizeof(_UINT32)/*FilePointer*/); } } @@ -37,6 +37,7 @@ void Index::readFields(CFRecord& record) { record.skipNunBytes(4); // reserved record >> rwMic >> rwMac >> ibXF; + while(!record.isEOF()) { FilePointerPtr element(new FilePointer); diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Index.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Index.h index 8722c353c5..093034f53a 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Index.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Index.h @@ -24,20 +24,12 @@ public: static const ElementType type = typeIndex; //----------------------------- - BackwardOnlyParam rwMic; - BackwardOnlyParam rwMac; - ForwardOnlyParam ibXF; - BackwardOnlyParam num_pointers; + BackwardOnlyParam<_UINT32> rwMic; + BackwardOnlyParam<_UINT32> rwMac; + ForwardOnlyParam<_UINT32> ibXF; + BackwardOnlyParam<_UINT32> num_pointers; + BiffStructurePtrVector rgibRw; -public: - //BO_ATTRIB_MARKUP_BEGIN - //BO_ATTRIB_MARKUP_ATTRIB(rwMic) - //BO_ATTRIB_MARKUP_ATTRIB(rwMac) -// "ibXF" and "FilePointer" are not used in XSLT -// //BO_ATTRIB_MARKUP_ATTRIB(ibXF) - //BO_ATTRIB_MARKUP_ATTRIB(num_pointers) -// //BO_ATTRIB_MARKUP_VECTOR_COMPLEX(rgibRw, FilePointer) - //BO_ATTRIB_MARKUP_END }; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Lbl.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Lbl.cpp index 4faad716d8..4455654cc3 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Lbl.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Lbl.cpp @@ -147,9 +147,12 @@ void Lbl::readFields(CFRecord& record) record >> cch >> cce; record.skipNunBytes(2); record >> itab; + record.skipNunBytes(4); + Name_bin.setSize(cch); // this is to process built-in string values record >> Name_bin; + rgce.load(record, cce); if(!fBuiltin) diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Lbl.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Lbl.h index a9135bbb14..0839019e34 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Lbl.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Lbl.h @@ -37,6 +37,7 @@ public: BIFF_BYTE fGrp; bool fPublished; bool fWorkbookParam; + BIFF_BYTE chKey; BIFF_WORD itab; XLUnicodeStringNoCch Name_bin; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/MDTInfo.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/MDTInfo.cpp index c7c84390b1..aca9459a43 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/MDTInfo.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/MDTInfo.cpp @@ -32,8 +32,10 @@ void MDTInfo::readFields(CFRecord& record) { record.skipNunBytes(12); #pragma message("############################ frtHeader skipped here") - unsigned int flags; + + _UINT32 flags; record >> flags; + fGhostRow = GETBIT(flags, 0); fGhostCol = GETBIT(flags, 1); fEdit = GETBIT(flags, 2); diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/MTRSettings.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/MTRSettings.cpp index b673089cda..2fd4c659bd 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/MTRSettings.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/MTRSettings.cpp @@ -31,8 +31,12 @@ void MTRSettings::writeFields(CFRecord& record) void MTRSettings::readFields(CFRecord& record) { record.skipNunBytes(12); + _UINT32 temp1, temp2; #pragma message("############################ frtHeader skipped here") - record >> fMTREnabled >> fUserSetThreadCount >> cUserThreadCount; + record >> temp1 >> temp2 >> cUserThreadCount; + + fMTREnabled = temp1; + fUserSetThreadCount = temp2; } } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/MTRSettings.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/MTRSettings.h index 3d7e451198..a5ff04844c 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/MTRSettings.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/MTRSettings.h @@ -20,15 +20,10 @@ public: void writeFields(CFRecord& record); void readFields(CFRecord& record); //----------------------------- - Boolean fMTREnabled; - Boolean fUserSetThreadCount; + bool fMTREnabled; + bool fUserSetThreadCount; + BIFF_DWORD cUserThreadCount; -public: - //BO_ATTRIB_MARKUP_BEGIN - //BO_ATTRIB_MARKUP_ATTRIB(fMTREnabled) - //BO_ATTRIB_MARKUP_ATTRIB(fUserSetThreadCount) - //BO_ATTRIB_MARKUP_ATTRIB(cUserThreadCount) - //BO_ATTRIB_MARKUP_END }; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/NameCmt.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/NameCmt.h index caf1f25826..461113a5cb 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/NameCmt.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/NameCmt.h @@ -24,12 +24,6 @@ public: //----------------------------- XLUnicodeStringNoCch name; XLUnicodeStringNoCch comment; -public: - //BO_ATTRIB_MARKUP_BEGIN - //BO_ATTRIB_MARKUP_ATTRIB(name) - //BO_ATTRIB_MARKUP_ATTRIB(comment) - //BO_ATTRIB_MARKUP_END - }; } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/NameFnGrp12.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/NameFnGrp12.h index 4359301780..08c689702e 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/NameFnGrp12.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/NameFnGrp12.h @@ -23,13 +23,8 @@ public: //----------------------------- BIFF_WORD cachName; BIFF_WORD fgrp; + XLNameUnicodeString rgach; -public: - //BO_ATTRIB_MARKUP_BEGIN - //BO_ATTRIB_MARKUP_ATTRIB(cachName) - //BO_ATTRIB_MARKUP_ATTRIB(fgrp) - //BO_ATTRIB_MARKUP_ATTRIB(rgach) - //BO_ATTRIB_MARKUP_END }; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/NamePublish.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/NamePublish.h index 43160e96c1..4a511af443 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/NamePublish.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/NamePublish.h @@ -26,14 +26,8 @@ public: //----------------------------- bool fPublished; bool fWorkbookParam; - XLNameUnicodeString strName; -public: - //BO_ATTRIB_MARKUP_BEGIN - //BO_ATTRIB_MARKUP_ATTRIB(fPublished) - //BO_ATTRIB_MARKUP_ATTRIB(fWorkbookParam) - //BO_ATTRIB_MARKUP_ATTRIB(strName) - //BO_ATTRIB_MARKUP_END + XLNameUnicodeString strName; }; } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Row.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Row.h index 04c3abf7c5..61b830ebf4 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Row.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Row.h @@ -38,7 +38,8 @@ public: bool fExAsc; bool fExDes; bool fPhonetic; - BackwardOnlyParam in_block_position; + + BackwardOnlyParam<_UINT32> in_block_position; }; } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/SST.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/SST.cpp index adea65505f..b46a2494ca 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/SST.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/SST.cpp @@ -36,7 +36,7 @@ void SST::writeFields(CFRecord& record) } CFRecord& current_record = recs.size() ? *recs.back() : record; // Points to the original 'record' or the last created 'Continue' - unsigned int ssss; + _UINT32 ssss; if(!current_record.checkFitWriteSafe(ssss = element->getNonVariablePartSize())) // If we cannot write non-variable part into the current record { current_record.commitData(); diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ShapePropsStream.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ShapePropsStream.cpp index 9311b9e7b2..c438d4aeee 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ShapePropsStream.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ShapePropsStream.cpp @@ -36,7 +36,7 @@ void ShapePropsStream::readFields(CFRecord& record) record >> dwChecksum; - unsigned int cb=0; + _UINT32 cb=0; record >> cb; if (cb > 0) diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ShapePropsStream.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ShapePropsStream.h index d2db9c8eb6..4a9dc4c5e7 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ShapePropsStream.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/ShapePropsStream.h @@ -24,8 +24,8 @@ public: FrtHeader frtHeader; - unsigned short wObjContext; - unsigned int dwChecksum; + _UINT16 wObjContext; + _UINT32 dwChecksum; std::string xml_; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/SheetExt.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/SheetExt.cpp index 0077026193..1779790a48 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/SheetExt.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/SheetExt.cpp @@ -38,8 +38,10 @@ void SheetExt::readFields(CFRecord& record) record >> frtHeader; record >> cb; - unsigned int flags; + + _UINT32 flags; record >> flags; + icvPlain = static_cast(GETBITS(flags, 0, 6)); if(0x00000028 == cb) diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/TextPropsStream.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/TextPropsStream.cpp index 5e899dd530..f6c4eaec86 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/TextPropsStream.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/TextPropsStream.cpp @@ -33,7 +33,7 @@ void TextPropsStream::readFields(CFRecord& record) record >> frtHeader; record >> dwChecksum; - unsigned int cb=0; + _UINT32 cb=0; record >> cb; if (cb > 0) diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/TextPropsStream.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/TextPropsStream.h index 4667f96ee6..0def54e8c7 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/TextPropsStream.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/TextPropsStream.h @@ -24,7 +24,7 @@ public: static const ElementType type = typeTextPropsStream; FrtHeader frtHeader; - unsigned int dwChecksum; + _UINT32 dwChecksum; std::string xml_; }; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Tick.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Tick.cpp index 5cd18819c3..a3b3fb314b 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Tick.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Tick.cpp @@ -48,7 +48,7 @@ void Tick::readFields(CFRecord& record) fAutoRot = GETBIT(flags, 5); iReadingOrder = GETBITS(flags, 14, 15); - rott = rot; + _rott = rot; } int Tick::serialize(std::wostream & _stream) diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Tick.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Tick.h index f7aa3e5880..5b3edac07a 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Tick.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Tick.h @@ -41,7 +41,7 @@ public: Icv icv; BIFF_WORD trot; - int rott; + int _rott; }; } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/AFDOperRk.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/AFDOperRk.cpp index fab476fd04..25640c3105 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/AFDOperRk.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/AFDOperRk.cpp @@ -36,7 +36,7 @@ void AFDOperRk::load(CFRecord& record) record >> rk; record.skipNunBytes(4); - unsigned int _rk = rk; + _UINT32 _rk = rk; } diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/AntiMoniker.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/AntiMoniker.h index 6fd14d1c3a..8b4eea020a 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/AntiMoniker.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/AntiMoniker.h @@ -18,8 +18,7 @@ public: virtual void load(XLS::CFRecord& record); virtual void store(XLS::CFRecord& record); -private: - unsigned int count; + _UINT32 count; }; } // namespace OSHARED diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/BitMarkedStructs.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/BitMarkedStructs.h index 34fbb4de55..e14bd81c45 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/BitMarkedStructs.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/BitMarkedStructs.h @@ -165,7 +165,7 @@ struct BErr : public BiffStructure_NoVtbl struct XColorType : public BiffStructure_NoVtbl { - unsigned int type; + _UINT32 type; enum { XCLRAUTO = 0x00000000, // Automatic color @@ -179,7 +179,7 @@ struct XColorType : public BiffStructure_NoVtbl struct RevisionType : public BiffStructure_NoVtbl { - unsigned short type; + _UINT16 type; enum { REVTINSRW = 0x0000, // Insert Row. @@ -268,15 +268,14 @@ struct ExtSheetPair : public BiffStructure_NoVtbl struct CondDataValue : public BiffStructure_NoVtbl { - unsigned int condDataValue; -private: - unsigned int reserved; + _UINT32 condDataValue; + _UINT32 reserved; }; struct KPISets : public BiffStructure_NoVtbl { - unsigned int set; + _UINT32 set; enum { KPINIL = 0xFFFFFFFF, // Sort by no-icon KPI3ARROWS = 0x00000000, // Kpi3 Arrows set diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CFExTemplateParams.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CFExTemplateParams.h index 8aec3b0c90..3034881591 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CFExTemplateParams.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CFExTemplateParams.h @@ -21,9 +21,9 @@ private: private: unsigned char reserved2_1; - unsigned int reserved2_2; - unsigned int reserved2_3; - unsigned int reserved2_4; + _UINT32 reserved2_2; + _UINT32 reserved2_3; + _UINT32 reserved2_4; }; @@ -36,10 +36,10 @@ private: unsigned short ctp; private: - unsigned short reserved_1; - unsigned int reserved_2; - unsigned int reserved_3; - unsigned int reserved_4; + _UINT16 reserved_1; + _UINT32 reserved_2; + _UINT32 reserved_3; + _UINT32 reserved_4; }; @@ -52,10 +52,10 @@ private: unsigned short dateOp; private: - unsigned short reserved_1; - unsigned int reserved_2; - unsigned int reserved_3; - unsigned int reserved_4; + _UINT16 reserved_1; + _UINT32 reserved_2; + _UINT32 reserved_3; + _UINT32 reserved_4; }; @@ -69,9 +69,9 @@ private: private: unsigned short reserved_1; - unsigned int reserved_2; - unsigned int reserved_3; - unsigned int reserved_4; + _UINT32 reserved_2; + _UINT32 reserved_3; + _UINT32 reserved_4; }; @@ -81,10 +81,10 @@ public: //void toXML(BiffStructurePtr & parent); private: - unsigned int unused1; - unsigned int unused2; - unsigned int unused3; - unsigned int unused4; + _UINT32 unused1; + _UINT32 unused2; + _UINT32 unused3; + _UINT32 unused4; }; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CellRangeRef.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CellRangeRef.h index 7e0b42bf4a..db1cbd1430 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CellRangeRef.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CellRangeRef.h @@ -120,9 +120,12 @@ public: RwType rwLast; ColType colFirst; ColType colLast; + record >> rwFirst >> rwLast >> colFirst >> colLast; + rowFirst = rwFirst; rowLast = rwLast; + switch(rel_info) { case rel_Present: diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CellXF.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CellXF.cpp index 53bfcbc964..df02148f09 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CellXF.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/CellXF.cpp @@ -20,7 +20,8 @@ BiffStructurePtr CellXF::clone() void CellXF::store(CFRecord& record) { - unsigned int flags = 0; + _UINT32 flags = 0; + SETBITS(flags, 0, 2, alc); SETBIT(flags, 3, fWrap); SETBITS(flags, 4, 6, alcV); @@ -68,11 +69,13 @@ void CellXF::load(CFRecord& record) { m_GlobalWorkbookInfo = record.getGlobalWorkbookInfo(); - unsigned int flags1; - unsigned int flags2; - unsigned int flags3; - unsigned short flags4; + _UINT32 flags1; + _UINT32 flags2; + _UINT32 flags3; + _UINT16 flags4; + record >> flags1 >> flags2 >> flags3 >> flags4; + alc = static_cast(GETBITS(flags1, 0, 2)); fWrap = GETBIT(flags1, 3); alcV = static_cast(GETBITS(flags1, 4, 6)); diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFALC.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFALC.cpp index 6f1b7a50d5..34d4041bc4 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFALC.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFALC.cpp @@ -46,7 +46,8 @@ BiffStructurePtr DXFALC::clone() // void DXFALC::store(CFRecord& record) { - unsigned int flags = 0; + _UINT32 flags = 0; + SETBITS(flags, 0, 2, alc); SETBIT(flags, 3, fWrap); SETBITS(flags, 4, 6, alcv); @@ -63,8 +64,9 @@ void DXFALC::store(CFRecord& record) void DXFALC::load(CFRecord& record) { - unsigned int flags; + _UINT32 flags; record >> flags; + alc = static_cast(GETBITS(flags, 0, 2)); fWrap = GETBIT(flags, 3); alcv = static_cast(GETBITS(flags, 4, 6)); diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFALC.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFALC.h index f1de0a0570..496b3c935b 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFALC.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFALC.h @@ -18,17 +18,17 @@ public: virtual void load(CFRecord& record); virtual void store(CFRecord& record); - unsigned char alc; - bool fWrap; - unsigned char alcv; - bool fJustLast; - unsigned char trot; - unsigned char cIndent; - bool fShrinkToFit; - bool fMergeCell; - unsigned char iReadingOrder; + unsigned char alc; + bool fWrap; + unsigned char alcv; + bool fJustLast; + unsigned char trot; + unsigned char cIndent; + bool fShrinkToFit; + bool fMergeCell; + unsigned char iReadingOrder; - unsigned int iIndent; + _UINT32 iIndent; }; } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFBdr.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFBdr.cpp index 174d96e562..6384d3f731 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFBdr.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFBdr.cpp @@ -50,7 +50,8 @@ BiffStructurePtr DXFBdr::clone() // void DXFBdr::store(CFRecord& record) { - unsigned int flags = 0; + _UINT32 flags = 0; + SETBITS(flags, 0, 3, dgLeft); SETBITS(flags, 4, 7, dgRight); SETBITS(flags, 8, 11, dgTop); @@ -61,7 +62,8 @@ void DXFBdr::store(CFRecord& record) SETBIT(flags, 31, bitDiagUp); record << flags; - unsigned int flags2 = 0; + _UINT32 flags2 = 0; + SETBITS(flags2, 0, 6, icvTop); SETBITS(flags2, 7, 13, icvBottom); SETBITS(flags2, 14, 20, icvDiag); @@ -72,14 +74,16 @@ void DXFBdr::store(CFRecord& record) void DXFBdr::load(CFRecord& record) { - unsigned int flags; + _UINT32 flags; record >> flags; + dgLeft = static_cast(GETBITS(flags, 0, 3)); dgRight = static_cast(GETBITS(flags, 4, 7)); dgTop = static_cast(GETBITS(flags, 8, 11)); dgBottom = static_cast(GETBITS(flags, 12, 15)); icvLeft = static_cast(GETBITS(flags, 16, 22)); icvRight = static_cast(GETBITS(flags, 23, 29)); + bitDiagDown = GETBIT(flags, 30); bitDiagUp = GETBIT(flags, 31); diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFFntD.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFFntD.h index 285e6c58b1..79901557d0 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFFntD.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFFntD.h @@ -22,15 +22,17 @@ public: virtual void store(CFRecord& record); XLUnicodeStringNoCch stFontName; - Stxp stxp; - int icvFore; - Ts tsNinch; - Boolean fSssNinch; - Boolean fUlsNinch; - Boolean fBlsNinch; - int ich; - int cch; - unsigned short iFnt; + Stxp stxp; + _INT32 icvFore; + Ts tsNinch; + + _UINT32 fSssNinch; + _UINT32 fUlsNinch; + _UINT32 fBlsNinch; + + _INT32 ich; + _INT32 cch; + _UINT16 iFnt; }; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFId.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFId.h index 08af64a3d0..18f697eb67 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFId.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFId.h @@ -22,7 +22,7 @@ public: virtual void load(CFRecord& record); virtual void store(CFRecord& record); - unsigned int index; + _UINT32 index; }; } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFN.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFN.cpp index 8170cb8d6e..68de813b46 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFN.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFN.cpp @@ -137,7 +137,8 @@ BiffStructurePtr DXFN::clone() // void DXFN::store(CFRecord& record) { - unsigned int flags = 0; + _UINT32 flags = 0; + SETBIT(flags, 0, alchNinch); SETBIT(flags, 1, alcvNinch); SETBIT(flags, 2, wrapNinch); @@ -167,7 +168,8 @@ void DXFN::store(CFRecord& record) SETBIT(flags, 30, ibitAtrProt); SETBIT(flags, 31, iReadingOrderNinch); record << flags; - unsigned short flags2 = 0; + + _UINT16 flags2 = 0; SETBIT(flags2, 0, fIfmtUser); SETBIT(flags2, 2, fNewBorder); SETBIT(flags2, 15, fZeroInited); @@ -202,8 +204,9 @@ void DXFN::store(CFRecord& record) void DXFN::load(CFRecord& record) { - unsigned int flags; + _UINT32 flags; record >> flags; + alchNinch = GETBIT(flags, 0); alcvNinch = GETBIT(flags, 1); wrapNinch = GETBIT(flags, 2); diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFN12.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFN12.h index 0d8bfc2e14..a14ae7088a 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFN12.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/DXFN12.h @@ -20,9 +20,9 @@ public: virtual void load(CFRecord& record); virtual void store(CFRecord& record); - unsigned int cbDxf; - DXFNPtr dxfn; - XFExtNoFRTPtr xfext; + _UINT32 cbDxf; + DXFNPtr dxfn; + XFExtNoFRTPtr xfext; }; } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/EncryptionHeader.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/EncryptionHeader.h index dc7ad6f057..a3093379bf 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/EncryptionHeader.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/EncryptionHeader.h @@ -20,11 +20,11 @@ public: virtual void store(XLS::CFRecord& record); EncryptionHeaderFlags Flags; - int AlgID; - int AlgIDHash; - unsigned int KeySize; - unsigned int ProviderType; - std::wstring CSPName; + _INT32 AlgID; + _INT32 AlgIDHash; + _UINT32 KeySize; + _UINT32 ProviderType; + std::wstring CSPName; }; } // namespace CRYPTO diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/EncryptionVerifier.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/EncryptionVerifier.h index 055aa177a6..870c404f58 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/EncryptionVerifier.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/EncryptionVerifier.h @@ -18,25 +18,28 @@ public: virtual void load(XLS::CFRecord& record); virtual void store(XLS::CFRecord& record); - unsigned int SaltSize; - struct SALT_TAG { - unsigned int b1; - unsigned int b2; - unsigned int b3; - unsigned int b4; + _UINT32 SaltSize; + struct SALT_TAG + { + _UINT32 b1; + _UINT32 b2; + _UINT32 b3; + _UINT32 b4; } Salt; - struct ENCRYPTED_VERIFIER_TAG { - unsigned int b1; - unsigned int b2; - unsigned int b3; - unsigned int b4; + struct ENCRYPTED_VERIFIER_TAG + { + _UINT32 b1; + _UINT32 b2; + _UINT32 b3; + _UINT32 b4; } EncryptedVerifier; - unsigned int VerifierHashSize; - struct ENCRYPTED_VERIFIER_HASH_TAG { - unsigned int b1; - unsigned int b2; - unsigned int b3; - unsigned int b4; + _UINT32 VerifierHashSize; + struct ENCRYPTED_VERIFIER_HASH_TAG + { + _UINT32 b1; + _UINT32 b2; + _UINT32 b3; + _UINT32 b4; } EncryptedVerifierHash; }; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ExternOleDdeLink.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ExternOleDdeLink.h index 33ec0cffe6..6398861caa 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ExternOleDdeLink.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ExternOleDdeLink.h @@ -20,9 +20,9 @@ public: static const ElementType type = typeExternOleDdeLink; - unsigned int lStgName; - ShortXLUnicodeString linkName; - MOper moper; + _UINT32 lStgName; + ShortXLUnicodeString linkName; + MOper moper; }; } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FactoidType.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FactoidType.cpp index dee8af98f3..9076d2e7fb 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FactoidType.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FactoidType.cpp @@ -22,7 +22,7 @@ void FactoidType::store(XLS::CFRecord& record) void FactoidType::load(XLS::CFRecord& record) { - unsigned int cbFactoid; + _UINT32 cbFactoid; record >> cbFactoid >> id >> rgbUri >> rgbTag >> rgbDownLoadURL; } diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FactoidType.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FactoidType.h index 96d98d4990..3e00666e48 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FactoidType.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FactoidType.h @@ -20,7 +20,7 @@ public: virtual void load(XLS::CFRecord& record); virtual void store(XLS::CFRecord& record); - unsigned int id; + _UINT32 id; PBString rgbUri; PBString rgbTag; PBString rgbDownLoadURL; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/Feat11FdaAutoFilter.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/Feat11FdaAutoFilter.cpp index a030b3d950..1362503532 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/Feat11FdaAutoFilter.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/Feat11FdaAutoFilter.cpp @@ -45,7 +45,7 @@ void Feat11FdaAutoFilter::load(CFRecord& record) record >> cbAutoFilter; record.skipNunBytes(2); - unsigned int size = cbAutoFilter; + _UINT32 size = cbAutoFilter; if (cbAutoFilter) recAutoFilter.readFields(record); } diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/Feat11FieldDataItem.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/Feat11FieldDataItem.cpp index 90214d9d19..46fd374e8a 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/Feat11FieldDataItem.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/Feat11FieldDataItem.cpp @@ -65,7 +65,7 @@ void Feat11FieldDataItem::load(CFRecord& record) record >> cbFmtAgg; record >> istnAgg; - unsigned int flags; + _UINT32 flags; record >> flags; fAutoFilter = static_cast(GETBIT(flags, 0)); diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FeatProtection.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FeatProtection.cpp index 927802d393..4879c702b3 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FeatProtection.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FeatProtection.cpp @@ -35,7 +35,7 @@ void FeatProtection::store(CFRecord& record) void FeatProtection::load(CFRecord& record) { - unsigned int flags; + _UINT32 flags; record >> flags; fSD = GETBIT(flags, 0); record >> wPassword >> stTitle; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FeatProtection.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FeatProtection.h index 8770c21879..528014699e 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FeatProtection.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FeatProtection.h @@ -23,10 +23,11 @@ public: static const ElementType type = typeFeatProtection; bool fSD; - unsigned int wPassword; + _UINT32 wPassword; XLUnicodeString stTitle; - SDContainer sdContainer; - bool sdContainer_set; + + SDContainer sdContainer; + bool sdContainer_set; }; } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FeatSmartTag.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FeatSmartTag.h index 8e81e856c0..67a2ccc7cf 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FeatSmartTag.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FeatSmartTag.h @@ -22,8 +22,8 @@ public: virtual void load(CFRecord& record); virtual void store(CFRecord& record); - unsigned int hashValue; - std::vector rgFactoid; + _UINT32 hashValue; + std::vector rgFactoid; }; } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FileMoniker.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FileMoniker.cpp index 8ed5955e76..4373d3d907 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FileMoniker.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FileMoniker.cpp @@ -33,13 +33,14 @@ void FileMoniker::store(XLS::CFRecord& record) void FileMoniker::load(XLS::CFRecord& record) { - unsigned int ansiLength; + _UINT32 ansiLength; + record >> cAnti >> ansiLength >> ansiPath >> endServer >> versionNumber; record.skipNunBytes(20); // reserved record >> cbUnicodePathSize; if(cbUnicodePathSize) { - unsigned int cbUnicodePathBytes; + _UINT32 cbUnicodePathBytes; record >> cbUnicodePathBytes >> usKeyValue; #if defined(_WIN32) || defined(_WIN64) diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FileMoniker.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FileMoniker.h index 395db4790b..3000cf603e 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FileMoniker.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FileMoniker.h @@ -20,13 +20,13 @@ public: virtual void load(XLS::CFRecord& record); virtual void store(XLS::CFRecord& record); - unsigned short cAnti; - std::string ansiPath; - unsigned short endServer; - unsigned short versionNumber; - unsigned int cbUnicodePathSize; - unsigned short usKeyValue; - std::wstring unicodePath; + _UINT16 cAnti; + std::string ansiPath; + _UINT16 endServer; + _UINT16 versionNumber; + _UINT32 cbUnicodePathSize; + _UINT16 usKeyValue; + std::wstring unicodePath; }; } // namespace OSHARED diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FilePointer.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FilePointer.h index a6f00ff985..bd0bcae1b2 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FilePointer.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FilePointer.h @@ -21,7 +21,7 @@ public: virtual void load(CFRecord& record); virtual void store(CFRecord& record); - unsigned int offset; + _UINT32 offset; }; typedef boost::shared_ptr FilePointerPtr; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FtPictFmla.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FtPictFmla.h index 66266448c5..601398ef96 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FtPictFmla.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FtPictFmla.h @@ -25,9 +25,9 @@ public: virtual void load(CFRecord& record){} virtual void store(CFRecord& record){} - ObjFmla fmla; - unsigned int lPosInCtlStm; - unsigned int cbBufInCtlStm; + ObjFmla fmla; + _UINT32 lPosInCtlStm; + _UINT32 cbBufInCtlStm; PictFmlaKey key; }; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FullColorExt.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FullColorExt.h index 15a93e0948..fb75753b12 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FullColorExt.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FullColorExt.h @@ -21,7 +21,7 @@ public: unsigned char icv; unsigned char xclrType; short nTintShade; - unsigned int xclrValue; + _UINT32 xclrValue; }; } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/GradStop.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/GradStop.h index f0a4a5f86e..6d7c427b90 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/GradStop.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/GradStop.h @@ -19,11 +19,12 @@ public: static const ElementType type = typeGradStop; - unsigned short xclrType; - unsigned int xclrValue; - LongRGBA xclrValue_rgb; - double numPosition; - double numTint; + _UINT16 xclrType; + _UINT32 xclrValue; + LongRGBA xclrValue_rgb; + + double numPosition; + double numTint; }; } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/HyperlinkObject.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/HyperlinkObject.cpp index 89581f92f8..5e624b74ab 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/HyperlinkObject.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/HyperlinkObject.cpp @@ -15,7 +15,8 @@ XLS::BiffStructurePtr HyperlinkObject::clone() void HyperlinkObject::store(XLS::CFRecord& record) { - unsigned int flags = 0; + _UINT32 flags = 0; + SETBIT(flags, 0, hlstmfHasMoniker); SETBIT(flags, 1, hlstmfIsAbsolute); SETBIT(flags, 2, hlstmfSiteGaveDisplayName); @@ -67,7 +68,8 @@ void HyperlinkObject::store(XLS::CFRecord& record) void HyperlinkObject::load(XLS::CFRecord& record) { - unsigned int flags; + _UINT32 flags; + record >> streamVersion >> flags; hlstmfHasMoniker = GETBIT(flags, 0); diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/HyperlinkObject.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/HyperlinkObject.h index 74f2d47f55..90545d643d 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/HyperlinkObject.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/HyperlinkObject.h @@ -28,7 +28,7 @@ public: virtual void load(XLS::CFRecord& record); virtual void store(XLS::CFRecord& record); - unsigned int streamVersion; + _UINT32 streamVersion; static const XLS::ElementType type = XLS::typeHyperlinkObject; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ISSTInf.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ISSTInf.h index 29c916da59..1a1ebd985e 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ISSTInf.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ISSTInf.h @@ -18,8 +18,8 @@ public: virtual void load(CFRecord& record); virtual void store(CFRecord& record); - unsigned int ib; - unsigned short cbOffset; + _UINT32 ib; + _UINT16 cbOffset; }; typedef boost::shared_ptr ISSTInfPtr; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ItemMoniker.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ItemMoniker.cpp index eb73708d24..86eb68aad9 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ItemMoniker.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ItemMoniker.cpp @@ -49,8 +49,9 @@ void ItemMoniker::store(XLS::CFRecord& record) void ItemMoniker::load(XLS::CFRecord& record) { - unsigned int delimiterLength; + _UINT32 delimiterLength; record >> delimiterLength >> delimiterAnsi; + int sizeof_delimiterUnicode = delimiterLength - (delimiterAnsi.length() + 1); if(sizeof_delimiterUnicode > 0) @@ -63,8 +64,9 @@ void ItemMoniker::load(XLS::CFRecord& record) record.skipNunBytes(sizeof_delimiterUnicode); } - unsigned int itemLength; + _UINT32 itemLength; record >> itemLength >> itemAnsi; + int sizeof_itemUnicode = itemLength - (itemAnsi.length() + 1); if(sizeof_itemUnicode > 0) diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/MDXStrIndex.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/MDXStrIndex.h index faceb95419..5e8724fc90 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/MDXStrIndex.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/MDXStrIndex.h @@ -18,7 +18,7 @@ public: virtual void load(CFRecord& record); virtual void store(CFRecord& record); - unsigned int index; + _UINT32 index; }; typedef boost::shared_ptr MDXStrIndexPtr; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/MDir.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/MDir.h index 8d7b52d716..1d2136f58b 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/MDir.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/MDir.h @@ -18,8 +18,8 @@ public: virtual void load(CFRecord& record); virtual void store(CFRecord& record); - int imdt; - unsigned short mdd; + _INT32 imdt; + _UINT16 mdd; }; typedef boost::shared_ptr MDirPtr; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/NoteRR.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/NoteRR.h index 72931d246c..80dd6dcf98 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/NoteRR.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/NoteRR.h @@ -23,21 +23,23 @@ public: virtual void load(CFRecord& record); virtual void store(CFRecord& record); - RRD rrd; - bool bitfDelNote; - bool bitfAddNote; - RwU row; - ColU col; - bool fShow; - bool fRwHidden; - bool fColHidden; - _GUID_ guid; - unsigned int ichEnd; - unsigned int cchNote; + RRD rrd; + bool bitfDelNote; + bool bitfAddNote; + + RwU row; + ColU col; + + bool fShow; + bool fRwHidden; + bool fColHidden; + + _GUID_ guid; + + _UINT32 ichEnd; + _UINT32 cchNote; + XLUnicodeString stAuthor; - - - }; } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtBStoreContainerFileBlock.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtBStoreContainerFileBlock.cpp index f1af9d789e..d6dfc6c20e 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtBStoreContainerFileBlock.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtBStoreContainerFileBlock.cpp @@ -55,13 +55,16 @@ void OfficeArtBStoreContainerFileBlock::load(XLS::CFRecord& record) unsigned short tag; record >> tag; - unsigned int size; + _UINT32 size; record >> size; - unsigned int cRef; + + _UINT32 cRef; record >> cRef; - unsigned int foDelay; + + _UINT32 foDelay; record >> foDelay; record.skipNunBytes(1); + char cbName; record >> cbName; record.skipNunBytes(2); diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtClientAnchorSheet.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtClientAnchorSheet.h index b73d87b987..4d8e293fc7 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtClientAnchorSheet.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtClientAnchorSheet.h @@ -38,10 +38,10 @@ public: XLS::RwU rwB; short dyB; - unsigned int _dxL; - unsigned int _dyT; - unsigned int _dxR; - unsigned int _dyB; + _UINT32 _dxL; + _UINT32 _dyT; + _UINT32 _dxR; + _UINT32 _dyB; }; typedef boost::shared_ptr OfficeArtClientAnchorSheetPtr; @@ -65,10 +65,10 @@ public: short dxR; short dyB; - unsigned int _dxL; - unsigned int _dyT; - unsigned int _dxR; - unsigned int _dyB; + _UINT32 _dxL; + _UINT32 _dyT; + _UINT32 _dxR; + _UINT32 _dyB; }; typedef boost::shared_ptr OfficeArtChildAnchorPtr; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFDG.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFDG.h index 94ee56f6a0..e8228556cb 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFDG.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFDG.h @@ -23,8 +23,8 @@ public: static const XLS::ElementType type = XLS::typeOfficeArtFDG; - unsigned int csp; - unsigned int spidCur; + _UINT32 csp; + _UINT32 spidCur; }; typedef boost::shared_ptr OfficeArtFDGPtr; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFDGGBlock.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFDGGBlock.cpp index dd4428a892..010b728771 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFDGGBlock.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFDGGBlock.cpp @@ -43,7 +43,7 @@ XLS::BiffStructurePtr OfficeArtFDGGBlock::clone() void OfficeArtFDGGBlock::storeFields(XLS::CFRecord& record) { - unsigned int cidcl = Rgidcl.size(); + _UINT32 cidcl = Rgidcl.size(); record << spidMax << cidcl << cspSaved << cdgSaved; record << Rgidcl; } @@ -51,7 +51,7 @@ void OfficeArtFDGGBlock::storeFields(XLS::CFRecord& record) void OfficeArtFDGGBlock::loadFields(XLS::CFRecord& record) { - unsigned int cidcl; + _UINT32 cidcl; record >> spidMax >> cidcl >> cspSaved >> cdgSaved; for(size_t i = 0; i < cidcl - 1; ++i) diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFDGGBlock.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFDGGBlock.h index 46a3b214e0..81deea18f9 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFDGGBlock.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFDGGBlock.h @@ -25,9 +25,10 @@ public: virtual void loadFields(XLS::CFRecord& record); virtual void storeFields(XLS::CFRecord& record); - unsigned int spidMax; - unsigned int cspSaved; - unsigned int cdgSaved; + _UINT32 spidMax; + _UINT32 cspSaved; + _UINT32 cdgSaved; + std::vector Rgidcl; }; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFOPTE.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFOPTE.cpp index b5178e82dc..772dec556c 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFOPTE.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFOPTE.cpp @@ -596,6 +596,7 @@ void MSOPOINT::load(XLS::CFRecord& record) { unsigned char x_; record >> x_; + x = GETBITS(x_,0 , 3) << 8; y = GETBITS(x_,4 , 8) << 8; } diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFOPTE.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFOPTE.h index 32c17d872e..ad79f43707 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFOPTE.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFOPTE.h @@ -573,8 +573,8 @@ class MSOPOINT : public XLS::BiffStructure static const XLS::ElementType type = XLS::typeOfficeArtRecord; - int x; - int y; + _INT32 x; + _INT32 y; int cbElement; }; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFSP.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFSP.cpp index ed5b967034..73041ca725 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFSP.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFSP.cpp @@ -20,7 +20,8 @@ XLS::BiffStructurePtr OfficeArtFSP::clone() void OfficeArtFSP::storeFields(XLS::CFRecord& record) { - unsigned int flags = 0; + _UINT32 flags = 0; + SETBIT(flags, 0, fGroup); SETBIT(flags, 1, fChild); SETBIT(flags, 2, fPatriarch); @@ -40,7 +41,7 @@ void OfficeArtFSP::storeFields(XLS::CFRecord& record) void OfficeArtFSP::loadFields(XLS::CFRecord& record) { - unsigned int flags; + _UINT32 flags; record >> spid >> flags; fGroup = GETBIT(flags, 0); diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFSP.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFSP.h index 63c6c3872b..2282b63f5c 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFSP.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFSP.h @@ -26,8 +26,8 @@ public: const unsigned short GetInstanceToStore(); - unsigned short shape_id; - unsigned int spid; + _UINT16 shape_id; + _UINT32 spid; bool fGroup; bool fChild; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFSPGR.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFSPGR.h index b4cbfb6b15..54ee8cae23 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFSPGR.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFSPGR.h @@ -23,10 +23,10 @@ public: virtual void loadFields(XLS::CFRecord& record); virtual void storeFields(XLS::CFRecord& record); - int xLeft; - int yTop; - int xRight; - int yBottom; + _INT32 xLeft; + _INT32 yTop; + _INT32 xRight; + _INT32 yBottom; }; typedef boost::shared_ptr OfficeArtFSPGRPtr; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtIDCL.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtIDCL.h index 39d9b8b50e..76a05669e3 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtIDCL.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtIDCL.h @@ -21,9 +21,8 @@ public: virtual void load(XLS::CFRecord& record); virtual void store(XLS::CFRecord& record); -public: - unsigned int dgid; - unsigned int cspidCur; + _UINT32 dgid; + _UINT32 cspidCur; }; typedef boost::shared_ptr OfficeArtIDCLPtr; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtMetafileHeader.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtMetafileHeader.h index 0fde81696e..8f922444d4 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtMetafileHeader.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtMetafileHeader.h @@ -42,10 +42,10 @@ public: virtual void store(XLS::CFRecord& record); virtual void load(XLS::CFRecord& record); - unsigned int cbSize; + _UINT32 cbSize; RECT rcBounds; POINT ptSize; - unsigned int cbSave; + _UINT32 cbSave; unsigned char compression; unsigned char filter; }; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtRecordHeader.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtRecordHeader.h index 1b2d84dae9..549f8d0a4e 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtRecordHeader.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtRecordHeader.h @@ -28,7 +28,7 @@ public: unsigned char recVer; unsigned short recInstance; unsigned short recType; - unsigned int recLen; + _UINT32 recLen; }; typedef boost::shared_ptr OfficeArtRecordHeaderPtr; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/SimpleOfficeArtContainers.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/SimpleOfficeArtContainers.h index 3a03f2fccf..2c95db8b6e 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/SimpleOfficeArtContainers.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/SimpleOfficeArtContainers.h @@ -82,12 +82,12 @@ public: static const XLS::ElementType type = XLS::typeOfficeArtClientData;//FConnectorRule - unsigned int ruid; - unsigned int spidA; - unsigned int spidB; - unsigned int spidC; - unsigned int cptiA; - unsigned int cptiB; + _UINT32 ruid; + _UINT32 spidA; + _UINT32 spidB; + _UINT32 spidC; + _UINT32 cptiA; + _UINT32 cptiB; }; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PictFmlaKey.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PictFmlaKey.cpp index f357c600fa..ff58c45c98 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PictFmlaKey.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PictFmlaKey.cpp @@ -40,7 +40,7 @@ void PictFmlaKey::store(CFRecord& record) void PictFmlaKey::load(CFRecord& record) { - unsigned int cbKey; + _UINT32 cbKey; record >> cbKey; record.skipNunBytes(cbKey); // ActiveX license key is here diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PropertyBagStore.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PropertyBagStore.cpp index a3cf0b2024..a566ad2dcc 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PropertyBagStore.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PropertyBagStore.cpp @@ -42,8 +42,9 @@ void PropertyBagStore::store(XLS::CFRecord& record) void PropertyBagStore::load(XLS::CFRecord& record) { - unsigned int cFactoidType; + _UINT32 cFactoidType; record >> cFactoidType; + for(size_t i = 0; i < cFactoidType; ++i) { FactoidType f; @@ -52,7 +53,7 @@ void PropertyBagStore::load(XLS::CFRecord& record) } record >> cbHdr >> sVer; record.skipNunBytes(4); // ignored - unsigned int cste; + _UINT32 cste; record >> cste; for(size_t i = 0; i < cste; ++i) { diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgExtraElf.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgExtraElf.cpp index dcbb7a1227..dbb5d3b2ee 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgExtraElf.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgExtraElf.cpp @@ -42,11 +42,13 @@ void PtgExtraElf::store(CFRecord& record) void PtgExtraElf::load(CFRecord& record) { - unsigned int flags; + _UINT32 flags; record >> flags; - unsigned int count = flags & 0x3fffffff; + + _UINT32 count = flags & 0x3fffffff; + fRel = GETBIT(flags, 31); - for(unsigned int i = 0; i < count; ++i) + for(_UINT32 i = 0; i < count; ++i) { RgceElfLocExtra cell_ref; record >> cell_ref; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgFuncVar.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgFuncVar.cpp index f43659476a..a38fd14c5b 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgFuncVar.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgFuncVar.cpp @@ -73,6 +73,18 @@ void PtgFuncVar::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data) if(0xFF == tab.getIndex() && ptg_stack.size() > 0) // user-defined function { func_name = ptg_stack.top(); + + if ( func_name == L"WEEKS" || + func_name == L"DAYSINYEAR" || + func_name == L"DAYSINMONTH" || + func_name == L"ISLEAPYEAR" || + func_name == L"MONTHS" || + func_name == L"WEEKS" || + func_name == L"WEEKSINYEAR" || + func_name == L"YEARS") + { + func_name = L"_xll." + func_name; + } ptg_stack.pop(); } ptg_stack.push(func_name + L'(' + arguments + L')'); diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgName.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgName.cpp index e79fcdc1c7..7789d5f540 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgName.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgName.cpp @@ -54,9 +54,9 @@ void PtgName::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data) std::wstring ptg; - if ((global_info) && (nameindex <= global_info->defineNames.size())) + if ((global_info) && (nameindex <= global_info->arDefineNames.size())) { - ptg = global_info->defineNames[nameindex-1]; + ptg = global_info->arDefineNames[nameindex-1]; } if(!ptg.empty()) diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgName.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgName.h index 0e928dc808..7c20be9903 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgName.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgName.h @@ -24,7 +24,7 @@ public: static const unsigned short fixed_id = 0x03; - unsigned int nameindex; + _UINT32 nameindex; private: GlobalWorkbookInfoPtr global_info; }; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgNameX.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgNameX.cpp index 9890133f36..e751bd02d9 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgNameX.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgNameX.cpp @@ -50,10 +50,23 @@ void PtgNameX::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data) return; } - std::wstring udfName; - if(nameindex > 0 && nameindex <= global_info->AddinUdfs.size() && !(udfName = global_info->AddinUdfs[nameindex - 1]).empty()) + std::wstring _Name; + if(nameindex > 0 && nameindex <= global_info->AddinUdfs.size() && !(_Name = global_info->AddinUdfs[nameindex - 1]).empty()) { - ptg_stack.push(udfName); + ptg_stack.push(_Name); + } + else if(ixti > 0 && ixti <= global_info->xti_parsed.size()) + { + std::wstring sheet = global_info->xti_parsed[ixti-1]; + + if (!sheet.empty()) sheet += L"!"; + + if (nameindex > 0 && nameindex <= global_info->arDefineNames.size()) + { + _Name = global_info->arDefineNames[nameindex - 1]; + } + + ptg_stack.push(sheet + _Name); } else { diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgNameX.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgNameX.h index 6d5f3276b4..284b2f60b5 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgNameX.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgNameX.h @@ -25,8 +25,8 @@ public: void fromString(const std::wstring& word); - unsigned short ixti; - unsigned int nameindex; + _UINT16 ixti; + _UINT32 nameindex; private: GlobalWorkbookInfoPtr global_info; }; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgSxName.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgSxName.h index 33a416ac31..73ab64a207 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgSxName.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PtgSxName.h @@ -20,7 +20,7 @@ public: virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data); private: - unsigned int sxIndex; + _UINT32 sxIndex; }; } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/RC4CryptoAPIEncryptionHeader.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/RC4CryptoAPIEncryptionHeader.h index 2cac10dbaa..03afc9125b 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/RC4CryptoAPIEncryptionHeader.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/RC4CryptoAPIEncryptionHeader.h @@ -24,7 +24,7 @@ public: Version EncryptionVersionInfo; EncryptionHeaderFlags Flags; - unsigned int EncryptionHeaderSize; + _UINT32 EncryptionHeaderSize; EncryptionHeader encryptionHeader; EncryptionVerifier encryptionVerifier; }; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/RC4EncryptionHeader.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/RC4EncryptionHeader.h index e966574777..e8295ca9cd 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/RC4EncryptionHeader.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/RC4EncryptionHeader.h @@ -20,22 +20,22 @@ public: Version EncryptionVersionInfo; struct SALT_TAG { - unsigned int b1; - unsigned int b2; - unsigned int b3; - unsigned int b4; + _UINT32 b1; + _UINT32 b2; + _UINT32 b3; + _UINT32 b4; } Salt; struct ENCRYPTED_VERIFIER_TAG { - unsigned int b1; - unsigned int b2; - unsigned int b3; - unsigned int b4; + _UINT32 b1; + _UINT32 b2; + _UINT32 b3; + _UINT32 b4; } EncryptedVerifier; struct ENCRYPTED_VERIFIER_HASH_TAG { - unsigned int b1; - unsigned int b2; - unsigned int b3; - unsigned int b4; + _UINT32 b1; + _UINT32 b2; + _UINT32 b3; + _UINT32 b4; } EncryptedVerifierHash; }; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/RRD.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/RRD.h index 205046ed7b..25f9e2f517 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/RRD.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/RRD.h @@ -21,13 +21,13 @@ public: virtual void load(CFRecord& record); virtual void store(CFRecord& record); - unsigned int cbMemory; - int revid; + _UINT32 cbMemory; + _INT32 revid; RevisionType revt; - bool fAccepted; - bool fUndoAction; - bool fDelAtEdgeOfSort; - TabId tabid; + bool fAccepted; + bool fUndoAction; + bool fDelAtEdgeOfSort; + TabId tabid; }; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SDContainer.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SDContainer.cpp index 7861dee8c9..05b292448d 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SDContainer.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SDContainer.cpp @@ -33,7 +33,7 @@ void SDContainer::store(CFRecord& record) void SDContainer::load(CFRecord& record) { - unsigned int cbSD; + _UINT32 cbSD; record >> cbSD >> sd; } diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SharedProperty.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SharedProperty.h index e190b89499..59a2f6bd00 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SharedProperty.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SharedProperty.h @@ -18,8 +18,8 @@ public: virtual void load(XLS::CFRecord& record); virtual void store(XLS::CFRecord& record); - unsigned int keyIndex; - unsigned int valueIndex; + _UINT32 keyIndex; + _UINT32 valueIndex; }; } // namespace OSHARED diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SheetExtOptional.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SheetExtOptional.cpp index 6df56ae2b8..218ed98460 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SheetExtOptional.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SheetExtOptional.cpp @@ -33,8 +33,9 @@ void SheetExtOptional::store(CFRecord& record) void SheetExtOptional::load(CFRecord& record) { - unsigned int flags; + _UINT32 flags; record >> flags; + icvPlain12 = static_cast(GETBITS(flags, 0, 6)); fCondFmtCalc = GETBIT(flags, 7); fNotPublished = GETBIT(flags, 8); diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SortCond12.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SortCond12.cpp index 93abb46639..6365d6e836 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SortCond12.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SortCond12.cpp @@ -59,8 +59,9 @@ void SortCond12::load(CFRecord& record) { unsigned short flags; record >> flags; - fSortDes = GETBIT(flags, 0); - sortOn = GETBITS(flags, 1, 4); + + fSortDes = GETBIT(flags, 0); + sortOn = GETBITS(flags, 1, 4); record >> rfx; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SortCond12.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SortCond12.h index 9098f9d510..2fc62b275b 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SortCond12.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SortCond12.h @@ -21,15 +21,15 @@ public: virtual void load(CFRecord& record); virtual void store(CFRecord& record); - bool fSortDes; - unsigned short sortOn; - RFX rfx; + bool fSortDes; + unsigned short sortOn; + RFX rfx; - CondDataValue condDataValue; - CFFlag cfflag; + CondDataValue condDataValue; + CFFlag cfflag; - int cchSt; - XLUnicodeStringNoCch stSslist; + _INT32 cchSt; + XLUnicodeStringNoCch stSslist; }; typedef boost::shared_ptr SortCond12Ptr; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/StyleXF.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/StyleXF.cpp index 312226e323..b11eabc2ca 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/StyleXF.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/StyleXF.cpp @@ -23,7 +23,8 @@ BiffStructurePtr StyleXF::clone() void StyleXF::store(CFRecord& record) { - unsigned int flags = 0; + _UINT32 flags = 0; + SETBITS(flags, 0, 2, alc); SETBIT(flags, 3, fWrap); SETBITS(flags, 4, 6, alcV); @@ -52,7 +53,7 @@ void StyleXF::store(CFRecord& record) SETBITS(flags, 26, 31, fill.fls); record << flags; - unsigned short flags2 = 0; + _UINT16 flags2 = 0; SETBITS(flags2, 0, 6, fill.icvFore); SETBITS(flags2, 7, 13, fill.icvBack); record << flags2; @@ -63,10 +64,10 @@ void StyleXF::load(CFRecord& record) { m_GlobalWorkbookInfo = record.getGlobalWorkbookInfo(); - unsigned int flags1; - unsigned int flags2; - unsigned int flags3; - unsigned short flags4; + _UINT32 flags1; + _UINT32 flags2; + _UINT32 flags3; + _UINT16 flags4; record >> flags1 >> flags2 >> flags3 >> flags4; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/TableFeatureType.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/TableFeatureType.cpp index 3aea2615dd..2f5da78c67 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/TableFeatureType.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/TableFeatureType.cpp @@ -94,17 +94,17 @@ void TableFeatureType::load(CFRecord& record) record >> cbFSData; // 64 record >> rupBuild; // Build number of the application - unsigned int _lt = lt; - unsigned int _idList = idList; - unsigned int _crwHeader = crwHeader; - unsigned int _crwTotals = crwTotals; - unsigned int _idFieldNext = idFieldNext; - unsigned int _cbFSData = cbFSData; - unsigned int _rupBuild = rupBuild; + _UINT32 _lt = lt; + _UINT32 _idList = idList; + _UINT32 _crwHeader = crwHeader; + _UINT32 _crwTotals = crwTotals; + _UINT32 _idFieldNext = idFieldNext; + _UINT32 _cbFSData = cbFSData; + _UINT32 _rupBuild = rupBuild; record.skipNunBytes(2); // unused1 - unsigned short flags; + _UINT16 flags; record >> flags; fAutoFilter = static_cast(GETBIT(flags, 1)); diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/URLMoniker.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/URLMoniker.cpp index bf645bc50f..482605bed5 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/URLMoniker.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/URLMoniker.cpp @@ -24,14 +24,14 @@ XLS::BiffStructurePtr URLMoniker::clone() void URLMoniker::store(XLS::CFRecord& record) { - unsigned int length = (url.length() + 1) * 2; + _UINT32 length = (url.length() + 1) * 2; record << length << url; } void URLMoniker::load(XLS::CFRecord& record) { - unsigned int length; + _UINT32 length; record >> length; try { diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/URLMoniker.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/URLMoniker.h index 3057aba1f7..3095f98afa 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/URLMoniker.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/URLMoniker.h @@ -21,12 +21,12 @@ public: static const XLS::ElementType type = XLS::typeURLMoniker; - std::wstring url; - std::wstring serialGUID; + std::wstring url; + std::wstring serialGUID; - unsigned int serialVersion; + _UINT32 serialVersion; - URICreateFlags uriFlags; + URICreateFlags uriFlags; }; } // namespace OSHARED diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/XFExtGradient.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/XFExtGradient.h index f0cceaf8de..3da6c95ea2 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/XFExtGradient.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/XFExtGradient.h @@ -21,7 +21,7 @@ public: static const ElementType type = typeXFExtGradient; XFPropGradient gradient; - unsigned int cGradStops; + _UINT32 cGradStops; std::vector rgGradStops; }; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/XFPropGradient.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/XFPropGradient.cpp index 1362e9b9ed..8d0b519baf 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/XFPropGradient.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/XFPropGradient.cpp @@ -21,8 +21,11 @@ void XFPropGradient::store(CFRecord& record) void XFPropGradient::load(CFRecord& record) { - record >> type1 >> numDegree >> numFillToLeft >> numFillToRight >> + _UINT32 temp; + record >> temp >> numDegree >> numFillToLeft >> numFillToRight >> numFillToTop >> numFillToBottom; + + type1 = temp; } diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/XFPropGradient.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/XFPropGradient.h index 2115a01a05..fa9284c635 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/XFPropGradient.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/XFPropGradient.h @@ -18,7 +18,8 @@ public: static const ElementType type = typeXFPropGradient; - Boolean type1; + bool type1; + double numDegree; double numFillToLeft; double numFillToRight; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/AXS.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/AXS.cpp index d669eab82e..6670254572 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/AXS.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/AXS.cpp @@ -204,7 +204,7 @@ int AXS::serialize(std::wostream & _stream) { FontX * font = dynamic_cast(m_FontX.get()); - _CP_OPT(unsigned int) color; + _CP_OPT(_UINT32) color; if (tick) color = ( tick->rgb.red << 16) + (tick->rgb.green << 8) + tick->rgb.blue; int iFont = font ? (_UINT16)font->iFont : 0; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/DVAXIS.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/DVAXIS.h index 8499f1d7ec..fff4ff07bc 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/DVAXIS.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/DVAXIS.h @@ -23,7 +23,7 @@ public: int serialize(std::wostream & _stream); - unsigned int id; + _UINT32 id; BaseObjectPtr m_Axis; BaseObjectPtr m_AXS; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/IVAXIS.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/IVAXIS.h index c90c187a64..992aa72d23 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/IVAXIS.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/IVAXIS.h @@ -23,7 +23,7 @@ public: int serialize(std::wostream & _stream); - unsigned int id; + _UINT32 id; BaseObjectPtr m_Axis; BaseObjectPtr m_AXS; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/LBL.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/LBL.h index 3a173b5c2d..eeb91008fb 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/LBL.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/LBL.h @@ -23,6 +23,9 @@ public: static const ElementType type = typeLBL; BaseObjectPtr m_Lbl; +//------------------------------------------------------- + + bool isSerialize; }; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/LBL_bu.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/LBL_bu.cpp index 30b65c6f74..7290d36e67 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/LBL_bu.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/LBL_bu.cpp @@ -13,6 +13,7 @@ namespace XLS LBL::LBL() { + isSerialize = false; } @@ -38,28 +39,73 @@ const bool LBL::loadContent(BinProcessor& proc) elements_.pop_back(); Lbl *lbl = dynamic_cast(m_Lbl.get()); + if (!lbl) return false; std::wstring name; - if (lbl->fBuiltin) name = lbl->Name.value().get_value_or(L""); - + std::wstring comment; + + if (lbl->fBuiltin) name = lbl->Name.value().get_value_or(L""); if (name.empty()) name = lbl->Name_bin.value(); + + std::wstring value = lbl->rgce.getAssembledFormula(); NameCmt namecmt(name); if (proc.optional(namecmt)) + { + if (name.empty()) + name = namecmt.name.value(); + comment = namecmt.comment.value(); + } + if (proc.optional()) + { + } + if (proc.optional()) { } - proc.optional(); - proc.optional(); GlobalWorkbookInfoPtr global_info_ = proc.getGlobalWorkbookInfo(); - global_info_->defineNames.push_back(name); + if (!value.empty() && !name.empty()) + { + //bool insert = false; + //std::multimap::iterator it = global_info_->mapDefineNames.find(name); + // + //if (it == global_info_->mapDefineNames.end()) + //{ + // insert = true; + //} + //else + //{ + // while (it != global_info_->mapDefineNames.end())//полные дубляжи + // { + // if (it->second != value) insert = true; + // else break; + // it++; + // } + //} + //if (insert) + { + global_info_->mapDefineNames.insert(std::pair(name, value)); // для поиска дубликатов имен + isSerialize = true; + } + } + else + { + if (lbl->fFunc) + { + if (name == L"FORMULA") //"general_formulas.xls" + name = L"_xludf." + name; + } + } + global_info_->arDefineNames.push_back(name);// для имен функций - todooo ... не все функции корректны !! БДИ !! return true; } int LBL::serialize(std::wostream & stream) { + //if (isSerialize == false) return 0; + Lbl *lbl = dynamic_cast(m_Lbl.get()); if (lbl == NULL) return 0; @@ -78,6 +124,11 @@ int LBL::serialize(std::wostream & stream) CP_XML_ATTR(L"name", xml::utils::replace_text_to_xml(name)); + if (lbl->itab != 0) + { + CP_XML_ATTR(L"localSheetId", lbl->itab - 1); + } + CP_XML_STREAM() << xml::utils::replace_text_to_xml(value); } } diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/GlobalWorkbookInfo.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/GlobalWorkbookInfo.h index f1ac88303f..050d171f3e 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/GlobalWorkbookInfo.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/GlobalWorkbookInfo.h @@ -58,7 +58,8 @@ public: unsigned int last_AXES_id; const static unsigned int initial_AXES_id = 0x2000000; - std::vector defineNames; + std::multimap mapDefineNames; + std::vector arDefineNames; std::vector, size_t> > bin_data;