mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
Compare commits
132 Commits
v4.4.0.91
...
v4.5.devl.
| Author | SHA1 | Date | |
|---|---|---|---|
| 4c7ab6e616 | |||
| a020d3dbf9 | |||
| 75e32a1562 | |||
| ef389872df | |||
| a975cb8261 | |||
| afcf6b079e | |||
| 3ed2224f93 | |||
| 122a5cd056 | |||
| b0994759e7 | |||
| 85ea22048a | |||
| 465e70759b | |||
| 9f6c833af5 | |||
| 398dc42bb2 | |||
| 98285c225d | |||
| bab6e40c2b | |||
| 64d6c3c872 | |||
| 9e639ec68f | |||
| 7e52ebca48 | |||
| 4925b47002 | |||
| afdaacb226 | |||
| 9f98f07f23 | |||
| 9e1a0e365f | |||
| 39e2b69b8e | |||
| 58c00745a7 | |||
| 4015e8ba4d | |||
| 276af55699 | |||
| ebdfcbd7ee | |||
| 867c09c85d | |||
| cd12777c68 | |||
| 0708c1f45a | |||
| ee577e629a | |||
| f230dc2555 | |||
| 11c9d74e68 | |||
| d61a955c38 | |||
| acfb96e3c3 | |||
| d2e3cc47f2 | |||
| 4f2f164af9 | |||
| 8addd6cb04 | |||
| 92cda5bc80 | |||
| 1a377d8738 | |||
| ed3e107db5 | |||
| 64d8c659bc | |||
| 3debba45b8 | |||
| b8ad1797f0 | |||
| 48587f55b3 | |||
| a505ae391d | |||
| c389801937 | |||
| 24214cb561 | |||
| b19191b286 | |||
| 77f8ab6875 | |||
| 6fc6f9ead3 | |||
| 270c1fa2ac | |||
| f76a03fab8 | |||
| 09e6d3f760 | |||
| 90d8055bcb | |||
| 01ba3b4182 | |||
| ddb67584b8 | |||
| 38ce5586bb | |||
| f6d9ce83f0 | |||
| 03edd40850 | |||
| 9ff87b3c6b | |||
| 645cbef1ef | |||
| 02238f7eea | |||
| 907e00a3ac | |||
| 2470bfd335 | |||
| 3ae52bd221 | |||
| 227d4f18d6 | |||
| 36bdbad685 | |||
| 525b828540 | |||
| f64ee80a1a | |||
| f6402813c4 | |||
| 224ac7d6e2 | |||
| 2e2bd8989d | |||
| 8f434efb95 | |||
| 244dafb02b | |||
| 149a1bdbd5 | |||
| a79d9041bc | |||
| 3954c42602 | |||
| 29dc0aee32 | |||
| d805972d6d | |||
| 549d5a46a6 | |||
| 9e867be756 | |||
| 771bf2d55c | |||
| 3c58cd96fc | |||
| e50864fa98 | |||
| c8c0924c74 | |||
| af732e4e85 | |||
| 47ffdae8cc | |||
| fd5870083b | |||
| 5ba62cb25d | |||
| 79e0588544 | |||
| a3d08cfc35 | |||
| 5caccb284a | |||
| ce19969b52 | |||
| 0f91dc392e | |||
| e9805cef30 | |||
| e3e05eb2db | |||
| c09f17cffb | |||
| ce73dd5987 | |||
| 77df8aacb9 | |||
| ce45b2802f | |||
| 7886018d6f | |||
| 5b5cb4188e | |||
| f797af5f17 | |||
| 055977535e | |||
| 6ab24f10f0 | |||
| 12a03da231 | |||
| cb7088979a | |||
| 1fb1fc6c97 | |||
| e633c3c5d1 | |||
| 0f04de34b1 | |||
| 3f8c2c293a | |||
| 2c97e743da | |||
| 2c83860c04 | |||
| c64b624de2 | |||
| 5e3990937d | |||
| 21744c1607 | |||
| 0892e2549f | |||
| cff6f305d4 | |||
| 5060071227 | |||
| d64109eaa4 | |||
| ec064bbd50 | |||
| baf952a151 | |||
| 0dd36c5e6a | |||
| 474404a8f9 | |||
| f2f6483b6f | |||
| c30161dbd0 | |||
| ec4f4fe476 | |||
| 634509ae28 | |||
| 1244048c50 | |||
| a62b69fb31 | |||
| 8197fb8900 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -20,6 +20,7 @@ Common/3dParty/v8/win_32
|
||||
Common/3dParty/v8/linux_64
|
||||
Common/3dParty/v8/linux_32
|
||||
Common/3dParty/v8/mac_64
|
||||
Common/3dParty/openssl/openssl
|
||||
**/core_build
|
||||
**/Release
|
||||
**/Debug
|
||||
|
||||
15
.travis.yml
15
.travis.yml
@ -1 +1,14 @@
|
||||
language: cpp
|
||||
language: cpp
|
||||
compiler: gcc
|
||||
dist: trusty
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- p7zip-full
|
||||
script:
|
||||
- exit 0
|
||||
# Build fails anyway. See explanation in
|
||||
# https://github.com/ONLYOFFICE/core/pull/29#issuecomment-306773327
|
||||
- cd Common/3dParty && ./make.sh
|
||||
- cd ../../
|
||||
- make
|
||||
@ -963,4 +963,3 @@ namespace DocFormatUtils
|
||||
};
|
||||
}
|
||||
|
||||
using namespace DocFormatUtils;
|
||||
|
||||
@ -32,6 +32,8 @@
|
||||
|
||||
#include "AnnotationReferenceDescriptor.h"
|
||||
|
||||
using namespace DocFormatUtils;
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
ByteStructure* AnnotationReferenceDescriptor::ConstructObject(VirtualStreamReader* reader, int length)
|
||||
@ -76,4 +78,4 @@ namespace DocFileFormat
|
||||
|
||||
return static_cast<ByteStructure*>(newObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,6 +34,8 @@
|
||||
#include "IVisitable.h"
|
||||
#include "Global.h"
|
||||
|
||||
using namespace DocFormatUtils;
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
typedef enum _BorderType
|
||||
|
||||
@ -33,6 +33,8 @@
|
||||
|
||||
#include "../Common/FormatUtils.h"
|
||||
|
||||
using namespace DocFormatUtils;
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
class DateAndTime
|
||||
|
||||
@ -811,10 +811,10 @@ namespace DocFileFormat
|
||||
{
|
||||
Symbol s = getSymbol( chpx );
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:sym", true);
|
||||
m_pXmlWriter->WriteAttribute(L"w:font", FormatUtils::XmlEncode(s.FontName));
|
||||
m_pXmlWriter->WriteAttribute(L"w:char", FormatUtils::XmlEncode(s.HexValue));
|
||||
m_pXmlWriter->WriteNodeEnd(L"", true);
|
||||
//m_pXmlWriter->WriteNodeBegin(L"w:sym", true);
|
||||
//m_pXmlWriter->WriteAttribute(L"w:font", FormatUtils::XmlEncode(s.FontName));
|
||||
//m_pXmlWriter->WriteAttribute(L"w:char", FormatUtils::XmlEncode(s.HexValue));
|
||||
//m_pXmlWriter->WriteNodeEnd(L"", true);
|
||||
}
|
||||
else if ((TextMark::DrawnObject == code) && fSpec)
|
||||
{
|
||||
@ -1663,12 +1663,17 @@ namespace DocFileFormat
|
||||
FontFamilyName* ffn = static_cast<FontFamilyName*>( m_document->FontTable->operator [] ( fontIndex ) );
|
||||
|
||||
ret.FontName = ffn->xszFtn;
|
||||
ret.HexValue = L"f0" + FormatUtils::IntToFormattedWideString( code, L"%02x" );
|
||||
ret.HexValue = L"f0" + FormatUtils::IntToFormattedWideString( code, L"%02x" );//-123 - ShortToFormattedWideString
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ret.HexValue.length() > 4)
|
||||
{
|
||||
ret.HexValue = ret.HexValue.substr(ret.HexValue.length() - 4, 4);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
#include "DrawingPrimitives.h"
|
||||
#include "VirtualStreamReader.h"
|
||||
|
||||
using namespace DocFormatUtils;
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
|
||||
@ -133,14 +133,25 @@ namespace DocFileFormat
|
||||
pos = tStream.GetPosition();
|
||||
|
||||
//------------------------------------------------------------------------------------------
|
||||
crypt_data_aes.hashAlgorithm = CRYPT_METHOD::SHA1; //by AlgIDHash -> 0x0000 || 0x8004
|
||||
crypt_data_aes.spinCount = 50000;
|
||||
switch(AlgIDHash)
|
||||
{
|
||||
case 0x8003: crypt_data_aes.hashAlgorithm = CRYPT_METHOD::MD5; break;
|
||||
case 0x0000:
|
||||
case 0x8004: crypt_data_aes.hashAlgorithm = CRYPT_METHOD::SHA1; break;
|
||||
}
|
||||
crypt_data_aes.spinCount = 0;
|
||||
|
||||
switch(AlgID)
|
||||
{
|
||||
case 0x0000:
|
||||
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;
|
||||
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;
|
||||
@ -156,16 +167,11 @@ namespace DocFileFormat
|
||||
break;
|
||||
}
|
||||
|
||||
switch(ProviderType)
|
||||
{
|
||||
case 0x0001: crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::RC4; break;
|
||||
case 0x0018: crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::AES_ECB; break;
|
||||
}
|
||||
|
||||
|
||||
//switch(ProviderType)
|
||||
//{
|
||||
// case 0x0001: crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::RC4; break;
|
||||
// case 0x0018: crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::AES_ECB; break;
|
||||
//}
|
||||
}
|
||||
|
||||
//RELEASEARRAYOBJECTS( bytes );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -34,6 +34,8 @@
|
||||
#include "VirtualStreamReader.h"
|
||||
#include "../../ASCOfficeXlsFile2/source/XlsFormat/Crypt/Decryptor.h"
|
||||
|
||||
using namespace DocFormatUtils;
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
typedef enum FibVersion
|
||||
@ -507,9 +509,9 @@ namespace DocFileFormat
|
||||
class FileInformationBlock
|
||||
{
|
||||
public:
|
||||
bool m_bOlderVersion;
|
||||
int m_CodePage;
|
||||
FibBase m_FibBase;
|
||||
bool m_bOlderVersion;
|
||||
int m_CodePage;
|
||||
FibBase m_FibBase;
|
||||
|
||||
RgW97 m_RgW97;
|
||||
RgLw97 m_RgLw97;
|
||||
@ -1189,9 +1191,9 @@ namespace DocFileFormat
|
||||
m_FibBase.fDot = FormatUtils::BitmaskToBool((int)flag16, 0x0001);
|
||||
m_FibBase.fGlsy = FormatUtils::BitmaskToBool((int)flag16, 0x0002);
|
||||
m_FibBase.fComplex = FormatUtils::BitmaskToBool((int)flag16, 0x0002);
|
||||
m_FibBase.fHasPic = FormatUtils::BitmaskToBool((int)flag16, 0x0008);
|
||||
m_FibBase.cQuickSaves = (WORD)(((int)flag16 & 0x00F0) >> 4);
|
||||
m_FibBase.fEncrypted = FormatUtils::BitmaskToBool((int)flag16, 0x0100);
|
||||
m_FibBase.fHasPic = FormatUtils::BitmaskToBool((int)flag16, 0x0008);
|
||||
m_FibBase.cQuickSaves = (WORD)(((int)flag16 & 0x00F0) >> 4);
|
||||
m_FibBase.fEncrypted = FormatUtils::BitmaskToBool((int)flag16, 0x0100);
|
||||
m_FibBase.fWhichTblStm = FormatUtils::BitmaskToBool((int)flag16, 0x0200);
|
||||
m_FibBase.fReadOnlyRecommended = FormatUtils::BitmaskToBool((int)flag16, 0x0400);
|
||||
m_FibBase.fWriteReservation = FormatUtils::BitmaskToBool((int)flag16, 0x0800);
|
||||
|
||||
@ -72,7 +72,7 @@ public:
|
||||
|
||||
if (m_Data)
|
||||
{
|
||||
rdUShort = FormatUtils::BytesToUInt16 (m_Data, m_Position, m_Size);
|
||||
rdUShort = DocFormatUtils::FormatUtils::BytesToUInt16 (m_Data, m_Position, m_Size);
|
||||
m_Position += sizeof(rdUShort);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ public:
|
||||
|
||||
if (m_Data)
|
||||
{
|
||||
rdShort = FormatUtils::BytesToInt16 (m_Data, m_Position, m_Size);
|
||||
rdShort = DocFormatUtils::FormatUtils::BytesToInt16 (m_Data, m_Position, m_Size);
|
||||
m_Position += sizeof(rdShort);
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ public:
|
||||
|
||||
if (m_Data)
|
||||
{
|
||||
rdInt = FormatUtils::BytesToInt32 (m_Data, m_Position, m_Size);
|
||||
rdInt = DocFormatUtils::FormatUtils::BytesToInt32 (m_Data, m_Position, m_Size);
|
||||
m_Position += sizeof(rdInt);
|
||||
}
|
||||
|
||||
@ -111,7 +111,7 @@ public:
|
||||
|
||||
if (m_Data )
|
||||
{
|
||||
rdUInt = FormatUtils::BytesToUInt32 (m_Data, m_Position, m_Size);
|
||||
rdUInt = DocFormatUtils::FormatUtils::BytesToUInt32 (m_Data, m_Position, m_Size);
|
||||
m_Position += sizeof(rdUInt);
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
@ -29,39 +29,32 @@
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
#pragma once
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("test")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("test")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
#include "RegularContainer.h"
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
namespace DocFileFormat
|
||||
{
|
||||
class OfficeArtFRITContainer: public RegularContainer
|
||||
{
|
||||
public:
|
||||
static const unsigned short TYPE_CODE_0xF118 = 0xF118;
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("492b3cfa-599e-4bd7-be7f-66de3e48c1cb")]
|
||||
OfficeArtFRITContainer () : RegularContainer()
|
||||
{
|
||||
}
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
OfficeArtFRITContainer (IBinaryReader* _reader, unsigned int size, unsigned int typeCode, unsigned int version, unsigned int instance) : RegularContainer (_reader, size, typeCode, version, instance)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~OfficeArtFRITContainer()
|
||||
{
|
||||
}
|
||||
|
||||
virtual Record* NewObject (IBinaryReader* _reader, unsigned int bodySize, unsigned int typeCode, unsigned int version, unsigned int instance)
|
||||
{
|
||||
return new OfficeArtFRITContainer( _reader, bodySize, typeCode, version, instance );
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -50,6 +50,7 @@
|
||||
#include "GroupShapeRecord.h"
|
||||
#include "OfficeArtClientTextbox.h"
|
||||
#include "UnknownRecord.h"
|
||||
#include "OfficeArtFRITContainer.h"
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
@ -135,6 +136,7 @@ namespace DocFileFormat
|
||||
case GroupContainer::TYPE_CODE_0xF003 : return new GroupContainer();
|
||||
case GroupShapeRecord::TYPE_CODE_0xF009 : return new GroupShapeRecord ();
|
||||
case OfficeArtClientTextbox::TYPE_CODE_0xF00D : return new OfficeArtClientTextbox ();
|
||||
case OfficeArtFRITContainer::TYPE_CODE_0xF118 : return new OfficeArtFRITContainer ();
|
||||
|
||||
default:
|
||||
return new UnknownRecord();
|
||||
|
||||
@ -32,6 +32,8 @@
|
||||
#include "Spa.h"
|
||||
#include "VirtualStreamReader.h"
|
||||
|
||||
using namespace DocFormatUtils;
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
|
||||
|
||||
@ -247,9 +247,8 @@ namespace DocFileFormat
|
||||
{
|
||||
freeform = false;
|
||||
m_pXmlWriter->WriteAttribute( L"type", (std::wstring(L"#") + VMLShapeTypeMapping::GenerateTypeId(pShape->GetShapeType())));
|
||||
|
||||
m_pXmlWriter->WriteAttribute( L"style", FormatUtils::XmlEncode(buildStyle(pShape, pAnchor, options, pContainer->Index)));
|
||||
}
|
||||
m_pXmlWriter->WriteAttribute( L"style", FormatUtils::XmlEncode(buildStyle(pShape, pAnchor, options, pContainer->Index)));
|
||||
|
||||
if (pShape->is<LineType>())
|
||||
{
|
||||
@ -446,7 +445,7 @@ namespace DocFileFormat
|
||||
{
|
||||
yCoord = iter->op;
|
||||
}break;
|
||||
// OUTLINE
|
||||
// LINE
|
||||
case lineColor:
|
||||
{
|
||||
RGBColor lineColor((int)iter->op, RedFirst);
|
||||
@ -493,6 +492,21 @@ namespace DocFileFormat
|
||||
{
|
||||
appendValueAttribute(&m_stroke, L"startarrowwidth", getArrowWidth( iter->op ));
|
||||
}break;
|
||||
case cxstyle:
|
||||
{
|
||||
if (pShape->GetShapeType() == NULL)
|
||||
{
|
||||
freeform = false;
|
||||
m_pXmlWriter->WriteAttribute(L"type", L"#_x0000_t32");
|
||||
}
|
||||
switch(iter->op)
|
||||
{
|
||||
case 0: m_pXmlWriter->WriteAttribute(L"o:connectortype", L"straight"); break;
|
||||
case 1: m_pXmlWriter->WriteAttribute(L"o:connectortype", L"elbow"); break;
|
||||
case 2: m_pXmlWriter->WriteAttribute(L"o:connectortype", L"curved"); break;
|
||||
case 3: m_pXmlWriter->WriteAttribute(L"o:connectortype", L"none"); break;
|
||||
}
|
||||
}break;
|
||||
// FILL
|
||||
case fillColor:
|
||||
{
|
||||
@ -544,6 +558,14 @@ namespace DocFileFormat
|
||||
appendValueAttribute(&m_fill, L"r:id", std::wstring(( L"rId" ) + FormatUtils::IntToWideString(m_nImageId) ));
|
||||
}
|
||||
}break;
|
||||
case fillBlipName:
|
||||
{
|
||||
std::wstring name;
|
||||
FormatUtils::GetSTLCollectionFromBytes<std::wstring>(&name, iter->opComplex.get(), iter->op, ENCODING_UTF16);
|
||||
if (!name.empty())
|
||||
appendValueAttribute(&m_fill, L"o:title", FormatUtils::XmlEncode(name));
|
||||
|
||||
}break;
|
||||
case fillOpacity:
|
||||
{
|
||||
appendValueAttribute(&m_fill, L"opacity", ( FormatUtils::IntToWideString( iter->op ) + L"f" ));
|
||||
|
||||
@ -197,20 +197,20 @@ public:
|
||||
int cchSize = 1;
|
||||
cch = ReadBytes( cchSize, true );
|
||||
|
||||
int xstzSize = FormatUtils::BytesToUChar( cch, 0, cchSize ) * 1;
|
||||
int xstzSize = DocFormatUtils::FormatUtils::BytesToUChar( cch, 0, cchSize ) * 1;
|
||||
xstz = ReadBytes(xstzSize, true);
|
||||
|
||||
FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &wstrResult, xstz, xstzSize, ENCODING_WINDOWS_1250 );
|
||||
DocFormatUtils::FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &wstrResult, xstz, xstzSize, ENCODING_WINDOWS_1250 );
|
||||
}
|
||||
else
|
||||
{
|
||||
int cchSize = 2;
|
||||
cch = ReadBytes( cchSize, true );
|
||||
|
||||
int xstzSize = FormatUtils::BytesToInt16( cch, 0, cchSize ) * 2;
|
||||
int xstzSize = DocFormatUtils::FormatUtils::BytesToInt16( cch, 0, cchSize ) * 2;
|
||||
xstz = ReadBytes(xstzSize, true);
|
||||
|
||||
FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &wstrResult, xstz, xstzSize, ENCODING_UTF16 );
|
||||
DocFormatUtils::FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &wstrResult, xstz, xstzSize, ENCODING_UTF16 );
|
||||
}
|
||||
|
||||
RELEASEARRAYOBJECTS(xstz);
|
||||
@ -234,7 +234,7 @@ public:
|
||||
//dont read the terminating zero
|
||||
unsigned char* stringBytes = ReadBytes( ( cch * 2 ), true );
|
||||
|
||||
FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &result, stringBytes, ( ( cch * 2 ) - 2 ), ENCODING_UTF16 );
|
||||
DocFormatUtils::FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &result, stringBytes, ( ( cch * 2 ) - 2 ), ENCODING_UTF16 );
|
||||
|
||||
RELEASEARRAYOBJECTS( stringBytes );
|
||||
}
|
||||
@ -278,7 +278,7 @@ public:
|
||||
//dont read the terminating zero
|
||||
stringBytes = ReadBytes( cch, true );
|
||||
|
||||
FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &result, stringBytes, ( cch - 1 ), ENCODING_WINDOWS_1250);
|
||||
DocFormatUtils::FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &result, stringBytes, ( cch - 1 ), ENCODING_WINDOWS_1250);
|
||||
|
||||
}
|
||||
RELEASEARRAYOBJECTS( stringBytes );
|
||||
|
||||
@ -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)
|
||||
{
|
||||
@ -470,6 +470,7 @@ namespace DocFileFormat
|
||||
delete storageOut;
|
||||
return false;
|
||||
}
|
||||
|
||||
std::list<std::string> listStream = storageIn->entries();
|
||||
|
||||
for (std::list<std::string>::iterator it = listStream.begin(); it != listStream.end(); it++)
|
||||
@ -484,9 +485,12 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DecryptStream(Decryptor, *it, storageIn, storageOut);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
storageOut->close();
|
||||
delete storageOut;
|
||||
|
||||
@ -508,9 +512,7 @@ namespace DocFileFormat
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool WordDocument::DecryptStream(CRYPT::Decryptor* Decryptor, std::string streamName, POLE::Storage * storageIn, POLE::Storage * storageOut)
|
||||
bool WordDocument::CopyStream (std::string streamName, POLE::Storage * storageIn, POLE::Storage * storageOut)
|
||||
{
|
||||
POLE::Stream *stream = new POLE::Stream(storageIn, streamName);
|
||||
if (!stream) return false;
|
||||
@ -524,24 +526,59 @@ namespace DocFileFormat
|
||||
unsigned char* data_stream = new unsigned char[sz_stream];
|
||||
stream->read(data_stream, sz_stream);
|
||||
|
||||
streamNew->write(data_stream, sz_stream);
|
||||
|
||||
RELEASEARRAYOBJECTS(data_stream);
|
||||
|
||||
streamNew->flush();
|
||||
|
||||
delete streamNew;
|
||||
delete stream;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool WordDocument::DecryptStream(CRYPT::Decryptor* Decryptor, std::string streamName, POLE::Storage * storageIn, POLE::Storage * storageOut)
|
||||
{
|
||||
POLE::Stream *stream = new POLE::Stream(storageIn, streamName);
|
||||
if (!stream) return false;
|
||||
|
||||
stream->seek(0);
|
||||
int size_stream = stream->size();
|
||||
|
||||
POLE::Stream *streamNew = new POLE::Stream(storageOut, streamName, true, size_stream);
|
||||
if (!streamNew) return false;
|
||||
|
||||
unsigned char* data_stream = new unsigned char[size_stream];
|
||||
stream->read(data_stream, size_stream);
|
||||
|
||||
unsigned char* data_store = NULL;
|
||||
int sz_data_store = 0;
|
||||
int size_data_store = 0;
|
||||
|
||||
if ("WordDocument" == streamName)
|
||||
{
|
||||
sz_data_store = 68;
|
||||
data_store = new unsigned char[sz_data_store];
|
||||
size_data_store = 68;
|
||||
data_store = new unsigned char[size_data_store];
|
||||
}
|
||||
|
||||
if (data_store)
|
||||
memcpy(data_store, data_stream, sz_data_store);
|
||||
memcpy(data_store, data_stream, size_data_store);
|
||||
|
||||
int size_block = 0x200;
|
||||
for (int pos = 0, block = 0 ; pos < size_stream; pos += size_block, block++)
|
||||
{
|
||||
if (pos + size_block > size_stream)
|
||||
size_block = size_stream - pos;
|
||||
|
||||
Decryptor->Decrypt((char*)data_stream + pos, size_block, block);
|
||||
}
|
||||
|
||||
Decryptor->Decrypt((char*)data_stream, sz_stream, 0);
|
||||
|
||||
if (data_store)
|
||||
memcpy(data_stream, data_store, sz_data_store);
|
||||
memcpy(data_stream, data_store, size_data_store);
|
||||
|
||||
streamNew->write(data_stream, sz_stream);
|
||||
streamNew->write(data_stream, size_stream);
|
||||
|
||||
RELEASEARRAYOBJECTS(data_store);
|
||||
RELEASEARRAYOBJECTS(data_stream);
|
||||
|
||||
@ -103,6 +103,7 @@ namespace DocFileFormat
|
||||
private:
|
||||
bool DecryptOfficeFile (CRYPT::Decryptor* Decryptor);
|
||||
bool DecryptStream (CRYPT::Decryptor* Decryptor, std::string streamName, POLE::Storage * storageIn, POLE::Storage * storageOut);
|
||||
bool CopyStream (std::string streamName, POLE::Storage * storageIn, POLE::Storage * storageOut);
|
||||
|
||||
inline StructuredStorageReader* GetStorage() const
|
||||
{
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -178,7 +178,9 @@ namespace BinXlsxRW{
|
||||
{
|
||||
std::wstring sXlsxFilename = L"Microsoft_Excel_Worksheet" + std::to_wstring(lChartNumber) + L".xlsx";
|
||||
std::wstring sXlsxPath = sEmbedingPath + FILE_SEPARATOR_STR + sXlsxFilename;
|
||||
|
||||
writeChartXlsx(sXlsxPath, oChartSpace);
|
||||
pReader->m_pRels->m_pManager->m_pContentTypes->AddDefault(L"xlsx");
|
||||
|
||||
std::wstring sChartsWorksheetRelsName = L"../embeddings/" + sXlsxFilename;
|
||||
long rId;
|
||||
|
||||
@ -87,9 +87,10 @@ public:
|
||||
std::wstring convert_conditional_formula(std::wstring const & expr);
|
||||
|
||||
// Лист1!$A$1 -> $Лист1.$A$1
|
||||
std::wstring convert_named_ref(std::wstring const & expr);
|
||||
std::wstring convert_named_ref (std::wstring const & expr);
|
||||
std::wstring convert_named_formula(std::wstring const & expr);
|
||||
|
||||
std::wstring find_base_cell(std::wstring const & expr);
|
||||
std::wstring get_base_cell_formula(std::wstring const & expr);
|
||||
|
||||
//Sheet2!C3:C19 -> Sheet2.C3:Sheet2.C19
|
||||
std::wstring convert_chart_distance(std::wstring const & expr);
|
||||
|
||||
@ -57,6 +57,7 @@ namespace formulasconvert {
|
||||
static std::wstring replace_named_ref_formater1(boost::wsmatch const & what);
|
||||
static std::wstring replace_cell_range_formater(boost::wsmatch const & what);
|
||||
|
||||
void replace_named_formula(std::wstring & expr, bool w = true);
|
||||
void replace_named_ref(std::wstring & expr, bool w = true);
|
||||
bool find_first_ref(std::wstring const & expr, std::wstring & table, std::wstring & ref);
|
||||
bool find_first_last_ref(std::wstring const & expr, std::wstring & table, std::wstring & ref_first,std::wstring & ref_last);
|
||||
@ -263,15 +264,12 @@ namespace formulasconvert {
|
||||
return what[2].str();
|
||||
else if (what[3].matched)
|
||||
return what[3].str();
|
||||
//else if (what[4].matched)
|
||||
// return what[4].str();
|
||||
else
|
||||
return L"";
|
||||
}
|
||||
|
||||
// TODO
|
||||
// заменить точки с запятой во всех вхождениях кроме находящихся в кавычках --*и в фигурных скобках*--
|
||||
// TODO: проверить как сохраняются кавычки в строке
|
||||
void odf2oox_converter::Impl::replace_semicolons(std::wstring& expr)
|
||||
{
|
||||
const std::wstring res = boost::regex_replace(
|
||||
|
||||
@ -43,6 +43,7 @@ namespace formulasconvert {
|
||||
class oox2odf_converter::Impl
|
||||
{
|
||||
public:
|
||||
|
||||
std::wstring convert(const std::wstring& expr);
|
||||
std::wstring convert_formula(const std::wstring& expr);
|
||||
std::wstring convert_conditional_formula(const std::wstring& expr);
|
||||
@ -59,93 +60,17 @@ public:
|
||||
static std::wstring replace_arguments(boost::wsmatch const & what);
|
||||
static std::wstring convert_scobci(boost::wsmatch const & what);
|
||||
|
||||
std::wstring replace_arguments1(std::wstring & workstr);
|
||||
|
||||
void replace_named_ref(std::wstring & expr);
|
||||
void replace_named_formula(std::wstring & expr);
|
||||
|
||||
std::wstring find_base_cell(const std::wstring & expr);
|
||||
static bool isFindBaseCell_;
|
||||
|
||||
// bool find_first_ref(std::wstring const & expr, std::wstring & table, std::wstring & ref);
|
||||
//bool find_first_last_ref(std::wstring const & expr, std::wstring & table, std::wstring & ref_first,std::wstring & ref_last);
|
||||
static std::wstring base_cell_formula_;
|
||||
};
|
||||
////Table!.$A$1:$A2 -> ref $A$1 -> ref $A$2
|
||||
//bool oox2odf_converter::Impl::find_first_last_ref(std::wstring const & expr, std::wstring & table,std::wstring & ref_first,std::wstring & ref_last)
|
||||
//{
|
||||
// std::vector< std::wstring > splitted;
|
||||
//
|
||||
// boost::algorithm::split(splitted, expr, boost::algorithm::is_any_of(L".:"), boost::algorithm::token_compress_on);
|
||||
//
|
||||
// if (splitted.size()>2)
|
||||
// {
|
||||
// table = splitted[0];
|
||||
// ref_first = splitted[1];
|
||||
// ref_last = splitted[2];
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
//}
|
||||
// // =[.A1]+[.B1] -> table = ""; ref = "A1"
|
||||
// // of:=['Sheet2 A'.B2] -> table= "Sheet2 A"; ref = "B2"
|
||||
//
|
||||
//bool oox2odf_converter::Impl::find_first_ref(std::wstring const & expr, std::wstring & table, std::wstring & ref)
|
||||
//{
|
||||
// boost::wregex re(L"\\[(?:\\$)?([^\\.]+?){0,1}\\.([a-zA-Z\\$]+\\d+)(?::\\.([a-zA-Z]+\\d+)){0,1}\\]");
|
||||
// boost::wsmatch result;
|
||||
// bool b = boost::regex_search(expr, result, re);
|
||||
//
|
||||
// size_t sz = result.size();
|
||||
// if (sz == 4 && !result[1].matched)
|
||||
// {
|
||||
// table = L"";
|
||||
// ref = result[2].str();
|
||||
// return true;
|
||||
// }
|
||||
// else if (sz == 4 && result[1].matched)
|
||||
// {
|
||||
// table = result[1].str();
|
||||
// XmlUtils::replace_all( table, L"$", L"");
|
||||
// XmlUtils::replace_all( table, L"'", L"");
|
||||
// ref = result[2].str();
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
//}
|
||||
//
|
||||
//namespace
|
||||
//{
|
||||
//
|
||||
//std::wstring replace_cell_range_formater(boost::wsmatch const & what)
|
||||
//{
|
||||
// const size_t sz = what.size();
|
||||
// if (sz == 4 && !what[1].matched)
|
||||
// {
|
||||
// const std::wstring c1 = what[2].str();
|
||||
// const std::wstring c2 = what[3].str();
|
||||
// const std::wstring s = c1 + (c2.empty() ? L"" : (L":" + c2) );
|
||||
// return s;
|
||||
// }
|
||||
// else if (sz == 4 && what[1].matched)
|
||||
// {
|
||||
// std::wstring sheet1 = what[1].str();
|
||||
// XmlUtils::replace_all( sheet1, L"$", L"");
|
||||
//
|
||||
// const std::wstring c1 = what[2].str();
|
||||
// const std::wstring c2 = what[3].str();
|
||||
// const std::wstring s = sheet1 + L"!" + c1 + (c2.empty() ? L"" : (L":" + c2) );
|
||||
// return s;
|
||||
// }
|
||||
// return L"";
|
||||
//}
|
||||
//
|
||||
//}
|
||||
//
|
||||
|
||||
// заменяем формат адресации ячеек НАОБОРОТ
|
||||
// [.A1] -> A1
|
||||
// [.A1:.B5] -> A1:B5
|
||||
// [Sheet2.A1:B5] -> Sheet2!A1:B5
|
||||
// [Sheet2.A1] -> Sheet2!A1
|
||||
// [$'Sheet2 A'.$B2] -> 'Sheet2 A'!$B2
|
||||
bool oox2odf_converter::Impl::isFindBaseCell_ = false;
|
||||
std::wstring oox2odf_converter::Impl::base_cell_formula_ = L"";
|
||||
|
||||
void oox2odf_converter::Impl::replace_cells_range(std::wstring& expr)
|
||||
{
|
||||
boost::wregex re(L"([:$!])+");
|
||||
@ -155,8 +80,10 @@ void oox2odf_converter::Impl::replace_cells_range(std::wstring& expr)
|
||||
|
||||
if (b)
|
||||
{
|
||||
boost::wregex re1(L"(\\$?\\w+\\!)?([a-zA-Z$]+\\d{1,})\\:?([a-zA-Z$]+\\d{1,})?");
|
||||
// $ Sheet2 ! $ A1 : $ B5
|
||||
boost::wregex re1(L"(\\$?\\w+\\!)?([a-zA-Z$]*\\d*)\\:?([a-zA-Z$]*\\d*)?");
|
||||
// $ Sheet2 ! $ A1 : $ B5
|
||||
// $ Sheet2 ! $ A : $ A
|
||||
// $ Sheet2 ! $ 1 : $ 1
|
||||
std::wstring workstr = expr;
|
||||
|
||||
std::wstring res = boost::regex_replace(
|
||||
@ -178,19 +105,28 @@ std::wstring oox2odf_converter::Impl::replace_cells_range_formater1(boost::wsmat
|
||||
{
|
||||
const size_t sz = what.size();
|
||||
|
||||
if (sz>3)
|
||||
if (sz > 3)
|
||||
{
|
||||
std::wstring sheet1 = what[1].matched ? what[1].str() : L"";
|
||||
XmlUtils::replace_all( sheet1, L"!", L"");
|
||||
std::wstring s;
|
||||
std::wstring sheet = what[1].matched ? what[1].str() : L"";
|
||||
|
||||
std::wstring c1 = what[2].str();
|
||||
std::wstring c2 = what[3].str();
|
||||
int res=0;
|
||||
if (sheet1.length() > 0 && (res = c1.find(L"$")) >=0) sheet1 = L"$" + sheet1;
|
||||
|
||||
if (!c1.empty() || !c2.empty() || !sheet.empty())
|
||||
{
|
||||
XmlUtils::replace_all( sheet, L"!", L"");
|
||||
|
||||
const std::wstring s = std::wstring(L"[") + sheet1 + L"." +
|
||||
c1 +
|
||||
(c2.empty() ? L"" : (L":" + sheet1 + L"." + c2) ) + std::wstring(L"]");
|
||||
if (isFindBaseCell_ && base_cell_formula_.empty() && !sheet.empty())
|
||||
{
|
||||
base_cell_formula_ = sheet + L".$A$1";
|
||||
}
|
||||
if (!sheet.empty() && (std::wstring::npos != c1.find(L"$"))) sheet = L"$" + sheet;
|
||||
|
||||
s = std::wstring(L"[") + sheet + L"." +
|
||||
c1 +
|
||||
(c2.empty() ? L"" : (L":" + sheet + L"." + c2) ) + std::wstring(L"]");
|
||||
}
|
||||
return s;
|
||||
}
|
||||
else
|
||||
@ -209,7 +145,7 @@ std::wstring oox2odf_converter::Impl::replace_cells_range_formater2(boost::wsmat
|
||||
{
|
||||
const size_t sz = what.size();
|
||||
|
||||
if (sz>2)
|
||||
if (sz > 2)
|
||||
{
|
||||
const std::wstring c1 = what[1].str();
|
||||
const std::wstring c2 = what[2].str();
|
||||
@ -222,39 +158,22 @@ std::wstring oox2odf_converter::Impl::replace_cells_range_formater2(boost::wsmat
|
||||
return L"";
|
||||
|
||||
}
|
||||
|
||||
//namespace {
|
||||
//
|
||||
//std::wstring replace_named_ref_formater(boost::wsmatch const & what)
|
||||
//{
|
||||
// const size_t sz = what.size();
|
||||
//
|
||||
// if (sz == 4 && !what[1].matched)
|
||||
// {
|
||||
// const std::wstring c1 = what[2].str();
|
||||
// const std::wstring c2 = what[3].str();
|
||||
// const std::wstring s = c1 + (c2.empty() ? L"" : (L":" + c2) );
|
||||
// return s;
|
||||
// }
|
||||
// else if (sz == 4 && what[1].matched)
|
||||
// {
|
||||
// std::wstring sheet1 = what[1].str();
|
||||
// XmlUtils::replace_all( sheet1, L"$", L"");
|
||||
//
|
||||
// const std::wstring c1 = what[2].str();
|
||||
// const std::wstring c2 = what[3].str();
|
||||
// const std::wstring s = sheet1 + L"!" + c1 + (c2.empty() ? L"" : (L":" + c2) );
|
||||
// return s;
|
||||
// }
|
||||
// return L"";
|
||||
//}
|
||||
//
|
||||
//}
|
||||
|
||||
void oox2odf_converter::Impl::replace_named_formula(std::wstring & expr)
|
||||
{
|
||||
base_cell_formula_.clear();
|
||||
|
||||
isFindBaseCell_ = true;
|
||||
expr = convert_formula(expr);
|
||||
isFindBaseCell_ = false;
|
||||
}
|
||||
|
||||
// Лист1!$A$1 -> $Лист1.$A$1
|
||||
|
||||
void oox2odf_converter::Impl::replace_named_ref(std::wstring & expr)
|
||||
{
|
||||
base_cell_formula_.clear();
|
||||
|
||||
isFindBaseCell_ = true;
|
||||
std::wstring workstr = expr, out;
|
||||
|
||||
replace_vertical(workstr);
|
||||
@ -264,8 +183,10 @@ void oox2odf_converter::Impl::replace_named_ref(std::wstring & expr)
|
||||
|
||||
boost::algorithm::split(distance,workstr, boost::algorithm::is_any_of(L";"), boost::algorithm::token_compress_on);
|
||||
|
||||
BOOST_FOREACH(std::wstring &d, distance)
|
||||
for (size_t i = 0; i < distance.size(); i++)
|
||||
{
|
||||
std::wstring &d = distance[i];
|
||||
|
||||
XmlUtils::replace_all( d, L"(", L"SCOBCAIN");
|
||||
XmlUtils::replace_all( d, L")", L"SCOBCAOUT");
|
||||
XmlUtils::replace_all( d, L" ", L"PROBEL");
|
||||
@ -283,21 +204,9 @@ void oox2odf_converter::Impl::replace_named_ref(std::wstring & expr)
|
||||
out = out + d + std::wstring(L";");
|
||||
}
|
||||
|
||||
if (out.length()>0) expr = out.substr(0,out.length()-1);
|
||||
if (!out.empty()) expr = out.substr(0, out.length() - 1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
std::wstring oox2odf_converter::Impl::find_base_cell(const std::wstring & expr)
|
||||
{
|
||||
std::vector< std::wstring > splitted;
|
||||
boost::algorithm::split(splitted, expr, boost::algorithm::is_any_of(L"!"), boost::algorithm::token_compress_on);
|
||||
|
||||
if (splitted.size()>1)
|
||||
{
|
||||
return splitted[0] + L".$A$1";
|
||||
}
|
||||
else return L"";
|
||||
isFindBaseCell_ = false;
|
||||
}
|
||||
|
||||
|
||||
@ -440,32 +349,6 @@ std::wstring replace_(boost::wsmatch const & what)
|
||||
|
||||
return L"";
|
||||
}
|
||||
std::wstring oox2odf_converter::Impl::replace_arguments1(std::wstring & workstr1)
|
||||
{
|
||||
std::wstring out;
|
||||
|
||||
std::wstring workstr = workstr1;
|
||||
|
||||
replace_vertical(workstr);
|
||||
replace_semicolons(workstr);
|
||||
|
||||
std::vector<std::wstring> distance;
|
||||
|
||||
boost::algorithm::split(distance,workstr, boost::algorithm::is_any_of(L";"), boost::algorithm::token_compress_on);
|
||||
|
||||
BOOST_FOREACH(std::wstring &d, distance)
|
||||
{
|
||||
|
||||
replace_cells_range(d);
|
||||
|
||||
out = out + d + std::wstring(L";");
|
||||
}
|
||||
|
||||
if (out.length()>0) out = out.substr(0,out.length()-1);
|
||||
|
||||
|
||||
return out ;
|
||||
}
|
||||
std::wstring oox2odf_converter::Impl::convert_scobci(boost::wsmatch const & what)
|
||||
{
|
||||
if (what[1].matched)
|
||||
@ -506,33 +389,31 @@ std::wstring oox2odf_converter::Impl::replace_arguments(boost::wsmatch const &
|
||||
|
||||
int sz = what.size();
|
||||
|
||||
std::wstring c1= what[1].str();
|
||||
std::wstring c2= what[2].str();
|
||||
std::wstring c3= what[3].str();
|
||||
|
||||
if (what[1].matched)
|
||||
{
|
||||
std::wstring workstr = what[1].str();
|
||||
replace_vertical(workstr);
|
||||
replace_semicolons(workstr);
|
||||
|
||||
out = what[1].str();
|
||||
}
|
||||
else if (what[2].matched)
|
||||
{
|
||||
out = what[2].str();
|
||||
}
|
||||
if (!out.empty())
|
||||
{
|
||||
std::vector<std::wstring> distance;
|
||||
|
||||
boost::algorithm::split(distance,workstr, boost::algorithm::is_any_of(L";"), boost::algorithm::token_compress_on);
|
||||
boost::algorithm::split(distance, out, boost::algorithm::is_any_of(L";"), boost::algorithm::token_compress_on);
|
||||
|
||||
BOOST_FOREACH(std::wstring &d, distance)
|
||||
{
|
||||
|
||||
replace_cells_range(d);
|
||||
out = L"";
|
||||
for (size_t i = 0; i < distance.size(); i++)
|
||||
{
|
||||
replace_cells_range(distance[i]);
|
||||
|
||||
out = out + d + std::wstring(L";");
|
||||
out = out + distance[i] + std::wstring(L";");
|
||||
}
|
||||
|
||||
if (out.length()>0) out = out.substr(0,out.length()-1);
|
||||
if (!out.empty()) out = out.substr(0, out.length() - 1);
|
||||
|
||||
}
|
||||
else if (what[2].matched)
|
||||
out = what[2].str();
|
||||
else if (what[3].matched)
|
||||
out = what[3].str();
|
||||
return out ;
|
||||
@ -560,7 +441,7 @@ std::wstring oox2odf_converter::Impl::convert_formula(const std::wstring & expr)
|
||||
|
||||
std::wstring res = boost::regex_replace(
|
||||
res1,
|
||||
boost::wregex(L"(?:(?=[()])(.*?)(?=[)]))"),
|
||||
boost::wregex(L"(?!([a-zA-Z]+\\d*\\())(([a-zA-Z]+\\!)?\\$?[a-zA-Z]*\\$?\\d*(\\:\\$?[a-zA-Z]*\\$?\\d*){0,1})"),
|
||||
&oox2odf_converter::Impl::replace_arguments, boost::match_default | boost::format_all);
|
||||
|
||||
if (res1 == res)
|
||||
@ -572,10 +453,6 @@ std::wstring oox2odf_converter::Impl::convert_formula(const std::wstring & expr)
|
||||
boost::wregex(L"(\\$?\\w+\\!)?([a-zA-Z$]+\\d{1,})\\:?([a-zA-Z$]+\\d{1,})?"),
|
||||
&replace_cells_range_formater1,
|
||||
boost::match_default | boost::format_all);
|
||||
|
||||
|
||||
replace_vertical(res);
|
||||
replace_semicolons(res);
|
||||
}
|
||||
|
||||
XmlUtils::replace_all( res, L"SCOBCAIN", L"(");
|
||||
@ -584,12 +461,16 @@ std::wstring oox2odf_converter::Impl::convert_formula(const std::wstring & expr)
|
||||
XmlUtils::replace_all( res, L"KVADRATIN", L"[");
|
||||
XmlUtils::replace_all( res, L"KVADRATOUT", L"]");
|
||||
|
||||
XmlUtils::replace_all( res, L"PROBEL", L" ");
|
||||
|
||||
XmlUtils::replace_all( res, L"APOSTROF", L"'");
|
||||
|
||||
XmlUtils::replace_all( res, L"KAVYCHKA", L"\"");
|
||||
|
||||
replace_vertical(res);
|
||||
replace_semicolons(res);
|
||||
|
||||
XmlUtils::replace_all( res, L"PROBEL", L" ");
|
||||
|
||||
return std::wstring(L"of:=") + res;
|
||||
|
||||
}
|
||||
@ -600,12 +481,12 @@ std::wstring oox2odf_converter::Impl::convert_conditional_formula(const std::wst
|
||||
std::wstring res1 = boost::regex_replace(
|
||||
workstr,
|
||||
boost::wregex(L"('.*?')|(\".*?\")"),
|
||||
&oox2odf_converter::Impl::convert_scobci,boost::match_default | boost::format_all);
|
||||
&oox2odf_converter::Impl::convert_scobci, boost::match_default | boost::format_all);
|
||||
|
||||
std::wstring res = boost::regex_replace(
|
||||
res1,
|
||||
boost::wregex(L"(?:(?=[()])(.*?)(?=[)]))"),
|
||||
&oox2odf_converter::Impl::replace_arguments,boost::match_default | boost::format_all);
|
||||
&oox2odf_converter::Impl::replace_arguments, boost::match_default | boost::format_all);
|
||||
|
||||
if (res1 == res)
|
||||
{
|
||||
@ -614,20 +495,21 @@ std::wstring oox2odf_converter::Impl::convert_conditional_formula(const std::wst
|
||||
&replace_cells_range_formater1,
|
||||
boost::match_default | boost::format_all);
|
||||
|
||||
replace_vertical(res);
|
||||
replace_semicolons(res);
|
||||
}
|
||||
|
||||
XmlUtils::replace_all( res, L"SCOBCAIN", L"(");
|
||||
XmlUtils::replace_all( res, L"SCOBCAOUT", L")");
|
||||
|
||||
XmlUtils::replace_all( res, L"PROBEL", L" ");
|
||||
|
||||
XmlUtils::replace_all( res, L"APOSTROF", L"'");
|
||||
|
||||
XmlUtils::replace_all( res, L"KAVYCHKA", L"\"");
|
||||
|
||||
return res;
|
||||
replace_vertical(res);
|
||||
replace_semicolons(res);
|
||||
|
||||
XmlUtils::replace_all( res, L"PROBEL", L" ");
|
||||
|
||||
return res;
|
||||
|
||||
}
|
||||
//Sheet2!C3:C19,Sheet2!L27:L34
|
||||
@ -726,9 +608,15 @@ std::wstring oox2odf_converter::convert_named_ref(const std::wstring& expr)
|
||||
impl_->replace_named_ref(workstr);
|
||||
return workstr;
|
||||
}
|
||||
std::wstring oox2odf_converter::find_base_cell(const std::wstring& expr)
|
||||
std::wstring oox2odf_converter::convert_named_formula(const std::wstring& expr)
|
||||
{
|
||||
return impl_->find_base_cell(expr);
|
||||
std::wstring workstr = expr;
|
||||
impl_->replace_named_formula(workstr);
|
||||
return workstr;
|
||||
}
|
||||
std::wstring oox2odf_converter::get_base_cell_formula(const std::wstring& expr)
|
||||
{
|
||||
return impl_->base_cell_formula_;
|
||||
}
|
||||
|
||||
|
||||
@ -840,14 +728,6 @@ int oox2odf_converter::get_count_value_points(std::wstring expr)
|
||||
return count;
|
||||
}
|
||||
|
||||
//bool oox2odf_converter::find_first_ref(std::wstring const & expr, std::wstring & table, std::wstring & ref)
|
||||
//{
|
||||
// return impl_->find_first_ref(expr, table, ref);
|
||||
//}
|
||||
//bool oox2odf_converter::find_first_last_ref(std::wstring const & expr, std::wstring & table, std::wstring & ref_first,std::wstring & ref_last)
|
||||
//{
|
||||
// return impl_->find_first_last_ref(expr, table, ref_first,ref_last);
|
||||
//}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -307,6 +307,7 @@ namespace
|
||||
content << L"<w:" << Node << L"s \
|
||||
xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
|
||||
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
|
||||
xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \
|
||||
xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \
|
||||
xmlns:w10=\"urn:schemas-microsoft-com:office:word\" \
|
||||
xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" \
|
||||
|
||||
@ -189,8 +189,14 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
|
||||
CP_XML_STREAM() << impl_->hyperlinks_.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")
|
||||
@ -205,10 +211,7 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
|
||||
CP_XML_STREAM() << impl_->ole_objects_.str();
|
||||
}
|
||||
}
|
||||
if (!impl_->page_props_.str().empty())
|
||||
{
|
||||
CP_XML_STREAM() << impl_->page_props_.str();
|
||||
}
|
||||
|
||||
//CP_XML_NODE(L"headerFooter){}
|
||||
|
||||
//CP_XML_NODE(L"rowBreaks){}
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
@ -34,8 +34,6 @@
|
||||
#include "office_presentation.h"
|
||||
#include "draw_page.h"
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
#include <cpdoccore/xml/xmlchar.h>
|
||||
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
@ -76,9 +74,10 @@ void office_presentation::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
Context.start_office_text();
|
||||
_CP_LOG << L"[info][docx] process pages (" << pages_.size() << L" elmements)" << std::endl;
|
||||
BOOST_FOREACH(const office_element_ptr & elm, pages_)
|
||||
{
|
||||
elm->docx_convert(Context);
|
||||
|
||||
for (size_t i = 0; i < pages_.size(); i++)
|
||||
{
|
||||
pages_[i]->docx_convert(Context);
|
||||
}
|
||||
Context.end_office_text();
|
||||
}
|
||||
@ -87,9 +86,10 @@ void office_presentation::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
Context.start_office_spreadsheet(this);
|
||||
_CP_LOG << L"[info][xlsx] process pages (" << pages_.size() << L" elmements)" << std::endl;
|
||||
BOOST_FOREACH(const office_element_ptr & elm, pages_)
|
||||
{
|
||||
elm->xlsx_convert(Context);
|
||||
|
||||
for (size_t i = 0; i < pages_.size(); i++)
|
||||
{
|
||||
pages_[i]->xlsx_convert(Context);
|
||||
}
|
||||
Context.end_office_spreadsheet();
|
||||
}
|
||||
@ -100,29 +100,29 @@ void office_presentation::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
|
||||
_CP_LOG << L"[info][pptx] process pages(" << pages_.size() << L" elmements)" << std::endl;
|
||||
|
||||
BOOST_FOREACH(const office_element_ptr & elm, footer_decls_)
|
||||
for (size_t i = 0; i < footer_decls_.size(); i++)
|
||||
{
|
||||
presentation_footer_decl * style = dynamic_cast<presentation_footer_decl *>(elm.get());
|
||||
presentation_footer_decl * style = dynamic_cast<presentation_footer_decl *>(footer_decls_[i].get());
|
||||
|
||||
if (!style)
|
||||
continue;
|
||||
|
||||
std::wstring style_name_ = L"footer:" + style->presentation_name_.get_value_or(L"");
|
||||
Context.root()->odf_context().drawStyles().add(style_name_, elm);
|
||||
Context.root()->odf_context().drawStyles().add(style_name_, footer_decls_[i]);
|
||||
}
|
||||
BOOST_FOREACH(const office_element_ptr & elm, date_time_decls_)
|
||||
{
|
||||
presentation_date_time_decl * style = dynamic_cast<presentation_date_time_decl *>(elm.get());
|
||||
for (size_t i = 0; i < date_time_decls_.size(); i++)
|
||||
{
|
||||
presentation_date_time_decl * style = dynamic_cast<presentation_date_time_decl *>(date_time_decls_[i].get());
|
||||
|
||||
if (!style)
|
||||
continue;
|
||||
|
||||
std::wstring style_name_ = L"datetime:" + style->presentation_name_.get_value_or(L"");
|
||||
Context.root()->odf_context().drawStyles().add(style_name_, elm);
|
||||
Context.root()->odf_context().drawStyles().add(style_name_, date_time_decls_[i]);
|
||||
}
|
||||
BOOST_FOREACH(const office_element_ptr & elm, pages_)
|
||||
for (size_t i = 0; i < pages_.size(); i++)
|
||||
{
|
||||
elm->pptx_convert(Context);
|
||||
pages_[i]->pptx_convert(Context);
|
||||
}
|
||||
Context.end_office_presentation();
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -138,7 +138,8 @@ void ods_table_context::add_defined_range(const std::wstring & name, const std::
|
||||
std::wstring odf_range = formulas_converter.convert_named_ref(cell_range);//todo - разделить конвертацию диапазонов/рэнжей на c [] и без
|
||||
XmlUtils::replace_all( odf_range, L"[", L"");
|
||||
XmlUtils::replace_all( odf_range, L"]", L"");
|
||||
std::wstring odf_base_cell = formulas_converter.find_base_cell(cell_range);
|
||||
|
||||
std::wstring odf_base_cell = formulas_converter.get_base_cell_formula(cell_range);
|
||||
|
||||
named_range->table_name_ = name;
|
||||
named_range->table_cell_range_address_ = odf_range;
|
||||
@ -181,8 +182,8 @@ void ods_table_context::add_defined_expression(const std::wstring & name, const
|
||||
|
||||
formulasconvert::oox2odf_converter formulas_converter;
|
||||
|
||||
std::wstring odf_value = formulas_converter.convert_named_ref(value);
|
||||
std::wstring odf_base_cell = formulas_converter.find_base_cell(value);
|
||||
std::wstring odf_value = formulas_converter.convert_named_formula(value);
|
||||
std::wstring odf_base_cell = formulas_converter.get_base_cell_formula(value);
|
||||
|
||||
named_expression->table_name_ = name;
|
||||
named_expression->table_expression_ = odf_value;
|
||||
@ -215,10 +216,9 @@ void ods_table_context::add_defined_expression(const std::wstring & name, const
|
||||
table_defined_expressions_.root->add_child_element(elm);
|
||||
}
|
||||
|
||||
if (odf_base_cell.length() > 0)
|
||||
if (!odf_base_cell.empty())
|
||||
named_expression->table_base_cell_address_ = odf_base_cell;
|
||||
|
||||
|
||||
table_defined_expressions_.elements.push_back(elm);
|
||||
}
|
||||
|
||||
|
||||
@ -602,17 +602,24 @@ void OoxConverter::convert(PPTX::Logic::SpPr *oox_spPr, PPTX::Logic::ShapeStyle*
|
||||
|
||||
bool bLine = odf_context()->drawing_context()->isLineShape();
|
||||
|
||||
if (!bLine)
|
||||
if (custGeom && !custGeom->cxnLst.empty())
|
||||
bLine = true;
|
||||
|
||||
odf_context()->drawing_context()->start_area_properties();
|
||||
{
|
||||
odf_context()->drawing_context()->start_area_properties();
|
||||
if (bLine)
|
||||
{
|
||||
odf_context()->drawing_context()->set_no_fill();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (oox_spPr->Fill.is_init())
|
||||
convert(&oox_spPr->Fill);
|
||||
else if (oox_sp_style)
|
||||
convert(&oox_sp_style->fillRef, 1);
|
||||
}
|
||||
odf_context()->drawing_context()->end_area_properties();
|
||||
}
|
||||
odf_context()->drawing_context()->end_area_properties();
|
||||
|
||||
odf_context()->drawing_context()->start_line_properties();
|
||||
{
|
||||
|
||||
@ -72,6 +72,7 @@ using namespace cpdoccore;
|
||||
|
||||
namespace Oox2Odf
|
||||
{
|
||||
|
||||
PptxConverter::PptxConverter(const std::wstring & path, const ProgressCallback* CallBack)
|
||||
{
|
||||
current_clrMap = NULL;
|
||||
@ -342,7 +343,7 @@ void PptxConverter::convert_slides()
|
||||
current_slide = slide->Master.operator->();
|
||||
|
||||
if (bShowLayoutMasterSp && bShowMasterSp)
|
||||
convert_slide(&slide->Master->cSld, current_txStyles, false, true, 2);
|
||||
convert_slide(&slide->Master->cSld, current_txStyles, false, true, Master);
|
||||
else
|
||||
convert(slide->Master->cSld.bg.GetPointer());
|
||||
|
||||
@ -350,7 +351,7 @@ void PptxConverter::convert_slides()
|
||||
current_clrMap = slide->Layout->clrMapOvr->overrideClrMapping.GetPointer();
|
||||
current_slide = slide->Layout.operator->();
|
||||
|
||||
convert_slide(&slide->Layout->cSld, current_txStyles, true, bShowLayoutMasterSp, 3);
|
||||
convert_slide(&slide->Layout->cSld, current_txStyles, true, bShowLayoutMasterSp, Layout);
|
||||
|
||||
if (slide->Layout->transition.IsInit()) convert (slide->Layout->transition.GetPointer());
|
||||
else convert (slide->Master->transition.GetPointer());
|
||||
@ -402,7 +403,7 @@ void PptxConverter::convert_slides()
|
||||
odp_context->current_slide().set_master_page (master_style_name);
|
||||
odp_context->current_slide().set_layout_page (layout_style_name);
|
||||
|
||||
convert_slide (slide->cSld.GetPointer(), current_txStyles, true, bShowMasterSp, 1);
|
||||
convert_slide (slide->cSld.GetPointer(), current_txStyles, true, bShowMasterSp, Slide);
|
||||
convert (slide->comments.operator->());
|
||||
convert (slide->Note.operator->());
|
||||
|
||||
@ -435,7 +436,7 @@ void PptxConverter::convert(PPTX::NotesMaster *oox_notes)
|
||||
|
||||
odf_context()->page_layout_context()->set_page_size(width, height);
|
||||
}
|
||||
convert_slide(&oox_notes->cSld, NULL, true, true, 2);
|
||||
convert_slide(&oox_notes->cSld, NULL, true, true, NotesMaster);
|
||||
|
||||
odp_context->end_note();
|
||||
|
||||
@ -468,7 +469,7 @@ void PptxConverter::convert(PPTX::NotesSlide *oox_notes)
|
||||
if (oox_notes->clrMapOvr.IsInit() && oox_notes->clrMapOvr->overrideClrMapping.IsInit())
|
||||
current_clrMap = oox_notes->clrMapOvr->overrideClrMapping.GetPointer();
|
||||
|
||||
convert_slide(&oox_notes->cSld, NULL, true, true, 1);
|
||||
convert_slide(&oox_notes->cSld, NULL, true, true, Notes);
|
||||
|
||||
odp_context->end_note();
|
||||
|
||||
@ -547,7 +548,7 @@ void PptxConverter::convert( PPTX::Logic::Transition *oox_transition )
|
||||
|
||||
if (oox_transition->advTm.is_init())
|
||||
{
|
||||
odp_context->current_slide().set_page_duration(*oox_transition->dur);
|
||||
odp_context->current_slide().set_page_duration(*oox_transition->advTm);
|
||||
}
|
||||
|
||||
if (oox_transition->base.is_init() == false) return;
|
||||
@ -1312,13 +1313,19 @@ void PptxConverter::convert(PPTX::Logic::Bg *oox_background)
|
||||
}
|
||||
odf_writer::style* page_style_ = dynamic_cast<odf_writer::style*>(odp_context->current_slide().page_style_elm_.get());
|
||||
odf_writer::style_drawing_page_properties* page_props = page_style_->content_.get_style_drawing_page_properties();
|
||||
|
||||
//необязательно
|
||||
//if (page_props->content_.common_draw_fill_attlist_.draw_fill_image_name_)
|
||||
//{
|
||||
// page_props->content_.draw_background_size_ = L"border";
|
||||
//}
|
||||
|
||||
odp_context->drawing_context()->end_drawing_background(page_props->content_.common_draw_fill_attlist_);
|
||||
|
||||
odp_context->end_drawings();
|
||||
}
|
||||
|
||||
void PptxConverter::convert_slide(PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxStyles* txStyles, bool bPlaceholders, bool bFillUp, int type)
|
||||
void PptxConverter::convert_slide(PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxStyles* txStyles, bool bPlaceholders, bool bFillUp, _typePages type)
|
||||
{
|
||||
if (oox_slide == NULL) return;
|
||||
|
||||
@ -1328,7 +1335,10 @@ void PptxConverter::convert_slide(PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxS
|
||||
if (oox_slide->attrName.IsInit())
|
||||
odp_context->current_slide().set_page_name(oox_slide->attrName.get());
|
||||
|
||||
convert(oox_slide->bg.GetPointer());
|
||||
if (type != Notes && type != NotesMaster)
|
||||
{
|
||||
convert(oox_slide->bg.GetPointer());
|
||||
}
|
||||
|
||||
for (size_t i = 0 ; i < oox_slide->spTree.SpTreeElems.size(); i++)
|
||||
{
|
||||
@ -1348,7 +1358,7 @@ void PptxConverter::convert_slide(PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxS
|
||||
{
|
||||
int ph_type = pShape->nvSpPr.nvPr.ph->type->GetBYTECode();
|
||||
|
||||
if (type == 3 && (ph_type == 5 || ph_type == 6 || ph_type == 7 || ph_type == 12))
|
||||
if (type == Layout && (ph_type == 5 || ph_type == 6 || ph_type == 7 || ph_type == 12))
|
||||
continue;
|
||||
|
||||
odf_context()->drawing_context()->set_placeholder_type(ph_type);
|
||||
|
||||
@ -100,6 +100,14 @@ using namespace cpdoccore;
|
||||
|
||||
namespace Oox2Odf
|
||||
{
|
||||
enum _typePages
|
||||
{
|
||||
Slide,
|
||||
Master,
|
||||
Layout,
|
||||
NotesMaster,
|
||||
Notes
|
||||
};
|
||||
class PptxConverter : public OoxConverter
|
||||
{
|
||||
public:
|
||||
@ -119,7 +127,7 @@ namespace Oox2Odf
|
||||
|
||||
void convert(OOX::WritingElement *oox_unknown);
|
||||
|
||||
void convert_slide (PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxStyles* txStyles, bool bPlaceholders, bool bFillUp, int type);
|
||||
void convert_slide (PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxStyles* txStyles, bool bPlaceholders, bool bFillUp, _typePages type);
|
||||
void convert_layout (PPTX::Logic::CSld *oox_slide);
|
||||
void convert (PPTX::Comments *oox_comments);
|
||||
void convert (PPTX::NotesSlide *oox_notes);
|
||||
|
||||
@ -176,6 +176,7 @@ SOURCES += \
|
||||
../Reader/ReadStructures.cpp \
|
||||
../Reader/PPTDocumentInfoOneUser.cpp \
|
||||
../Reader/Records.cpp \
|
||||
../Reader/PPTFileReader.cpp \
|
||||
../Reader/SlidePersist.cpp \
|
||||
../Records/Animations/AnimationTypes.cpp \
|
||||
../Records/Drawing/ArtBlip.cpp \
|
||||
|
||||
@ -32,6 +32,7 @@
|
||||
|
||||
#include "../Reader/ReadStructures.cpp"
|
||||
#include "../Reader/PPTDocumentInfoOneUser.cpp"
|
||||
#include "../Reader/PPTFileReader.cpp"
|
||||
#include "../Reader/Records.cpp"
|
||||
#include "../Reader/SlidePersist.cpp"
|
||||
#include "../Records/Animations/AnimationTypes.cpp"
|
||||
|
||||
@ -36,6 +36,7 @@
|
||||
#include "./Reader/PPTFileReader.h"
|
||||
#include "./PPTXWriter/Converter.h"
|
||||
|
||||
#include "../../../Common/OfficeFileErrorDescription.h"
|
||||
#include "../../../OfficeUtils/src/OfficeUtils.h"
|
||||
|
||||
#ifndef READMODE
|
||||
@ -51,31 +52,45 @@ COfficePPTFile::~COfficePPTFile()
|
||||
CloseFile();
|
||||
}
|
||||
|
||||
bool COfficePPTFile::OpenFile(std::wstring sFileName)
|
||||
long COfficePPTFile::OpenFile(const std::wstring & sFileName, const std::wstring & password)
|
||||
{
|
||||
CloseFile();
|
||||
|
||||
POLE::Storage *pStgFrom = new POLE::Storage(sFileName.c_str());
|
||||
if (pStgFrom == NULL) return FALSE;
|
||||
if (pStgFrom == NULL) return AVS_ERROR_FILEFORMAT;
|
||||
|
||||
pStgFrom->open(false,false);
|
||||
pStgFrom->open(false, false);
|
||||
|
||||
m_pReader = new CPPTFileReader(pStgFrom, m_strTempDirectory);
|
||||
((CPPTFileReader*)m_pReader)->m_oDocumentInfo.m_strFileDirectory = GetDirectory(sFileName.c_str());
|
||||
|
||||
if (!((CPPTFileReader*)m_pReader)->IsPowerPoint())
|
||||
CPPTFileReader* pptReader = (CPPTFileReader*)m_pReader;
|
||||
|
||||
pptReader->m_oDocumentInfo.m_strTmpDirectory = m_strTempDirectory;
|
||||
pptReader->m_oDocumentInfo.m_strPassword = password;
|
||||
|
||||
if (pptReader->IsPowerPoint() == false)
|
||||
{
|
||||
CPPTFileReader* r = (CPPTFileReader*)m_pReader; RELEASEOBJECT(r);
|
||||
RELEASEOBJECT(pptReader);
|
||||
m_pReader = NULL;
|
||||
return FALSE;
|
||||
return AVS_ERROR_FILEFORMAT;
|
||||
}
|
||||
|
||||
((CPPTFileReader*)m_pReader)->ReadPersistDirectory();
|
||||
((CPPTFileReader*)m_pReader)->ReadSlideList();
|
||||
if (pptReader->ReadPersists() == false)
|
||||
{
|
||||
if (pptReader->IsEncrypted())
|
||||
{
|
||||
if (password.empty()) return AVS_ERROR_DRM;
|
||||
else return AVS_ERROR_PASSWORD;
|
||||
}
|
||||
return AVS_ERROR_FILEFORMAT;
|
||||
}
|
||||
|
||||
//pptReader->ReadEncryptedSummary();
|
||||
//pptReader->ReadDocumentSummary();
|
||||
pptReader->ReadDocument();
|
||||
|
||||
m_Status = READMODE;
|
||||
|
||||
return TRUE;
|
||||
return S_OK;
|
||||
}
|
||||
bool COfficePPTFile::CloseFile()
|
||||
{
|
||||
@ -86,29 +101,28 @@ bool COfficePPTFile::CloseFile()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT COfficePPTFile::LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath)
|
||||
HRESULT COfficePPTFile::LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath, std::wstring password)
|
||||
{
|
||||
if (m_strTempDirectory.length() < 1)
|
||||
if (m_strTempDirectory.empty())
|
||||
{
|
||||
m_strTempDirectory = NSDirectory::GetTempPath();
|
||||
}
|
||||
|
||||
bool bRes = OpenFile(sSrcFileName);
|
||||
if (!bRes)
|
||||
long nResult = OpenFile(sSrcFileName, password);
|
||||
if (nResult != S_OK)
|
||||
{
|
||||
CloseFile();
|
||||
m_Status = NULLMODE;
|
||||
return S_FALSE;
|
||||
return nResult;
|
||||
}
|
||||
if (!((CPPTFileReader*)m_pReader)->m_oDocumentInfo.m_arUsers.empty())
|
||||
{
|
||||
NSPresentationEditor::CPPTXWriter oPPTXWriter;
|
||||
NSPresentationEditor::CPPTXWriter oPPTXWriter;
|
||||
oPPTXWriter.m_strTempDirectory = sDstPath;
|
||||
|
||||
|
||||
oPPTXWriter.CreateFile(((CPPTFileReader*)m_pReader)->m_oDocumentInfo.m_arUsers[0]);
|
||||
oPPTXWriter.CloseFile();
|
||||
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@ -35,31 +35,26 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace CRYPT
|
||||
{
|
||||
class Decryptor;
|
||||
}
|
||||
|
||||
namespace POLE
|
||||
{
|
||||
class Storage;
|
||||
}
|
||||
|
||||
class COfficePPTFile
|
||||
{
|
||||
public:
|
||||
COfficePPTFile()
|
||||
{
|
||||
m_strTempDirectory = L"";
|
||||
m_pReader = NULL;
|
||||
m_Status = 0;
|
||||
|
||||
}
|
||||
|
||||
~COfficePPTFile();
|
||||
|
||||
private:
|
||||
|
||||
int m_Status;
|
||||
|
||||
void* m_pReader;
|
||||
|
||||
std::vector<std::wstring> m_arUserSources;
|
||||
|
||||
std::wstring m_strTempDirectory;
|
||||
|
||||
public:
|
||||
|
||||
HRESULT put_TempDirectory(std::wstring sDir)
|
||||
{
|
||||
m_strTempDirectory = sDir;
|
||||
@ -71,13 +66,19 @@ public:
|
||||
return m_strTempDirectory;
|
||||
}
|
||||
|
||||
HRESULT LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath);
|
||||
HRESULT LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath, std::wstring password);
|
||||
|
||||
private:
|
||||
bool OpenFile(std::wstring sFileName);
|
||||
|
||||
int m_Status;
|
||||
void* m_pReader;
|
||||
std::vector<std::wstring> m_arUserSources;
|
||||
std::wstring m_strTempDirectory;
|
||||
std::wstring m_sTempDecryptFileName;
|
||||
|
||||
long OpenFile(const std::wstring & fileName, const std::wstring & password);
|
||||
bool CloseFile();
|
||||
|
||||
std::wstring GetDirectory(std::wstring strFileName);
|
||||
std::wstring GetDirectory(std::wstring strFileName);
|
||||
};
|
||||
|
||||
|
||||
@ -42,15 +42,16 @@ public:
|
||||
DWORD m_nOffsetPersistDirectory;
|
||||
|
||||
DWORD m_nDocumentRef;
|
||||
DWORD m_nEncryptRef;
|
||||
DWORD m_nMaxPersistWritten;
|
||||
|
||||
public:
|
||||
CUserEdit()
|
||||
{
|
||||
m_nOffsetLastEdit = 0;
|
||||
m_nOffsetPersistDirectory = 0;
|
||||
m_nDocumentRef = 0;
|
||||
m_nMaxPersistWritten = 0;
|
||||
m_nOffsetLastEdit = 0;
|
||||
m_nOffsetPersistDirectory = 0;
|
||||
m_nDocumentRef = 0;
|
||||
m_nMaxPersistWritten = 0;
|
||||
m_nEncryptRef = 0;
|
||||
}
|
||||
~CUserEdit()
|
||||
{
|
||||
@ -62,15 +63,17 @@ public:
|
||||
m_nOffsetPersistDirectory = oSrc.m_nOffsetPersistDirectory;
|
||||
m_nDocumentRef = oSrc.m_nDocumentRef;
|
||||
m_nMaxPersistWritten = oSrc.m_nMaxPersistWritten;
|
||||
m_nEncryptRef = oSrc.m_nEncryptRef;
|
||||
return (*this);
|
||||
}
|
||||
|
||||
void FromAtom(CRecordUserEditAtom* pAtom)
|
||||
{
|
||||
m_nOffsetLastEdit = pAtom->m_nOffsetLastEdit;
|
||||
m_nOffsetPersistDirectory = pAtom->m_nOffsetPersistDirectory;
|
||||
m_nDocumentRef = pAtom->m_nOffsetDocPersistIdRef;
|
||||
m_nMaxPersistWritten = pAtom->m_nPersistIdSeed;
|
||||
m_nOffsetLastEdit = pAtom->m_nOffsetLastEdit;
|
||||
m_nOffsetPersistDirectory = pAtom->m_nOffsetPersistDirectory;
|
||||
m_nDocumentRef = pAtom->m_nOffsetDocPersistIdRef;
|
||||
m_nMaxPersistWritten = pAtom->m_nPersistIdSeed;
|
||||
m_nEncryptRef = pAtom->m_nEncryptSessionPersistIdRef;
|
||||
}
|
||||
};
|
||||
|
||||
@ -79,10 +82,8 @@ class CCurrentUser
|
||||
public:
|
||||
bool m_bIsEncrypt;
|
||||
DWORD m_nOffsetToCurrentEdit;
|
||||
std::wstring m_sName;
|
||||
|
||||
std::wstring m_strName;
|
||||
|
||||
public:
|
||||
CCurrentUser()
|
||||
{
|
||||
m_bIsEncrypt = false;
|
||||
@ -96,20 +97,16 @@ public:
|
||||
{
|
||||
m_bIsEncrypt = oSrc.m_bIsEncrypt;
|
||||
m_nOffsetToCurrentEdit = oSrc.m_nOffsetToCurrentEdit;
|
||||
m_strName = oSrc.m_strName;
|
||||
m_sName = oSrc.m_sName;
|
||||
return (*this);
|
||||
}
|
||||
|
||||
void FromAtom(CRecordCurrentUserAtom* pAtom)
|
||||
{
|
||||
m_bIsEncrypt = (NO_ENCRYPT == pAtom->m_nToken);
|
||||
m_bIsEncrypt = (ENCRYPT == pAtom->m_nToken);
|
||||
|
||||
m_nOffsetToCurrentEdit = pAtom->m_nOffsetToCurEdit;
|
||||
m_strName = pAtom->m_strUNICODEUserName;
|
||||
}
|
||||
|
||||
std::wstring ToString()
|
||||
{
|
||||
return L"";
|
||||
m_sName = pAtom->m_strUNICODEUserName;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -38,14 +38,12 @@ class CPPTDocumentInfo
|
||||
public:
|
||||
CCurrentUser m_oCurrentUser;
|
||||
std::vector<CPPTUserInfo*> m_arUsers;
|
||||
std::wstring m_strFileDirectory;
|
||||
std::wstring m_strTmpDirectory;
|
||||
std::map<int, std::wstring> m_mapStoreImageFile;
|
||||
|
||||
public:
|
||||
std::wstring m_strPassword;
|
||||
|
||||
CPPTDocumentInfo() : m_oCurrentUser(), m_arUsers()
|
||||
{
|
||||
m_strFileDirectory = _T("");
|
||||
}
|
||||
|
||||
~CPPTDocumentInfo()
|
||||
@ -66,7 +64,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void ReadFromStream(CRecordCurrentUserAtom* pCurrentUser, POLE::Stream* pStream, std::wstring strFolderMem)
|
||||
bool ReadFromStream(CRecordCurrentUserAtom* pCurrentUser, POLE::Stream* pStream)
|
||||
{
|
||||
m_oCurrentUser.FromAtom(pCurrentUser);
|
||||
|
||||
@ -86,16 +84,24 @@ public:
|
||||
oUserAtom.ReadFromStream(oHeader, pStream);
|
||||
|
||||
CPPTUserInfo* pInfo = new CPPTUserInfo();
|
||||
pInfo->m_strFileDirectory = m_strFileDirectory;
|
||||
|
||||
pInfo->m_strTmpDirectory = m_strTmpDirectory;
|
||||
pInfo->m_bEncrypt = m_oCurrentUser.m_bIsEncrypt;
|
||||
pInfo->m_strPassword = m_strPassword;
|
||||
|
||||
bool bRes = pInfo->ReadFromStream(&oUserAtom, pStream, strFolderMem);
|
||||
bool bResult = pInfo->ReadFromStream(&oUserAtom, pStream);
|
||||
|
||||
offsetToEdit = pInfo->m_oUser.m_nOffsetLastEdit;
|
||||
m_oCurrentUser.m_bIsEncrypt = pInfo->m_bEncrypt;
|
||||
|
||||
if (!bRes)
|
||||
if (bResult == false)
|
||||
{
|
||||
delete pInfo;
|
||||
continue;
|
||||
|
||||
if (pInfo->m_bEncrypt)
|
||||
return false;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
|
||||
m_arUsers.push_back(pInfo);
|
||||
@ -105,11 +111,16 @@ public:
|
||||
|
||||
pInfo = NULL;
|
||||
}
|
||||
// теперь нужно у всех сделать FromDocument...или только для ПОСЛЕДНЕГО пользователя ??? (остальные то не нужны)
|
||||
//for (int i = 0; i < m_arUsers.size(); ++i)
|
||||
if (m_arUsers.size() > 0)
|
||||
{
|
||||
m_arUsers[0]->FromDocument();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
bool LoadDocument(std::wstring strFolderMem)
|
||||
{
|
||||
if (m_arUsers.empty()) return false;
|
||||
|
||||
m_arUsers[0]->ReadExtenalObjects(strFolderMem);
|
||||
m_arUsers[0]->FromDocument();
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
@ -47,6 +47,9 @@ CPPTUserInfo::CPPTUserInfo() : CDocument(),
|
||||
m_mapMasters(),
|
||||
m_mapNotes(),
|
||||
m_mapSlides(),
|
||||
m_bEncrypt(false),
|
||||
m_pStorageDecrypt(NULL),
|
||||
m_pDecryptor(NULL),
|
||||
m_arOffsetPictures()
|
||||
{
|
||||
m_pDocumentInfo = NULL;
|
||||
@ -58,7 +61,6 @@ CPPTUserInfo::CPPTUserInfo() : CDocument(),
|
||||
m_nWriteSlideTimeOffset = 0.0;
|
||||
m_nWriteSlideTime = 0.0;
|
||||
|
||||
m_strFileDirectory = _T("");
|
||||
m_bIsSetupEmpty = false;
|
||||
|
||||
m_bRtl = false;
|
||||
@ -78,6 +80,9 @@ CPPTUserInfo::~CPPTUserInfo()
|
||||
void CPPTUserInfo::Clear()
|
||||
{
|
||||
CDocument::Clear();
|
||||
|
||||
RELEASEOBJECT(m_pDecryptor);
|
||||
RELEASEOBJECT(m_pStorageDecrypt);
|
||||
|
||||
for (std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapSlides.begin(); pPair != m_mapSlides.end(); ++pPair)
|
||||
{
|
||||
@ -128,10 +133,11 @@ void CPPTUserInfo::Clear()
|
||||
m_arOffsetPictures.clear();
|
||||
}
|
||||
|
||||
bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStream, std::wstring strFolderMem)
|
||||
bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStream)
|
||||
{
|
||||
m_oUser.FromAtom(pUser);
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
SRecordHeader oHeader;
|
||||
CRecordUserEditAtom oUserAtom;
|
||||
|
||||
@ -147,23 +153,82 @@ bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStr
|
||||
CRecordPersistDirectoryAtom oPersist;
|
||||
oPersist.ReadFromStream(oHeader, pStream);
|
||||
oPersist.ToMap(&m_mapOffsetInPIDs);
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::map<DWORD, DWORD>::iterator pPair = m_mapOffsetInPIDs.find(m_oUser.m_nEncryptRef);
|
||||
|
||||
if (pPair != m_mapOffsetInPIDs.end())
|
||||
{
|
||||
StreamUtils::StreamSeek(pPair->second, pStream);
|
||||
oHeader.ReadFromStream(pStream);
|
||||
|
||||
if (RECORD_TYPE_DOCUMENT_ENCRYPTION_ATOM == oHeader.RecType)
|
||||
{
|
||||
m_bEncrypt = true;
|
||||
m_oEncryptionHeader.ReadFromStream(oHeader, pStream);
|
||||
|
||||
m_pDecryptor = new CRYPT::ECMADecryptor();
|
||||
m_pDecryptor->SetCryptData(m_oEncryptionHeader.crypt_data_aes);
|
||||
|
||||
if (m_strPassword.empty())
|
||||
{
|
||||
if (m_pDecryptor->SetPassword(L"VelvetSweatshop") == false)
|
||||
return false;
|
||||
}
|
||||
else if (m_pDecryptor->SetPassword(m_strPassword) == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
std::wstring sTemp = m_strTmpDirectory + FILE_SEPARATOR_STR + L"~tempFile.ppt";
|
||||
|
||||
m_pStorageDecrypt = new POLE::Storage(sTemp.c_str());
|
||||
m_pStorageDecrypt->open(true, true);
|
||||
}
|
||||
}
|
||||
|
||||
ReadDocumentPersists(pStream);
|
||||
return true;
|
||||
}
|
||||
|
||||
void CPPTUserInfo::DecryptStream(POLE::Stream *pStream, int block)
|
||||
{
|
||||
int size = pStream->size() - pStream->tell();
|
||||
|
||||
POLE::Stream *pStreamTmp = new POLE::Stream(m_pStorageDecrypt, "Tmp" + std::to_string(m_arStreamDecrypt.size() + 1), true, size);
|
||||
unsigned char* data_stream = new unsigned char[size];
|
||||
|
||||
pStream->read(data_stream, size);
|
||||
m_pDecryptor->Decrypt((char*)data_stream, size, block);
|
||||
pStreamTmp->write(data_stream, size);
|
||||
pStreamTmp->flush();
|
||||
pStreamTmp->seek(0);
|
||||
|
||||
m_arStreamDecrypt.push_back(CFStreamPtr(new CFStream(pStreamTmp)));
|
||||
}
|
||||
|
||||
bool CPPTUserInfo::ReadDocumentPersists(POLE::Stream* pStream)
|
||||
{
|
||||
SRecordHeader oHeader;
|
||||
std::map<DWORD, DWORD>::iterator pPair = m_mapOffsetInPIDs.find(m_oUser.m_nDocumentRef);
|
||||
|
||||
if (pPair == m_mapOffsetInPIDs.end())
|
||||
return false;
|
||||
|
||||
StreamUtils::StreamSeek(pPair->second, pStream);
|
||||
oHeader.ReadFromStream(pStream);
|
||||
DWORD offset_stream = pPair->second;
|
||||
|
||||
StreamUtils::StreamSeek(offset_stream, pStream);
|
||||
|
||||
POLE::Stream * pStreamTmp = pStream;
|
||||
if (m_pDecryptor)
|
||||
{
|
||||
DecryptStream(pStream, m_oUser.m_nDocumentRef);
|
||||
pStreamTmp = m_arStreamDecrypt.back()->stream_;
|
||||
}
|
||||
oHeader.ReadFromStream(pStreamTmp);
|
||||
if (RECORD_TYPE_DOCUMENT != oHeader.RecType)
|
||||
{
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_oDocument.ReadFromStream(oHeader, pStream);
|
||||
|
||||
Clear();
|
||||
m_oDocument.ReadFromStream(oHeader, pStreamTmp);
|
||||
|
||||
std::map<DWORD, DWORD>::iterator nIndexPsrRef;
|
||||
|
||||
@ -173,13 +238,19 @@ bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStr
|
||||
|
||||
if (nIndexPsrRef != m_mapOffsetInPIDs.end())
|
||||
{
|
||||
long offset = (long)nIndexPsrRef->second;
|
||||
offset_stream = nIndexPsrRef->second;
|
||||
|
||||
StreamUtils::StreamSeek(offset, pStream);
|
||||
|
||||
oHeader.ReadFromStream(pStream);
|
||||
StreamUtils::StreamSeek(offset_stream, pStream);
|
||||
POLE::Stream *pStreamTmp = pStream;
|
||||
if (m_pDecryptor)
|
||||
{
|
||||
DecryptStream(pStream, m_oDocument.m_arMasterPersists[index].m_nPsrRef);
|
||||
pStreamTmp = m_arStreamDecrypt.back()->stream_;
|
||||
}
|
||||
oHeader.ReadFromStream(pStreamTmp);
|
||||
|
||||
CRecordSlide* pSlide = new CRecordSlide();
|
||||
pSlide->ReadFromStream(oHeader, pStream);
|
||||
pSlide->ReadFromStream(oHeader, pStreamTmp);
|
||||
pSlide->m_oPersist = m_oDocument.m_arMasterPersists[index];
|
||||
|
||||
pSlide->m_Index = m_mapMasters.size();
|
||||
@ -198,12 +269,19 @@ bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStr
|
||||
|
||||
if (m_mapOffsetInPIDs.end() != nIndexPsrRef)
|
||||
{
|
||||
long offset = (long)nIndexPsrRef->second;
|
||||
StreamUtils::StreamSeek(offset, pStream);
|
||||
|
||||
oHeader.ReadFromStream(pStream);
|
||||
offset_stream = nIndexPsrRef->second;
|
||||
StreamUtils::StreamSeek(offset_stream, pStream);
|
||||
|
||||
POLE::Stream *pStreamTmp = pStream;
|
||||
if (m_pDecryptor)
|
||||
{
|
||||
DecryptStream(pStream, m_oDocument.m_arNotePersists[index].m_nPsrRef);
|
||||
pStreamTmp = m_arStreamDecrypt.back()->stream_;
|
||||
}
|
||||
oHeader.ReadFromStream(pStreamTmp);
|
||||
|
||||
CRecordSlide* pSlide = new CRecordSlide();
|
||||
pSlide->ReadFromStream(oHeader, pStream);
|
||||
pSlide->ReadFromStream(oHeader, pStreamTmp);
|
||||
pSlide->m_oPersist = m_oDocument.m_arNotePersists[index];
|
||||
|
||||
pSlide->m_Index = m_mapNotes.size();
|
||||
@ -223,14 +301,19 @@ bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStr
|
||||
|
||||
if (m_mapOffsetInPIDs.end() != nIndexPsrRef)
|
||||
{
|
||||
long offset = (long)nIndexPsrRef->second;
|
||||
offset_stream = (long)nIndexPsrRef->second;
|
||||
StreamUtils::StreamSeek(offset_stream, pStream);
|
||||
|
||||
StreamUtils::StreamSeek(offset, pStream);
|
||||
|
||||
oHeader.ReadFromStream(pStream);
|
||||
POLE::Stream *pStreamTmp = pStream;
|
||||
if (m_pDecryptor)
|
||||
{
|
||||
DecryptStream(pStream, m_oDocument.m_arSlidePersists[index].m_nPsrRef);
|
||||
pStreamTmp = m_arStreamDecrypt.back()->stream_;
|
||||
}
|
||||
oHeader.ReadFromStream(pStreamTmp);
|
||||
|
||||
CRecordSlide* pSlide = new CRecordSlide();
|
||||
pSlide->ReadFromStream(oHeader, pStream);
|
||||
pSlide->ReadFromStream(oHeader, pStreamTmp);
|
||||
pSlide->m_oPersist = m_oDocument.m_arSlidePersists[index];
|
||||
|
||||
pSlide->m_Index = m_mapSlides.size(); // in m_arrSlidesOrder
|
||||
@ -266,14 +349,19 @@ bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStr
|
||||
|
||||
if (m_mapOffsetInPIDs.end() != nIndexPsrRef)
|
||||
{
|
||||
long offset = (long)nIndexPsrRef->second;
|
||||
offset_stream = nIndexPsrRef->second;
|
||||
StreamUtils::StreamSeek(offset_stream, pStream);
|
||||
|
||||
StreamUtils::StreamSeek(offset, pStream);
|
||||
|
||||
oHeader.ReadFromStream(pStream);
|
||||
POLE::Stream *pStreamTmp = pStream;
|
||||
if (m_pDecryptor)
|
||||
{
|
||||
DecryptStream(pStream, oArrayDoc[0]->m_nNotesMasterPersistIDRef);
|
||||
pStreamTmp = m_arStreamDecrypt.back()->stream_;
|
||||
}
|
||||
oHeader.ReadFromStream(pStreamTmp);
|
||||
|
||||
CRecordSlide* pSlide = new CRecordSlide();
|
||||
pSlide->ReadFromStream(oHeader, pStream);
|
||||
pSlide->ReadFromStream(oHeader, pStreamTmp);
|
||||
pSlide->m_oPersist.m_nPsrRef = oArrayDoc[0]->m_nNotesMasterPersistIDRef;
|
||||
pSlide->m_Index = 0;
|
||||
|
||||
@ -283,24 +371,32 @@ bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStr
|
||||
|
||||
if (m_mapOffsetInPIDs.end() != nIndexPsrRef)
|
||||
{
|
||||
long offset = (long)nIndexPsrRef->second;
|
||||
offset_stream = nIndexPsrRef->second;
|
||||
StreamUtils::StreamSeek(offset_stream, pStream);
|
||||
|
||||
StreamUtils::StreamSeek(offset, pStream);
|
||||
|
||||
oHeader.ReadFromStream(pStream);
|
||||
POLE::Stream *pStreamTmp = pStream;
|
||||
if (m_pDecryptor)
|
||||
{
|
||||
DecryptStream(pStream, oArrayDoc[0]->m_nHandoutMasterPersistIDRef);
|
||||
pStreamTmp = m_arStreamDecrypt.back()->stream_;
|
||||
}
|
||||
oHeader.ReadFromStream(pStreamTmp);
|
||||
|
||||
CRecordSlide* pSlide = new CRecordSlide();
|
||||
pSlide->ReadFromStream(oHeader, pStream);
|
||||
pSlide->ReadFromStream(oHeader, pStreamTmp);
|
||||
pSlide->m_oPersist.m_nPsrRef = oArrayDoc[0]->m_nHandoutMasterPersistIDRef;
|
||||
pSlide->m_Index = 0;
|
||||
|
||||
m_mapHandoutMasters.insert( std::pair<DWORD, CRecordSlide*>(0, pSlide ));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------
|
||||
void CPPTUserInfo::ReadExtenalObjects(std::wstring strFolderMem)
|
||||
{
|
||||
// так... теперь берем всю инфу о ExObject -----------------------------
|
||||
m_oExMedia.m_strPresentationDirectory = strFolderMem;
|
||||
m_oExMedia.m_strSourceDirectory = m_strFileDirectory;
|
||||
|
||||
NSPresentationEditor::CExFilesInfo oInfo;
|
||||
|
||||
@ -347,20 +443,12 @@ bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStr
|
||||
|
||||
m_arrFonts.push_back(oFont);
|
||||
}
|
||||
|
||||
//FromDocument();
|
||||
// FromDocument - должен вызываться после того, как загрузятся все (!!!) юзеры
|
||||
|
||||
// теперь заполним пустые картинки
|
||||
//std::vector<CRecordBlipStoreContainer*> oArray;
|
||||
m_oDocument.GetRecordsByType(&m_arrBlipStore, true, true);
|
||||
if (0 < m_arrBlipStore.size())
|
||||
{
|
||||
m_bIsSetupEmpty = TRUE;
|
||||
m_arrBlipStore[0]->SetUpPicturesInfos(&m_arOffsetPictures);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CPPTUserInfo::FromDocument()
|
||||
@ -513,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;
|
||||
@ -539,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;
|
||||
@ -708,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;
|
||||
|
||||
// записываем шрифты
|
||||
@ -1314,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;
|
||||
|
||||
// читаем настройки текстовых стилей -----------------------------------------------
|
||||
@ -1696,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);
|
||||
|
||||
|
||||
@ -34,6 +34,7 @@
|
||||
|
||||
#include "../Records/Animations/AnimationTypes.h"
|
||||
#include "../Records/ExObjListContainer.h"
|
||||
#include "../Records/CryptSession10Container.h"
|
||||
|
||||
#include "SlideInfo.h"
|
||||
|
||||
@ -46,7 +47,14 @@ public:
|
||||
CUserEdit m_oUser;
|
||||
std::map<DWORD, DWORD> m_mapOffsetInPIDs;
|
||||
CRecordDocument m_oDocument;
|
||||
|
||||
|
||||
CEncryptionHeader m_oEncryptionHeader;
|
||||
bool m_bEncrypt;
|
||||
std::wstring m_strPassword;
|
||||
CRYPT::ECMADecryptor* m_pDecryptor;
|
||||
POLE::Storage* m_pStorageDecrypt;
|
||||
std::vector<CFStreamPtr> m_arStreamDecrypt; // на каждый Persist свой ... оО
|
||||
|
||||
std::map<DWORD, CRecordSlide*> m_mapSlides;
|
||||
std::map<DWORD, CRecordSlide*> m_mapMasters;
|
||||
std::map<DWORD, CRecordSlide*> m_mapNotes;
|
||||
@ -101,7 +109,7 @@ public:
|
||||
std::vector<int> m_arOffsetPictures;
|
||||
bool m_bIsSetupEmpty;
|
||||
|
||||
std::wstring m_strFileDirectory;
|
||||
std::wstring m_strTmpDirectory;
|
||||
|
||||
// вся инфа о ex - файлах
|
||||
CExMedia m_oExMedia;
|
||||
@ -118,7 +126,12 @@ public:
|
||||
|
||||
void Clear();
|
||||
|
||||
bool ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStream, std::wstring strFolderMem);
|
||||
bool ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStream);
|
||||
bool ReadDocumentPersists(POLE::Stream* pStream);
|
||||
void ReadExtenalObjects(std::wstring strFolderMem);
|
||||
|
||||
void DecryptStream(POLE::Stream *pStream, int block);
|
||||
|
||||
void FromDocument();
|
||||
|
||||
void NormalizeCoords(long lWidth, long lHeight);
|
||||
@ -295,7 +308,6 @@ public:
|
||||
}
|
||||
return _T("blank");
|
||||
}
|
||||
|
||||
|
||||
void AddAnimation (DWORD dwSlideID, double Width, double Height, IElement* pElement);
|
||||
void AddAudioTransition (DWORD dwSlideID, CTransition* pTransition, const std::wstring& strFilePath);
|
||||
|
||||
@ -196,7 +196,8 @@ typedef BYTE BOOL1;
|
||||
#define RECORD_TYPE_COMMENT2000SUMMARYATOM 12005
|
||||
|
||||
// Records ~12050 seem to be related to Document Encryption
|
||||
#define RECORD_TYPE_DOCUMENT_ENCRYPTION_ATOM 12052
|
||||
#define RECORD_TYPE_DOCUMENT_ENCRYPTION_ATOM 0x2F14
|
||||
|
||||
|
||||
//records greater then 0xF000 belong to with Microsoft Office Drawing format also known as Escher
|
||||
#define RECORD_TYPE_ESCHER_DGG_CONTAINER 0xF000
|
||||
@ -251,6 +252,7 @@ typedef BYTE BOOL1;
|
||||
#define RECORD_PROG_BINARY_TAG 0x138A // RT_ProgBinaryTag SlideProgTagsContainer-DocProgTagsContainer-ShapeProgTagsContainer
|
||||
#define RECORD_TEXT_MASTER_STYLE10_ATOM 0x0FB2 // RT_TextMasterStyle10Atom TextMasterStyle10Atom
|
||||
|
||||
|
||||
static std::string GetRecordName(DWORD dwType)
|
||||
{
|
||||
std::string strName = ("Unknown");
|
||||
|
||||
273
ASCOfficePPTFile/PPTFormatLib/Reader/PPTFileReader.cpp
Normal file
273
ASCOfficePPTFile/PPTFormatLib/Reader/PPTFileReader.cpp
Normal file
@ -0,0 +1,273 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#include "PPTFileReader.h"
|
||||
|
||||
#include "../../../ASCOfficeXlsFile2/source/XlsFormat/Crypt/Decryptor.h"
|
||||
#include "../../../ASCOfficeXlsFile2/source/XlsFormat/Logic/SummaryInformationStream/SummaryInformation.h"
|
||||
|
||||
#include "../../../DesktopEditor/common/Directory.h"
|
||||
#include "../Records/Drawing/ArtBlip.h"
|
||||
|
||||
#define CURRENT_USER_STREAM "Current User"
|
||||
|
||||
#define DOCUMENT_STREAM "PowerPoint Document"
|
||||
|
||||
#define PICTURE_STREAM "Pictures"
|
||||
#define HEADER_STREAM "Header"
|
||||
|
||||
#define PP97_DUALSTORAGE "PP97_DUALSTORAGE"
|
||||
|
||||
#define ENCRYPTED_SUMMARY_STREAM "EncryptedSummary"
|
||||
#define DOCUMENT_SUMMARY_STREAM "DocumentSummaryInformation"
|
||||
|
||||
CPPTFileReader::CPPTFileReader(POLE::Storage *pStorage, std::wstring strTemp):
|
||||
m_pStorage(pStorage),
|
||||
m_bIsPPTFile(false),
|
||||
m_nPresentationCodePage(1250),
|
||||
m_pDocumentStream(NULL), m_pPictureStream(NULL), m_pDocumentSummaryStream(NULL), m_pEncryptedSummaryStream(NULL),
|
||||
m_strTmpDirectory(strTemp),
|
||||
m_oDocumentInfo()
|
||||
{
|
||||
m_bDualStorage = false;
|
||||
|
||||
POLE::Stream *pStm = new POLE::Stream( m_pStorage, CURRENT_USER_STREAM);
|
||||
|
||||
if ( ReadCurrentUser(pStm) )
|
||||
{
|
||||
m_bIsPPTFile = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
RELEASEOBJECT(pStm);
|
||||
|
||||
std::string stream_name = std::string(PP97_DUALSTORAGE) + std::string("/") + std::string(CURRENT_USER_STREAM);
|
||||
pStm = new POLE::Stream( m_pStorage, stream_name);
|
||||
|
||||
if (pStm == NULL)
|
||||
return;
|
||||
|
||||
m_bDualStorage = true;
|
||||
if ( ReadCurrentUser(pStm))
|
||||
{
|
||||
m_bIsPPTFile = true;
|
||||
}
|
||||
}
|
||||
|
||||
RELEASEOBJECT(pStm);
|
||||
|
||||
if (0 == m_strTmpDirectory.length())
|
||||
{
|
||||
m_strTmpDirectory = NSDirectory::GetTempPath();
|
||||
}
|
||||
|
||||
m_strTmpDirectory = NSDirectory::CreateDirectoryWithUniqueName(m_strTmpDirectory);
|
||||
|
||||
}
|
||||
CPPTFileReader::~CPPTFileReader()
|
||||
{
|
||||
RELEASEOBJECT(m_pStorage);
|
||||
|
||||
NSDirectory::DeleteDirectory(m_strTmpDirectory);
|
||||
}
|
||||
|
||||
bool CPPTFileReader::IsPowerPoint()
|
||||
{
|
||||
return m_bIsPPTFile;
|
||||
}
|
||||
bool CPPTFileReader::IsEncrypted()
|
||||
{
|
||||
if (m_oDocumentInfo.m_arUsers.empty())
|
||||
return m_oDocumentInfo.m_oCurrentUser.m_bIsEncrypt; //wps не выставляет флаг!
|
||||
|
||||
return m_oDocumentInfo.m_arUsers[0]->m_bEncrypt;
|
||||
}
|
||||
|
||||
bool CPPTFileReader::ReadPersists()
|
||||
{
|
||||
CFStreamPtr pStream = GetDocumentStream();
|
||||
if (!pStream) return false;
|
||||
|
||||
return m_oDocumentInfo.ReadFromStream(&m_oCurrentUser, pStream->stream_);
|
||||
}
|
||||
void CPPTFileReader::ReadDocument()
|
||||
{
|
||||
ReadPictures();
|
||||
m_oDocumentInfo.LoadDocument(m_strTmpDirectory);
|
||||
}
|
||||
|
||||
bool CPPTFileReader::ReadCurrentUser(POLE::Stream *pStm)
|
||||
{
|
||||
if (!pStm) return false;
|
||||
|
||||
SRecordHeader oHeader;
|
||||
bool isPP = false;
|
||||
|
||||
if( oHeader.ReadFromStream(pStm))
|
||||
{
|
||||
m_oCurrentUser.ReadFromStream(oHeader, pStm);
|
||||
|
||||
isPP = (m_oCurrentUser.m_nSize == 0x00000014 && (m_oCurrentUser.m_nLenUserName <= 255));
|
||||
}
|
||||
|
||||
return isPP;
|
||||
}
|
||||
|
||||
CFStreamPtr CPPTFileReader::GetDocumentStream()
|
||||
{
|
||||
if (!m_pDocumentStream)
|
||||
{
|
||||
m_pDocumentStream = GetStreamByName(DOCUMENT_STREAM);
|
||||
}
|
||||
return m_pDocumentStream;
|
||||
}
|
||||
CFStreamPtr CPPTFileReader::GetPictureStream()
|
||||
{
|
||||
if (!m_pPictureStream)
|
||||
{
|
||||
m_pPictureStream = GetStreamByName(PICTURE_STREAM);
|
||||
}
|
||||
return m_pPictureStream;
|
||||
}
|
||||
CFStreamPtr CPPTFileReader::GetStreamByName(const std::string & name)
|
||||
{
|
||||
if (!m_bIsPPTFile)
|
||||
return CFStreamPtr();
|
||||
|
||||
std::string stream_name;
|
||||
|
||||
if (m_bDualStorage) stream_name = std::string(PP97_DUALSTORAGE) + std::string("/");
|
||||
|
||||
POLE::Stream *pStream = new POLE::Stream(m_pStorage, stream_name + name);
|
||||
|
||||
if (pStream->fail())
|
||||
{
|
||||
RELEASEOBJECT(pStream);
|
||||
return CFStreamPtr();
|
||||
}
|
||||
return CFStreamPtr( new CFStream(pStream));
|
||||
}
|
||||
CFStreamPtr CPPTFileReader::GetEncryptedSummaryStream()
|
||||
{
|
||||
if (m_pEncryptedSummaryStream == NULL)
|
||||
{
|
||||
m_pEncryptedSummaryStream = GetStreamByName(ENCRYPTED_SUMMARY_STREAM);
|
||||
}
|
||||
return m_pEncryptedSummaryStream;
|
||||
}
|
||||
|
||||
CFStreamPtr CPPTFileReader::GetDocumentSummaryStream()
|
||||
{
|
||||
if (!m_pDocumentSummaryStream)
|
||||
{
|
||||
m_pDocumentSummaryStream = GetStreamByName(DOCUMENT_SUMMARY_STREAM);
|
||||
}
|
||||
return m_pDocumentSummaryStream;
|
||||
}
|
||||
void CPPTFileReader::ReadEncryptedSummary()
|
||||
{
|
||||
CFStreamPtr pStream = GetEncryptedSummaryStream();
|
||||
if (!pStream) return;
|
||||
|
||||
SRecordHeader oHeader;
|
||||
|
||||
if (oHeader.ReadFromStream(pStream) == false )
|
||||
{
|
||||
return;
|
||||
}
|
||||
CRecordEncryptedSummary info;
|
||||
|
||||
info.ReadFromStream(oHeader, pStream);
|
||||
}
|
||||
|
||||
void CPPTFileReader::ReadDocumentSummary()
|
||||
{
|
||||
CFStreamPtr pStream = GetDocumentSummaryStream();
|
||||
if (!pStream) return;
|
||||
|
||||
OLEPS::SummaryInformation doc_summary_info(pStream);
|
||||
|
||||
m_nPresentationCodePage = doc_summary_info.GetCodePage();
|
||||
|
||||
if (m_nPresentationCodePage == 0)
|
||||
m_nPresentationCodePage = 1250;
|
||||
}
|
||||
|
||||
void CPPTFileReader::ReadPictures()
|
||||
{
|
||||
if (m_oDocumentInfo.m_arUsers.empty()) return;
|
||||
|
||||
CFStreamPtr pStream = GetPictureStream();
|
||||
if (!pStream) return;
|
||||
|
||||
CRYPT::ECMADecryptor *pDecryptor = m_oDocumentInfo.m_arUsers[0]->m_pDecryptor;
|
||||
|
||||
while (true)
|
||||
{
|
||||
//if (pStream->isEOF()) случаются неверно записанные стримы
|
||||
// break;
|
||||
|
||||
int pos = pStream->getStreamPointer();
|
||||
if (pos >= pStream->getStreamSize())
|
||||
break;
|
||||
|
||||
SRecordHeader oHeader;
|
||||
if (pDecryptor)
|
||||
{
|
||||
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.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;
|
||||
|
||||
art_blip.ReadFromStream(oHeader, pStream->stream_);
|
||||
m_oDocumentInfo.m_mapStoreImageFile[ pos ] = art_blip.m_sFileName;
|
||||
|
||||
pStream->seekFromBegin(pos + oHeader.RecLen + 8);
|
||||
}
|
||||
}
|
||||
@ -31,201 +31,48 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "../../../DesktopEditor/common/Directory.h"
|
||||
#include "../Records/Drawing/ArtBlip.h"
|
||||
|
||||
#include "PPTDocumentInfo.h"
|
||||
|
||||
#define CURRENT_USER_STREAM "Current User"
|
||||
|
||||
#define DOCUMENT_STREAM "PowerPoint Document"
|
||||
|
||||
#define PICTURE_STREAM "Pictures"
|
||||
#define HEADER_STREAM "Header"
|
||||
|
||||
#define PP97_DUALSTORAGE "PP97_DUALSTORAGE"
|
||||
using namespace XLS;
|
||||
|
||||
class CPPTFileReader
|
||||
{
|
||||
public:
|
||||
CPPTFileReader(POLE::Storage *pStg, std::wstring strTemp):
|
||||
m_pPowerPointStg(pStg),
|
||||
m_bIsPPTFile(false),
|
||||
m_pDocStream(NULL),
|
||||
m_pPictureStream(NULL),
|
||||
m_lImagesCount(0),
|
||||
m_strMemoryForder(strTemp),
|
||||
m_oDocumentInfo()
|
||||
{
|
||||
m_bDualStorage = false;
|
||||
|
||||
POLE::Stream *pStm = new POLE::Stream( m_pPowerPointStg, CURRENT_USER_STREAM);
|
||||
|
||||
if ( ReadCurrentUser(pStm) )
|
||||
{
|
||||
m_bIsPPTFile = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
RELEASEOBJECT(pStm);
|
||||
|
||||
std::string stream_name = std::string(PP97_DUALSTORAGE) + std::string("/") + std::string(CURRENT_USER_STREAM);
|
||||
pStm = new POLE::Stream( m_pPowerPointStg, stream_name);
|
||||
|
||||
if (pStm == NULL)
|
||||
return;
|
||||
|
||||
m_bDualStorage = true;
|
||||
if ( ReadCurrentUser(pStm))
|
||||
{
|
||||
m_bIsPPTFile = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
RELEASEOBJECT(pStm);
|
||||
|
||||
if (0 == m_strMemoryForder.length())
|
||||
{
|
||||
m_strMemoryForder = NSDirectory::GetTempPath();
|
||||
}
|
||||
|
||||
m_strMemoryForder = NSDirectory::CreateDirectoryWithUniqueName(m_strMemoryForder);
|
||||
|
||||
}
|
||||
~CPPTFileReader()
|
||||
{
|
||||
RELEASEOBJECT(m_pDocStream);
|
||||
RELEASEOBJECT(m_pPictureStream);
|
||||
|
||||
RELEASEOBJECT(m_pPowerPointStg);
|
||||
|
||||
NSDirectory::DeleteDirectory(m_strMemoryForder);
|
||||
}
|
||||
|
||||
bool IsPowerPoint()
|
||||
{
|
||||
return m_bIsPPTFile;
|
||||
}
|
||||
|
||||
void ReadPersistDirectory()
|
||||
{
|
||||
bool bRes = SavePictures();
|
||||
// нужно вызывать РОВНО один раз...
|
||||
m_oDocumentInfo.ReadFromStream(&m_oCurrentUser, GetDocStream(), m_strMemoryForder);
|
||||
}
|
||||
|
||||
void ReadSlideList()
|
||||
{
|
||||
if (m_oDocumentInfo.m_arUsers.size() > 0)
|
||||
{
|
||||
|
||||
DWORD nPID = m_oDocumentInfo.m_arUsers[0]->m_oUser.m_nDocumentRef;
|
||||
std::map<DWORD, DWORD>::iterator pPair = m_oDocumentInfo.m_arUsers[0]->m_mapOffsetInPIDs.find(nPID);
|
||||
|
||||
if (pPair == m_oDocumentInfo.m_arUsers[0]->m_mapOffsetInPIDs.end()) return;
|
||||
|
||||
DWORD offset = pPair->second;
|
||||
StreamUtils::StreamSeek((long)offset, GetDocStream());
|
||||
}
|
||||
}
|
||||
|
||||
CPPTFileReader(POLE::Storage *pStorage, std::wstring strTemp);
|
||||
~CPPTFileReader();
|
||||
bool IsPowerPoint();
|
||||
bool IsEncrypted();
|
||||
bool ReadPersists();
|
||||
void ReadDocument();
|
||||
protected:
|
||||
|
||||
bool ReadCurrentUser(POLE::Stream *pStm)
|
||||
{
|
||||
if (!pStm) return false;
|
||||
CFStreamPtr GetDocumentStream();
|
||||
CFStreamPtr GetPictureStream();
|
||||
CFStreamPtr GetEncryptedSummaryStream();
|
||||
CFStreamPtr GetDocumentSummaryStream();
|
||||
|
||||
CFStreamPtr GetStreamByName(const std::string & name);
|
||||
|
||||
SRecordHeader oHeader;
|
||||
bool isPP = false;
|
||||
|
||||
if( oHeader.ReadFromStream(pStm))
|
||||
{
|
||||
m_oCurrentUser.ReadFromStream(oHeader, pStm);
|
||||
|
||||
isPP = (m_oCurrentUser.m_nSize == 0x00000014 && (m_oCurrentUser.m_nToken == NO_ENCRYPT) &&
|
||||
(m_oCurrentUser.m_nLenUserName <= 255));
|
||||
}
|
||||
|
||||
return isPP;
|
||||
}
|
||||
|
||||
POLE::Stream* GetDocStream()
|
||||
{
|
||||
if (m_pDocStream == NULL)
|
||||
{
|
||||
if (!m_bIsPPTFile)
|
||||
return NULL;
|
||||
|
||||
std::string stream_name;
|
||||
|
||||
if (m_bDualStorage) stream_name = std::string(PP97_DUALSTORAGE) + std::string("/");
|
||||
|
||||
m_pDocStream = new POLE::Stream(m_pPowerPointStg, stream_name + DOCUMENT_STREAM);
|
||||
}
|
||||
return m_pDocStream;
|
||||
}
|
||||
POLE::Stream* GetPictureStream()
|
||||
{
|
||||
if (m_pPictureStream == NULL)
|
||||
{
|
||||
if (!m_bIsPPTFile)
|
||||
return NULL;
|
||||
|
||||
std::string stream_name;
|
||||
|
||||
if (m_bDualStorage) stream_name = std::string(PP97_DUALSTORAGE) + std::string("/");
|
||||
|
||||
m_pPictureStream = new POLE::Stream(m_pPowerPointStg, stream_name + PICTURE_STREAM);
|
||||
}
|
||||
return m_pPictureStream;
|
||||
}
|
||||
|
||||
bool SavePictures()
|
||||
{
|
||||
POLE::Stream* pStream = GetPictureStream();
|
||||
|
||||
if (NULL == pStream)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
SRecordHeader oHeader;
|
||||
ULONG nRd = 0;
|
||||
m_lImagesCount = 0;
|
||||
|
||||
// удаление картинок при завершении программы
|
||||
|
||||
while (TRUE)
|
||||
{
|
||||
if (oHeader.ReadFromStream(pStream) == false )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
CRecordOfficeArtBlip art_blip;
|
||||
art_blip.m_strMemoryForder = m_strMemoryForder;
|
||||
art_blip.m_oDocumentInfo = &m_oDocumentInfo;
|
||||
|
||||
art_blip.ReadFromStream(oHeader, pStream);
|
||||
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
bool ReadCurrentUser(POLE::Stream *pStm);
|
||||
void ReadEncryptedSummary();
|
||||
void ReadDocumentSummary();
|
||||
void ReadPictures();
|
||||
|
||||
private:
|
||||
bool m_bDualStorage;
|
||||
CRecordCurrentUserAtom m_oCurrentUser;
|
||||
POLE::Stream * m_pDocStream;
|
||||
POLE::Stream * m_pPictureStream;
|
||||
POLE::Storage* m_pPowerPointStg;
|
||||
bool m_bIsPPTFile;
|
||||
|
||||
XLS::CFStreamPtr m_pDocumentStream;
|
||||
XLS::CFStreamPtr m_pPictureStream;
|
||||
XLS::CFStreamPtr m_pDocumentSummaryStream;
|
||||
XLS::CFStreamPtr m_pEncryptedSummaryStream;
|
||||
|
||||
bool m_bIsPPTFile;
|
||||
|
||||
public:
|
||||
// для картинок
|
||||
std::wstring m_strMemoryForder;
|
||||
|
||||
POLE::Storage* m_pStorage;
|
||||
std::wstring m_strTmpDirectory;
|
||||
std::vector<bool> m_arLoadImageFlags;
|
||||
DWORD m_lImagesCount;
|
||||
|
||||
CPPTDocumentInfo m_oDocumentInfo;
|
||||
int m_nPresentationCodePage;
|
||||
};
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -35,6 +35,97 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
std::wstring CUnknownRecord::ReadStringW(const CFStreamPtr &pStream, int lLen)
|
||||
{
|
||||
if (!pStream) return (L"");
|
||||
|
||||
unsigned char* pData = new unsigned char[2 * (lLen + 1)];
|
||||
memset (pData, 0, 2 * (lLen + 1));
|
||||
|
||||
pStream->read(pData, 2 * lLen);
|
||||
|
||||
if (sizeof(wchar_t) == 4)
|
||||
{
|
||||
ConversionResult eUnicodeConversionResult;
|
||||
UTF32 *pStrUtf32 = new UTF32 [lLen + 1];
|
||||
pStrUtf32[lLen] = 0 ;
|
||||
|
||||
const UTF16 *pStrUtf16_Conv = (const UTF16 *) pData;
|
||||
UTF32 *pStrUtf32_Conv = pStrUtf32;
|
||||
|
||||
eUnicodeConversionResult = ConvertUTF16toUTF32 ( &pStrUtf16_Conv
|
||||
, &pStrUtf16_Conv[lLen]
|
||||
, &pStrUtf32_Conv
|
||||
, &pStrUtf32 [lLen]
|
||||
, strictConversion);
|
||||
|
||||
if (conversionOK != eUnicodeConversionResult)
|
||||
{
|
||||
delete [] pStrUtf32;
|
||||
return (L"");
|
||||
}
|
||||
std::wstring res((wchar_t*)pStrUtf32, lLen);
|
||||
if (pStrUtf32) delete [] pStrUtf32;
|
||||
return res;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::wstring str((wchar_t*)pData);
|
||||
delete[] pData;
|
||||
return str;
|
||||
}
|
||||
|
||||
}
|
||||
std::string CUnknownRecord::ReadStringA(const CFStreamPtr &pStream, int lLen)
|
||||
{
|
||||
if (!pStream) return ("");
|
||||
|
||||
char* pData = new char[lLen + 1];
|
||||
|
||||
pStream->read((unsigned char*)pData, lLen);
|
||||
|
||||
pData[lLen] = 0;
|
||||
|
||||
std::string str(pData, lLen);
|
||||
|
||||
delete[] pData;
|
||||
return str;
|
||||
}
|
||||
|
||||
void CRecordsContainer::ReadFromStream(SRecordHeader & oHeader, const CFStreamPtr &pStream)
|
||||
{
|
||||
m_oHeader = oHeader;
|
||||
m_arRecords.clear();
|
||||
|
||||
LONG lPosition = pStream->getStreamPointer();
|
||||
|
||||
m_oHeader = oHeader;
|
||||
|
||||
UINT lCurLen = 0;
|
||||
ULONG lReadLen = 0;
|
||||
SRecordHeader oRec;
|
||||
|
||||
while (lCurLen < m_oHeader.RecLen)
|
||||
{
|
||||
if (oRec.ReadFromStream(pStream) == FALSE )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
IRecord* pRecord = CreateByType(oRec);
|
||||
pRecord->ReadFromStream(oRec, pStream);
|
||||
|
||||
m_arRecords.push_back(pRecord);
|
||||
lCurLen += (8 + oRec.RecLen);
|
||||
}
|
||||
if (lCurLen != m_oHeader.RecLen)
|
||||
{
|
||||
// нужно разобраться, что тут такое!!!
|
||||
LONG lPosition = 0;
|
||||
pStream->seekFromBegin(lPosition + m_oHeader.RecLen);
|
||||
}
|
||||
}
|
||||
|
||||
void CRecordsContainer::ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
|
||||
{
|
||||
m_oHeader = oHeader;
|
||||
|
||||
@ -34,46 +34,77 @@
|
||||
#include "PPTFileDefines.h"
|
||||
#include "../Reader/ReadStructures.h"
|
||||
#include "../../../ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/Enums.h"
|
||||
#include "../../../ASCOfficeXlsFile2/source/XlsFormat/Binary/CFStream.h"
|
||||
#include "../../../Common/3dParty/pole/pole.h"
|
||||
#include "../../../OfficeCryptReader/source/CryptTransform.h"
|
||||
|
||||
using namespace NSPresentationEditor;
|
||||
using namespace XLS;
|
||||
|
||||
struct SRecordHeader
|
||||
class SRecordHeader
|
||||
{
|
||||
BYTE RecVersion;
|
||||
USHORT RecInstance;
|
||||
USHORT RecType;
|
||||
UINT RecLen;
|
||||
public:
|
||||
unsigned char RecVersion;
|
||||
unsigned short RecInstance;
|
||||
unsigned short RecType;
|
||||
_UINT32 RecLen;
|
||||
|
||||
SRecordHeader()
|
||||
void Clear()
|
||||
{
|
||||
RecVersion = 0;
|
||||
RecInstance = RecType = 0;
|
||||
RecInstance = 0;
|
||||
RecType = 0;
|
||||
RecLen = 0;
|
||||
}
|
||||
SRecordHeader()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
bool ReadFromStream(const CFStreamPtr &pStream)
|
||||
{
|
||||
Clear();
|
||||
|
||||
if (pStream->isEOF()) return FALSE;
|
||||
POLE::uint64 nRd = 0;
|
||||
|
||||
unsigned short rec =0;
|
||||
pStream->read((unsigned char*)&(rec), 2);
|
||||
|
||||
RecInstance = rec >> 4;
|
||||
RecVersion = rec - (RecInstance << 4);
|
||||
|
||||
*pStream >> RecType >> RecLen;
|
||||
|
||||
unsigned long sz = pStream->getStreamSize() - pStream->getStreamPointer();
|
||||
|
||||
if (RecLen > sz )
|
||||
{
|
||||
RecLen = sz;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ReadFromStream(POLE::Stream * pStream)
|
||||
{
|
||||
RecVersion = 0;
|
||||
RecInstance = RecType = 0;
|
||||
RecLen = 0;
|
||||
Clear();
|
||||
if (!pStream) return false;
|
||||
|
||||
POLE::uint64 nRd = 0;
|
||||
|
||||
unsigned short rec =0;
|
||||
nRd = pStream->read((unsigned char*)&(rec), 2);
|
||||
|
||||
if (nRd != 2) return FALSE;
|
||||
if (nRd != 2) return false;
|
||||
|
||||
//RecVersion = rec & 0xFF0F;
|
||||
RecInstance = rec >> 4;
|
||||
RecVersion = rec - (RecInstance<<4);
|
||||
RecVersion = rec - (RecInstance<<4);
|
||||
|
||||
nRd = pStream->read((unsigned char*)&(RecType), 2);
|
||||
|
||||
nRd = pStream->read((unsigned char*)&(RecLen), 4);
|
||||
|
||||
POLE::uint64 sz = pStream->size()-pStream->tell();
|
||||
POLE::uint64 sz = pStream->size() - pStream->tell();
|
||||
|
||||
if (RecLen > sz )
|
||||
{
|
||||
@ -116,8 +147,8 @@ public:
|
||||
SRecordHeader m_oHeader;
|
||||
|
||||
public:
|
||||
// читаем из файла
|
||||
virtual ~IRecord(){}
|
||||
virtual void ReadFromStream(SRecordHeader & oHeader, const CFStreamPtr &pStream) = 0;
|
||||
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) = 0;
|
||||
};
|
||||
|
||||
@ -134,17 +165,26 @@ public:
|
||||
~CUnknownRecord()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void ReadFromStream(SRecordHeader & oHeader, const CFStreamPtr &pStream)
|
||||
{
|
||||
m_oHeader = oHeader;
|
||||
|
||||
pStream->seekFromCurForward(m_oHeader.RecLen);
|
||||
}
|
||||
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
|
||||
{
|
||||
m_oHeader = oHeader;
|
||||
|
||||
StreamUtils::StreamSkip((long)m_oHeader.RecLen, pStream);
|
||||
}
|
||||
|
||||
std::wstring ReadStringW(const CFStreamPtr &pStream, int size);
|
||||
std::string ReadStringA(const CFStreamPtr &pStream, int size);
|
||||
};
|
||||
|
||||
IRecord* CreateByType(SRecordHeader oHeader);
|
||||
|
||||
class CRecordsContainer : public IRecord
|
||||
class CRecordsContainer : public CUnknownRecord
|
||||
{
|
||||
protected:
|
||||
std::vector<IRecord*> m_arRecords;
|
||||
@ -173,6 +213,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void ReadFromStream(SRecordHeader & oHeader, const CFStreamPtr &pStream);
|
||||
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream);
|
||||
|
||||
template <typename T>
|
||||
|
||||
@ -315,7 +315,7 @@ namespace Animations
|
||||
|
||||
namespace Animations
|
||||
{
|
||||
struct BuildAtom : public IRecord
|
||||
struct BuildAtom : public CUnknownRecord
|
||||
{
|
||||
public:
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
@ -346,7 +346,7 @@ namespace Animations
|
||||
bool fExpanded;
|
||||
bool fUIExpanded;
|
||||
};
|
||||
struct ParaBuildAtom : public IRecord
|
||||
struct ParaBuildAtom : public CUnknownRecord
|
||||
{
|
||||
public:
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
@ -395,7 +395,7 @@ namespace Animations
|
||||
|
||||
DWORD delayTime;
|
||||
};
|
||||
struct LevelInfoAtom : public IRecord
|
||||
struct LevelInfoAtom : public CUnknownRecord
|
||||
{
|
||||
public:
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
@ -429,7 +429,7 @@ namespace Animations
|
||||
IRecord* timeNode; // ExtTimeNodeContainer
|
||||
};
|
||||
|
||||
struct ParaBuildContainer : public IRecord
|
||||
struct ParaBuildContainer : public CUnknownRecord
|
||||
{
|
||||
public:
|
||||
|
||||
@ -499,7 +499,7 @@ namespace Animations
|
||||
std::vector <ParaBuildLevel*> rgParaBuildLevel;
|
||||
};
|
||||
|
||||
struct BuildListContainer : public IRecord
|
||||
struct BuildListContainer : public CUnknownRecord
|
||||
{
|
||||
public:
|
||||
|
||||
@ -575,7 +575,7 @@ namespace Animations
|
||||
|
||||
namespace Animations
|
||||
{
|
||||
struct TimeVariant : public IRecord
|
||||
struct TimeVariant : public CUnknownRecord
|
||||
{
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
{
|
||||
@ -709,7 +709,7 @@ namespace Animations
|
||||
std::wstring stringValue;
|
||||
};
|
||||
|
||||
struct TimeStringListContainer : public IRecord
|
||||
struct TimeStringListContainer : public CUnknownRecord
|
||||
{
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
{
|
||||
@ -744,7 +744,7 @@ namespace Animations
|
||||
std::vector <TimeVariantString> m_Values;
|
||||
};
|
||||
// structures for ExtTimeNodeContainer
|
||||
struct TimeNodeAtom : public IRecord
|
||||
struct TimeNodeAtom : public CUnknownRecord
|
||||
{
|
||||
static const DWORD RT_TimeSequenceData = 0xF141;
|
||||
|
||||
@ -808,7 +808,7 @@ namespace Animations
|
||||
bool m_bDurationProperty;
|
||||
};
|
||||
|
||||
struct TimeSequenceDataAtom : public IRecord
|
||||
struct TimeSequenceDataAtom : public CUnknownRecord
|
||||
{
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
{
|
||||
@ -938,7 +938,7 @@ namespace Animations
|
||||
};
|
||||
|
||||
|
||||
struct TimePropertyList4TimeNodeContainer : public IRecord
|
||||
struct TimePropertyList4TimeNodeContainer : public CUnknownRecord
|
||||
{
|
||||
public:
|
||||
//static const DWORD RT_TimePropertyList = 0xF13D; // Specifies a TimePropertyList4TimeNodeContainer or TimePropertyList4TimeBehavior.
|
||||
@ -1113,7 +1113,7 @@ namespace Animations
|
||||
TimeEffectDir m_EffectDir;
|
||||
};
|
||||
|
||||
struct TimePropertyList4TimeBehavior : public IRecord
|
||||
struct TimePropertyList4TimeBehavior : public CUnknownRecord
|
||||
{
|
||||
public:
|
||||
//static const DWORD RT_TimePropertyList = 0xF13D; // Specifies a TimePropertyList4TimeNodeContainer or TimePropertyList4TimeBehavior.
|
||||
@ -1156,7 +1156,7 @@ namespace Animations
|
||||
|
||||
namespace Animations
|
||||
{
|
||||
struct VisualShapeAtom : public IRecord
|
||||
struct VisualShapeAtom : public CUnknownRecord
|
||||
{
|
||||
// Привязка анимации через этот объект к ID объекту
|
||||
|
||||
@ -1191,7 +1191,7 @@ namespace Animations
|
||||
DWORD m_nData2;
|
||||
};
|
||||
|
||||
struct VisualPageAtom : public IRecord
|
||||
struct VisualPageAtom : public CUnknownRecord
|
||||
{
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
{
|
||||
@ -1216,7 +1216,7 @@ namespace Animations
|
||||
TimeVisualElementEnum m_Type;
|
||||
};
|
||||
|
||||
struct ClientVisualElementContainer : public IRecord
|
||||
struct ClientVisualElementContainer : public CUnknownRecord
|
||||
{
|
||||
|
||||
ClientVisualElementContainer ()
|
||||
@ -1269,7 +1269,7 @@ namespace Animations
|
||||
bool m_bVisualShapeAtom;
|
||||
};
|
||||
|
||||
struct TimeBehaviorAtom : public IRecord
|
||||
struct TimeBehaviorAtom : public CUnknownRecord
|
||||
{
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
{
|
||||
@ -1310,7 +1310,7 @@ namespace Animations
|
||||
DWORD m_nBehaviorTransform;
|
||||
};
|
||||
|
||||
struct TimeBehaviorContainer : public IRecord
|
||||
struct TimeBehaviorContainer : public CUnknownRecord
|
||||
{
|
||||
TimeBehaviorContainer ()
|
||||
{
|
||||
@ -1452,7 +1452,7 @@ namespace Animations
|
||||
ClientVisualElementContainer clientVisualElement;
|
||||
};
|
||||
|
||||
struct TimeEffectBehaviorAtom : public IRecord
|
||||
struct TimeEffectBehaviorAtom : public CUnknownRecord
|
||||
{
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
{
|
||||
@ -1492,7 +1492,7 @@ namespace Animations
|
||||
DWORD m_nEffectTransition;
|
||||
};
|
||||
|
||||
struct TimeEffectBehaviorContainer : public IRecord
|
||||
struct TimeEffectBehaviorContainer : public CUnknownRecord
|
||||
{
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
{
|
||||
@ -1562,7 +1562,7 @@ namespace Animations
|
||||
TimeBehaviorContainer m_oBehavior;
|
||||
|
||||
};
|
||||
struct TimeConditionAtom : public IRecord
|
||||
struct TimeConditionAtom : public CUnknownRecord
|
||||
{
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
{
|
||||
@ -1593,7 +1593,7 @@ namespace Animations
|
||||
LONG m_nTimeDelay;
|
||||
};
|
||||
|
||||
struct TimeConditionContainer : public IRecord
|
||||
struct TimeConditionContainer : public CUnknownRecord
|
||||
{
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
{
|
||||
@ -1634,7 +1634,7 @@ namespace Animations
|
||||
ClientVisualElementContainer m_oVisualElement;
|
||||
};
|
||||
|
||||
struct TimeIterateDataAtom: public IRecord
|
||||
struct TimeIterateDataAtom: public CUnknownRecord
|
||||
{
|
||||
public:
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
@ -1675,7 +1675,7 @@ namespace Animations
|
||||
|
||||
namespace Animations
|
||||
{
|
||||
struct TimeMotionBehaviorAtom : public IRecord
|
||||
struct TimeMotionBehaviorAtom : public CUnknownRecord
|
||||
{
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
{
|
||||
@ -1730,7 +1730,7 @@ namespace Animations
|
||||
DWORD m_nBehaviorOrigin;
|
||||
};
|
||||
|
||||
struct TimeMotionBehaviorContainer : public IRecord
|
||||
struct TimeMotionBehaviorContainer : public CUnknownRecord
|
||||
{
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
{
|
||||
@ -1784,7 +1784,7 @@ namespace Animations
|
||||
|
||||
namespace Animations
|
||||
{
|
||||
struct TimeSetBehaviorAtom : public IRecord
|
||||
struct TimeSetBehaviorAtom : public CUnknownRecord
|
||||
{
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
{
|
||||
@ -1817,7 +1817,7 @@ namespace Animations
|
||||
TimeAnimateBehaviorValueTypeEnum m_ValueType;
|
||||
};
|
||||
|
||||
struct TimeSetBehaviorContainer : public IRecord
|
||||
struct TimeSetBehaviorContainer : public CUnknownRecord
|
||||
{
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
{
|
||||
@ -1858,7 +1858,7 @@ namespace Animations
|
||||
|
||||
namespace Animations
|
||||
{
|
||||
struct TimeAnimateBehaviorAtom : public IRecord
|
||||
struct TimeAnimateBehaviorAtom : public CUnknownRecord
|
||||
{
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
{
|
||||
@ -1903,7 +1903,7 @@ namespace Animations
|
||||
TimeAnimateBehaviorValueTypeEnum m_ValueType;
|
||||
};
|
||||
|
||||
struct TimeAnimationValueAtom : public IRecord
|
||||
struct TimeAnimationValueAtom : public CUnknownRecord
|
||||
{
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
{
|
||||
@ -1958,7 +1958,7 @@ namespace Animations
|
||||
TimeVariantString m_VarFormula;
|
||||
};
|
||||
|
||||
struct TimeAnimationValueListContainer : public IRecord
|
||||
struct TimeAnimationValueListContainer : public CUnknownRecord
|
||||
{
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
{
|
||||
@ -2004,7 +2004,7 @@ namespace Animations
|
||||
std::vector<TimeAnimationEntry> m_arrEntry;
|
||||
};
|
||||
|
||||
struct TimeAnimateBehaviorContainer : public IRecord
|
||||
struct TimeAnimateBehaviorContainer : public CUnknownRecord
|
||||
{
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
{
|
||||
@ -2069,7 +2069,7 @@ namespace Animations
|
||||
|
||||
namespace Animations
|
||||
{
|
||||
struct TimeRotationBehaviorAtom : public IRecord
|
||||
struct TimeRotationBehaviorAtom : public CUnknownRecord
|
||||
{
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
{
|
||||
@ -2106,7 +2106,7 @@ namespace Animations
|
||||
float fTo;
|
||||
DWORD rotationDirection; // 0 - rotate clockwise, 1 - rotate counter clockwise
|
||||
};
|
||||
struct TimeRotationBehaviorContainer : public IRecord
|
||||
struct TimeRotationBehaviorContainer : public CUnknownRecord
|
||||
{
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
{
|
||||
@ -2136,7 +2136,7 @@ namespace Animations
|
||||
|
||||
namespace Animations
|
||||
{
|
||||
struct TimeScaleBehaviorAtom : public IRecord
|
||||
struct TimeScaleBehaviorAtom : public CUnknownRecord
|
||||
{
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
{
|
||||
@ -2181,7 +2181,7 @@ namespace Animations
|
||||
bool fZoomContents;
|
||||
};
|
||||
|
||||
struct TimeScaleBehaviorContainer : public IRecord
|
||||
struct TimeScaleBehaviorContainer : public CUnknownRecord
|
||||
{
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
{
|
||||
@ -2237,7 +2237,7 @@ namespace Animations
|
||||
}
|
||||
};
|
||||
|
||||
struct TimeColorBehaviorAtom: public IRecord
|
||||
struct TimeColorBehaviorAtom: public CUnknownRecord
|
||||
{
|
||||
public:
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
@ -2278,7 +2278,7 @@ namespace Animations
|
||||
TimeAnimateColor colorTo;
|
||||
};
|
||||
|
||||
struct TimeColorBehaviorContainer : public IRecord
|
||||
struct TimeColorBehaviorContainer : public CUnknownRecord
|
||||
{
|
||||
public:
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
@ -2308,7 +2308,7 @@ namespace Animations
|
||||
|
||||
namespace Animations
|
||||
{
|
||||
struct TimeModifierAtom : public IRecord
|
||||
struct TimeModifierAtom : public CUnknownRecord
|
||||
{
|
||||
public:
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
@ -2335,7 +2335,7 @@ namespace Animations
|
||||
float value;
|
||||
};
|
||||
|
||||
struct SlaveContainer : public IRecord
|
||||
struct SlaveContainer : public CUnknownRecord
|
||||
{
|
||||
public:
|
||||
|
||||
@ -2464,7 +2464,7 @@ namespace Animations
|
||||
bool haveExtTimeContainer;
|
||||
};
|
||||
|
||||
struct ExtTimeNodeContainer : public IRecord
|
||||
struct ExtTimeNodeContainer : public CUnknownRecord
|
||||
{
|
||||
public:
|
||||
|
||||
@ -2818,7 +2818,7 @@ namespace Animations
|
||||
bool haveBuildList;
|
||||
};
|
||||
|
||||
struct SlideTime10Atom : public IRecord
|
||||
struct SlideTime10Atom : public CUnknownRecord
|
||||
{
|
||||
static const DWORD RT_SlideTime10Atom = 0x2EEB;
|
||||
|
||||
@ -2853,7 +2853,7 @@ namespace Animations
|
||||
SYSTEMTIME m_SystemTime;
|
||||
};
|
||||
|
||||
struct SlideFlags10Atom : public IRecord
|
||||
struct SlideFlags10Atom : public CUnknownRecord
|
||||
{
|
||||
static const DWORD RT_SlideFlags10Atom = 0x2EEA;
|
||||
|
||||
@ -2885,7 +2885,7 @@ namespace Animations
|
||||
bool m_bOverrideMasterAnimation; // A bit that specifies whether the slide does not follow the animations on the main master slide or title master slide.
|
||||
};
|
||||
|
||||
struct HashCode10Atom : public IRecord
|
||||
struct HashCode10Atom : public CUnknownRecord
|
||||
{
|
||||
//static const DWORD RT_HashCodeAtom = 0x2B00;
|
||||
|
||||
@ -3756,7 +3756,7 @@ namespace Animations
|
||||
};
|
||||
}
|
||||
|
||||
struct PP10SlideBinaryTagExtension : public IRecord
|
||||
struct PP10SlideBinaryTagExtension : public CUnknownRecord
|
||||
{
|
||||
public:
|
||||
|
||||
@ -3824,7 +3824,7 @@ public:
|
||||
Animations::BuildListContainer* buildListContainer; // OPTIONAL
|
||||
};
|
||||
|
||||
struct SlideProgTagsContainer : public IRecord
|
||||
struct SlideProgTagsContainer : public CUnknownRecord
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
@ -36,8 +36,6 @@ class CRecordCString : public CUnknownRecord
|
||||
{
|
||||
public:
|
||||
std::wstring m_strText;
|
||||
|
||||
public:
|
||||
|
||||
CRecordCString()
|
||||
{
|
||||
|
||||
195
ASCOfficePPTFile/PPTFormatLib/Records/CryptSession10Container.h
Normal file
195
ASCOfficePPTFile/PPTFormatLib/Records/CryptSession10Container.h
Normal file
@ -0,0 +1,195 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
#include "../../../ASCOfficeXlsFile2/source/XlsFormat/Crypt/Decryptor.h"
|
||||
|
||||
class CRecordEncryptedSummary : public CUnknownRecord
|
||||
{
|
||||
public:
|
||||
CRecordEncryptedSummary(){}
|
||||
~CRecordEncryptedSummary(){}
|
||||
|
||||
DWORD StreamOffset;
|
||||
DWORD StreamSize;
|
||||
unsigned short Block;
|
||||
unsigned char NameSize;
|
||||
bool fStream;
|
||||
std::wstring StreamName;
|
||||
|
||||
virtual void ReadFromStream(SRecordHeader & oHeader, const CFStreamPtr &pStream)
|
||||
{
|
||||
m_oHeader = oHeader;
|
||||
|
||||
unsigned char flags;
|
||||
|
||||
*pStream >> StreamOffset >> StreamSize >> Block >> NameSize >> flags;
|
||||
|
||||
fStream = GETBIT(flags, 0);
|
||||
|
||||
if (NameSize > 0 && NameSize < 0xff)
|
||||
{
|
||||
StreamName = ReadStringW(pStream, NameSize);
|
||||
}
|
||||
}
|
||||
};
|
||||
class CEncryptionHeader : public CUnknownRecord
|
||||
{
|
||||
public:
|
||||
|
||||
CRYPT::_rc4CryptData crypt_data_rc4;
|
||||
CRYPT::_ecmaCryptData crypt_data_aes;
|
||||
bool bStandard;
|
||||
|
||||
CEncryptionHeader(){}
|
||||
~CEncryptionHeader(){}
|
||||
|
||||
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
|
||||
{
|
||||
m_oHeader = oHeader;
|
||||
|
||||
int pos_start_record = pStream->tell();
|
||||
|
||||
unsigned short vMajor = StreamUtils::ReadWORD(pStream);
|
||||
unsigned short vMinor = StreamUtils::ReadWORD(pStream);
|
||||
|
||||
if(0x0001 == vMajor) // RC4 encryption header structure
|
||||
{
|
||||
bStandard = true;
|
||||
|
||||
crypt_data_rc4.Salt.b1 = StreamUtils::ReadDWORD(pStream);
|
||||
crypt_data_rc4.Salt.b2 = StreamUtils::ReadDWORD(pStream);
|
||||
crypt_data_rc4.Salt.b3 = StreamUtils::ReadDWORD(pStream);
|
||||
crypt_data_rc4.Salt.b4 = StreamUtils::ReadDWORD(pStream);
|
||||
|
||||
crypt_data_rc4.EncryptedVerifier.b1 = StreamUtils::ReadDWORD(pStream);
|
||||
crypt_data_rc4.EncryptedVerifier.b2 = StreamUtils::ReadDWORD(pStream);
|
||||
crypt_data_rc4.EncryptedVerifier.b3 = StreamUtils::ReadDWORD(pStream);
|
||||
crypt_data_rc4.EncryptedVerifier.b4 = StreamUtils::ReadDWORD(pStream);
|
||||
|
||||
crypt_data_rc4.EncryptedVerifierHash.b1 = StreamUtils::ReadDWORD(pStream);
|
||||
crypt_data_rc4.EncryptedVerifierHash.b2 = StreamUtils::ReadDWORD(pStream);
|
||||
crypt_data_rc4.EncryptedVerifierHash.b3 = StreamUtils::ReadDWORD(pStream);
|
||||
crypt_data_rc4.EncryptedVerifierHash.b4 = StreamUtils::ReadDWORD(pStream);
|
||||
}
|
||||
else
|
||||
{
|
||||
bStandard = false;
|
||||
crypt_data_aes.bAgile = false;
|
||||
|
||||
unsigned short flags = StreamUtils::ReadDWORD(pStream);
|
||||
unsigned char *pDataRead = NULL;
|
||||
|
||||
bool fCryptoAPI = GETBIT(flags, 1);
|
||||
bool fDocProps = GETBIT(flags, 2);
|
||||
bool fExternal = GETBIT(flags, 3);
|
||||
bool fAES = GETBIT(flags, 4);
|
||||
|
||||
//EncryptionHeader
|
||||
int HeaderSize = StreamUtils::ReadDWORD(pStream);
|
||||
int Flags = StreamUtils::ReadDWORD(pStream);
|
||||
int SizeExtra = StreamUtils::ReadDWORD(pStream);
|
||||
int AlgID = StreamUtils::ReadDWORD(pStream);
|
||||
int AlgIDHash = StreamUtils::ReadDWORD(pStream);
|
||||
int KeySize = StreamUtils::ReadDWORD(pStream);
|
||||
int ProviderType= StreamUtils::ReadDWORD(pStream);
|
||||
int Reserved1 = StreamUtils::ReadDWORD(pStream);
|
||||
int Reserved2 = StreamUtils::ReadDWORD(pStream);
|
||||
|
||||
int pos = pStream->tell();
|
||||
int size = pStream->size();
|
||||
|
||||
std::vector<char> dataCSPName;
|
||||
while(pos < size - 1)
|
||||
{
|
||||
dataCSPName.push_back(StreamUtils::ReadBYTE(pStream));
|
||||
dataCSPName.push_back(StreamUtils::ReadBYTE(pStream));
|
||||
if (dataCSPName[dataCSPName.size() - 1] == 0 && dataCSPName[dataCSPName.size() - 2] == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
pos+=2;//unicode null-terminate string
|
||||
}
|
||||
//EncryptionVerifier
|
||||
crypt_data_aes.saltSize = StreamUtils::ReadDWORD(pStream);
|
||||
crypt_data_aes.saltValue = StreamUtils::ReadStringA(pStream, crypt_data_aes.saltSize);
|
||||
|
||||
crypt_data_aes.encryptedVerifierInput = StreamUtils::ReadStringA(pStream, 0x10);
|
||||
|
||||
crypt_data_aes.hashSize = StreamUtils::ReadDWORD(pStream);
|
||||
|
||||
int szEncryptedVerifierHash = (ProviderType == 0x0001) ? 0x14 : 0x20;
|
||||
crypt_data_aes.encryptedVerifierValue = StreamUtils::ReadStringA(pStream, szEncryptedVerifierHash);
|
||||
|
||||
pos = pStream->tell();
|
||||
|
||||
//------------------------------------------------------------------------------------------
|
||||
switch(AlgIDHash)
|
||||
{
|
||||
case 0x8003: crypt_data_aes.hashAlgorithm = CRYPT_METHOD::MD5; break;
|
||||
case 0x0000:
|
||||
case 0x8004: crypt_data_aes.hashAlgorithm = CRYPT_METHOD::SHA1; break;
|
||||
}
|
||||
crypt_data_aes.spinCount = 0;
|
||||
|
||||
switch(AlgID)
|
||||
{
|
||||
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;
|
||||
crypt_data_aes.keySize = 128 /8;
|
||||
break;
|
||||
case 0x660F:
|
||||
crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::AES_ECB;
|
||||
crypt_data_aes.keySize = 192 /8;
|
||||
break;
|
||||
case 0x6610:
|
||||
crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::AES_ECB;
|
||||
crypt_data_aes.keySize = 256 /8;
|
||||
break;
|
||||
}
|
||||
|
||||
//switch(ProviderType)
|
||||
//{
|
||||
// case 0x0001: crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::RC4; break;
|
||||
// case 0x0018: crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::AES_ECB; break;
|
||||
//}
|
||||
}
|
||||
int pos_end_record = pStream->tell();
|
||||
|
||||
int sz_header = pos_end_record - pos_start_record;
|
||||
}
|
||||
};
|
||||
@ -54,8 +54,7 @@ public:
|
||||
|
||||
DWORD m_nRelVersion; // 0x00000008 or 0x00000009
|
||||
|
||||
public:
|
||||
|
||||
|
||||
CRecordCurrentUserAtom() : m_nToken(0)
|
||||
{
|
||||
m_nRelVersion = m_nDocFileVersion = m_nMinorVersion = m_nMajorVersion = m_nLenUserName = m_nOffsetToCurEdit = 0;
|
||||
|
||||
@ -39,194 +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);
|
||||
|
||||
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);
|
||||
oMetaFile.m_bIsValid = TRUE;
|
||||
oMetaFile.m_sExtension = L".emf";
|
||||
|
||||
sExt = _T(".bmp");
|
||||
break;
|
||||
}
|
||||
case RECORD_TYPE_ESCHER_BLIP_TIFF:
|
||||
{
|
||||
if (0x06E4 == oHeader.RecInstance) lOffset = 17;
|
||||
else if (0x06E5 == oHeader.RecInstance) lOffset = 33;
|
||||
|
||||
StreamUtils::StreamSkip(lOffset, pStream);
|
||||
|
||||
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_strMemoryForder + 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);
|
||||
|
||||
std::wstring strFile = L"Image " + std::to_wstring(nImagesCount + 1) + sExt;
|
||||
CMetaHeader oMetaHeader;
|
||||
oMetaHeader.FromStream(pStream, pDecryptor);
|
||||
|
||||
CFile fileImage;
|
||||
HRESULT hr = fileImage.CreateFile(m_strMemoryForder + 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;
|
||||
Gdiplus::ENHMETAHEADER3 oEmfHeader;
|
||||
oMetaHeader.ToEMFHeader(&oEmfHeader);
|
||||
|
||||
m_sFileName = strFile;
|
||||
}
|
||||
int dwOffset = pos - 8;
|
||||
|
||||
if (m_oDocumentInfo)
|
||||
oMetaFile.SetHeader(NULL, 0);
|
||||
|
||||
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_WMF:
|
||||
{
|
||||
m_oDocumentInfo->m_mapStoreImageFile[dwOffset ] = m_sFileName;
|
||||
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)
|
||||
{
|
||||
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_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, 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);
|
||||
|
||||
sExt = _T(".bmp");
|
||||
break;
|
||||
}
|
||||
case RECORD_TYPE_ESCHER_BLIP_TIFF:
|
||||
{
|
||||
if (0x06E4 == oHeader.RecInstance) lOffset = 17;
|
||||
else if (0x06E5 == oHeader.RecInstance) lOffset = 33;
|
||||
|
||||
StreamUtils::StreamSkip(lOffset, pStream);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ public:
|
||||
CPPTDocumentInfo * m_oDocumentInfo;
|
||||
|
||||
std::wstring m_sFileName;
|
||||
std::wstring m_strMemoryForder;
|
||||
std::wstring m_strTmpDirectory;
|
||||
|
||||
CRecordOfficeArtBlip()
|
||||
{
|
||||
|
||||
@ -40,8 +40,6 @@ public:
|
||||
double m_dStartTime;
|
||||
double m_dEndTime;
|
||||
|
||||
public:
|
||||
|
||||
CRecordExCDAudioContainer()
|
||||
{
|
||||
m_dStartTime = 0;
|
||||
|
||||
@ -49,12 +49,15 @@ public:
|
||||
|
||||
DWORD m_nPersistIdSeed; // for next
|
||||
|
||||
DWORD m_nEncryptSessionPersistIdRef;
|
||||
|
||||
USHORT m_nLastView;
|
||||
|
||||
public:
|
||||
|
||||
CRecordUserEditAtom()
|
||||
{
|
||||
m_nEncryptSessionPersistIdRef = 0;
|
||||
}
|
||||
|
||||
~CRecordUserEditAtom()
|
||||
@ -67,36 +70,39 @@ public:
|
||||
|
||||
m_nLastSlideIdRef = StreamUtils::ReadDWORD(pStream);
|
||||
|
||||
m_nVersion = StreamUtils::ReadWORD(pStream);
|
||||
m_nVersion = StreamUtils::ReadWORD(pStream);
|
||||
m_nMinorVersion = StreamUtils::ReadBYTE(pStream);
|
||||
m_nMajorVersion = StreamUtils::ReadBYTE(pStream);
|
||||
|
||||
m_nOffsetLastEdit = StreamUtils::ReadDWORD(pStream);
|
||||
m_nOffsetPersistDirectory = StreamUtils::ReadDWORD(pStream);
|
||||
m_nOffsetDocPersistIdRef = StreamUtils::ReadDWORD(pStream);
|
||||
m_nOffsetLastEdit = StreamUtils::ReadDWORD(pStream);
|
||||
m_nOffsetPersistDirectory = StreamUtils::ReadDWORD(pStream);
|
||||
m_nOffsetDocPersistIdRef = StreamUtils::ReadDWORD(pStream);
|
||||
|
||||
m_nPersistIdSeed = StreamUtils::ReadDWORD(pStream);
|
||||
m_nLastView = StreamUtils::ReadWORD(pStream);
|
||||
m_nPersistIdSeed = StreamUtils::ReadDWORD(pStream);
|
||||
m_nLastView = StreamUtils::ReadWORD(pStream);
|
||||
|
||||
StreamUtils::StreamSkip(m_oHeader.RecLen - 22, pStream);
|
||||
StreamUtils::StreamSkip(2, pStream);
|
||||
|
||||
if (m_oHeader.RecLen > 28)
|
||||
{
|
||||
m_nEncryptSessionPersistIdRef = StreamUtils::ReadDWORD(pStream);
|
||||
}
|
||||
}
|
||||
|
||||
CRecordUserEditAtom& operator =(const CRecordUserEditAtom& oSrc)
|
||||
{
|
||||
m_nLastSlideIdRef = oSrc.m_nLastSlideIdRef;
|
||||
m_nLastSlideIdRef = oSrc.m_nLastSlideIdRef;
|
||||
|
||||
m_nVersion = oSrc.m_nVersion;
|
||||
m_nMinorVersion = oSrc.m_nMinorVersion;
|
||||
m_nMajorVersion = oSrc.m_nMajorVersion;
|
||||
m_nVersion = oSrc.m_nVersion;
|
||||
m_nMinorVersion = oSrc.m_nMinorVersion;
|
||||
m_nMajorVersion = oSrc.m_nMajorVersion;
|
||||
|
||||
m_nOffsetLastEdit = oSrc.m_nOffsetLastEdit;
|
||||
|
||||
m_nOffsetPersistDirectory = oSrc.m_nOffsetPersistDirectory;
|
||||
|
||||
m_nOffsetDocPersistIdRef = oSrc.m_nOffsetDocPersistIdRef;
|
||||
m_nPersistIdSeed = oSrc.m_nPersistIdSeed;
|
||||
|
||||
m_nLastView = oSrc.m_nLastView;
|
||||
m_nOffsetLastEdit = oSrc.m_nOffsetLastEdit;
|
||||
m_nOffsetPersistDirectory = oSrc.m_nOffsetPersistDirectory;
|
||||
m_nOffsetDocPersistIdRef = oSrc.m_nOffsetDocPersistIdRef;
|
||||
m_nPersistIdSeed = oSrc.m_nPersistIdSeed;
|
||||
m_nLastView = oSrc.m_nLastView;
|
||||
m_nEncryptSessionPersistIdRef = oSrc.m_nEncryptSessionPersistIdRef;
|
||||
return (*this);
|
||||
}
|
||||
};
|
||||
@ -486,6 +486,10 @@
|
||||
RelativePath="..\Reader\PPTFileDefines.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Reader\PPTFileReader.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Reader\PPTFileReader.h"
|
||||
>
|
||||
@ -542,6 +546,10 @@
|
||||
RelativePath="..\Records\ColorSchemeAtom.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Records\CryptSession10Container.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Records\CString.h"
|
||||
>
|
||||
|
||||
@ -60,7 +60,7 @@ int _tmain(int argc, _TCHAR* argv[])
|
||||
|
||||
pptFile.put_TempDirectory(tempPath);
|
||||
|
||||
HRESULT hRes = pptFile.LoadFromFile(sSrcPpt, dstTempPath);
|
||||
HRESULT hRes = pptFile.LoadFromFile(sSrcPpt, dstTempPath, L"password");
|
||||
|
||||
if (hRes == S_OK)
|
||||
{
|
||||
|
||||
@ -2,44 +2,44 @@ Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PPTXFormat", "..\..\ASCOfficePPTXFile\PPTXLib\PPTXFormat.vcproj", "{36636678-AE25-4BE6-9A34-2561D1BCF302}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56} = {C739151F-5384-41DF-A1A6-F089E2C1AD56}
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0} = {A100103A-353E-45E8-A9B8-90B87CC5C0B0}
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} = {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0} = {A100103A-353E-45E8-A9B8-90B87CC5C0B0}
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56} = {C739151F-5384-41DF-A1A6-F089E2C1AD56}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "graphics", "..\..\DesktopEditor\graphics\graphics_vs2005.vcproj", "{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7} = {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56} = {C739151F-5384-41DF-A1A6-F089E2C1AD56}
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239} = {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169} = {DF861D33-9BC1-418C-82B1-581F590FE169}
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3} = {0588563C-F05C-428C-B21A-DD74756628B3}
|
||||
{40A69F40-063E-43FD-8543-455495D8733E} = {40A69F40-063E-43FD-8543-455495D8733E}
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E} = {9A037A69-D1DF-4505-AB2A-6CB3641C476E}
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD} = {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1} = {EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36} = {BC52A07C-A797-423D-8C4F-8678805BBB36}
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} = {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470} = {818753F2-DBB9-4D3B-898A-A604309BE470}
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} = {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36} = {BC52A07C-A797-423D-8C4F-8678805BBB36}
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1} = {EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD} = {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E} = {9A037A69-D1DF-4505-AB2A-6CB3641C476E}
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}
|
||||
{40A69F40-063E-43FD-8543-455495D8733E} = {40A69F40-063E-43FD-8543-455495D8733E}
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3} = {0588563C-F05C-428C-B21A-DD74756628B3}
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169} = {DF861D33-9BC1-418C-82B1-581F590FE169}
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239} = {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56} = {C739151F-5384-41DF-A1A6-F089E2C1AD56}
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7} = {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "agg2d", "..\..\DesktopEditor\agg-2.4\agg_vs2005.vcproj", "{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cximage", "..\..\DesktopEditor\cximage\CxImage\cximage_vs2005.vcproj", "{BC52A07C-A797-423D-8C4F-8678805BBB36}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470} = {818753F2-DBB9-4D3B-898A-A604309BE470}
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D} = {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1} = {EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E} = {9A037A69-D1DF-4505-AB2A-6CB3641C476E}
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}
|
||||
{40A69F40-063E-43FD-8543-455495D8733E} = {40A69F40-063E-43FD-8543-455495D8733E}
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3} = {0588563C-F05C-428C-B21A-DD74756628B3}
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169} = {DF861D33-9BC1-418C-82B1-581F590FE169}
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239} = {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7} = {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239} = {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169} = {DF861D33-9BC1-418C-82B1-581F590FE169}
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3} = {0588563C-F05C-428C-B21A-DD74756628B3}
|
||||
{40A69F40-063E-43FD-8543-455495D8733E} = {40A69F40-063E-43FD-8543-455495D8733E}
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E} = {9A037A69-D1DF-4505-AB2A-6CB3641C476E}
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1} = {EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D} = {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470} = {818753F2-DBB9-4D3B-898A-A604309BE470}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jpeg", "..\..\DesktopEditor\cximage\jpeg\Jpeg_vs2005.vcproj", "{818753F2-DBB9-4D3B-898A-A604309BE470}"
|
||||
@ -69,12 +69,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpsd", "..\..\DesktopEdit
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PPTFormatLib", "..\PPTFormatLib\Win32\PPTFormatLib.vcproj", "{7B27E40E-F70A-4A74-A77C-0944D7931D15}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302} = {36636678-AE25-4BE6-9A34-2561D1BCF302}
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0} = {A100103A-353E-45E8-A9B8-90B87CC5C0B0}
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56} = {C739151F-5384-41DF-A1A6-F089E2C1AD56}
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56} = {C739151F-5384-41DF-A1A6-F089E2C1AD56}
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0} = {A100103A-353E-45E8-A9B8-90B87CC5C0B0}
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302} = {36636678-AE25-4BE6-9A34-2561D1BCF302}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jbig", "..\..\DesktopEditor\cximage\jbig\jbig_vs2005.vcproj", "{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}"
|
||||
@ -86,19 +86,32 @@ EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PptFormatTest", "PptFormatTest.vcproj", "{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{7B27E40E-F70A-4A74-A77C-0944D7931D15} = {7B27E40E-F70A-4A74-A77C-0944D7931D15}
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363} = {F8274B05-168E-4D6E-B843-AA7510725363}
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302} = {36636678-AE25-4BE6-9A34-2561D1BCF302}
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF} = {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C} = {C27E9A9F-3A17-4482-9C5F-BF15C01E747C}
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302} = {36636678-AE25-4BE6-9A34-2561D1BCF302}
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363} = {F8274B05-168E-4D6E-B843-AA7510725363}
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D} = {77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libxml2", "..\..\DesktopEditor\xml\build\vs2005\libxml2.vcproj", "{21663823-DE45-479B-91D0-B4FEF4916EF0}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OfficeFileCrypt", "..\..\OfficeCryptReader\win32\ECMACryptReader.vcproj", "{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XlsFormat", "..\..\ASCOfficeXlsFile2\source\win32\XlsFormat.vcproj", "{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cryptlib", "..\..\Common\3dParty\cryptopp\cryptlib.vcproj", "{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
DLL-Import Debug|Win32 = DLL-Import Debug|Win32
|
||||
DLL-Import Debug|x64 = DLL-Import Debug|x64
|
||||
DLL-Import Release|Win32 = DLL-Import Release|Win32
|
||||
DLL-Import Release|x64 = DLL-Import Release|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
ReleaseASC|Win32 = ReleaseASC|Win32
|
||||
@ -115,6 +128,14 @@ Global
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Debug|x64.Build.0 = Debug|x64
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Release|Win32.Build.0 = Release|Win32
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Release|x64.ActiveCfg = Release|x64
|
||||
@ -137,6 +158,14 @@ Global
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug|x64.Build.0 = Debug|x64
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release|Win32.Build.0 = Release|Win32
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release|x64.ActiveCfg = Release|x64
|
||||
@ -159,6 +188,14 @@ Global
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug|x64.Build.0 = Debug|x64
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Release|Win32.Build.0 = Release|Win32
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Release|x64.ActiveCfg = Release|x64
|
||||
@ -181,6 +218,14 @@ Global
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Debug|x64.Build.0 = Debug|x64
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Release|Win32.Build.0 = Release|Win32
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Release|x64.ActiveCfg = Release|x64
|
||||
@ -203,6 +248,14 @@ Global
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Debug|x64.Build.0 = Debug|x64
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Release|Win32.Build.0 = Release|Win32
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Release|x64.ActiveCfg = Release|x64
|
||||
@ -225,6 +278,14 @@ Global
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Debug|x64.Build.0 = Debug|x64
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release|Win32.Build.0 = Release|Win32
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release|x64.ActiveCfg = Release|x64
|
||||
@ -248,6 +309,14 @@ Global
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Debug|x64.Build.0 = Debug|x64
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Release|Win32.Build.0 = Release|Win32
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Release|x64.ActiveCfg = Release|x64
|
||||
@ -270,6 +339,14 @@ Global
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.Build.0 = Debug|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.Build.0 = Release|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.ActiveCfg = Release|x64
|
||||
@ -292,6 +369,14 @@ Global
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Debug|x64.Build.0 = Debug|x64
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Release|Win32.Build.0 = Release|Win32
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Release|x64.ActiveCfg = Release|x64
|
||||
@ -314,6 +399,14 @@ Global
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Debug|x64.Build.0 = Debug|x64
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Release|Win32.Build.0 = Release|Win32
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Release|x64.ActiveCfg = Release|x64
|
||||
@ -336,6 +429,14 @@ Global
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Debug|x64.Build.0 = Debug|x64
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Release|Win32.Build.0 = Release|Win32
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Release|x64.ActiveCfg = Release|x64
|
||||
@ -358,6 +459,14 @@ Global
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Debug|x64.Build.0 = Debug|x64
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Release|Win32.Build.0 = Release|Win32
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Release|x64.ActiveCfg = Release|x64
|
||||
@ -380,6 +489,14 @@ Global
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Debug|x64.Build.0 = Debug|x64
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Release|Win32.Build.0 = Release|Win32
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Release|x64.ActiveCfg = Release|x64
|
||||
@ -402,6 +519,14 @@ Global
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Debug|x64.Build.0 = Debug|x64
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Release|Win32.Build.0 = Release|Win32
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Release|x64.ActiveCfg = Release|x64
|
||||
@ -424,6 +549,14 @@ Global
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Debug|x64.Build.0 = Debug|x64
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Release|Win32.Build.0 = Release|Win32
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Release|x64.ActiveCfg = Release|x64
|
||||
@ -446,6 +579,14 @@ Global
|
||||
{7B27E40E-F70A-4A74-A77C-0944D7931D15}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{7B27E40E-F70A-4A74-A77C-0944D7931D15}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{7B27E40E-F70A-4A74-A77C-0944D7931D15}.Debug|x64.Build.0 = Debug|x64
|
||||
{7B27E40E-F70A-4A74-A77C-0944D7931D15}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{7B27E40E-F70A-4A74-A77C-0944D7931D15}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{7B27E40E-F70A-4A74-A77C-0944D7931D15}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{7B27E40E-F70A-4A74-A77C-0944D7931D15}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{7B27E40E-F70A-4A74-A77C-0944D7931D15}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{7B27E40E-F70A-4A74-A77C-0944D7931D15}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{7B27E40E-F70A-4A74-A77C-0944D7931D15}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{7B27E40E-F70A-4A74-A77C-0944D7931D15}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{7B27E40E-F70A-4A74-A77C-0944D7931D15}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{7B27E40E-F70A-4A74-A77C-0944D7931D15}.Release|Win32.Build.0 = Release|Win32
|
||||
{7B27E40E-F70A-4A74-A77C-0944D7931D15}.Release|x64.ActiveCfg = Release|x64
|
||||
@ -468,6 +609,14 @@ Global
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Debug|x64.Build.0 = Debug|x64
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Release|Win32.Build.0 = Release|Win32
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Release|x64.ActiveCfg = Release|x64
|
||||
@ -490,6 +639,14 @@ Global
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Debug|x64.Build.0 = Debug|x64
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Release|Win32.Build.0 = Release|Win32
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Release|x64.ActiveCfg = Release|x64
|
||||
@ -512,6 +669,14 @@ Global
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Debug|x64.Build.0 = Debug|x64
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Release|Win32.Build.0 = Release|Win32
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Release|x64.ActiveCfg = Release|x64
|
||||
@ -534,6 +699,14 @@ Global
|
||||
{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}.Debug|x64.Build.0 = Debug|x64
|
||||
{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}.Release|Win32.Build.0 = Release|Win32
|
||||
{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}.Release|x64.ActiveCfg = Release|x64
|
||||
@ -556,6 +729,14 @@ Global
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|x64.Build.0 = Debug|x64
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|Win32.Build.0 = Release|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|x64.ActiveCfg = Release|x64
|
||||
@ -574,6 +755,96 @@ Global
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Unicode Release|Win32.Build.0 = Release|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Unicode Release|x64.ActiveCfg = Release|x64
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Unicode Release|x64.Build.0 = Release|x64
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.Debug|x64.Build.0 = Debug|x64
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.Release|Win32.Build.0 = Release|Win32
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.Release|x64.ActiveCfg = Release|x64
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.Release|x64.Build.0 = Release|x64
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.ReleaseASC|Win32.ActiveCfg = Release|x64
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.ReleaseASC|x64.ActiveCfg = Release|x64
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.ReleaseASC|x64.Build.0 = Release|x64
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.ReleaseOpenSource|Win32.ActiveCfg = Release|x64
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.ReleaseOpenSource|x64.ActiveCfg = Release|x64
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.ReleaseOpenSource|x64.Build.0 = Release|x64
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.Unicode Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.Unicode Debug|Win32.Build.0 = Debug|Win32
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.Unicode Debug|x64.ActiveCfg = Debug|x64
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.Unicode Debug|x64.Build.0 = Debug|x64
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.Unicode Release|Win32.ActiveCfg = Release|Win32
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.Unicode Release|Win32.Build.0 = Release|Win32
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.Unicode Release|x64.ActiveCfg = Release|x64
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.Unicode Release|x64.Build.0 = Release|x64
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.Debug|x64.Build.0 = Debug|x64
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.Release|Win32.Build.0 = Release|Win32
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.Release|x64.ActiveCfg = Release|x64
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.Release|x64.Build.0 = Release|x64
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.ReleaseASC|Win32.ActiveCfg = Release|x64
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.ReleaseASC|x64.ActiveCfg = Release|x64
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.ReleaseASC|x64.Build.0 = Release|x64
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.ReleaseOpenSource|Win32.ActiveCfg = Release|x64
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.ReleaseOpenSource|x64.ActiveCfg = Release|x64
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.ReleaseOpenSource|x64.Build.0 = Release|x64
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.Unicode Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.Unicode Debug|Win32.Build.0 = Debug|Win32
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.Unicode Debug|x64.ActiveCfg = Debug|x64
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.Unicode Debug|x64.Build.0 = Debug|x64
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.Unicode Release|Win32.ActiveCfg = Release|Win32
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.Unicode Release|Win32.Build.0 = Release|Win32
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.Unicode Release|x64.ActiveCfg = Release|x64
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.Unicode Release|x64.Build.0 = Release|x64
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Debug|x64.Build.0 = Debug|x64
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.DLL-Import Debug|Win32.ActiveCfg = DLL-Import Debug|Win32
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.DLL-Import Debug|Win32.Build.0 = DLL-Import Debug|Win32
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.DLL-Import Debug|x64.ActiveCfg = DLL-Import Debug|x64
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.DLL-Import Debug|x64.Build.0 = DLL-Import Debug|x64
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.DLL-Import Release|Win32.ActiveCfg = DLL-Import Release|Win32
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.DLL-Import Release|Win32.Build.0 = DLL-Import Release|Win32
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.DLL-Import Release|x64.ActiveCfg = DLL-Import Release|x64
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.DLL-Import Release|x64.Build.0 = DLL-Import Release|x64
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Release|Win32.Build.0 = Release|Win32
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Release|x64.ActiveCfg = Release|x64
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Release|x64.Build.0 = Release|x64
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.ReleaseASC|Win32.ActiveCfg = Release|x64
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.ReleaseASC|x64.ActiveCfg = Release|x64
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.ReleaseASC|x64.Build.0 = Release|x64
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.ReleaseOpenSource|Win32.ActiveCfg = Release|x64
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.ReleaseOpenSource|x64.ActiveCfg = Release|x64
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.ReleaseOpenSource|x64.Build.0 = Release|x64
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Unicode Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Unicode Debug|Win32.Build.0 = Debug|Win32
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Unicode Debug|x64.ActiveCfg = Debug|x64
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Unicode Debug|x64.Build.0 = Debug|x64
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Unicode Release|Win32.ActiveCfg = Release|Win32
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Unicode Release|Win32.Build.0 = Release|Win32
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Unicode Release|x64.ActiveCfg = Release|x64
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Unicode Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@ -186,6 +186,8 @@ namespace NSBinPptxRW
|
||||
#define SPTREE_TYPE_SPTREE 4
|
||||
#define SPTREE_TYPE_GRFRAME 5
|
||||
#define SPTREE_TYPE_OLE 6
|
||||
#define SPTREE_TYPE_VIDEO 7
|
||||
#define SPTREE_TYPE_AUDIO 8
|
||||
|
||||
static BYTE SchemeClr_GetBYTECode(const std::wstring& sValue)
|
||||
{
|
||||
|
||||
@ -36,6 +36,8 @@
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/WritingElement.h"
|
||||
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/Media/OleObject.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/Media/Audio.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/Media/Video.h"
|
||||
|
||||
#include "../../Common/Base64.h"
|
||||
|
||||
@ -106,7 +108,7 @@ namespace NSBinPptxRW
|
||||
CreateFontPicker(NULL);
|
||||
}
|
||||
|
||||
CImageManager2::CImageManager2() : m_mapImages(), m_lIndexNextImage(0), m_lIndexNextOle(0)
|
||||
CImageManager2::CImageManager2() : m_mapImages(), m_lIndexNextImage(0), m_lIndexCounter(0)
|
||||
{
|
||||
m_nDocumentType = XMLWRITER_DOC_TYPE_PPTX;
|
||||
m_pContentTypes = new OOX::CContentTypes();
|
||||
@ -118,8 +120,8 @@ namespace NSBinPptxRW
|
||||
void CImageManager2::Clear()
|
||||
{
|
||||
m_mapImages.clear();
|
||||
m_lIndexNextImage = 1;
|
||||
m_lIndexNextOle = 1;
|
||||
m_lIndexNextImage = 0;
|
||||
m_lIndexCounter = 0;
|
||||
}
|
||||
void CImageManager2::SetDstMedia(const std::wstring& strDst)
|
||||
{
|
||||
@ -147,34 +149,50 @@ namespace NSBinPptxRW
|
||||
{
|
||||
if(nIndex1 + sFind1.length() < strInput.length())
|
||||
{
|
||||
wchar_t cRes = strInput[nIndex1 + sFind1.length()];
|
||||
if('1' <= cRes && cRes <= '6')
|
||||
wchar_t cRes1 = strInput[nIndex1 + sFind1.length()];
|
||||
if('1' <= cRes1 && cRes1 <= '9')
|
||||
{
|
||||
wchar_t cRes2 = strInput[nIndex1 + sFind1.length() + 1];
|
||||
|
||||
int nImageIndex = nIndex1 + (int)sFind1.length() + 1;
|
||||
if(nImageIndex == (int)strInput.find(_T("image"), nImageIndex))
|
||||
nRes = cRes - '0';
|
||||
if (std::wstring::npos != strInput.find(_T("image"), nImageIndex))
|
||||
{
|
||||
nRes = cRes1 - '0';
|
||||
if('0' <= cRes2 && cRes2 <= '9')
|
||||
{
|
||||
nRes = nRes * 10 + (cRes2 - '0');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return nRes;
|
||||
}
|
||||
_imageManager2Info CImageManager2::GenerateImage(const std::wstring& strInput, NSCommon::smart_ptr<OOX::OleObject> & oleFile, const std::wstring& oleData, std::wstring strBase64Image)
|
||||
_imageManager2Info CImageManager2::GenerateImage(const std::wstring& strInput, NSCommon::smart_ptr<OOX::File> & additionalFile, const std::wstring& oleData, std::wstring strBase64Image)
|
||||
{
|
||||
if (IsNeedDownload(strInput))
|
||||
return DownloadImage(strInput);
|
||||
|
||||
std::map<std::wstring, _imageManager2Info>::const_iterator pPair = m_mapImages.find ((_T("") == strBase64Image) ? strInput : strBase64Image);
|
||||
std::map<std::wstring, _imageManager2Info>::const_iterator pPair = m_mapImages.find ((strBase64Image.empty()) ? strInput : strBase64Image);
|
||||
|
||||
if (pPair != m_mapImages.end())
|
||||
{
|
||||
smart_ptr<OOX::Media> mediaFile = additionalFile.smart_dynamic_cast<OOX::Media>();
|
||||
if (mediaFile.IsInit())
|
||||
mediaFile->set_filename(pPair->second.sFilepathAdditional);
|
||||
|
||||
return pPair->second;
|
||||
}
|
||||
|
||||
std::wstring strExts = _T(".jpg");
|
||||
int nIndexExt = (int)strInput.rfind(wchar_t('.'));
|
||||
if (-1 != nIndexExt)
|
||||
strExts = strInput.substr(nIndexExt);
|
||||
|
||||
std::wstring strOleBin;
|
||||
int typeAdditional = 0;
|
||||
std::wstring strAdditional;
|
||||
std::wstring strImage = strInput;
|
||||
|
||||
int nDisplayType = IsDisplayedImage(strInput);
|
||||
@ -208,21 +226,52 @@ namespace NSBinPptxRW
|
||||
}
|
||||
if(0 != (nDisplayType & 4))
|
||||
{
|
||||
smart_ptr<OOX::OleObject> oleFile = additionalFile.smart_dynamic_cast<OOX::OleObject>();
|
||||
if (oleFile.IsInit())
|
||||
{
|
||||
if (OOX::CSystemUtility::IsFileExist(oleFile->filename()) == false)
|
||||
{
|
||||
typeAdditional = 1;
|
||||
|
||||
std::wstring strOle = strFolder + strFileName + oleFile->filename().GetExtention();
|
||||
if (OOX::CSystemUtility::IsFileExist(strOle))
|
||||
{
|
||||
m_pContentTypes->AddDefault(oleFile->filename().GetExtention(false));
|
||||
strOleBin = strOle;
|
||||
strAdditional = strOle;
|
||||
}
|
||||
else
|
||||
{
|
||||
strOle = strFolder + strFileName + L".bin";
|
||||
if (OOX::CSystemUtility::IsFileExist(strOle))
|
||||
strOleBin = strOle;
|
||||
strAdditional = strOle;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(0 != (nDisplayType & 8))
|
||||
{
|
||||
smart_ptr<OOX::Media> mediaFile = additionalFile.smart_dynamic_cast<OOX::Media>();
|
||||
if (mediaFile.IsInit())
|
||||
{
|
||||
if (OOX::CSystemUtility::IsFileExist(mediaFile->filename()) == false)
|
||||
{
|
||||
typeAdditional = 2;
|
||||
|
||||
std::wstring strMedia = strFolder + strFileName + mediaFile->filename().GetExtention();
|
||||
if (OOX::CSystemUtility::IsFileExist(strMedia))
|
||||
{
|
||||
m_pContentTypes->AddDefault(mediaFile->filename().GetExtention(false));
|
||||
strAdditional = strMedia;
|
||||
}
|
||||
else
|
||||
{
|
||||
strMedia = strFolder + strFileName;
|
||||
|
||||
if (mediaFile.is<OOX::Audio>()) strMedia += L".wav";
|
||||
if (mediaFile.is<OOX::Video>()) strMedia += L".avi";
|
||||
|
||||
if (OOX::CSystemUtility::IsFileExist(strMedia))
|
||||
strAdditional = strMedia;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -233,10 +282,20 @@ namespace NSBinPptxRW
|
||||
m_pContentTypes->AddDefault(strExts.substr(1));
|
||||
}
|
||||
|
||||
_imageManager2Info oImageManagerInfo = GenerateImageExec(strImage, strExts, strOleBin, oleData);
|
||||
if (oleData.empty() == false)
|
||||
{
|
||||
//plugins data - generate ole
|
||||
typeAdditional = 1;
|
||||
}
|
||||
|
||||
if (!oImageManagerInfo.sFilepathOle.empty())
|
||||
oleFile->set_filename(oImageManagerInfo.sFilepathOle);
|
||||
_imageManager2Info oImageManagerInfo = GenerateImageExec(strImage, strExts, strAdditional, typeAdditional, oleData);
|
||||
|
||||
if (!oImageManagerInfo.sFilepathAdditional.empty())
|
||||
{
|
||||
smart_ptr<OOX::Media> mediaFile = additionalFile.smart_dynamic_cast<OOX::Media>();
|
||||
if (mediaFile.IsInit())
|
||||
mediaFile->set_filename(oImageManagerInfo.sFilepathAdditional);
|
||||
}
|
||||
|
||||
if (strBase64Image.empty())
|
||||
m_mapImages[strInput] = oImageManagerInfo;
|
||||
@ -281,7 +340,7 @@ namespace NSBinPptxRW
|
||||
}
|
||||
return bRes;
|
||||
}
|
||||
_imageManager2Info CImageManager2::GenerateImageExec(const std::wstring& strInput, const std::wstring& sExts, const std::wstring& strOleImage, const std::wstring& oleData)
|
||||
_imageManager2Info CImageManager2::GenerateImageExec(const std::wstring& strInput, const std::wstring& sExts, const std::wstring& strAdditionalImage, int nAdditionalType, const std::wstring& oleData)
|
||||
{
|
||||
OOX::CPath oPathOutput;
|
||||
_imageManager2Info oImageManagerInfo;
|
||||
@ -293,8 +352,11 @@ namespace NSBinPptxRW
|
||||
{
|
||||
oPathOutput = m_strDstMedia + FILE_SEPARATOR_STR + strImage + strExts;
|
||||
|
||||
if (oPathOutput.GetPath() != strInput)
|
||||
CDirectory::CopyFile(strInput, oPathOutput.GetPath());
|
||||
if (oPathOutput.GetPath() != strInput && NSFile::CFileBinary::Exists(strInput))
|
||||
{
|
||||
NSFile::CFileBinary::Copy(strInput, oPathOutput.GetPath());
|
||||
oImageManagerInfo.sFilepathImage = oPathOutput.GetPath();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -302,32 +364,52 @@ namespace NSBinPptxRW
|
||||
strExts = _T(".png");
|
||||
oPathOutput = m_strDstMedia + FILE_SEPARATOR_STR + strImage + strExts;
|
||||
SaveImageAsPng(strInput, oPathOutput.GetPath());
|
||||
oImageManagerInfo.sFilepathImage = oPathOutput.GetPath();
|
||||
}
|
||||
oImageManagerInfo.sFilepathImage = oPathOutput.GetPath();
|
||||
|
||||
if (!strOleImage.empty() || !oleData.empty() )
|
||||
if ((!strAdditionalImage.empty() || !oleData.empty() ) && (nAdditionalType == 1))
|
||||
{
|
||||
std::wstring strExtsOle = L".bin";
|
||||
std::wstring strAdditionalExt = L".bin";
|
||||
|
||||
int pos = (int)strOleImage.rfind(L".");
|
||||
if (pos >= 0) strExtsOle = strOleImage.substr(pos);
|
||||
int pos = (int)strAdditionalImage.rfind(L".");
|
||||
if (pos >= 0) strAdditionalExt = strAdditionalImage.substr(pos);
|
||||
|
||||
std::wstring strImageOle = L"oleObject" + std::to_wstring(++m_lIndexNextOle) + strExtsOle;
|
||||
std::wstring strImageAdditional = L"oleObject" + std::to_wstring(++m_lIndexCounter) + strAdditionalExt;
|
||||
|
||||
OOX::CPath pathOutputOle = m_strDstEmbed + FILE_SEPARATOR_STR + strImageOle;
|
||||
OOX::CPath pathOutput = m_strDstEmbed + FILE_SEPARATOR_STR + strImageAdditional;
|
||||
|
||||
std::wstring strOleImageOut = pathOutputOle.GetPath();
|
||||
std::wstring strAdditionalImageOut = pathOutput.GetPath();
|
||||
|
||||
if(!oleData.empty())
|
||||
{
|
||||
WriteOleData(strOleImageOut, oleData);
|
||||
WriteOleData(strAdditionalImageOut, oleData);
|
||||
oImageManagerInfo.sFilepathAdditional = strAdditionalImageOut;
|
||||
}
|
||||
else
|
||||
else if (NSFile::CFileBinary::Exists(strAdditionalImage))
|
||||
{
|
||||
CDirectory::CopyFile(strOleImage, strOleImageOut);
|
||||
NSFile::CFileBinary::Copy(strAdditionalImage, strAdditionalImageOut);
|
||||
oImageManagerInfo.sFilepathAdditional = strAdditionalImageOut;
|
||||
}
|
||||
|
||||
oImageManagerInfo.sFilepathOle = strOleImageOut;
|
||||
}
|
||||
else if (!strAdditionalImage.empty() && nAdditionalType == 2)
|
||||
{
|
||||
std::wstring strAdditionalExt;
|
||||
|
||||
int pos = (int)strAdditionalImage.rfind(L".");
|
||||
if (pos >= 0) strAdditionalExt = strAdditionalImage.substr(pos);
|
||||
|
||||
std::wstring strImageAdditional = L"media" + std::to_wstring(++m_lIndexCounter) + strAdditionalExt;
|
||||
|
||||
OOX::CPath pathOutput = m_strDstMedia + FILE_SEPARATOR_STR + strImageAdditional;
|
||||
|
||||
std::wstring strAdditionalImageOut = pathOutput.GetPath();
|
||||
|
||||
if (NSFile::CFileBinary::Exists(strAdditionalImage))
|
||||
{
|
||||
NSFile::CFileBinary::Copy(strAdditionalImage, strAdditionalImageOut);
|
||||
oImageManagerInfo.sFilepathAdditional = strAdditionalImageOut;
|
||||
}
|
||||
}
|
||||
|
||||
return oImageManagerInfo;
|
||||
@ -372,7 +454,6 @@ namespace NSBinPptxRW
|
||||
strExts = strUrl.substr(nIndexExt);
|
||||
|
||||
std::wstring strImage;
|
||||
std::wstring strOleImage;
|
||||
|
||||
int nDisplayType = IsDisplayedImage(strUrl);
|
||||
|
||||
@ -380,11 +461,6 @@ namespace NSBinPptxRW
|
||||
{
|
||||
std::wstring strInputMetafile = strUrl.substr(0, strUrl.length() - strExts.length());
|
||||
std::wstring sDownloadRes;
|
||||
//todo
|
||||
if(0 != (nDisplayType & 4))
|
||||
{
|
||||
strOleImage = DownloadImageExec(strInputMetafile + _T(".bin"));
|
||||
}
|
||||
|
||||
if(0 != (nDisplayType & 1))
|
||||
{
|
||||
@ -414,11 +490,9 @@ namespace NSBinPptxRW
|
||||
_imageManager2Info oImageManagerInfo;
|
||||
if (!strImage.empty())
|
||||
{
|
||||
oImageManagerInfo = GenerateImageExec(strImage, strExts, strOleImage, L"");
|
||||
oImageManagerInfo = GenerateImageExec(strImage, strExts, L"", 0, L"");
|
||||
CDirectory::DeleteFile(strImage);
|
||||
}
|
||||
if (!strOleImage.empty())
|
||||
CDirectory::DeleteFile(strOleImage);
|
||||
|
||||
m_mapImages[strUrl] = oImageManagerInfo;
|
||||
return oImageManagerInfo;
|
||||
@ -1041,6 +1115,16 @@ namespace NSBinPptxRW
|
||||
m_pWriter->WriteString(str);
|
||||
}
|
||||
|
||||
std::wstring s = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"../theme/theme" +
|
||||
std::to_wstring(nIndexTheme + 1) + L".xml\"/>";
|
||||
m_pWriter->WriteString(s);
|
||||
}
|
||||
void CRelsGenerator::StartNotesMaster(int nIndexTheme)
|
||||
{
|
||||
m_pWriter->WriteString(_T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"));
|
||||
m_pWriter->WriteString(_T("<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">"));
|
||||
|
||||
std::wstring s = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"../theme/theme" +
|
||||
std::to_wstring(nIndexTheme + 1) + L".xml\"/>";
|
||||
@ -1056,7 +1140,7 @@ namespace NSBinPptxRW
|
||||
std::to_wstring(nIndexTheme + 1) + L".xml\"/>";
|
||||
m_pWriter->WriteString(str);
|
||||
}
|
||||
void CRelsGenerator::StartSlide(int nIndexSlide, int nIndexLayout)
|
||||
void CRelsGenerator::StartSlide(int nIndexSlide, int nIndexLayout, int nIndexNotes)
|
||||
{
|
||||
m_pWriter->WriteString(_T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"));
|
||||
m_pWriter->WriteString(_T("<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">"));
|
||||
@ -1066,12 +1150,15 @@ namespace NSBinPptxRW
|
||||
std::to_wstring(nIndexLayout + 1) + L".xml\"/>";
|
||||
m_pWriter->WriteString(str);
|
||||
|
||||
str = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide\" Target=\"../notesSlides/notesSlide" +
|
||||
std::to_wstring(nIndexSlide + 1) + L".xml\"/>";
|
||||
m_pWriter->WriteString(str);
|
||||
if (nIndexNotes >= 0)
|
||||
{
|
||||
str = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide\" Target=\"../notesSlides/notesSlide" +
|
||||
std::to_wstring(nIndexNotes + 1) + L".xml\"/>";
|
||||
m_pWriter->WriteString(str);
|
||||
}
|
||||
}
|
||||
void CRelsGenerator::StartNote(int nIndexSlide)
|
||||
void CRelsGenerator::StartNotes(int nIndexSlide)
|
||||
{
|
||||
m_pWriter->WriteString(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>");
|
||||
m_pWriter->WriteString(L"<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">");
|
||||
@ -1122,10 +1209,14 @@ namespace NSBinPptxRW
|
||||
|
||||
m_pWriter->WriteString(strRels);
|
||||
}
|
||||
void CRelsGenerator::EndPresentationRels(const bool& bIsCommentsAuthors = false)
|
||||
void CRelsGenerator::EndPresentationRels(const bool& bIsCommentsAuthors = false, const bool& bIsNotesMaster)
|
||||
{
|
||||
std::wstring strRels0 = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster\" Target=\"notesMasters/notesMaster1.xml\"/>";
|
||||
if (bIsNotesMaster)
|
||||
{
|
||||
std::wstring strRels0 = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster\" Target=\"notesMasters/notesMaster1.xml\"/>";
|
||||
m_pWriter->WriteString(strRels0);
|
||||
}
|
||||
std::wstring strRels1 = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps\" Target=\"presProps.xml\" />";
|
||||
std::wstring strRels2 = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
|
||||
@ -1133,7 +1224,6 @@ namespace NSBinPptxRW
|
||||
std::wstring strRels3 = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps\" Target=\"viewProps.xml\" />";
|
||||
|
||||
m_pWriter->WriteString(strRels0);
|
||||
m_pWriter->WriteString(strRels1);
|
||||
m_pWriter->WriteString(strRels2);
|
||||
m_pWriter->WriteString(strRels3);
|
||||
@ -1166,36 +1256,42 @@ namespace NSBinPptxRW
|
||||
oFile.CloseFile();
|
||||
}
|
||||
|
||||
_relsGeneratorInfo CRelsGenerator::WriteImage(const std::wstring& strImage, smart_ptr<OOX::OleObject> & oleFile, const std::wstring& oleData, std::wstring strBase64Image = _T(""))
|
||||
_relsGeneratorInfo CRelsGenerator::WriteImage(const std::wstring& strImage, smart_ptr<OOX::File> & additionalFile, const std::wstring& oleData, std::wstring strBase64Image = _T(""))
|
||||
{
|
||||
_imageManager2Info oImageManagerInfo = m_pManager->GenerateImage(strImage, oleFile, oleData, strBase64Image);
|
||||
_imageManager2Info oImageManagerInfo = m_pManager->GenerateImage(strImage, additionalFile, oleData, strBase64Image);
|
||||
|
||||
std::wstring strImageRelsPath;
|
||||
|
||||
if (m_pManager->m_nDocumentType == XMLWRITER_DOC_TYPE_DOCX) strImageRelsPath = L"media/";
|
||||
else strImageRelsPath = L"../media/";
|
||||
|
||||
strImageRelsPath += OOX::CPath(oImageManagerInfo.sFilepathImage).GetFilename();
|
||||
|
||||
std::map<std::wstring, _relsGeneratorInfo>::iterator pPair = m_mapImages.find(strImageRelsPath);
|
||||
|
||||
if (m_mapImages.end() != pPair)
|
||||
{
|
||||
return pPair->second;
|
||||
}
|
||||
_relsGeneratorInfo oRelsGeneratorInfo;
|
||||
|
||||
oRelsGeneratorInfo.nImageRId = m_lNextRelsID++;
|
||||
oRelsGeneratorInfo.sFilepathImage = oImageManagerInfo.sFilepathImage;
|
||||
|
||||
std::wstring strRid = L"rId" + std::to_wstring(oRelsGeneratorInfo.nImageRId);
|
||||
|
||||
m_pWriter->WriteString( L"<Relationship Id=\"" + strRid +
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\" Target=\"" + strImageRelsPath +
|
||||
L"\"/>");
|
||||
|
||||
if( oleFile.IsInit() )
|
||||
if (!oImageManagerInfo.sFilepathImage.empty())
|
||||
{
|
||||
strImageRelsPath += OOX::CPath(oImageManagerInfo.sFilepathImage).GetFilename();
|
||||
|
||||
std::map<std::wstring, _relsGeneratorInfo>::iterator pPair = m_mapImages.find(strImageRelsPath);
|
||||
|
||||
if (m_mapImages.end() != pPair)
|
||||
{
|
||||
return pPair->second;
|
||||
}
|
||||
|
||||
oRelsGeneratorInfo.nImageRId = m_lNextRelsID++;
|
||||
oRelsGeneratorInfo.sFilepathImage = oImageManagerInfo.sFilepathImage;
|
||||
|
||||
std::wstring strRid = L"rId" + std::to_wstring(oRelsGeneratorInfo.nImageRId);
|
||||
|
||||
m_pWriter->WriteString( L"<Relationship Id=\"" + strRid +
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\" Target=\"" + strImageRelsPath +
|
||||
L"\"/>");
|
||||
}
|
||||
|
||||
if(additionalFile.is<OOX::OleObject>())
|
||||
{
|
||||
smart_ptr<OOX::OleObject> oleFile = additionalFile.smart_dynamic_cast<OOX::OleObject>();
|
||||
|
||||
std::wstring strOleRelsPath;
|
||||
|
||||
oRelsGeneratorInfo.nOleRId = m_lNextRelsID++;
|
||||
@ -1222,7 +1318,29 @@ namespace NSBinPptxRW
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(additionalFile.is<OOX::Media>())
|
||||
{
|
||||
smart_ptr<OOX::Media> mediaFile = additionalFile.smart_dynamic_cast<OOX::Media>();
|
||||
|
||||
std::wstring strMediaRelsPath;
|
||||
|
||||
oRelsGeneratorInfo.nMediaRId = m_lNextRelsID++;
|
||||
oRelsGeneratorInfo.sFilepathOle = mediaFile->filename().GetPath();
|
||||
|
||||
if (m_pManager->m_nDocumentType != XMLWRITER_DOC_TYPE_XLSX)
|
||||
{
|
||||
std::wstring strRid = L"rId" + std::to_wstring(oRelsGeneratorInfo.nMediaRId);
|
||||
|
||||
if (m_pManager->m_nDocumentType == XMLWRITER_DOC_TYPE_DOCX) strMediaRelsPath = L"media/";
|
||||
else strMediaRelsPath = L"../media/";
|
||||
|
||||
strMediaRelsPath += mediaFile->filename().GetFilename();
|
||||
|
||||
m_pWriter->WriteString( L"<Relationship Id=\"" + strRid
|
||||
+ L"\" Type=\"http://schemas.microsoft.com/office/2007/relationships/media\" Target=\"" +
|
||||
strMediaRelsPath + L"\"/>");
|
||||
}
|
||||
}
|
||||
m_mapImages.insert(std::pair<std::wstring, _relsGeneratorInfo>(strImageRelsPath, oRelsGeneratorInfo));
|
||||
return oRelsGeneratorInfo;
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ class COfficeFontPicker;
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
class OleObject;
|
||||
class File;
|
||||
class CContentTypes;
|
||||
class WritingElement;
|
||||
class IFileContainer;
|
||||
@ -91,7 +91,7 @@ namespace NSBinPptxRW
|
||||
|
||||
struct _imageManager2Info
|
||||
{
|
||||
std::wstring sFilepathOle;
|
||||
std::wstring sFilepathAdditional;
|
||||
std::wstring sFilepathImage;
|
||||
};
|
||||
|
||||
@ -99,7 +99,9 @@ namespace NSBinPptxRW
|
||||
{
|
||||
int nImageRId;
|
||||
int nOleRId;
|
||||
int nMediaRId;
|
||||
|
||||
std::wstring sFilepathMedia;
|
||||
std::wstring sFilepathOle;
|
||||
std::wstring sFilepathImage;
|
||||
|
||||
@ -107,6 +109,7 @@ namespace NSBinPptxRW
|
||||
{
|
||||
nImageRId = -1;
|
||||
nOleRId = -1;
|
||||
nMediaRId = -1;
|
||||
}
|
||||
};
|
||||
|
||||
@ -158,17 +161,13 @@ namespace NSBinPptxRW
|
||||
|
||||
NSShapeImageGen::CImageManager* m_pImageManager;
|
||||
|
||||
//NSFontCutter::CFontDstManager m_oFontPicker;
|
||||
|
||||
NSFontCutter::CFontDstManager* m_pNativePicker;
|
||||
COfficeFontPicker* m_pFontPicker;
|
||||
bool m_bDeleteFontPicker;
|
||||
|
||||
public:
|
||||
CCommonWriter();
|
||||
~CCommonWriter();
|
||||
|
||||
public:
|
||||
void CreateFontPicker(COfficeFontPicker* pPicker);
|
||||
void CheckFontPicker();
|
||||
};
|
||||
@ -178,7 +177,7 @@ namespace NSBinPptxRW
|
||||
private:
|
||||
std::map<std::wstring, _imageManager2Info> m_mapImages;
|
||||
_INT32 m_lIndexNextImage;
|
||||
_INT32 m_lIndexNextOle;
|
||||
_INT32 m_lIndexCounter;
|
||||
std::wstring m_strDstMedia;
|
||||
std::wstring m_strDstEmbed;
|
||||
public:
|
||||
@ -197,8 +196,8 @@ namespace NSBinPptxRW
|
||||
|
||||
int IsDisplayedImage(const std::wstring& strInput);
|
||||
|
||||
_imageManager2Info GenerateImage(const std::wstring& strInput, NSCommon::smart_ptr<OOX::OleObject> & oleFile, const std::wstring& oleData, std::wstring strBase64Image);
|
||||
_imageManager2Info GenerateImageExec(const std::wstring& strInput, const std::wstring& strExts, const std::wstring& strOleImage, const std::wstring& oleData);
|
||||
_imageManager2Info GenerateImage(const std::wstring& strInput, NSCommon::smart_ptr<OOX::File> & additionalFile, const std::wstring& oleData, std::wstring strBase64Image);
|
||||
_imageManager2Info GenerateImageExec(const std::wstring& strInput, const std::wstring& strExts, const std::wstring& strAdditionalImage, int nAdditionalType, const std::wstring& oleData);
|
||||
|
||||
void SaveImageAsPng(const std::wstring& strFileSrc, const std::wstring& strFileDst);
|
||||
void SaveImageAsJPG(const std::wstring& strFileSrc, const std::wstring& strFileDst);
|
||||
@ -408,8 +407,9 @@ namespace NSBinPptxRW
|
||||
|
||||
void StartMaster (int nIndexTheme, const _slideMasterInfo& oInfo);
|
||||
void StartLayout (int nIndexTheme);
|
||||
void StartSlide (int nIndexSlide, int nIndexLayout);
|
||||
void StartNote (int nIndexSlide);
|
||||
void StartSlide (int nIndexSlide, int nIndexLayout, int nIndexNotes);
|
||||
void StartNotes (int nIndexSlide);
|
||||
void StartNotesMaster(int nIndexTheme);
|
||||
|
||||
void WriteMasters (int nCount);
|
||||
void WriteThemes (int nCount);
|
||||
@ -419,14 +419,14 @@ namespace NSBinPptxRW
|
||||
int WriteRels (const std::wstring& bsType, const std::wstring& bsTarget, const std::wstring& bsTargetMode);
|
||||
int WriteHyperlink (const std::wstring& strLink, const bool& bIsActionInit);
|
||||
|
||||
void EndPresentationRels (const bool& bIsCommentsAuthors);
|
||||
void EndPresentationRels (const bool& bIsCommentsAuthors, const bool& bIsNotesMaster = false);
|
||||
int GetNextId ();
|
||||
void CloseRels ();
|
||||
|
||||
void AddRels (const std::wstring& strRels);
|
||||
void SaveRels (const std::wstring& strFile);
|
||||
|
||||
_relsGeneratorInfo WriteImage (const std::wstring& strImage, NSCommon::smart_ptr<OOX::OleObject>& strOle, const std::wstring& oleData, std::wstring strBase64Image);
|
||||
_relsGeneratorInfo WriteImage (const std::wstring& strImage, NSCommon::smart_ptr<OOX::File>& additionalFile, const std::wstring& oleData, std::wstring strBase64Image);
|
||||
};
|
||||
|
||||
class CBinaryFileReader
|
||||
|
||||
@ -162,8 +162,7 @@ namespace PPTX2EditorAdvanced
|
||||
}
|
||||
|
||||
// записываем все слайды
|
||||
size_t nCount = presentation->sldIdLst.size();
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
for (size_t i = 0; i < presentation->sldIdLst.size(); ++i)
|
||||
{
|
||||
std::wstring rId = presentation->sldIdLst[i].rid.get();
|
||||
smart_ptr<PPTX::Slide> slide = ((*presentation)[rId]).smart_dynamic_cast<PPTX::Slide>();
|
||||
|
||||
@ -109,15 +109,14 @@ namespace NSPresentationEditor
|
||||
class CExMedia
|
||||
{
|
||||
public:
|
||||
std::wstring m_strPresentationDirectory;
|
||||
std::wstring m_strSourceDirectory;
|
||||
std::wstring m_strPresentationDirectory;
|
||||
|
||||
std::vector<CExFilesInfo> m_arVideos;
|
||||
std::vector<CExFilesInfo> m_arImages;
|
||||
std::vector<CExFilesInfo> m_arAudios;
|
||||
std::vector<CExFilesInfo> m_arHyperlinks;
|
||||
std::vector<CExFilesInfo> m_arVideos;
|
||||
std::vector<CExFilesInfo> m_arImages;
|
||||
std::vector<CExFilesInfo> m_arAudios;
|
||||
std::vector<CExFilesInfo> m_arHyperlinks;
|
||||
|
||||
std::vector<CExFilesInfo> m_arAudioCollection;
|
||||
std::vector<CExFilesInfo> m_arAudioCollection;
|
||||
|
||||
public:
|
||||
void Clear()
|
||||
@ -131,8 +130,6 @@ namespace NSPresentationEditor
|
||||
public:
|
||||
CExMedia() : m_arVideos(), m_arImages(), m_arAudios()
|
||||
{
|
||||
m_strPresentationDirectory = _T("");
|
||||
m_strSourceDirectory = _T("");
|
||||
}
|
||||
|
||||
CExMedia(const CExMedia& oSrc)
|
||||
@ -143,7 +140,6 @@ namespace NSPresentationEditor
|
||||
CExMedia& operator=(const CExMedia& oSrc)
|
||||
{
|
||||
m_strPresentationDirectory = oSrc.m_strPresentationDirectory;
|
||||
m_strSourceDirectory = oSrc.m_strSourceDirectory;
|
||||
|
||||
for (size_t i=0; i < oSrc.m_arVideos.size(); i++)
|
||||
m_arVideos.push_back(oSrc.m_arVideos[i]);
|
||||
|
||||
@ -165,23 +165,6 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// std::wstring ToString()
|
||||
// {
|
||||
// std::wstring str = _T("");
|
||||
// str.Format(_T("%d,%d,%d,%d"), (long)m_ePID, (long)m_bIsBlip, (long)m_bComplex, (long)m_lValue);
|
||||
// // не будем ничего писать - а то xml - не распознаются
|
||||
// /*if (m_bComplex)
|
||||
// {
|
||||
// std::wstring strProp = CDirectory::BYTEArrayToString(m_pOptions, m_lValue);
|
||||
// if (NSOfficeDrawing::pibName == m_ePID)
|
||||
// {
|
||||
// strProp = (std::wstring)CDirectory::BYTEArrayToStringW(m_pOptions, m_lValue);
|
||||
// }
|
||||
// str += _T(" options=") + strProp;
|
||||
// }*/
|
||||
// return _T("<Property command='") + str + _T("'/>");
|
||||
// }
|
||||
};
|
||||
|
||||
// А вот контейнер пропертей
|
||||
|
||||
@ -58,10 +58,12 @@ namespace NSBinPptxRW
|
||||
|
||||
std::vector<PPTX::Slide> m_arSlides;
|
||||
std::vector<LONG> m_arSlides_Layout;
|
||||
std::vector<LONG> m_arSlides_Notes;
|
||||
|
||||
std::vector<PPTX::NotesMaster> m_arNotesMasters;
|
||||
std::vector<PPTX::NotesSlide> m_arNotesSlides;
|
||||
std::vector<LONG> m_arNotesSlides_Master;
|
||||
std::vector<LONG> m_arNotesMasters_Theme;
|
||||
|
||||
PPTX::Presentation m_oPresentation;
|
||||
PPTX::TableStyles m_oTableStyles;
|
||||
@ -175,14 +177,14 @@ namespace NSBinPptxRW
|
||||
|
||||
std::map<BYTE, LONG>::iterator pPair;
|
||||
|
||||
// writer
|
||||
CXmlWriter oXmlWriter;
|
||||
|
||||
// первым делом определим количество необходимого. если хоть одно из этих чисел - ноль, то ппту не корректный
|
||||
LONG nCountThemes = 0;
|
||||
LONG nCountMasters = 0;
|
||||
LONG nCountLayouts = 0;
|
||||
LONG nCountSlides = 0;
|
||||
// первым делом определим количество необходимого. если хоть одно из этих чисел - ноль, то ппту не корректный
|
||||
LONG nCountThemes = 0;
|
||||
LONG nCountMasters = 0;
|
||||
LONG nCountLayouts = 0;
|
||||
LONG nCountSlides = 0;
|
||||
bool bNotesMasterPresent = false;
|
||||
|
||||
pPair = m_mainTables.find(NSMainTables::Themes);
|
||||
if (m_mainTables.end() != pPair)
|
||||
@ -214,7 +216,7 @@ namespace NSBinPptxRW
|
||||
return;
|
||||
}
|
||||
|
||||
// теперь создадим массивы для рельсов
|
||||
// теперь создадим массивы для рельсов
|
||||
for (LONG i = 0; i < nCountMasters; ++i)
|
||||
{
|
||||
_slideMasterInfo elm;
|
||||
@ -226,8 +228,11 @@ namespace NSBinPptxRW
|
||||
}
|
||||
for (LONG i = 0; i < nCountSlides; ++i)
|
||||
m_arSlides_Layout.push_back(0);
|
||||
|
||||
for (LONG i = 0; i < nCountSlides; ++i)
|
||||
m_arSlides_Notes.push_back(-1);
|
||||
|
||||
// ThemeRels
|
||||
// ThemeRels
|
||||
pPair = m_mainTables.find(NSMainTables::ThemeRels);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
@ -242,7 +247,7 @@ namespace NSBinPptxRW
|
||||
}
|
||||
}
|
||||
|
||||
// нужно проставить всем шаблонам мастер.
|
||||
// нужно проставить всем шаблонам мастер.
|
||||
for (LONG i = 0; i < nCountMasters; ++i)
|
||||
{
|
||||
size_t _countL = m_arSlideMasters_Theme[i].m_arLayouts.size();
|
||||
@ -252,7 +257,7 @@ namespace NSBinPptxRW
|
||||
}
|
||||
}
|
||||
|
||||
// готово, теперь нужно слайдам проставить шаблоны
|
||||
// готово, теперь нужно слайдам проставить шаблоны
|
||||
pPair = m_mainTables.find(NSMainTables::SlideRels);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
@ -271,11 +276,46 @@ namespace NSBinPptxRW
|
||||
m_arSlides_Layout[index++] = m_oReader.GetULong();
|
||||
}
|
||||
}
|
||||
pPair = m_mainTables.find(NSMainTables::SlideNotesRels);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
m_oReader.Seek(pPair->second);
|
||||
m_oReader.Skip(6); // type + len + start attr
|
||||
|
||||
// теперь нужно удалить все themes, которые не ведут на мастерслайд
|
||||
size_t index =0;
|
||||
while (true)
|
||||
{
|
||||
BYTE _at = m_oReader.GetUChar_TypeNode();
|
||||
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
|
||||
break;
|
||||
|
||||
//m_arSlides_Layout[_at] = m_oReader.GetULong(); тут прописан не индекс, а тип - смотри - oBinaryWriter.WriteInt1(0, oBinaryWriter.m_pCommon->m_oSlide_Layout_Rels[i]);
|
||||
if (index < m_arSlides_Notes.size())
|
||||
m_arSlides_Notes[index++] = m_oReader.GetULong();
|
||||
}
|
||||
}
|
||||
|
||||
pPair = m_mainTables.find(NSMainTables::NotesMastersRels);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
m_oReader.Seek(pPair->second);
|
||||
m_oReader.Skip(6); // type + len + start attr
|
||||
|
||||
size_t index =0;
|
||||
while (true)
|
||||
{
|
||||
BYTE _at = m_oReader.GetUChar_TypeNode();
|
||||
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
|
||||
break;
|
||||
|
||||
m_arNotesMasters_Theme.push_back( m_oReader.GetULong());
|
||||
}
|
||||
}
|
||||
// теперь нужно удалить все themes, которые не ведут на мастерслайды
|
||||
std::vector<LONG> arThemes;
|
||||
std::vector<LONG> arThemesDst;
|
||||
std::vector<bool> arThemesSave;
|
||||
|
||||
for (LONG i = 0; i < nCountThemes; ++i)
|
||||
{
|
||||
arThemes.push_back(i);
|
||||
@ -286,6 +326,11 @@ namespace NSBinPptxRW
|
||||
{
|
||||
arThemesSave[m_arSlideMasters_Theme[i].m_lThemeIndex] = true;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < m_arNotesMasters_Theme.size(); i++)
|
||||
{
|
||||
arThemesSave[m_arNotesMasters_Theme[i]] = true;
|
||||
}
|
||||
LONG lCurrectTheme = 0;
|
||||
for (LONG i = 0; i < nCountMasters; ++i)
|
||||
{
|
||||
@ -298,9 +343,8 @@ namespace NSBinPptxRW
|
||||
for (LONG i = 0; i < nCountMasters; ++i)
|
||||
{
|
||||
m_arSlideMasters_Theme[i].m_lThemeIndex = arThemesDst[i];
|
||||
}
|
||||
|
||||
// themes
|
||||
}
|
||||
// themes
|
||||
pPair = m_mainTables.find(NSMainTables::Themes);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
@ -343,7 +387,7 @@ namespace NSBinPptxRW
|
||||
}
|
||||
}
|
||||
|
||||
// slideMasters
|
||||
// slideMasters
|
||||
pPair = m_mainTables.find(NSMainTables::SlideMasters);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
@ -396,7 +440,7 @@ namespace NSBinPptxRW
|
||||
}
|
||||
}
|
||||
|
||||
// slideLayouts
|
||||
// slideLayouts
|
||||
pPair = m_mainTables.find(NSMainTables::SlideLayouts);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
@ -431,8 +475,100 @@ namespace NSBinPptxRW
|
||||
m_oReader.m_pRels->SaveRels(pathFileRels.GetPath());
|
||||
}
|
||||
}
|
||||
// notes
|
||||
pPair = m_mainTables.find(NSMainTables::NotesSlides);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
m_oReader.Seek(pPair->second);
|
||||
LONG lCount = m_oReader.GetLong();
|
||||
|
||||
// slides
|
||||
if ( lCount > 0 )
|
||||
{
|
||||
OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("notesSlides");
|
||||
OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + _T("_rels");
|
||||
|
||||
NSDirectory::CreateDirectory (pathFolder.GetPath());
|
||||
NSDirectory::CreateDirectory (pathFolderRels.GetPath());
|
||||
|
||||
for (LONG i = 0; i < lCount; ++i)
|
||||
{
|
||||
PPTX::NotesSlide elm;
|
||||
m_arNotesSlides.push_back(elm);
|
||||
|
||||
m_oReader.m_pRels->Clear();
|
||||
|
||||
size_t indexSlide = 0;
|
||||
for (indexSlide = 0; indexSlide < m_arSlides_Notes.size(); indexSlide++)
|
||||
{//todooo -> make map
|
||||
if (m_arSlides_Notes[indexSlide] == i)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
m_oReader.m_pRels->StartNotes(indexSlide);
|
||||
|
||||
m_arNotesSlides[i].fromPPTY(&m_oReader);
|
||||
|
||||
m_oReader.m_pRels->CloseRels();
|
||||
|
||||
std::wstring strNotesXml = L"notesSlide" + std::to_wstring(i + 1) + L".xml";
|
||||
oXmlWriter.ClearNoAttack();
|
||||
|
||||
m_arNotesSlides[i].toXmlWriter(&oXmlWriter);
|
||||
|
||||
OOX::CPath pathFile = pathFolder + FILE_SEPARATOR_STR + strNotesXml;
|
||||
oXmlWriter.SaveToFile(pathFile.GetPath());
|
||||
|
||||
OOX::CPath pathFileRels = pathFolderRels + FILE_SEPARATOR_STR + strNotesXml + _T(".rels");
|
||||
m_oReader.m_pRels->SaveRels(pathFileRels.GetPath());
|
||||
}
|
||||
}
|
||||
}
|
||||
// noteMasters
|
||||
pPair = m_mainTables.find(NSMainTables::NotesMasters);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
m_oReader.Seek(pPair->second);
|
||||
LONG lCount = m_oReader.GetLong();
|
||||
|
||||
if (lCount > 0 || m_arNotesSlides.size() > 0)//один элемент
|
||||
{
|
||||
OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("notesMasters");
|
||||
OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + _T("_rels");
|
||||
|
||||
NSDirectory::CreateDirectory(pathFolder.GetPath());
|
||||
NSDirectory::CreateDirectory(pathFolderRels.GetPath());
|
||||
|
||||
PPTX::NotesMaster elm;
|
||||
m_arNotesMasters.push_back(elm);
|
||||
|
||||
m_oReader.m_pRels->Clear();
|
||||
m_oReader.m_pRels->StartNotesMaster(m_arSlideMasters_Theme.size());
|
||||
|
||||
bNotesMasterPresent = true;
|
||||
if (lCount > 0)
|
||||
{
|
||||
m_arNotesMasters.back().fromPPTY(&m_oReader);
|
||||
m_oReader.m_pRels->CloseRels();
|
||||
|
||||
std::wstring strMasterNotesXml = L"notesMaster1.xml";
|
||||
oXmlWriter.ClearNoAttack();
|
||||
|
||||
m_arNotesMasters.back().toXmlWriter(&oXmlWriter);
|
||||
|
||||
OOX::CPath pathFile = pathFolder + FILE_SEPARATOR_STR + strMasterNotesXml;
|
||||
oXmlWriter.SaveToFile(pathFile.GetPath());
|
||||
|
||||
OOX::CPath pathFileRels = pathFolderRels + FILE_SEPARATOR_STR + strMasterNotesXml + _T(".rels");
|
||||
m_oReader.m_pRels->SaveRels(pathFileRels.GetPath());
|
||||
}
|
||||
else
|
||||
{
|
||||
CreateDefaultNotesMasters(m_arSlideMasters_Theme.size());
|
||||
}
|
||||
}
|
||||
}
|
||||
// slides
|
||||
int nComment = 1;
|
||||
pPair = m_mainTables.find(NSMainTables::Slides);
|
||||
if (m_mainTables.end() != pPair)
|
||||
@ -452,7 +588,7 @@ namespace NSBinPptxRW
|
||||
m_arSlides.push_back(elm);
|
||||
|
||||
m_oReader.m_pRels->Clear();
|
||||
m_oReader.m_pRels->StartSlide(i, m_arSlides_Layout[i]);
|
||||
m_oReader.m_pRels->StartSlide(i, m_arSlides_Layout[i], m_arSlides_Notes[i]);
|
||||
m_arSlides[i].fromPPTY(&m_oReader);
|
||||
|
||||
if (m_arSlides[i].comments.is_init())
|
||||
@ -488,71 +624,6 @@ namespace NSBinPptxRW
|
||||
m_oReader.m_pRels->SaveRels(pathFileRels.GetPath());
|
||||
}
|
||||
}
|
||||
|
||||
if (false)
|
||||
{
|
||||
// noteMasters
|
||||
pPair = m_mainTables.find(NSMainTables::NotesMasters);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
m_oReader.Seek(pPair->second);
|
||||
LONG lCount = m_oReader.GetLong();
|
||||
|
||||
for (LONG i = 0; i < lCount; ++i)
|
||||
{
|
||||
PPTX::NotesMaster elm;
|
||||
m_arNotesMasters.push_back(elm);
|
||||
m_arNotesMasters[i].fromPPTY(&m_oReader);
|
||||
}
|
||||
}
|
||||
|
||||
// notes
|
||||
pPair = m_mainTables.find(NSMainTables::NotesSlides);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
m_oReader.Seek(pPair->second);
|
||||
LONG lCount = m_oReader.GetLong();
|
||||
|
||||
for (LONG i = 0; i < lCount; ++i)
|
||||
{
|
||||
PPTX::NotesSlide elm;
|
||||
m_arNotesSlides.push_back(elm);
|
||||
m_arNotesSlides[i].fromPPTY(&m_oReader);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// create default
|
||||
CreateDefaultNotesMasters((int)m_arThemes.size() + 1);
|
||||
CreateDefaultNote();
|
||||
|
||||
OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("notesSlides");
|
||||
OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + _T("_rels");
|
||||
|
||||
NSDirectory::CreateDirectory (pathFolder.GetPath());
|
||||
NSDirectory::CreateDirectory (pathFolderRels.GetPath());
|
||||
|
||||
LONG lCount = (LONG)m_arSlides.size();
|
||||
for (LONG i = 0; i < lCount; ++i)
|
||||
{
|
||||
m_oReader.m_pRels->Clear();
|
||||
m_oReader.m_pRels->StartNote(i);
|
||||
m_oReader.m_pRels->CloseRels();
|
||||
|
||||
std::wstring strMasterXml = L"notesSlide" + std::to_wstring(i + 1) + L".xml";
|
||||
oXmlWriter.ClearNoAttack();
|
||||
|
||||
m_oDefaultNote.toXmlWriter(&oXmlWriter);
|
||||
|
||||
OOX::CPath pathFile = pathFolder + FILE_SEPARATOR_STR + strMasterXml;
|
||||
oXmlWriter.SaveToFile(pathFile.GetPath());
|
||||
|
||||
OOX::CPath pathFileRels = pathFolderRels + FILE_SEPARATOR_STR + strMasterXml + _T(".rels");
|
||||
m_oReader.m_pRels->SaveRels(pathFileRels.GetPath());
|
||||
}
|
||||
}
|
||||
|
||||
if (false)
|
||||
{
|
||||
// app
|
||||
@ -595,15 +666,13 @@ namespace NSBinPptxRW
|
||||
m_oViewProps.fromPPTY(&m_oReader);
|
||||
}
|
||||
|
||||
//CreateDefaultPresProps();
|
||||
}
|
||||
else
|
||||
{
|
||||
// create default
|
||||
CreateDefaultApp();
|
||||
CreateDefaultCore();
|
||||
//CreateDefaultPresProps();
|
||||
//CreateDefaultTableStyles();
|
||||
|
||||
CreateDefaultViewProps();
|
||||
|
||||
// presProps
|
||||
@ -715,13 +784,16 @@ namespace NSBinPptxRW
|
||||
}
|
||||
|
||||
m_oReader.m_pRels->WriteSlides(nCountSlides);
|
||||
m_oReader.m_pRels->EndPresentationRels(m_oPresentation.commentAuthors.is_init());
|
||||
|
||||
m_oPresentation.notesMasterIdLst.clear();
|
||||
m_oPresentation.notesMasterIdLst.push_back(PPTX::Logic::XmlId());
|
||||
m_oPresentation.notesMasterIdLst[0].m_name = _T("notesMasterId");
|
||||
m_oPresentation.notesMasterIdLst[0].rid = (size_t)nCurrentRels;
|
||||
|
||||
if (bNotesMasterPresent)
|
||||
{
|
||||
m_oPresentation.notesMasterIdLst.push_back(PPTX::Logic::XmlId());
|
||||
m_oPresentation.notesMasterIdLst[0].m_name = _T("notesMasterId");
|
||||
m_oPresentation.notesMasterIdLst[0].rid = (size_t)nCurrentRels;
|
||||
++nCurrentRels;
|
||||
}
|
||||
m_oReader.m_pRels->EndPresentationRels(m_oPresentation.commentAuthors.is_init(), bNotesMasterPresent);
|
||||
m_oReader.m_pRels->CloseRels();
|
||||
|
||||
oXmlWriter.ClearNoAttack();
|
||||
@ -760,15 +832,13 @@ namespace NSBinPptxRW
|
||||
pContentTypes->Registration(L"application/vnd.openxmlformats-officedocument.extended-properties+xml", L"/docProps", L"app.xml");
|
||||
|
||||
// themes
|
||||
for (LONG i = 0; i < (LONG)m_arThemes.size(); ++i)
|
||||
for (size_t i = 0; i < m_arThemes.size(); ++i)
|
||||
{
|
||||
pContentTypes->Registration(L"application/vnd.openxmlformats-officedocument.theme+xml", L"/ppt/theme", L"theme" + std::to_wstring(i + 1) + L".xml");
|
||||
}
|
||||
if (true)
|
||||
{
|
||||
// notes theme
|
||||
pContentTypes->Registration(L"application/vnd.openxmlformats-officedocument.theme+xml", L"/ppt/theme", L"theme" + std::to_wstring((int)m_arThemes.size() + 1) + L".xml");
|
||||
// notes master
|
||||
if (!m_arNotesMasters.empty())
|
||||
{
|
||||
pContentTypes->Registration(L"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml", L"/ppt/notesMasters", L"notesMaster1.xml");
|
||||
}
|
||||
|
||||
@ -785,13 +855,13 @@ namespace NSBinPptxRW
|
||||
}
|
||||
|
||||
// slides
|
||||
for (LONG i = 0; i < nCountSlides; ++i)
|
||||
for (size_t i = 0; i < m_arSlides.size(); ++i)
|
||||
{
|
||||
pContentTypes->Registration(L"application/vnd.openxmlformats-officedocument.presentationml.slide+xml", L"/ppt/slides", L"slide" + std::to_wstring(i + 1) + L".xml");
|
||||
}
|
||||
|
||||
// notes
|
||||
for (LONG i = 0; i < nCountSlides; ++i)
|
||||
for (size_t i = 0; i < m_arNotesSlides.size(); ++i)
|
||||
{
|
||||
pContentTypes->Registration(L"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml", L"/ppt/notesSlides", L"notesSlide" + std::to_wstring(i + 1) + L".xml");
|
||||
}
|
||||
|
||||
@ -104,16 +104,14 @@ namespace NSShapeImageGen
|
||||
|
||||
return *this;
|
||||
}
|
||||
void SetNameModificator(NSShapeImageGen::ImageType eType, bool bOle)
|
||||
void SetNameModificator(NSShapeImageGen::ImageType eType, int typeAdditionalFile )
|
||||
{
|
||||
std::wstring sPrefix;
|
||||
int nRes = 0;
|
||||
if(itWMF == eType)
|
||||
nRes += 1;
|
||||
if(itEMF == eType)
|
||||
nRes += 2;
|
||||
if(bOle)
|
||||
nRes += 4;
|
||||
if(itWMF == eType) nRes += 1;
|
||||
if(itEMF == eType) nRes += 2;
|
||||
if(typeAdditionalFile == 1) nRes += 4;
|
||||
if(typeAdditionalFile == 2) nRes += 8;
|
||||
|
||||
if(0 != nRes)
|
||||
m_sName = L"display" + std::to_wstring(nRes) + L"image";
|
||||
}
|
||||
@ -199,7 +197,7 @@ namespace NSShapeImageGen
|
||||
|
||||
return GenerateImageID(punkImage, (std::max)(1.0, width), (std::max)(1.0, height));
|
||||
}
|
||||
CImageInfo WriteImage(const std::wstring& strFile, const std::wstring& strOleFile, double& x, double& y, double& width, double& height)
|
||||
CImageInfo WriteImage(const std::wstring& strFile, double& x, double& y, double& width, double& height, const std::wstring& strAdditionalFile, int typeAdditionalFile)
|
||||
{
|
||||
bool bIsDownload = false;
|
||||
int n1 = (int)strFile.find (L"www");
|
||||
@ -215,16 +213,16 @@ namespace NSShapeImageGen
|
||||
if (bIsDownload)
|
||||
{
|
||||
|
||||
std::wstring strFile1 = strFile;
|
||||
std::wstring strFileUrl = strFile;
|
||||
|
||||
XmlUtils::replace_all(strFile1, L"\\", L"/");
|
||||
XmlUtils::replace_all(strFile1, L"http:/", L"http://");
|
||||
XmlUtils::replace_all(strFile1, L"https:/", L"https://");
|
||||
XmlUtils::replace_all(strFile1, L"ftp:/", L"ftp://");
|
||||
XmlUtils::replace_all(strFileUrl, L"\\", L"/");
|
||||
XmlUtils::replace_all(strFileUrl, L"http:/", L"http://");
|
||||
XmlUtils::replace_all(strFileUrl, L"https:/", L"https://");
|
||||
XmlUtils::replace_all(strFileUrl, L"ftp:/", L"ftp://");
|
||||
|
||||
|
||||
CImageInfo oInfo;
|
||||
std::map<std::wstring, CImageInfo>::iterator pPair = m_mapImagesFile.find(strFile1);
|
||||
std::map<std::wstring, CImageInfo>::iterator pPair = m_mapImagesFile.find(strFileUrl);
|
||||
|
||||
if (pPair != m_mapImagesFile.end())
|
||||
return pPair->second;
|
||||
@ -233,7 +231,7 @@ namespace NSShapeImageGen
|
||||
|
||||
#ifndef DISABLE_FILE_DOWNLOADER
|
||||
|
||||
CFileDownloader oDownloader(strFile1, true);
|
||||
CFileDownloader oDownloader(strFileUrl, true);
|
||||
if (oDownloader.DownloadSync())
|
||||
{
|
||||
strDownload = oDownloader.GetFilePath();
|
||||
@ -241,21 +239,23 @@ namespace NSShapeImageGen
|
||||
|
||||
#endif
|
||||
|
||||
return GenerateImageID(strDownload, strFile1, strOleFile, (std::max)(1.0, width), (std::max)(1.0, height));
|
||||
return GenerateImageID(strDownload, strFileUrl, (std::max)(1.0, width), (std::max)(1.0, height), strAdditionalFile, typeAdditionalFile);
|
||||
|
||||
|
||||
}
|
||||
|
||||
CImageInfo info;
|
||||
CFile oFile;
|
||||
if (S_OK != oFile.OpenFile(strFile))
|
||||
return info;
|
||||
if (strAdditionalFile.empty())
|
||||
{
|
||||
CImageInfo info;
|
||||
CFile oFile;
|
||||
if (S_OK != oFile.OpenFile(strFile))
|
||||
return info;
|
||||
oFile.CloseFile();
|
||||
}
|
||||
|
||||
oFile.CloseFile();
|
||||
|
||||
if (-1 == width && -1 == height)
|
||||
return GenerateImageID(strFile, L"", strOleFile, width, height);
|
||||
return GenerateImageID(strFile, L"", strOleFile, (std::max)(1.0, width), (std::max)(1.0, height));
|
||||
if (width < 0 && height < 0) return GenerateImageID(strFile, L"", -1, -1, strAdditionalFile, typeAdditionalFile);
|
||||
return GenerateImageID(strFile, L"", (std::max)(1.0, width), (std::max)(1.0, height), strAdditionalFile, typeAdditionalFile);
|
||||
}
|
||||
void SetFontManager(CFontManager* pFontManager)
|
||||
{
|
||||
@ -413,12 +413,12 @@ namespace NSShapeImageGen
|
||||
return oInfo;
|
||||
}
|
||||
|
||||
CImageInfo GenerateImageID(const std::wstring& strFileName, const std::wstring & strUrl, const std::wstring& strOleFile, double dWidth, double dHeight)
|
||||
CImageInfo GenerateImageID(const std::wstring& strFileName, const std::wstring & strUrl, double dWidth, double dHeight, const std::wstring& strAdditionalFile, int typeAdditionalFile)
|
||||
{
|
||||
std::wstring sMapKey = strFileName;
|
||||
|
||||
if(!strUrl.empty()) sMapKey = strUrl;
|
||||
if(!strOleFile.empty()) sMapKey += strOleFile;
|
||||
if(!strAdditionalFile.empty()) sMapKey += strAdditionalFile;
|
||||
|
||||
CImageInfo oInfo;
|
||||
std::map<std::wstring, CImageInfo>::iterator pPair = m_mapImagesFile.find(sMapKey);
|
||||
@ -434,26 +434,30 @@ namespace NSShapeImageGen
|
||||
LONG lImageType = m_oImageExt.GetImageType(strFileName);
|
||||
|
||||
bool bVector = (1 == lImageType || 2 == lImageType);
|
||||
bool bOle = !strOleFile.empty();
|
||||
|
||||
bool bOle = !strAdditionalFile.empty() && (typeAdditionalFile == 1);
|
||||
bool bMedia = !strAdditionalFile.empty() && (typeAdditionalFile == 2);
|
||||
|
||||
if(bVector)
|
||||
oInfo.m_eType = (1 == lImageType) ? itWMF : itEMF;
|
||||
|
||||
oInfo.SetNameModificator(oInfo.m_eType, bOle);
|
||||
oInfo.SetNameModificator(oInfo.m_eType, typeAdditionalFile);
|
||||
|
||||
std::wstring strSaveDir = m_strDstMedia + FILE_SEPARATOR_STR;
|
||||
std::wstring strSaveItemWE = strSaveDir + std::wstring(oInfo.GetPathWithoutExtension());
|
||||
|
||||
//copy ole bin
|
||||
if(bOle)
|
||||
//copy ole bin or media
|
||||
if(bOle || bMedia)
|
||||
{
|
||||
std::wstring strExts = _T(".bin");
|
||||
int nIndexExt = (int)strOleFile.rfind(wchar_t('.'));
|
||||
std::wstring strExts;
|
||||
int nIndexExt = (int)strAdditionalFile.rfind(wchar_t('.'));
|
||||
if (-1 != nIndexExt)
|
||||
strExts = strOleFile.substr(nIndexExt);
|
||||
strExts = strAdditionalFile.substr(nIndexExt);
|
||||
|
||||
std::wstring sCopyOlePath = strSaveItemWE + strExts;//L".bin";
|
||||
CDirectory::CopyFile(strOleFile, sCopyOlePath);
|
||||
if(bOle && strExts.empty()) strExts = L".bin";
|
||||
|
||||
std::wstring sCopyOlePath = strSaveItemWE + strExts;
|
||||
CDirectory::CopyFile(strAdditionalFile, sCopyOlePath);
|
||||
}
|
||||
|
||||
if (bVector)
|
||||
|
||||
@ -86,12 +86,12 @@ namespace PPTX
|
||||
|
||||
void FileContainer::read(const OOX::CPath& filename)
|
||||
{
|
||||
//not implement FileContainer.read
|
||||
//OOX::IFileContainer::read(filename);
|
||||
}
|
||||
|
||||
void FileContainer::read(const OOX::CRels& rels, const OOX::CPath& path)
|
||||
{
|
||||
//not implement FileContainer.read
|
||||
//OOX::IFileContainer::read(rels, path);
|
||||
}
|
||||
void FileContainer::read(const OOX::CRels& rels, const OOX::CPath& path, FileMap& map, IPPTXEvent* Event)
|
||||
{
|
||||
@ -157,8 +157,6 @@ namespace PPTX
|
||||
pContainer->read(normPath, map, Event);
|
||||
m_bCancelled = pContainer->m_bCancelled;
|
||||
}
|
||||
//todo детально разобраться и вернуть проверку res.(до перехода на cross platform все было хорошо)
|
||||
//на презентация с hyperlink выходим при достижении 100%. Проценты считаются от количества обработанных файлов, а hyperlink не файл(Ligninger_og_uligheder.pptx)
|
||||
if (m_bCancelled)
|
||||
{
|
||||
break;
|
||||
|
||||
@ -187,8 +187,25 @@ namespace PPTX
|
||||
break;
|
||||
}
|
||||
case BULLET_TYPE_BULLET_BLIP:
|
||||
// TODO:
|
||||
break;
|
||||
{
|
||||
pReader->Skip(5); // len + type + start attr
|
||||
|
||||
Logic::BuBlip *pBuBlip = new Logic::BuBlip();
|
||||
pBuBlip->blip.fromPPTY(pReader);
|
||||
|
||||
if (pBuBlip->blip.embed.IsInit())
|
||||
{
|
||||
m_Bullet.reset(pBuBlip);
|
||||
}
|
||||
else
|
||||
{//??? сбой ???
|
||||
delete pBuBlip;
|
||||
|
||||
Logic::BuChar *pBuChar = new Logic::BuChar();
|
||||
pBuChar->Char = wchar_t(L'\x2022');
|
||||
m_Bullet.reset(pBuChar);
|
||||
}
|
||||
}break;
|
||||
default:
|
||||
m_Bullet.reset(new Logic::BuNone());
|
||||
break;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -44,7 +44,11 @@ namespace PPTX
|
||||
{
|
||||
public:
|
||||
WritingElement_AdditionConstructors(ClrMap)
|
||||
PPTX_LOGIC_BASE2(ClrMap)
|
||||
|
||||
ClrMap(std::wstring name = L"p:clrMap")
|
||||
{
|
||||
m_name = name;
|
||||
}
|
||||
|
||||
virtual OOX::EElementType getType() const
|
||||
{
|
||||
|
||||
@ -165,12 +165,26 @@ namespace PPTX
|
||||
XmlUtils::CAttribute oAttr;
|
||||
XmlUtils::CNodeValue oValue;
|
||||
|
||||
return XmlUtils::CreateNode(_T("p:ext"), oValue);
|
||||
return XmlUtils::CreateNode(L"p:ext", oValue);
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
// TODO:
|
||||
if (link.IsInit() && uri.IsInit())
|
||||
{
|
||||
pWriter->StartNode(L"p:ext");
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(L"uri", *uri);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->StartNode(L"p14:media");
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(L"xmlns:p14", std::wstring(L"http://schemas.microsoft.com/office/powerpoint/2010/main"));
|
||||
pWriter->WriteAttribute(L"r:embed", link->get());
|
||||
pWriter->EndAttributes();
|
||||
pWriter->EndNode(L"p14:media");
|
||||
pWriter->EndNode(L"p:ext");
|
||||
}
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
|
||||
@ -156,5 +156,230 @@ namespace PPTX
|
||||
|
||||
return L"";
|
||||
}
|
||||
void Blip::toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
std::wstring strName = (_T("") == m_namespace) ? _T("blip") : (m_namespace + _T(":blip"));
|
||||
pWriter->StartNode(strName);
|
||||
|
||||
pWriter->StartAttributes();
|
||||
if (embed.IsInit())
|
||||
pWriter->WriteAttribute(_T("r:embed"), embed->ToString());
|
||||
if (link.IsInit())
|
||||
pWriter->WriteAttribute(_T("r:link"), link->ToString());
|
||||
pWriter->WriteAttribute(_T("cstate"), cstate);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
// TODO:
|
||||
size_t nCount = Effects.size();
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
{
|
||||
Effects[i].toXmlWriter(pWriter);
|
||||
}
|
||||
|
||||
pWriter->EndNode(strName);
|
||||
}
|
||||
|
||||
void Blip::toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteLimit2(0, cstate);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
if (embed.is_init())
|
||||
pWriter->WriteString1(10, embed->get());
|
||||
if (link.is_init())
|
||||
pWriter->WriteString1(11, link->get());
|
||||
|
||||
pWriter->StartRecord(2);
|
||||
ULONG len = (ULONG)Effects.size();
|
||||
pWriter->WriteULONG(len);
|
||||
|
||||
for (ULONG i = 0; i < len; ++i)
|
||||
{
|
||||
pWriter->WriteRecord1(3, Effects[i]);
|
||||
}
|
||||
|
||||
pWriter->EndRecord();
|
||||
|
||||
double dX = pWriter->GetShapeX(); //mm
|
||||
double dY = pWriter->GetShapeY();
|
||||
|
||||
double dW = pWriter->GetShapeWidth(); //mm
|
||||
double dH = pWriter->GetShapeHeight();
|
||||
|
||||
OOX::IFileContainer* pRels = NULL;
|
||||
|
||||
if (pWriter->m_pCurrentContainer->is_init())
|
||||
pRels = pWriter->m_pCurrentContainer->operator ->();
|
||||
|
||||
std::wstring additionalPath;
|
||||
int additionalType = 0;
|
||||
if(!oleFilepathBin.empty())
|
||||
{
|
||||
additionalPath = oleFilepathBin;
|
||||
additionalType = 1;
|
||||
}
|
||||
else if(!oleRid.empty())
|
||||
{
|
||||
additionalPath = this->GetFullOleName(OOX::RId(oleRid), pRels);
|
||||
additionalType = 1;
|
||||
}
|
||||
else if(!mediaRid.empty())
|
||||
{
|
||||
additionalPath = this->GetFullOleName(OOX::RId(mediaRid), pRels);
|
||||
additionalType = 2;
|
||||
}
|
||||
else if(!mediaFilepath.empty())
|
||||
{
|
||||
additionalPath = mediaFilepath;
|
||||
additionalType = 2;
|
||||
}
|
||||
|
||||
std::wstring imagePath;
|
||||
if(!oleFilepathImage.empty())
|
||||
{
|
||||
imagePath = oleFilepathImage;
|
||||
}
|
||||
else
|
||||
{
|
||||
imagePath = this->GetFullPicName(pRels);
|
||||
}
|
||||
|
||||
NSShapeImageGen::CImageInfo oId = pWriter->m_pCommon->m_pImageManager->WriteImage(imagePath, dX, dY, dW, dH, additionalPath, additionalType);
|
||||
std::wstring s = oId.GetPath2();
|
||||
|
||||
pWriter->StartRecord(3);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteString1(0, s);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
void Blip::fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG _s2 = pReader->GetPos();
|
||||
LONG _e2 = _s2 + pReader->GetLong() + 4;
|
||||
|
||||
pReader->Skip(1);
|
||||
|
||||
while (true)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar_TypeNode();
|
||||
if (NSBinPptxRW::g_nodeAttributeEnd == _at)
|
||||
break;
|
||||
|
||||
if (_at == 0)
|
||||
pReader->Skip(1);
|
||||
}
|
||||
|
||||
while (pReader->GetPos() < _e2)
|
||||
{
|
||||
BYTE _t = pReader->GetUChar();
|
||||
|
||||
switch (_t)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
{
|
||||
// id. embed / link
|
||||
pReader->Skip(4);
|
||||
break;
|
||||
}
|
||||
case 10:
|
||||
case 11:
|
||||
{
|
||||
// id. embed / link
|
||||
pReader->GetString2();
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
pReader->Skip(4);
|
||||
ULONG count_effects = pReader->GetULong();
|
||||
for (ULONG _eff = 0; _eff < count_effects; ++_eff)
|
||||
{
|
||||
pReader->Skip(1); // type
|
||||
ULONG rec_len = pReader->GetULong();
|
||||
if (0 == rec_len)
|
||||
continue;
|
||||
|
||||
BYTE rec = pReader->GetUChar();
|
||||
|
||||
if (rec == EFFECT_TYPE_ALPHAMODFIX)
|
||||
{
|
||||
// alpha!!!
|
||||
LONG _e22 = pReader->GetPos() + pReader->GetLong() + 4;
|
||||
|
||||
pReader->Skip(1); // startattr
|
||||
|
||||
PPTX::Logic::AlphaModFix* pEffect = new PPTX::Logic::AlphaModFix();
|
||||
while (true)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar_TypeNode();
|
||||
if (NSBinPptxRW::g_nodeAttributeEnd == _at)
|
||||
break;
|
||||
|
||||
if (_at == 0)
|
||||
pEffect->amt = pReader->GetLong();
|
||||
}
|
||||
|
||||
Effects.push_back(UniEffect());
|
||||
Effects[0].InitPointer(pEffect);
|
||||
|
||||
pReader->Seek(_e22);
|
||||
}
|
||||
else
|
||||
{
|
||||
pReader->SkipRecord();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
pReader->Skip(6); // len + start attributes + type
|
||||
|
||||
std::wstring strImagePath = pReader->GetString2();
|
||||
|
||||
if (0 != strImagePath.find(_T("http:")) &&
|
||||
0 != strImagePath.find(_T("https:")) &&
|
||||
0 != strImagePath.find(_T("ftp:")) &&
|
||||
0 != strImagePath.find(_T("file:")))
|
||||
{
|
||||
if (0 == strImagePath.find(_T("theme")))
|
||||
{
|
||||
strImagePath = pReader->m_strFolderExternalThemes + FILE_SEPARATOR_STR + strImagePath;
|
||||
}
|
||||
else
|
||||
{
|
||||
strImagePath = pReader->m_strFolder + FILE_SEPARATOR_STR + _T("media") + FILE_SEPARATOR_STR + strImagePath;
|
||||
}
|
||||
|
||||
OOX::CPath pathUrl = strImagePath;
|
||||
strImagePath = pathUrl.GetPath();
|
||||
}
|
||||
|
||||
smart_ptr<OOX::File> additionalFile;
|
||||
NSBinPptxRW::_relsGeneratorInfo oRelsGeneratorInfo = pReader->m_pRels->WriteImage(strImagePath, additionalFile, L"", L"");
|
||||
|
||||
if (oRelsGeneratorInfo.nImageRId > 0)
|
||||
{
|
||||
embed = new OOX::RId((size_t)oRelsGeneratorInfo.nImageRId);
|
||||
}
|
||||
pReader->Skip(1); // end attribute
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
pReader->SkipRecord();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pReader->Seek(_e2);
|
||||
}
|
||||
} // namespace Logic
|
||||
} // namespace PPTX
|
||||
@ -63,16 +63,22 @@ namespace PPTX
|
||||
link = oSrc.link;
|
||||
|
||||
m_namespace = oSrc.m_namespace;
|
||||
|
||||
oleRid = oSrc.oleRid;
|
||||
oleFilepathBin = oSrc.oleFilepathBin;
|
||||
|
||||
mediaRid = oSrc.mediaRid;
|
||||
mediaFilepath = oSrc.mediaFilepath;
|
||||
|
||||
return *this;
|
||||
}
|
||||
virtual OOX::EElementType getType() const
|
||||
{
|
||||
return OOX::et_a_blip;
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node);
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
@ -81,96 +87,12 @@ namespace PPTX
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("cstate"), cstate )
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node);
|
||||
virtual std::wstring toXML() const;
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const;
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
std::wstring strName = (_T("") == m_namespace) ? _T("blip") : (m_namespace + _T(":blip"));
|
||||
pWriter->StartNode(strName);
|
||||
|
||||
pWriter->StartAttributes();
|
||||
if (embed.IsInit())
|
||||
pWriter->WriteAttribute(_T("r:embed"), embed->ToString());
|
||||
if (link.IsInit())
|
||||
pWriter->WriteAttribute(_T("r:link"), link->ToString());
|
||||
pWriter->WriteAttribute(_T("cstate"), cstate);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
// TODO:
|
||||
size_t nCount = Effects.size();
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
{
|
||||
Effects[i].toXmlWriter(pWriter);
|
||||
}
|
||||
|
||||
pWriter->EndNode(strName);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteLimit2(0, cstate);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
if (embed.is_init())
|
||||
pWriter->WriteString1(10, embed->get());
|
||||
if (link.is_init())
|
||||
pWriter->WriteString1(11, link->get());
|
||||
|
||||
pWriter->StartRecord(2);
|
||||
ULONG len = (ULONG)Effects.size();
|
||||
pWriter->WriteULONG(len);
|
||||
|
||||
for (ULONG i = 0; i < len; ++i)
|
||||
{
|
||||
pWriter->WriteRecord1(3, Effects[i]);
|
||||
}
|
||||
|
||||
pWriter->EndRecord();
|
||||
|
||||
double dX = pWriter->GetShapeX(); //mm
|
||||
double dY = pWriter->GetShapeY();
|
||||
|
||||
double dW = pWriter->GetShapeWidth(); //mm
|
||||
double dH = pWriter->GetShapeHeight();
|
||||
|
||||
OOX::IFileContainer* pRels = NULL;
|
||||
|
||||
if (pWriter->m_pCurrentContainer->is_init())
|
||||
pRels = pWriter->m_pCurrentContainer->operator ->();
|
||||
|
||||
std::wstring olePath;
|
||||
if(!oleFilepathBin.empty())
|
||||
{
|
||||
olePath = oleFilepathBin;
|
||||
}
|
||||
else if(!oleRid.empty())
|
||||
{
|
||||
olePath= this->GetFullOleName(OOX::RId(oleRid), pRels);
|
||||
}
|
||||
|
||||
std::wstring imagePath;
|
||||
if(!oleFilepathImage.empty())
|
||||
{
|
||||
imagePath = oleFilepathImage;
|
||||
}
|
||||
else
|
||||
{
|
||||
imagePath = this->GetFullPicName(pRels);
|
||||
}
|
||||
|
||||
NSShapeImageGen::CImageInfo oId = pWriter->m_pCommon->m_pImageManager->WriteImage(imagePath, olePath, dX, dY, dW, dH);
|
||||
std::wstring s = oId.GetPath2();
|
||||
|
||||
pWriter->StartRecord(3);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteString1(0, s);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const;
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader);
|
||||
|
||||
virtual std::wstring GetFullPicName(OOX::IFileContainer* pRels = NULL)const;
|
||||
virtual std::wstring GetFullOleName(const OOX::RId& pRId, OOX::IFileContainer* pRels = NULL)const;
|
||||
|
||||
@ -180,9 +102,11 @@ namespace PPTX
|
||||
nullable<OOX::RId> embed;
|
||||
nullable<OOX::RId> link;
|
||||
std::wstring m_namespace;
|
||||
//internal
|
||||
std::wstring mediaRid;
|
||||
std::wstring mediaFilepath;
|
||||
|
||||
std::wstring oleRid;
|
||||
//internal
|
||||
std::wstring oleFilepathBin;
|
||||
std::wstring oleFilepathImage;
|
||||
protected:
|
||||
|
||||
@ -69,6 +69,9 @@ namespace PPTX
|
||||
dpi = oSrc.dpi;
|
||||
rotWithShape = oSrc.rotWithShape;
|
||||
|
||||
additionalFile = oSrc.additionalFile;
|
||||
oleData = oSrc.oleData;
|
||||
|
||||
m_namespace = oSrc.m_namespace;
|
||||
return *this;
|
||||
}
|
||||
@ -432,10 +435,10 @@ namespace PPTX
|
||||
strImagePath = pathUrl.GetPath();
|
||||
}
|
||||
|
||||
NSBinPptxRW::_relsGeneratorInfo oRelsGeneratorInfo = pReader->m_pRels->WriteImage(strImagePath, oleFile, oleData, strOrigBase64);
|
||||
NSBinPptxRW::_relsGeneratorInfo oRelsGeneratorInfo = pReader->m_pRels->WriteImage(strImagePath, additionalFile, oleData, strOrigBase64);
|
||||
|
||||
// -------------------
|
||||
if (strTempFile != _T(""))
|
||||
if (!strTempFile.empty())
|
||||
{
|
||||
CDirectory::DeleteFile(strTempFile);
|
||||
}
|
||||
@ -444,15 +447,22 @@ namespace PPTX
|
||||
if (!blip.is_init())
|
||||
blip = new PPTX::Logic::Blip();
|
||||
|
||||
blip->embed = new OOX::RId((size_t)oRelsGeneratorInfo.nImageRId);
|
||||
blip->oleFilepathImage = oRelsGeneratorInfo.sFilepathImage;
|
||||
if (oRelsGeneratorInfo.nImageRId > 0)
|
||||
{
|
||||
blip->embed = new OOX::RId((size_t)oRelsGeneratorInfo.nImageRId);
|
||||
}
|
||||
|
||||
if(oRelsGeneratorInfo.nOleRId > 0)
|
||||
{
|
||||
blip->oleRid = OOX::RId((size_t)oRelsGeneratorInfo.nOleRId).get();
|
||||
blip->oleFilepathBin = oRelsGeneratorInfo.sFilepathOle;
|
||||
blip->oleFilepathImage = oRelsGeneratorInfo.sFilepathImage;
|
||||
}
|
||||
if(oRelsGeneratorInfo.nMediaRId > 0)
|
||||
{
|
||||
blip->mediaRid = OOX::RId((size_t)oRelsGeneratorInfo.nMediaRId).get();
|
||||
blip->mediaFilepath = oRelsGeneratorInfo.sFilepathMedia;
|
||||
}
|
||||
|
||||
pReader->Skip(1); // end attribute
|
||||
break;
|
||||
}
|
||||
@ -507,8 +517,8 @@ namespace PPTX
|
||||
nullable_bool rotWithShape;
|
||||
|
||||
//internal
|
||||
smart_ptr<OOX::OleObject> oleFile;
|
||||
std::wstring oleData;
|
||||
mutable smart_ptr<OOX::File> additionalFile;
|
||||
std::wstring oleData;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
@ -45,8 +45,9 @@ namespace PPTX
|
||||
public:
|
||||
WritingElement_AdditionConstructors(MediaFile)
|
||||
|
||||
MediaFile()
|
||||
MediaFile(std::wstring name_)
|
||||
{
|
||||
name = name_;
|
||||
}
|
||||
|
||||
MediaFile& operator=(const MediaFile& oSrc)
|
||||
@ -75,19 +76,28 @@ namespace PPTX
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("r:link"), link)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("contentType"), contentType)
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, L"r:link", link)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, L"contentType", contentType)
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
}
|
||||
virtual std::wstring toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("r:link"), link.ToString());
|
||||
oAttr.Write(_T("contentType"), contentType);
|
||||
oAttr.Write(L"r:link", link.ToString());
|
||||
oAttr.Write(L"contentType", contentType);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:") + name, oAttr);
|
||||
return XmlUtils::CreateNode(L"a:" + name, oAttr);
|
||||
}
|
||||
public:
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(L"a:" + name);
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute (L"r:link", link.ToString());
|
||||
pWriter->WriteAttribute (L"contentType", contentType);
|
||||
pWriter->EndAttributes();
|
||||
pWriter->EndNode(L"a:" + name);
|
||||
}
|
||||
|
||||
std::wstring name;
|
||||
OOX::RId link;
|
||||
nullable_string contentType;
|
||||
|
||||
@ -41,7 +41,10 @@
|
||||
#include "Media/MediaFile.h"
|
||||
#include "Media/WavAudioFile.h"
|
||||
|
||||
#include "../../../Common/DocxFormat/Source/DocxFormat/Media/Audio.h"
|
||||
#include "../../../Common/DocxFormat/Source/DocxFormat/Media/Video.h"
|
||||
#include "../../../Common/DocxFormat/Source/DocxFormat/Media/OleObject.h"
|
||||
|
||||
#include "../../../Common/DocxFormat/Source/MathEquation/MathEquation.h"
|
||||
|
||||
#include "../../../ASCOfficeDocxFile2/BinWriter/BinEquationWriter.h"
|
||||
@ -134,9 +137,11 @@ namespace PPTX
|
||||
pWriter->WriteLimit2(4, m_oDrawAspect);
|
||||
pWriter->WriteLimit2(5, m_oType);
|
||||
pWriter->WriteLimit2(6, m_oUpdateMode);
|
||||
if (ole_file.IsInit() == false || ole_file->isMsPackage() == false)
|
||||
if (ole_file.IsInit() && ole_file->isMsPackage() == false)
|
||||
{
|
||||
pWriter->WriteString1(7, ole_file->filename().GetFilename()); //OleObject Binary FileName (bin, xls, doc, ... other stream file)
|
||||
std::wstring sExt = ole_file->filename().GetExtention(false);
|
||||
if (!sExt.empty())
|
||||
pWriter->WriteString1(7, L"maskFile." + sExt); //OleObject Binary FileName Extension (bin, xls, doc, ... other stream file)
|
||||
}
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
@ -608,6 +613,183 @@ namespace PPTX
|
||||
|
||||
return XmlUtils::CreateNode(m_namespace + L":pic", oValue);
|
||||
}
|
||||
|
||||
void Pic::toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
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())
|
||||
{
|
||||
blipFill.additionalFile = GetMediaLink();
|
||||
|
||||
smart_ptr<OOX::Media> mediaFile = blipFill.additionalFile.smart_dynamic_cast<OOX::Media>();
|
||||
if (mediaFile.IsInit() && blipFill.blip.IsInit())
|
||||
{
|
||||
blipFill.blip->mediaFilepath = mediaFile->filename().GetPath();
|
||||
}
|
||||
|
||||
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
|
||||
pWriter->StartRecord(SPTREE_TYPE_PIC);
|
||||
}
|
||||
else
|
||||
{
|
||||
pWriter->StartRecord(SPTREE_TYPE_PIC);
|
||||
}
|
||||
|
||||
if (blipFill.additionalFile.is<OOX::Media>())
|
||||
{
|
||||
smart_ptr<OOX::Media> mediaFile = blipFill.additionalFile.smart_dynamic_cast<OOX::Media>();
|
||||
|
||||
pWriter->StartRecord(5);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
std::wstring sExt = mediaFile->filename().GetExtention(false);
|
||||
if (!sExt.empty())
|
||||
pWriter->WriteString1(0, L"maskFile." + sExt);
|
||||
//todoo start, end positions ..
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
pWriter->WriteRecord2(4, oleObject);
|
||||
pWriter->WriteRecord1(0, nvPicPr);
|
||||
pWriter->WriteRecord1(1, blipFill);
|
||||
pWriter->WriteRecord1(2, spPr);
|
||||
pWriter->WriteRecord2(3, style);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
void Pic::toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
std::wstring namespace_ = m_namespace;
|
||||
bool bOle = false;
|
||||
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX) namespace_ = L"xdr";
|
||||
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX) namespace_ = L"pic";
|
||||
|
||||
if (pWriter->m_lDocType != XMLWRITER_DOC_TYPE_XLSX &&
|
||||
pWriter->m_lDocType != XMLWRITER_DOC_TYPE_DOCX)
|
||||
{
|
||||
if(oleObject.IsInit() && oleObject->isValid())
|
||||
{
|
||||
bOle = true;
|
||||
pWriter->WriteString(L"<p:graphicFrame><p:nvGraphicFramePr><p:cNvPr id=\"0\" name=\"\"/><p:cNvGraphicFramePr><a:graphicFrameLocks noChangeAspect=\"1\"/></p:cNvGraphicFramePr><p:nvPr><p:extLst><p:ext uri=\"{D42A27DB-BD31-4B8C-83A1-F6EECF244321}\"><p14:modId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"2157879785\"/></p:ext></p:extLst></p:nvPr></p:nvGraphicFramePr>");
|
||||
if(spPr.xfrm.IsInit())
|
||||
{
|
||||
std::wstring oldNamespace = spPr.xfrm->m_ns;
|
||||
spPr.xfrm->m_ns = _T("p");
|
||||
spPr.xfrm->toXmlWriter(pWriter);
|
||||
spPr.xfrm->m_ns = oldNamespace;
|
||||
}
|
||||
pWriter->WriteString(L"<a:graphic><a:graphicData uri=\"http://schemas.openxmlformats.org/presentationml/2006/ole\">");
|
||||
|
||||
pWriter->StartNode(_T("p:oleObj"));
|
||||
pWriter->WriteAttribute(L"name", (std::wstring)L"oleObj");
|
||||
if(oleObject->m_oId.IsInit())
|
||||
{
|
||||
pWriter->WriteAttribute2(L"r:id", oleObject->m_oId->get());
|
||||
}
|
||||
if(oleObject->m_oDxaOrig.IsInit())
|
||||
{
|
||||
int nDxaOrig = oleObject->m_oDxaOrig.get();
|
||||
pWriter->WriteAttribute(L"imgW", 635 * nDxaOrig); //twips to emu
|
||||
}
|
||||
if(oleObject->m_oDyaOrig.IsInit())
|
||||
{
|
||||
int nDyaOrig = oleObject->m_oDyaOrig.get();
|
||||
pWriter->WriteAttribute(L"imgH", 635 * nDyaOrig); //twips to emu
|
||||
}
|
||||
pWriter->WriteAttribute2(L"progId", oleObject->m_sProgId);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->WriteString(L"<p:embed/>");
|
||||
}
|
||||
}
|
||||
pWriter->StartNode(namespace_ + L":pic");
|
||||
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX)
|
||||
{
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("xmlns:pic"), (std::wstring)_T("http://schemas.openxmlformats.org/drawingml/2006/picture"));
|
||||
}
|
||||
pWriter->EndAttributes();
|
||||
|
||||
nvPicPr.toXmlWriter(pWriter);
|
||||
|
||||
blipFill.m_namespace = namespace_;
|
||||
blipFill.toXmlWriter(pWriter);
|
||||
|
||||
pWriter->m_lFlag = 1;
|
||||
spPr.toXmlWriter(pWriter);
|
||||
pWriter->m_lFlag = 0;
|
||||
|
||||
pWriter->Write(style);
|
||||
|
||||
pWriter->EndNode(namespace_ + L":pic");
|
||||
|
||||
if (pWriter->m_lDocType != XMLWRITER_DOC_TYPE_XLSX &&
|
||||
pWriter->m_lDocType != XMLWRITER_DOC_TYPE_DOCX)
|
||||
{
|
||||
if(bOle)
|
||||
{
|
||||
pWriter->WriteString(L"</p:oleObj></a:graphicData></a:graphic></p:graphicFrame>");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Pic::fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
@ -621,9 +803,8 @@ namespace PPTX
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
nvPicPr.fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
nvPicPr.fromPPTY(pReader);
|
||||
}break;
|
||||
case 1:
|
||||
{
|
||||
blipFill.fromPPTY(pReader);
|
||||
@ -637,19 +818,23 @@ namespace PPTX
|
||||
if (NSFile::CFileBinary::Exists(oleObject->m_OleObjectFile->filename().GetPath()) == false)
|
||||
oleObject->m_OleObjectFile->set_filename (blipFill.blip->oleFilepathBin);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
smart_ptr<OOX::Media> mediaFile = blipFill.additionalFile.smart_dynamic_cast<OOX::Media>();
|
||||
if (mediaFile.IsInit() && blipFill.blip.IsInit())
|
||||
{
|
||||
if (NSFile::CFileBinary::Exists(mediaFile->filename().GetPath()) == false)
|
||||
mediaFile->set_filename (blipFill.blip->mediaFilepath);
|
||||
}
|
||||
}break;
|
||||
case 2:
|
||||
{
|
||||
spPr.fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
spPr.fromPPTY(pReader);
|
||||
}break;
|
||||
case 3:
|
||||
{
|
||||
style = new ShapeStyle(L"p");
|
||||
style->fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
style->fromPPTY(pReader);
|
||||
}break;
|
||||
case 4:
|
||||
{
|
||||
oleObject = new COLEObject();
|
||||
@ -658,15 +843,34 @@ namespace PPTX
|
||||
if(oleObject->m_sData.IsInit())
|
||||
blipFill.oleData = oleObject->m_sData.get();
|
||||
|
||||
blipFill.oleFile = oleObject->m_OleObjectFile;
|
||||
blipFill.additionalFile = oleObject->m_OleObjectFile.smart_dynamic_cast<OOX::File>();
|
||||
}break;
|
||||
case 5:
|
||||
{
|
||||
LONG _end_rec1 = pReader->GetPos() + pReader->GetLong() + 4;
|
||||
|
||||
//if (oleObject->m_OleObjectFile.IsInit())
|
||||
//{
|
||||
// blipFill.olePath = oleObject->m_OleObjectFile->filename().GetPath();
|
||||
// if (NSFile::CFileBinary::Exists(blipFill.olePath))
|
||||
// blipFill.olePath.clear();
|
||||
//}
|
||||
break;
|
||||
pReader->Skip(1); // start attributes
|
||||
|
||||
while (true)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar_TypeNode();
|
||||
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
|
||||
break;
|
||||
|
||||
if (0 == _at)
|
||||
{
|
||||
std::wstring strMediaFileMask = pReader->GetString2();
|
||||
|
||||
smart_ptr<OOX::Media> mediaFile = blipFill.additionalFile.smart_dynamic_cast<OOX::Media>();
|
||||
if (mediaFile.IsInit())
|
||||
{
|
||||
mediaFile->set_filename(strMediaFileMask);
|
||||
}
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
pReader->Seek(_end_rec1);
|
||||
}
|
||||
default:
|
||||
{
|
||||
@ -674,16 +878,53 @@ namespace PPTX
|
||||
}
|
||||
}
|
||||
}
|
||||
if(blipFill.blip.IsInit() && !blipFill.blip->oleRid.empty() && oleObject.IsInit())
|
||||
if(blipFill.blip.IsInit() && blipFill.additionalFile.IsInit())
|
||||
{
|
||||
oleObject->m_oId = OOX::RId(blipFill.blip->oleRid);
|
||||
|
||||
if (oleObject->m_OleObjectFile.IsInit() == false)
|
||||
if (!blipFill.blip->oleRid.empty() && oleObject.IsInit())
|
||||
{
|
||||
oleObject->m_OleObjectFile = new OOX::OleObject(false, pReader->m_nDocumentType == XMLWRITER_DOC_TYPE_DOCX);
|
||||
|
||||
oleObject->m_OleObjectFile->set_filename (blipFill.blip->oleFilepathBin);
|
||||
oleObject->m_OleObjectFile->set_filename_cache (blipFill.blip->oleFilepathImage);
|
||||
oleObject->m_oId = OOX::RId(blipFill.blip->oleRid);
|
||||
|
||||
if (oleObject->m_OleObjectFile.IsInit() == false)
|
||||
{
|
||||
oleObject->m_OleObjectFile = new OOX::OleObject(false, pReader->m_nDocumentType == XMLWRITER_DOC_TYPE_DOCX);
|
||||
|
||||
oleObject->m_OleObjectFile->set_filename (blipFill.blip->oleFilepathBin);
|
||||
oleObject->m_OleObjectFile->set_filename_cache (blipFill.blip->oleFilepathImage);
|
||||
}
|
||||
}
|
||||
if (!blipFill.blip->mediaRid.empty())
|
||||
{
|
||||
PPTX::Logic::Ext ext;
|
||||
ext.link = OOX::RId(blipFill.blip->mediaRid);
|
||||
ext.uri = L"{DAA4B4D4-6D71-4841-9C94-3DE7FCFB9230}";
|
||||
nvPicPr.nvPr.extLst.push_back(ext);
|
||||
|
||||
int nRId = -1;
|
||||
if (blipFill.additionalFile.is<OOX::Audio>())
|
||||
{
|
||||
nvPicPr.nvPr.media.Media = new PPTX::Logic::MediaFile(L"audioFile");
|
||||
nRId = pReader->m_pRels->WriteRels(L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/audio",
|
||||
L"NULL", L"External");
|
||||
|
||||
}
|
||||
if (blipFill.additionalFile.is<OOX::Video>())
|
||||
{
|
||||
nvPicPr.nvPr.media.Media = new PPTX::Logic::MediaFile(L"videoFile");
|
||||
nRId = pReader->m_pRels->WriteRels(L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/video",
|
||||
L"NULL", L"External");
|
||||
}
|
||||
|
||||
if (nvPicPr.nvPr.media.Media.IsInit() && nRId > 0)
|
||||
{
|
||||
PPTX::Logic::MediaFile& mediaFile = nvPicPr.nvPr.media.Media.as<PPTX::Logic::MediaFile>();
|
||||
mediaFile.link = OOX::RId((size_t)nRId);
|
||||
|
||||
}
|
||||
if (nvPicPr.cNvPr.hlinkClick.IsInit() == false)
|
||||
nvPicPr.cNvPr.hlinkClick.Init();
|
||||
|
||||
nvPicPr.cNvPr.hlinkClick->id = L"";
|
||||
nvPicPr.cNvPr.hlinkClick->action = L"ppaction://media";
|
||||
}
|
||||
}
|
||||
|
||||
@ -726,57 +967,28 @@ namespace PPTX
|
||||
return blipFill.blip->GetFullPicName();
|
||||
return _T("");
|
||||
}
|
||||
|
||||
std::wstring Pic::GetVideoLink()const
|
||||
smart_ptr<OOX::File> Pic::GetMediaLink()const
|
||||
{
|
||||
std::wstring file = _T("");
|
||||
if (parentFileIs<Slide>())
|
||||
smart_ptr<OOX::File> file;
|
||||
|
||||
if (!parentFileIs<Slide>()) return file;
|
||||
|
||||
if (nvPicPr.nvPr.media.is<WavAudioFile>())
|
||||
{
|
||||
if (nvPicPr.nvPr.media.is<MediaFile>())
|
||||
{
|
||||
if ((nvPicPr.nvPr.media.as<MediaFile>().name == _T("videoFile")) || (nvPicPr.nvPr.media.as<MediaFile>().name == _T("quickTimeFile")))
|
||||
{
|
||||
file = parentFileAs<Slide>().GetLinkFromRId(nvPicPr.nvPr.media.as<MediaFile>().link.get());
|
||||
if (std::wstring (_T("NULL")) == file) // HAVE TRIM
|
||||
{
|
||||
if(nvPicPr.nvPr.extLst.size())
|
||||
{
|
||||
file = parentFileAs<Slide>().GetLinkFromRId(nvPicPr.nvPr.extLst[0].link.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return parentFileAs<Slide>().Find(nvPicPr.nvPr.media.as<WavAudioFile>().embed.get());
|
||||
}
|
||||
|
||||
return file;
|
||||
}
|
||||
|
||||
std::wstring Pic::GetAudioLink()const
|
||||
{
|
||||
std::wstring file = _T("");
|
||||
if (parentFileIs<Slide>())
|
||||
if (nvPicPr.nvPr.media.is<MediaFile>())
|
||||
{
|
||||
if (nvPicPr.nvPr.media.is<WavAudioFile>())
|
||||
file = parentFileAs<Slide>().Find(nvPicPr.nvPr.media.as<MediaFile>().link.get());
|
||||
smart_ptr<OOX::Media> mediaFile = file.smart_dynamic_cast<OOX::Media>();
|
||||
|
||||
if ( mediaFile.IsInit() == false && !nvPicPr.nvPr.extLst.empty())
|
||||
{
|
||||
return parentFileAs<Slide>().GetLinkFromRId(nvPicPr.nvPr.media.as<WavAudioFile>().embed.get());
|
||||
}
|
||||
|
||||
if (nvPicPr.nvPr.media.is<MediaFile>())
|
||||
{
|
||||
if (nvPicPr.nvPr.media.as<MediaFile>().name == _T("audioFile"))
|
||||
{
|
||||
file = parentFileAs<Slide>().GetLinkFromRId(nvPicPr.nvPr.media.as<MediaFile>().link.get());
|
||||
|
||||
if (std::wstring (_T("NULL")) == file) // HAVE TRIM
|
||||
{
|
||||
if(nvPicPr.nvPr.extLst.size())
|
||||
{
|
||||
file = parentFileAs<Slide>().GetLinkFromRId(nvPicPr.nvPr.extLst[0].link.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//todooo - почему везде нулевой то? - сделать по всем поиск по uri
|
||||
file = parentFileAs<Slide>().Find(nvPicPr.nvPr.extLst[0].link.get());
|
||||
}
|
||||
}//удалять ли c UnknownType ???? (если не найден щас генерится)
|
||||
return file;
|
||||
}
|
||||
|
||||
@ -970,8 +1182,18 @@ namespace PPTX
|
||||
}
|
||||
}
|
||||
|
||||
if (spPr.Geometry.is_init())
|
||||
bool bRect = bOle; //ole ВСЕГДА rect
|
||||
|
||||
if (spPr.Geometry.is<PPTX::Logic::PrstGeom>())
|
||||
{
|
||||
const PPTX::Logic::PrstGeom & lpGeom = spPr.Geometry.as<PPTX::Logic::PrstGeom>();
|
||||
|
||||
if( lpGeom.prst.get() == L"rect" )
|
||||
bRect = true;
|
||||
}
|
||||
|
||||
if (bRect == false)
|
||||
{//custom vml shape
|
||||
std::wstring strPath;
|
||||
std::wstring strTextRect;
|
||||
|
||||
@ -1158,8 +1380,11 @@ namespace PPTX
|
||||
}
|
||||
if(oleObject->m_oId.IsInit())
|
||||
{
|
||||
blipFill.blip->oleRid = oleObject->m_oId.get().ToString();
|
||||
if (blipFill.blip.IsInit() == false)
|
||||
blipFill.blip.Init();
|
||||
blipFill.blip->oleRid = oleObject->m_oId->get();
|
||||
}
|
||||
node.ReadAttributeBase(L"spid", oleObject->m_sShapeId);
|
||||
}
|
||||
} // namespace Logic
|
||||
} // namespace PPTX
|
||||
|
||||
@ -237,127 +237,35 @@ namespace PPTX
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node);
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
|
||||
virtual std::wstring toXML() const;
|
||||
void fromXMLOle(XmlUtils::CXmlNode& node);
|
||||
|
||||
virtual void GetRect(Aggplus::RECT& pRect)const;
|
||||
|
||||
virtual std::wstring GetFullPicName()const;
|
||||
virtual std::wstring GetVideoLink()const;
|
||||
virtual std::wstring GetAudioLink()const;
|
||||
smart_ptr<OOX::File> GetMediaLink()const;
|
||||
|
||||
DWORD GetFill(UniFill& fill)const;
|
||||
DWORD GetLine(Ln& line)const;
|
||||
|
||||
double GetStTrim () const;
|
||||
double GetEndTrim () const;
|
||||
long GetRefId() const;
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
if(oleObject.IsInit())
|
||||
{
|
||||
pWriter->StartRecord(SPTREE_TYPE_OLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
pWriter->StartRecord(SPTREE_TYPE_PIC);
|
||||
}
|
||||
|
||||
pWriter->WriteRecord2(4, oleObject);
|
||||
pWriter->WriteRecord1(0, nvPicPr);
|
||||
pWriter->WriteRecord1(1, blipFill);
|
||||
pWriter->WriteRecord1(2, spPr);
|
||||
pWriter->WriteRecord2(3, style);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
std::wstring namespace_ = m_namespace;
|
||||
bool bOle = false;
|
||||
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX) namespace_ = L"xdr";
|
||||
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX) namespace_ = L"pic";
|
||||
|
||||
if (pWriter->m_lDocType != XMLWRITER_DOC_TYPE_XLSX &&
|
||||
pWriter->m_lDocType != XMLWRITER_DOC_TYPE_DOCX)
|
||||
{
|
||||
if(oleObject.IsInit() && oleObject->isValid())
|
||||
{
|
||||
bOle = true;
|
||||
pWriter->WriteString(L"<p:graphicFrame><p:nvGraphicFramePr><p:cNvPr id=\"0\" name=\"\"/><p:cNvGraphicFramePr><a:graphicFrameLocks noChangeAspect=\"1\"/></p:cNvGraphicFramePr><p:nvPr><p:extLst><p:ext uri=\"{D42A27DB-BD31-4B8C-83A1-F6EECF244321}\"><p14:modId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"2157879785\"/></p:ext></p:extLst></p:nvPr></p:nvGraphicFramePr>");
|
||||
if(spPr.xfrm.IsInit())
|
||||
{
|
||||
std::wstring oldNamespace = spPr.xfrm->m_ns;
|
||||
spPr.xfrm->m_ns = _T("p");
|
||||
spPr.xfrm->toXmlWriter(pWriter);
|
||||
spPr.xfrm->m_ns = oldNamespace;
|
||||
}
|
||||
pWriter->WriteString(L"<a:graphic><a:graphicData uri=\"http://schemas.openxmlformats.org/presentationml/2006/ole\">");
|
||||
|
||||
pWriter->StartNode(_T("p:oleObj"));
|
||||
pWriter->WriteAttribute(L"name", (std::wstring)L"oleObj");
|
||||
if(oleObject->m_oId.IsInit())
|
||||
{
|
||||
pWriter->WriteAttribute2(L"r:id", oleObject->m_oId->get());
|
||||
}
|
||||
if(oleObject->m_oDxaOrig.IsInit())
|
||||
{
|
||||
int nDxaOrig = oleObject->m_oDxaOrig.get();
|
||||
pWriter->WriteAttribute(L"imgW", 635 * nDxaOrig); //twips to emu
|
||||
}
|
||||
if(oleObject->m_oDyaOrig.IsInit())
|
||||
{
|
||||
int nDyaOrig = oleObject->m_oDyaOrig.get();
|
||||
pWriter->WriteAttribute(L"imgH", 635 * nDyaOrig); //twips to emu
|
||||
}
|
||||
pWriter->WriteAttribute2(L"progId", oleObject->m_sProgId);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->WriteString(L"<p:embed/>");
|
||||
}
|
||||
}
|
||||
pWriter->StartNode(namespace_ + L":pic");
|
||||
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX)
|
||||
{
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("xmlns:pic"), (std::wstring)_T("http://schemas.openxmlformats.org/drawingml/2006/picture"));
|
||||
}
|
||||
pWriter->EndAttributes();
|
||||
|
||||
nvPicPr.toXmlWriter(pWriter);
|
||||
|
||||
blipFill.m_namespace = namespace_;
|
||||
blipFill.toXmlWriter(pWriter);
|
||||
|
||||
pWriter->m_lFlag = 1;
|
||||
spPr.toXmlWriter(pWriter);
|
||||
pWriter->m_lFlag = 0;
|
||||
|
||||
pWriter->Write(style);
|
||||
|
||||
pWriter->EndNode(namespace_ + L":pic");
|
||||
|
||||
if (pWriter->m_lDocType != XMLWRITER_DOC_TYPE_XLSX &&
|
||||
pWriter->m_lDocType != XMLWRITER_DOC_TYPE_DOCX)
|
||||
{
|
||||
if(bOle)
|
||||
{
|
||||
pWriter->WriteString(L"</p:oleObj></a:graphicData></a:graphic></p:graphicFrame>");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader);
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const;
|
||||
|
||||
virtual std::wstring toXML() const;
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const;
|
||||
void toXmlWriterVML(NSBinPptxRW::CXmlWriter* pWriter, smart_ptr<PPTX::Theme>& oTheme, smart_ptr<PPTX::Logic::ClrMap>& oClrMap, bool in_group = false);
|
||||
void fromXMLOle(XmlUtils::CXmlNode& node);
|
||||
//----------------------------------------------------------------------
|
||||
NvPicPr nvPicPr;
|
||||
BlipFill blipFill;
|
||||
mutable BlipFill blipFill;
|
||||
SpPr spPr;
|
||||
nullable<ShapeStyle> style;
|
||||
//internal
|
||||
nullable<COLEObject> oleObject;
|
||||
|
||||
std::wstring m_namespace;
|
||||
nullable<COLEObject> oleObject;
|
||||
nullable_string m_sClientDataXml;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds();
|
||||
|
||||
@ -409,7 +409,6 @@ namespace PPTX
|
||||
|
||||
pWriter->StartRecord(4);
|
||||
pWriter->m_pMainDocument->getBinaryContentElem(OOX::et_w_sdtContent, oTextBoxShape.GetPointer(), *pWriter, lDataSize);
|
||||
//pWriter->m_pMainDocument->getBinaryContent(TextBoxShape.get(), *pWriter, lDataSize);
|
||||
pWriter->EndRecord();
|
||||
|
||||
if (oTextBoxBodyPr.is_init())
|
||||
@ -419,6 +418,24 @@ namespace PPTX
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
}
|
||||
else if (strTextBoxShape.is_init())//после конвертации старого шейпа (vml)
|
||||
{
|
||||
long lDataSize = 0;
|
||||
ULONG lPos = pWriter->GetPosition();
|
||||
pWriter->SetPosition(lPos);
|
||||
|
||||
pWriter->StartRecord(4);
|
||||
pWriter->m_pMainDocument->getBinaryContent(strTextBoxShape.get(), *pWriter, lDataSize);
|
||||
pWriter->EndRecord();
|
||||
|
||||
if (oTextBoxBodyPr.is_init())
|
||||
{
|
||||
pWriter->StartRecord(5);
|
||||
oTextBoxBodyPr->toPPTY(pWriter);
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
}
|
||||
|
||||
else if (txBody.is_init())
|
||||
{
|
||||
std::wstring strContent = txBody->GetDocxTxBoxContent(pWriter, style);
|
||||
@ -553,7 +570,7 @@ namespace PPTX
|
||||
std::wstring strFillNode;
|
||||
std::wstring strStrokeNode;;
|
||||
|
||||
CalculateFill(spPr, style, oTheme, oClrMap, strFillAttr, strFillNode, bOle);
|
||||
CalculateFill(spPr, style, oTheme, oClrMap, strFillAttr, strFillNode, bOle, bSignature);
|
||||
CalculateLine(spPr, style, oTheme, oClrMap, strStrokeAttr, strStrokeNode, bOle, bSignature);
|
||||
|
||||
pWriter->StartNode(L"v:shape");
|
||||
|
||||
@ -37,8 +37,11 @@
|
||||
#include "CxnSp.h"
|
||||
#include "SpTree.h"
|
||||
#include "GraphicFrame.h"
|
||||
#include "./../SlideMaster.h"
|
||||
|
||||
#include "../SlideMaster.h"
|
||||
|
||||
#include "../../../Common/DocxFormat/Source/DocxFormat/Media/Audio.h"
|
||||
#include "../../../Common/DocxFormat/Source/DocxFormat/Media/Video.h"
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
@ -56,7 +59,7 @@ namespace PPTX
|
||||
}
|
||||
|
||||
void CalculateFill(PPTX::Logic::SpPr& oSpPr, nullable<ShapeStyle>& pShapeStyle, NSCommon::smart_ptr<PPTX::Theme>& oTheme,
|
||||
NSCommon::smart_ptr<PPTX::Logic::ClrMap>& oClrMap, std::wstring& strAttr, std::wstring& strNode, bool bOle)
|
||||
NSCommon::smart_ptr<PPTX::Logic::ClrMap>& oClrMap, std::wstring& strAttr, std::wstring& strNode, bool bOle, bool bSignature)
|
||||
{
|
||||
PPTX::Logic::UniFill fill;
|
||||
DWORD ARGB = 0;
|
||||
@ -110,7 +113,7 @@ namespace PPTX
|
||||
|
||||
std::wstring strId = oBlip.blip->embed->ToString();
|
||||
|
||||
if(bOle)
|
||||
if (bOle || bSignature)
|
||||
{
|
||||
strAttr = _T(" filled=\"f\"");
|
||||
strNode = _T("<v:imagedata r:id=\"") + strId + _T("\" o:title=\"\" />");
|
||||
@ -346,8 +349,22 @@ namespace PPTX
|
||||
}
|
||||
case SPTREE_TYPE_OLE:
|
||||
case SPTREE_TYPE_PIC:
|
||||
case SPTREE_TYPE_AUDIO:
|
||||
case SPTREE_TYPE_VIDEO:
|
||||
{
|
||||
Logic::Pic* p = new Logic::Pic();
|
||||
|
||||
if (_type == SPTREE_TYPE_AUDIO)
|
||||
{
|
||||
OOX::Audio *pAudio = new OOX::Audio(pReader->m_nDocumentType == XMLWRITER_DOC_TYPE_DOCX);
|
||||
p->blipFill.additionalFile = smart_ptr<OOX::File>(dynamic_cast<OOX::File*>(pAudio));
|
||||
}
|
||||
else if (_type == SPTREE_TYPE_VIDEO)
|
||||
{
|
||||
OOX::Video* pVideo = new OOX::Video(pReader->m_nDocumentType == XMLWRITER_DOC_TYPE_DOCX);
|
||||
p->blipFill.additionalFile = smart_ptr<OOX::File>(dynamic_cast<OOX::File*>(pVideo));
|
||||
}
|
||||
|
||||
p->fromPPTY(pReader);
|
||||
m_elem.reset(p);
|
||||
break;
|
||||
|
||||
@ -44,7 +44,7 @@ namespace PPTX
|
||||
namespace Logic
|
||||
{
|
||||
void CalculateFill(PPTX::Logic::SpPr& oSpPr, nullable<ShapeStyle>& pShapeStyle, smart_ptr<PPTX::Theme>& oTheme,
|
||||
smart_ptr<PPTX::Logic::ClrMap>& oClrMap, std::wstring& strAttr, std::wstring& strNode, bool bOle = false);
|
||||
smart_ptr<PPTX::Logic::ClrMap>& oClrMap, std::wstring& strAttr, std::wstring& strNode, bool bOle = false, bool bSignature = false);
|
||||
|
||||
void CalculateLine(PPTX::Logic::SpPr& oSpPr, nullable<ShapeStyle>& pShapeStyle,
|
||||
smart_ptr<PPTX::Theme>& oTheme, smart_ptr<PPTX::Logic::ClrMap>& oClrMap, std::wstring& strAttr, std::wstring& strNode, bool bOle = false, bool bSignature = false);
|
||||
|
||||
@ -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 );
|
||||
|
||||
|
||||
@ -46,9 +46,9 @@ namespace PPTX
|
||||
public:
|
||||
WritingElement_AdditionConstructors(TextListStyle)
|
||||
|
||||
TextListStyle()
|
||||
TextListStyle(std::wstring name = L"a:lstStyle")
|
||||
{
|
||||
m_name = L"a:lstStyle";
|
||||
m_name = name;
|
||||
}
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
|
||||
@ -189,8 +189,8 @@ namespace PPTX
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("lvl"), lvl)
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("algn"), algn)
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("fontAlgn"),fontAlgn)
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("marL"), marR)
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("marR"), marL)
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("marL"), marL)
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("marR"), marR)
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("indent"), indent)
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("defTabSz"),defTabSz)
|
||||
WritingElement_ReadAttributes_End ( oReader )
|
||||
@ -541,4 +541,4 @@ namespace PPTX
|
||||
} // namespace Logic
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // PPTX_LOGIC_TEXTPARAGRAPHPR_INCLUDE_H_
|
||||
#endif // PPTX_LOGIC_TEXTPARAGRAPHPR_INCLUDE_H_
|
||||
|
||||
@ -434,10 +434,10 @@ namespace PPTX
|
||||
}
|
||||
// -------------------
|
||||
|
||||
NSBinPptxRW::_relsGeneratorInfo oRelsGeneratorInfo = pReader->m_pRels->WriteImage(strUrl, pFill->oleFile, pFill->oleData, strOrigBase64);
|
||||
NSBinPptxRW::_relsGeneratorInfo oRelsGeneratorInfo = pReader->m_pRels->WriteImage(strUrl, pFill->additionalFile, pFill->oleData, strOrigBase64);
|
||||
|
||||
// -------------------
|
||||
if (strTempFile != _T(""))
|
||||
if (!strTempFile.empty())
|
||||
{
|
||||
CDirectory::DeleteFile(strTempFile);
|
||||
}
|
||||
@ -455,7 +455,11 @@ namespace PPTX
|
||||
pFill->blip->oleRid = OOX::RId((size_t)oRelsGeneratorInfo.nOleRId).get();
|
||||
pFill->blip->oleFilepathBin = oRelsGeneratorInfo.sFilepathOle;
|
||||
}
|
||||
|
||||
if(oRelsGeneratorInfo.nMediaRId > 0)
|
||||
{
|
||||
pFill->blip->mediaRid = OOX::RId((size_t)oRelsGeneratorInfo.nMediaRId).get();
|
||||
pFill->blip->mediaFilepath = oRelsGeneratorInfo.sFilepathMedia;
|
||||
}
|
||||
pReader->Skip(1); // end attribute
|
||||
break;
|
||||
}
|
||||
|
||||
@ -107,16 +107,13 @@ namespace PPTX
|
||||
return Media->toXML();
|
||||
return _T("");
|
||||
}
|
||||
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
// TODO:
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
// TODO:
|
||||
if (Media.is_init())
|
||||
Media->toXmlWriter(pWriter);
|
||||
}
|
||||
@ -126,8 +123,7 @@ namespace PPTX
|
||||
template<class T> AVSINLINE const bool is() const { return Media.is<T>(); }
|
||||
template<class T> AVSINLINE T& as() { return Media.as<T>(); }
|
||||
template<class T> AVSINLINE const T& as() const { return Media.as<T>(); }
|
||||
//public:
|
||||
private:
|
||||
|
||||
smart_ptr<WrapperWritingElement> Media;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
|
||||
@ -131,11 +131,11 @@ namespace PPTX
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:r"), PPTX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:m"), PPTX::g_Namespaces.m.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:w"), PPTX::g_Namespaces.w.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:p"), PPTX::g_Namespaces.p.m_strLink);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
cSld.toXmlWriter(pWriter);
|
||||
|
||||
clrMap.toXmlWriter(pWriter);
|
||||
pWriter->Write(hf);
|
||||
pWriter->Write(notesStyle);
|
||||
@ -172,7 +172,7 @@ namespace PPTX
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
notesStyle = new Logic::TextListStyle();
|
||||
notesStyle = new Logic::TextListStyle(L"p:notesStyle");
|
||||
notesStyle->fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ namespace PPTX
|
||||
}
|
||||
virtual void read(const OOX::CPath& filename, FileMap& map)
|
||||
{
|
||||
//FileContainer::read(filename, map);
|
||||
//FileContainer::read(filename);
|
||||
|
||||
XmlUtils::CXmlNode oNode;
|
||||
oNode.FromXmlFile(filename.m_strFilename);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="windows-1251"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Version="8,00"
|
||||
Name="PPTXFormat"
|
||||
ProjectGUID="{36636678-AE25-4BE6-9A34-2561D1BCF302}"
|
||||
RootNamespace="PPTXFormat"
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,9 +96,8 @@ public:
|
||||
void appendDelayedItems(const ReceiverItems& receiver_items_from_record, const SourceItems& source_items_from_record);
|
||||
void applyDelayedItems();
|
||||
|
||||
|
||||
POLE::Stream *stream_;
|
||||
private:
|
||||
POLE::Stream * stream_;
|
||||
CFStream::ReceiverItems receiver_items;
|
||||
CFStream::SourceItems source_items;
|
||||
};
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user