Compare commits

..

12 Commits

Author SHA1 Message Date
28ebf5aaa6 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop
* 'develop' of https://github.com/ONLYOFFICE/core:
  XlsFormat - connections records
  "60% - Accent1 2" -> "60% - Accent1"
  .
  x2t version up 2.4.466
  XlsFormat - external data records
  Decryptors ... small refactoring
  moveRange
  moveFrom/moveTo open/save
  .
  PptFormatReader - decrypt ppt images
  .
  PprFormatReader - read encrypted files
  x14:conditionalFormatting DxfId starts from 0
2017-06-26 19:19:13 +03:00
8f5967356d up 2017-06-26 19:17:29 +03:00
bc7d73667d XlsFormat - connections records 2017-06-26 17:52:14 +03:00
a434ae2cc4 "60% - Accent1 2" -> "60% - Accent1" 2017-06-26 17:11:36 +03:00
7e52ebca48 . 2017-06-26 11:39:52 +03:00
4925b47002 x2t version up 2.4.466 2017-06-26 10:50:00 +03:00
afdaacb226 XlsFormat - external data records 2017-06-25 15:56:46 +03:00
9f98f07f23 Decryptors ... small refactoring 2017-06-25 14:20:14 +03:00
9e1a0e365f moveRange 2017-06-24 16:36:18 +03:00
39e2b69b8e moveFrom/moveTo open/save 2017-06-24 16:17:44 +03:00
58c00745a7 . 2017-06-24 16:02:47 +03:00
4015e8ba4d PptFormatReader - decrypt ppt images 2017-06-24 15:46:38 +03:00
152 changed files with 3249 additions and 871 deletions

View File

@ -963,4 +963,3 @@ namespace DocFormatUtils
};
}
using namespace DocFormatUtils;

View File

@ -32,6 +32,8 @@
#include "AnnotationReferenceDescriptor.h"
using namespace DocFormatUtils;
namespace DocFileFormat
{
ByteStructure* AnnotationReferenceDescriptor::ConstructObject(VirtualStreamReader* reader, int length)
@ -76,4 +78,4 @@ namespace DocFileFormat
return static_cast<ByteStructure*>(newObject);
}
}
}

View File

@ -34,6 +34,8 @@
#include "IVisitable.h"
#include "Global.h"
using namespace DocFormatUtils;
namespace DocFileFormat
{
typedef enum _BorderType

View File

@ -33,6 +33,8 @@
#include "../Common/FormatUtils.h"
using namespace DocFormatUtils;
namespace DocFileFormat
{
class DateAndTime

View File

@ -33,6 +33,7 @@
#include "DrawingPrimitives.h"
#include "VirtualStreamReader.h"
using namespace DocFormatUtils;
namespace DocFileFormat
{

View File

@ -147,10 +147,11 @@ namespace DocFileFormat
if (fAES) crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::AES_ECB;
if (fCryptoAPI) crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::RC4;
crypt_data_aes.keySize = KeySize / 8;
break;
case 0x6801:
crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::RC4;
crypt_data_aes.keySize = KeySize / 8;
if (crypt_data_aes.keySize == 0) crypt_data_aes.keySize = 5; // 40 bit
break;
case 0x660E:
crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::AES_ECB;

View File

@ -34,6 +34,8 @@
#include "VirtualStreamReader.h"
#include "../../ASCOfficeXlsFile2/source/XlsFormat/Crypt/Decryptor.h"
using namespace DocFormatUtils;
namespace DocFileFormat
{
typedef enum FibVersion
@ -1189,9 +1191,9 @@ namespace DocFileFormat
m_FibBase.fDot = FormatUtils::BitmaskToBool((int)flag16, 0x0001);
m_FibBase.fGlsy = FormatUtils::BitmaskToBool((int)flag16, 0x0002);
m_FibBase.fComplex = FormatUtils::BitmaskToBool((int)flag16, 0x0002);
m_FibBase.fHasPic = FormatUtils::BitmaskToBool((int)flag16, 0x0008);
m_FibBase.cQuickSaves = (WORD)(((int)flag16 & 0x00F0) >> 4);
m_FibBase.fEncrypted = FormatUtils::BitmaskToBool((int)flag16, 0x0100);
m_FibBase.fHasPic = FormatUtils::BitmaskToBool((int)flag16, 0x0008);
m_FibBase.cQuickSaves = (WORD)(((int)flag16 & 0x00F0) >> 4);
m_FibBase.fEncrypted = FormatUtils::BitmaskToBool((int)flag16, 0x0100);
m_FibBase.fWhichTblStm = FormatUtils::BitmaskToBool((int)flag16, 0x0200);
m_FibBase.fReadOnlyRecommended = FormatUtils::BitmaskToBool((int)flag16, 0x0400);
m_FibBase.fWriteReservation = FormatUtils::BitmaskToBool((int)flag16, 0x0800);

View File

@ -72,7 +72,7 @@ public:
if (m_Data)
{
rdUShort = FormatUtils::BytesToUInt16 (m_Data, m_Position, m_Size);
rdUShort = DocFormatUtils::FormatUtils::BytesToUInt16 (m_Data, m_Position, m_Size);
m_Position += sizeof(rdUShort);
}
@ -85,7 +85,7 @@ public:
if (m_Data)
{
rdShort = FormatUtils::BytesToInt16 (m_Data, m_Position, m_Size);
rdShort = DocFormatUtils::FormatUtils::BytesToInt16 (m_Data, m_Position, m_Size);
m_Position += sizeof(rdShort);
}
@ -98,7 +98,7 @@ public:
if (m_Data)
{
rdInt = FormatUtils::BytesToInt32 (m_Data, m_Position, m_Size);
rdInt = DocFormatUtils::FormatUtils::BytesToInt32 (m_Data, m_Position, m_Size);
m_Position += sizeof(rdInt);
}
@ -111,7 +111,7 @@ public:
if (m_Data )
{
rdUInt = FormatUtils::BytesToUInt32 (m_Data, m_Position, m_Size);
rdUInt = DocFormatUtils::FormatUtils::BytesToUInt32 (m_Data, m_Position, m_Size);
m_Position += sizeof(rdUInt);
}

View File

@ -32,6 +32,8 @@
#include "Spa.h"
#include "VirtualStreamReader.h"
using namespace DocFormatUtils;
namespace DocFileFormat
{

View File

@ -197,20 +197,20 @@ public:
int cchSize = 1;
cch = ReadBytes( cchSize, true );
int xstzSize = FormatUtils::BytesToUChar( cch, 0, cchSize ) * 1;
int xstzSize = DocFormatUtils::FormatUtils::BytesToUChar( cch, 0, cchSize ) * 1;
xstz = ReadBytes(xstzSize, true);
FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &wstrResult, xstz, xstzSize, ENCODING_WINDOWS_1250 );
DocFormatUtils::FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &wstrResult, xstz, xstzSize, ENCODING_WINDOWS_1250 );
}
else
{
int cchSize = 2;
cch = ReadBytes( cchSize, true );
int xstzSize = FormatUtils::BytesToInt16( cch, 0, cchSize ) * 2;
int xstzSize = DocFormatUtils::FormatUtils::BytesToInt16( cch, 0, cchSize ) * 2;
xstz = ReadBytes(xstzSize, true);
FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &wstrResult, xstz, xstzSize, ENCODING_UTF16 );
DocFormatUtils::FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &wstrResult, xstz, xstzSize, ENCODING_UTF16 );
}
RELEASEARRAYOBJECTS(xstz);
@ -234,7 +234,7 @@ public:
//dont read the terminating zero
unsigned char* stringBytes = ReadBytes( ( cch * 2 ), true );
FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &result, stringBytes, ( ( cch * 2 ) - 2 ), ENCODING_UTF16 );
DocFormatUtils::FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &result, stringBytes, ( ( cch * 2 ) - 2 ), ENCODING_UTF16 );
RELEASEARRAYOBJECTS( stringBytes );
}
@ -278,7 +278,7 @@ public:
//dont read the terminating zero
stringBytes = ReadBytes( cch, true );
FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &result, stringBytes, ( cch - 1 ), ENCODING_WINDOWS_1250);
DocFormatUtils::FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &result, stringBytes, ( cch - 1 ), ENCODING_WINDOWS_1250);
}
RELEASEARRAYOBJECTS( stringBytes );

View File

