mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-03-18 05:38:07 +08:00
Compare commits
85 Commits
core-win-6
...
v4.5.dev.5
| Author | SHA1 | Date | |
|---|---|---|---|
| 8a75916944 | |||
| da45eb4f33 | |||
| 59d75ed148 | |||
| ccc4d751d0 | |||
| a020d3dbf9 | |||
| 7852b7fbe8 | |||
| a64fd8792d | |||
| 32448298a3 | |||
| b3384f1466 | |||
| 93274395a9 | |||
| 2726e14445 | |||
| 75e32a1562 | |||
| 8c2637b89c | |||
| ef389872df | |||
| 6fc611fdfc | |||
| 0cabb63336 | |||
| f501bf7930 | |||
| 7b617dc9e9 | |||
| 245f989ae3 | |||
| 429729b979 | |||
| d709652992 | |||
| 776d799fd2 | |||
| a975cb8261 | |||
| c932b5af26 | |||
| 423e8dda86 | |||
| afcf6b079e | |||
| 3ed2224f93 | |||
| 5307855120 | |||
| 3c9a91af45 | |||
| 9f06f94c93 | |||
| 4954ef2934 | |||
| 721e8800f1 | |||
| ef8e5cab6d | |||
| 028e58ad51 | |||
| 424e0e34cc | |||
| d8988cd101 | |||
| 440a884c0a | |||
| 449bab1a70 | |||
| c1e5e33691 | |||
| 8c7515443a | |||
| 1d16f4ab8f | |||
| 122a5cd056 | |||
| b0994759e7 | |||
| 118f1c5736 | |||
| b65703ceb1 | |||
| c08c960c96 | |||
| 02ece25af8 | |||
| 435a27f6d9 | |||
| 85ea22048a | |||
| 87ae0b38fa | |||
| b93d463469 | |||
| 0aa59b0d92 | |||
| 3dbcce8c36 | |||
| cc9459359f | |||
| 465e70759b | |||
| 9f6c833af5 | |||
| f4d16b0d61 | |||
| 398dc42bb2 | |||
| 69b4a09475 | |||
| ab360be66a | |||
| 98285c225d | |||
| bab6e40c2b | |||
| 539cb2f355 | |||
| 64d6c3c872 | |||
| 7c9be7e2eb | |||
| bad2992903 | |||
| d405cd4e83 | |||
| f632855006 | |||
| 48641d5bde | |||
| d88ae6d3f4 | |||
| e9ad1202ff | |||
| 1fc9280ab3 | |||
| 9e639ec68f | |||
| 28ebf5aaa6 | |||
| 8f5967356d | |||
| bc7d73667d | |||
| a434ae2cc4 | |||
| 7e52ebca48 | |||
| 4925b47002 | |||
| afdaacb226 | |||
| 9f98f07f23 | |||
| 9e1a0e365f | |||
| 39e2b69b8e | |||
| 58c00745a7 | |||
| 4015e8ba4d |
@ -58,7 +58,7 @@
|
||||
|
||||
#include <boost/format.hpp>
|
||||
|
||||
namespace DocFormatUtils
|
||||
namespace DocFileFormat
|
||||
{
|
||||
typedef unsigned char Bool8;
|
||||
typedef unsigned short Bool16;
|
||||
@ -963,4 +963,3 @@ namespace DocFormatUtils
|
||||
};
|
||||
}
|
||||
|
||||
using namespace DocFormatUtils;
|
||||
|
||||
@ -76,4 +76,4 @@ namespace DocFileFormat
|
||||
|
||||
return static_cast<ByteStructure*>(newObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,7 +33,6 @@
|
||||
#include "DrawingPrimitives.h"
|
||||
#include "VirtualStreamReader.h"
|
||||
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
DrawingPrimitive * DrawingPrimitive::Create(VirtualStreamReader* reader, int length, short dpk)
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -1189,9 +1189,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);
|
||||
|
||||
@ -72,7 +72,7 @@ public:
|
||||
|
||||
if (m_Data)
|
||||
{
|
||||
rdUShort = FormatUtils::BytesToUInt16 (m_Data, m_Position, m_Size);
|
||||
rdUShort = DocFileFormat::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 = DocFileFormat::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 = DocFileFormat::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 = DocFileFormat::FormatUtils::BytesToUInt32 (m_Data, m_Position, m_Size);
|
||||
m_Position += sizeof(rdUInt);
|
||||
}
|
||||
|
||||
|
||||
@ -60,7 +60,7 @@ namespace DocFileFormat
|
||||
_size.cx = Right - Left;
|
||||
_size.cy = Bottom - Top;
|
||||
|
||||
rcgBounds = DocFormatUtils::Rectangle (_point, _size);
|
||||
rcgBounds = DocFileFormat::Rectangle (_point, _size);
|
||||
}
|
||||
|
||||
virtual ~ChildAnchor()
|
||||
@ -75,7 +75,7 @@ namespace DocFileFormat
|
||||
public:
|
||||
|
||||
/// Rectangle that describes the bounds of the anchor
|
||||
DocFormatUtils::Rectangle rcgBounds;
|
||||
DocFileFormat::Rectangle rcgBounds;
|
||||
int Left;
|
||||
int Top;
|
||||
int Right;
|
||||
|
||||
@ -64,7 +64,7 @@ namespace DocFileFormat
|
||||
oSize.cx = ( right - left );
|
||||
oSize.cy = ( bottom - top );
|
||||
|
||||
rcgBounds = DocFormatUtils::Rectangle(oPoint,oSize);
|
||||
rcgBounds = DocFileFormat::Rectangle(oPoint,oSize);
|
||||
}
|
||||
|
||||
virtual ~GroupShapeRecord()
|
||||
@ -77,6 +77,6 @@ namespace DocFileFormat
|
||||
return new GroupShapeRecord( _reader, bodySize, typeCode, version, instance );
|
||||
}
|
||||
|
||||
DocFormatUtils::Rectangle rcgBounds;
|
||||
DocFileFormat::Rectangle rcgBounds;
|
||||
};
|
||||
}
|
||||
|
||||
@ -488,7 +488,7 @@ namespace DocFileFormat
|
||||
{
|
||||
for ( unsigned int i = 0, nSize = _grid->size(); i < nSize; i++ )
|
||||
{
|
||||
if(_grid->at(i) % DocFormatUtils::gc_nZeroWidth != 0)
|
||||
if(_grid->at(i) % DocFileFormat::gc_nZeroWidth != 0)
|
||||
{
|
||||
bWriteGridCol = true;
|
||||
break;
|
||||
|
||||
@ -44,6 +44,8 @@
|
||||
#include "../../DesktopEditor/common/File.h"
|
||||
#include "../../DesktopEditor/raster/BgraFrame.h"
|
||||
|
||||
using namespace DocFileFormat;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
DWORD iType; // Record type EMR_HEADER
|
||||
|
||||
@ -1441,7 +1441,7 @@ namespace DocFileFormat
|
||||
{
|
||||
if ((style != NULL) && (anchor != NULL))
|
||||
{
|
||||
DocFormatUtils::Rectangle bounds = anchor->rcgBounds;
|
||||
DocFileFormat::Rectangle bounds = anchor->rcgBounds;
|
||||
|
||||
if (twistDimensions)
|
||||
{
|
||||
|
||||
@ -197,20 +197,20 @@ public:
|
||||
int cchSize = 1;
|
||||
cch = ReadBytes( cchSize, true );
|
||||
|
||||
int xstzSize = FormatUtils::BytesToUChar( cch, 0, cchSize ) * 1;
|
||||
int xstzSize = DocFileFormat::FormatUtils::BytesToUChar( cch, 0, cchSize ) * 1;
|
||||
xstz = ReadBytes(xstzSize, true);
|
||||
|
||||
FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &wstrResult, xstz, xstzSize, ENCODING_WINDOWS_1250 );
|
||||
DocFileFormat::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 = DocFileFormat::FormatUtils::BytesToInt16( cch, 0, cchSize ) * 2;
|
||||
xstz = ReadBytes(xstzSize, true);
|
||||
|
||||
FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &wstrResult, xstz, xstzSize, ENCODING_UTF16 );
|
||||
DocFileFormat::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 );
|
||||
DocFileFormat::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);
|
||||
DocFileFormat::FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &result, stringBytes, ( cch - 1 ), ENCODING_WINDOWS_1250);
|
||||
|
||||
}
|
||||
RELEASEARRAYOBJECTS( stringBytes );
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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>");
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
@ -5587,6 +5738,8 @@ namespace BinDocxRW
|
||||
OOX::Logic::CDrawing* pGraphicDrawing = NULL;
|
||||
PPTX::Logic::GraphicFrame* pGraphic = NULL;
|
||||
|
||||
m_oBcw.m_oStream.ClearCurShapePositionAndSizes();
|
||||
|
||||
if(OOX::et_mc_alternateContent == pElementType)
|
||||
{
|
||||
OOX::WritingElement* we = NULL;
|
||||
|
||||
@ -49,8 +49,8 @@
|
||||
6967917D1D9E8AEE002CA4BA /* BinReaderWriterDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 696791791D9E8AEE002CA4BA /* BinReaderWriterDefines.h */; };
|
||||
6967917E1D9E8AEE002CA4BA /* BinWriters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967917A1D9E8AEE002CA4BA /* BinWriters.cpp */; };
|
||||
6967917F1D9E8AEE002CA4BA /* BinWriters.h in Headers */ = {isa = PBXBuildFile; fileRef = 6967917B1D9E8AEE002CA4BA /* BinWriters.h */; };
|
||||
69BBDF251F0B8AAC00EB1BF7 /* FileDownloader_mac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 69BBDF241F0B8AAC00EB1BF7 /* FileDownloader_mac.mm */; };
|
||||
69F181AF1C77274E00B2952B /* FileDownloader.h in Headers */ = {isa = PBXBuildFile; fileRef = 69F181AD1C77274E00B2952B /* FileDownloader.h */; };
|
||||
69F181B51C77276D00B2952B /* FileDownloader_curl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 69F181B31C77276D00B2952B /* FileDownloader_curl.cpp */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
@ -97,8 +97,8 @@
|
||||
696791791D9E8AEE002CA4BA /* BinReaderWriterDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BinReaderWriterDefines.h; path = ../../BinWriter/BinReaderWriterDefines.h; sourceTree = "<group>"; };
|
||||
6967917A1D9E8AEE002CA4BA /* BinWriters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BinWriters.cpp; path = ../../BinWriter/BinWriters.cpp; sourceTree = "<group>"; };
|
||||
6967917B1D9E8AEE002CA4BA /* BinWriters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BinWriters.h; path = ../../BinWriter/BinWriters.h; sourceTree = "<group>"; };
|
||||
69BBDF241F0B8AAC00EB1BF7 /* FileDownloader_mac.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp.preprocessed; fileEncoding = 4; name = FileDownloader_mac.mm; path = ../../../Common/FileDownloader/FileDownloader_mac.mm; sourceTree = "<group>"; };
|
||||
69F181AD1C77274E00B2952B /* FileDownloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileDownloader.h; path = ../../../Common/FileDownloader/FileDownloader.h; sourceTree = "<group>"; };
|
||||
69F181B31C77276D00B2952B /* FileDownloader_curl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileDownloader_curl.cpp; path = ../../../Common/FileDownloader/FileDownloader_curl.cpp; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@ -230,7 +230,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
69F181AD1C77274E00B2952B /* FileDownloader.h */,
|
||||
69F181B31C77276D00B2952B /* FileDownloader_curl.cpp */,
|
||||
69BBDF241F0B8AAC00EB1BF7 /* FileDownloader_mac.mm */,
|
||||
);
|
||||
name = Common;
|
||||
sourceTree = "<group>";
|
||||
@ -339,7 +339,6 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
69F181B51C77276D00B2952B /* FileDownloader_curl.cpp in Sources */,
|
||||
17C1FE961ACC42C4006B99B3 /* Common.cpp in Sources */,
|
||||
17C1FE971ACC42C4006B99B3 /* ChartFromToBinary.cpp in Sources */,
|
||||
17C1FE981ACC42C4006B99B3 /* CSVReader.cpp in Sources */,
|
||||
@ -348,6 +347,7 @@
|
||||
17C1FE9B1ACC42C4006B99B3 /* CSVWriter.cpp in Sources */,
|
||||
69414A301CB51666003E771B /* ChartWriter.cpp in Sources */,
|
||||
6967917E1D9E8AEE002CA4BA /* BinWriters.cpp in Sources */,
|
||||
69BBDF251F0B8AAC00EB1BF7 /* FileDownloader_mac.mm in Sources */,
|
||||
17C1FE9C1ACC42C4006B99B3 /* XlsxSerializer.cpp in Sources */,
|
||||
690FE0851E9BBD68004B26D0 /* Readers.cpp in Sources */,
|
||||
17C1FE9D1ACC42C4006B99B3 /* FontProcessor.cpp in Sources */,
|
||||
@ -379,6 +379,7 @@
|
||||
unix,
|
||||
_IOS,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
_XCODE,
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
@ -416,6 +417,7 @@
|
||||
unix,
|
||||
_IOS,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
_XCODE,
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
|
||||
@ -107,6 +107,7 @@ static const std::wstring _ooxShapeType[]=
|
||||
L"path",
|
||||
L"custGeom",//uses sub-sub type,
|
||||
L"polygon",
|
||||
L"roundRect",
|
||||
};
|
||||
|
||||
|
||||
@ -355,7 +356,7 @@ void _oox_drawing::serialize_shape(std::wostream & strm)
|
||||
shapeGeomPreset = L"rect";
|
||||
}
|
||||
}
|
||||
else if (sub_type < 9 && sub_type >= 0)
|
||||
else if (sub_type < 10 && sub_type >= 0)
|
||||
{
|
||||
shapeGeomPreset = _ooxShapeType[sub_type]; //odf -> oox
|
||||
}
|
||||
|
||||
@ -189,14 +189,14 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
|
||||
CP_XML_STREAM() << impl_->hyperlinks_.str();
|
||||
}
|
||||
}
|
||||
|
||||
CP_XML_STREAM() << impl_->drawing_.str();
|
||||
|
||||
if (!impl_->page_props_.str().empty())
|
||||
{
|
||||
CP_XML_STREAM() << impl_->page_props_.str();
|
||||
}//props выше legacyDrawing !!
|
||||
|
||||
CP_XML_STREAM() << impl_->drawing_.str();
|
||||
|
||||
if (impl_->commentsId_.length()>0)
|
||||
{
|
||||
CP_XML_NODE(L"legacyDrawing")
|
||||
|
||||
@ -687,6 +687,7 @@ void common_shape_draw_attlist::add_attributes( const xml::attributes_wc_ptr & A
|
||||
CP_APPLY_ATTR(L"draw:transform", draw_transform_);
|
||||
CP_APPLY_ATTR(L"draw:name", draw_name_);
|
||||
CP_APPLY_ATTR(L"draw:text-style-name", draw_text_style_name_);
|
||||
CP_APPLY_ATTR(L"drawooo:display", drawooo_display_);
|
||||
}
|
||||
void common_shape_draw_attlist::apply_from(const common_shape_draw_attlist & Other)
|
||||
{
|
||||
@ -698,6 +699,7 @@ void common_shape_draw_attlist::apply_from(const common_shape_draw_attlist & Oth
|
||||
_CP_APPLY_PROP2(draw_transform_);
|
||||
_CP_APPLY_PROP2(draw_name_);
|
||||
_CP_APPLY_PROP2(draw_text_style_name_);
|
||||
_CP_APPLY_PROP2(drawooo_display_);
|
||||
}
|
||||
|
||||
void common_shape_draw_attlist::serialize(CP_ATTR_NODE)
|
||||
@ -710,6 +712,7 @@ void common_shape_draw_attlist::serialize(CP_ATTR_NODE)
|
||||
CP_XML_ATTR_OPT(L"draw:transform", draw_transform_);
|
||||
CP_XML_ATTR_OPT(L"draw:name", draw_name_);
|
||||
CP_XML_ATTR_OPT(L"draw:text-style-name", draw_text_style_name_);
|
||||
CP_XML_ATTR_OPT(L"drawooo:display", drawooo_display_);
|
||||
}
|
||||
void common_draw_shape_with_text_and_styles_attlist::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
|
||||
@ -501,6 +501,7 @@ public:
|
||||
_CP_OPT(std::wstring) draw_layer_;
|
||||
_CP_OPT(std::wstring) draw_transform_;
|
||||
_CP_OPT(int) draw_z_index_;
|
||||
_CP_OPT(std::wstring) drawooo_display_;
|
||||
};
|
||||
|
||||
class common_draw_position_attlist
|
||||
|
||||
@ -235,7 +235,7 @@ void Compute_HatchFill(draw_hatch * image_style,oox::oox_hatch_fill_ptr fill)
|
||||
int style =0;
|
||||
if (image_style->draw_style_)style = image_style->draw_style_->get_type();
|
||||
|
||||
int angle = (int)(0.5 + *image_style->draw_rotation_/10.);
|
||||
int angle = image_style->draw_rotation_ ? (int)(0.5 + *image_style->draw_rotation_/10.) : 0;
|
||||
|
||||
if (image_style->draw_color_)fill->color_ref = image_style->draw_color_->get_hex_value();
|
||||
|
||||
|
||||
@ -74,7 +74,7 @@ void draw_shape::add_child_element( xml::sax * Reader, const std::wstring & Ns,
|
||||
}
|
||||
void draw_shape::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
CP_APPLY_ATTR(L"draw:id", draw_id_);//или сюда draw_shape_attlist_???
|
||||
CP_APPLY_ATTR(L"draw:id", draw_id_);//или сюда draw_shape_attlist_???
|
||||
|
||||
common_draw_attlists_.shape_with_text_and_styles_.add_attributes(Attributes);
|
||||
common_draw_attlists_.position_.add_attributes(Attributes);
|
||||
@ -87,6 +87,7 @@ void draw_shape::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
void draw_rect_attlist::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
CP_APPLY_ATTR(L"draw:filter-name", draw_filter_name_);
|
||||
CP_APPLY_ATTR(L"draw:corner-radius",draw_corner_radius_);
|
||||
}
|
||||
|
||||
const wchar_t * draw_rect::ns = L"draw";
|
||||
@ -98,6 +99,9 @@ void draw_rect::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
draw_shape::add_attributes(Attributes);
|
||||
|
||||
sub_type_ = 2;
|
||||
|
||||
if (draw_rect_attlist_.draw_corner_radius_)
|
||||
sub_type_ = 9;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -101,7 +101,8 @@ public:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
|
||||
public:
|
||||
_CP_OPT(std::wstring) draw_filter_name_;
|
||||
_CP_OPT(std::wstring) draw_filter_name_;
|
||||
_CP_OPT(odf_types::length) draw_corner_radius_;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -95,13 +95,13 @@ void draw_shape::common_docx_convert(oox::docx_conversion_context & Context)
|
||||
Context.set_paragraph_state (false);
|
||||
Context.set_run_state (false);
|
||||
|
||||
BOOST_FOREACH(const office_element_ptr & elm, content_)
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
ElementType type = elm->get_type();
|
||||
ElementType type = content_[i]->get_type();
|
||||
|
||||
if (type != typeDrawCustomShape)
|
||||
{
|
||||
elm->docx_convert(Context);
|
||||
content_[i]->docx_convert(Context);
|
||||
}
|
||||
}
|
||||
|
||||
@ -120,9 +120,16 @@ void draw_rect::docx_convert(oox::docx_conversion_context & Context)
|
||||
return;
|
||||
}
|
||||
common_docx_convert(Context);
|
||||
//...
|
||||
draw_shape::docx_convert(Context);
|
||||
|
||||
if (draw_rect_attlist_.draw_corner_radius_)
|
||||
{
|
||||
draw_shape * shape = Context.get_drawing_context().get_current_shape();//owner
|
||||
|
||||
double val = draw_rect_attlist_.draw_corner_radius_->get_value() * 6500;
|
||||
shape->additional_.push_back(_property(L"oox-draw-modifiers", std::to_wstring((int)val)));
|
||||
}
|
||||
|
||||
draw_shape::docx_convert(Context);
|
||||
}
|
||||
void draw_ellipse::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
@ -157,6 +164,7 @@ void draw_line::docx_convert(oox::docx_conversion_context & Context)
|
||||
reset_svg_attributes();
|
||||
|
||||
common_docx_convert(Context);
|
||||
//...
|
||||
|
||||
draw_shape::docx_convert(Context);
|
||||
}
|
||||
|
||||
@ -626,6 +626,7 @@ public:
|
||||
// header_footer_content_impl content_;
|
||||
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(style_footer_first);
|
||||
|
||||
/// style:header-left
|
||||
class style_header_left : public office_element_impl<style_header_left>, public header_footer_impl
|
||||
|
||||
@ -384,9 +384,11 @@ void odf_drawing_context::start_group()
|
||||
group->common_draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_name_ = impl_->current_drawing_state_.name_;
|
||||
if (impl_->current_drawing_state_.z_order_ >= 0)
|
||||
group->common_draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_z_index_ = impl_->current_drawing_state_.z_order_;
|
||||
if (!impl_->current_drawing_state_.name_.empty())
|
||||
group->common_draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_name_ = impl_->current_drawing_state_.name_;
|
||||
|
||||
//if (!impl_->current_drawing_state_.description_.empty())
|
||||
// group->common_draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_name_ = impl_->current_drawing_state_.description_;
|
||||
if (impl_->current_drawing_state_.hidden_)
|
||||
group->common_draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.drawooo_display_ = L"printer";
|
||||
|
||||
impl_->current_drawing_state_.name_ = L"";
|
||||
impl_->current_drawing_state_.z_order_ = -1;
|
||||
|
||||
@ -519,10 +521,12 @@ void odf_drawing_context::end_drawing()
|
||||
draw->common_draw_attlists_.shape_with_text_and_styles_.common_presentation_attlist_.presentation_class_ = impl_->current_drawing_state_.presentation_class_;
|
||||
draw->common_draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_layer_ = draw_layer;
|
||||
}
|
||||
if (impl_->current_drawing_state_.name_.length() > 0)
|
||||
if (!impl_->current_drawing_state_.name_.empty())
|
||||
draw->common_draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_name_ = impl_->current_drawing_state_.name_;
|
||||
if (impl_->current_drawing_state_.z_order_ >= 0)
|
||||
draw->common_draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_z_index_ = impl_->current_drawing_state_.z_order_;
|
||||
if (impl_->current_drawing_state_.hidden_)
|
||||
draw->common_draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.drawooo_display_ = L"printer";
|
||||
|
||||
std::wstring strTransform;
|
||||
|
||||
@ -2125,6 +2129,13 @@ void odf_drawing_context::set_textarea_wrap(bool Val)
|
||||
impl_->current_graphic_properties->fo_wrap_option_ = wrap_option(wrap_option::NoWrap);
|
||||
|
||||
}
|
||||
void odf_drawing_context::set_textarea_fit_to_size(bool val)
|
||||
{
|
||||
if (!impl_->current_graphic_properties)return;
|
||||
|
||||
impl_->current_graphic_properties->draw_fit_to_size_ = val;
|
||||
}
|
||||
|
||||
|
||||
void odf_drawing_context::set_textarea_font(std::wstring & latin, std::wstring & cs, std::wstring & ea)
|
||||
{
|
||||
|
||||
@ -228,6 +228,7 @@ public:
|
||||
void set_textarea_wrap (bool val);
|
||||
void set_textarea_fontcolor (std::wstring hexColor);
|
||||
void set_textarea_font (std::wstring & latin, std::wstring & cs, std::wstring & ea);
|
||||
void set_textarea_fit_to_size (bool val);
|
||||
|
||||
void set_placeholder_id (std::wstring val);
|
||||
void set_placeholder_type (int val);
|
||||
|
||||
@ -283,6 +283,8 @@ void odt_conversion_context::end_drawings()
|
||||
}
|
||||
void odt_conversion_context::start_paragraph(bool styled)
|
||||
{
|
||||
if (current_field_.enabled && !current_field_.result) return; //Стандартное_составное_письмо.docx
|
||||
|
||||
if (is_paragraph_in_current_section_ && !styled)
|
||||
{
|
||||
styles_context()->create_style(L"", odf_types::style_family::Paragraph, true, false, -1);
|
||||
@ -374,8 +376,9 @@ void odt_conversion_context::set_field_instr(std::wstring instr)
|
||||
{
|
||||
if (current_field_.enabled == false) return;
|
||||
|
||||
current_field_.type = 0; //users field
|
||||
int res1 = instr.find(L"HYPERLINK");
|
||||
if (res1 >=0) //это не поле - это hyperlink
|
||||
if (res1 >= 0) //это не поле - это hyperlink
|
||||
{
|
||||
current_field_.type = 1;
|
||||
|
||||
@ -390,24 +393,24 @@ void odt_conversion_context::set_field_instr(std::wstring instr)
|
||||
}
|
||||
}
|
||||
res1 = instr.find(L"NUMPAGES");
|
||||
if (res1 >=0 && current_field_.type == 0)
|
||||
if (res1 >= 0 && current_field_.type == 0)
|
||||
{
|
||||
current_field_.type = 3;
|
||||
}
|
||||
res1 = instr.find(L"PAGEREF");
|
||||
if (res1 >=0 && current_field_.type == 0 ) //это не поле - это bookmark
|
||||
if (res1 >= 0 && current_field_.type == 0 ) //это не поле - это bookmark
|
||||
{
|
||||
current_field_.type = 5;
|
||||
if (instr.length() > 9)
|
||||
current_field_.value = instr.substr(9, instr.length()-5);
|
||||
}
|
||||
res1 = instr.find(L"PAGE");
|
||||
if (res1 >=0 && current_field_.type == 0)
|
||||
if (res1 >= 0 && current_field_.type == 0)
|
||||
{
|
||||
current_field_.type = 2;
|
||||
}
|
||||
res1 = instr.find(L"TIME");
|
||||
if (res1 >=0 && current_field_.type == 0)
|
||||
if (res1 >= 0 && current_field_.type == 0)
|
||||
{
|
||||
current_field_.type = 4;
|
||||
}
|
||||
@ -418,20 +421,34 @@ void odt_conversion_context::set_field_instr(std::wstring instr)
|
||||
}
|
||||
//////////////////////////////////////////
|
||||
res1 = instr.find(L"@");
|
||||
if (res1 >=0)
|
||||
if (res1 >= 0)
|
||||
{
|
||||
current_field_.format = instr.substr(res1+1, instr.length());
|
||||
current_field_.format = instr.substr(res1 + 1, instr.length());
|
||||
}
|
||||
|
||||
if (current_field_.type == 0)
|
||||
{
|
||||
res1 = instr.find(L" ");
|
||||
if (res1 >= 0)
|
||||
{
|
||||
current_field_.name = instr.substr(0, res1);
|
||||
}
|
||||
}
|
||||
}
|
||||
void odt_conversion_context::start_field(bool in_span)
|
||||
{
|
||||
current_field_.enabled = true;
|
||||
|
||||
|
||||
current_field_.result = false;
|
||||
current_field_.in_span = in_span;
|
||||
current_field_.value = L"";
|
||||
current_field_.type = 0;
|
||||
current_field_.value.clear();
|
||||
current_field_.name.clear();
|
||||
current_field_.type = 0; // users field
|
||||
}
|
||||
void odt_conversion_context::separate_field()
|
||||
{
|
||||
current_field_.result = true;
|
||||
}
|
||||
|
||||
void odt_conversion_context::set_master_page_name(std::wstring master_name)
|
||||
{
|
||||
if (current_root_elements_.size() < 1)// return; - эффект_штурмовика.docx - 1 страница !! (и ваще -
|
||||
@ -566,13 +583,17 @@ void odt_conversion_context::end_field()
|
||||
}
|
||||
current_field_.value = L"";
|
||||
current_field_.format = L"";
|
||||
current_field_.name = L"";
|
||||
|
||||
current_field_.enabled = false;
|
||||
current_field_.started = false;
|
||||
current_field_.in_span = false;
|
||||
current_field_.result = false;
|
||||
current_field_.enabled = false;
|
||||
current_field_.started = false;
|
||||
current_field_.in_span = false;
|
||||
}
|
||||
void odt_conversion_context::end_paragraph()
|
||||
{
|
||||
if (current_field_.enabled && !current_field_.result) return; //Стандартное_составное_письмо.docx
|
||||
|
||||
text_context()->end_paragraph();
|
||||
|
||||
flush_section();
|
||||
|
||||
@ -95,6 +95,7 @@ public:
|
||||
|
||||
void start_field (bool in_span);
|
||||
void end_field ();
|
||||
void separate_field ();
|
||||
void set_field_instr (std::wstring instr);
|
||||
|
||||
void start_run (bool styled = false);
|
||||
@ -182,12 +183,14 @@ private:
|
||||
|
||||
struct _field_state
|
||||
{
|
||||
std::wstring name;
|
||||
bool enabled;
|
||||
int type;
|
||||
std::wstring value;
|
||||
std::wstring format;
|
||||
bool started;
|
||||
bool in_span;
|
||||
bool result;
|
||||
}current_field_;
|
||||
|
||||
struct _text_changes_state
|
||||
|
||||
@ -1137,12 +1137,24 @@ void OoxConverter::convert(PPTX::Logic::BodyPr *oox_bodyPr)
|
||||
//+ style section
|
||||
//+element text:section в котором параграфы
|
||||
}
|
||||
if (oox_bodyPr->Fit.type == PPTX::Logic::TextFit::FitSpAuto)
|
||||
{
|
||||
//изменяемы размеры
|
||||
odf_context()->drawing_context()->set_text_box_min_size(true);//уже выставленые в min
|
||||
|
||||
switch(oox_bodyPr->Fit.type)
|
||||
{
|
||||
case PPTX::Logic::TextFit::FitSpAuto:
|
||||
{//изменяемы размеры
|
||||
odf_context()->drawing_context()->set_text_box_min_size(true);//уже выставленые в min
|
||||
}break;
|
||||
case PPTX::Logic::TextFit::FitNo:
|
||||
{
|
||||
}break;
|
||||
case PPTX::Logic::TextFit::FitNormAuto:
|
||||
{
|
||||
}break;
|
||||
default:
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
if (oox_bodyPr->fromWordArt.IsInit() && oox_bodyPr->prstTxWarp.IsInit())
|
||||
{
|
||||
for (size_t i = 0; i < oox_bodyPr->prstTxWarp->avLst.size(); i++)
|
||||
|
||||
@ -593,6 +593,14 @@ void OoxConverter::convert(OOX::Vml::CRoundRect *vml_roundrect)
|
||||
|
||||
OOX::Vml::CVmlCommonElements *vml_common = dynamic_cast<OOX::Vml::CVmlCommonElements *>(vml_roundrect);
|
||||
convert(vml_common);
|
||||
|
||||
double arc_size = vml_roundrect->m_oArcSize.GetValue();
|
||||
|
||||
if (arc_size > 0)
|
||||
{
|
||||
odf_types::length corner = odf_types::length(arc_size * 20, odf_types::length::cm);
|
||||
odf_context()->drawing_context()->set_corner_radius(corner);
|
||||
}
|
||||
}
|
||||
|
||||
void OoxConverter::convert(OOX::Vml::CCurve *vml_curve)
|
||||
|
||||
@ -751,7 +751,7 @@ void DocxConverter::convert(OOX::Logic::CSym *oox_sym)
|
||||
odt_context->text_context()->set_symbol_text(oox_sym->m_oChar->GetValue());
|
||||
//odt_context->text_context()->add_text_content(std::wstring(L"/") + oox_sym->m_oChar->ToString());
|
||||
}
|
||||
void DocxConverter::convert(OOX::Logic::CFldChar *oox_fld)
|
||||
void DocxConverter::convert(OOX::Logic::CFldChar *oox_fld)
|
||||
{
|
||||
if (oox_fld == NULL) return;
|
||||
|
||||
@ -762,7 +762,7 @@ void DocxConverter::convert(OOX::Logic::CFldChar *oox_fld)
|
||||
{
|
||||
if (oox_fld->m_oFldCharType->GetValue() == SimpleTypes::fldchartypeBegin) odt_context->start_field(false);
|
||||
if (oox_fld->m_oFldCharType->GetValue() == SimpleTypes::fldchartypeEnd) odt_context->end_field();
|
||||
if (oox_fld->m_oFldCharType->GetValue() == SimpleTypes::fldchartypeSeparate){}
|
||||
if (oox_fld->m_oFldCharType->GetValue() == SimpleTypes::fldchartypeSeparate)odt_context->separate_field();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1436,6 +1436,8 @@ void PptxConverter::convert_layout(PPTX::Logic::CSld *oox_slide)
|
||||
|
||||
if (pShape.IsInit() && pShape->nvSpPr.nvPr.ph.is_init())
|
||||
{
|
||||
pShape->FillLevelUp();
|
||||
|
||||
int type = 0;
|
||||
if (pShape->nvSpPr.nvPr.ph->type.IsInit())
|
||||
type = pShape->nvSpPr.nvPr.ph->type->GetBYTECode();
|
||||
|
||||
@ -92,11 +92,16 @@ public:
|
||||
bool bResult = pInfo->ReadFromStream(&oUserAtom, pStream);
|
||||
|
||||
offsetToEdit = pInfo->m_oUser.m_nOffsetLastEdit;
|
||||
m_oCurrentUser.m_bIsEncrypt = pInfo->m_bEncrypt;
|
||||
|
||||
if (bResult == false)
|
||||
{
|
||||
delete pInfo;
|
||||
continue;
|
||||
|
||||
if (pInfo->m_bEncrypt)
|
||||
return false;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
|
||||
m_arUsers.push_back(pInfo);
|
||||
|
||||
@ -601,12 +601,14 @@ void CPPTUserInfo::LoadNotes(DWORD dwNoteID, CSlide* pNotes)
|
||||
|
||||
CSlideInfo* pNotesWrapper = &m_arNotesWrapper.back();
|
||||
|
||||
int indexUser = pRecordSlide->m_IndexUser;
|
||||
int indexUser = pRecordSlide->m_IndexUser;
|
||||
|
||||
if (m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures.empty())
|
||||
pNotesWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[0]->m_arOffsetPictures;
|
||||
else
|
||||
pNotesWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures;
|
||||
|
||||
pNotesWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures;
|
||||
pNotesWrapper->m_mapFilePictures = &m_pDocumentInfo->m_mapStoreImageFile;
|
||||
|
||||
//грузим placeholder
|
||||
pNotesWrapper->m_arTextPlaceHolders = pRecordSlide->m_oPersist.m_arTextAttrs;
|
||||
|
||||
std::vector<CRecordNotesAtom*> oArrayNotesAtoms;
|
||||
@ -627,6 +629,9 @@ void CPPTUserInfo::LoadNotes(DWORD dwNoteID, CSlide* pNotes)
|
||||
//????? у заметок нет слайда !!!
|
||||
}
|
||||
//-----------------------------------------------------
|
||||
size_t index = pPairSlide->second->m_Index;
|
||||
if (index >= m_arSlides.size())
|
||||
return;
|
||||
CSlide* pSlide = m_arSlides[pPairSlide->second->m_Index];
|
||||
|
||||
pNotes->m_lSlideID = pPairSlide->second->m_Index;
|
||||
@ -796,12 +801,14 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
|
||||
|
||||
CSlideInfo* pSlideWrapper = &m_arSlideWrapper.back();
|
||||
|
||||
int indexUser = pRecordSlide->m_IndexUser;
|
||||
int indexUser = pRecordSlide->m_IndexUser;
|
||||
|
||||
pSlideWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures;
|
||||
if (m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures.empty())
|
||||
pSlideWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[0]->m_arOffsetPictures;
|
||||
else
|
||||
pSlideWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures;
|
||||
|
||||
pSlideWrapper->m_mapFilePictures = &m_pDocumentInfo->m_mapStoreImageFile;
|
||||
|
||||
// вот, грузим placeholder
|
||||
pSlideWrapper->m_arTextPlaceHolders = pRecordSlide->m_oPersist.m_arTextAttrs;
|
||||
|
||||
// записываем шрифты
|
||||
@ -1402,7 +1409,11 @@ void CPPTUserInfo::LoadMainMaster(DWORD dwMasterID, const LONG& lOriginWidth, co
|
||||
indexUser = pPairMaster1->second->m_IndexUser;
|
||||
pMasterWrapper->m_arTextPlaceHolders = pPairMaster1->second->m_oPersist.m_arTextAttrs;
|
||||
}
|
||||
pMasterWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures;
|
||||
if (m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures.empty() == false)
|
||||
pMasterWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures;
|
||||
else
|
||||
pMasterWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[0]->m_arOffsetPictures;
|
||||
|
||||
pMasterWrapper->m_mapFilePictures = &m_pDocumentInfo->m_mapStoreImageFile;
|
||||
|
||||
// читаем настройки текстовых стилей -----------------------------------------------
|
||||
@ -1784,11 +1795,13 @@ void CPPTUserInfo::LoadNoMainMaster(DWORD dwMasterID, const LONG& lOriginWidth,
|
||||
|
||||
CSlideInfo* pMasterWrapper = &m_arMasterWrapper[m_arMasterWrapper.size() - 1];
|
||||
|
||||
// вот, грузим placeholder
|
||||
pMasterWrapper->m_arTextPlaceHolders = pCurMaster->m_oPersist.m_arTextAttrs;
|
||||
|
||||
pMasterWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[pCurMaster->m_IndexUser]->m_arOffsetPictures;
|
||||
pMasterWrapper->m_arTextPlaceHolders = pCurMaster->m_oPersist.m_arTextAttrs;
|
||||
pMasterWrapper->m_mapFilePictures = &m_pDocumentInfo->m_mapStoreImageFile;
|
||||
|
||||
if (m_pDocumentInfo->m_arUsers[pCurMaster->m_IndexUser]->m_arOffsetPictures.empty() == false)
|
||||
pMasterWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[pCurMaster->m_IndexUser]->m_arOffsetPictures;
|
||||
else
|
||||
pMasterWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[0]->m_arOffsetPictures;
|
||||
|
||||
std::map<DWORD, LONG>::iterator pPairTheme = m_mapMasterToTheme.find(dwID);
|
||||
|
||||
|
||||
@ -116,7 +116,7 @@ bool CPPTFileReader::ReadPersists()
|
||||
CFStreamPtr pStream = GetDocumentStream();
|
||||
if (!pStream) return false;
|
||||
|
||||
if (m_oDocumentInfo.ReadFromStream(&m_oCurrentUser, pStream->stream_) == false) return false;
|
||||
return m_oDocumentInfo.ReadFromStream(&m_oCurrentUser, pStream->stream_);
|
||||
}
|
||||
void CPPTFileReader::ReadDocument()
|
||||
{
|
||||
@ -198,7 +198,6 @@ void CPPTFileReader::ReadEncryptedSummary()
|
||||
if (!pStream) return;
|
||||
|
||||
SRecordHeader oHeader;
|
||||
ULONG nRd = 0;
|
||||
|
||||
if (oHeader.ReadFromStream(pStream) == false )
|
||||
{
|
||||
@ -224,46 +223,51 @@ 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)
|
||||
{
|
||||
if (pStream->isEOF())
|
||||
//if (pStream->isEOF()) случаются неверно записанные стримы
|
||||
// break;
|
||||
|
||||
int pos = pStream->getStreamPointer();
|
||||
if (pos >= pStream->getStreamSize())
|
||||
break;
|
||||
|
||||
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_);
|
||||
|
||||
if (oHeader.RecType == 0 && oHeader.RecLen == 0 )
|
||||
break;// окончание стрима забито нулями (выравнивание)
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -342,6 +342,14 @@
|
||||
<Filter
|
||||
Name="Common"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\..\ASCOfficeXlsFile2\source\XlsFormat\Binary\CFRecord.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\ASCOfficeXlsFile2\source\XlsFormat\Binary\CFStream.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\XlsxSerializerCom\Reader\ChartFromToBinary.cpp"
|
||||
>
|
||||
|
||||
@ -60,7 +60,7 @@ int _tmain(int argc, _TCHAR* argv[])
|
||||
|
||||
pptFile.put_TempDirectory(tempPath);
|
||||
|
||||
HRESULT hRes = pptFile.LoadFromFile(sSrcPpt, dstTempPath, L"password");
|
||||
HRESULT hRes = pptFile.LoadFromFile(sSrcPpt, dstTempPath, L"");
|
||||
|
||||
if (hRes == S_OK)
|
||||
{
|
||||
|
||||
@ -83,7 +83,7 @@ namespace PPTX
|
||||
int nParentDepth = oReader.GetDepth();
|
||||
while( oReader.ReadNextSiblingNode( nParentDepth ) )
|
||||
{
|
||||
std::wstring strName = XmlUtils::GetNameNoNS(oReader.GetName());
|
||||
std::wstring strName = oReader.GetName();
|
||||
|
||||
if (strName == L"a:cxnSpLocks")
|
||||
{
|
||||
@ -155,7 +155,6 @@ namespace PPTX
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
virtual std::wstring toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr1;
|
||||
|
||||
18
ASCOfficePPTXFile/PPTXFormat/Logic/GraphicFrame.cpp
Normal file → Executable file
18
ASCOfficePPTXFile/PPTXFormat/Logic/GraphicFrame.cpp
Normal file → Executable file
@ -124,6 +124,8 @@ namespace PPTX
|
||||
xfrm = oReader;
|
||||
else if (L"cNvGraphicFramePr" == strName)
|
||||
nvGraphicFramePr.cNvGraphicFramePr.fromXML( oReader );
|
||||
else if (L"nvGraphicFramePr" == strName)
|
||||
nvGraphicFramePr.fromXML( oReader );
|
||||
|
||||
else if (L"graphic" == strName)
|
||||
{
|
||||
@ -248,12 +250,26 @@ namespace PPTX
|
||||
}
|
||||
else if (L"oleObj" == strName)
|
||||
{
|
||||
olePic = oNode.ReadNode(L"p:pic");
|
||||
olePic = oNode.ReadNode(L"p:pic"); //нормальный вариант объекта
|
||||
if (olePic.IsInit())
|
||||
{
|
||||
olePic->fromXMLOle(oNode);
|
||||
result = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
olePic.Init(); //старый вариант описания объекта через spid в VmlDrawing
|
||||
olePic->spPr.xfrm;
|
||||
|
||||
Logic::PrstGeom* geom = new Logic::PrstGeom();
|
||||
geom->prst = L"rect";
|
||||
olePic->spPr.Geometry.m_geometry.reset(geom);
|
||||
|
||||
olePic->fromXMLOle(oNode);
|
||||
result = true;
|
||||
}
|
||||
if (olePic->spPr.xfrm.IsInit() == false)
|
||||
olePic->spPr.xfrm = xfrm;
|
||||
}
|
||||
else if (L"AlternateContent" == strName)
|
||||
{
|
||||
|
||||
@ -619,6 +619,45 @@ namespace PPTX
|
||||
if(oleObject.IsInit())
|
||||
{
|
||||
pWriter->StartRecord(SPTREE_TYPE_OLE);
|
||||
|
||||
if (oleObject->m_sShapeId.IsInit() && (!blipFill.blip->embed.IsInit() && blipFill.blip->oleFilepathImage.empty()) &&
|
||||
parentFileIs<PPTX::Slide>() && parentFileAs<PPTX::Slide>().Vml.IsInit())
|
||||
{
|
||||
OOX::CVmlDrawing *pVml = parentFileAs<PPTX::Slide>().Vml.operator->();
|
||||
|
||||
std::map<std::wstring, OOX::CVmlDrawing::_vml_shape>::iterator pPair = pVml->m_mapShapes.find(*oleObject->m_sShapeId);
|
||||
if (pVml->m_mapShapes.end() != pPair)
|
||||
{
|
||||
pPair->second.bUsed = true;
|
||||
OOX::Vml::CShape* pShape = dynamic_cast<OOX::Vml::CShape*>(pPair->second.pElement);
|
||||
for(size_t j = 0; (pShape) && (j < pShape->m_arrItems.size()); ++j)
|
||||
{
|
||||
OOX::WritingElement* pChildElemShape = pShape->m_arrItems[j];
|
||||
if(OOX::et_v_imagedata == pChildElemShape->getType())
|
||||
{
|
||||
OOX::Vml::CImageData* pImageData = static_cast<OOX::Vml::CImageData*>(pChildElemShape);
|
||||
|
||||
std::wstring sIdImageFileCache;
|
||||
|
||||
if (pImageData->m_oRelId.IsInit()) sIdImageFileCache = pImageData->m_oRelId->GetValue();
|
||||
else if (pImageData->m_rId.IsInit()) sIdImageFileCache = pImageData->m_rId->GetValue();
|
||||
|
||||
if (!sIdImageFileCache.empty())
|
||||
{
|
||||
//ищем физический файл ( rId относительно vml_drawing)
|
||||
smart_ptr<OOX::File> pFile = pVml->Find(sIdImageFileCache);
|
||||
|
||||
if (pFile.IsInit() && ( OOX::FileTypes::Image == pFile->type()))
|
||||
{
|
||||
OOX::Image* pImageFileCache = static_cast<OOX::Image*>(pFile.operator->());
|
||||
|
||||
blipFill.blip->oleFilepathImage = pImageFileCache->filename().GetPath();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (nvPicPr.nvPr.media.is_init())
|
||||
{
|
||||
@ -630,10 +669,17 @@ namespace PPTX
|
||||
blipFill.blip->mediaFilepath = mediaFile->filename().GetPath();
|
||||
}
|
||||
|
||||
if (nvPicPr.nvPr.media.as<MediaFile>().name == L"audioFile")
|
||||
if (nvPicPr.nvPr.media.is<MediaFile>())
|
||||
{
|
||||
if (nvPicPr.nvPr.media.as<MediaFile>().name == L"audioFile")
|
||||
pWriter->StartRecord(SPTREE_TYPE_AUDIO);
|
||||
else if (nvPicPr.nvPr.media.as<MediaFile>().name == L"videoFile")
|
||||
pWriter->StartRecord(SPTREE_TYPE_VIDEO);
|
||||
}
|
||||
else if (nvPicPr.nvPr.media.is<WavAudioFile>() || nvPicPr.nvPr.media.is<AudioCD>())
|
||||
{
|
||||
pWriter->StartRecord(SPTREE_TYPE_AUDIO);
|
||||
else if (nvPicPr.nvPr.media.as<MediaFile>().name == L"videoFile")
|
||||
pWriter->StartRecord(SPTREE_TYPE_VIDEO);
|
||||
}
|
||||
else
|
||||
pWriter->StartRecord(SPTREE_TYPE_PIC);
|
||||
}
|
||||
@ -1338,6 +1384,7 @@ namespace PPTX
|
||||
blipFill.blip.Init();
|
||||
blipFill.blip->oleRid = oleObject->m_oId->get();
|
||||
}
|
||||
node.ReadAttributeBase(L"spid", oleObject->m_sShapeId);
|
||||
}
|
||||
} // namespace Logic
|
||||
} // namespace PPTX
|
||||
|
||||
@ -259,7 +259,7 @@ namespace PPTX
|
||||
void toXmlWriterVML(NSBinPptxRW::CXmlWriter* pWriter, smart_ptr<PPTX::Theme>& oTheme, smart_ptr<PPTX::Logic::ClrMap>& oClrMap, bool in_group = false);
|
||||
//----------------------------------------------------------------------
|
||||
NvPicPr nvPicPr;
|
||||
BlipFill blipFill;
|
||||
mutable BlipFill blipFill;
|
||||
SpPr spPr;
|
||||
nullable<ShapeStyle> style;
|
||||
//internal
|
||||
|
||||
@ -83,8 +83,6 @@ namespace PPTX
|
||||
m_eType = OOX::et_a_latin;
|
||||
else if ( _T("a:sym") == m_name )
|
||||
m_eType = OOX::et_a_sym;
|
||||
else
|
||||
return;
|
||||
|
||||
ReadAttributes( oReader );
|
||||
|
||||
|
||||
@ -128,27 +128,32 @@ namespace PPTX
|
||||
{
|
||||
if (!pShape) return;
|
||||
|
||||
if(pShape->nvSpPr.nvPr.ph.is_init())
|
||||
if (pShape->nvSpPr.nvPr.ph.is_init())
|
||||
{
|
||||
std::wstring idx = pShape->nvSpPr.nvPr.ph->idx.get_value_or(_T("0"));
|
||||
std::wstring type = pShape->nvSpPr.nvPr.ph->type.get_value_or(_T("body"));
|
||||
std::wstring idx = pShape->nvSpPr.nvPr.ph->idx.get_value_or(L"");
|
||||
std::wstring type = pShape->nvSpPr.nvPr.ph->type.get_value_or(L"body");
|
||||
|
||||
if(type == L"ctrTitle") type = L"title";
|
||||
if (type == L"ctrTitle") type = L"title";
|
||||
|
||||
for(size_t i = 0; i < cSld.spTree.SpTreeElems.size(); ++i)
|
||||
for (size_t i = 0; i < cSld.spTree.SpTreeElems.size(); ++i)
|
||||
{
|
||||
smart_ptr<Logic::Shape> pLayoutShape = cSld.spTree.SpTreeElems[i].GetElem().smart_dynamic_cast<Logic::Shape>();
|
||||
|
||||
if(pLayoutShape.IsInit())
|
||||
if (pLayoutShape.IsInit())
|
||||
{
|
||||
if(pLayoutShape->nvSpPr.nvPr.ph.is_init())
|
||||
if (pLayoutShape->nvSpPr.nvPr.ph.is_init())
|
||||
{
|
||||
std::wstring lIdx = pLayoutShape->nvSpPr.nvPr.ph->idx.get_value_or(_T("0"));
|
||||
std::wstring lIdx = pLayoutShape->nvSpPr.nvPr.ph->idx.get_value_or(_T(""));
|
||||
std::wstring lType = pLayoutShape->nvSpPr.nvPr.ph->type.get_value_or(_T("body"));
|
||||
|
||||
if(lType == _T("ctrTitle")) lType = _T("title");
|
||||
if (lType == L"ctrTitle") lType = L"title";
|
||||
|
||||
if((type == lType) && (idx == lIdx))
|
||||
if ((type == lType) && (idx == lIdx) && !idx.empty())
|
||||
{
|
||||
pShape->SetLevelUpElement(pLayoutShape.operator->());
|
||||
return;
|
||||
}
|
||||
else if ((type == lType) && idx.empty() && lIdx.empty())
|
||||
{
|
||||
pShape->SetLevelUpElement(pLayoutShape.operator->());
|
||||
return;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,8 +36,8 @@
|
||||
#include "BinSmartPointers.h"
|
||||
#include "../Logic/GlobalWorkbookInfo.h"
|
||||
|
||||
#include <common.h>
|
||||
#include <Auxiliary/HelpFunc.h>
|
||||
#include "../../Common/common.h"
|
||||
#include "../Auxiliary/HelpFunc.h"
|
||||
|
||||
#include "../../../Common/DocxFormat/Source/Base/unicode_util.h"
|
||||
namespace XLS
|
||||
|
||||
@ -96,8 +96,6 @@ CompoundFile::CompoundFile(const std::wstring & file_path, const ReadWriteMode m
|
||||
storage_ = NULL;
|
||||
Open(file_path, mode);
|
||||
}
|
||||
|
||||
|
||||
// Opens "Workbook" stream and returns the only reference
|
||||
CFStreamPtr CompoundFile::getWorkbookStream()
|
||||
{
|
||||
@ -114,61 +112,6 @@ CFStreamPtr CompoundFile::getWorkbookStream()
|
||||
return stream;
|
||||
}
|
||||
|
||||
|
||||
// Creates "Workbook" stream and returns the only reference
|
||||
CFStreamPtr CompoundFile::createWorkbookStream()
|
||||
{
|
||||
return createNamedStream("Workbook");
|
||||
}
|
||||
|
||||
void CompoundFile::closeWorkbookStream()
|
||||
{
|
||||
return closeNamedStream("Workbook");
|
||||
}
|
||||
|
||||
|
||||
// Opens "SummaryInformation" stream and returns the only reference
|
||||
CFStreamPtr CompoundFile::getSummaryInformationStream()
|
||||
{
|
||||
return getNamedStream("SummaryInformation");
|
||||
}
|
||||
|
||||
|
||||
// Creates "SummaryInformation" stream and returns the only reference
|
||||
CFStreamPtr CompoundFile::createSummaryInformationStream()
|
||||
{
|
||||
return createNamedStream("SummaryInformation");
|
||||
}
|
||||
|
||||
|
||||
// Closes "SummaryInformation" stream
|
||||
void CompoundFile::closeSummaryInformationStream()
|
||||
{
|
||||
return closeNamedStream("SummaryInformation");
|
||||
}
|
||||
|
||||
|
||||
// Opens "SummaryInformation" stream and returns the only reference
|
||||
CFStreamPtr CompoundFile::getDocumentSummaryInformationStream()
|
||||
{
|
||||
return getNamedStream("DocumentSummaryInformation");
|
||||
}
|
||||
|
||||
|
||||
// Creates "SummaryInformation" stream and returns the only reference
|
||||
CFStreamPtr CompoundFile::createDocumentSummaryInformationStream()
|
||||
{
|
||||
return createNamedStream("DocumentSummaryInformation");
|
||||
}
|
||||
|
||||
|
||||
// Closes "SummaryInformation" stream
|
||||
void CompoundFile::closeDocumentSummaryInformationStream()
|
||||
{
|
||||
return closeNamedStream("DocumentSummaryInformation");
|
||||
}
|
||||
|
||||
|
||||
CFStreamPtr CompoundFile::getNamedStream(const std::string& name)
|
||||
{
|
||||
if(!streams[name])
|
||||
|
||||
@ -58,29 +58,19 @@ public:
|
||||
|
||||
bool isError();
|
||||
|
||||
CFStreamPtr getWorkbookStream();
|
||||
CFStreamPtr createWorkbookStream();
|
||||
void closeWorkbookStream();
|
||||
|
||||
CFStreamPtr getSummaryInformationStream();
|
||||
CFStreamPtr createSummaryInformationStream();
|
||||
void closeSummaryInformationStream();
|
||||
|
||||
CFStreamPtr getDocumentSummaryInformationStream();
|
||||
CFStreamPtr createDocumentSummaryInformationStream();
|
||||
void closeDocumentSummaryInformationStream();
|
||||
CFStreamPtr getWorkbookStream ();
|
||||
CFStreamPtr getNamedStream (const std::string& name);
|
||||
|
||||
POLE::Storage *storage_;
|
||||
private:
|
||||
POLE::Stream* openStream (const std::string & stream_name); // Opens a stream in the storage (shall be called not more than once per stream)
|
||||
POLE::Stream* createStream (const std::string & stream_name); // Creates a new stream in the storage
|
||||
|
||||
CFStreamPtr getNamedStream (const std::string& name);
|
||||
CFStreamPtr createNamedStream (const std::string& name);
|
||||
void closeNamedStream (const std::string& name);
|
||||
|
||||
private:
|
||||
std::map<std::string, CFStreamPtr> streams;
|
||||
POLE::Storage *storage_;
|
||||
ReadWriteMode rwMode;
|
||||
};
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -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];
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include <Logic/Biff_structures/LongRGB.h>
|
||||
#include "../Biff_structures/LongRGB.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
@ -59,12 +59,12 @@ public:
|
||||
|
||||
typedef enum
|
||||
{
|
||||
st_Workbook = 0x0005,
|
||||
st_Globals = st_Workbook,
|
||||
st_Dialog = 0x0010,
|
||||
st_Worksheet = st_Dialog,
|
||||
st_Chart = 0x0020,
|
||||
st_Macro = 0x040
|
||||
st_Workbook = 0x0005,
|
||||
st_Globals = st_Workbook,
|
||||
st_Dialog = 0x0010,
|
||||
st_Worksheet = st_Dialog,
|
||||
st_Chart = 0x0020,
|
||||
st_Macro = 0x040
|
||||
} SubstreamType;
|
||||
|
||||
|
||||
|
||||
@ -36,8 +36,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of BkHim record in BIFF8
|
||||
class BkHim: public BiffRecordContinued
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(BkHim)
|
||||
@ -48,10 +46,9 @@ public:
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeBkHim;
|
||||
static const ElementType type = typeBkHim;
|
||||
|
||||
_UINT16 cf;
|
||||
_UINT32 lcb;
|
||||
|
||||
@ -31,6 +31,9 @@
|
||||
*/
|
||||
|
||||
#include "DBQueryExt.h"
|
||||
#include "../Biff_structures/ConnGrbitDbtWeb.h"
|
||||
#include "../Biff_structures/ConnGrbitDbtOledb.h"
|
||||
#include "../Biff_structures/ConnGrbitDbtAdo.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
@ -52,10 +55,44 @@ BaseObjectPtr DBQueryExt::clone()
|
||||
|
||||
void DBQueryExt::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### DBQueryExt record is not implemented")
|
||||
Log::error("DBQueryExt record is not implemented.");
|
||||
unsigned short flags1, flags2;
|
||||
record >> frtHeaderOld >> dbt >> flags1;
|
||||
|
||||
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;
|
||||
}
|
||||
record >> flags1 >> bVerDbqueryEdit >> bVerDbqueryRefreshed >> bVerDbqueryRefreshableMin;
|
||||
|
||||
fTxtWiz = GETBIT(flags1, 0);
|
||||
fTableNames = GETBIT(flags1, 1);
|
||||
|
||||
record.skipNunBytes(3); //unused
|
||||
|
||||
record >> coledb >> cstFuture >> wRefreshInterval >> wHtmlFmt >> cwParamFlags;
|
||||
|
||||
PBT val1;
|
||||
for (unsigned short i = 0; i < cwParamFlags; i++)
|
||||
{
|
||||
record >> val1;
|
||||
rgPbt.push_back(val1);
|
||||
}
|
||||
|
||||
char val2;
|
||||
for (unsigned short i = 0; i < cstFuture; i++)
|
||||
{
|
||||
record >> val2;
|
||||
rgbFutureBytes += val2;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -32,12 +32,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include "../Biff_structures/FrtHeaderOld.h"
|
||||
#include "../Biff_structures/PBT.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of DBQueryExt record in BIFF8
|
||||
class DBQueryExt: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(DBQueryExt)
|
||||
@ -47,13 +47,32 @@ public:
|
||||
~DBQueryExt();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeDBQueryExt;
|
||||
|
||||
static const ElementType type = typeDBQueryExt;
|
||||
|
||||
FrtHeaderOld frtHeaderOld;
|
||||
unsigned short dbt; //enum DataSourceType
|
||||
bool fMaintain;
|
||||
bool fNewQuery;
|
||||
bool fImportXmlSource;
|
||||
bool fSPListSrc;
|
||||
bool fSPListReinitCache;
|
||||
bool fSrcIsXml;
|
||||
BiffStructurePtr grbitDbt;
|
||||
bool fTxtWiz;
|
||||
bool fTableNames;
|
||||
unsigned char bVerDbqueryEdit; //DataFunctionalityLevel
|
||||
unsigned char bVerDbqueryRefreshed;
|
||||
unsigned char bVerDbqueryRefreshableMin;
|
||||
unsigned short coledb;
|
||||
unsigned short cstFuture;
|
||||
unsigned short wRefreshInterval;
|
||||
unsigned short wHtmlFmt;
|
||||
unsigned short cwParamFlags;
|
||||
std::vector<PBT> rgPbt;
|
||||
std::string rgbFutureBytes;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -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());
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -35,11 +35,11 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
DbOrParamQry::DbOrParamQry()
|
||||
DbOrParamQry::DbOrParamQry(int typeRecord_)
|
||||
{
|
||||
typeRecord = typeRecord_;
|
||||
}
|
||||
|
||||
|
||||
DbOrParamQry::~DbOrParamQry()
|
||||
{
|
||||
}
|
||||
@ -52,10 +52,32 @@ BaseObjectPtr DbOrParamQry::clone()
|
||||
|
||||
void DbOrParamQry::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### DbOrParamQry record is not implemented")
|
||||
Log::error("DbOrParamQry record is not implemented.");
|
||||
size_t size = record.getDataSize() - record.getRdPtr();
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
if (typeRecord == 1)
|
||||
{
|
||||
unsigned short flags;
|
||||
|
||||
record >> param.wTypeSql >> flags >> param.grbit >> param.fVal;
|
||||
|
||||
param.pbt = GETBITS(flags, 0, 1);
|
||||
param.fNonDefaultName = GETBIT(flags, 2);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned short flags;
|
||||
|
||||
record >> flags >> query.cparams >> query.cstQuery >> query.cstWebPost >> query.cstSQLSav >> query.cstOdbcConn;
|
||||
|
||||
query.dbt = GETBITS(flags, 0, 2);
|
||||
query.fOdbcConn = GETBIT(flags, 3);
|
||||
query.fSql = GETBIT(flags, 4);
|
||||
query.fSqlSav = GETBIT(flags, 5);
|
||||
query.fWeb = GETBIT(flags, 6);
|
||||
query.fSavePwd = GETBIT(flags, 7);
|
||||
query.fTablesOnlyHTML = GETBIT(flags, 8);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -36,24 +36,48 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of DbOrParamQry record in BIFF8
|
||||
class DbOrParamQry: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(DbOrParamQry)
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(DbOrParamQry)
|
||||
public:
|
||||
DbOrParamQry();
|
||||
DbOrParamQry(int typeRecord = 2);
|
||||
~DbOrParamQry();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeDbOrParamQry;
|
||||
static const ElementType type = typeDbOrParamQry;
|
||||
|
||||
int typeRecord;
|
||||
|
||||
//PARAMQRY_Fixed - 8 bytes + variable
|
||||
struct
|
||||
{
|
||||
unsigned short wTypeSql;
|
||||
unsigned char pbt;
|
||||
bool fNonDefaultName;
|
||||
unsigned short grbit;
|
||||
unsigned short fVal;
|
||||
}param;
|
||||
|
||||
//---------------------------------------
|
||||
struct
|
||||
{
|
||||
unsigned char dbt;
|
||||
bool fOdbcConn;
|
||||
bool fSql;
|
||||
bool fSqlSav;
|
||||
bool fWeb;
|
||||
bool fSavePwd;
|
||||
bool fTablesOnlyHTML;
|
||||
short cparams;
|
||||
short cstQuery;
|
||||
short cstWebPost;
|
||||
short cstSQLSav;
|
||||
short cstOdbcConn;
|
||||
}query;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -35,16 +35,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
Fbi2::Fbi2()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Fbi2::~Fbi2()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr Fbi2::clone()
|
||||
{
|
||||
return BaseObjectPtr(new Fbi2(*this));
|
||||
@ -52,9 +42,9 @@ BaseObjectPtr Fbi2::clone()
|
||||
|
||||
void Fbi2::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### Fbi2 record is not implemented")
|
||||
Log::error("Fbi2 record is not implemented.");
|
||||
//record >> some_value;
|
||||
unsigned short val;
|
||||
record >> dmixBasis >> dmiyBasis >> twpHeightBasis >> val >> ifnt;
|
||||
scab = (val != 0);
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -32,25 +32,31 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include "../Biff_structures/FontIndex.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of Fbi2 record in BIFF8
|
||||
class Fbi2: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(Fbi2)
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(Fbi2)
|
||||
public:
|
||||
Fbi2();
|
||||
~Fbi2();
|
||||
Fbi2(){}
|
||||
~Fbi2(){}
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
static const ElementType type = typeFbi2;
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
unsigned short dmixBasis;
|
||||
unsigned short dmiyBasis;
|
||||
unsigned short twpHeightBasis;
|
||||
bool scab;
|
||||
FontIndex ifnt;
|
||||
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -35,16 +35,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
FrtFontList::FrtFontList()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
FrtFontList::~FrtFontList()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr FrtFontList::clone()
|
||||
{
|
||||
return BaseObjectPtr(new FrtFontList(*this));
|
||||
@ -52,9 +42,15 @@ BaseObjectPtr FrtFontList::clone()
|
||||
|
||||
void FrtFontList::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### FrtFontList record is not implemented")
|
||||
Log::error("FrtFontList record is not implemented.");
|
||||
//record >> some_value;
|
||||
unsigned char reserved;
|
||||
record >> frtHeaderOld >> verExcel >> reserved >> cFont;
|
||||
|
||||
FontInfo val;
|
||||
for (unsigned short i = 0; i < cFont; i++)
|
||||
{
|
||||
record >> val;
|
||||
rgFontInfo.push_back(val);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -32,28 +32,30 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include "../Biff_structures/FrtHeaderOld.h"
|
||||
#include "../Biff_structures/FontInfo.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of FrtFontList record in BIFF8
|
||||
class FrtFontList: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(FrtFontList)
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(FrtFontList)
|
||||
public:
|
||||
FrtFontList();
|
||||
~FrtFontList();
|
||||
FrtFontList(){}
|
||||
~FrtFontList(){}
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeFrtFontList;
|
||||
|
||||
static const ElementType type = typeFrtFontList;
|
||||
|
||||
FrtHeaderOld frtHeaderOld;
|
||||
unsigned char verExcel;
|
||||
unsigned short cFont;
|
||||
std::vector<FontInfo> rgFontInfo;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user