@ -139,7 +139,7 @@ namespace DocFileFormat
if (encryptionHeader->bStandard)
{
CRYPT::RC4Decryptor Decryptor(encryptionHeader->crypt_data_rc4, m_sPassword, 1);
CRYPT::RC4Decryptor Decryptor(encryptionHeader->crypt_data_rc4, m_sPassword);
if (Decryptor.IsVerify() == false)
{
@ -153,24 +153,6 @@ namespace DocFileFormat
}
else
{
//POLE::Stream * pStream = NULL;
//if (m_pStorage->GetStream ("EncryptedSummaryInformation", &pStream))
//{
// VirtualStreamReader tStream( pStream, 0, FIB->m_bOlderVersion);
// _UINT32 StreamDescriptorArrayOffset = tStream.ReadUInt32();
// _UINT32 StreamDescriptorArraySize = tStream.ReadUInt32();
// for (int i = 0; i < StreamDescriptorArraySize; i++)
// {
// }
// _UINT32 EncryptedStreamDescriptorCount = tStream.ReadUInt32();
// for (int i = 0; i < EncryptedStreamDescriptorCount; i++)
// {
// }
// RELEASEOBJECT(pStream);
//}
CRYPT::ECMADecryptor Decryptor;
Decryptor.SetCryptData(encryptionHeader->crypt_data_aes);

View File

@ -405,6 +405,8 @@ public:
std::wstring Fill;
std::wstring Del;
std::wstring Ins;
std::wstring MoveFrom;
std::wstring MoveTo;
std::wstring rPrChange;
bool bBold;
@ -492,13 +494,15 @@ public:
Fill.clear();
Del.clear();
Ins.clear();
MoveFrom.clear();
MoveTo.clear();
rPrChange.clear();
}
bool IsNoEmpty()
{
return bBold || bItalic || bUnderline || bStrikeout || bFontAscii || bFontHAnsi || bFontAE || bFontCS || bFontSize || bColor || bVertAlign || bHighLight || bShd ||
bRStyle || bSpacing || bDStrikeout || bCaps || bSmallCaps || bPosition || bFontHint || bBoldCs || bItalicCs || bFontSizeCs || bCs || bRtl || bLang || bLangBidi || bLangEA || bThemeColor || bVanish ||
!Outline.empty() || !Fill.empty() || !Del.empty() || !Ins.empty() || !rPrChange.empty();
!Outline.empty() || !Fill.empty() || !Del.empty() || !Ins.empty() || !MoveFrom.empty() || !MoveTo.empty() || !rPrChange.empty();
}
void Write(XmlUtils::CStringWriter* pCStringWriter)
{
@ -749,6 +753,10 @@ public:
pCStringWriter->WriteString(Del);
if (!Ins.empty())
pCStringWriter->WriteString(Ins);
if (!MoveFrom.empty())
pCStringWriter->WriteString(MoveFrom);
if (!MoveTo.empty())
pCStringWriter->WriteString(MoveTo);
if (!rPrChange.empty())
pCStringWriter->WriteString(rPrChange);
pCStringWriter->WriteString(L"</w:rPr>");

View File

@ -570,6 +570,20 @@ public:
orPr->Ins = oIns.ToString(_T("w:ins"));
}
break;
case c_oSerProp_rPrType::MoveFrom:
{
TrackRevision oMoveFrom;
oBinary_CommonReader2.ReadTrackRevision(length, &oMoveFrom);
orPr->MoveFrom = oMoveFrom.ToString(_T("w:moveFrom"));
}
break;
case c_oSerProp_rPrType::MoveTo:
{
TrackRevision oMoveTo;
oBinary_CommonReader2.ReadTrackRevision(length, &oMoveTo);
orPr->MoveTo = oMoveTo.ToString(_T("w:moveTo"));
}
break;
case c_oSerProp_rPrType::rPrChange:
{
TrackRevision oRPrChange;
@ -3771,6 +3785,42 @@ public:
res = Read1(length, &Binary_DocumentTableReader::ReadDelIns, this, &oTrackRevision);
oTrackRevision.Write(&GetRunStringWriter(), _T("w:del"));
}
else if ( c_oSerParType::MoveFrom == type )
{
TrackRevision oTrackRevision;
res = Read1(length, &Binary_DocumentTableReader::ReadDelIns, this, &oTrackRevision);
oTrackRevision.Write(&GetRunStringWriter(), _T("w:moveFrom"));
}
else if ( c_oSerParType::MoveTo == type )
{
TrackRevision oTrackRevision;
res = Read1(length, &Binary_DocumentTableReader::ReadDelIns, this, &oTrackRevision);
oTrackRevision.Write(&GetRunStringWriter(), _T("w:moveTo"));
}
else if ( c_oSerParType::MoveFromRangeStart == type )
{
OOX::Logic::CMoveFromRangeStart oMoveFromRangeStart;
res = Read1(length, &Binary_DocumentTableReader::ReadMoveFromRangeStart, this, &oMoveFromRangeStart);
GetRunStringWriter().WriteString(oMoveFromRangeStart.toXML());
}
else if ( c_oSerParType::MoveFromRangeEnd == type )
{
OOX::Logic::CMoveFromRangeEnd oMoveToRangeEnd;
res = Read1(length, &Binary_DocumentTableReader::ReadMoveFromRangeEnd, this, &oMoveToRangeEnd);
GetRunStringWriter().WriteString(oMoveToRangeEnd.toXML());
}
else if ( c_oSerParType::MoveToRangeStart == type )
{
OOX::Logic::CMoveToRangeStart oMoveToRangeStart;
res = Read1(length, &Binary_DocumentTableReader::ReadMoveToRangeStart, this, &oMoveToRangeStart);
GetRunStringWriter().WriteString(oMoveToRangeStart.toXML());
}
else if ( c_oSerParType::MoveToRangeEnd == type )
{
OOX::Logic::CMoveToRangeEnd oMoveToRangeEnd;
res = Read1(length, &Binary_DocumentTableReader::ReadMoveToRangeEnd, this, &oMoveToRangeEnd);
GetRunStringWriter().WriteString(oMoveToRangeEnd.toXML());
}
else if(c_oSerParType::Sdt == type)
{
SdtWraper oSdt(1);
@ -3797,6 +3847,142 @@ public:
res = c_oSerConstants::ReadUnknown;
return res;
}
int ReadMoveFromRangeStart(BYTE type, long length, void* poResult)
{
int res = c_oSerConstants::ReadOk;
OOX::Logic::CMoveFromRangeStart* pMoveFromRangeStart = static_cast<OOX::Logic::CMoveFromRangeStart*>(poResult);
if (c_oSerMoveRange::Author == type)
{
pMoveFromRangeStart->m_sAuthor.Init();
pMoveFromRangeStart->m_sAuthor->append(m_oBufferedStream.GetString3(length));
}
else if (c_oSerMoveRange::ColFirst == type)
{
pMoveFromRangeStart->m_oColFirst.Init();
pMoveFromRangeStart->m_oColFirst->SetValue(m_oBufferedStream.GetLong());
}
else if (c_oSerMoveRange::ColLast == type)
{
pMoveFromRangeStart->m_oColLast.Init();
pMoveFromRangeStart->m_oColLast->SetValue(m_oBufferedStream.GetLong());
}
else if (c_oSerMoveRange::Date == type)
{
std::wstring strValue = m_oBufferedStream.GetString3(length);
pMoveFromRangeStart->m_oDate.Init();
pMoveFromRangeStart->m_oDate->SetValue(strValue);
}
else if (c_oSerMoveRange::DisplacedByCustomXml == type)
{
pMoveFromRangeStart->m_oDisplacedByCustomXml.Init();
pMoveFromRangeStart->m_oDisplacedByCustomXml->SetValue((SimpleTypes::EDisplacedByCustomXml)m_oBufferedStream.GetUChar());
}
else if (c_oSerMoveRange::Id == type)
{
pMoveFromRangeStart->m_oId.Init();
pMoveFromRangeStart->m_oId->SetValue(m_oBufferedStream.GetLong());
}
else if (c_oSerMoveRange::Name == type)
{
pMoveFromRangeStart->m_sName.Init();
pMoveFromRangeStart->m_sName->append(m_oBufferedStream.GetString3(length));
}
else if (c_oSerMoveRange::UserId == type)
{
pMoveFromRangeStart->m_sUserId.Init();
pMoveFromRangeStart->m_sUserId->append(m_oBufferedStream.GetString3(length));
}
else
res = c_oSerConstants::ReadUnknown;
return res;
}
int ReadMoveToRangeStart(BYTE type, long length, void* poResult)
{
int res = c_oSerConstants::ReadOk;
OOX::Logic::CMoveToRangeStart* pMoveToRangeStart = static_cast<OOX::Logic::CMoveToRangeStart*>(poResult);
if (c_oSerMoveRange::Author == type)
{
pMoveToRangeStart->m_sAuthor.Init();
pMoveToRangeStart->m_sAuthor->append(m_oBufferedStream.GetString3(length));
}
else if (c_oSerMoveRange::ColFirst == type)
{
pMoveToRangeStart->m_oColFirst.Init();
pMoveToRangeStart->m_oColFirst->SetValue(m_oBufferedStream.GetLong());
}
else if (c_oSerMoveRange::ColLast == type)
{
pMoveToRangeStart->m_oColLast.Init();
pMoveToRangeStart->m_oColLast->SetValue(m_oBufferedStream.GetLong());
}
else if (c_oSerMoveRange::Date == type)
{
std::wstring strValue = m_oBufferedStream.GetString3(length);
pMoveToRangeStart->m_oDate.Init();
pMoveToRangeStart->m_oDate->SetValue(strValue);
}
else if (c_oSerMoveRange::DisplacedByCustomXml == type)
{
pMoveToRangeStart->m_oDisplacedByCustomXml.Init();
pMoveToRangeStart->m_oDisplacedByCustomXml->SetValue((SimpleTypes::EDisplacedByCustomXml)m_oBufferedStream.GetUChar());
}
else if (c_oSerMoveRange::Id == type)
{
pMoveToRangeStart->m_oId.Init();
pMoveToRangeStart->m_oId->SetValue(m_oBufferedStream.GetLong());
}
else if (c_oSerMoveRange::Name == type)
{
pMoveToRangeStart->m_sName.Init();
pMoveToRangeStart->m_sName->append(m_oBufferedStream.GetString3(length));
}
else if (c_oSerMoveRange::UserId == type)
{
pMoveToRangeStart->m_sUserId.Init();
pMoveToRangeStart->m_sUserId->append(m_oBufferedStream.GetString3(length));
}
else
res = c_oSerConstants::ReadUnknown;
return res;
}
int ReadMoveFromRangeEnd(BYTE type, long length, void* poResult)
{
int res = c_oSerConstants::ReadOk;
OOX::Logic::CMoveFromRangeEnd* pMoveFromRangeEnd = static_cast<OOX::Logic::CMoveFromRangeEnd*>(poResult);
if (c_oSerMoveRange::DisplacedByCustomXml == type)
{
pMoveFromRangeEnd->m_oDisplacedByCustomXml.Init();
pMoveFromRangeEnd->m_oDisplacedByCustomXml->SetValue((SimpleTypes::EDisplacedByCustomXml)m_oBufferedStream.GetUChar());
}
else if (c_oSerMoveRange::Id == type)
{
pMoveFromRangeEnd->m_oId.Init();
pMoveFromRangeEnd->m_oId->SetValue(m_oBufferedStream.GetLong());
}
else
res = c_oSerConstants::ReadUnknown;
return res;
}
int ReadMoveToRangeEnd(BYTE type, long length, void* poResult)
{
int res = c_oSerConstants::ReadOk;
OOX::Logic::CMoveToRangeEnd* pMoveToRangeEnd = static_cast<OOX::Logic::CMoveToRangeEnd*>(poResult);
if (c_oSerMoveRange::DisplacedByCustomXml == type)
{
pMoveToRangeEnd->m_oDisplacedByCustomXml.Init();
pMoveToRangeEnd->m_oDisplacedByCustomXml->SetValue((SimpleTypes::EDisplacedByCustomXml)m_oBufferedStream.GetUChar());
}
else if (c_oSerMoveRange::Id == type)
{
pMoveToRangeEnd->m_oId.Init();
pMoveToRangeEnd->m_oId->SetValue(m_oBufferedStream.GetLong());
}
else
res = c_oSerConstants::ReadUnknown;
return res;
}
int ReadFldSimple(BYTE type, long length, void* poResult)
{
int res = c_oSerConstants::ReadOk;

View File

@ -381,7 +381,9 @@ extern int g_nCurFormatVersion;
TextFill = 32,
Del = 33,
Ins = 34,
rPrChange = 35
rPrChange = 35,
MoveFrom = 36,
MoveTo = 37
};}
namespace c_oSerProp_rowPrType{enum c_oSerProp_rowPrType
{
@ -464,7 +466,13 @@ extern int g_nCurFormatVersion;
Del = 12,
Ins = 13,
Background = 14,
Sdt = 15
Sdt = 15,
MoveFrom = 16,
MoveTo = 17,
MoveFromRangeStart = 18,
MoveFromRangeEnd = 19,
MoveToRangeStart = 20,
MoveToRangeEnd = 21
};}
namespace c_oSerDocTableType{enum c_oSerDocTableType
{
@ -1073,6 +1081,17 @@ extern int g_nCurFormatVersion;
TIMaxLength = 23,
TIType = 24,
};}
namespace c_oSerMoveRange{enum c_oSerMoveRange
{
Author = 0,
ColFirst = 1,
ColLast = 2,
Date = 3,
DisplacedByCustomXml = 4,
Id = 5,
Name = 6,
UserId = 7
};}
}
#endif // #ifndef DOCX_BIN_READER_WRITER_DEFINES

View File

@ -831,6 +831,22 @@ namespace BinDocxRW
Write_rPrChange(rPr.m_oRPrChange.get());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
if(rPr.m_oMoveFrom.IsInit())
{
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rPrType::MoveFrom);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable);
nCurPos = m_oBcw.WriteItemWithLengthStart();
m_oBcw.WriteTrackRevision(rPr.m_oMoveFrom.get());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
if(rPr.m_oMoveTo.IsInit())
{
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rPrType::MoveTo);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable);
nCurPos = m_oBcw.WriteItemWithLengthStart();
m_oBcw.WriteTrackRevision(rPr.m_oMoveTo.get());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
}
void Write_rPrChange(const OOX::Logic::CRPrChange& rPrChange)
{
@ -3229,6 +3245,22 @@ namespace BinDocxRW
m_oBcw.WriteItemEnd(nCurPos);
break;
}
case OOX::et_w_moveFrom:
{
OOX::Logic::CMoveFrom* pMoveFrom = static_cast<OOX::Logic::CMoveFrom*>(item);
nCurPos = m_oBcw.WriteItemStart(c_oSerParType::MoveFrom);
WriteMoveFrom(*pMoveFrom);
m_oBcw.WriteItemEnd(nCurPos);
break;
}
case OOX::et_w_moveTo:
{
OOX::Logic::CMoveTo* pMoveTo = static_cast<OOX::Logic::CMoveTo*>(item);
nCurPos = m_oBcw.WriteItemStart(c_oSerParType::MoveTo);
WriteMoveTo(*pMoveTo);
m_oBcw.WriteItemEnd(nCurPos);
break;
}
case OOX::et_w_commentRangeStart:
{
OOX::Logic::CCommentRangeStart* pCommentRangeStart = static_cast<OOX::Logic::CCommentRangeStart*>(item);
@ -3241,6 +3273,39 @@ namespace BinDocxRW
WriteComment(OOX::et_w_commentRangeEnd, pCommentRangeEnd->m_oId);
break;
}
//todo moveRange on all levels(body, p ...)
// case OOX::et_w_moveFromRangeStart:
// {
// OOX::Logic::CMoveFromRangeStart* pMoveFromRangeStart = static_cast<OOX::Logic::CMoveFromRangeStart*>(item);
// nCurPos = m_oBcw.WriteItemStart(c_oSerParType::MoveFromRangeStart);
// WriteMoveRangeStart(*pMoveFromRangeStart);
// m_oBcw.WriteItemEnd(nCurPos);
// break;
// }
// case OOX::et_w_moveFromRangeEnd:
// {
// OOX::Logic::CMoveFromRangeEnd* pMoveFromRangeEnd = static_cast<OOX::Logic::CMoveFromRangeEnd*>(item);
// nCurPos = m_oBcw.WriteItemStart(c_oSerParType::MoveFromRangeEnd);
// WriteMoveRangeEnd(*pMoveFromRangeEnd);
// m_oBcw.WriteItemEnd(nCurPos);
// break;
// }
// case OOX::et_w_moveToRangeStart:
// {
// OOX::Logic::CMoveToRangeStart* pMoveToRangeStart = static_cast<OOX::Logic::CMoveToRangeStart*>(item);
// nCurPos = m_oBcw.WriteItemStart(c_oSerParType::MoveToRangeStart);
// WriteMoveRangeStart(*pMoveToRangeStart);
// m_oBcw.WriteItemEnd(nCurPos);
// break;
// }
// case OOX::et_w_moveToRangeEnd:
// {
// OOX::Logic::CMoveToRangeEnd* pMoveToRangeEnd = static_cast<OOX::Logic::CMoveToRangeEnd*>(item);
// nCurPos = m_oBcw.WriteItemStart(c_oSerParType::MoveToRangeEnd);
// WriteMoveRangeEnd(*pMoveToRangeEnd);
// m_oBcw.WriteItemEnd(nCurPos);
// break;
// }
case OOX::et_m_oMathPara:
{
OOX::Logic::COMathPara* pOMathPara = static_cast<OOX::Logic::COMathPara*>(item);
@ -3280,6 +3345,92 @@ namespace BinDocxRW
WriteParagraphContent(oIns.m_arrItems);
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
void WriteMoveFrom(const OOX::Logic::CMoveFrom& oMoveFrom)
{
int nCurPos = 0;
m_oBcw.WriteTrackRevision(oMoveFrom);
nCurPos = m_oBcw.WriteItemStart(c_oSerProp_RevisionType::Content);
WriteParagraphContent(oMoveFrom.m_arrItems);
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
void WriteMoveTo(const OOX::Logic::CMoveTo& oMoveTo)
{
int nCurPos = 0;
m_oBcw.WriteTrackRevision(oMoveTo);
nCurPos = m_oBcw.WriteItemStart(c_oSerProp_RevisionType::Content);
WriteParagraphContent(oMoveTo.m_arrItems);
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
template<typename T> void WriteMoveRangeStart(const T& elem)
{
int nCurPos = 0;
if (elem.m_sAuthor.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerMoveRange::Author);
m_oBcw.m_oStream.WriteStringW3(elem.m_sAuthor.get());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
if (elem.m_oColFirst.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerMoveRange::ColFirst);
m_oBcw.m_oStream.WriteLONG(elem.m_oColFirst->GetValue());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
if (elem.m_oColLast.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerMoveRange::ColLast);
m_oBcw.m_oStream.WriteLONG(elem.m_oColLast->GetValue());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
if (elem.m_oDate.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerMoveRange::Date);
m_oBcw.m_oStream.WriteStringW3(elem.m_oDate->ToString());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
if (elem.m_oDisplacedByCustomXml.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerMoveRange::DisplacedByCustomXml);
m_oBcw.m_oStream.WriteBYTE(elem.m_oDisplacedByCustomXml->GetValue());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
if (elem.m_oId.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerMoveRange::Id);
m_oBcw.m_oStream.WriteLONG(elem.m_oId->GetValue());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
if (elem.m_sName.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerMoveRange::Name);
m_oBcw.m_oStream.WriteStringW3(elem.m_sName.get());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
if (elem.m_sUserId.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerMoveRange::UserId);
m_oBcw.m_oStream.WriteStringW3(elem.m_sUserId.get());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
}
template<typename T> void WriteMoveRangeEnd(const T& elem)
{
int nCurPos = 0;
if (elem.m_oDisplacedByCustomXml.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerMoveRange::DisplacedByCustomXml);
m_oBcw.m_oStream.WriteBYTE(elem.m_oDisplacedByCustomXml->GetValue());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
if (elem.m_oId.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerMoveRange::Id);
m_oBcw.m_oStream.WriteLONG(elem.m_oId->GetValue());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
}
void WriteComment(OOX::EElementType eType, nullable<SimpleTypes::CDecimalNumber<>>& oId)
{
int nCurPos = 0;

View File

@ -96,7 +96,9 @@ public:
if (bResult == false)
{
delete pInfo;
continue;
if (pInfo->m_bEncrypt) return false;
else continue;
}
m_arUsers.push_back(pInfo);

View File

@ -198,7 +198,6 @@ void CPPTFileReader::ReadEncryptedSummary()
if (!pStream) return;
SRecordHeader oHeader;
ULONG nRd = 0;
if (oHeader.ReadFromStream(pStream) == false )
{
@ -224,12 +223,11 @@ void CPPTFileReader::ReadDocumentSummary()
void CPPTFileReader::ReadPictures()
{
if (m_oDocumentInfo.m_arUsers.empty()) return;
CFStreamPtr pStream = GetPictureStream();
if (!pStream) return;
SRecordHeader oHeader;
ULONG nRd = 0;
CRYPT::ECMADecryptor *pDecryptor = m_oDocumentInfo.m_arUsers[0]->m_pDecryptor;
while (true)
@ -237,33 +235,34 @@ void CPPTFileReader::ReadPictures()
if (pStream->isEOF())
break;
int pos = pStream->getStreamPointer();
int pos = pStream->getStreamPointer();
POLE::Stream * pStreamTmp = pStream->stream_;
SRecordHeader oHeader;
if (pDecryptor)
{
m_oDocumentInfo.m_arUsers[0]->DecryptStream(pStreamTmp, 0);
pStreamTmp = m_oDocumentInfo.m_arUsers[0]->m_arStreamDecrypt.back()->stream_;
BYTE pHeader[8];
pStream->read(pHeader, 8);
pDecryptor->Decrypt((char*)pHeader, 8, 0);
unsigned short rec =0;
memcpy(&rec, pHeader + 0, 2);
memcpy(&oHeader.RecType,pHeader + 2, 2);
memcpy(&oHeader.RecLen, pHeader + 4, 4);
}
oHeader.ReadFromStream(pStreamTmp);
pStream->seekFromBegin(pos + 8);
oHeader.RecInstance = rec >> 4;
oHeader.RecVersion = rec - (oHeader.RecInstance << 4);
}
else
oHeader.ReadFromStream(pStream->stream_);
CRecordOfficeArtBlip art_blip;
art_blip.m_strTmpDirectory = m_strTmpDirectory;
art_blip.m_oDocumentInfo = &m_oDocumentInfo;
pStreamTmp = pStream->stream_;
if (pDecryptor)
{
m_oDocumentInfo.m_arUsers[0]->DecryptStream(pStreamTmp, 1);
pStreamTmp = m_oDocumentInfo.m_arUsers[0]->m_arStreamDecrypt.back()->stream_;
}
art_blip.ReadFromStream(oHeader, pStreamTmp);
pStream->seekFromBegin(pos + oHeader.RecLen + 8);
art_blip.ReadFromStream(oHeader, pStream->stream_);
m_oDocumentInfo.m_mapStoreImageFile[ pos ] = art_blip.m_sFileName;
pStream->seekFromBegin(pos + oHeader.RecLen + 8);
}
}

View File

@ -33,8 +33,10 @@
#include "ReadStructures.h"
#include <zlib.h>
#include "../../../ASCOfficeDocFile/DocDocxConverter/MemoryStream.h"
#include "../../../OfficeCryptReader/source/CryptTransform.h"
#include <zlib.h>
using namespace NSPresentationEditor;
@ -639,22 +641,31 @@ namespace NSPresentationEditor
}
}
//------------------------------------------------------------------------------------
void CMetaHeader::FromStream(POLE::Stream* pStream)
void CMetaHeader::FromStream(POLE::Stream* pStream, CRYPT::ECMADecryptor *pDecryptor)
{
cbSize = StreamUtils::ReadDWORD(pStream);
BYTE pData[34];
pStream->read(pData, 34);
rcBounds.left = StreamUtils::ReadLONG(pStream);
rcBounds.top = StreamUtils::ReadLONG(pStream);
rcBounds.right = StreamUtils::ReadLONG(pStream);
rcBounds.bottom = StreamUtils::ReadLONG(pStream);
if (pDecryptor)
{
pDecryptor->Decrypt((char*)pData, 34, 0);
}
MemoryStream memStream(pData, 34, false);
ptSize.x = StreamUtils::ReadLONG(pStream);
ptSize.y = StreamUtils::ReadLONG(pStream);
cbSize = memStream.ReadUInt32();
rcBounds.left = memStream.ReadInt32();
rcBounds.top = memStream.ReadInt32();
rcBounds.right = memStream.ReadInt32();
rcBounds.bottom = memStream.ReadInt32();
cbSave = StreamUtils::ReadDWORD(pStream);
ptSize.x = memStream.ReadInt32();
ptSize.y = memStream.ReadInt32();
compression = StreamUtils::ReadBYTE(pStream);
filter = StreamUtils::ReadBYTE(pStream);
cbSave = memStream.ReadUInt32();
compression = memStream.ReadByte();
filter = memStream.ReadByte();
}
void CMetaHeader::ToEMFHeader(Gdiplus::ENHMETAHEADER3* pHeader)

View File

@ -43,6 +43,10 @@ namespace NSZLib
bool Decompress(const BYTE* pSrcBuffer, const ULONG& lSrcBufferLen,
BYTE* pDstBuffer, ULONG& lDstBufferLen);
}
namespace CRYPT
{
class ECMADecryptor;
}
/**************************************************************
теперь все структуры...
которые участвуют в записях
@ -90,11 +94,11 @@ struct SFileIdCluster
}
};
#if !defined(_WIN32) && !defined (_WIN64)
typedef struct tagPOINT
{
long x;
long y;
} POINT;
typedef struct tagPOINT
{
long x;
long y;
} POINT;
typedef struct tagSIZE
{
@ -170,7 +174,7 @@ public:
CMetaHeader()
{
}
void FromStream(POLE::Stream* pStream);
void FromStream(POLE::Stream* pStream, CRYPT::ECMADecryptor *pDecryptor = NULL);
void ToEMFHeader (Gdiplus::ENHMETAHEADER3* pHeader);
void ToWMFHeader (Gdiplus::WmfPlaceableFileHeader* pHeader);

View File

@ -165,6 +165,8 @@ public:
case 0x6801:
crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::RC4;
crypt_data_aes.keySize = KeySize / 8;
if (crypt_data_aes.keySize == 0)
crypt_data_aes.keySize = 5; // 40 bit
break;
case 0x660E:
crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::AES_ECB;

View File

@ -39,191 +39,198 @@
void CRecordOfficeArtBlip::ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
CMetaFileBuffer oMetaFile;
if ((oHeader.RecVersion == PSFLAG_CONTAINER) || ((oHeader.RecVersion & 0x0F) == 0x0F)) return;
CRYPT::ECMADecryptor *pDecryptor = m_oDocumentInfo ? m_oDocumentInfo->m_arUsers[0]->m_pDecryptor : NULL;
CMetaFileBuffer oMetaFile;
std::wstring sExt = L".jpg";
int lOffset = 0;
int pos = pStream->tell();
if ((oHeader.RecVersion != PSFLAG_CONTAINER) && ((oHeader.RecVersion & 0x0F) != 0x0F))
switch (oHeader.RecType)
{
int lOffset = 0;
switch (oHeader.RecType)
case RECORD_TYPE_ESCHER_BLIP_EMF:
{
case RECORD_TYPE_ESCHER_BLIP_EMF:
{
if (0x03D4 == oHeader.RecInstance) lOffset = 16;
else if (0x03D5 == oHeader.RecInstance) lOffset = 32;
if (0x03D4 == oHeader.RecInstance) lOffset = 16;
else if (0x03D5 == oHeader.RecInstance) lOffset = 32;
StreamUtils::StreamSkip(lOffset, pStream);
lOffset += 34;
StreamUtils::StreamSkip(lOffset, pStream);
lOffset += 34;
oMetaFile.m_bIsValid = TRUE;
oMetaFile.m_sExtension = L".emf";
CMetaHeader oMetaHeader;
oMetaHeader.FromStream(pStream);
Gdiplus::ENHMETAHEADER3 oEmfHeader;
oMetaHeader.ToEMFHeader(&oEmfHeader);
oMetaFile.SetHeader(NULL, 0);
BYTE* pData = new BYTE[oHeader.RecLen - lOffset];
pStream->read(pData, oHeader.RecLen - lOffset);
oMetaFile.SetData(pData, oMetaHeader.cbSave, oMetaHeader.cbSize, (bool)(oMetaHeader.compression != 0xFE) );
}break;
case RECORD_TYPE_ESCHER_BLIP_WMF:
{
if (0x0216 == oHeader.RecInstance) lOffset = 16;
else if (0x0217 == oHeader.RecInstance) lOffset = 32;
StreamUtils::StreamSkip(lOffset, pStream);
lOffset += 34;
oMetaFile.m_bIsValid = TRUE;
oMetaFile.m_sExtension = L".wmf";
CMetaHeader oMetaHeader;
oMetaHeader.FromStream(pStream);
Gdiplus::WmfPlaceableFileHeader oWmfHeader;
oMetaHeader.ToWMFHeader(&oWmfHeader);
LONG lLenHeader = 22;
BYTE* pMetaHeader = new BYTE[lLenHeader]; // удалится в oMetaFile
memcpy(pMetaHeader, (void*)(&oWmfHeader), lLenHeader);
oMetaFile.SetHeader(pMetaHeader, lLenHeader);
BYTE* pData = new BYTE[oHeader.RecLen - lOffset];
pStream->read(pData, oHeader.RecLen - lOffset);
oMetaFile.SetData(pData, oMetaHeader.cbSave, oMetaHeader.cbSize, (bool)(oMetaHeader.compression != 0xFE) );
}break;
case RECORD_TYPE_ESCHER_BLIP_PICT://Medwoche.ppt , (483)
{
if (0x0542 == oHeader.RecInstance) lOffset = 16;
else if (0x0543 == oHeader.RecInstance) lOffset = 32;
StreamUtils::StreamSkip(lOffset, pStream);
lOffset += 34;
oMetaFile.m_bIsValid = TRUE;
oMetaFile.m_sExtension = L".wmf";//L".pct"; - ВРЕМЕННО пока не сделана конвертация pct(pic) хоть во что нито !!!
CMetaHeader oMetaHeader;
oMetaHeader.FromStream(pStream); //отдельно вынесенный заголовок.. "форматный" находится в блоке данных
BYTE* pData = new BYTE[oHeader.RecLen - lOffset];
pStream->read(pData, oHeader.RecLen - lOffset);
oMetaFile.SetData(pData, oMetaHeader.cbSave, oMetaHeader.cbSize, (bool)(oMetaHeader.compression != 0xFE) );
}break;
case RECORD_TYPE_ESCHER_BLIP_JPEG:
{
if (0x046A == oHeader.RecInstance || 0x06E2 == oHeader.RecInstance) lOffset = 17;
else if (0x046B == oHeader.RecInstance || 0x06E3 == oHeader.RecInstance) lOffset = 33;
//StreamUtils::StreamSkip(lOffset, pStream);
std::string str = StreamUtils::ReadStringA(pStream, lOffset);
sExt = _T(".jpg");
break;
}
case RECORD_TYPE_ESCHER_BLIP_PNG:
{
if (0x06E0 == oHeader.RecInstance) lOffset = 17;
else if (0x06E1 == oHeader.RecInstance) lOffset = 33;
//StreamUtils::StreamSkip(lOffset, pStream);
std::string str = StreamUtils::ReadStringA(pStream, lOffset);
sExt = _T(".png");
break;
}
case RECORD_TYPE_ESCHER_BLIP_DIB:
{
if (0x07A8 == oHeader.RecInstance) lOffset = 17;
else if (0x07A9 == oHeader.RecInstance) lOffset = 33;
StreamUtils::StreamSkip(lOffset, pStream);
oMetaFile.m_bIsValid = TRUE;
oMetaFile.m_sExtension = L".emf";
sExt = _T(".bmp");
break;
}
case RECORD_TYPE_ESCHER_BLIP_TIFF:
CMetaHeader oMetaHeader;
oMetaHeader.FromStream(pStream, pDecryptor);
Gdiplus::ENHMETAHEADER3 oEmfHeader;
oMetaHeader.ToEMFHeader(&oEmfHeader);
oMetaFile.SetHeader(NULL, 0);
BYTE* pData = new BYTE[oHeader.RecLen - lOffset];
pStream->read(pData, oHeader.RecLen - lOffset);
if (pDecryptor)
{
if (0x06E4 == oHeader.RecInstance) lOffset = 17;
else if (0x06E5 == oHeader.RecInstance) lOffset = 33;
StreamUtils::StreamSkip(lOffset, pStream);
sExt = _T(".tif");
break;
pDecryptor->Decrypt((char*)pData, oHeader.RecLen - lOffset, 0);
}
default:
oMetaFile.SetData(pData, oMetaHeader.cbSave, oMetaHeader.cbSize, (bool)(oMetaHeader.compression != 0xFE) );
}break;
case RECORD_TYPE_ESCHER_BLIP_WMF:
{
if (0x0216 == oHeader.RecInstance) lOffset = 16;
else if (0x0217 == oHeader.RecInstance) lOffset = 32;
StreamUtils::StreamSkip(lOffset, pStream);
lOffset += 34;
oMetaFile.m_bIsValid = TRUE;
oMetaFile.m_sExtension = L".wmf";
CMetaHeader oMetaHeader;
oMetaHeader.FromStream(pStream, pDecryptor);
Gdiplus::WmfPlaceableFileHeader oWmfHeader;
oMetaHeader.ToWMFHeader(&oWmfHeader);
LONG lLenHeader = 22;
BYTE* pMetaHeader = new BYTE[lLenHeader]; // удалится в oMetaFile
memcpy(pMetaHeader, (void*)(&oWmfHeader), lLenHeader);
oMetaFile.SetHeader(pMetaHeader, lLenHeader);
BYTE* pData = new BYTE[oHeader.RecLen - lOffset];
pStream->read(pData, oHeader.RecLen - lOffset);
if (pDecryptor)
{
break;
pDecryptor->Decrypt((char*)pData, oHeader.RecLen - lOffset, 0);
}
}
int nImagesCount = 0;
if (m_oDocumentInfo)
{
nImagesCount = m_oDocumentInfo->m_mapStoreImageFile.size();
}
//else nImagesCount = generate uniq name
oMetaFile.SetData(pData, oMetaHeader.cbSave, oMetaHeader.cbSize, (bool)(oMetaHeader.compression != 0xFE) );
if (oMetaFile.m_bIsValid)
}break;
case RECORD_TYPE_ESCHER_BLIP_PICT://Medwoche.ppt , (483)
{
std::wstring strFile = L"Image " +std::to_wstring(nImagesCount + 1) + oMetaFile.m_sExtension;
if (0x0542 == oHeader.RecInstance) lOffset = 16;
else if (0x0543 == oHeader.RecInstance) lOffset = 32;
CFile fileMeta;
HRESULT hr = fileMeta.CreateFile(m_strTmpDirectory + FILE_SEPARATOR_STR + strFile);
StreamUtils::StreamSkip(lOffset, pStream);
lOffset += 34;
oMetaFile.m_bIsValid = TRUE;
oMetaFile.m_sExtension = L".wmf";//L".pct"; - ВРЕМЕННО пока не сделана конвертация pct(pic) хоть во что нито !!!
CMetaHeader oMetaHeader;
oMetaHeader.FromStream(pStream, pDecryptor); //отдельно вынесенный заголовок.. "форматный" находится в блоке данных
BYTE* pData = new BYTE[oHeader.RecLen - lOffset];
pStream->read(pData, oHeader.RecLen - lOffset);
if (pDecryptor)
{
pDecryptor->Decrypt((char*)pData, oHeader.RecLen - lOffset, 0);
}
oMetaFile.SetData(pData, oMetaHeader.cbSave, oMetaHeader.cbSize, (bool)(oMetaHeader.compression != 0xFE) );
}break;
case RECORD_TYPE_ESCHER_BLIP_JPEG:
{
if (0x046A == oHeader.RecInstance || 0x06E2 == oHeader.RecInstance) lOffset = 17;
else if (0x046B == oHeader.RecInstance || 0x06E3 == oHeader.RecInstance) lOffset = 33;
StreamUtils::StreamSkip(lOffset, pStream);
sExt = _T(".jpg");
break;
}
case RECORD_TYPE_ESCHER_BLIP_PNG:
{
if (0x06E0 == oHeader.RecInstance) lOffset = 17;
else if (0x06E1 == oHeader.RecInstance) lOffset = 33;
StreamUtils::StreamSkip(lOffset, pStream);
sExt = _T(".png");
break;
}
case RECORD_TYPE_ESCHER_BLIP_DIB:
{
if (0x07A8 == oHeader.RecInstance) lOffset = 17;
else if (0x07A9 == oHeader.RecInstance) lOffset = 33;
StreamUtils::StreamSkip(lOffset, pStream);
if (hr == S_OK)
{
oMetaFile.ToFile(&fileMeta);
fileMeta.CloseFile();
}
m_sFileName = strFile;
sExt = _T(".bmp");
break;
}
else
case RECORD_TYPE_ESCHER_BLIP_TIFF:
{
BYTE* pImage = new BYTE[oHeader.RecLen - lOffset];
if (0x06E4 == oHeader.RecInstance) lOffset = 17;
else if (0x06E5 == oHeader.RecInstance) lOffset = 33;
pStream->read(pImage, oHeader.RecLen - lOffset);
std::wstring strFile = L"Image " + std::to_wstring(nImagesCount + 1) + sExt;
StreamUtils::StreamSkip(lOffset, pStream);
CFile fileImage;
HRESULT hr = fileImage.CreateFile(m_strTmpDirectory + FILE_SEPARATOR_STR + strFile);
if (hr == S_OK)
{
if (RECORD_TYPE_ESCHER_BLIP_DIB == oHeader.RecType)
{
WORD vtType = 0x4D42;
fileImage.WriteFile((void*)&vtType, 2);
DWORD dwLen = oHeader.RecLen - lOffset;
fileImage.WriteFile((void*)&dwLen, 4);
DWORD dwRes = 0;
fileImage.WriteFile((void*)&dwRes, 4);
DWORD dwOffset = 2;
fileImage.WriteFile((void*)&dwOffset, 4);
}
fileImage.WriteFile((void*)pImage, oHeader.RecLen - lOffset);
fileImage.CloseFile();
}
if (pImage)delete[] pImage;
pImage = NULL;
m_sFileName = strFile;
sExt = _T(".tif");
break;
}
default:
{
break;
}
}
int nImagesCount = 0;
if (m_oDocumentInfo)
{
nImagesCount = m_oDocumentInfo->m_mapStoreImageFile.size();
}
//else nImagesCount = generate uniq name
if (oMetaFile.m_bIsValid)
{
std::wstring strFile = L"Image " +std::to_wstring(nImagesCount + 1) + oMetaFile.m_sExtension;
CFile fileMeta;
HRESULT hr = fileMeta.CreateFile(m_strTmpDirectory + FILE_SEPARATOR_STR + strFile);
if (hr == S_OK)
{
oMetaFile.ToFile(&fileMeta);
fileMeta.CloseFile();
}
m_sFileName = strFile;
}
else
{
BYTE* pImage = new BYTE[oHeader.RecLen - lOffset];
pStream->read(pImage, oHeader.RecLen - lOffset);
if (pDecryptor)
{
pDecryptor->Decrypt((char*)pImage, oHeader.RecLen - lOffset, 0);
}
std::wstring strFile = L"Image " + std::to_wstring(nImagesCount + 1) + sExt;
CFile fileImage;
HRESULT hr = fileImage.CreateFile(m_strTmpDirectory + FILE_SEPARATOR_STR + strFile);
if (hr == S_OK)
{
if (RECORD_TYPE_ESCHER_BLIP_DIB == oHeader.RecType)
{
WORD vtType = 0x4D42;
fileImage.WriteFile((void*)&vtType, 2);
DWORD dwLen = oHeader.RecLen - lOffset;
fileImage.WriteFile((void*)&dwLen, 4);
DWORD dwRes = 0;
fileImage.WriteFile((void*)&dwRes, 4);
DWORD dwOffset = 2;
fileImage.WriteFile((void*)&dwOffset, 4);
}
fileImage.WriteFile((void*)pImage, oHeader.RecLen - lOffset);
fileImage.CloseFile();
}
if (pImage)delete[] pImage;
pImage = NULL;
m_sFileName = strFile;
}
}

View File

@ -70,10 +70,10 @@ CFRecord::CFRecord(CFStreamPtr stream, GlobalWorkbookInfoPtr global_info)
case rt_RRDHead:
break;
case rt_BoundSheet8:
global_info->decryptor->Decrypt(data_ + sizeof(unsigned int), size_ - sizeof(unsigned int), rec_data_pos + sizeof(unsigned int));
global_info->decryptor->Decrypt(data_ + sizeof(unsigned int), size_ - sizeof(unsigned int), rec_data_pos + sizeof(unsigned int), 1024);
break;
default:
global_info->decryptor->Decrypt(data_, size_, rec_data_pos);
global_info->decryptor->Decrypt(data_, size_, rec_data_pos, 1024);
break;
}
}

View File

@ -34,10 +34,8 @@
namespace CRYPT
{
BiffDecoderBase::BiffDecoderBase(int BLOCKSIZE) : mbValid(false)
BiffDecoderBase::BiffDecoderBase() : mbValid(false)
{
RCF_BLOCKSIZE = BLOCKSIZE;
}
@ -51,34 +49,29 @@ bool BiffDecoderBase::verifyPassword(const std::wstring& rPassword)
mbValid = implVerify(rPassword);
return mbValid;
}
void BiffDecoderBase::decode(unsigned char* pnDestData, const unsigned char* pnSrcData, const long nStreamPos, const unsigned short nBytes)
void BiffDecoderBase::decode(unsigned char* pnDestData, const unsigned char* pnSrcData, const unsigned short nBytes, const long block_index)
{
if(pnDestData && pnSrcData && (nBytes> 0))
{
if(mbValid)
implDecode(pnDestData, pnSrcData, nStreamPos, nBytes);
implDecode(pnDestData, pnSrcData, nBytes, block_index);
else
memcpy(pnDestData, pnSrcData, nBytes);
}}
void BiffDecoderBase::decode(unsigned char* pnDestData, const unsigned char* pnSrcData, const unsigned short nBytes, const long nStreamPos, const unsigned short block_size)
{
if(pnDestData && pnSrcData && (nBytes> 0))
{
if(mbValid)
implDecode(pnDestData, pnSrcData, nBytes, nStreamPos, block_size);
else
memcpy(pnDestData, pnSrcData, nBytes);
}
}
/** Returns the block index of the passed stream position for RCF decryption. */
int BiffDecoderBase::lclGetRcfBlock(long nStreamPos)
{
return static_cast<int>(nStreamPos / RCF_BLOCKSIZE);
}
/** Returns the offset of the passed stream position in a block for RCF decryption. */
int BiffDecoderBase::lclGetRcfOffset(long nStreamPos)
{
return static_cast<int>(nStreamPos % RCF_BLOCKSIZE);
}
BiffDecoder_RCF::BiffDecoder_RCF(unsigned char pnSalt[16], unsigned char pnVerifier[16], unsigned char pnVerifierHash[16], int BlockSize)
: BiffDecoderBase(BlockSize),
BiffDecoder_RCF::BiffDecoder_RCF(unsigned char pnSalt[16], unsigned char pnVerifier[16], unsigned char pnVerifierHash[16])
:
maPassword(16, 0),
maSalt(pnSalt, pnSalt + 16),
maVerifier(pnVerifier, pnVerifier + 16),
@ -107,28 +100,37 @@ bool BiffDecoder_RCF::implVerify(const std::wstring& rPassword)
}
return false;
}
void BiffDecoder_RCF::implDecode(unsigned char* pnDestData, const unsigned char* pnSrcData, const long nStreamPos, const unsigned short nBytes)
void BiffDecoder_RCF::implDecode(unsigned char* pnDestData, const unsigned char* pnSrcData, const unsigned short nBytes, const long block_index)
{
unsigned char* pnCurrDest = pnDestData;
const unsigned char* pnCurrSrc = pnSrcData;
long nCurrPos = nStreamPos;
unsigned short nBytesLeft = nBytes;
while(nBytesLeft> 0)
maCodec.startBlock(block_index);
maCodec.decode(pnDestData, pnSrcData, static_cast<int>(nBytes));
}
void BiffDecoder_RCF::implDecode(unsigned char* pnDestData, const unsigned char* pnSrcData, const unsigned short nBytes, const long nStreamPos, const unsigned short block_size)
{
unsigned char* pnCurrDest = pnDestData;
const unsigned char* pnCurrSrc = pnSrcData;
long nCurrPos = nStreamPos;
unsigned short nBytesLeft = nBytes;
while(nBytesLeft > 0)
{
// initialize codec for current stream position
maCodec.startBlock(lclGetRcfBlock(nCurrPos));
maCodec.skip(lclGetRcfOffset(nCurrPos));
maCodec.startBlock (nCurrPos / block_size);
const long offset = nCurrPos % block_size;
maCodec.skip (offset);
// decode the block
unsigned short nBlockLeft = static_cast<unsigned short>(get_BLOCKSIZE() - lclGetRcfOffset(nCurrPos));
unsigned short nBlockLeft = static_cast<unsigned short>(block_size - offset);
unsigned short nDecBytes = nBytesLeft < nBlockLeft ? nBytesLeft : nBlockLeft;
maCodec.decode(pnCurrDest, pnCurrSrc, static_cast<int>(nDecBytes));
// prepare for next block
pnCurrDest += nDecBytes;
pnCurrSrc += nDecBytes;
nCurrPos += nDecBytes;
pnCurrDest += nDecBytes;
pnCurrSrc += nDecBytes;
nCurrPos += nDecBytes;
nBytesLeft = nBytesLeft - nDecBytes;
}
}

View File

@ -44,12 +44,10 @@ namespace CRYPT
class BiffDecoderBase
{
public:
explicit BiffDecoderBase(int BLOCKSIZE);
explicit BiffDecoderBase();
virtual ~BiffDecoderBase();
int get_BLOCKSIZE(){return RCF_BLOCKSIZE;}
/** Implementation of the ::comphelper::IDocPasswordVerifier interface,
/** Implementation of the ::comphelper::IDocPasswordVerifier interface,
calls the new virtual function implVerify(). */
virtual bool verifyPassword( const std::wstring& rPassword );
@ -57,21 +55,18 @@ public:
inline bool isValid() const { return mbValid; }
/** Decodes nBytes unsigned chars and writes encrypted data into the buffer pnDestData. */
void decode(unsigned char* pnDestData, const unsigned char* pnSrcData, const long nStreamPos, const unsigned short nBytes);
int lclGetRcfBlock(long nStreamPos);
int lclGetRcfOffset(long nStreamPos);
virtual void decode(unsigned char* pnDestData, const unsigned char* pnSrcData, const unsigned short nBytes, const long nStreamPos, const unsigned short block_size);
virtual void decode(unsigned char* pnDestData, const unsigned char* pnSrcData, const unsigned short nBytes, const long block_index);
private:
int RCF_BLOCKSIZE;
/** Derived classes implement password verification and initialization of
the decoder. */
virtual bool implVerify(const std::wstring& rPassword) = 0;
/** Implementation of decryption of a memory block. */
virtual void implDecode(unsigned char* pnDestData, const unsigned char* pnSrcData, const long nStreamPos, const unsigned short nBytes) = 0;
virtual void implDecode(unsigned char* pnDestData, const unsigned char* pnSrcData, const unsigned short nBytes, const long nStreamPos, const unsigned short block_size) = 0;
virtual void implDecode(unsigned char* pnDestData, const unsigned char* pnSrcData, const unsigned short nBytes, const long block_index) = 0;
private:
bool mbValid; /// True = decoder is correctly initialized.
@ -83,7 +78,7 @@ typedef ::boost::shared_ptr<BiffDecoderBase> BiffDecoderRef;
class BiffDecoder_RCF : public BiffDecoderBase
{
public:
explicit BiffDecoder_RCF(unsigned char pnSalt[ 16 ], unsigned char pnVerifier[ 16 ], unsigned char pnVerifierHash[ 16 ], int BlockSize);
explicit BiffDecoder_RCF(unsigned char pnSalt[ 16 ], unsigned char pnVerifier[ 16 ], unsigned char pnVerifierHash[ 16 ]);
private:
@ -91,14 +86,14 @@ private:
virtual bool implVerify(const std::wstring& rPassword);
/** Implementation of decryption of a memory block. */
virtual void implDecode(unsigned char* pnDestData, const unsigned char* pnSrcData, const long nStreamPos, const unsigned short nBytes);
virtual void implDecode(unsigned char* pnDestData, const unsigned char* pnSrcData, const unsigned short nBytes, const long nStreamPos, const unsigned short block_size);
virtual void implDecode(unsigned char* pnDestData, const unsigned char* pnSrcData, const unsigned short nBytes, const long block_index);
private:
BinaryCodec_RCF maCodec; /// Cipher algorithm implementation.
BinaryCodec_RCF maCodec; /// Cipher algorithm implementation.
std::vector<unsigned short> maPassword;
std::vector<unsigned char> maSalt;
std::vector<unsigned char> maVerifier;
std::vector<unsigned char> maVerifierHash;
std::vector<unsigned char> maSalt;
std::vector<unsigned char> maVerifier;
std::vector<unsigned char> maVerifierHash;
};

View File

@ -143,7 +143,7 @@ public:
private:
CipherARCFOUR mhCipher;
DigestMD5 mhDigest;
unsigned char mpnDigestValue[DigestMD5::RTL_DIGEST_LENGTH_MD5];
unsigned char mpnDigestValue[DigestMD5::RTL_DIGEST_LENGTH_MD5];
};

View File

@ -68,8 +68,8 @@ namespace CRYPT
{
public:
virtual void Encrypt(char* data, const size_t size) = 0;
virtual void Decrypt(char* data, const size_t size, const unsigned long stream_pos) = 0;
virtual void Decrypt(char* data, const size_t size, const unsigned long stream_pos, const size_t block_size) = 0;
virtual void Decrypt(char* data, const size_t size, const unsigned long block_index) = 0;
typedef enum
{

View File

@ -37,18 +37,20 @@
namespace CRYPT
{
RC4Decryptor::RC4Decryptor(_rc4CryptData & header, std::wstring _password, int _type) :
crypt(new RC4Crypt(header, _password, _type))
RC4Decryptor::RC4Decryptor(_rc4CryptData & header, std::wstring _password) :
crypt(new RC4Crypt(header, _password))
{
crypt_data = header;
type = _type;
}
void RC4Decryptor::Decrypt(char* data, const size_t size, const unsigned long stream_pos)
void RC4Decryptor::Decrypt(char* data, const size_t size, const unsigned long stream_pos, const size_t block_size)
{
crypt->Decrypt(data, size, stream_pos);
crypt->Decrypt(data, size, stream_pos, block_size);
}
void RC4Decryptor::Decrypt(char* data, const size_t size, const unsigned long block_index)
{
crypt->Decrypt(data, size, block_index);
}
bool RC4Decryptor::IsVerify()
{
return crypt->IsVerify();
@ -57,7 +59,7 @@ namespace CRYPT
bool RC4Decryptor::SetPassword(std::wstring password)
{
crypt.reset();
crypt = CryptPtr(new RC4Crypt(crypt_data, password, type));
crypt = CryptPtr(new RC4Crypt(crypt_data, password));
if (crypt) return crypt->IsVerify();
else return false;

View File

@ -40,15 +40,16 @@ namespace CRYPT
class RC4Decryptor : public Decryptor
{
public:
RC4Decryptor(_rc4CryptData & header, std::wstring password, int type);
RC4Decryptor(_rc4CryptData & header, std::wstring password);
virtual void Decrypt(char* data, const size_t size, const unsigned long stream_pos);
virtual void Decrypt(char* data, const size_t size, const unsigned long stream_pos, const size_t block_size);
virtual void Decrypt(char* data, const size_t size, const unsigned long block_index);
virtual bool SetPassword(std::wstring password);
virtual bool IsVerify();
private:
int type;
CryptPtr crypt;
_rc4CryptData crypt_data;
};

View File

@ -38,7 +38,7 @@
namespace CRYPT
{
RC4Crypt::RC4Crypt(CRYPT::_rc4CryptData & data, std::wstring password, int type)
RC4Crypt::RC4Crypt(CRYPT::_rc4CryptData & data, std::wstring password)
{
m_VerifyPassword = false;
@ -46,18 +46,11 @@ RC4Crypt::RC4Crypt(CRYPT::_rc4CryptData & data, std::wstring password, int type)
CopyDWORDs2Bytes(data.EncryptedVerifier.b1 , data.EncryptedVerifier.b2, data.EncryptedVerifier.b3, data.EncryptedVerifier.b4, pnVerifier);
CopyDWORDs2Bytes(data.EncryptedVerifierHash.b1, data.EncryptedVerifierHash.b2, data.EncryptedVerifierHash.b3, data.EncryptedVerifierHash.b4, pnVerifierHash);
int BlockSize = 1024;
if (type == 1) BlockSize = 512;
mxDecoder.reset(new BiffDecoder_RCF(pnSalt, pnVerifier, pnVerifierHash, BlockSize));
mxDecoder.reset(new BiffDecoder_RCF(pnSalt, pnVerifier, pnVerifierHash));
m_VerifyPassword = mxDecoder->verifyPassword(password);
}
void RC4Crypt::Encrypt(char* data, const size_t size)
{
}
bool RC4Crypt::IsVerify()
{
@ -87,18 +80,33 @@ void RC4Crypt::CopyDWORDs2Bytes(const unsigned int b1, const unsigned int b2, co
byte_array[15] = static_cast<unsigned char>((b4 & 0xff000000) >> 24);
}
void RC4Crypt::Decrypt(char* data, const size_t size, const unsigned long stream_pos)
void RC4Crypt::Decrypt(char* data, const size_t size, const unsigned long block_index)
{
static unsigned char quick_buf[256];
if(size <= 256)
{
mxDecoder->decode( quick_buf, reinterpret_cast<unsigned char*>(data), stream_pos, size );
static unsigned char quick_buf[256];
mxDecoder->decode( quick_buf, reinterpret_cast<unsigned char*>(data), size, block_index );
memcpy(data, quick_buf, size);
}
else
{
boost::scoped_array<unsigned char> out_data(new unsigned char[size]);
mxDecoder->decode( out_data.get(), reinterpret_cast<unsigned char*>(data), stream_pos, size );
mxDecoder->decode( out_data.get(), reinterpret_cast<unsigned char*>(data), size, block_index );
memcpy(data, out_data.get(), size);
}
}
void RC4Crypt::Decrypt(char* data, const size_t size, const unsigned long stream_pos, const size_t block_size)
{
if(size <= 256)
{
static unsigned char quick_buf[256];
mxDecoder->decode( quick_buf, reinterpret_cast<unsigned char*>(data), size, stream_pos, block_size );
memcpy(data, quick_buf, size);
}
else
{
boost::scoped_array<unsigned char> out_data(new unsigned char[size]);
mxDecoder->decode( out_data.get(), reinterpret_cast<unsigned char*>(data), size, stream_pos, block_size );
memcpy(data, out_data.get(), size);
}
}

View File

@ -41,10 +41,10 @@ namespace CRYPT
class RC4Crypt : public Crypt
{
public:
RC4Crypt(CRYPT::_rc4CryptData & data, std::wstring password, int type);
RC4Crypt(CRYPT::_rc4CryptData & data, std::wstring password);
virtual void Encrypt(char* data, const size_t size);
virtual void Decrypt(char* data, const size_t size, const unsigned long stream_pos);
virtual void Decrypt(char* data, const size_t size, const unsigned long stream_pos, const size_t block_size);
virtual void Decrypt(char* data, const size_t size, const unsigned long block_index);
virtual bool IsVerify();

View File

@ -44,7 +44,6 @@ DConName::~DConName()
{
}
BaseObjectPtr DConName::clone()
{
return BaseObjectPtr(new DConName(*this));
@ -52,9 +51,14 @@ BaseObjectPtr DConName::clone()
void DConName::readFields(CFRecord& record)
{
#pragma message("####################### DConName record is not implemented")
Log::error("DConName record is not implemented.");
record >> stName >> cchFile;
if (cchFile > 0 && cchFile < 0xffff)
{
stFile.setSize(cchFile);
record >> stFile;
}
// skip unused
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
}

View File

@ -32,12 +32,11 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/BiffString.h"
namespace XLS
{
// Logical representation of DConName record in BIFF8
class DConName: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(DConName)
@ -47,12 +46,14 @@ public:
~DConName();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeDConName;
XLUnicodeString stName;
unsigned short cchFile;
XLUnicodeStringNoCch stFile;
};
} // namespace XLS

View File

@ -31,6 +31,11 @@
*/
#include "DConn.h"
#include "../Biff_structures/DConnConnectionWeb.h"
#include "../Biff_structures/DConnConnectionOleDb.h"
#include "../Biff_structures/ConnGrbitDbtWeb.h"
#include "../Biff_structures/ConnGrbitDbtOledb.h"
#include "../Biff_structures/ConnGrbitDbtAdo.h"
namespace XLS
{
@ -52,10 +57,65 @@ BaseObjectPtr DConn::clone()
void DConn::readFields(CFRecord& record)
{
#pragma message("####################### DConn record is not implemented")
Log::error("DConn record is not implemented.");
unsigned short flags1, reserved1;
unsigned char flags2, reserved2;
record >> frtHeaderOld >> dbt >> flags1 >> cParams >> reserved1 >> flags2 >> reserved2;
fSavePwd = GETBIT(flags1, 0);
fTablesOnlyHtml = GETBIT(flags1, 1);
fTableNames = GETBIT(flags1, 2);
fDeleted = GETBIT(flags1, 3);
fStandAlone = GETBIT(flags1, 4);
fAlwaysUseConnectionFile = GETBIT(flags1, 5);
fBackgroundQuery= GETBIT(flags1, 6);
fRefreshOnLoad = GETBIT(flags1, 7);
fSaveData = GETBIT(flags1, 8);
fMaintain = GETBIT(flags1, 0);
fNewQuery = GETBIT(flags1, 1);
fImportXmlSource= GETBIT(flags1, 2);
fSPListSrc = GETBIT(flags1, 3);
fSPListReinitCache = GETBIT(flags1, 4);
fSrcIsXml = GETBIT(flags1, 7);
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
switch (dbt)
{
case 4: grbitDbt.reset(new ConnGrbitDbtWeb); break;
case 5: grbitDbt.reset(new ConnGrbitDbtOledb); break;
case 7: grbitDbt.reset(new ConnGrbitDbtAdo); break;
}
if (grbitDbt)
{
record >> *grbitDbt;
}
record >> bVerDbqueryEdit >> bVerDbqueryRefreshed >> bVerDbqueryRefreshableMin >> wRefreshInterval >> wHtmlFmt >> wHtmlFmt >> rcc >> credMethod;
record >> rgchSourceDataFile >> rgchSourceConnectionFile >> rgchConnectionName >> rgchConnectionDesc >> rgchSSOApplicationID >> tableNames;
for ( unsigned short i = 0; i < cParams; i++)
{
DConnParameter val;
params.push_back(val);
}
switch (dbt)
{
case 1: connection.reset(new XLUnicodeStringSegmented); break;
case 4: connection.reset(new DConnConnectionWeb); break;
case 5: connection.reset(new DConnConnectionOleDb); break;
case 6: connection_txtQry.readFields(record); break;
}
if (connection)
record >> *connection;
record >> rgbSQL >> rgbSQLSav >> rgbEditWebPage >> id;
int skip = record.getDataSize() - record.getRdPtr();
record.skipNunBytes(skip);
}
} // namespace XLS

View File

@ -31,13 +31,15 @@
*/
#pragma once
#include "BiffRecord.h"
#include "TxtQry.h"
#include "../Biff_structures/FrtHeaderOld.h"
#include "../Biff_structures/DConnParameter.h"
#include "../Biff_structures/DConnId.h"
#include "../Biff_structures/DConnStringSequence.h"
namespace XLS
{
// Logical representation of DConn record in BIFF8
class DConn: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(DConn)
@ -47,13 +49,54 @@ public:
~DConn();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeDConn;
static const ElementType type = typeDConn;
FrtHeaderOld frtHeaderOld;
unsigned short dbt;
bool fSavePwd;
bool fTablesOnlyHtml;
bool fTableNames;
bool fDeleted;
bool fStandAlone;
bool fAlwaysUseConnectionFile;
bool fBackgroundQuery;
bool fRefreshOnLoad;
bool fSaveData;
unsigned short cParams;
bool fMaintain;
bool fNewQuery;
bool fImportXmlSource;
bool fSPListSrc;
bool fSPListReinitCache;
bool fSrcIsXml;
BiffStructurePtr grbitDbt;
unsigned char bVerDbqueryEdit;
unsigned char bVerDbqueryRefreshed;
unsigned char bVerDbqueryRefreshableMin;
unsigned short wRefreshInterval;
unsigned short wHtmlFmt;
_UINT32 rcc;
unsigned char credMethod;
XLUnicodeStringSegmented rgchSourceDataFile;
XLUnicodeStringSegmented rgchSourceConnectionFile;
XLUnicodeStringSegmented rgchConnectionName;
XLUnicodeStringSegmented rgchConnectionDesc;
XLUnicodeStringSegmented rgchSSOApplicationID;
XLUnicodeStringSegmented tableNames;
std::vector<DConnParameter> params;
BiffStructurePtr connection;
TxtQry connection_txtQry;
DConnStringSequence rgbSQL;
DConnStringSequence rgbSQLSav;
DConnStringSequence rgbEditWebPage;
DConnId id;
};
} // namespace XLS

View File

@ -52,9 +52,9 @@ BaseObjectPtr ExtString::clone()
void ExtString::readFields(CFRecord& record)
{
#pragma message("####################### ExtString record is not implemented")
Log::error("ExtString record is not implemented.");
//record >> some_value;
record >> frtHeaderOld >> string;
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
}
} // namespace XLS

View File

@ -32,12 +32,12 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/BiffString.h"
#include "../Biff_structures/FrtHeaderOld.h"
namespace XLS
{
// Logical representation of ExtString record in BIFF8
class ExtString: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(ExtString)
@ -47,12 +47,13 @@ public:
~ExtString();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeExtString;
static const ElementType type = typeExtString;
FrtHeaderOld frtHeaderOld;
XLUnicodeString string;
};

View File

@ -55,13 +55,14 @@ void ExternName::readFields(CFRecord& record)
{
unsigned short flags;
record >> flags;
fBuiltIn = GETBIT(flags, 0);
fBuiltIn = GETBIT(flags, 0);
fWantAdvise = GETBIT(flags, 1);
fWantPict = GETBIT(flags, 2);
fOle = GETBIT(flags, 3);
fOleLink = GETBIT(flags, 4);
cf = GETBITS(flags, 5, 14);
fIcon = GETBIT(flags, 15);
fWantPict = GETBIT(flags, 2);
fOle = GETBIT(flags, 3);
fOleLink = GETBIT(flags, 4);
cf = GETBITS(flags, 5, 14);
fIcon = GETBIT(flags, 15);
if(0x3A01 == supbook_cch) // UDF reference on a XLL or COM add-in.
{
@ -69,9 +70,6 @@ void ExternName::readFields(CFRecord& record)
}
else
{
#pragma message("####################### ExternName record is not implemented")
Log::error("ExternName record is not implemented.");
if(fOle && !fOleLink) // DDE data item
{
body = BiffStructurePtr(new ExternDdeLinkNoOper);

View File

@ -79,7 +79,7 @@ void FilePass::readFields(CFRecord& record)
if (cryptHeaderPtr->bStandard)
{
record.getGlobalWorkbookInfo()->decryptor =
CRYPT::DecryptorPtr(new CRYPT::RC4Decryptor(cryptHeaderPtr->crypt_data_rc4, record.getGlobalWorkbookInfo()->password, 2));
CRYPT::DecryptorPtr(new CRYPT::RC4Decryptor(cryptHeaderPtr->crypt_data_rc4, record.getGlobalWorkbookInfo()->password));
}
else
{

View File

@ -52,9 +52,7 @@ BaseObjectPtr FnGrp12::clone()
void FnGrp12::readFields(CFRecord& record)
{
record.skipNunBytes(12);
#pragma message(">>>>>>>>>>> frtHeader skipped here")
record >> astFnGrp;
record >> frtHeader >> astFnGrp;
}
} // namespace XLS

View File

@ -32,13 +32,12 @@
#pragma once
#include "BiffRecord.h"
#include <Logic/Biff_structures/BiffString.h>
#include "../Biff_structures/BiffString.h"
#include "../Biff_structures/FrtHeader.h"
namespace XLS
{
// Logical representation of FnGrp12 record in BIFF8
class FnGrp12: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(FnGrp12)
@ -48,14 +47,14 @@ public:
~FnGrp12();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeFnGrp12;
static const ElementType type = typeFnGrp12;
//-----------------------------
XLUnicodeString astFnGrp;
FrtHeader frtHeader;
};

View File

@ -52,11 +52,8 @@ BaseObjectPtr ForceFullCalculation::clone()
void ForceFullCalculation::readFields(CFRecord& record)
{
record.skipNunBytes(12);
#pragma message(">>>>>>>>>>> frtHeader skipped here")
_UINT32 temp;
record >> temp;
record >> frtHeader >> temp;
fNoDeps = temp;
}

View File

@ -32,12 +32,11 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/FrtHeader.h"
namespace XLS
{
// Logical representation of ForceFullCalculation record in BIFF8
class ForceFullCalculation: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(ForceFullCalculation)
@ -51,10 +50,11 @@ public:
void readFields(CFRecord& record);
static const ElementType type = typeForceFullCalculation;
static const ElementType type = typeForceFullCalculation;
//-----------------------------
bool fNoDeps;
bool fNoDeps;
FrtHeader frtHeader;
};

View File

@ -52,10 +52,9 @@ BaseObjectPtr GUIDTypeLib::clone()
void GUIDTypeLib::readFields(CFRecord& record)
{
record.skipNunBytes(12);
#pragma message(">>>>>>>>>>> frtHeader skipped here")
_GUID_ guid_num;
record >> guid_num;
record >> frtHeader >> guid_num;
guid = STR::guid2bstr(guid_num);
}

View File

@ -32,12 +32,11 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/FrtHeader.h"
namespace XLS
{
// Logical representation of GUIDTypeLib record in BIFF8
class GUIDTypeLib: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(GUIDTypeLib)
@ -47,16 +46,14 @@ public:
~GUIDTypeLib();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeGUIDTypeLib;
static const ElementType type = typeGUIDTypeLib;
//-----------------------------
std::wstring guid;
std::wstring guid;
FrtHeader frtHeader;
};
} // namespace XLS

View File

@ -52,8 +52,8 @@ BaseObjectPtr MDB::clone()
void MDB::readFields(CFRecord& record)
{
record.skipNunBytes(12);
#pragma message(">>>>>>>>>>> frtHeader skipped here")
record >> frtHeader;
while(!record.isEOF())
{
MDirPtr element(new MDir);

View File

@ -32,13 +32,12 @@
#pragma once
#include "BiffRecord.h"
#include <Logic/Biff_structures/MDir.h>
#include "../Biff_structures/MDir.h"
#include "../Biff_structures/FrtHeader.h"
namespace XLS
{
// Logical representation of MDB record in BIFF8
class MDB: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(MDB)
@ -48,11 +47,11 @@ public:
~MDB();
BaseObjectPtr clone();
void readFields(CFRecord& record);
//-----------------------------
BiffStructurePtrVector rgmdir;
BiffStructurePtrVector rgmdir;
FrtHeader frtHeader;
};
} // namespace XLS

View File

@ -52,11 +52,9 @@ BaseObjectPtr MDTInfo::clone()
void MDTInfo::readFields(CFRecord& record)
{
record.skipNunBytes(12);
#pragma message(">>>>>>>>>>> frtHeader skipped here")
_UINT32 flags;
record >> flags;
record >> frtHeader >> flags;
fGhostRow = GETBIT(flags, 0);
fGhostCol = GETBIT(flags, 1);

View File

@ -32,13 +32,13 @@
#pragma once
#include "BiffRecord.h"
#include <Logic/Biff_structures/BiffString.h>
#include "../Biff_structures/BiffString.h"
#include "../Biff_structures/FrtHeader.h"
namespace XLS
{
// Logical representation of MDTInfo record in BIFF8
class MDTInfo: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(MDTInfo)
@ -48,7 +48,6 @@ public:
~MDTInfo();
BaseObjectPtr clone();
void readFields(CFRecord& record);
//-----------------------------
@ -79,7 +78,8 @@ public:
bool fAdjust;
bool fCellMeta;
LPWideString stName;
LPWideString stName;
FrtHeader frtHeader;
};

View File

@ -52,9 +52,7 @@ BaseObjectPtr MDXKPI::clone()
void MDXKPI::readFields(CFRecord& record)
{
record.skipNunBytes(12);
#pragma message(">>>>>>>>>>> frtHeader skipped here")
record >> istrConnName >> tfnSrc >> kpiprop >> istrKPIName >> istrMbrKPI;
record >> frtHeader >> istrConnName >> tfnSrc >> kpiprop >> istrKPIName >> istrMbrKPI;
}
} // namespace XLS

View File

@ -32,12 +32,12 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/FrtHeader.h"
namespace XLS
{
// Logical representation of MDXKPI record in BIFF8
class MDXKPI: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(MDXKPI)
@ -47,7 +47,6 @@ public:
~MDXKPI();
BaseObjectPtr clone();
void readFields(CFRecord& record);
//-----------------------------
@ -56,6 +55,7 @@ public:
unsigned char kpiprop;
_INT32 istrKPIName;
_INT32 istrMbrKPI;
FrtHeader frtHeader;
};
} // namespace XLS

View File

@ -50,12 +50,9 @@ BaseObjectPtr MDXProp::clone()
return BaseObjectPtr(new MDXProp(*this));
}
void MDXProp::readFields(CFRecord& record)
{
record.skipNunBytes(12);
#pragma message(">>>>>>>>>>> frtHeader skipped here")
record >> istrConnName >> tfnSrc >> istrMbr >> istrProp;
record >> frtHeader >> istrConnName >> tfnSrc >> istrMbr >> istrProp;
}
} // namespace XLS

View File

@ -32,12 +32,11 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/FrtHeader.h"
namespace XLS
{
// Logical representation of MDXProp record in BIFF8
class MDXProp: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(MDXProp)
@ -47,14 +46,14 @@ public:
~MDXProp();
BaseObjectPtr clone();
void readFields(CFRecord& record);
//-----------------------------
_INT32 istrConnName;
_INT32 istrConnName;
unsigned char tfnSrc;
_UINT32 istrMbr;
_UINT32 istrProp;
_UINT32 istrMbr;
_UINT32 istrProp;
FrtHeader frtHeader;
};

View File

@ -50,12 +50,10 @@ BaseObjectPtr MDXSet::clone()
return BaseObjectPtr(new MDXSet(*this));
}
void MDXSet::readFields(CFRecord& record)
{
record.skipNunBytes(12);
#pragma message(">>>>>>>>>>> frtHeader skipped here")
record >> istrConnName >> tfnSrc >> sso >> istrSetDef >> cistr;
record >> frtHeader >> istrConnName >> tfnSrc >> sso >> istrSetDef >> cistr;
while(!record.isEOF())
{
MDXStrIndexPtr element(new MDXStrIndex);

View File

@ -32,13 +32,12 @@
#pragma once
#include "BiffRecord.h"
#include <Logic/Biff_structures/MDXStrIndex.h>
#include "../Biff_structures/MDXStrIndex.h"
#include "../Biff_structures/FrtHeader.h"
namespace XLS
{
// Logical representation of MDXSet record in BIFF8
class MDXSet: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(MDXSet)
@ -48,16 +47,16 @@ public:
~MDXSet();
BaseObjectPtr clone();
void readFields(CFRecord& record);
//-----------------------------
_INT32 istrConnName;
unsigned char tfnSrc;
unsigned char sso;
_UINT32 istrSetDef;
_INT32 cistr;
BiffStructurePtrVector rgistr;
_INT32 istrConnName;
unsigned char tfnSrc;
unsigned char sso;
_UINT32 istrSetDef;
_INT32 cistr;
BiffStructurePtrVector rgistr;
FrtHeader frtHeader;
};
} // namespace XLS

View File

@ -50,12 +50,9 @@ BaseObjectPtr MDXStr::clone()
return BaseObjectPtr(new MDXStr(*this));
}
void MDXStr::readFields(CFRecord& record)
{
record.skipNunBytes(12);
#pragma message(">>>>>>>>>>> frtHeader skipped here")
record >> st;
record >> frtHeader >> st;
}
} // namespace XLS

View File

@ -32,13 +32,12 @@
#pragma once
#include "BiffRecord.h"
#include <Logic/Biff_structures/BiffString.h>
#include "../Biff_structures/BiffString.h"
#include "../Biff_structures/FrtHeader.h"
namespace XLS
{
// Logical representation of MDXStr record in BIFF8
class MDXStr: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(MDXStr)
@ -52,7 +51,8 @@ public:
void readFields(CFRecord& record);
//-----------------------------
LPWideString st;
LPWideString st;
FrtHeader frtHeader;
};

View File

@ -50,12 +50,10 @@ BaseObjectPtr MDXTuple::clone()
return BaseObjectPtr(new MDXTuple(*this));
}
void MDXTuple::readFields(CFRecord& record)
{
record.skipNunBytes(12);
#pragma message(">>>>>>>>>>> frtHeader skipped here")
record >> istrConnName >> tfnSrc >> cistr;
record >> frtHeader >> istrConnName >> tfnSrc >> cistr;
while(!record.isEOF())
{
MDXStrIndexPtr element(new MDXStrIndex);

View File

@ -32,13 +32,12 @@
#pragma once
#include "BiffRecord.h"
#include <Logic/Biff_structures/MDXStrIndex.h>
#include "../Biff_structures/MDXStrIndex.h"
#include "../Biff_structures/FrtHeader.h"
namespace XLS
{
// Logical representation of MDXTuple record in BIFF8
class MDXTuple: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(MDXTuple)
@ -48,18 +47,17 @@ public:
~MDXTuple();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeMDXTuple;
//-----------------------------
_INT32 istrConnName;
unsigned char tfnSrc;
_INT32 cistr;
BiffStructurePtrVector rgistr;
_INT32 istrConnName;
unsigned char tfnSrc;
_INT32 cistr;
BiffStructurePtrVector rgistr;
FrtHeader frtHeader;
};
} // namespace XLS

View File

@ -44,7 +44,6 @@ NameFnGrp12::~NameFnGrp12()
{
}
BaseObjectPtr NameFnGrp12::clone()
{
return BaseObjectPtr(new NameFnGrp12(*this));
@ -52,9 +51,7 @@ BaseObjectPtr NameFnGrp12::clone()
void NameFnGrp12::readFields(CFRecord& record)
{
record.skipNunBytes(12);
#pragma message(">>>>>>>>>>> frtHeader skipped here")
record >> cachName >> fgrp >> rgach;
record >> frtHeader >> cachName >> fgrp >> rgach;
}
} // namespace XLS

View File

@ -32,13 +32,12 @@
#pragma once
#include "BiffRecord.h"
#include <Logic/Biff_structures/BiffString.h>
#include "../Biff_structures/BiffString.h"
#include "../Biff_structures/FrtHeader.h"
namespace XLS
{
// Logical representation of NameFnGrp12 record in BIFF8
class NameFnGrp12: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(NameFnGrp12)
@ -48,15 +47,14 @@ public:
~NameFnGrp12();
BaseObjectPtr clone();
void readFields(CFRecord& record);
//-----------------------------
_UINT16 cachName;
_UINT16 fgrp;
_UINT16 cachName;
_UINT16 fgrp;
XLUnicodeString rgach;
FrtHeader frtHeader;
};
} // namespace XLS

View File

@ -44,7 +44,6 @@ NamePublish::~NamePublish()
{
}
BaseObjectPtr NamePublish::clone()
{
return BaseObjectPtr(new NamePublish(*this));
@ -52,10 +51,10 @@ BaseObjectPtr NamePublish::clone()
void NamePublish::readFields(CFRecord& record)
{
record.skipNunBytes(12);
#pragma message(">>>>>>>>>>> frtHeader skipped here")
unsigned short flags;
record >> flags >> strName;
record >> frtHeader >> flags >> strName;
fPublished = GETBIT(flags, 0);
fWorkbookParam = GETBIT(flags, 0);
}

View File

@ -32,13 +32,12 @@
#pragma once
#include "BiffRecord.h"
#include <Logic/Biff_structures/BiffString.h>
#include "../Biff_structures/BiffString.h"
#include "../Biff_structures/FrtHeader.h"
namespace XLS
{
// Logical representation of NamePublish record in BIFF8
class NamePublish: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(NamePublish)
@ -48,17 +47,17 @@ public:
~NamePublish();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeNamePublish;
//-----------------------------
bool fPublished;
bool fWorkbookParam;
bool fPublished;
bool fWorkbookParam;
XLUnicodeString strName;
FrtHeader frtHeader;
};
} // namespace XLS

View File

@ -39,7 +39,6 @@ SortData::SortData()
{
}
SortData::~SortData()
{
}
@ -51,11 +50,9 @@ BaseObjectPtr SortData::clone()
void SortData::readFields(CFRecord& record)
{
record.skipNunBytes(12);
#pragma message(">>>>>>>>>>> frtHeader skipped here")
unsigned short flags;
record >> flags;
record >> frtHeader >> flags;
fCol = GETBIT(flags, 0);
fCaseSensitive = GETBIT(flags, 1);

View File

@ -32,8 +32,9 @@
#pragma once
#include "BiffRecordContinued.h"
#include <Logic/Biff_structures/CellRangeRef.h>
#include <Logic/Biff_structures/SortCond12.h>
#include "../Biff_structures/CellRangeRef.h"
#include "../Biff_structures/SortCond12.h"
#include "../Biff_structures/FrtHeader.h"
namespace XLS
{
@ -60,7 +61,8 @@ public:
BIFF_DWORD cconditions;
BIFF_DWORD idParent;
BiffStructurePtrVector sortCond12Array;
BiffStructurePtrVector sortCond12Array;
FrtHeader frtHeader;
//-----------------------------
std::wstring rfx;

View File

@ -52,15 +52,14 @@ BaseObjectPtr StyleExt::clone()
void StyleExt::readFields(CFRecord& record)
{
record.skipNunBytes(12);
#pragma message(">>>>>>>>>>> frtHeader skipped here")
unsigned char flags;
record >> flags;
record >> frtHeader >> flags;
fBuiltIn = GETBIT(flags, 0);
fHidden = GETBIT(flags, 1);
fCustom = GETBIT(flags, 2);
stName.setSize(0xff); //max size
record >> iCategory>> builtInData >> stName >> xfProps;
}

View File

@ -32,9 +32,11 @@
#pragma once
#include "BiffRecord.h"
#include <Logic/Biff_structures/BuiltInStyle.h>
#include <Logic/Biff_structures/BiffString.h>
#include <Logic/Biff_structures/XFProps.h>
#include "../Biff_structures/BuiltInStyle.h"
#include "../Biff_structures/XFProps.h"
#include "../Biff_structures/BiffString.h"
#include "../Biff_structures/FrtHeader.h"
namespace XLS
{
@ -67,6 +69,8 @@ public:
BuiltInStyle builtInData;
LPWideString stName;
XFProps xfProps;
FrtHeader frtHeader;
};
} // namespace XLS

View File

@ -52,12 +52,13 @@ BaseObjectPtr TableStyle::clone()
void TableStyle::readFields(CFRecord& record)
{
record.skipNunBytes(12);
#pragma message(">>>>>>>>>>> frtHeader skipped here")
unsigned short flags;
record >> flags;
record >> frtHeader >> flags;
fIsPivot = GETBIT(flags, 1);
fIsTable = GETBIT(flags, 2);
unsigned short cchName;
record >> ctse >> cchName;
rgchName.setSize(cchName);

View File

@ -32,13 +32,12 @@
#pragma once
#include "BiffRecord.h"
#include <Logic/Biff_structures/BiffString.h>
#include "../Biff_structures/BiffString.h"
#include "../Biff_structures/FrtHeader.h"
namespace XLS
{
// Logical representation of TableStyle record in BIFF8
class TableStyle: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(TableStyle)
@ -49,18 +48,16 @@ public:
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeTableStyle;
//-----------------------------
bool fIsPivot;
bool fIsTable;
_UINT32 ctse;
LPWideStringNoCch rgchName;
bool fIsPivot;
bool fIsTable;
_UINT32 ctse;
LPWideStringNoCch rgchName;
FrtHeader frtHeader;
};
} // namespace XLS

View File

@ -39,23 +39,18 @@ TableStyleElement::TableStyleElement()
{
}
TableStyleElement::~TableStyleElement()
{
}
BaseObjectPtr TableStyleElement::clone()
{
return BaseObjectPtr(new TableStyleElement(*this));
}
void TableStyleElement::readFields(CFRecord& record)
{
record.skipNunBytes(12);
#pragma message(">>>>>>>>>>> frtHeader skipped here")
record >> tseType >> size >> index;
record >> frtHeader >> tseType >> size >> index;
}
} // namespace XLS

View File

@ -32,12 +32,11 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/FrtHeader.h"
namespace XLS
{
// Logical representation of TableStyleElement record in BIFF8
class TableStyleElement: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(TableStyleElement)
@ -47,17 +46,16 @@ public:
~TableStyleElement();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeTableStyleElement;
//-----------------------------
_UINT32 tseType;
_UINT32 size;
_UINT32 index;
_UINT32 tseType;
_UINT32 size;
_UINT32 index;
FrtHeader frtHeader;
};
} // namespace XLS

View File

@ -39,12 +39,10 @@ TableStyles::TableStyles()
{
}
TableStyles::~TableStyles()
{
}
BaseObjectPtr TableStyles::clone()
{
return BaseObjectPtr(new TableStyles(*this));
@ -52,12 +50,9 @@ BaseObjectPtr TableStyles::clone()
void TableStyles::readFields(CFRecord& record)
{
record.skipNunBytes(12);
#pragma message(">>>>>>>>>>> frtHeader skipped here")
unsigned short cchDefTableStyle;
unsigned short cchDefPivotStyle;
record >> cts >> cchDefTableStyle >> cchDefPivotStyle;
record >> frtHeader >> cts >> cchDefTableStyle >> cchDefPivotStyle;
rgchDefTableStyle.setSize(cchDefTableStyle);
rgchDefPivotStyle.setSize(cchDefPivotStyle);

View File

@ -32,12 +32,12 @@
#pragma once
#include "BiffRecord.h"
#include <Logic/Biff_structures/BiffString.h>
#include "../Biff_structures/BiffString.h"
#include "../Biff_structures/FrtHeader.h"
namespace XLS
{
// Logical representation of TableStyles record in BIFF8
class TableStyles: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(TableStyles)
@ -50,13 +50,13 @@ public:
void readFields(CFRecord& record);
static const ElementType type = typeTableStyles;
static const ElementType type = typeTableStyles;
//-----------------------------
_UINT32 cts;
LPWideStringNoCch rgchDefTableStyle;
LPWideStringNoCch rgchDefPivotStyle;
_UINT32 cts;
LPWideStringNoCch rgchDefTableStyle;
LPWideStringNoCch rgchDefPivotStyle;
FrtHeader frtHeader;
};
} // namespace XLS

View File

@ -41,12 +41,10 @@ Theme::Theme()
{
}
Theme::~Theme()
{
}
BaseObjectPtr Theme::clone()
{
return BaseObjectPtr(new Theme(*this));
@ -54,9 +52,7 @@ BaseObjectPtr Theme::clone()
void Theme::readFields(CFRecord& record)
{
record.skipNunBytes(12);
#pragma message(">>>>>>>>>>> frtHeader skipped here")
record >> dwThemeVersion;
record >> frtHeader >> dwThemeVersion;
if(!dwThemeVersion)
{

View File

@ -32,12 +32,11 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/FrtHeader.h"
namespace XLS
{
// Logical representation of Theme record in BIFF8
class Theme: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(Theme)
@ -53,9 +52,8 @@ public:
static const ElementType type = typeTheme;
//-----------------------------
_UINT32 dwThemeVersion;
//std::wstring rgb;
_UINT32 dwThemeVersion;
FrtHeader frtHeader;
};
} // namespace XLS

View File

@ -53,9 +53,34 @@ BaseObjectPtr TxtQry::clone()
void TxtQry::readFields(CFRecord& record)
{
#pragma message("####################### TxtQry record is not implemented")
Log::error("TxtQry record is not implemented.");
//record >> some_value;
unsigned short reserved, flags1, unused1;
unsigned char unused2, flags2;
record >> rt >> flags1 >> unused1 >> rowStartAt >> flags2 >> chCustom >> unused2 >> itwf >> chDecimal >> chThousSep;
fFile = GETBIT(flags1, 0);
fDelimited = GETBIT(flags1, 1);
iCpid = GETBITS(flags1, 2, 3);
fPromptForFile = GETBIT(flags1, 4);
iCpidNew = GETBITS(flags1, 5, 14);
fUseNewiCpid = GETBIT(flags1, 15);
fTab = GETBIT(flags2, 0);
fSpace = GETBIT(flags2, 1);
fComma = GETBIT(flags2, 2);
fSemiColon = GETBIT(flags2, 3);
fCustom = GETBIT(flags2, 4);
fConsecutive = GETBIT(flags2, 5);
iTextDelm = GETBITS(flags1, 6, 7);
for (int i = 0 ; i < itwf; i++)
{
TxtWf val;
record >> val;
rgtxtwf.push_back(val);
}
record >> rgchFile;
}
} // namespace XLS

View File

@ -32,12 +32,12 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/TxtWf.h"
#include "../Biff_structures/BiffString.h"
namespace XLS
{
// Logical representation of TxtQry record in BIFF8
class TxtQry: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(TxtQry)
@ -50,9 +50,29 @@ public:
void readFields(CFRecord& record);
static const ElementType type = typeTxtQry;
static const ElementType type = typeTxtQry;
unsigned short rt;
bool fFile;
bool fDelimited;
unsigned char iCpid;
bool fPromptForFile;
unsigned char iCpidNew;
bool fUseNewiCpid;
_INT32 rowStartAt;
bool fTab;
bool fSpace;
bool fComma;
bool fSemiColon;
bool fCustom;
bool fConsecutive;
unsigned char iTextDelm;
unsigned short chCustom;
_INT32 itwf;
unsigned char chDecimal;
unsigned char chThousSep;
std::vector<TxtWf> rgtxtwf;
XLUnicodeString rgchFile;
};
} // namespace XLS

View File

@ -39,12 +39,10 @@ XFCRC::XFCRC()
{
}
XFCRC::~XFCRC()
{
}
BaseObjectPtr XFCRC::clone()
{
return BaseObjectPtr(new XFCRC(*this));
@ -52,8 +50,7 @@ BaseObjectPtr XFCRC::clone()
void XFCRC::readFields(CFRecord& record)
{
record.skipNunBytes(12);
#pragma message(">>>>>>>>>>> frtHeader skipped here")
record >> frtHeader;
record.skipNunBytes(2); // reserved
record >> cxfs >> crc;
}

View File

@ -32,12 +32,11 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/FrtHeader.h"
namespace XLS
{
// Logical representation of XFCRC record in BIFF8
class XFCRC: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(XFCRC)
@ -50,12 +49,12 @@ public:
void readFields(CFRecord& record);
static const ElementType type = typeXFCRC;
static const ElementType type = typeXFCRC;
//-----------------------------
_UINT16 cxfs;
_UINT32 crc;
_UINT16 cxfs;
_UINT32 crc;
FrtHeader frtHeader;
};
} // namespace XLS

View File

@ -39,12 +39,10 @@ XFExt::XFExt()
{
}
XFExt::~XFExt()
{
}
BaseObjectPtr XFExt::clone()
{
return BaseObjectPtr(new XFExt(*this));
@ -52,8 +50,7 @@ BaseObjectPtr XFExt::clone()
void XFExt::readFields(CFRecord& record)
{
record.skipNunBytes(12);
#pragma message(">>>>>>>>>>> frtHeader skipped here")
record >> frtHeader;
record.skipNunBytes(2); // reserved
record >> ixfe;
record.skipNunBytes(2); // reserved

View File

@ -32,13 +32,12 @@
#pragma once
#include "BiffRecord.h"
#include <Logic/Biff_structures/ExtProp.h>
#include "../Biff_structures/ExtProp.h"
#include "../Biff_structures/FrtHeader.h"
namespace XLS
{
// Logical representation of XFExt record in BIFF8
class XFExt: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(XFExt)
@ -51,13 +50,13 @@ public:
void readFields(CFRecord& record);
static const ElementType type = typeXFExt;
static const ElementType type = typeXFExt;
//-----------------------------
_UINT16 ixfe;
_UINT16 cexts;
BiffStructurePtrVector rgExt;
FrtHeader frtHeader;
};
} // namespace XLS

View File

@ -205,5 +205,31 @@ const bool BiffString::getWideRecommendation() const
}
return false;
}
//-----------------------------------------------------------------
BiffStructurePtr XLUnicodeStringSegmented::clone()
{
return BiffStructurePtr(new XLUnicodeStringSegmented(*this));
}
void XLUnicodeStringSegmented::load(CFRecord& record)
{
record >> cchTotal;
if (cchTotal < 1) return;
_UINT32 cchTotal_test = 0;
while(true)
{
if (record.isEOF())
break;
XLUnicodeString string;
record >> string;
cchTotal_test += string.value().length();
arStrings.push_back(string.value());
strTotal += string.value();
}
}
} // namespace XLS

View File

@ -211,60 +211,24 @@ CFRecord& operator>>(CFRecord& record, XLUnicodeString_T<cchType, det_id, cch_wh
return record;
}
//
//
//template<class cchType, AW_DETERMINATION det_id, CCH_SOURCE cch_where>
//CFRecord& operator<<(CFRecord& record, XLUnicodeString_T<cchType, det_id, cch_where>& val)
//{
// size_t struct_size = 0;
// bool is_wide = val.getWideRecommendation();
//
// switch(cch_where)
// {
// case cch_READ_FROM_RECORD:
// {
// cchType cch_l = static_cast<cchType>(val.getSize()); // Just to conform size write.
// if(aw_READ_FROM_CCH == det_id)
// {
// SETBIT(cch_l, ((sizeof(cchType) * 8) - 1), is_wide);
// }
// record << cch_l;
// struct_size += sizeof(cchType);
// break;
// }
// case cch_PASSED_AS_AN_ARGUMENT:
// // Means cch already stored outside
// break;
// }
//
// switch(det_id)
// {
// case aw_READ_FROM_RECORD_IF_CCH_NOT_ZERO:
// if(0 == val.getSize()) break;
// case aw_READ_FROM_RECORD:
// {
// unsigned char fHighByte = is_wide ? 1 : 0;
// record << fHighByte;
// struct_size += sizeof(fHighByte);
// break;
// }
// case aw_WIDE:
// is_wide = true;
// break;
// case aw_ANSI:
// is_wide = false;
// break;
// case aw_READ_FROM_CCH:
// // See cch_READ_FROM_RECORD case in the previous switch
// break;
// }
// struct_size += (val.getSize() << (is_wide ? 1 : 0));
// val.store(record, is_wide);
// val.setStructSize(struct_size); // The only usage is DXFFntD::load
// return record;
//}
//
//
class XLUnicodeStringSegmented : public BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(XLUnicodeStringSegmented)
public:
XLUnicodeStringSegmented(){}
~XLUnicodeStringSegmented(){}
BiffStructurePtr clone();
virtual void load(CFRecord& record);
static const ElementType type = typeStringSegmented;
_UINT32 cchTotal;
std::vector<std::wstring> arStrings;
std::wstring strTotal;
};
} // namespace XLS

View File

@ -89,7 +89,6 @@ struct PtgAttrSpaceType : public BiffStructure_NoVtbl
unsigned char cch;
};
struct RkNumber : public BiffStructure_NoVtbl
{
unsigned int fX100 : 1;
@ -354,22 +353,8 @@ struct CFrtId : public BiffStructure_NoVtbl
unsigned short rtLast;
};
} // namespace XLS
namespace CRYPTO
{
struct Version : public XLS::BiffStructure_NoVtbl
{
unsigned short vMajor;
unsigned short vMinor;
};
} // namespace CRYPTO
#pragma pack()

View File

@ -36,8 +36,6 @@
namespace XLS
{
class CFRecord;
class CFParsedFormula : public ParsedFormula
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(CFParsedFormula)

View File

@ -36,8 +36,6 @@
namespace XLS
{
class CFRecord;
class CFParsedFormulaNoCCE : public ParsedFormula
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(CFParsedFormulaNoCCE)

View File

@ -37,8 +37,6 @@
namespace XLS
{
class CFRecord;
class CFVO : public BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(CFVO)

View File

@ -36,8 +36,6 @@
namespace XLS
{
class CFRecord;
class CFVOParsedFormula : public ParsedFormula
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(CFVOParsedFormula)

View File

@ -36,8 +36,6 @@
namespace XLS
{
class CFRecord;
class ChartNumNillable : public BiffAttribute
{
public:

View File

@ -37,8 +37,6 @@
namespace XLS
{
class CFRecord;
class ChartParsedFormula : public ParsedFormula
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(ChartParsedFormula)

View File

@ -37,8 +37,6 @@
namespace OSHARED
{
class CFRecord;
class CompositeMoniker : public XLS::BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(CompositeMoniker)

View File

@ -37,8 +37,6 @@
namespace XLS
{
class CFRecord;
class CondFmtStructure : public BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(CondFmtStructure)

View File

@ -0,0 +1,53 @@
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "ConnGrbitDbtAdo.h"
namespace XLS
{
BiffStructurePtr ConnGrbitDbtAdo::clone()
{
return BiffStructurePtr(new ConnGrbitDbtAdo(*this));
}
void ConnGrbitDbtAdo::load(CFRecord& record)
{
unsigned short flags;
record >> flags;
fAdoRefreshable = GETBIT(flags, 1);
}
} // namespace XLS

View File

@ -0,0 +1,56 @@
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include "BiffStructure.h"
namespace XLS
{
class ConnGrbitDbtAdo: public BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(ConnGrbitDbtAdo)
public:
BiffStructurePtr clone();
ConnGrbitDbtAdo(){}
~ConnGrbitDbtAdo(){}
static const ElementType type = typeConnGrbitDbtAdo;
virtual void load(CFRecord& record);
bool fAdoRefreshable;
};
} // namespace XLS

View File

@ -0,0 +1,61 @@
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "ConnGrbitDbtOledb.h"
namespace XLS
{
BiffStructurePtr ConnGrbitDbtOledb::clone()
{
return BiffStructurePtr(new ConnGrbitDbtOledb(*this));
}
void ConnGrbitDbtOledb::load(CFRecord& record)
{
unsigned short flags;
record >> flags;
dbost = GETBITS(flags, 0, 2);
fLocalConn = GETBIT(flags, 3);
fNoRefreshCube = GETBIT(flags, 4);
fUseOfficeLcid = GETBIT(flags, 5);
fSrvFmtNum = GETBIT(flags, 6);
fSrvFmtBack = GETBIT(flags, 7);
fSrvFmtFore = GETBIT(flags, 8);
fSrvFmtFlags = GETBIT(flags, 9);
fSupportsLangCellProp = GETBIT(flags, 10);
fSrvSupportsClientCube = GETBIT(flags, 11);
}
} // namespace XLS

View File

@ -0,0 +1,64 @@
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include "BiffStructure.h"
namespace XLS
{
class ConnGrbitDbtOledb: public BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(ConnGrbitDbtOledb)
public:
BiffStructurePtr clone();
ConnGrbitDbtOledb(){}
~ConnGrbitDbtOledb(){}
static const ElementType type = typeConnGrbitDbtOledb;
virtual void load(CFRecord& record);
unsigned char dbost;
bool fLocalConn;
bool fNoRefreshCube;
bool fUseOfficeLcid;
bool fSrvFmtNum;
bool fSrvFmtBack;
bool fSrvFmtFore;
bool fSrvFmtFlags;
bool fSupportsLangCellProp;
bool fSrvSupportsClientCube;
};
} // namespace XLS

View File

@ -0,0 +1,57 @@
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "ConnGrbitDbtWeb.h"
namespace XLS
{
BiffStructurePtr ConnGrbitDbtWeb::clone()
{
return BiffStructurePtr(new ConnGrbitDbtWeb(*this));
}
void ConnGrbitDbtWeb::load(CFRecord& record)
{
unsigned short flags;
record >> flags;
fParsePreFormatted = GETBIT(flags, 0);
fConsecDelim = GETBIT(flags, 1);
fSameSettings = GETBIT(flags, 2);
fXL97Format = GETBIT(flags, 3);
fNoDateRecog = GETBIT(flags, 4);
fRefreshedInXl9 = GETBIT(flags, 5);
}
} // namespace XLS

View File

@ -0,0 +1,61 @@
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include "BiffStructure.h"
namespace XLS
{
class ConnGrbitDbtWeb: public BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(ConnGrbitDbtWeb)
public:
BiffStructurePtr clone();
ConnGrbitDbtWeb(){}
~ConnGrbitDbtWeb(){}
static const ElementType type = typeConnGrbitDbtWeb;
virtual void load(CFRecord& record);
bool fParsePreFormatted;
bool fConsecDelim;
bool fSameSettings;
bool fXL97Format;
bool fNoDateRecog;
bool fRefreshedInXl9;
};
} // namespace XLS

View File

@ -31,14 +31,11 @@
*/
#pragma once
#include <Logic/Biff_records/BiffRecord.h>
#include <Logic/Biff_structures/BiffString.h>
#include "BiffString.h"
namespace XLS
{
class CFRecord;
class ControlInfo : public BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(ControlInfo)
@ -49,8 +46,6 @@ public:
virtual void load(CFRecord& record);
unsigned char fDefault;
unsigned char fHelp;
unsigned char fCancel;

View File

@ -0,0 +1,75 @@
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "DConnConnectionOleDb.h"
#include "BiffString.h"
#include "../Biff_records/SXStreamID.h"
namespace XLS
{
BiffStructurePtr DConnConnectionOleDb::clone()
{
return BiffStructurePtr(new DConnConnectionOleDb(*this));
}
DConnConnectionOleDb::DConnConnectionOleDb()
{
}
DConnConnectionOleDb::~DConnConnectionOleDb()
{
}
void DConnConnectionOleDb::load(CFRecord& record)
{
record >> nDrillthroughRows >> cOleDb;
for (unsigned short i = 0; i < cOleDb; i++)
{
unsigned short val;
record >> val;
rgIOleDbValid.push_back(val);
}
int skip_unused = 2 * (4 - cOleDb) + 2;
record.skipNunBytes(skip_unused);
for (unsigned short i = 0; i < cOleDb; i++)
{
XLUnicodeStringSegmented val;
record >> val;
rgConn.push_back(val);
}}
} // namespace XLS

View File

@ -0,0 +1,60 @@
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include "BiffString.h"
namespace XLS
{
class DConnConnectionOleDb: public BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(DConnConnectionOleDb)
public:
BiffStructurePtr clone();
DConnConnectionOleDb();
~DConnConnectionOleDb();
static const ElementType type = typeDConnConnectionOleDb;
virtual void load(CFRecord& record);
_UINT32 nDrillthroughRows;
unsigned short cOleDb;
std::vector<unsigned short> rgIOleDbValid;
//rgIOleDbInvalid; //size in bytes = 2 * (4 cOleDb)
std::vector<XLUnicodeStringSegmented> rgConn;
};
} // namespace XLS

Some files were not shown because too many files have changed in this diff Show More