Commit d5726524 authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

git-svn-id:...

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@61919 954022d7-b5bf-4e40-9824-e11837661b57
parent c12f4518
...@@ -350,6 +350,11 @@ ASCOfficePDFWriter/Tests/TestSvgToPDF/bin/Test.exe svn_mime_002dtype=application ...@@ -350,6 +350,11 @@ ASCOfficePDFWriter/Tests/TestSvgToPDF/bin/Test.exe svn_mime_002dtype=application
ASCOfficePDFWriter/Tests/TestSvgToPDF/bin/Test.pdb svn_mime_002dtype=application%2Foctet-stream ASCOfficePDFWriter/Tests/TestSvgToPDF/bin/Test.pdb svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Tests/TestSvgToPDF/bin/files/coffe.jpg svn_mime_002dtype=application%2Foctet-stream ASCOfficePDFWriter/Tests/TestSvgToPDF/bin/files/coffe.jpg svn_mime_002dtype=application%2Foctet-stream
ASCOfficePDFWriter/Win32 svnc_tsvn_003alogminsize=5 ASCOfficePDFWriter/Win32 svnc_tsvn_003alogminsize=5
ASCOfficePPTFile/trunk/Linux svnc_tsvn_003alogminsize=5
ASCOfficePPTFile/trunk/PPTFormatLib svnc_tsvn_003alogminsize=5
ASCOfficePPTFile/trunk/PPTFormatLib/Linux svnc_tsvn_003alogminsize=5
ASCOfficePPTFile/trunk/PPTFormatLib/Win32 svnc_tsvn_003alogminsize=5
ASCOfficePPTFile/trunk/Win32 svnc_tsvn_003alogminsize=5
ASCOfficeXlsFile/ASCWorksheetConverter/Documents/22_04_09[!!-~]Презентация/xls-xlsx.odp svn_mime_002dtype=application%2Foctet-stream ASCOfficeXlsFile/ASCWorksheetConverter/Documents/22_04_09[!!-~]Презентация/xls-xlsx.odp svn_mime_002dtype=application%2Foctet-stream
ASCOfficeXlsFile/ASCWorksheetConverter/Documents/22_04_09[!!-~]Презентация/xls-xlsx_short.odp svn_mime_002dtype=application%2Foctet-stream ASCOfficeXlsFile/ASCWorksheetConverter/Documents/22_04_09[!!-~]Презентация/xls-xlsx_short.odp svn_mime_002dtype=application%2Foctet-stream
ASCOfficeXlsFile/ASCWorksheetConverter/Documents/22_04_09[!!-~]Презентация/Презентация[!!-~]конвертера[!!-~]XLSX.doc svn_mime_002dtype=application%2Foctet-stream ASCOfficeXlsFile/ASCWorksheetConverter/Documents/22_04_09[!!-~]Презентация/Презентация[!!-~]конвертера[!!-~]XLSX.doc svn_mime_002dtype=application%2Foctet-stream
......
#include "../PPTFormatLib/PPTFormatLib.h"
#include <iostream>
#include "../Win32/version.h"
static std::wstring utf8_to_unicode(const char *src)
{
if (src == NULL) return _T("");
std::string temp = src;
unsigned int nLength = temp.length();
UTF32 *pStrUtf32 = new UTF32 [nLength+1];
memset ((void *) pStrUtf32, 0, sizeof (UTF32) * (nLength+1));
UTF8 *pStrUtf8 = (UTF8 *) src;
// this values will be modificated
const UTF8 *pStrUtf8_Conv = pStrUtf8;
UTF32 *pStrUtf32_Conv = pStrUtf32;
ConversionResult eUnicodeConversionResult = ConvertUTF8toUTF32 (&pStrUtf8_Conv,
&pStrUtf8[nLength]
, &pStrUtf32_Conv
, &pStrUtf32 [nLength]
, strictConversion);
if (conversionOK != eUnicodeConversionResult)
{
delete [] pStrUtf32;
return L"";
}
std::wstring wsEntryName ((wchar_t *) pStrUtf32);
delete [] pStrUtf32;
return wsEntryName;
}
int main(int argc, char *argv[])
{
// check arguments
if (argc < 3)
{
// print out help topic
std::cout << std::endl;
std::cout << std::endl;
std::cout << "-------------------------------------------------------------------------------" << std::endl;
std::cout << "\t\tPPT/PPTX file converter. Version: " << STRVER << std::endl;
std::cout << "-------------------------------------------------------------------------------" << std::endl;
std::cout << std::endl;
std::cout << "USAGE: ASCPptConverter \"path_to_file_1\" \"path_to_file_2\" " << std::endl;
std::cout << "WHERE:" << std::endl;
std::cout << "\t\"path_to_file_1\" is a path to file to be converted" << std::endl;
std::cout << "\t\"path_to_file_2\" is a path to the corresponding output file" << std::endl << std::endl;
return 1;
}
CString sArg1, sArg2, sExePath;
sExePath = utf8_to_unicode(argv [0]);
sArg1 = utf8_to_unicode(argv [1]);
sArg2 = utf8_to_unicode(argv [2]);
CString sXMLOptions = _T("");
{// ppt -> pptx
COfficePPTFile pptFile;
HRESULT hRes = pptFile.LoadFromFile(sArg1, sArg2, sXMLOptions);
if (hRes != S_OK)return 2;
}
return 0;
}
#-------------------------------------------------
#
# Project created by QtCreator 2014-12-16T18:25:28
#
#-------------------------------------------------
QT -= core
QT -= gui
QMAKE_CXXFLAGS += -std=c++11 -Wall -Wno-ignored-qualifiers
DEFINES += UNICODE \
_UNICODE \
_USE_LIBXML2_READER_ \
_LINUX_QT \
_LINUX \
LINUX \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
PPTX_DEF\
PPT_DEF\
PPT_FORMAT\
USE_AVSOFFICESTUDIO_XMLUTILS \
SOLUTION_ASCOFFICEDOCXFILE2 \
ENABLE_PPT_TO_PPTX_CONVERT \
_PRESENTATION_WRITER_ \
NODOCX \
#DISABLE_FILE_DOWNLOADER \
BUILD_CONFIG_FULL_VERSION \
DONT_WRITE_EMBEDDED_FONTS \
CXIMAGE_DONT_DECLARE_TCHAR
TARGET = ASCPptConverter
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
INCLUDEPATH += \
/usr/include/libxml2
SOURCES += \
PptFileConverter.cpp
CONFIG(debug, debug|release){
message(Debug)
#pptformat
unix:!macx: LIBS += -L$$PWD/../PPTFormatLib/Linux/build-PPTFormatLib-Desktop-Debug/ -lPptFormatLib
unix:!macx: PRE_TARGETDEPS += $$PWD/../PPTFormatLib/Linux/build-PPTFormatLib-Desktop-Debug/libPptFormatLib.a
#pptxformat
unix:!macx: LIBS += -L$$PWD/../../../ASCOfficePPTXFile/PPTXLib/Linux/build-PPTXFormatLib-Desktop-Debug/ -lPPTXFormatLib
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../ASCOfficePPTXFile/PPTXLib/Linux/build-PPTXFormatLib-Desktop-Debug/libPPTXFormatLib.a
#docxfile2
unix:!macx: LIBS += -L$$PWD/../../../ASCOfficeDocxFile2/build-ASCOfficeDocxFile2Lib-Desktop-Debug/ -lASCOfficeDocxFile2Lib
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../ASCOfficeDocxFile2/build-ASCOfficeDocxFile2Lib-Desktop-Debug/libASCOfficeDocxFile2Lib.a
#docxformat
unix:!macx: LIBS += -L$$PWD/../../../Common/DocxFormat/build-DocxFormatLib-Desktop-Debug/ -lDocxFormatLib
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../Common/DocxFormat/build-DocxFormatLib-Desktop-Debug/libDocxFormatLib.a
#htmlRenderer
unix:!macx: LIBS += -L$$PWD/../../../ASCHTMLRenderer/build-ASCHTMLRendererLib-Desktop-Debug/ -lASCHTMLRendererLib
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../ASCHTMLRenderer/build-ASCHTMLRendererLib-Desktop-Debug/libASCHTMLRendererLib.a
#OfficeUtils
unix:!macx: LIBS += -L$$PWD/../../../ASCOfficeUtils/ASCOfficeUtilsLib/build-ASCOfficeUtilsLib-Desktop-Debug/ -lASCOfficeUtilsLib
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../ASCOfficeUtils/ASCOfficeUtilsLib/build-ASCOfficeUtilsLib-Desktop-Debug/libASCOfficeUtilsLib.a
#Graphics
unix:!macx: LIBS += -L$$PWD/../../../DesktopEditor/Qt_build/graphics/build-graphics-Desktop-Debug/ -lgraphics
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../DesktopEditor/Qt_build/graphics/build-graphics-Desktop-Debug/libgraphics.a
}
CONFIG(release, debug|release){
message(Release)
#pptformat
unix:!macx: LIBS += -L$$PWD/../PPTFormatLib/Linux/build-PPTFormatLib-Desktop-Release/ -lPPTFormatLib
unix:!macx: PRE_TARGETDEPS += $$PWD/../PPTFormatLib/Linux/build-PPTFormatLib-Desktop-Release/libPPTFormatLib.a
#pptxformat
unix:!macx: LIBS += -L$$PWD/../../../ASCOfficePPTXFile/PPTXLib/Linux/build-PPTXFormatLib-Desktop-Release/ -lPPTXFormatLib
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../ASCOfficePPTXFile/PPTXLib/Linux/build-PPTXFormatLib-Desktop-Release/libPPTXFormatLib.a
#docxfile2
unix:!macx: LIBS += -L$$PWD/../../../ASCOfficeDocxFile2/build-ASCOfficeDocxFile2Lib-Desktop-Release/ -lASCOfficeDocxFile2Lib
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../ASCOfficeDocxFile2/build-ASCOfficeDocxFile2Lib-Desktop-Release/libASCOfficeDocxFile2Lib.a
#docxformat
unix:!macx: LIBS += -L$$PWD/../../../Common/DocxFormat/build-DocxFormatLib-Desktop-Release/ -lDocxFormatLib
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../Common/DocxFormat/build-DocxFormatLib-Desktop-Release/libDocxFormatLib.a
#htmlRenderer
unix:!macx: LIBS += -L$$PWD/../../../ASCHTMLRenderer/build-ASCHTMLRendererLib-Desktop-Release/ -lASCHTMLRendererLib
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../ASCHTMLRenderer/build-ASCHTMLRendererLib-Desktop-Release/libASCHTMLRendererLib.a
#OfficeUtils
unix:!macx: LIBS += -L$$PWD/../../../ASCOfficeUtils/ASCOfficeUtilsLib/build-ASCOfficeUtilsLib-Desktop-Release/ -lASCOfficeUtilsLib
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../ASCOfficeUtils/ASCOfficeUtilsLib/build-ASCOfficeUtilsLib-Desktop-Release/libASCOfficeUtilsLib.a
#Graphics
unix:!macx: LIBS += -L$$PWD/../../../DesktopEditor/Qt_build/graphics/build-graphics-Desktop-Release/ -lgraphics
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../DesktopEditor/Qt_build/graphics/build-graphics-Desktop-Release/libgraphics.a
}
unix:!macx: LIBS += -lxml2 -lcurl
#unix:!macx: LIBS += -L$$PWD/../../../../../../../../usr/lib/x86_64-linux-gnu/ -lcurl
#INCLUDEPATH += $$PWD/../../../../../../../../usr/lib/x86_64-linux-gnu
#DEPENDPATH += $$PWD/../../../../../../../../usr/lib/x86_64-linux-gnu
#unix:!macx: PRE_TARGETDEPS += $$PWD/../../../../../../../../usr/lib/x86_64-linux-gnu/libcurl.a
#-------------------------------------------------
#
# Project created by QtCreator 2014-12-16T18:28:23
#
#-------------------------------------------------
QT -= core gui
TARGET = PptFormatLib
TEMPLATE = lib
CONFIG += staticlib
QMAKE_CXXFLAGS += -std=c++11 -Wall -Wno-ignored-qualifiers
DEFINES += UNICODE \
_UNICODE \
LINUX \
_LINUX_QT\
USE_ATL_CSTRING \
PPTX_DEF \
PPT_DEF \
ENABLE_PPT_TO_PPTX_CONVERT \
PPT_FORMAT \
_USE_LIBXML2_READER_ \
LIBXML_READER_ENABLED \
USE_LITE_READER \
_USE_XMLLITE_READER_ \
_PRESENTATION_WRITER_ \
_SVG_CONVERT_TO_IMAGE_ \
BUILD_CONFIG_FULL_VERSION \
DONT_WRITE_EMBEDDED_FONTS
#DISABLE_FILE_DOWNLOADER
INCLUDEPATH += \
../../../Common/DocxFormat/Source/XML/libxml2/XML/include
INCLUDEPATH += \
/usr/include/libxml2 \
INCLUDEPATH += \
../../../../DesktopEditor/freetype-2.5.2/include
LIBS += -lxml2
unix {
target.path = /usr/lib
INSTALLS += target
}
HEADERS += \
../Reader/AudioOverlay.h \
../Reader/ClassesAtom.h \
../Reader/CommonZLib.h \
../Reader/PPTDocumentInfo.h \
../Reader/PPTDocumentInfoOneUser.h \
../Reader/PPTFileDefines.h \
../Reader/PPTFileReader.h \
../Reader/ReadStructures.h \
../Reader/Records.h \
../Reader/Slide.h \
../Reader/SlideInfo.h \
../Reader/SlidePersist.h \
../Records/AnimationInfoAtom.h \
../Records/BlipEntityAtom.h \
../Records/BookmarkEntityAtom.h \
../Records/BookmarkSeedAtom.h \
../Records/ColorSchemeAtom.h \
../Records/CString.h \
../Records/CurrentUserAtom.h \
../Records/DateTimeMCAtom.h \
../Records/DocRoutingSlipAtom.h \
../Records/DocumentAtom.h \
../Records/DocumentRecords.h \
../Records/DocumentTextInfo.h \
../Records/EndDocument.h \
../Records/ExCDAudioContainer.h \
../Records/ExControlAtom.h \
../Records/ExHyperlinkAtom.h \
../Records/ExMediaAtom.h \
../Records/ExMIDIAudioContainer.h \
../Records/ExObjListAtom.h \
../Records/ExObjListContainer.h \
../Records/ExObjRefAtom.h \
../Records/ExOleEmbedAtom.h \
../Records/ExOleLinkAtom.h \
../Records/ExOleObjAtom.h \
../Records/ExVideoContainer.h \
../Records/ExWAVAudioEmbeddedContainer.h \
../Records/ExWAVAudioLinkContainer.h \
../Records/FontEntityAtom.h \
../Records/GenericDateMCAtom.h \
../Records/GridSpacing10Atom.h \
../Records/GuideAtom.h \
../Records/HeadersFootersAtom.h \
../Records/InteractiveInfoAtom.h \
../Records/KinsokuAtom.h \
../Records/MasterPersistAtom.h \
../Records/MasterTextPropAtom.h \
../Records/MetafileBlob.h \
../Records/MouseTextInteractiveInfoAtom.h \
../Records/NamedShowSlidesAtom.h \
../Records/NormalViewSetInfoAtom.h \
../Records/NotesAtom.h \
../Records/NotesPersistAtom.h \
../Records/NoZoomViewInfoAtom.h \
../Records/OutlineTextRefAtom.h \
../Records/PersistDirectoryAtom.h \
../Records/PlaceHolderAtom.h \
../Records/RecordsIncluder.h \
../Records/RoundTripColorMappingAtom.h \
../Records/RoundTripCompositeMainMasterId12Atom.h \
../Records/RoundTripNewPlaceholderId12Atom.h \
../Records/RoundTripOriginalMainMasterId12Atom.h \
../Records/RoundTripThemeAtom.h \
../Records/ShapeFlags10Atom.h \
../Records/ShapeFlagsAtom.h \
../Records/SlideAtom.h \
../Records/SlideColorSchemeAtom.h \
../Records/SlideContainer.h \
../Records/SlideListWithText.h \
../Records/SlideNumberMCAtom.h \
../Records/SlidePersistAtom.h \
../Records/SlideViewInfoAtom.h \
../Records/SoundCollAtom.h \
../Records/SoundCollectionContainer.h \
../Records/SoundContainer.h \
../Records/SoundDataBlob.h \
../Records/SSDocInfoAtom.h \
../Records/SSlideLayoutAtom.h \
../Records/SSSlideInfoAtom.h \
../Records/StyleTextPropAtom.h \
../Records/TextBookmarkAtom.h \
../Records/TextBytesAtom.h \
../Records/TextCFExceptionAtom.h \
../Records/TextCharsAtom.h \
../Records/TextFullSettings.h \
../Records/TextHeaderAtom.h \
../Records/TextInteractiveInfoAtom.h \
../Records/TextMasterStyleAtom.h \
../Records/TextPFExceptionAtom.h \
../Records/TextRulerAtom.h \
../Records/TextSIExceptionAtom.h \
../Records/TextSpecInfoAtom.h \
../Records/UserEditAtom.h \
../Records/VBAInfoAtom.h \
../Records/ViewInfoAtom.h \
../Records/ZoomViewInfoAtom.h \
../Records/Animations/AnimationTypes.h \
../Records/Drawing/BitmapBlip.h \
../Records/Drawing/BlipStoreContainer.h \
../Records/Drawing/BlipStoreEntry.h \
../Records/Drawing/ChildAnchor.h \
../Records/Drawing/ClientAnchor.h \
../Records/Drawing/DrawingContainer.h \
../Records/Drawing/DrawingGroup.h \
../Records/Drawing/DrawingRecord.h \
../Records/Drawing/GroupShape.h \
../Records/Drawing/GroupShapeContainer.h \
../Records/Drawing/RegGroupItems.h \
../Records/Drawing/Shape.h \
../Records/Drawing/ShapeContainer.h \
../Records/Drawing/ShapeProperties.h \
../Records/Drawing/TextBox.h \
../../../../ASCPresentationEditor/PPTXWriter/Converter.h \
../../../../ASCPresentationEditor/PPTXWriter/CSS.h \
../../../../ASCPresentationEditor/PPTXWriter/ImageManager.h \
../../../../ASCPresentationEditor/PPTXWriter/ShapeWriter.h \
../../../../ASCPresentationEditor/PPTXWriter/StylesWriter.h \
../../../../ASCOfficeDocFile/pole/pole.h \
../../../../ASCPresentationEditor/OfficeDrawing/Element.h \
../../../../ASCPresentationEditor/OfficeDrawing/ElementProperties.h \
../../../../ASCPresentationEditor/OfficeDrawing/Elements.h \
../../../../ASCPresentationEditor/OfficeDrawing/Layout.h \
../../../../ASCPresentationEditor/OfficeDrawing/Slide.h \
../../../../ASCPresentationEditor/OfficeDrawing/SVGConverter.h \
../../../../ASCPresentationEditor/OfficeDrawing/SVGFramework.h \
../../../../ASCPresentationEditor/OfficeDrawing/SVGTransformer.h \
../../../../ASCPresentationEditor/OfficeDrawing/TextAttributesEx.h \
../../../../ASCPresentationEditor/OfficeDrawing/TextStructures.h \
../../../../ASCPresentationEditor/OfficeDrawing/Theme.h \
../PPTFormatLib.h
SOURCES += \
../Reader/PPTDocumentInfoOneUser.cpp \
../Reader/Records.cpp \
../Reader/SlidePersist.cpp \
../Records/Animations/AnimationTypes.cpp \
../../../../ASCPresentationEditor/PPTXWriter/Converter.cpp \
../../../../ASCPresentationEditor/PPTXWriter/ShapeWriter.cpp \
../../../../ASCOfficeDocFile/pole/pole.cpp \
../../../../ASCPresentationEditor/OfficeDrawing/Elements.cpp \
../../../../ASCPresentationEditor/OfficeDrawing/Layout.cpp \
../../../../ASCPresentationEditor/OfficeDrawing/SVGConverter.cpp \
../../../../ASCPresentationEditor/OfficeDrawing/SVGFramework.cpp \
../../../../ASCPresentationEditor/OfficeDrawing/SVGTransformer.cpp \
../../../../ASCPresentationEditor/OfficeDrawing/TextAttributesEx.cpp \
../../../../ASCPresentationEditor/OfficeDrawing/Theme.cpp \
../PPTFormatLib.cpp

#include "PPTFormatLib.h"
#include "Reader/PPTFileReader.h"
#include "../../../ASCPresentationEditor/PPTXWriter/Converter.h"
#include "../../../ASCOfficeUtils/ASCOfficeUtilsLib/OfficeUtils.h"
#ifndef READMODE
#define READMODE 1
#endif
#ifndef NULLMODE
#define NULLMODE 0
#endif
COfficePPTFile::~COfficePPTFile()
{
CloseFile();
}
BOOL COfficePPTFile::OpenFile(CString sFileName)
{
CloseFile();
POLE::Storage *pStgFrom = new POLE::Storage(sFileName);
if (pStgFrom == NULL) return FALSE;
pStgFrom->open(false,false);
m_pReader = new CPPTFileReader(pStgFrom, m_strTempDirectory);
((CPPTFileReader*)m_pReader)->m_oDocumentInfo.m_strFileDirectory = GetDirectory(sFileName);
if (!((CPPTFileReader*)m_pReader)->IsPowerPoint())
{
CPPTFileReader* r = (CPPTFileReader*)m_pReader; RELEASEOBJECT(r);
m_pReader = NULL;
return FALSE;
}
((CPPTFileReader*)m_pReader)->ReadPersistDirectory();
((CPPTFileReader*)m_pReader)->ReadSlideList();
m_Status = READMODE;
return TRUE;
}
BOOL COfficePPTFile::CloseFile()
{
m_Status = NULLMODE;
CPPTFileReader* r = (CPPTFileReader*)m_pReader; RELEASEOBJECT(r);
m_pReader = NULL;
return S_OK;
}
HRESULT COfficePPTFile::LoadFromFile(CString sSrcFileName, CString sDstPath, CString sXMLOptions)
{
if (m_strTempDirectory.GetLength() < 1)
{
m_strTempDirectory = FileSystem::Directory::GetTempPath();
}
BOOL bRes = OpenFile(sSrcFileName);
if (!bRes)
{
CloseFile();
m_Status = NULLMODE;
return S_FALSE;
}
m_strEditorXml = _T("");
if (0 < ((CPPTFileReader*)m_pReader)->m_oDocumentInfo.m_arUsers.size())
{
m_strEditorXml = ((CPPTFileReader*)m_pReader)->m_oDocumentInfo.m_arUsers[0]->ToXmlEditor2();
}
//////////////////////////////////////
if (m_strEditorXml.GetLength() <1) return S_FALSE;
if (sDstPath.GetLength() > 0)
{
bool bNeedPPTXFile = false;
#if !(defined(_WIN32) || defined (_WIN64)) || defined(_DEBUG)
bNeedPPTXFile = true;
#endif
NSPresentationEditor::CDocument oPresentationEditor;
NSPresentationEditor::CPPTXWriter oPPTXWriter;
oPresentationEditor.LoadFromXML(m_strEditorXml);
oPPTXWriter.m_strTempDirectory = sDstPath;
if (bNeedPPTXFile)
{
oPPTXWriter.m_strTempDirectory = FileSystem::Directory::CreateDirectoryWithUniqueName(m_strTempDirectory);
}
oPPTXWriter.CreateFile(&oPresentationEditor);
oPPTXWriter.CloseFile();
if (bNeedPPTXFile)
{
COfficeUtils oOfficeUtils(NULL);
std::wstring bstrSrcPath = string2std_string(oPPTXWriter.m_strTempDirectory);
std::wstring bstrDstPath = string2std_string(sDstPath);
oOfficeUtils.CompressFileOrDirectory( bstrSrcPath, bstrDstPath, -1 );
FileSystem::Directory::DeleteDirectory(oPPTXWriter.m_strTempDirectory);
}
}
//CloseFile(); нельзя тута- поскольку в Win32 используется PresentationEditor для конвертации xml -> pptx
return S_OK;
}
HRESULT COfficePPTFile::GetAdditionalParam (CString sParamName, VARIANT* ParamValue)
{
if (NULL == ParamValue)
return S_FALSE;
if (_T("EditorXml") == sParamName)
{
#if defined(_WIN32) || defined (_WIN64)
ParamValue->bstrVal = m_strEditorXml.AllocSysString();
#else
ParamValue->bstrVal = m_strEditorXml;
#endif
}
return S_OK;
}
CString COfficePPTFile::GetDirectory(CString strFileName)
{
int nIndex = strFileName.ReverseFind(FILE_SEPARATOR_CHAR);
if (-1 != nIndex)
{
return strFileName.Mid(0, nIndex + 1);
}
return strFileName;
}
#pragma once
#if defined(_WIN32) || defined (_WIN64)
#include <atlbase.h>
#include <atlstr.h>
#else
#include "../../../DesktopEditor/common/ASCVariant.h"
#include "../../../Common/DocxFormat/Source/Base/ASCString.h"
#endif
#include <vector>
class COfficePPTFile
{
public:
COfficePPTFile()
{
m_strTempDirectory = L"";
m_pReader = NULL;
m_Status = 0;
}
~COfficePPTFile();
private:
LONG m_Status;
void* m_pReader;
std::vector<CString> m_arUserSources;
CString m_strEditorXml;
CString m_strTempDirectory;
public:
HRESULT put_TempDirectory(CString sDir)
{
m_strTempDirectory = sDir;
return S_OK;
}
CString get_TempDirectory()
{
return m_strTempDirectory;
}
HRESULT LoadFromFile(CString sSrcFileName, CString sDstPath, CString sXMLOptions);
HRESULT GetAdditionalParam (CString sParamName, VARIANT* ParamValue);
private:
BOOL OpenFile(CString sFileName);
BOOL CloseFile();
CString GetDirectory(CString strFileName);
};
#pragma once
#include "Elements.h"
class CAudioPart
{
public:
CString m_strFile;
double m_dStartTime;
double m_dEndTime;
double m_dClipStartTime;
double m_dClipEndTime;
double m_dAudioDuration;
bool m_bLoop;
bool m_bStop;
bool m_bIsTransition;
double m_dAmplify;
public:
CAudioPart()
{
m_strFile = _T("");
m_dStartTime = 0.0;
m_dEndTime = -1.0;
m_dClipStartTime = 0.0;
m_dClipEndTime = -1.0;
m_dAudioDuration = 0.0;
m_bLoop = false;
m_bStop = false;
m_bIsTransition = false;
m_dAmplify = 100.0;
}
~CAudioPart()
{
}
CAudioPart(const CAudioPart& oSrc)
{
*this = oSrc;
}
CAudioPart& operator=(const CAudioPart& oSrc)
{
m_strFile = oSrc.m_strFile;
m_dStartTime = oSrc.m_dStartTime;
m_dEndTime = oSrc.m_dEndTime;
m_dClipStartTime = oSrc.m_dClipStartTime;
m_dClipEndTime = oSrc.m_dClipEndTime;
m_dAudioDuration = oSrc.m_dAudioDuration;
m_bLoop = oSrc.m_bLoop;
m_bStop = oSrc.m_bStop;
m_bIsTransition = oSrc.m_bIsTransition;
m_dAmplify = oSrc.m_dAmplify;
return *this;
}
CAudioPart(CAudioElement* pAudioElem)
{
if (NULL == pAudioElem)
{
m_strFile = _T("");
m_dStartTime = 0.0;
m_dEndTime = -1.0;
m_dClipStartTime = 0.0;
m_dClipEndTime = -1.0;
m_dAudioDuration = 0.0;
m_bLoop = false;
m_bStop = false;
m_bIsTransition = false;
m_dAmplify = 100.0;
}
else
{
m_strFile = pAudioElem->m_strFileName;
m_dStartTime = pAudioElem->m_dStartTime;
m_dEndTime = pAudioElem->m_dEndTime;
m_dClipStartTime = pAudioElem->m_dClipStartTime;
m_dClipEndTime = pAudioElem->m_dClipEndTime;
m_dAudioDuration = pAudioElem->m_dAudioDuration;
m_bLoop = pAudioElem->m_bLoop;
m_bStop = false;
m_bIsTransition = false;
m_dAmplify = 100.0;
}
}
public:
void CalculateDuration()
{
if (0.0 < m_dAudioDuration || _T("") == m_strFile)
return;
VideoFile::IVideoFile3* pVideoFile = NULL;
if (SUCCEEDED(CoCreateInstance(VideoFile::CLSID_CVideoFile3, NULL, CLSCTX_ALL, VideoFile::IID_IVideoFile3, (void**)(&pVideoFile))))
{
if (NULL != pVideoFile)
{
BSTR bsFile = m_strFile.AllocSysString();
if (S_OK == pVideoFile->OpenFile(bsFile))
{
pVideoFile->get_audioDuration(&m_dAudioDuration);
}
SysFreeString(bsFile);
RELEASEINTERFACE(pVideoFile);
}
}
}
};
class CAudioOverlay
{
public:
CAtlArray<CAudioPart> m_arParts;
double m_dAllDuration;
public:
CAudioOverlay() : m_arParts(), m_dAllDuration(0.0)
{
}
~CAudioOverlay()
{
}
CAudioOverlay(const CAudioOverlay& oSrc)
{
*this = oSrc;
}
CAudioOverlay& operator=(const CAudioOverlay& oSrc)
{
m_arParts.Copy(oSrc.m_arParts);
m_dAllDuration = oSrc.m_dAllDuration;
return *this;
}
public:
void Calculate()
{
size_t nCount = m_arParts.GetCount();
//
for (size_t i = 0; i < nCount; ++i)
{
CAudioPart* pPart = &m_arParts[i];
pPart->CalculateDuration();
if (pPart->m_dStartTime < 0.0)
pPart->m_dStartTime = 0.0;
pPart->m_dEndTime = pPart->m_dStartTime + pPart->m_dAudioDuration;
if (pPart->m_dEndTime > m_dAllDuration)
{
pPart->m_dEndTime = m_dAllDuration;
}
if (pPart->m_bLoop)
{
pPart->m_dEndTime = m_dAllDuration;
}
}
//
for (size_t i = 0; i < nCount; ++i)
{
CAudioPart* pPart = &m_arParts[i];
if (pPart->m_bIsTransition)
{
if (pPart->m_bStop)
{
//
for (size_t j = 0; j < nCount; ++j)
{
if (j == i)
continue;
CAudioPart* pMem = &m_arParts[j];
if (pMem->m_dStartTime <= pPart->m_dStartTime && pMem->m_dEndTime > pPart->m_dStartTime)
{
pMem->m_dEndTime = pPart->m_dStartTime;
}
}
}
if (pPart->m_bLoop)
{
//
double dMin = m_dAllDuration;
for (size_t j = 0; j < nCount; ++j)
{
if (j == i)
continue;
CAudioPart* pMem = &m_arParts[j];
if (pMem->m_dStartTime > pPart->m_dEndTime)
{
if (dMin > pMem->m_dStartTime)
dMin = pMem->m_dStartTime;
}
}
pPart->m_dEndTime = dMin;
}
}
else
{
if (pPart->m_bLoop)
{
pPart->m_dEndTime = m_dAllDuration;
}
}
}
}
CString GetAudioOverlay()
{
CString strRes = _T("");
size_t nCount = m_arParts.GetCount();
for (size_t i = 0; i < nCount; ++i)
{
CAudioPart* pPart = &m_arParts[i];
CString strOverlay1 = _T("");
CString strOverlay2 = _T("");
strOverlay1.Format(_T("<AudioSource StartTime='%lf' Duration='%lf' Amplify='%lf'>"),
pPart->m_dStartTime, pPart->m_dEndTime - pPart->m_dStartTime, pPart->m_dAmplify);
int lIndex = pPart->m_strFile.Find(L"file:///");
if (0 == lIndex)
{
pPart->m_strFile = pPart->m_strFile.Mid(8);
pPart->m_strFile.Replace('/', '\\');
pPart->m_strFile.Replace(L"%20", L" ");
}
CString strFile_ = pPart->m_strFile;
CorrectXmlString(strFile_);
strOverlay2.Format(_T("<Source StartTime='%lf' EndTime='%lf'"), pPart->m_dClipStartTime, pPart->m_dClipEndTime);
strOverlay2 += _(" FilePath=\"") + strFile_ + _T("\">");
strOverlay2 += _T("</AudioSource>");
strOverlay1 += strOverlay2;
strRes += strOverlay1;
}
return strRes;
}
};
#pragma once
#include "../Records/CurrentUserAtom.h"
using namespace NSOfficePPT;
class CUserEdit
{
public:
DWORD m_nOffsetLastEdit;
DWORD m_nOffsetPersistDirectory;
DWORD m_nDocumentRef;
DWORD m_nMaxPersistWritten;
public:
CUserEdit()
{
m_nOffsetLastEdit = 0;
m_nOffsetPersistDirectory = 0;
m_nDocumentRef = 0;
m_nMaxPersistWritten = 0;
}
~CUserEdit()
{
}
CUserEdit& operator =(const CUserEdit& oSrc)
{
m_nOffsetLastEdit = oSrc.m_nOffsetLastEdit;
m_nOffsetPersistDirectory = oSrc.m_nOffsetPersistDirectory;
m_nDocumentRef = oSrc.m_nDocumentRef;
m_nMaxPersistWritten = oSrc.m_nMaxPersistWritten;
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;
}
};
class CCurrentUser
{
public:
bool m_bIsEncrypt;
DWORD m_nOffsetToCurrentEdit;
CStringW m_strName;
public:
CCurrentUser()
{
m_bIsEncrypt = false;
m_nOffsetToCurrentEdit = 0;
m_strName = _T("");
}
~CCurrentUser()
{
}
CCurrentUser& operator =(const CCurrentUser& oSrc)
{
m_bIsEncrypt = oSrc.m_bIsEncrypt;
m_nOffsetToCurrentEdit = oSrc.m_nOffsetToCurrentEdit;
m_strName = oSrc.m_strName;
return (*this);
}
void FromAtom(CRecordCurrentUserAtom* pAtom)
{
m_bIsEncrypt = (NO_ENCRYPT == pAtom->m_nToken);
m_nOffsetToCurrentEdit = pAtom->m_nOffsetToCurEdit;
m_strName = pAtom->m_strUNICODEUserName;
}
CString ToString()
{
CString str = _T("<CurrentUser Name='") + (CString)m_strName + _T("' />");
return str;
}
};
///----------- constants----------
const int MST_FLAG_OBJECTS = 0x01;
const int MST_FLAG_SCHEME = 0x02;
const int MST_FLAG_BACKGROUND = 0x04;
#define MAX_OBJECTS_IN_LAYOUT 8
const int S_HEADERFOOTER_DATE = 0x01;
const int S_HEADERFOOTER_TODAYDATE = 0x02;
const int S_HEADERFOOTER_USERDATE = 0x04;
const int S_HEADERFOOTER_SLIDENUMBER = 0x08;
const int S_HEADERFOOTER_HEADER = 0x10;
const int S_HEADERFOOTER_FOOTER = 0x20;
#define PSR_NAMEDSHOW_SIZE 32
//---------------------------------
struct SDocInfoAtom
{
SColorAtom PenColor;
INT RestartTime;
SHORT StartSlide;
SHORT EndSlide;
USHORT NamedShow[PSR_NAMEDSHOW_SIZE];
BYTE Flags;
};
struct SSlideInfoAtom
{
INT SlideTime; // how long to show the slide in ticks
UINT SoundRef;
USHORT Effect; // type of transition (2 character signature)
USHORT Flags; // set of flags that determine type of build
BYTE Speed; // speed of transition
};
struct PSR_AnimationInfoAtom
{
SColorAtom DimColor;
UINT Flags;
UINT SoundRef;
USHORT OrderID;
USHORT DelayTime;
USHORT SlideCount;
BYTE BuildType;
BYTE FlyMethod;
BYTE FlyDirection;
BYTE AfterEffect;
BYTE SubEffect;
BYTE OleVerb;
};
struct SInteractiveInfoAtom
{
UINT SoundRef;
UINT ExHyperlinkID;
BYTE Action;
BYTE OleVerb;
BYTE Jump;
BYTE Flags;
};
#pragma once
// zlib - .
// -
#include <zlib.h>
#pragma comment(lib, "zlib.lib")
namespace NSZLib
{
static BOOL Decompress(const BYTE* pSrcBuffer, const ULONG& lSrcBufferLen,
BYTE* pDstBuffer, ULONG& lDstBufferLen)
{
try
{
if (Z_OK == uncompress(pDstBuffer, &lDstBufferLen, pSrcBuffer, lSrcBufferLen))
{
return TRUE;
}
}
catch(...)
{
}
return FALSE;
}
}
\ No newline at end of file
#pragma once
#include "PPTDocumentInfoOneUser.h"
class CPPTDocumentInfo
{
public:
CCurrentUser m_oCurrentUser;
std::vector<CPPTUserInfo*> m_arUsers;
CString m_strFileDirectory;
public:
CPPTDocumentInfo() : m_oCurrentUser(), m_arUsers()
{
m_strFileDirectory = _T("");
}
~CPPTDocumentInfo()
{
Clear();
}
void Clear()
{
size_t nCount = m_arUsers.size();
while(0 != nCount)
{
if (NULL != m_arUsers[nCount-1])
delete m_arUsers[nCount-1];
m_arUsers.pop_back();
--nCount;
}
}
void ReadFromStream(CRecordCurrentUserAtom* pCurrentUser, POLE::Stream* pStream, CStringW strFolderMem)
{
m_oCurrentUser.FromAtom(pCurrentUser);
DWORD offsetToEdit = m_oCurrentUser.m_nOffsetToCurrentEdit;
SRecordHeader oHeader;
CRecordUserEditAtom oUserAtom;
Clear();
size_t nCountUsers = 0;
while (0 < offsetToEdit)
{
StreamUtils::StreamSeek(offsetToEdit, pStream);
oHeader.ReadFromStream(pStream);
oUserAtom.ReadFromStream(oHeader, pStream);
CPPTUserInfo* pInfo = new CPPTUserInfo();
pInfo->m_strFileDirectory = m_strFileDirectory;
BOOL bRes = pInfo->ReadFromStream(&oUserAtom, pStream, strFolderMem);
offsetToEdit = pInfo->m_oUser.m_nOffsetLastEdit;
if (!bRes)
{
delete pInfo;
continue;
}
m_arUsers.push_back(pInfo);
//
pInfo->m_pDocumentInfo = this;
pInfo->m_lIndexThisUser = m_arUsers.size() - 1;
pInfo = NULL;
}
// , blip. -
LONG lCount = m_arUsers.size();
if (1 < lCount)
{
m_arUsers[0]->m_arEmptyPictures = m_arUsers[lCount - 1]->m_arEmptyPictures;
}
// FromDocument...
for (size_t i = 0; i < m_arUsers.size(); ++i)
{
m_arUsers[i]->FromDocument();
}
#ifdef _DEBUG
SaveXmlInfo();
#endif
}
void SaveXmlInfo()
{
if (!PPT_DUMP_LOG)
return;
XmlUtils::CXmlWriter oWriter;
oWriter.WriteNodeBegin(_T("PPTInfo"));
oWriter.WriteString(m_oCurrentUser.ToString());
for (size_t nIndex = 0; nIndex < m_arUsers.size(); ++nIndex)
{
oWriter.WriteString(m_arUsers[nIndex]->m_strXmlInfo);
}
oWriter.WriteNodeEnd(_T("PPTInfo"));
//CDirectory::SaveToFile(_T("C:\\PPTInfo.xml"), oWriter.GetXmlString());
oWriter.SaveToFile(_T("C:\\PPTInfo.xml"), TRUE);
}
LONG GetCountPicturesUsed(size_t nUser)
{
LONG lRes = 0;
for (size_t i = 0; i < m_arUsers[nUser]->m_arEmptyPictures.size(); ++i)
{
if (!m_arUsers[nUser]->m_arEmptyPictures[i])
++lRes;
}
return lRes;
}
};
\ No newline at end of file
#include "PPTDocumentInfo.h"
#include "../Records/ExMIDIAudioContainer.h"
#include "../Records/ExCDAudioContainer.h"
#include "../Records/ExWAVAudioLinkContainer.h"
#include "../Records/ExWAVAudioEmbeddedContainer.h"
#include "../Records/ExObjListContainer.h"
#include "../Records/SoundCollectionContainer.h"
#include "../Records/SoundContainer.h"
CPPTUserInfo::CPPTUserInfo() : CDocument(),
m_oUser(),
m_mapOffsetInPIDs(),
m_oDocument(),
m_mapMasters(),
m_mapNotes(),
m_mapSlides(),
m_arEmptyPictures()
{
m_pDocumentInfo = NULL;
m_lIndexThisUser = -1;
m_nWriteSlideTimeOffset = 0.0;
m_nWriteSlideTime = 0.0;
m_strFileDirectory = _T("");
m_bIsSetupEmpty = FALSE;
}
CPPTUserInfo::~CPPTUserInfo()
{
Clear();
}
void CPPTUserInfo::Clear()
{
CDocument::Clear();
for (std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapSlides.begin(); pPair != m_mapSlides.end(); ++pPair)
{
RELEASEINTERFACE(pPair->second);
}
m_mapSlides.clear();
m_arrSlidesOrder.clear();
for (std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapMasters.begin(); pPair != m_mapMasters.end(); ++pPair)
{
RELEASEINTERFACE(pPair->second);
}
m_mapMasters.clear();
m_arrMastersOrder.clear();
for (std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapNotes.begin(); pPair != m_mapNotes.end(); ++pPair)
{
RELEASEINTERFACE(pPair->second);
}
m_mapNotes.clear();
m_arrNotesOrder.clear();
m_oExMedia.Clear();
m_arrFonts.clear();
for (int nIndex = 0; nIndex < m_mapAnimations.size(); ++nIndex)
{
RELEASEOBJECT ( m_mapAnimations[nIndex]);
}
m_mapAnimations.clear();
m_mapTransitions.clear ();
m_arEmptyPictures.clear();
}
BOOL CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStream, CStringW strFolderMem)
{
m_oUser.FromAtom(pUser);
SRecordHeader oHeader;
CRecordUserEditAtom oUserAtom;
StreamUtils::StreamSeek(m_oUser.m_nOffsetPersistDirectory, pStream);
oHeader.ReadFromStream(pStream);
if (RECORD_TYPE_PERSISTPTRINCREMENTALBLOCK != oHeader.RecType)
{
return FALSE;
}
CRecordPersistDirectoryAtom oPersist;
oPersist.ReadFromStream(oHeader, pStream);
oPersist.ToMap(&m_mapOffsetInPIDs);
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);
if (RECORD_TYPE_DOCUMENT != oHeader.RecType)
{
return FALSE;
}
m_oDocument.ReadFromStream(oHeader, pStream);
Clear();
for (size_t index = 0; index < m_oDocument.m_arMasterPersists.size(); ++index)
{
std::map<DWORD, DWORD>::iterator nPsrRef = m_mapOffsetInPIDs.find(m_oDocument.m_arMasterPersists[index].m_nPsrRef);
if (nPsrRef != m_mapOffsetInPIDs.end())
{
long offset = (long)nPsrRef->second;
StreamUtils::StreamSeek(offset, pStream);
oHeader.ReadFromStream(pStream);
CRecordSlide* pSlide = new CRecordSlide();
pSlide->ReadFromStream(oHeader, pStream);
pSlide->m_oPersist = m_oDocument.m_arMasterPersists[index];
pSlide->m_Index = m_mapMasters.size();
m_mapMasters.insert(m_mapMasters.end(), std::pair<DWORD, CRecordSlide*>(m_oDocument.m_arMasterPersists[index].m_nSlideID, pSlide));
pSlide = NULL;
}
else
{
m_mapMasters.insert(m_mapMasters.end(), std::pair<DWORD, CRecordSlide*>(m_oDocument.m_arMasterPersists[index].m_nSlideID, NULL));
}
m_arrMastersOrder.push_back(m_oDocument.m_arMasterPersists[index].m_nSlideID);
}
for (size_t index = 0; index < m_oDocument.m_arNotePersists.size(); ++index)
{
std::map<DWORD, DWORD>::iterator nIndexPsrRef = m_mapOffsetInPIDs.find(m_oDocument.m_arNotePersists[index].m_nPsrRef);
if (m_mapOffsetInPIDs.end() != nIndexPsrRef)
{
long offset = (long)nIndexPsrRef->second;
StreamUtils::StreamSeek(offset, pStream);
oHeader.ReadFromStream(pStream);
CRecordSlide* pSlide = new CRecordSlide();
pSlide->ReadFromStream(oHeader, pStream);
pSlide->m_oPersist = m_oDocument.m_arNotePersists[index];
pSlide->m_Index = m_mapNotes.size();
m_mapNotes.insert(std::pair<DWORD, CRecordSlide*>(m_oDocument.m_arNotePersists[index].m_nSlideID, pSlide));
pSlide = NULL;
}
else
{
m_mapNotes.insert(std::pair<DWORD, CRecordSlide*>(m_oDocument.m_arNotePersists[index].m_nSlideID, NULL));
}
m_arrNotesOrder.push_back(m_oDocument.m_arNotePersists[index].m_nSlideID);
}
for (size_t index = 0; index < m_oDocument.m_arSlidePersists.size(); ++index)
{
std::map<DWORD, DWORD>::iterator nIndexPsrRef = m_mapOffsetInPIDs.find(m_oDocument.m_arSlidePersists[index].m_nPsrRef);
if (m_mapOffsetInPIDs.end() != nIndexPsrRef)
{
long offset = (long)nIndexPsrRef->second;
StreamUtils::StreamSeek(offset, pStream);
oHeader.ReadFromStream(pStream);
CRecordSlide* pSlide = new CRecordSlide();
pSlide->ReadFromStream(oHeader, pStream);
pSlide->m_oPersist = m_oDocument.m_arSlidePersists[index];
pSlide->m_Index = m_mapSlides.size(); // in m_arrSlidesOrder
m_mapSlides.insert( std::pair<DWORD, CRecordSlide*>(m_oDocument.m_arSlidePersists[index].m_nSlideID, pSlide ));
if ( pSlide->m_bExistsTransition )
{
m_mapTransitions.insert (std::pair<DWORD, CSlideShowSlideInfoAtom>( (DWORD)index, pSlide->m_oSlideShowSlideInfoAtom ));
}
if ( pSlide->m_pSlideProgTagsContainer )
{
Animations::CSlideTimeLine* pEffects = pSlide->m_pSlideProgTagsContainer->GetTimeLine ();
if (pEffects)
{
m_mapAnimations.insert(std::pair<DWORD, Animations::CSlideTimeLine*>((DWORD)index, pEffects));
}
}
}
else
{
m_mapSlides.insert( std::pair<DWORD, CRecordSlide*>(m_oDocument.m_arSlidePersists[index].m_nSlideID, NULL));
}
m_arrSlidesOrder.push_back(m_oDocument.m_arSlidePersists[index].m_nSlideID);
}
// ... ExObject -----------------------------
m_oExMedia.m_strPresentationDirectory = strFolderMem;
m_oExMedia.m_strSourceDirectory = m_strFileDirectory;
NSPresentationEditor::CExFilesInfo oInfo;
oInfo.m_strFilePath = m_oExMedia.m_strPresentationDirectory;
oInfo.m_dwID = 0xFFFFFFFF;
m_oExMedia.m_arImages.push_back(oInfo);
//
std::vector<CRecordExObjListContainer*> oArrayExObjects;
m_oDocument.GetRecordsByType(&oArrayExObjects, false, true);
if (0 != oArrayExObjects.size())
{
LoadExternal(oArrayExObjects[0]);
}
else
{
// ,
//
LoadExternal(NULL);
}
// -------------------------------------------------------------------
//
std::vector<CRecordFontEntityAtom*> oArrayFonts;
m_oDocument.GetRecordsByType(&oArrayFonts, true);
for (int nIndex = 0; nIndex < oArrayFonts.size(); ++nIndex)
{
CFont oFont;
oFont.Name = (CString)oArrayFonts[nIndex]->m_strFaceName;
oFont.Charset = oArrayFonts[nIndex]->m_lfCharSet;
switch (oArrayFonts[nIndex]->m_lfPitchAndFamily / 0x10)
{
case 1: {oFont.PitchFamily = _T("roman"); break;}
case 2: {oFont.PitchFamily = _T("swiss"); break;}
case 3: {oFont.PitchFamily = _T("modern"); break;}
case 4: {oFont.PitchFamily = _T("script"); break;}
case 5: {oFont.PitchFamily = _T("decorative"); break;}
default: {oFont.PitchFamily = _T("unknown"); break;}
}
m_arrFonts.push_back(oFont);
}
UpdateXMLInfo();
//FromDocument();
// FromDocument - , (!!!)
//
//
std::vector<CRecordBlipStoreContainer*> oArray;
m_oDocument.GetRecordsByType(&oArray, true, true);
if (0 < oArray.size())
{
m_bIsSetupEmpty = TRUE;
oArray[0]->SetUpEmptyInfos(&m_arEmptyPictures);
}
return TRUE;
}
void CPPTUserInfo::FromDocument()
{
UpdateXMLInfo();
m_arSlides.clear();
//
// , ...
std::vector<CRecordDocumentAtom*> oArrayDoc;
m_oDocument.GetRecordsByType(&oArrayDoc, true, true);
if (0 == oArrayDoc.size())
return;
std::vector<CRecordDocumentTextInfo*> oArrayInfo;
m_oDocument.GetRecordsByType(&oArrayInfo, false, true);
if (0 != oArrayInfo.size())
{
std::vector<CRecordTextMasterStyleAtom*> oStyles;
oArrayInfo[0]->GetRecordsByType(&oStyles, false, false);
if (0 != oStyles.size())
m_oDefaultTextStyle.SetStyles((NSPresentationEditor::CTextStyles*)oStyles[0]);
}
LONG lOriginWidth = oArrayDoc[0]->m_oSlideSize.X;
LONG lOriginHeight = oArrayDoc[0]->m_oSlideSize.Y;
m_oInfo.m_lUnitsHor = lOriginWidth;
m_oInfo.m_lUnitsVer = lOriginHeight;
m_oInfo.m_lMillimetresHor = (LONG)(c_dMasterUnitsToMillimetreKoef * lOriginWidth);
m_oInfo.m_lMillimetresVer = (LONG)(c_dMasterUnitsToMillimetreKoef * lOriginHeight);
LoadMasters(lOriginWidth, lOriginHeight);
double DurationSlide = PPT_DEFAULT_SLIDE_DURATION;
//for (std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapSlides.begin(); pPair != m_mapSlides.end(); ++pPair)
for (int i=0; i< m_arrSlidesOrder.size(); i++)
{
std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapSlides.find(m_arrSlidesOrder[i]);
if (pPair == m_mapSlides.end())
continue;
LoadSlideFromPrevUsers ( pPair->first );
DurationSlide = PPT_DEFAULT_SLIDE_DURATION;
CSlide elm;
m_arSlides.push_back(elm);
// ...
//
std::map <DWORD, Animations::CSlideTimeLine*>::iterator pTimeLine = m_mapAnimations.find( pPair->first);
if ( m_mapAnimations.end() != pTimeLine )
{
if ( (pTimeLine->second) && (0.0 != pTimeLine->second->GetTime () ))
{
DurationSlide = pTimeLine->second->GetTime ();
}
}
CSlide* pSlide = &m_arSlides.back();
pSlide->m_dStartTime = 0.0;
pSlide->m_dEndTime = DurationSlide;
pSlide->m_dDuration = DurationSlide;
pSlide->m_lOriginalWidth = lOriginWidth;
pSlide->m_lOriginalHeight = lOriginHeight;
pSlide->m_lWidth = (LONG)(c_dMasterUnitsToMillimetreKoef * lOriginWidth);
pSlide->m_lHeight = (LONG)(c_dMasterUnitsToMillimetreKoef * lOriginHeight);
LoadSlide ( pPair->first, &m_arSlides.back());
}
CalculateEditor(m_oInfo);
}
void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
{
std::map<DWORD, CRecordSlide*>::iterator pPairSlide = m_mapSlides.find(dwSlideID);
if (pPairSlide == m_mapSlides.end()) return;
CRecordSlide* pRecordSlide = pPairSlide->second;
if (NULL == pRecordSlide) return;
//
CTransition* pTransition = &pSlide->m_oSlideShow.m_oTransition;
if (pRecordSlide->m_bExistsTransition)
{
CSlideShowSlideInfoAtom* pAtom = &pRecordSlide->m_oSlideShowSlideInfoAtom;
pTransition->m_bAudioPresent = pAtom->m_bSound;
NSPresentationEditor::CExFilesInfo* pInfo = m_oExMedia.LockAudioFromCollection(pAtom->m_nSoundRef);
if (NULL != pInfo)
{
pTransition->m_oAudio.m_strFileName = pInfo->m_strFilePath;
}
pTransition->m_bLoopSound = pAtom->m_bLoopSound;
pTransition->m_bStopSound = pAtom->m_bStopSound;
pTransition->m_nEffectDirection = pAtom->m_nEffectDirection;
pTransition->m_nEffectType = pAtom->m_nEffectType; //
pSlide->m_oSlideShow.m_dSlideDuration = pAtom->m_nSlideTime;
switch (pAtom->m_nSpeed)
{
case 0x00:
pTransition->m_dSpeed = 750.0;
break;
case 0x01:
pTransition->m_dSpeed = 500.0;
break;
case 0x02:
pTransition->m_dSpeed = 250.0;
break;
default:
pTransition->m_dSpeed = 500.0;
break;
};
}
else
{
pTransition->m_dSpeed = 0.0;
}
CSlideShowSlideInfoAtom* pAtom = &pRecordSlide->m_oSlideShowSlideInfoAtom;
if (pAtom->m_bSound)
{
NSPresentationEditor::CExFilesInfo* pInfo = m_oExMedia.LockAudioFromCollection(pAtom->m_nSoundRef);
if (NULL != pInfo)
AddAudioTransition (dwSlideID, pTransition, pInfo->m_strFilePath);
}
//
pSlide->m_bUseLayoutColorScheme = true;
CSlideInfo slide_info;
m_arSlideWrapper.push_back(slide_info);
CSlideInfo* pSlideWrapper = &m_arSlideWrapper.back();
pSlideWrapper->m_parEmptyPictures = &m_arEmptyPictures;
// , placeholder
pSlideWrapper->m_arTextPlaceHolders = pRecordSlide->m_oPersist.m_arTextAttrs;
//
std::vector<CRecordSlideAtom*> oArrayAtoms;
pRecordSlide->GetRecordsByType(&oArrayAtoms, false, true);
if (0 == oArrayAtoms.size())
{
// !!!
return;
}
std::map<DWORD, LONG>::iterator pPair = m_mapMasterToTheme.find(oArrayAtoms[0]->m_nMasterIDRef);
if (pPair == m_mapMasterToTheme.end())
{
//?????
}
pSlide->m_lThemeID = pPair->second;
pPair = m_mapMasterToLayout.find(oArrayAtoms[0]->m_nMasterIDRef);
if (pPair == m_mapMasterToLayout.end())
{
//?????
}
pSlide->m_lLayoutID = pPair->second;
CSlideInfo* pThemeWrapper = &m_arMasterWrapper[pSlide->m_lThemeID];
CTheme* pTheme = &m_arThemes[pSlide->m_lThemeID];
CLayout* pLayout = &pTheme->m_arLayouts[pSlide->m_lLayoutID];
std::vector<NSPresentationEditor::CColor>* pArrayColorScheme = &pTheme->m_arColorScheme;
if (!pLayout->m_bUseThemeColorScheme)
pArrayColorScheme = &pLayout->m_arColorScheme;
////todoooooo
//int idxTheme = pSlide->m_lThemeID;
//CSlideInfo* pThemeWrapper = NULL;
//CTheme* pTheme = NULL;
//CLayout* pLayout = NULL;
//if (idxTheme < m_arMasterWrapper.size())
// pThemeWrapper = &m_arMasterWrapper[pSlide->m_lThemeID];
//if (idxTheme < m_arThemes.size())
// pTheme = &m_arThemes[idxTheme];
//int idxLayout = pSlide->m_lLayoutID;
//if (pTheme)
//{
// if (idxLayout < pTheme->m_arLayouts.size())
// pLayout = &pTheme->m_arLayouts[idxLayout];
//}
//std::vector<NSPresentationEditor::CColor>* pArrayColorScheme;
//if (pLayout)
//{
// pArrayColorScheme = &pTheme->m_arColorScheme;
// if (!pLayout->m_bUseThemeColorScheme)
// pArrayColorScheme = &pLayout->m_arColorScheme;
//}
// -----------------------------------------------------------
pSlide->m_bUseLayoutColorScheme = true;
if (!oArrayAtoms[0]->m_bMasterScheme)
{
std::vector<CRecordColorSchemeAtom*> oArrayColors;
pRecordSlide->GetRecordsByType(&oArrayColors, false);
for (int i = 0; i < oArrayColors.size(); ++i)
{
if (0x01 == oArrayColors[i]->m_oHeader.RecInstance)
{
pSlide->m_bUseLayoutColorScheme = false;
oArrayColors[i]->ToArray(&pSlide->m_arColorScheme);
CorrectColorScheme(pSlide->m_arColorScheme);
//
size_t nCountC = pSlide->m_arColorScheme.size();
size_t nIndexC = 0;
if (nCountC == pArrayColorScheme->size())
{
for (; nIndexC < nCountC; ++nIndexC)
{
if (pSlide->m_arColorScheme[i].IsEqual(pArrayColorScheme->at(i)))
break;
}
}
if (nIndexC == nCountC)
{
pSlide->m_bUseLayoutColorScheme = true;
pSlide->m_arColorScheme.clear();
}
break;
}
}
}
// ---------------------------------------------------------------------------------
// ...
std::vector<CRecordShapeContainer*> oArrayShapes;
pRecordSlide->GetRecordsByType(&oArrayShapes, true);
pSlide->m_bShowMasterShapes = (TRUE == oArrayAtoms[0]->m_bMasterObjects);
pSlide->m_bIsBackground = false;
for (int nShape = 0; nShape < oArrayShapes.size(); ++nShape)
{
IElement* pElem = NULL;
oArrayShapes[nShape]->GetElement(&pElem, &m_oExMedia, pSlide->m_lOriginalWidth, pSlide->m_lOriginalHeight,
pTheme, pLayout, pThemeWrapper, pSlideWrapper, pSlide);
if (NULL != pElem)
{
AddAnimation ( dwSlideID, pSlide->m_lOriginalWidth, pSlide->m_lOriginalHeight, pElem );
if (pElem->m_bIsBackground)
{
if (!oArrayAtoms[0]->m_bMasterBackground)
{
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElem);
if (NULL != pShape)
{
pShape->SetupProperties(pSlide, pTheme, pLayout);
pSlide->m_bIsBackground = true;
pSlide->m_oBackground = pShape->m_oShape.m_oBrush;
}
}
RELEASEINTERFACE(pElem);
continue;
}
pSlide->m_arElements.push_back(pElem);
}
}
}
void CPPTUserInfo::LoadMainMaster(DWORD dwMasterID, const LONG& lOriginWidth, const LONG& lOriginHeight)
{
std::map<DWORD, LONG>::iterator pPair = m_mapMasterToTheme.find(dwMasterID);
if (pPair != m_mapMasterToTheme.end())
{
//
return;
}
LoadMasterFromPrevUsers(dwMasterID);
std::map<DWORD, CRecordSlide*>::iterator pPairMaster = m_mapMasters.find(dwMasterID);
if (m_mapMasters.end() == pPairMaster)
return;
std::vector<CRecordSlideAtom*> oArraySlideAtoms;
CRecordSlide* pMaster = pPairMaster->second;
if (pMaster == NULL)
return; //todooo 20080720.ppt
pMaster->GetRecordsByType(&oArraySlideAtoms, true);
if (0 == oArraySlideAtoms.size())
return;
DWORD dwID = (DWORD)oArraySlideAtoms[0]->m_nMasterIDRef;
if (0 != dwID)
{
// - main!!!
// main, - title
// title .
return;
}
std::vector<CRecordTripOriginalMasterId12Atom*> oArrayOrigId;
pMaster->GetRecordsByType(&oArrayOrigId, false, true);
if (0 != oArrayOrigId.size())
m_mapMasterOriginalIds.insert(std::pair<DWORD, DWORD>(oArrayOrigId[0]->m_dwID, dwMasterID));
std::vector<CRecordTripCompositeMasterId12Atom*> oArrayCompId;
pMaster->GetRecordsByType(&oArrayCompId, false, true);
if (0 != oArrayCompId.size())
{
// - main!!!
// main, - title
// title .
return;
}
LONG lIndexTheme = (LONG)m_arThemes.size();
m_mapMasterToTheme.insert(std::pair<DWORD, LONG>(dwMasterID, lIndexTheme));
m_mapMasterToLayout.insert(std::pair<DWORD, LONG>(dwMasterID, 0));
CTheme theme;
m_arThemes.push_back(theme);
CTheme* pTheme = &m_arThemes[lIndexTheme];
CLayout layout;
pTheme->m_arLayouts.push_back(layout);
CLayout* pLayout = &pTheme->m_arLayouts.back();
CSlideInfo slide_info;
m_arMasterWrapper.push_back(slide_info);
CSlideInfo* pMasterWrapper = &m_arMasterWrapper[lIndexTheme];
// ---------------------------------------------------------------
int nCountFonts = m_arrFonts.size();
for (int i = 0; i < nCountFonts; ++i)
{
pTheme->m_arFonts.push_back(m_arrFonts[i]);
}
// ---------------------------------------------------------------------------------
// -----------------------------------------------------------
std::vector<CRecordColorSchemeAtom*> oArrayColors;
pMaster->GetRecordsByType(&oArrayColors, false);
int nColorCount = oArrayColors.size();
for (int i = 0; i < nColorCount; ++i)
{
if (0x01 == oArrayColors[i]->m_oHeader.RecInstance)
{
oArrayColors[i]->ToArray(&pTheme->m_arColorScheme);
oArrayColors[i]->ToArray(&m_oSchemeColors);
}
}
CorrectColorScheme(pTheme->m_arColorScheme);
// ---------------------------------------------------------------------------------
// , placeholder
std::map<DWORD, CRecordSlide*>::iterator pPairMaster1 = m_mapMasters.find(dwMasterID);
if (pPairMaster1 != m_mapMasters.end())
{
pMasterWrapper->m_arTextPlaceHolders = pPairMaster1->second->m_oPersist.m_arTextAttrs;
}
pMasterWrapper->m_parEmptyPictures = &m_arEmptyPictures;
// -----------------------------------------------
std::vector<CRecordTextMasterStyleAtom*> oArrayTextMasters;
pMaster->GetRecordsByType(&oArrayTextMasters, true, false);
for (int i = 0; i < oArrayTextMasters.size(); ++i)
{
LONG lType = (LONG)oArrayTextMasters[i]->m_oHeader.RecInstance;
if ((0 > lType) || (lType > 8))
continue;
pMasterWrapper->m_pStyles[lType] = new NSPresentationEditor::CTextStyles();
pMasterWrapper->m_pStyles[lType]->SetStyles((NSPresentationEditor::CTextStyles*)oArrayTextMasters[i]);
CTheme::CalculateStyle(pTheme, pMasterWrapper->m_pStyles[lType].get());
}
if (pMasterWrapper->m_pStyles[3].is_init())
pMasterWrapper->m_pStyles[3]->ApplyBefore(m_oDefaultTextStyle);
else
pMasterWrapper->m_pStyles[3] = m_oDefaultTextStyle;
CTextStyles oPPTDefaultStyle;
CreateDefaultStyle(oPPTDefaultStyle, pTheme);
oPPTDefaultStyle.ApplyAfter(m_oDefaultTextStyle);
//
pTheme->m_pStyles[0] = oPPTDefaultStyle;
pTheme->m_pStyles[1] = oPPTDefaultStyle;
pTheme->m_pStyles[2] = oPPTDefaultStyle;
pTheme->m_pStyles[3] = oPPTDefaultStyle;
if (pMasterWrapper->m_pStyles[0].is_init())
pTheme->m_pStyles[1].ApplyAfter(pMasterWrapper->m_pStyles[0].get());
if (pMasterWrapper->m_pStyles[1].is_init())
pTheme->m_pStyles[2].ApplyAfter(pMasterWrapper->m_pStyles[1].get());
if (pMasterWrapper->m_pStyles[2].is_init())
pTheme->m_pStyles[3].ApplyAfter(pMasterWrapper->m_pStyles[3].get());
// ---------------------------------------------------------------------------------
pLayout->m_lOriginalWidth = lOriginWidth;
pLayout->m_lOriginalHeight = lOriginHeight;
pLayout->m_lWidth = (LONG)(c_dMasterUnitsToMillimetreKoef * lOriginWidth);
pLayout->m_lHeight = (LONG)(c_dMasterUnitsToMillimetreKoef * lOriginHeight);
pLayout->m_bUseThemeColorScheme = true;
pLayout->m_bShowMasterShapes = true;
pLayout->m_strLayoutType = ConvertLayoutType(oArraySlideAtoms[0]->m_oLayout.m_nGeom, oArraySlideAtoms[0]->m_oLayout.m_pPlaceHolderID);
// ...-----------------------------------------------------------
std::vector<CRecordShapeContainer*> oArrayShapes;
pMaster->GetRecordsByType(&oArrayShapes, true);
pTheme->CalculateStyles();
for (int nShape = 0; nShape < oArrayShapes.size(); ++nShape)
{
NSPresentationEditor::IElement* pElem = NULL;
oArrayShapes[nShape]->GetElement(&pElem, &m_oExMedia, lOriginWidth, lOriginHeight, pTheme, pLayout, pMasterWrapper, pMasterWrapper);
if (NULL != pElem)
{
AddAnimation ( dwMasterID, lOriginWidth, lOriginHeight, pElem );
if (pElem->m_bIsBackground)
{
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElem);
if (NULL != pShape)
{
pShape->SetupProperties(NULL, pTheme, pLayout);
pTheme->m_bIsBackground = true;
pTheme->m_oBackground = pShape->m_oShape.m_oBrush;
}
RELEASEINTERFACE(pElem);
continue;
}
if (-1 == pElem->m_lPlaceholderType)
pTheme->m_arElements.push_back(pElem);
else
pLayout->m_arElements.push_back(pElem);
}
}
}
void CPPTUserInfo::LoadMasters(const LONG& lOriginWidth, const LONG& lOriginHeight)
{
//for (std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapMasters.begin(); pPair != m_mapMasters.end(); ++pPair)
for (long i=0; i< m_arrMastersOrder.size(); i++)
{
std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapMasters.find(m_arrMastersOrder[i]);
if (pPair == m_mapMasters.end())continue;
LoadMainMaster(pPair->first, lOriginWidth, lOriginHeight);
}
//for (std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapMasters.begin(); pPair != m_mapMasters.end(); ++pPair)
for (long i=0; i< m_arrMastersOrder.size(); i++)
{
std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapMasters.find(m_arrMastersOrder[i]);
if (pPair == m_mapMasters.end())continue;
LoadNoMainMaster(pPair->first, lOriginWidth, lOriginHeight);
}
}
void CPPTUserInfo::LoadNoMainMaster(DWORD dwMasterID, const LONG& lOriginWidth, const LONG& lOriginHeight)
{
std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapMasters.find(dwMasterID);
if (pPair == m_mapMasters.end())
return;
CRecordSlide* pCurMaster = pPair->second;
if (pCurMaster == NULL)
return;
DWORD dwCurID = pCurMaster->m_oPersist.m_nSlideID;
std::vector<CRecordSlideAtom*> oArraySlideAtoms;
pCurMaster->GetRecordsByType(&oArraySlideAtoms, true);
if (0 == oArraySlideAtoms.size())
return;
BOOL bMasterColorScheme = oArraySlideAtoms[0]->m_bMasterScheme;
BOOL bMasterBackGround = oArraySlideAtoms[0]->m_bMasterBackground;
BOOL bMasterObjects = oArraySlideAtoms[0]->m_bMasterObjects;
DWORD dwID = (DWORD)oArraySlideAtoms[0]->m_nMasterIDRef;
if (0 == dwID)
{
std::vector<CRecordTripCompositeMasterId12Atom*> oArrayCompId;
pCurMaster->GetRecordsByType(&oArrayCompId, false, true);
if (0 != oArrayCompId.size())
{
std::map<DWORD, DWORD>::iterator pPair1 = m_mapMasterOriginalIds.find(oArrayCompId[0]->m_dwID);
if (m_mapMasterOriginalIds.end() != pPair1)
{
dwID = pPair1->second;
}
}
}
// , MainMaster -
if (0 == dwID)
{
// !!!
return;
}
// LoadSlide
std::map<DWORD, LONG>::iterator pPairTheme = m_mapMasterToTheme.find(dwID);
if (m_mapMasterToTheme.end() == pPairTheme)
return;
CTheme* pTheme = &m_arThemes[pPairTheme->second];
LONG lIndexLayout = (LONG)pTheme->m_arLayouts.size();
m_mapMasterToTheme[dwCurID] = pPairTheme->second;
m_mapMasterToLayout[dwCurID] = lIndexLayout;
CLayout layout_elm;
pTheme->m_arLayouts.push_back(layout_elm);
CLayout* pLayout = &pTheme->m_arLayouts[lIndexLayout];
CSlideInfo elm;
m_arMasterWrapper.push_back(elm);
CSlideInfo* pMasterWrapper = &m_arMasterWrapper[m_arMasterWrapper.size() - 1];
CSlideInfo* pThemeWrapper = &m_arMasterWrapper[pPairTheme->second];
// , placeholder
pMasterWrapper->m_arTextPlaceHolders = pCurMaster->m_oPersist.m_arTextAttrs;
pMasterWrapper->m_parEmptyPictures = &m_arEmptyPictures;
pLayout->m_bUseThemeColorScheme = true;
pLayout->m_bShowMasterShapes = (bMasterObjects == TRUE) ? true : false;
pLayout->m_strLayoutType = ConvertLayoutType(oArraySlideAtoms[0]->m_oLayout.m_nGeom, oArraySlideAtoms[0]->m_oLayout.m_pPlaceHolderID);
std::vector<NSPresentationEditor::CColor>* pArrayColorScheme = &pTheme->m_arColorScheme;
// -----------------------------------------------------------
if (!bMasterColorScheme)
{
std::vector<CRecordColorSchemeAtom*> oArrayColors;
pCurMaster->GetRecordsByType(&oArrayColors, false);
pLayout->m_arColorScheme.clear();
for (int i = 0; i < oArrayColors.size(); ++i)
{
if (0x01 == oArrayColors[i]->m_oHeader.RecInstance)
{
oArrayColors[i]->ToArray(&pLayout->m_arColorScheme);
pLayout->m_bUseThemeColorScheme = false;
CorrectColorScheme(pLayout->m_arColorScheme);
//
size_t nCountC = pLayout->m_arColorScheme.size();
size_t nIndexC = 0;
if (nCountC == pArrayColorScheme->size())
{
for (; nIndexC < nCountC; ++nIndexC)
{
if (pLayout->m_arColorScheme[i].IsEqual(pArrayColorScheme->at(i)))
break;
}
}
if (nIndexC == nCountC)
{
pLayout->m_bUseThemeColorScheme = true;
pLayout->m_arColorScheme.clear();
}
break;
}
}
}
// ---------------------------------------------------------------------------------
pLayout->m_lOriginalWidth = lOriginWidth;
pLayout->m_lOriginalHeight = lOriginHeight;
pLayout->Clear();
//if (!bMasterObjects)
// pTheme->m_arElements.clear();
// ---------------------------------------------------------------------------------
// ...
std::vector<CRecordShapeContainer*> oArrayShapes;
pCurMaster->GetRecordsByType(&oArrayShapes, true);
for (int nShape = 0; nShape < oArrayShapes.size(); ++nShape)
{
IElement* pElem = NULL;
oArrayShapes[nShape]->GetElement(&pElem, &m_oExMedia, lOriginWidth, lOriginHeight, pTheme, pLayout, pThemeWrapper, pMasterWrapper);
if (NULL != pElem)
{
AddAnimation ( dwMasterID, lOriginWidth, lOriginHeight, pElem );
if (pElem->m_bIsBackground)
{
if (!bMasterBackGround)
{
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElem);
if (NULL != pShape)
{
pShape->SetupProperties(NULL, pTheme, pLayout);
pLayout->m_bIsBackground = true;
pLayout->m_oBackground = pShape->m_oShape.m_oBrush;
}
}
RELEASEINTERFACE(pElem);
continue;
}
pLayout->m_arElements.push_back(pElem);
}
}
}
void CPPTUserInfo::UpdateXMLInfo()
{
if (!PPT_DUMP_LOG)
return;
XmlUtils::CXmlWriter oWriter;
oWriter.WriteNodeBegin(_T("User"));
oWriter.WriteString(m_oDocument.ToString());
// Slides...
if (0 != m_mapSlides.size())
{
oWriter.WriteNodeBegin(_T("Slides"));
//for (std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapSlides.begin(); pPair != m_mapSlides.end(); ++pPair)
for (int i=0; i< m_arrSlidesOrder.size(); i++)
{
std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapSlides.find(m_arrSlidesOrder[i]);
if (pPair == m_mapSlides.end())
continue;
CRecordSlide* pSlide = pPair->second;
if (NULL != pSlide)
{
oWriter.WriteString(pSlide->ToString(pPair->first));
}
}
oWriter.WriteNodeEnd(_T("Slides"));
}
// Masters
if (0 != m_mapMasters.size())
{
oWriter.WriteNodeBegin(_T("Masters"));
//for (std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapMasters.begin(); pPair != m_mapMasters.end(); ++pPair)
for (long i=0; i< m_arrMastersOrder.size(); i++)
{
std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapMasters.find(m_arrMastersOrder[i]);
if (pPair == m_mapMasters.end())continue;
CRecordSlide* pSlide = pPair->second;
if (NULL != pSlide)
{
oWriter.WriteString(pSlide->ToString(pPair->first));
}
}
oWriter.WriteNodeEnd(_T("Masters"));
}
// Notes
if (0 != m_mapNotes.size())
{
oWriter.WriteNodeBegin(_T("Notes"));
//for (std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapNotes.begin(); pPair != m_mapNotes.end(); ++pPair)
for (long i=0; i< m_arrNotesOrder.size(); i++)
{
std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapNotes.find(m_arrNotesOrder[i]);
if (pPair == m_mapMasters.end())continue;
CRecordSlide* pSlide = pPair->second;
if (NULL != pSlide)
{
oWriter.WriteString(pSlide->ToString(pPair->first));
}
}
oWriter.WriteNodeEnd(_T("Notes"));
}
oWriter.WriteNodeEnd(_T("User"));
m_strXmlInfo = oWriter.GetXmlString();
//CDirectory::SaveToFile(_T("C:\\PPTInfo.xml"), m_strXmlInfo);
}
void CPPTUserInfo::LoadSlideFromPrevUsers(DWORD dwSlideID)
{
if ((NULL == m_pDocumentInfo) || (-1 == m_lIndexThisUser))
return;
std::map<DWORD, CRecordSlide*>::iterator pPairSlide = m_mapSlides.find(dwSlideID);
if (pPairSlide != m_mapSlides.end() && pPairSlide->second)
return; //
size_t lUsersCount = m_pDocumentInfo->m_arUsers.size();
// -
for (size_t lIndexUser = m_lIndexThisUser + 1; lIndexUser < lUsersCount; ++lIndexUser)
//for (size_t lIndexUser = lUsersCount - 1; lIndexUser > m_lIndexThisUser; lIndexUser--)
{
std::map<DWORD, CRecordSlide*>::iterator pPair = m_pDocumentInfo->m_arUsers[lIndexUser]->m_mapSlides.find(dwSlideID);
if (pPair == m_pDocumentInfo->m_arUsers[lIndexUser]->m_mapSlides.end())
continue;
CRecordSlide* pSlideCur = pPair->second;
if (NULL != pSlideCur)
{
pSlideCur->AddRef();
if (pPairSlide != m_mapSlides.end())
{
pPairSlide->second = pSlideCur;
}
else
{
m_mapSlides.insert(m_mapSlides.end(), std::pair<DWORD, CRecordSlide*>(dwSlideID, pSlideCur));
m_arrSlidesOrder.push_back(dwSlideID);
}
return;
}
}
}
void CPPTUserInfo::LoadMasterFromPrevUsers(DWORD dwMasterID)
{
if ((NULL == m_pDocumentInfo) || (-1 == m_lIndexThisUser))
return;
std::map<DWORD, CRecordSlide*>::iterator pPairMaster = m_mapMasters.find(dwMasterID);
if (pPairMaster != m_mapMasters.end() && pPairMaster->second)
return;//
size_t lUsersCount = m_pDocumentInfo->m_arUsers.size();
// -
for (size_t lIndexUser = m_lIndexThisUser + 1; lIndexUser < lUsersCount; ++lIndexUser)
//for (size_t lIndexUser = lUsersCount - 1; lIndexUser > m_lIndexThisUser; lIndexUser--)
{
std::map<DWORD, CRecordSlide*>::iterator pPair = m_pDocumentInfo->m_arUsers[lIndexUser]->m_mapMasters.find(dwMasterID);
if (pPair == m_pDocumentInfo->m_arUsers[lIndexUser]->m_mapMasters.end())
continue;
CRecordSlide* pSlideCur = pPair->second;
if (NULL != pSlideCur)
{
pSlideCur->AddRef();
if (pPairMaster != m_mapMasters.end())
{
//
pPairMaster->second = pSlideCur;
}
else
{
m_mapMasters.insert(m_mapMasters.end(), std::pair<DWORD, CRecordSlide*>(dwMasterID, pSlideCur));
m_arrMastersOrder.push_back(dwMasterID);
}
return;
}
}
}
void CPPTUserInfo::LoadNoteFromPrevUsers(DWORD dwSlideID)
{
if ((NULL == m_pDocumentInfo) || (-1 == m_lIndexThisUser))
return;
std::map<DWORD, CRecordSlide*>::iterator pPair = m_mapNotes.find(dwSlideID);
if (pPair != m_mapNotes.end())
return; //
size_t lUsersCount = m_pDocumentInfo->m_arUsers.size();
// -
for (size_t lIndexUser = m_lIndexThisUser + 1; lIndexUser < lUsersCount; lIndexUser++)
//for (size_t lIndexUser = lUsersCount - 1; lIndexUser > m_lIndexThisUser; lIndexUser--)
{
pPair = m_pDocumentInfo->m_arUsers[lIndexUser]->m_mapNotes.find(dwSlideID);
if (pPair == m_pDocumentInfo->m_arUsers[lIndexUser]->m_mapNotes.end())
continue;
CRecordSlide* pSlideCur = pPair->second;
if (NULL != pSlideCur)
{
pSlideCur->AddRef();
m_mapNotes.insert(std::pair<DWORD, CRecordSlide*>(dwSlideID, pSlideCur));
m_arrNotesOrder.push_back(dwSlideID);
return;
}
}
}
void CPPTUserInfo::LoadExternal(CRecordExObjListContainer* pExObjects)
{
// SoundCollection
std::vector<CRecordSoundCollectionContainer*> oArrayCollection;
m_oDocument.GetRecordsByType(&oArrayCollection, false, true);
if (0 != oArrayCollection.size())
{
std::vector<CRecordSoundContainer*> oArraySounds;
oArrayCollection[0]->GetRecordsByType(&oArraySounds, false);
int nSize = oArraySounds.size();
for (int i = 0; i < nSize; ++i)
{
std::vector<CRecordCString*> oArrayStrings;
std::vector<CRecordSoundDataBlob*> oArrayData;
oArraySounds[i]->GetRecordsByType(&oArrayStrings, false);
oArraySounds[i]->GetRecordsByType(&oArrayData, false);
if ((3 <= oArrayStrings.size()) && (1 == oArrayData.size()))
{
NSPresentationEditor::CExFilesInfo oInfo;
oInfo.m_strFilePath = m_oExMedia.m_strPresentationDirectory + FILE_SEPARATOR_STR + oArrayStrings[0]->m_strText + _T(".audio");
oInfo.m_dwID = (DWORD)XmlUtils::GetInteger(oArrayStrings[2]->m_strText);
oArrayData[0]->SaveToFile(oInfo.m_strFilePath);
m_oExMedia.m_arAudioCollection.push_back(oInfo);
}
}
}
if (NULL == pExObjects)
return;
// ----------------------------------------------
std::vector<CRecordExVideoContainer*> oArray;
pExObjects->GetRecordsByType(&oArray, true);
for (int nIndex = 0; nIndex < oArray.size(); ++nIndex)
{
LoadExVideo(oArray[nIndex]);
}
oArray.clear();
// -----------------------------------------------------------
// ----------------------------------------------
std::vector<CRecordExCDAudioContainer*> oArrayAudioCD;
std::vector<CRecordExMIDIAudioContainer*> oArrayAudioMIDI;
std::vector<CRecordWAVAudioLinkContainer*> oArrayWAVLink;
std::vector<CRecordWAVAudioEmbeddedContainer*> oArrayAudioEmbedded;
pExObjects->GetRecordsByType(&oArrayAudioCD , true);
pExObjects->GetRecordsByType(&oArrayAudioMIDI , true);
pExObjects->GetRecordsByType(&oArrayWAVLink , true);
pExObjects->GetRecordsByType(&oArrayAudioEmbedded , true);
int nSize1 = oArrayAudioCD.size();
int nSize2 = oArrayAudioMIDI.size();
int nSize3 = oArrayWAVLink.size();
int nSize4 = oArrayAudioEmbedded.size();
for (int nIndex = 0; nIndex < nSize2; ++nIndex)
{
LoadExAudio(oArrayAudioMIDI[nIndex]);
}
for (int nIndex = 0; nIndex < nSize3; ++nIndex)
{
LoadExAudio(oArrayWAVLink[nIndex]);
}
for (int nIndex = 0; nIndex < nSize4; ++nIndex)
{
DWORD dwKeySound = oArrayAudioEmbedded[nIndex]->m_nSoundID;
DWORD dwKeyObj = oArrayAudioEmbedded[nIndex]->m_oMedia.m_nExObjID;
NSPresentationEditor::CExFilesInfo* pInfo = m_oExMedia.LockAudioFromCollection(dwKeySound);
if (NULL != pInfo)
{
NSPresentationEditor::CExFilesInfo oAudio;
oAudio.m_dwID = dwKeyObj;
oAudio.m_strFilePath = pInfo->m_strFilePath;
oAudio.m_bLoop = oArrayAudioEmbedded[nIndex]->m_oMedia.m_bLoop;
m_oExMedia.m_arAudios.push_back(oAudio);
}
}
for (int nIndex = 0; nIndex < nSize1; ++nIndex)
{
DWORD dwKeyObj = oArrayAudioCD[nIndex]->m_oMedia.m_nExObjID;
NSPresentationEditor::CExFilesInfo* pInfo = m_oExMedia.LockAudio(dwKeyObj);
if (NULL != pInfo)
{
pInfo->m_dStartTime = oArrayAudioCD[nIndex]->m_dStartTime;
pInfo->m_dEndTime = oArrayAudioCD[nIndex]->m_dEndTime;
pInfo->m_bLoop = oArrayAudioCD[nIndex]->m_oMedia.m_bLoop;
}
}
// -----------------------------------------------------------
oArrayAudioCD.clear();
oArrayAudioMIDI.clear();
oArrayWAVLink.clear();
oArrayAudioEmbedded.clear();
}
void CPPTUserInfo::LoadExVideo(CRecordsContainer* pExObject)
{
std::vector<CRecordExMediaAtom*> oArrayExMedia;
std::vector<CRecordCString*> oArrayCString;
pExObject->GetRecordsByType(&oArrayExMedia, false);
pExObject->GetRecordsByType(&oArrayCString, false);
if ((1 == oArrayExMedia.size()) && (1 == oArrayCString.size()))
{
NSPresentationEditor::CExFilesInfo oInfo;
oInfo.m_dwID = oArrayExMedia[0]->m_nExObjID;
oInfo.m_strFilePath = oArrayCString[0]->m_strText;
oInfo.m_bLoop = oArrayExMedia[0]->m_bLoop;
m_oExMedia.m_arVideos.push_back(oInfo);
}
oArrayExMedia.clear();
oArrayCString.clear();
}
void CPPTUserInfo::LoadExAudio(CRecordsContainer* pExObject)
{
std::vector<CRecordExMediaAtom*> oArrayExMedia;
std::vector<CRecordCString*> oArrayCString;
pExObject->GetRecordsByType(&oArrayExMedia, false);
pExObject->GetRecordsByType(&oArrayCString, false);
if ((1 == oArrayExMedia.size()) && (1 == oArrayCString.size()))
{
NSPresentationEditor::CExFilesInfo oInfo;
oInfo.m_dwID = oArrayExMedia[0]->m_nExObjID;
oInfo.m_strFilePath = oArrayCString[0]->m_strText;
oInfo.m_bLoop = oArrayExMedia[0]->m_bLoop;
m_oExMedia.m_arAudios.push_back(oInfo);
}
oArrayExMedia.clear();
oArrayCString.clear();
}
void CPPTUserInfo::AddAnimation ( DWORD dwSlideID, double Width, double Height, IElement* pElement )
{
std::map <DWORD, Animations::CSlideTimeLine*>::iterator pPair = m_mapAnimations.find( dwSlideID );
if (pPair == m_mapAnimations.end()) return;
Animations::CSlideTimeLine* pTimeLine = pPair->second;
if (pTimeLine == NULL) return;
std::map <DWORD, Animations::Effects*>::iterator pPairA = pTimeLine->GetAnimation().find ( pElement->m_lID );
if (pPairA == pTimeLine->GetAnimation().end()) return;
Animations::Effects* arEffects = pPairA->second;
if (arEffects == NULL) return;
for ( long i = 0; i < (long)arEffects->size(); ++i )
{
CAnimationSimple oEffect = arEffects->at(i);
CAnimationSimple oAnimation = oEffect;
oAnimation.m_dTimeAccel = oEffect.m_nDuration * oEffect.m_dTimeAccel;
oAnimation.m_dTimeDecel = oEffect.m_nDuration * oEffect.m_dTimeDecel;
if (0 == oEffect.m_nSchemeColor) // RGB
{
oAnimation.m_nColorTo = oEffect.m_nColorTo;
}
else if (2 == oEffect.m_nSchemeColor) // Index From Table
{
if ((int)oAnimation.m_nColorTo >= (int)m_oSchemeColors.size())
continue;
oAnimation.m_nColorTo = m_oSchemeColors[oEffect.m_nColorTo].GetLONG();
}
pElement->m_oAnimations.m_dSlideWidth = Width;
pElement->m_oAnimations.m_dSlideHeight = Height;
pElement->m_oAnimations.m_arAnimations.push_back ( oAnimation );
}
}
void CPPTUserInfo::AddAudioTransition (DWORD dwSlideID, CTransition* pTransition, const CString& strFilePath)
{
if (NULL==pTransition)
return;
CAudioElement* pAudio = new CAudioElement ();
if (pAudio)
{
pAudio->m_strFileName = strFilePath;
}
// ??? ???
}
#pragma once
#include "ClassesAtom.h"
#include "../Records/Animations/AnimationTypes.h"
#include "../Records/ExObjListContainer.h"
#include "SlideInfo.h"
class CPPTDocumentInfo;
using namespace NSPresentationEditor;
class CPPTUserInfo : public CDocument
{
public:
CUserEdit m_oUser;
std::map<DWORD, DWORD> m_mapOffsetInPIDs;
CRecordDocument m_oDocument;
//todooo C++11 unsorted_map - m_arr .. Order
std::map<DWORD, CRecordSlide*> m_mapSlides;
std::map<DWORD, CRecordSlide*> m_mapMasters;
std::map<DWORD, CRecordSlide*> m_mapNotes;
std::vector<DWORD> m_arrSlidesOrder;
std::vector<DWORD> m_arrMastersOrder;
std::vector<DWORD> m_arrNotesOrder;
// id /
std::map<DWORD, LONG> m_mapMasterToTheme;
std::map<DWORD, LONG> m_mapMasterToLayout;
// original id -> natural id
std::map<DWORD, DWORD> m_mapMasterOriginalIds;
// -
std::vector<CSlideInfo> m_arSlideWrapper;
std::vector<CSlideInfo> m_arMasterWrapper;
// - .
// () -
std::vector<CFont> m_arrFonts;
NSPresentationEditor::CTextStyles m_oDefaultTextStyle;
// ()
CPPTDocumentInfo* m_pDocumentInfo;
size_t m_lIndexThisUser;
// Animations structures
std::map <DWORD, Animations::CSlideTimeLine*> m_mapAnimations;
double m_nWriteSlideTimeOffset;
double m_nWriteSlideTime;
std::map<DWORD, CSlideShowSlideInfoAtom> m_mapTransitions;
// "" -
std::vector<BOOL> m_arEmptyPictures;
BOOL m_bIsSetupEmpty;
CString m_strFileDirectory;
// ex -
CExMedia m_oExMedia;
// DEBUG information
CString m_strXmlInfo;
std::vector<CColor> m_oSchemeColors;
public:
CPPTUserInfo();
~CPPTUserInfo();
void Clear();
BOOL ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStream, CStringW strFolderMem);
void FromDocument();
void NormalizeCoords(long lWidth, long lHeight);
void LoadSlide(DWORD dwSlideID, CSlide* pSlide);
void LoadMasters(const LONG& lOriginWidth, const LONG& lOriginHeight);
void LoadNoMainMaster (DWORD dwMasterID, const LONG& lOriginWidth, const LONG& lOriginHeight);
void LoadMainMaster (DWORD dwMasterID, const LONG& lOriginWidth, const LONG& lOriginHeight);
void UpdateXMLInfo();
void LoadSlideFromPrevUsers (DWORD dwSlideID);
void LoadMasterFromPrevUsers(DWORD dwSlideID);
void LoadNoteFromPrevUsers (DWORD dwSlideID);
void LoadExternal(CRecordExObjListContainer* pExObjects);
void LoadExVideo(CRecordsContainer* pExObject);
void LoadExAudio(CRecordsContainer* pExObject);
void CreateDefaultStyle(NSPresentationEditor::CTextStyles& pStyle, NSPresentationEditor::CTheme* pTheme)
{
for (int i = 0; i < 10; ++i)
{
if (!pStyle.m_pLevels[i].is_init())
pStyle.m_pLevels[i] = new NSPresentationEditor::CTextStyleLevel();
NSPresentationEditor::CTextPFRun* pPF = &pStyle.m_pLevels[i]->m_oPFRun;
NSPresentationEditor::CTextCFRun* pCF = &pStyle.m_pLevels[i]->m_oCFRun;
pPF->textAlignment = (WORD)0;
pPF->leftMargin = (LONG)0;
pPF->indent = (LONG)0;
pPF->defaultTabSize = (LONG)0;
pPF->fontAlign = (WORD)0;
pPF->wrapFlags = (WORD)0x02;
pPF->textDirection = (WORD)0;
pPF->lineSpacing = (LONG)100;
pPF->spaceBefore = (LONG)0;
pPF->spaceAfter = (LONG)0;
pCF->FontBold = FALSE;
pCF->FontItalic = FALSE;
pCF->FontUnderline = FALSE;
pCF->FontStrikeout = FALSE;
pCF->Size = 18;
pCF->BaseLineOffset = (double)0;
pCF->Cap = (WORD)0;
pCF->FontProperties = new NSPresentationEditor::CFontProperties();
pCF->FontProperties->SetFont(pTheme->m_arFonts[0]);
pCF->Color = new NSPresentationEditor::CColor();
}
}
void CorrectColorScheme(std::vector<CColor>& oScheme)
{
std::vector<CColor> oArrayMem;
oArrayMem.push_back(oScheme[0]);//0
oArrayMem.push_back(oScheme[1]);//1
oArrayMem.push_back(oScheme[2]);//2
oArrayMem.push_back(oScheme[3]);//3
oArrayMem.push_back(oScheme[0]);//4
oArrayMem.push_back(oScheme[5]);//5 //accent1
oArrayMem.push_back(oScheme[6]);//6 //accent2
oArrayMem.push_back(oScheme[7]);//7 //accent3
oArrayMem.push_back(oScheme[5]);//8 //accent4
oArrayMem.push_back(oScheme[6]);//9 //accent5
oArrayMem.push_back(oScheme[7]);//10 //accent6
oArrayMem.push_back(oScheme[5]);//11 //hlink
oArrayMem.push_back(oScheme[6]);//12 //folHlink
oArrayMem.push_back(oScheme[0]);//13 //lt1
oArrayMem.push_back(oScheme[1]);//14 //dk1
oArrayMem.push_back(oScheme[2]);//15 //lt2
oArrayMem.push_back(oScheme[3]);//16 //dk2
//0x00 //Background color
//0x01 //Text color
//0x02 //Shadow color
//0x03 //Title text color
//0x04 //Fill color
//0x05 //Accent 1 color
//0x06 //Accent 2 color
//0x07 //Accent 3 color
oScheme = oArrayMem;
}
CString ConvertLayoutType(INT nGeom, BYTE* pPlaceholders)
{
switch (nGeom)
{
case 0x00:
case 0x02:
return _T("title");
case 0x01:
{
NSOfficePPT::PlaceholderEnum phbody = (NSOfficePPT::PlaceholderEnum)pPlaceholders[0];
switch (phbody)
{
case NSOfficePPT::Table:
return _T("tbl");
case NSOfficePPT::OrganizationChart:
return _T("dgm");
case NSOfficePPT::Graph:
return _T("chart");
default:
break;
}
return _T("obj");
}
case 0x07:
return _T("titleOnly");
case 0x08:
{
NSOfficePPT::PlaceholderEnum leftType = (NSOfficePPT::PlaceholderEnum)pPlaceholders[1];
NSOfficePPT::PlaceholderEnum rightType = (NSOfficePPT::PlaceholderEnum)pPlaceholders[2];
if (leftType == NSOfficePPT::Body && rightType == NSOfficePPT::Object)
{
return _T("txAndObj");
}
else if (leftType == NSOfficePPT::Object && rightType == NSOfficePPT::Body)
{
return _T("objAndTx");
}
else if (leftType == NSOfficePPT::Body && rightType == NSOfficePPT::ClipArt)
{
return _T("txAndClipArt");
}
else if (leftType == NSOfficePPT::ClipArt && rightType == NSOfficePPT::Body)
{
return _T("clipArtAndTx");
}
else if (leftType == NSOfficePPT::Body && rightType == NSOfficePPT::Graph)
{
return _T("txAndChart");
}
else if (leftType == NSOfficePPT::Graph && rightType == NSOfficePPT::Body)
{
return _T("chartAndTx");
}
else if (leftType == NSOfficePPT::Body && rightType == NSOfficePPT::MediaClip)
{
return _T("txAndMedia");
}
else if (leftType == NSOfficePPT::MediaClip && rightType == NSOfficePPT::Body)
{
return _T("mediaAndTx");
}
return _T("twoObj");
}
case 0x09:
{
NSOfficePPT::PlaceholderEnum topType = (NSOfficePPT::PlaceholderEnum)pPlaceholders[1];
NSOfficePPT::PlaceholderEnum bottomType = (NSOfficePPT::PlaceholderEnum)pPlaceholders[2];
if (topType == NSOfficePPT::Body && bottomType == NSOfficePPT::Object)
{
return _T("txOverObj");
}
return _T("objOverTx");
}
case 0x0A:
{
NSOfficePPT::PlaceholderEnum leftType = (NSOfficePPT::PlaceholderEnum)pPlaceholders[1];
if (leftType == NSOfficePPT::Object)
{
return _T("objAndTwoObj");
}
return _T("txAndTwoObj");
}
case 0x0B:
{
NSOfficePPT::PlaceholderEnum rightType = (NSOfficePPT::PlaceholderEnum)pPlaceholders[2];
if (rightType == NSOfficePPT::Object)
{
return _T("twoObjAndObj");
}
return _T("twoObjAndTx");
}
case 0x0D:
return _T("twoObjOverTx");
case 0x0F:
return _T("objOnly");
case 0x10:
return _T("blank");
case 0x0E:
return _T("fourObj");
case 0x11:
return _T("vertTitleAndTx");
case 0x12:
return _T("vertTx");
}
return _T("obj");
}
void AddAnimation (DWORD dwSlideID, double Width, double Height, IElement* pElement);
void AddAudioTransition (DWORD dwSlideID, CTransition* pTransition, const CString& strFilePath);
};
\ No newline at end of file
#pragma once
#if defined(_WIN32) || defined (_WIN64)
#include <windows.h>
#include <atlbase.h>
#include <atlstr.h>
#else
#include "../../../../DesktopEditor/common/ASCVariant.h"
#include "../../../../Common/DocxFormat/Source/Base/ASCString.h"
#endif
typedef BYTE BOOL1;
#define PSFLAG_CONTAINER 0xFF
#ifdef _DEBUG
#define PPT_DUMP_LOG FALSE // TRUE - xml
#else
#define PPT_DUMP_LOG FALSE //
#endif
#define PPT_DEFAULT_SLIDE_DURATION 5000
/////////////////////////////////////////////////////////////////////////
#define RECORD_TYPE_UNKNOWN 0
#define RECORD_TYPE_DOCUMENT 1000
#define RECORD_TYPE_DOCUMENT_ATOM 1001
#define RECORD_TYPE_ENDDOCUMENT 1002
#define RECORD_TYPE_SLIDE 1006
#define RECORD_TYPE_SLIDE_ATOM 1007
#define RECORD_TYPE_NOTES 1008
#define RECORD_TYPE_NOTES_ATOM 1009
#define RECORD_TYPE_ENVIRONMENT 1010
#define RECORD_TYPE_SLIDE_PERSIST_ATOM 1011
#define RECORD_TYPE_SSLIDE_LAYOUT_ATOM 1015
#define RECORD_TYPE_MAINMASTER 1016
#define RECORD_TYPE_SSSLIDE_INFO_ATOM 1017
#define RECORD_TYPE_SLIDE_VIEWINFO 1018
#define RECORD_TYPE_GUIDE_ATOM 1019
#define RECORD_TYPE_VIEWINFO 1020
#define RECORD_TYPE_VIEWINFO_ATOM 1021
#define RECORD_TYPE_SLIDE_VIEWINFO_ATOM 1022
#define RECORD_TYPE_VBAINFO 1023
#define RECORD_TYPE_VBAINFO_ATOM 1024
#define RECORD_TYPE_SSDOCINFO_ATOM 1025
#define RECORD_TYPE_SUMMARY 1026
#define RECORD_TYPE_DOC_ROUTING_SLIP 1030
#define RECORD_TYPE_OUTLINE_VIEWINFO 1031
#define RECORD_TYPE_SORTER_VIEWINFO 1032
#define RECORD_TYPE_EXOBJLIST 1033
#define RECORD_TYPE_EXOBJLIST_ATOM 1034
#define RECORD_TYPE_PPDRAWING_GROUP 1035
#define RECORD_TYPE_PPDRAWING 1036
#define RECORD_TYPE_NAMEDSHOWS 1040
#define RECORD_TYPE_NAMEDSHOW 1041
#define RECORD_TYPE_NAMEDSHOW_SLIDES 1042
#define RECORD_TYPE_SHEET_PROPERTIES 1044
#define RECORD_TYPE_LIST 2000
#define RECORD_TYPE_FONTCOLLECTION 2005
#define RECORD_TYPE_BOOKMARKCOLLECTION 2019
#define RECORD_TYPE_SOUNDCOLLECTION 2020
#define RECORD_TYPE_SOUNDCOLL_ATOM 2021
#define RECORD_TYPE_SOUND 2022
#define RECORD_TYPE_SOUNDDATA 2023
#define RECORD_TYPE_BOOKMARK_SEED_ATOM 2025
#define RECORD_TYPE_COLOR_SCHEME_ATOM 2032
#define RECORD_TYPE_OESHAPE_ATOM 3008
#define RECORD_TYPE_EX_OBJREF_ATOM 3009
#define RECORD_TYPE_OEPLACEHOLDER_ATOM 3011
#define RECORD_TYPE_GPOPUBLICINT_ATOM 3024
#define RECORD_TYPE_GRCOLOR 3020
#define RECORD_TYPE_GRECT_ATOM 3025
#define RECORD_TYPE_GRATIO_ATOM 3031
#define RECORD_TYPE_GSCALING_ATOM 3032
#define RECORD_TYPE_GPOINT_ATOM 3034
#define RECORD_TYPE_OUTLINE_TEXTREF_ATOM 3998
#define RECORD_TYPE_TEXT_HEADER_ATOM 3999
#define RECORD_TYPE_TEXT_CHARS_ATOM 4000
#define RECORD_TYPE_STYLE_TEXTPROP_ATOM 4001
#define RECORD_TYPE_BASE_TEXTPROP_ATOM 4002
#define RECORD_TYPE_TXMASTERSTYLE_ATOM 4003
#define RECORD_TYPE_TXCFSTYLE_ATOM 4004
#define RECORD_TYPE_TXPFSTYLE_ATOM 4005
#define RECORD_TYPE_TEXTRULER_ATOM 4006
#define RECORD_TYPE_TEXTBOOKMARK_ATOM 4007
#define RECORD_TYPE_TEXTBYTES_ATOM 4008
#define RECORD_TYPE_TXSISTYLE_ATOM 4009
#define RECORD_TYPE_TEXTSPECINFO_ATOM 4010
#define RECORD_TYPE_DEFAULTRULER_ATOM 4011
#define RECORD_TYPE_FONTENTITY_ATOM 4023
#define RECORD_TYPE_FONT_EMBEDDEDDATA 4024
#define RECORD_TYPE_CSTRING 4026
#define RECORD_TYPE_METAFILE 4033
#define RECORD_TYPE_EXOLEOBJ_ATOM 4035
#define RECORD_TYPE_SRKINSOKU 4040
#define RECORD_TYPE_HANDOUT 4041
#define RECORD_TYPE_EXEMBED 4044
#define RECORD_TYPE_EXEMBEDATOM 4045
#define RECORD_TYPE_EXLINK 4046
#define RECORD_TYPE_BOOKMARK_ENTITY_ATOM 4048
#define RECORD_TYPE_EXLINK_ATOM 4049
#define RECORD_TYPE_SRKINSOKU_ATOM 4050
#define RECORD_TYPE_EXHYPERLINK_ATOM 4051
#define RECORD_TYPE_EXHYPERLINK 4055
#define RECORD_TYPE_SLIDE_NUMBERMC_ATOM 4056
#define RECORD_TYPE_HEADERSFOOTERS 4057
#define RECORD_TYPE_HEADERSFOOTERS_ATOM 4058
#define RECORD_TYPE_TXINTERACTIVEINFO_ATOM 4063
#define RECORD_TYPE_CHARFORMAT_ATOM 4066
#define RECORD_TYPE_PARAFORMAT_ATOM 4067
#define RECORD_TYPE_RECOLORINFO_ATOM 4071
#define RECORD_TYPE_EXQUICKTIMEMOVIE 4074
#define RECORD_TYPE_EXQUICKTIMEMOVIEDATA 4075
#define RECORD_TYPE_EXCONTROL 4078
#define RECORD_TYPE_SLIDELISTWITHTEXT 4080
#define RECORD_TYPE_ANIMATIONINFO_ATOM 4081
#define RECORD_TYPE_INTERACTIVEINFO 4082
#define RECORD_TYPE_INTERACTIVEINFO_ATOM 4083
#define RECORD_TYPE_USER_EDIT_ATOM 4085
#define RECORD_TYPE_CURRENTUSER_ATOM 4086
#define RECORD_TYPE_DATETIMEMC_ATOM 4087
#define RECORD_TYPE_GENERICDATEMC_ATOM 4088
#define RECORD_TYPE_FOOTERMC_ATOM 4090
#define RECORD_TYPE_EXCONTROL_ATOM 4091
#define RECORD_TYPE_EX_MEDIA_ATOM 4100
#define RECORD_TYPE_EX_VIDEOCONTAINER 4101
#define RECORD_TYPE_EX_AVIMOVIE 4102
#define RECORD_TYPE_EX_MCIMOVIE 4103
#define RECORD_TYPE_EX_MIDIAUDIO 4109
#define RECORD_TYPE_EX_CDAUDIO 4110
#define RECORD_TYPE_EX_WAVAUDIOEMBEDDED 4111
#define RECORD_TYPE_EX_WAVAUDIOLINK 4112
#define RECORD_TYPE_EX_OLEOBJSTG 4113
#define RECORD_TYPE_EX_CDAUDIO_ATOM 4114
#define RECORD_TYPE_EXWAVAUDIOEMBEDDED_ATOM 4115
#define RECORD_TYPE_ANIMATIONINFO 4116
#define RECORD_TYPE_RTFDATETIMEMC_ATOM 4117
#define RECORD_TYPE_PROGTAGS 5000
#define RECORD_TYPE_PROGSTRINGTAG 5001
#define RECORD_TYPE_PROGBINARYTAG 5002
#define RECORD_TYPE_BINARYTAGDATA 5003
#define RECORD_TYPE_PRPUBLICINTOPTIONS 6000
#define RECORD_TYPE_PERSISTPTRFULLBLOCK 6001
#define RECORD_TYPE_PERSISTPTRINCREMENTALBLOCK 6002
#define RECORD_TYPE_GSCALING_ATOM2 10001
#define RECORD_TYPE_GRCOLOR_ATOM2 10002
// Records ~12000 seem to be related to the Comments used in PPT 2000/XP
// (Comments in PPT97 are normal Escher text boxes)
#define RECORD_TYPE_COMMENT2000 12000
#define RECORD_TYPE_COMMENT2000ATOM 12001
#define RECORD_TYPE_COMMENT2000SUMMARY 12004
#define RECORD_TYPE_COMMENT2000SUMMARYATOM 12005
// Records ~12050 seem to be related to Document Encryption
#define RECORD_TYPE_DOCUMENT_ENCRYPTION_ATOM 12052
#define RECORD_TYPE_ORIGINALMAINMASTERID 1052
#define RECORD_TYPE_COMPOSITEMASTERID 1053
#define RECORD_TYPE_ROUNDTRIPCONTENTMASTERINFO12 1054
#define RECORD_TYPE_ROUNDTRIPSHAPEID12 1055
#define RECORD_TYPE_ROUNDTRIPHFPLACEHOLDER12 1056
#define RECORD_TYPE_ROUNDTRIPCONTENTMASTERID 1058
#define RECORD_TYPE_ROUNDTRIPOARTTEXTSTYLES12 1059
#define RECORD_TYPE_ROUNDTRIPHEADERFOOTERDEFAULTS12ATOM 1060
#define RECORD_TYPE_ROUNDTRIPDOCFLAGS12 1061
#define RECORD_TYPE_ROUNDTRIPSHAPECHECKSUMFORCUSTOMLAYOUTS12 1062
#define RECORD_TYPE_ROUNDTRIPNOTESMASTERTEXTSTYLES12 1063
#define RECORD_TYPE_ROUNDTRIPCUSTOMTABLESTYLES12 1064
//records greater then 0xF000 belong to with Microsoft Office Drawing format also known as Escher
#define RECORD_TYPE_ESCHER_DGG_CONTAINER 0xF000
#define RECORD_TYPE_ESCHER_DGG 0xF006
#define RECORD_TYPE_ESCHER_CLSID 0xF016
#define RECORD_TYPE_ESCHER_OPT 0xF00B
#define RECORD_TYPE_ESCHER_BSTORE_CONTAINER 0xF001
#define RECORD_TYPE_ESCHER_BSE 0xF007
#define RECORD_TYPE_ESCHER_BLIP_START 0xF018
#define RECORD_TYPE_ESCHER_BLIP_END 0xF117
#define RECORD_TYPE_ESCHER_BLIP_EMF 0xF01A
#define RECORD_TYPE_ESCHER_BLIP_WMF 0xF01B
#define RECORD_TYPE_ESCHER_BLIP_PICT 0xF01C
#define RECORD_TYPE_ESCHER_BLIP_JPEG 0xF01D
#define RECORD_TYPE_ESCHER_BLIP_PNG 0xF01E
#define RECORD_TYPE_ESCHER_BLIP_DIB 0xF01F
#define RECORD_TYPE_ESCHER_BLIP_TIFF 0xF029
#define RECORD_TYPE_ESCHER_DG_CONTAINER 0xF002
#define RECORD_TYPE_ESCHER_DG 0xF008
#define RECORD_TYPE_ESCHER_REGROUPITEMS 0xF118
#define RECORD_TYPE_ESCHER_COLORSCHEME 0xF120
#define RECORD_TYPE_ESCHER_SPGR_CONTAINER 0xF003
#define RECORD_TYPE_ESCHER_SP_CONTAINER 0xF004
#define RECORD_TYPE_ESCHER_SPGR 0xF009
#define RECORD_TYPE_ESCHER_SP 0xF00A
#define RECORD_TYPE_ESCHER_TEXTBOX 0xF00C
#define RECORD_TYPE_ESCHER_CLIENTTEXTBOX 0xF00D
#define RECORD_TYPE_ESCHER_ANCHOR 0xF00E
#define RECORD_TYPE_ESCHER_CHILDANCHOR 0xF00F
#define RECORD_TYPE_ESCHER_CLIENTANCHOR 0xF010
#define RECORD_TYPE_ESCHER_CLIENTDATA 0xF011
#define RECORD_TYPE_ESCHER_SOLVERCONTAINER 0xF005
#define RECORD_TYPE_ESCHER_CONNECTORRULE 0xF012
#define RECORD_TYPE_ESCHER_ALIGNRULE 0xF013
#define RECORD_TYPE_ESCHER_ARCRULE 0xF014
#define RECORD_TYPE_ESCHER_CLIENTRULE 0xF015
#define RECORD_TYPE_ESCHER_CALLOUTRULE 0xF017
#define RECORD_TYPE_ESCHER_SELECTION 0xF119
#define RECORD_TYPE_ESCHER_COLORMRU 0xF11A
#define RECORD_TYPE_ESCHER_DELETEDPSPL 0xF11D
#define RECORD_TYPE_ESCHER_SPLITMENUCOLORS 0xF11E
#define RECORD_TYPE_ESCHER_OLEOBJECT 0xF11F
#define RECORD_TYPE_ESCHER_SECONDARY_OPT 0xF121
#define RECORD_TYPE_ESCHER_TETRIARY_OPT 0xF122
/// Animations defines ///
#define RECORD_PROG_TAGS 0x1388 // RT_ProgTags SlideProgTagsContainer
#define RECORD_PROG_STRING_TAG 0x1389 // RT_ProgStringTag ProgStringTagContainer
#define RECORD_PROG_BINARY_TAG 0x138A // RT_ProgBinaryTag SlideProgTagsContainer-DocProgTagsContainer-ShapeProgTagsContainer
#define RECORD_TEXT_MASTER_STYLE10_ATOM 0x0FB2 // RT_TextMasterStyle10Atom TextMasterStyle10Atom
static CString GetRecordName(DWORD dwType)
{
CString strName = _T("Unknown");
switch (dwType)
{
case RECORD_TYPE_UNKNOWN : { strName = _T("Unknown"); break; }
case RECORD_TYPE_DOCUMENT : { strName = _T("Document"); break; }
case RECORD_TYPE_DOCUMENT_ATOM : { strName = _T("DocumentAtom"); break; }
case RECORD_TYPE_ENDDOCUMENT : { strName = _T("EndDocument"); break; }
case RECORD_TYPE_SLIDE : { strName = _T("Slide"); break; }
case RECORD_TYPE_SLIDE_ATOM : { strName = _T("SlideAtom"); break; }
case RECORD_TYPE_NOTES : { strName = _T("Notes"); break; }
case RECORD_TYPE_NOTES_ATOM : { strName = _T("NotesAtom"); break; }
case RECORD_TYPE_ENVIRONMENT : { strName = _T("Environment"); break; }
case RECORD_TYPE_SLIDE_PERSIST_ATOM : { strName = _T("SlidePersistAtom"); break; }
case RECORD_TYPE_SSLIDE_LAYOUT_ATOM : { strName = _T("SSlideLayoutAtom"); break; }
case RECORD_TYPE_MAINMASTER : { strName = _T("MainMaster"); break; }
case RECORD_TYPE_SSSLIDE_INFO_ATOM : { strName = _T("SSSlideInfoAtom"); break; }
case RECORD_TYPE_SLIDE_VIEWINFO : { strName = _T("SlideViewInfo"); break; }
case RECORD_TYPE_GUIDE_ATOM : { strName = _T("GuideAtom"); break; }
case RECORD_TYPE_VIEWINFO : { strName = _T("ViewInfo"); break; }
case RECORD_TYPE_VIEWINFO_ATOM : { strName = _T("ViewInfoAtom"); break; }
case RECORD_TYPE_SLIDE_VIEWINFO_ATOM : { strName = _T("SlideViewInfoAtom"); break; }
case RECORD_TYPE_VBAINFO : { strName = _T("VBAInfo"); break; }
case RECORD_TYPE_VBAINFO_ATOM : { strName = _T("VBAInfoAtom"); break; }
case RECORD_TYPE_SSDOCINFO_ATOM : { strName = _T("SSDocInfoAtom"); break; }
case RECORD_TYPE_SUMMARY : { strName = _T("Summary"); break; }
case RECORD_TYPE_DOC_ROUTING_SLIP : { strName = _T("DocRoutingSlip"); break; }
case RECORD_TYPE_OUTLINE_VIEWINFO : { strName = _T("OutlineViewInfo"); break; }
case RECORD_TYPE_SORTER_VIEWINFO : { strName = _T("SorterViewInfo"); break; }
case RECORD_TYPE_EXOBJLIST : { strName = _T("ExObjList"); break; }
case RECORD_TYPE_EXOBJLIST_ATOM : { strName = _T("ExObjectListAtom"); break; }
case RECORD_TYPE_PPDRAWING_GROUP : { strName = _T("PPDrawingGroup"); break; }
case RECORD_TYPE_PPDRAWING : { strName = _T("PPDrawing"); break; }
case RECORD_TYPE_NAMEDSHOWS : { strName = _T("NamedShows"); break; }
case RECORD_TYPE_NAMEDSHOW : { strName = _T("NamedShow"); break; }
case RECORD_TYPE_NAMEDSHOW_SLIDES : { strName = _T("NamedShowSlides"); break; }
case RECORD_TYPE_SHEET_PROPERTIES : { strName = _T("SheetProperties"); break; }
case RECORD_TYPE_LIST : { strName = _T("List"); break; }
case RECORD_TYPE_FONTCOLLECTION : { strName = _T("FontCollection"); break; }
case RECORD_TYPE_BOOKMARKCOLLECTION : { strName = _T("BookmarkCollection"); break; }
case RECORD_TYPE_SOUNDCOLLECTION : { strName = _T("SoundCollection"); break; }
case RECORD_TYPE_SOUNDCOLL_ATOM : { strName = _T("SoundCollAtom"); break; }
case RECORD_TYPE_SOUND : { strName = _T("Sound"); break; }
case RECORD_TYPE_SOUNDDATA : { strName = _T("SoundData"); break; }
case RECORD_TYPE_BOOKMARK_SEED_ATOM : { strName = _T("BookMarkSeedAtom"); break; }
case RECORD_TYPE_COLOR_SCHEME_ATOM : { strName = _T("ColorSchemeAtom"); break; }
case RECORD_TYPE_OESHAPE_ATOM : { strName = _T("OEShapeAtom"); break; }
case RECORD_TYPE_EX_OBJREF_ATOM : { strName = _T("ExObjRefAtom"); break; }
case RECORD_TYPE_OEPLACEHOLDER_ATOM : { strName = _T("PlaceHolderAtom"); break; }
case RECORD_TYPE_GPOPUBLICINT_ATOM : { strName = _T("GpOpublicintAtom"); break; }
case RECORD_TYPE_GRCOLOR : { strName = _T("GrColor"); break; }
case RECORD_TYPE_GRECT_ATOM : { strName = _T("GRectAtom"); break; }
case RECORD_TYPE_GRATIO_ATOM : { strName = _T("GRatioAtom"); break; }
case RECORD_TYPE_GSCALING_ATOM : { strName = _T("GScalingAtom"); break; }
case RECORD_TYPE_GPOINT_ATOM : { strName = _T("GPointAtom"); break; }
case RECORD_TYPE_OUTLINE_TEXTREF_ATOM : { strName = _T("OutlineTextRefAtom"); break; }
case RECORD_TYPE_TEXT_HEADER_ATOM : { strName = _T("TextHeaderAtom"); break; }
case RECORD_TYPE_TEXT_CHARS_ATOM : { strName = _T("TextCharsAtom"); break; }
case RECORD_TYPE_STYLE_TEXTPROP_ATOM : { strName = _T("StyleTextPropAtom"); break; }
case RECORD_TYPE_BASE_TEXTPROP_ATOM : { strName = _T("BaseTextPropAtom"); break; }
case RECORD_TYPE_TXMASTERSTYLE_ATOM : { strName = _T("TxMasterStyleAtom"); break; }
case RECORD_TYPE_TXCFSTYLE_ATOM : { strName = _T("TxCfStyleAtom"); break; }
case RECORD_TYPE_TXPFSTYLE_ATOM : { strName = _T("TxPfStyleAtom"); break; }
case RECORD_TYPE_TEXTRULER_ATOM : { strName = _T("TextRulerAtom"); break; }
case RECORD_TYPE_TEXTBOOKMARK_ATOM : { strName = _T("TextBookmarkAtom"); break; }
case RECORD_TYPE_TEXTBYTES_ATOM : { strName = _T("TextBytesAtom"); break; }
case RECORD_TYPE_TXSISTYLE_ATOM : { strName = _T("TxSiStyleAtom"); break; }
case RECORD_TYPE_TEXTSPECINFO_ATOM : { strName = _T("TextSpecInfoAtom"); break; }
case RECORD_TYPE_DEFAULTRULER_ATOM : { strName = _T("DefaultRulerAtom"); break; }
case RECORD_TYPE_FONTENTITY_ATOM : { strName = _T("FontEntityAtom"); break; }
case RECORD_TYPE_FONT_EMBEDDEDDATA : { strName = _T("FontEmbeddedData"); break; }
case RECORD_TYPE_CSTRING : { strName = _T("CString"); break; }
case RECORD_TYPE_METAFILE : { strName = _T("Metafile"); break; }
case RECORD_TYPE_EXOLEOBJ_ATOM : { strName = _T("ExOleObjAtom"); break; }
case RECORD_TYPE_SRKINSOKU : { strName = _T("SrKinsoku"); break; }
case RECORD_TYPE_HANDOUT : { strName = _T("Handout"); break; }
case RECORD_TYPE_EXEMBED : { strName = _T("Exembed"); break; }
case RECORD_TYPE_EXEMBEDATOM : { strName = _T("ExembedAtom"); break; }
case RECORD_TYPE_EXLINK : { strName = _T("ExLink"); break; }
case RECORD_TYPE_BOOKMARK_ENTITY_ATOM : { strName = _T("BookmarkEntityAtom"); break; }
case RECORD_TYPE_EXLINK_ATOM : { strName = _T("ExLinkAtom"); break; }
case RECORD_TYPE_SRKINSOKU_ATOM : { strName = _T("SrKinsokuAtom"); break; }
case RECORD_TYPE_EXHYPERLINK_ATOM : { strName = _T("ExHyperlinkAtom"); break; }
case RECORD_TYPE_EXHYPERLINK : { strName = _T("ExHyperlink"); break; }
case RECORD_TYPE_SLIDE_NUMBERMC_ATOM : { strName = _T("SlideNumberMcAtom"); break; }
case RECORD_TYPE_HEADERSFOOTERS : { strName = _T("HeadersFooters"); break; }
case RECORD_TYPE_HEADERSFOOTERS_ATOM : { strName = _T("HeadersFootersAtom"); break; }
case RECORD_TYPE_TXINTERACTIVEINFO_ATOM : { strName = _T("TxInteractiveInfoAtom"); break; }
case RECORD_TYPE_CHARFORMAT_ATOM : { strName = _T("CharFormatAtom"); break; }
case RECORD_TYPE_PARAFORMAT_ATOM : { strName = _T("ParaFormatAtom"); break; }
case RECORD_TYPE_RECOLORINFO_ATOM : { strName = _T("ReColorInfoAtom"); break; }
case RECORD_TYPE_EXQUICKTIMEMOVIE : { strName = _T("ExQuicktimeMovie"); break; }
case RECORD_TYPE_EXQUICKTIMEMOVIEDATA : { strName = _T("ExQuicktimeMovieData"); break; }
case RECORD_TYPE_EXCONTROL : { strName = _T("ExControl"); break; }
case RECORD_TYPE_SLIDELISTWITHTEXT : { strName = _T("SlidelistWithText"); break; }
case RECORD_TYPE_INTERACTIVEINFO : { strName = _T("InteractiveInfo"); break; }
case RECORD_TYPE_INTERACTIVEINFO_ATOM : { strName = _T("InteractiveInfoAtom"); break; }
case RECORD_TYPE_USER_EDIT_ATOM : { strName = _T("UserEditAtom"); break; }
case RECORD_TYPE_CURRENTUSER_ATOM : { strName = _T("CurrentUserAtom"); break; }
case RECORD_TYPE_DATETIMEMC_ATOM : { strName = _T("DateTimeMCAtom"); break; }
case RECORD_TYPE_GENERICDATEMC_ATOM : { strName = _T("GenericDateMCAtom"); break; }
case RECORD_TYPE_FOOTERMC_ATOM : { strName = _T("FooterMCAtom"); break; }
case RECORD_TYPE_EXCONTROL_ATOM : { strName = _T("ExControlAtom"); break; }
case RECORD_TYPE_EX_MEDIA_ATOM : { strName = _T("ExMediaAtom"); break; }
case RECORD_TYPE_EX_VIDEOCONTAINER : { strName = _T("ExVideoContainer"); break; }
case RECORD_TYPE_EX_AVIMOVIE : { strName = _T("ExAviMovie"); break; }
case RECORD_TYPE_EX_MCIMOVIE : { strName = _T("ExMciMovie"); break; }
case RECORD_TYPE_EX_MIDIAUDIO : { strName = _T("ExMidAudio"); break; }
case RECORD_TYPE_EX_CDAUDIO : { strName = _T("ExCDAudio"); break; }
case RECORD_TYPE_EX_WAVAUDIOEMBEDDED : { strName = _T("ExWavAudioEmbedded"); break; }
case RECORD_TYPE_EX_WAVAUDIOLINK : { strName = _T("ExWavAudioLink"); break; }
case RECORD_TYPE_EX_OLEOBJSTG : { strName = _T("ExOleObjStg"); break; }
case RECORD_TYPE_EX_CDAUDIO_ATOM : { strName = _T("ExCDAudioAtom"); break; }
case RECORD_TYPE_EXWAVAUDIOEMBEDDED_ATOM : { strName = _T("ExWavAudioEmbeddedAtom"); break; }
case RECORD_TYPE_ANIMATIONINFO : { strName = _T("AnimationInfo"); break; }
case RECORD_TYPE_ANIMATIONINFO_ATOM : { strName = _T("AnimationInfoAtom"); break; }
case RECORD_TYPE_RTFDATETIMEMC_ATOM : { strName = _T("RtfDateTimeMCAtom"); break; }
case RECORD_TYPE_PROGTAGS : { strName = _T("ProgTags"); break; }
case RECORD_TYPE_PROGSTRINGTAG : { strName = _T("ProgStringTag"); break; }
case RECORD_TYPE_PROGBINARYTAG : { strName = _T("ProgBinaryTag"); break; }
case RECORD_TYPE_BINARYTAGDATA : { strName = _T("BinaryTagData"); break; }
case RECORD_TYPE_PRPUBLICINTOPTIONS : { strName = _T("PrPublicIntOptions"); break; }
case RECORD_TYPE_PERSISTPTRFULLBLOCK : { strName = _T("PersistPtrFullBlock"); break; }
case RECORD_TYPE_PERSISTPTRINCREMENTALBLOCK : { strName = _T("PersistPtrIncrementalBlock"); break; }
case RECORD_TYPE_GSCALING_ATOM2 : { strName = _T("GScalingAtom2"); break; }
case RECORD_TYPE_GRCOLOR_ATOM2 : { strName = _T("GRColorAtom2"); break; }
// Records ~12000 seem to be related to the Comments used in PPT 2000/XP
// (Comments in PPT97 are normal Escher text boxes)
case RECORD_TYPE_COMMENT2000 : { strName = _T("Comment2000"); break; }
case RECORD_TYPE_COMMENT2000ATOM : { strName = _T("Comment2000Atom"); break; }
case RECORD_TYPE_COMMENT2000SUMMARY : { strName = _T("Comment2000Summary"); break; }
case RECORD_TYPE_COMMENT2000SUMMARYATOM : { strName = _T("Comment2000SummaryAtom"); break; }
// Records ~12050 seem to be related to Document Encryption
case RECORD_TYPE_DOCUMENT_ENCRYPTION_ATOM : { strName = _T("DocumentEncryption"); break; }
case RECORD_TYPE_ORIGINALMAINMASTERID : { strName = _T("OriginalMainMasterID"); break; }
case RECORD_TYPE_COMPOSITEMASTERID : { strName = _T("CompositeMasterID"); break; }
case RECORD_TYPE_ROUNDTRIPCONTENTMASTERINFO12 : { strName = _T("RoundTripContentMasterInfo12"); break; }
case RECORD_TYPE_ROUNDTRIPSHAPEID12 : { strName = _T("RoundTripShapeID12"); break; }
case RECORD_TYPE_ROUNDTRIPHFPLACEHOLDER12 : { strName = _T("RoundTripHfPlaceholder12"); break; }
case RECORD_TYPE_ROUNDTRIPCONTENTMASTERID : { strName = _T("RoundTripContentMasterID"); break; }
case RECORD_TYPE_ROUNDTRIPOARTTEXTSTYLES12 : { strName = _T("RoundTripOartTextStyles12"); break; }
case RECORD_TYPE_ROUNDTRIPSHAPECHECKSUMFORCUSTOMLAYOUTS12 : { strName = _T("RoundTripShapeChecksumForCustomLayouts12"); break; }
case RECORD_TYPE_ROUNDTRIPNOTESMASTERTEXTSTYLES12 : { strName = _T("RoundTripNotesMasterTextStyles12"); break; }
case RECORD_TYPE_ROUNDTRIPCUSTOMTABLESTYLES12 : { strName = _T("RoundTripCustomTableStyles12"); break; }
//records greater then 0xF000 belong to with Microsoft Office Drawing format also known as Escher
case RECORD_TYPE_ESCHER_DGG_CONTAINER : { strName = _T("Escher_DrawingGroupContainer"); break; }
case RECORD_TYPE_ESCHER_DGG : { strName = _T("Escher_DrawingGroupRecord"); break; }
case RECORD_TYPE_ESCHER_CLSID : { strName = _T("Escher_CLSID_Record"); break; }
case RECORD_TYPE_ESCHER_OPT : { strName = _T("Escher_OPT"); break; }
case RECORD_TYPE_ESCHER_BSTORE_CONTAINER : { strName = _T("Escher_BlipStoreContainer"); break; }
case RECORD_TYPE_ESCHER_BSE : { strName = _T("Escher_BlipStoreEntry"); break; }
case RECORD_TYPE_ESCHER_BLIP_START : { strName = _T("Escher_BlipStart"); break; }
case RECORD_TYPE_ESCHER_BLIP_END : { strName = _T("Escher_BlipEnd"); break; }
case RECORD_TYPE_ESCHER_DG_CONTAINER : { strName = _T("Escher_DrawingContainer"); break; }
case RECORD_TYPE_ESCHER_DG : { strName = _T("Escher_DrawingRecord"); break; }
case RECORD_TYPE_ESCHER_REGROUPITEMS : { strName = _T("Escher_RegGroupItems"); break; }
case RECORD_TYPE_ESCHER_COLORSCHEME : { strName = _T("Escher_ColorSheme"); break; }
case RECORD_TYPE_ESCHER_SPGR_CONTAINER : { strName = _T("Escher_GroupShapeContainer"); break; }
case RECORD_TYPE_ESCHER_SP_CONTAINER : { strName = _T("Escher_ShapeContainer"); break; }
case RECORD_TYPE_ESCHER_SPGR : { strName = _T("Escher_GroupShapeRecord"); break; }
case RECORD_TYPE_ESCHER_SP : { strName = _T("Escher_ShapeRecord"); break; }
case RECORD_TYPE_ESCHER_TEXTBOX : { strName = _T("Escher_TextBox"); break; }
case RECORD_TYPE_ESCHER_CLIENTTEXTBOX : { strName = _T("Escher_ClientTextBox"); break; }
case RECORD_TYPE_ESCHER_ANCHOR : { strName = _T("Escher_Anchor"); break; }
case RECORD_TYPE_ESCHER_CHILDANCHOR : { strName = _T("Escher_ChildAnchor"); break; }
case RECORD_TYPE_ESCHER_CLIENTANCHOR : { strName = _T("Escher_ClientAnchor"); break; }
case RECORD_TYPE_ESCHER_CLIENTDATA : { strName = _T("Escher_ClientData"); break; }
case RECORD_TYPE_ESCHER_SOLVERCONTAINER : { strName = _T("Escher_SolverContainer"); break; }
case RECORD_TYPE_ESCHER_CONNECTORRULE : { strName = _T("Escher_ConnectorRule"); break; }
case RECORD_TYPE_ESCHER_ALIGNRULE : { strName = _T("Escher_AlignRule"); break; }
case RECORD_TYPE_ESCHER_ARCRULE : { strName = _T("Escher_ArcRule"); break; }
case RECORD_TYPE_ESCHER_CLIENTRULE : { strName = _T("Escher_ClientRule"); break; }
case RECORD_TYPE_ESCHER_CALLOUTRULE : { strName = _T("Escher_CallOutRule"); break; }
case RECORD_TYPE_ESCHER_SELECTION : { strName = _T("Escher_Selection"); break; }
case RECORD_TYPE_ESCHER_COLORMRU : { strName = _T("Escher_ColorMRU"); break; }
case RECORD_TYPE_ESCHER_DELETEDPSPL : { strName = _T("Escher_DeletedPSPL"); break; }
case RECORD_TYPE_ESCHER_SPLITMENUCOLORS : { strName = _T("Escher_SplitMenuColors"); break; }
case RECORD_TYPE_ESCHER_OLEOBJECT : { strName = _T("Escher_OleObject"); break; }
case RECORD_TYPE_ESCHER_SECONDARY_OPT : { strName = _T("Escher_SecondaryOPT"); break; }
case RECORD_TYPE_ESCHER_TETRIARY_OPT : { strName = _T("Escher_TetriaryOPT"); break; }
default: break;
};
if ((dwType > RECORD_TYPE_ESCHER_BLIP_START) && (dwType < RECORD_TYPE_ESCHER_BLIP_END))
{
strName = _T("Escher_Blip");
}
return strName;
}
#pragma once
#include "../../../../Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.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"
class CPPTFileReader
{
public:
CPPTFileReader(POLE::Storage *pStg, CStringW 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 (pStm == NULL) return;
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.GetLength())
{
m_strMemoryForder = FileSystem::Directory::GetTempPath();
}
m_strMemoryForder = FileSystem::Directory::CreateDirectoryWithUniqueName(m_strMemoryForder);
}
~CPPTFileReader()
{
RELEASEOBJECT(m_pDocStream);
RELEASEOBJECT(m_pPictureStream);
RELEASEOBJECT(m_pPowerPointStg);
FileSystem::Directory::DeleteDirectory(m_strMemoryForder);
}
BOOL IsPowerPoint()
{
return m_bIsPPTFile;
}
void ReadPersistDirectory()
{
// ...
m_oDocumentInfo.ReadFromStream(&m_oCurrentUser, GetDocStream(), (CStringW)m_strMemoryForder);
}
void ReadSlideList()
{
// .
// m_arLoadImageFlags
//std::vector<CRecordBlipStoreEntry*> oArrayBSE;
//m_oDocumentInfo.m_arUsers[0]->m_oDocument.GetRecordsByType(&oArrayBSE, true, false);
// ...
BOOL bRes = SavePictures();
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());
}
if (PPT_DUMP_LOG)
{
ParseForSlideLists();
}
}
protected:
BOOL ReadCurrentUser(POLE::Stream *pStm)
{
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;
}
DWORD ParseForSlideLists()
{
POLE::Stream *pStm = GetDocStream();
SRecordHeader oHeader;
//DWORD nRd = 0;
XmlUtils::CXmlWriter oWriter;
oWriter.WriteNodeBegin(_T("PPTFile"));
while (TRUE)
{
/////////////////////////////////////////////
// xml
if ( oHeader.ReadFromStream(pStm) == FALSE )
break;
oHeader.ToXmlWriter(&oWriter, pStm);
}
oWriter.WriteNodeEnd(_T("PPTFile"));
CDirectory::SaveToFile(_T("C:\\PPT.xml"), oWriter.GetXmlString());
//oWriter.SaveToFile(_T("C:\\PPT.xml"));
return 0;
}
BOOL SavePictures()
{
POLE::Stream* pStream = GetPictureStream();
if (NULL == pStream)
{
return FALSE;
}
SRecordHeader oHeader;
ULONG nRd = 0;
m_lImagesCount = 0;
//
while (TRUE)
{
/*if (m_lImagesCount < m_oDocumentInfo.m_arEmptyPictures.GetCount())
{
if (m_oDocumentInfo.m_arEmptyPictures[m_lImagesCount])
{
++m_lImagesCount;
continue;
}
}*/
CMetaFileBuffer oMetaFile;
if (oHeader.ReadFromStream(pStream) == FALSE )
{
break;
}
if ((oHeader.RecVersion != PSFLAG_CONTAINER) && ((oHeader.RecVersion & 0x0F) != 0x0F))
{
long lOffset = 0;
switch (oHeader.RecType)
{
case RECORD_TYPE_ESCHER_BLIP_EMF:
{
if (0x03D4 == oHeader.RecInstance)
{
lOffset = 16;
}
else if (0x03D5 == oHeader.RecInstance)
{
lOffset = 32;
}
StreamUtils::StreamSkip(lOffset, pStream);
lOffset += 34;
oMetaFile.m_bIsValid = TRUE;
CMetaHeader oMetaHeader;
oMetaHeader.FromStream(pStream);
Gdiplus::ENHMETAHEADER3 oEmfHeader;
oMetaHeader.ToEMFHeader(&oEmfHeader);
//LONG lLenHeader = 88;
//BYTE* pMetaHeader = new BYTE[lLenHeader];
//memcpy(pMetaHeader, (void*)(&oEmfHeader), lLenHeader);
//oMetaFile.SetHeader(pMetaHeader, lLenHeader);
oMetaFile.SetHeader(NULL, 0);
BYTE* pData = new BYTE[oHeader.RecLen - lOffset];
pStream->read(pData, oHeader.RecLen - lOffset);
oMetaFile.SetData(pData, oMetaHeader.cbSave,
oMetaHeader.cbSize, 0 == oMetaHeader.compression);
if (0 == oMetaHeader.compression)
{
RELEASEARRAYOBJECTS(pData);
}
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;
CMetaHeader oMetaHeader;
oMetaHeader.FromStream(pStream);
Gdiplus::WmfPlaceableFileHeader oWmfHeader;
oMetaHeader.ToWMFHeader(&oWmfHeader);
LONG lLenHeader = 22;
BYTE* pMetaHeader = new BYTE[lLenHeader];
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, 0 == oMetaHeader.compression);
if (0 == oMetaHeader.compression)
{
RELEASEARRAYOBJECTS(pData);
}
break;
}
case RECORD_TYPE_ESCHER_BLIP_PICT:
{
if (0x0542 == oHeader.RecInstance)
{
lOffset = 16;
}
else if (0x0543 == oHeader.RecInstance)
{
lOffset = 32;
}
StreamUtils::StreamSkip(lOffset, pStream);
lOffset += 34;
oMetaFile.m_bIsValid = TRUE;
CMetaHeader oMetaHeader;
oMetaHeader.FromStream(pStream);
Gdiplus::WmfPlaceableFileHeader oWmfHeader;
oMetaHeader.ToWMFHeader(&oWmfHeader);
LONG lLenHeader = 22;
BYTE* pMetaHeader = new BYTE[lLenHeader];
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, 0 == oMetaHeader.compression);
if (0 == oMetaHeader.compression)
{
RELEASEARRAYOBJECTS(pData);
}
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);
break;
}
case RECORD_TYPE_ESCHER_BLIP_PNG:
{
if (0x06E0 == oHeader.RecInstance)
{
lOffset = 17;
}
else if (0x06E1 == oHeader.RecInstance)
{
lOffset = 33;
}
StreamUtils::StreamSkip(lOffset, pStream);
break;
}
case RECORD_TYPE_ESCHER_BLIP_DIB:
{
if (0x07A8 == oHeader.RecInstance)
{
lOffset = 17;
}
else if (0x07A9 == oHeader.RecInstance)
{
lOffset = 33;
}
StreamUtils::StreamSkip(lOffset, pStream);
break;
}
case RECORD_TYPE_ESCHER_BLIP_TIFF:
{
if (0x06E4 == oHeader.RecInstance)
{
lOffset = 17;
}
else if (0x06E5 == oHeader.RecInstance)
{
lOffset = 33;
}
StreamUtils::StreamSkip(lOffset, pStream);
break;
}
default:
{
break;
}
};
if (oMetaFile.m_bIsValid)
{
CString strFile = CDirectory::ToString(++m_lImagesCount) + _T(".jpg");
CFile fileMeta;
HRESULT hr = fileMeta.CreateFile((CString)m_strMemoryForder + FILE_SEPARATOR_STR + strFile);
if (hr == S_OK)
{
oMetaFile.ToFile(&fileMeta);
fileMeta.CloseFile();
}
continue;
}
BYTE* pImage = new BYTE[oHeader.RecLen - lOffset];
//StreamUtils::StreamSkip(lOffset, pStream);
pStream->read(pImage, oHeader.RecLen - lOffset);
CString strFile = CDirectory::ToString(++m_lImagesCount) + _T(".jpg");
CFile fileJpeg;
HRESULT hr = fileJpeg.CreateFile((CString)m_strMemoryForder+ FILE_SEPARATOR_STR + strFile);
if (hr == S_OK)
{
if (RECORD_TYPE_ESCHER_BLIP_DIB == oHeader.RecType)
{
WORD vtType = 0x4D42;
fileJpeg.WriteFile((void*)&vtType, 2);
DWORD dwLen = oHeader.RecLen - lOffset;
fileJpeg.WriteFile((void*)&dwLen, 4);
DWORD dwRes = 0;
fileJpeg.WriteFile((void*)&dwRes, 4);
DWORD dwOffset = 2;
fileJpeg.WriteFile((void*)&dwOffset, 4);
}
fileJpeg.WriteFile((void*)pImage, oHeader.RecLen - lOffset);
fileJpeg.CloseFile();
}
delete[] pImage;
}
else
{
// ...
continue;
}
}
return TRUE;
}
private:
bool m_bDualStorage;
CRecordCurrentUserAtom m_oCurrentUser;
POLE::Stream * m_pDocStream;
POLE::Stream * m_pPictureStream;
POLE::Storage* m_pPowerPointStg;
BOOL m_bIsPPTFile;
public:
//
CStringW m_strMemoryForder;
std::vector<BOOL> m_arLoadImageFlags;
DWORD m_lImagesCount;
public:
CPPTDocumentInfo m_oDocumentInfo;
};
#pragma once
#include "../../../../ASCPresentationEditor/OfficeDrawing/TextAttributesEx.h"
#include "SlidePersist.h"
#include <zlib.h>
using namespace NSPresentationEditor;
namespace NSZLib
{
static BOOL Decompress(const BYTE* pSrcBuffer, const ULONG& lSrcBufferLen,
BYTE* pDstBuffer, ULONG& lDstBufferLen)
{
try
{
if (Z_OK == uncompress(pDstBuffer, &lDstBufferLen, pSrcBuffer, lSrcBufferLen))
{
return TRUE;
}
}
catch(...)
{
}
return FALSE;
}
}
/**************************************************************
...
**************************************************************/
struct SRatioAtom
{
LONG Number;
LONG Denom;
CString ToString()
{
CString str = _T("");
str.Format(_T("<Ratio info='(%d,%d)' />"), Number, Denom);
return str;
}
void FromStream(POLE::Stream* pStream)
{
Number = StreamUtils::ReadLONG(pStream);
Denom = StreamUtils::ReadLONG(pStream);
}
};
struct SScalingAtom
{
SRatioAtom X;
SRatioAtom Y;
CString ToString()
{
return X.ToString() + Y.ToString();
}
void FromStream(POLE::Stream* pStream)
{
X.FromStream(pStream);
Y.FromStream(pStream);
}
};
struct SSlideLayoutAtom
{
INT m_nGeom;
BYTE m_pPlaceHolderID[8];
CString ToString()
{
CString str = _T("");
str.Format(_T("<SSlideLayoutAtom Geom='%d' PlaceHolderIDs='(%d,%d,%d,%d,%d,%d,%d,%d)' />"),
m_nGeom, m_pPlaceHolderID[0], m_pPlaceHolderID[1], m_pPlaceHolderID[2], m_pPlaceHolderID[3],
m_pPlaceHolderID[4], m_pPlaceHolderID[5], m_pPlaceHolderID[6], m_pPlaceHolderID[7]);
return str;
}
};
struct SFileIdCluster
{
UINT DrawingGroupID;
UINT CurrentShapeID;
void ReadFromStream(POLE::Stream* pStream)
{
DrawingGroupID = (UINT)StreamUtils::ReadDWORD(pStream);
CurrentShapeID = (UINT)StreamUtils::ReadDWORD(pStream);
}
CString ToString()
{
CString str = _T("");
str.Format(_T("<FileIdCluster drawinggroupID='%d' currentshapeID='%d' />"), DrawingGroupID, CurrentShapeID);
return str;
}
};
#if !defined(_WIN32) && !defined (_WIN64)
struct POINT
{
long x;
long y;
};
struct SIZE
{
long cx;
long cy;
};
struct RECT
{
long left;
long top;
long right;
long bottom;
};
namespace Gdiplus
{
typedef struct
{
short Left;
short Top;
short Right;
short Bottom;
} PWMFRect16;
typedef struct
{
DWORD iType; // Record type EMR_HEADER
DWORD nSize; // Record size in bytes. This may be greater
// than the sizeof(ENHMETAHEADER).
RECT rclBounds; // Inclusive-inclusive bounds in device units
RECT rclFrame; // Inclusive-inclusive Picture Frame .01mm unit
DWORD dSignature; // Signature. Must be ENHMETA_SIGNATURE.
DWORD nVersion; // Version number
DWORD nBytes; // Size of the metafile in bytes
DWORD nRecords; // Number of records in the metafile
WORD nHandles; // Number of handles in the handle table
// Handle index zero is reserved.
WORD sReserved; // Reserved. Must be zero.
DWORD nDescription; // Number of chars in the unicode desc string
// This is 0 if there is no description string
DWORD offDescription; // Offset to the metafile description record.
// This is 0 if there is no description string
DWORD nPalEntries; // Number of entries in the metafile palette.
SIZE szlDevice; // Size of the reference device in pels
SIZE szlMillimeters; // Size of the reference device in millimeters
} ENHMETAHEADER3;
typedef struct
{
DWORD Key; // GDIP_WMF_PLACEABLEKEY
short Hmf; // Metafile HANDLE number (always 0)
PWMFRect16 BoundingBox; // Coordinates in metafile units
short Inch; // Number of metafile units per inch
DWORD Reserved; // Reserved (always 0)
short Checksum; // Checksum value for previous 10 WORDs
}WmfPlaceableFileHeader;
}
#endif
class CMetaHeader
{
public:
DWORD cbSize;
RECT rcBounds;
POINT ptSize;
DWORD cbSave;
BYTE compression;
BYTE filter;
public:
CMetaHeader()
{
}
void FromStream(POLE::Stream* pStream)
{
cbSize = StreamUtils::ReadDWORD(pStream);
rcBounds.left = StreamUtils::ReadLONG(pStream);
rcBounds.top = StreamUtils::ReadLONG(pStream);
rcBounds.right = StreamUtils::ReadLONG(pStream);
rcBounds.bottom = StreamUtils::ReadLONG(pStream);
ptSize.x = StreamUtils::ReadLONG(pStream);
ptSize.y = StreamUtils::ReadLONG(pStream);
cbSave = StreamUtils::ReadDWORD(pStream);
compression = StreamUtils::ReadBYTE(pStream);
filter = StreamUtils::ReadBYTE(pStream);
}
void ToEMFHeader(Gdiplus::ENHMETAHEADER3* pHeader)
{
if (NULL == pHeader)
return;
pHeader->iType = 0x00000001;
pHeader->nSize = 88;
pHeader->rclBounds.left = rcBounds.left;
pHeader->rclBounds.top = rcBounds.top;
pHeader->rclBounds.right = rcBounds.right;
pHeader->rclBounds.bottom = rcBounds.bottom;
//
pHeader->rclFrame.left = rcBounds.left;
pHeader->rclFrame.top = rcBounds.top;
pHeader->rclFrame.right = rcBounds.right;
pHeader->rclFrame.bottom = rcBounds.bottom;
pHeader->dSignature = 0x464D4520;
pHeader->nVersion = 0x00010000;
pHeader->nBytes = cbSize;
pHeader->nRecords = 1;
pHeader->nHandles = 0;
pHeader->sReserved = 0;
pHeader->nDescription = 0;
pHeader->offDescription = 0;
pHeader->nPalEntries = 0;
pHeader->szlDevice.cx = 200;
pHeader->szlDevice.cy = 200;
//
pHeader->szlMillimeters.cx = 100;
pHeader->szlMillimeters.cy = 100;
}
void ToWMFHeader(Gdiplus::WmfPlaceableFileHeader* pHeader)
{
if (NULL == pHeader)
return;
pHeader->Key = 0x9AC6CDD7;
pHeader->Hmf = 0;
pHeader->BoundingBox.Left = (short)rcBounds.left;
pHeader->BoundingBox.Top = (short)rcBounds.top;
pHeader->BoundingBox.Right = (short)rcBounds.right;
pHeader->BoundingBox.Bottom = (short)rcBounds.bottom;
pHeader->Inch = 1440; // 1:1
pHeader->Reserved = 0;
pHeader->Checksum = 0;
pHeader->Checksum ^= (pHeader->Key & 0x0000FFFFL);
pHeader->Checksum ^= ((pHeader->Key & 0xFFFF0000L) >> 16);
pHeader->Checksum ^= pHeader->Hmf;
pHeader->Checksum ^= pHeader->BoundingBox.Left;
pHeader->Checksum ^= pHeader->BoundingBox.Top;
pHeader->Checksum ^= pHeader->BoundingBox.Right;
pHeader->Checksum ^= pHeader->BoundingBox.Bottom;
pHeader->Checksum ^= pHeader->Inch;
pHeader->Checksum ^= (pHeader->Reserved & 0x0000FFFFL);
pHeader->Checksum ^= ((pHeader->Reserved & 0xFFFF0000L) >> 16);
}
static void DecompressDeflate(BYTE* pSrc, LONG lSrcSize, BYTE** ppDst, LONG& lDstSize)
{
#if defined(_WIN32) || defined (_WIN64)
CComPtr<IEncodingFilterFactory> pEFF;
HRESULT hr = pEFF.CoCreateInstance(CLSID_StdEncodingFilterFac);
CComPtr<IDataFilter> pDF;
//accquire suitable filter
if (!pEFF || FAILED(pEFF->GetDefaultFilter( L"deflate", L"text", &pDF)))
return;
//temporary out buffers
BYTE* outBuff = new BYTE[200000];
DWORD dwOutBuffSize = sizeof(outBuff);
long dwRead = 0, dwWritten = 0;
//encode chunk of data
//hr = pDF->DoDecode(0, lSrcSize, pSrc, lDstSize, *ppDst, lSrcSize, &dwRead, &dwWritten, 0);
hr = pDF->DoDecode(0, lSrcSize, pSrc, dwOutBuffSize, outBuff, lSrcSize, &dwRead, &dwWritten, 0);
#endif
}
};
class CMetaFileBuffer
{
public:
BOOL m_bIsValid;
private:
BYTE* m_pMetaHeader;
BYTE* m_pMetaFile;
LONG m_lMetaHeaderSize;
LONG m_lMetaFileSize;
public:
CMetaFileBuffer()
{
m_bIsValid = FALSE;
m_pMetaHeader = NULL;
m_pMetaFile = NULL;
m_lMetaHeaderSize = 0;
m_lMetaFileSize = 0;
}
~CMetaFileBuffer()
{
RELEASEARRAYOBJECTS(m_pMetaHeader);
RELEASEARRAYOBJECTS(m_pMetaFile);
}
void SetHeader(BYTE* pHeader, LONG lSize)
{
m_pMetaHeader = pHeader;
m_lMetaHeaderSize = lSize;
}
void SetData(BYTE* pCompress, LONG lCompressSize, LONG lUncompressSize, BOOL bIsCompressed)
{
if (!bIsCompressed)
{
m_pMetaFile = pCompress;
m_lMetaFileSize = lUncompressSize;
}
else
{
ULONG lSize = lUncompressSize;
m_pMetaFile = new BYTE[lUncompressSize];
BOOL bRes = NSZLib::Decompress(pCompress, (ULONG)lCompressSize, m_pMetaFile, lSize);
if (bRes)
{
m_lMetaFileSize = (LONG)lSize;
}
else
{
RELEASEARRAYOBJECTS(m_pMetaFile);
m_lMetaFileSize = 0;
}
}
}
void ToFile(CFile* pFile)
{
if (NULL != m_pMetaHeader)
{
pFile->WriteFile((void*)m_pMetaHeader, m_lMetaHeaderSize);
}
if (NULL != m_pMetaFile)
{
pFile->WriteFile((void*)m_pMetaFile, m_lMetaFileSize);
}
}
};
namespace NSStreamReader
{
static inline void Read(POLE::Stream* pStream, SPointAtom& oAtom)
{
oAtom.X = StreamUtils::ReadLONG(pStream);
oAtom.Y = StreamUtils::ReadLONG(pStream);
}
static inline void Read(POLE::Stream* pStream, SColorAtom& oAtom)
{
oAtom.R = StreamUtils::ReadBYTE(pStream);
oAtom.G = StreamUtils::ReadBYTE(pStream);
oAtom.B = StreamUtils::ReadBYTE(pStream);
oAtom.Index = StreamUtils::ReadBYTE(pStream);
oAtom.bPaletteIndex = (0x01 == (oAtom.Index & 0x01));
oAtom.bPaletteRGB = (0x02 == (oAtom.Index & 0x02));
oAtom.bSystemRGB = (0x04 == (oAtom.Index & 0x04));
oAtom.bSchemeIndex = (0x08 == (oAtom.Index & 0x08));
oAtom.bSysIndex = (0x10 == (oAtom.Index & 0x10));
}
static inline void Read(POLE::Stream* pStream, NSPresentationEditor::CTextSIRun& oRun, bool bIsIndentation = true)
{
if (bIsIndentation)
{
oRun.lCount = StreamUtils::ReadDWORD(pStream);
}
DWORD dwFlags = StreamUtils::ReadDWORD(pStream);
BYTE flag1 = (BYTE)(dwFlags);
BYTE flag2 = (BYTE)(dwFlags >> 8);
oRun.bSpell = (0x01 == (0x01 & flag1));
oRun.bLang = (0x02 == (0x02 & flag1));
oRun.bAltLang = (0x04 == (0x04 & flag1));
// unused
// unused
oRun.bPp10ext = (0x20 == (0x20 & flag1));
oRun.bBidi = (0x40 == (0x40 & flag1));
// unused
// reserved
oRun.bSmartTag = (0x02 == (0x02 & flag2));
if (oRun.bSpell)
{
oRun.Spell = StreamUtils::ReadWORD(pStream);
}
if (oRun.bLang)
{
oRun.Lang = StreamUtils::ReadWORD(pStream);
}
if (oRun.bAltLang)
{
oRun.AltLang = StreamUtils::ReadWORD(pStream);
}
if (oRun.bBidi)
{
oRun.Bidi = StreamUtils::ReadWORD(pStream);
}
if (oRun.bPp10ext)
{
DWORD dwFlags = StreamUtils::ReadDWORD(pStream);
BYTE flag1 = (BYTE)(dwFlags);
BYTE flag2 = (BYTE)(dwFlags >> 8);
BYTE flag3 = (BYTE)(dwFlags >> 16);
BYTE flag4 = (BYTE)(dwFlags >> 24);
oRun.pp10runid = (0x0F & flag1);
oRun.bGramma = (0x80 == (0x80 & flag4));
}
/*if (bSmartTag)
{
DWORD tabStopsCount = StreamUtils::ReadDWORD(pStream);
arSmartTags.clear();
for (int i = 0; i < (int)tabStopsCount; ++i)
{
arSmartTags.Add(StreamUtils::ReadDWORD(pStream));
}
}*/
}
static inline void Read(POLE::Stream* pStream, NSPresentationEditor::CTextRuler& oRun)
{
DWORD dwFlags = StreamUtils::ReadDWORD(pStream);
BYTE flag1 = (BYTE)(dwFlags);
BYTE flag2 = (BYTE)(dwFlags >> 8);
BYTE flag3 = (BYTE)(dwFlags >> 16);
BYTE flag4 = (BYTE)(dwFlags >> 24);
bool bDefaultTabSize_ = (0x01 == (0x01 & flag1));
bool bCLevels_ = (0x02 == (0x02 & flag1));
bool bTabStops_ = (0x04 == (0x04 & flag1));
bool bLeftMargin1_ = (0x08 == (0x08 & flag1));
bool bLeftMargin2_ = (0x10 == (0x10 & flag1));
bool bLeftMargin3_ = (0x20 == (0x20 & flag1));
bool bLeftMargin4_ = (0x40 == (0x40 & flag1));
bool bLeftMargin5_ = (0x80 == (0x80 & flag1));
bool bIndent1_ = (0x01 == (0x01 & flag2));
bool bIndent2_ = (0x02 == (0x02 & flag2));
bool bIndent3_ = (0x04 == (0x04 & flag2));
bool bIndent4_ = (0x08 == (0x08 & flag2));
bool bIndent5_ = (0x10 == (0x10 & flag2));
if (bCLevels_)
oRun.CLevels = StreamUtils::ReadSHORT(pStream);
if (bDefaultTabSize_)
oRun.DefaultTabSize = StreamUtils::ReadSHORT(pStream);
if (bTabStops_)
{
WORD tabStopsCount = StreamUtils::ReadWORD(pStream);
oRun.tabsStops.clear();
for (int i = 0; i < (int)tabStopsCount; ++i)
{
oRun.tabsStops.push_back(StreamUtils::ReadDWORD(pStream));
}
}
if (bLeftMargin1_)
oRun.LeftMargin1 = StreamUtils::ReadSHORT(pStream);
if (bIndent1_)
oRun.Indent1 = StreamUtils::ReadSHORT(pStream);
if (bLeftMargin2_)
oRun.LeftMargin2 = StreamUtils::ReadSHORT(pStream);
if (bIndent2_)
oRun.Indent2 = StreamUtils::ReadSHORT(pStream);
if (bLeftMargin3_)
oRun.LeftMargin3 = StreamUtils::ReadSHORT(pStream);
if (bIndent3_)
oRun.Indent3 = StreamUtils::ReadSHORT(pStream);
if (bLeftMargin4_)
oRun.LeftMargin4 = StreamUtils::ReadSHORT(pStream);
if (bIndent4_)
oRun.Indent4 = StreamUtils::ReadSHORT(pStream);
if (bLeftMargin5_)
oRun.LeftMargin5 = StreamUtils::ReadSHORT(pStream);
if (bIndent5_)
oRun.Indent5 = StreamUtils::ReadSHORT(pStream);
}
}
class CTextPFRun_ppt
{
public:
NSPresentationEditor::CTextPFRun m_oRun;
LONG m_lLevel;
LONG m_lCount;
public:
CTextPFRun_ppt() : m_oRun()
{
m_lLevel = -1;
m_lCount = 0;
}
CTextPFRun_ppt(const CTextPFRun_ppt& oSrc)
{
*this = oSrc;
}
CTextPFRun_ppt& operator=(const CTextPFRun_ppt& oSrc)
{
m_oRun = oSrc.m_oRun;
m_lLevel = oSrc.m_lLevel;
m_lCount = oSrc.m_lCount;
return *this;
}
public:
void LoadFromStream(POLE::Stream* pStream, bool bIsIndentation = true)
{
if (bIsIndentation)
{
m_lCount = StreamUtils::ReadLONG(pStream);
m_lLevel = (LONG)StreamUtils::ReadWORD(pStream);
if (m_lLevel > 0x0004)
m_lLevel = 0x0004;
}
DWORD dwFlags = StreamUtils::ReadDWORD(pStream);
BYTE flag1 = (BYTE)(dwFlags);
BYTE flag2 = (BYTE)(dwFlags >> 8);
BYTE flag3 = (BYTE)(dwFlags >> 16);
BYTE flag4 = (BYTE)(dwFlags >> 24);
bool hasBullet_ = (0x01 == (0x01 & flag1));
bool bulletHasFont_ = (0x02 == (0x02 & flag1));
bool bulletHasColor_ = (0x04 == (0x04 & flag1));
bool bulletHasSize_ = (0x08 == (0x08 & flag1));
bool bulletFontRef_ = (0x10 == (0x10 & flag1));
bool bulletColor_ = (0x20 == (0x20 & flag1));
bool bulletSize_ = (0x40 == (0x40 & flag1));
bool bulletChar_ = (0x80 == (0x80 & flag1));
bool leftMargin_ = (0x01 == (0x01 & flag2));
// reserved
bool indent_ = (0x04 == (0x04 & flag2));
bool textAlignment_ = (0x08 == (0x08 & flag2));
bool lineSpacing_ = (0x10 == (0x10 & flag2));
bool spaceBefore_ = (0x20 == (0x20 & flag2));
bool spaceAfter_ = (0x40 == (0x40 & flag2));
bool defaultTabSize_ = (0x80 == (0x80 & flag2));
bool fontAlign_ = (0x01 == (0x01 & flag3));
bool charWrap_ = (0x02 == (0x02 & flag3));
bool wordWrap_ = (0x04 == (0x04 & flag3));
bool overflow_ = (0x08 == (0x08 & flag3));
bool tabStops_ = (0x10 == (0x10 & flag3));
bool textDirection_ = (0x20 == (0x20 & flag3));
//reserved
bool bulletBlip_ = (0x80 == (0x80 & flag3));
bool bulletScheme_ = (0x01 == (0x01 & flag4));
bool bulletHasScheme_ = (0x02 == (0x02 & flag4));
if (hasBullet_ || bulletHasFont_ || bulletHasColor_ || bulletHasSize_)
{
WORD bulletFlag = StreamUtils::ReadWORD(pStream);
if (bulletFlag & 0x0F)
m_oRun.hasBullet = (BOOL)(0x01 == (bulletFlag & 0x01));
else
m_oRun.hasBullet = (BOOL)FALSE;
}
if (bulletChar_)
m_oRun.bulletChar = (WCHAR)StreamUtils::ReadWORD(pStream);
if (bulletFontRef_)
m_oRun.bulletFontRef = StreamUtils::ReadWORD(pStream);
if (bulletSize_)
m_oRun.bulletSize = StreamUtils::ReadWORD(pStream);
if (bulletColor_)
{
SColorAtom oColorAtom;
NSStreamReader::Read(pStream, oColorAtom);
NSPresentationEditor::CColor oColor;
oColor.R = oColorAtom.R;
oColor.G = oColorAtom.G;
oColor.B = oColorAtom.B;
oColor.A = 255;
oColor.m_lSchemeIndex = -1;
if (oColorAtom.Index < 10)
{
oColor.m_lSchemeIndex = oColorAtom.Index;
NSPresentationEditor::CorrectColorPPT(oColor.m_lSchemeIndex);
}
m_oRun.bulletColor = oColor;
}
if (TRUE) // ,
m_oRun.bulletColor.reset();
if (textAlignment_)
m_oRun.textAlignment = StreamUtils::ReadWORD(pStream);
if (lineSpacing_)
m_oRun.lineSpacing = StreamUtils::ReadSHORT(pStream);
if (spaceBefore_)
m_oRun.spaceBefore = (LONG)StreamUtils::ReadSHORT(pStream);
if (spaceAfter_)
m_oRun.spaceAfter = (LONG)StreamUtils::ReadSHORT(pStream);
if (leftMargin_)
m_oRun.leftMargin = (LONG)StreamUtils::ReadSHORT(pStream);
if (indent_)
m_oRun.indent = (LONG)StreamUtils::ReadSHORT(pStream);
if (defaultTabSize_)
m_oRun.defaultTabSize = (LONG)StreamUtils::ReadWORD(pStream);
if (tabStops_)
{
WORD tabStopsCount = StreamUtils::ReadWORD(pStream);
m_oRun.tabStops.clear();
if (tabStopsCount > 10)
tabStopsCount = 10;
for (int i = 0; i < (int)tabStopsCount; ++i)
{
m_oRun.tabStops.push_back(StreamUtils::ReadDWORD(pStream));
}
if (0 < m_oRun.tabStops.size())
m_oRun.defaultTabSize = m_oRun.tabStops[0];
}
if (fontAlign_)
m_oRun.fontAlign = StreamUtils::ReadWORD(pStream);
if (charWrap_ || wordWrap_ || overflow_)
{
m_oRun.wrapFlags = StreamUtils::ReadWORD(pStream);
}
if (textDirection_)
m_oRun.textDirection = StreamUtils::ReadWORD(pStream);
}
};
class CTextCFRun_ppt
{
public:
NSPresentationEditor::CTextCFRun m_oRun;
LONG m_lCount;
public:
CTextCFRun_ppt() : m_oRun()
{
m_lCount = 0;
}
CTextCFRun_ppt(const CTextCFRun_ppt& oSrc)
{
*this = oSrc;
}
CTextCFRun_ppt& operator=(const CTextCFRun_ppt& oSrc)
{
m_oRun = oSrc.m_oRun;
m_lCount = oSrc.m_lCount;
return *this;
}
public:
void LoadFromStream(POLE::Stream* pStream, bool bIsIndentation = true)
{
if (bIsIndentation)
{
m_lCount = StreamUtils::ReadLONG(pStream);
}
DWORD dwFlags = StreamUtils::ReadDWORD(pStream);
BYTE flag1 = (BYTE)(dwFlags);
BYTE flag2 = (BYTE)(dwFlags >> 8);
BYTE flag3 = (BYTE)(dwFlags >> 16);
BYTE flag4 = (BYTE)(dwFlags >> 24);
bool hasBold = (0x01 == (0x01 & flag1));
bool hasItalic = (0x02 == (0x02 & flag1));
bool hasUnderline = (0x04 == (0x04 & flag1));
// unused
bool hasShadow = (0x10 == (0x10 & flag1));
bool hasFehint = (0x20 == (0x20 & flag1));
// unused
bool hasKimi = (0x80 == (0x80 & flag1));
// unused
bool hasEmboss = (0x02 == (0x02 & flag2));
// unused
BYTE hasStyle = ((0x3C & flag2) >> 2);
// unused
bool typeface_ = (0x01 == (0x01 & flag3));
bool size_ = (0x02 == (0x02 & flag3));
bool color_ = (0x04 == (0x04 & flag3));
bool BaseLineOffset_ = (0x08 == (0x08 & flag3));
bool EAFontRef_ = (0x20 == (0x20 & flag3));
bool AnsiFontRef_ = (0x40 == (0x40 & flag3));
bool SymbolFontRef_ = (0x80 == (0x80 & flag3));
bool hasNewEATypeface = (0x01 == (0x01 & flag4));
bool hasCsTypeface = (0x02 == (0x02 & flag4));
bool hasPp11ext = (0x04 == (0x04 & flag4));
bool bIsFontStylePresent = (hasBold || hasItalic || hasUnderline || hasShadow ||
hasFehint || hasKimi || hasEmboss || hasStyle != 0);
if (bIsFontStylePresent)
{
WORD fontStyle = StreamUtils::ReadWORD(pStream);
if (0x01 == (0x01 & fontStyle))
m_oRun.FontBold = (BOOL)TRUE;
if (0x02 == (0x02 & fontStyle))
m_oRun.FontItalic = (BOOL)TRUE;
if (0x04 == (0x04 & fontStyle))
m_oRun.FontUnderline = (BOOL)TRUE;
if (0x10 == (0x10 & fontStyle))
m_oRun.FontShadow = (BOOL)TRUE;
}
if (typeface_)
m_oRun.Typeface = StreamUtils::ReadWORD(pStream);
if (EAFontRef_)
m_oRun.EAFontRef = StreamUtils::ReadWORD(pStream);
if (AnsiFontRef_)
m_oRun.AnsiFontRef = StreamUtils::ReadWORD(pStream);
if (SymbolFontRef_)
m_oRun.SymbolFontRef = StreamUtils::ReadWORD(pStream);
if (size_)
m_oRun.Size = StreamUtils::ReadWORD(pStream);
if (color_)
{
SColorAtom oColorAtom;
NSStreamReader::Read(pStream, oColorAtom);
NSPresentationEditor::CColor oColor;
oColor.R = oColorAtom.R;
oColor.G = oColorAtom.G;
oColor.B = oColorAtom.B;
oColor.A = 255;
oColor.m_lSchemeIndex = -1;
if (oColorAtom.Index < 10)
{
oColor.m_lSchemeIndex = oColorAtom.Index;
NSPresentationEditor::CorrectColorPPT(oColor.m_lSchemeIndex);
}
m_oRun.Color = oColor;
}
if (BaseLineOffset_)
m_oRun.BaseLineOffset = (double)StreamUtils::ReadSHORT(pStream);
// ????
}
};
namespace NSPresentationEditor
{
static void ConvertPPTTextToEditorStructure(std::vector<CTextPFRun_ppt>& oArrayPF, std::vector<CTextCFRun_ppt>& oArrayCF,
CString& strText, NSPresentationEditor::CTextAttributesEx& oAttributes)
{
int nCountPFs = (int)oArrayPF.size();
int nCountCFs = (int)oArrayCF.size();
oAttributes.m_arParagraphs.clear();
int nCurrentPF = 0;
int nCurrentCF = 0;
int nOffsetCF = 0;
int nIndexLast = strText.GetLength();
int nIndexText = 0;
for (int nIndexPF = 0; nIndexPF < nCountPFs; ++nIndexPF)
{
CParagraph elm;
oAttributes.m_arParagraphs.push_back(elm);
NSPresentationEditor::CParagraph* pPar = &oAttributes.m_arParagraphs[nIndexPF];
pPar->m_oPFRun = oArrayPF[nIndexPF].m_oRun;
pPar->m_lTextType = oAttributes.m_lTextType;
pPar->m_lTextLevel = oArrayPF[nIndexPF].m_lLevel;
int nCountInPF = oArrayPF[nIndexPF].m_lCount;
while (true)
{
if (nCurrentCF >= nCountCFs)
break;
int nCountAdd = oArrayCF[nCurrentCF].m_lCount - nOffsetCF;
if (nCountAdd > nCountInPF)
{
nOffsetCF += nCountInPF;
NSPresentationEditor::CSpan oSpan;
oSpan.m_oRun = oArrayCF[nCurrentCF].m_oRun;
oSpan.m_strText = strText.Mid(nIndexText, nCountInPF);
pPar->m_arSpans.push_back(oSpan);
nIndexText += nCountInPF;
break;
}
else if (nCountAdd == nCountInPF)
{
nOffsetCF = 0;
NSPresentationEditor::CSpan oSpan;
oSpan.m_oRun = oArrayCF[nCurrentCF].m_oRun;
oSpan.m_strText = strText.Mid(nIndexText, nCountAdd);
pPar->m_arSpans.push_back(oSpan);
nIndexText += nCountAdd;
++nCurrentCF;
break;
}
else
{
nOffsetCF = 0;
NSPresentationEditor::CSpan oSpan;
oSpan.m_oRun = oArrayCF[nCurrentCF].m_oRun;
oSpan.m_strText = strText.Mid(nIndexText, nCountAdd);
pPar->m_arSpans.push_back(oSpan);
nIndexText += nCountAdd;
nCountInPF -= nCountAdd;
++nCurrentCF;
}
}
}
}
}
#include "Records.h"
#include "../Records/RecordsIncluder.h"
void SRecordHeader::ToXmlWriter(XmlUtils::CXmlWriter* pWriter, POLE::Stream* pStream)
{
if (IsContainer())
{
pWriter->WriteNodeBegin(GetRecordName((DWORD)RecType), TRUE);
pWriter->WriteAttribute(_T("length"), (int)RecLen);
pWriter->WriteNodeEnd(GetRecordName((DWORD)RecType), TRUE, FALSE);
UINT lCurLen = 0;
SRecordHeader oRec;
while (lCurLen < RecLen)
{
if (oRec.ReadFromStream(pStream) == FALSE )
{
break;
}
lCurLen += (8 + oRec.RecLen);
oRec.ToXmlWriter(pWriter, pStream);
}
pWriter->WriteNodeEnd(GetRecordName((DWORD)RecType));
}
else
{
IRecord* pRecord = CreateByType(*this);
pRecord->ReadFromStream(*this, pStream);
pWriter->WriteString(pRecord->ToString());
}
}
void CRecordsContainer::ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_arRecords.clear();
LONG lPosition = 0;
StreamUtils::StreamPosition(lPosition, pStream);
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;
StreamUtils::StreamSeek(lPosition + m_oHeader.RecLen, pStream);
}
}
IRecord* CreateByType(SRecordHeader oHeader)
{
IRecord* pRecord = NULL;
switch (oHeader.RecType)
{
CREATE_BY_TYPE(RECORD_TYPE_SLIDELISTWITHTEXT, CRecordSlideListWithText)
CREATE_BY_TYPE(RECORD_TYPE_DOCUMENT_ATOM, CRecordDocumentAtom)
//CREATE_BY_TYPE(RECORD_TYPE_ENDDOCUMENT, CRecordEndDocument)
//CREATE_BY_TYPE(RECORD_TYPE_SSLIDE_LAYOUT_ATOM, CRecordSSlideLayoutAtom)
CREATE_BY_TYPE(RECORD_TYPE_SLIDE_ATOM, CRecordSlideAtom)
CREATE_BY_TYPE(RECORD_TYPE_NOTES_ATOM, CRecordNotesAtom)
CREATE_BY_TYPE(RECORD_TYPE_SLIDE_PERSIST_ATOM, CRecordSlidePersistAtom)
CREATE_BY_TYPE(RECORD_TYPE_ENVIRONMENT, CRecordDocumentTextInfo)
//CREATE_BY_TYPE(RECORD_TYPE_UNKNOWN, CRecordMasterPersistAtom)
//CREATE_BY_TYPE(RECORD_TYPE_UNKNOWN, CRecordNotesPersistAtom)
CREATE_BY_TYPE(RECORD_TYPE_SSSLIDE_INFO_ATOM, CSlideShowSlideInfoAtom)
//CREATE_BY_TYPE(RECORD_TYPE_GUIDE_ATOM, CRecordGuideAtom)
//CREATE_BY_TYPE(RECORD_TYPE_VIEWINFO_ATOM, CRecordZoomViewInfoAtom)
//CREATE_BY_TYPE(RECORD_TYPE_VIEWINFO_ATOM, CRecordNoZoomViewInfoAtom)
CREATE_BY_TYPE(RECORD_TYPE_VIEWINFO_ATOM, CRecordViewInfoAtom)
CREATE_BY_TYPE(RECORD_TYPE_SLIDE_VIEWINFO_ATOM, CRecordSlideViewInfoAtom)
//CREATE_BY_TYPE(RECORD_TYPE_VBAINFO_ATOM, CRecordVBAInfoAtom)
//CREATE_BY_TYPE(RECORD_TYPE_SSDOCINFO_ATOM, CRecordSSDocInfoAtom)
//CREATE_BY_TYPE(RECORD_TYPE_DOC_ROUTING_SLIP, CRecordDocRoutingSlipAtom)
//CREATE_BY_TYPE(RECORD_TYPE_EXOBJLIST_ATOM, CRecordExObjListAtom)
//CREATE_BY_TYPE(RECORD_TYPE_UNKNOWN, CRecordGridSpacing10Atom)
//CREATE_BY_TYPE(RECORD_TYPE_UNKNOWN, CRecordRoundTripThemeAtom)
//CREATE_BY_TYPE(RECORD_TYPE_UNKNOWN, CRecordRoundTripColorMappingAtom)
//CREATE_BY_TYPE(RECORD_TYPE_NAMEDSHOW_SLIDES, CRecordNamedShowSlidesAtom)
//CREATE_BY_TYPE(RECORD_TYPE_SHEET_PROPERTIES, CRecordNormalViewSetInfoAtom)
CREATE_BY_TYPE(RECORD_TYPE_COLOR_SCHEME_ATOM, CRecordColorSchemeAtom)
CREATE_BY_TYPE(RECORD_TYPE_ORIGINALMAINMASTERID, CRecordTripOriginalMasterId12Atom)
CREATE_BY_TYPE(RECORD_TYPE_COMPOSITEMASTERID, CRecordTripCompositeMasterId12Atom)
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPCONTENTMASTERINFO12, CRecordRoundTripContentMasterInfo12Atom)
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPSHAPEID12, CRecordRoundTripShapeId12Atom)
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPHFPLACEHOLDER12, CRecordRoundTripHFPlaceholder12Atom)
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPCONTENTMASTERID, CRecordRoundTripContentMasterId12Atom)
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPOARTTEXTSTYLES12, CRecordRoundTripOArtTextStyles12Atom)
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPHEADERFOOTERDEFAULTS12ATOM, CRecordRoundTripHeaderFooterDefaults12Atom)
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPDOCFLAGS12, CRecordRoundTripDocFlags12Atom)
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPSHAPECHECKSUMFORCUSTOMLAYOUTS12, CRecordRoundTripShapeCheckSumForCustomLayouts12Atom)
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPNOTESMASTERTEXTSTYLES12, CRecordRoundTripNotesMasterTextStyles12Atom)
//CREATE_BY_TYPE(RECORD_TYPE_ROUNDTRIPCUSTOMTABLESTYLES12, CRecordRoundTripCustomTableStyles12Atom)
//CREATE_BY_TYPE(RECORD_TYPE_BOOKMARK_SEED_ATOM, CRecordBookmarkSeedAtom)
//CREATE_BY_TYPE(RECORD_TYPE_COLOR_SCHEME_ATOM, CRecordSlideColorSchemeAtom)
//CREATE_BY_TYPE(RECORD_TYPE_UNKNOWN, CRecordSchemeListElementColorSchemeAtom)
//CREATE_BY_TYPE(RECORD_TYPE_UNKNOWN, CRecordBlipEntityAtom)
//CREATE_BY_TYPE(RECORD_TYPE_UNKNOWN, CRecordExObjRefAtom)
CREATE_BY_TYPE(RECORD_TYPE_OEPLACEHOLDER_ATOM, CRecordPlaceHolderAtom)
//CREATE_BY_TYPE(RECORD_TYPE_UNKNOWN, CRecordShapeFlagsAtom)
//CREATE_BY_TYPE(RECORD_TYPE_UNKNOWN, CRecordShapeFlags10Atom)
//CREATE_BY_TYPE(RECORD_TYPE_UNKNOWN, CRecordRoundTripNewPlaceholderId12Atom)
CREATE_BY_TYPE(RECORD_TYPE_OUTLINE_TEXTREF_ATOM, CRecordOutlineTextRefAtom)
CREATE_BY_TYPE(RECORD_TYPE_TEXT_HEADER_ATOM, CRecordTextHeaderAtom)
CREATE_BY_TYPE(RECORD_TYPE_TEXT_CHARS_ATOM, CRecordTextCharsAtom)
CREATE_BY_TYPE(RECORD_TYPE_STYLE_TEXTPROP_ATOM, CRecordStyleTextPropAtom)
CREATE_BY_TYPE(RECORD_TYPE_TEXTSPECINFO_ATOM, CRecordTextSpecInfoAtom)
CREATE_BY_TYPE(RECORD_TYPE_BASE_TEXTPROP_ATOM, CRecordMasterTextPropAtom)
CREATE_BY_TYPE(RECORD_TYPE_TXMASTERSTYLE_ATOM, CRecordTextMasterStyleAtom)
CREATE_BY_TYPE(RECORD_TYPE_TXCFSTYLE_ATOM, CRecordTextCFExceptionAtom)
CREATE_BY_TYPE(RECORD_TYPE_TXPFSTYLE_ATOM, CRecordTextPFExceptionAtom)
CREATE_BY_TYPE(RECORD_TYPE_TXSISTYLE_ATOM, CRecordTextSIExceptionAtom)
CREATE_BY_TYPE(RECORD_TYPE_TEXTRULER_ATOM, CRecordTextRulerAtom)
//CREATE_BY_TYPE(RECORD_TYPE_TEXTBOOKMARK_ATOM, CRecordTextBookmarkAtom)
CREATE_BY_TYPE(RECORD_TYPE_TEXTBYTES_ATOM, CRecordTextBytesAtom)
//CREATE_BY_TYPE(RECORD_TYPE_UNKNOWN, CRecordOutlineTextPropsHeaderExAtom)
CREATE_BY_TYPE(RECORD_TYPE_GUIDE_ATOM, CRecordGuideAtom)
CREATE_BY_TYPE(RECORD_TYPE_FONTENTITY_ATOM, CRecordFontEntityAtom)
//CREATE_BY_TYPE(RECORD_TYPE_FONT_EMBEDDEDDATA, CRecordFontEmbedDataBlob)
//CREATE_BY_TYPE(RECORD_TYPE_METAFILE, CRecordMetafileBlob)
CREATE_BY_TYPE(RECORD_TYPE_CSTRING, CRecordCString)
//CREATE_BY_TYPE(RECORD_TYPE_EXOLEOBJ_ATOM, CRecordExOleObjAtom)
//CREATE_BY_TYPE(RECORD_TYPE_EXEMBEDATOM, CRecordExOleEmbedAtom)
//CREATE_BY_TYPE(RECORD_TYPE_BOOKMARK_ENTITY_ATOM, CRecordBookmarkEntityAtom)
//CREATE_BY_TYPE(RECORD_TYPE_EXLINK_ATOM, CRecordExOleLinkAtom)
//CREATE_BY_TYPE(RECORD_TYPE_SRKINSOKU_ATOM, CRecordKinsokuAtom)
//CREATE_BY_TYPE(RECORD_TYPE_EXHYPERLINK_ATOM, CRecordExHyperlinkAtom)
//CREATE_BY_TYPE(RECORD_TYPE_UNKNOWN, CRecordSlideNumberMCAtom)
CREATE_BY_TYPE(RECORD_TYPE_HEADERSFOOTERS_ATOM, CRecordHeadersFootersAtom)
//CREATE_BY_TYPE(RECORD_TYPE_UNKNOWN, CRecordMouseTextInteractiveInfoAtom)
//CREATE_BY_TYPE(RECORD_TYPE_UNKNOWN, CRecordRecolorInfoAtom)
//CREATE_BY_TYPE(RECORD_TYPE_UNKNOWN, CRecordAnimationInfoAtom)
//CREATE_BY_TYPE(RECORD_TYPE_UNKNOWN, CRecordDateTimeMCAtom)
//CREATE_BY_TYPE(RECORD_TYPE_UNKNOWN, CRecordGenericDateMCAtom)
CREATE_BY_TYPE(RECORD_TYPE_EX_VIDEOCONTAINER, CRecordExVideoContainer)
CREATE_BY_TYPE(RECORD_TYPE_EX_OBJREF_ATOM, CRecordExObjRefAtom)
CREATE_BY_TYPE(RECORD_TYPE_EX_MEDIA_ATOM, CRecordExMediaAtom)
//CREATE_BY_TYPE(RECORD_TYPE_EXCONTROL_ATOM, CRecordExControlAtom)
CREATE_BY_TYPE(RECORD_TYPE_ESCHER_BSTORE_CONTAINER, CRecordBlipStoreContainer)
CREATE_BY_TYPE(RECORD_TYPE_ESCHER_BSE, CRecordBlipStoreEntry)
CREATE_BY_TYPE(RECORD_TYPE_ESCHER_DG_CONTAINER, CRecordDrawingContainer)
CREATE_BY_TYPE(RECORD_TYPE_ESCHER_DGG, CRecordDrawingGroup)
CREATE_BY_TYPE(RECORD_TYPE_ESCHER_DG, CRecordDrawingRecord)
CREATE_BY_TYPE(RECORD_TYPE_ESCHER_SPGR, CRecordGroupShape)
CREATE_BY_TYPE(RECORD_TYPE_ESCHER_SPGR_CONTAINER, CRecordGroupShapeContainer)
CREATE_BY_TYPE(RECORD_TYPE_ESCHER_SP_CONTAINER, CRecordShapeContainer)
CREATE_BY_TYPE(RECORD_TYPE_ESCHER_SP, CRecordShape)
CREATE_BY_TYPE(RECORD_TYPE_ESCHER_CLIENTANCHOR, CRecordClientAnchor)
CREATE_BY_TYPE(RECORD_TYPE_ESCHER_CHILDANCHOR, CRecordChildAnchor)
CREATE_BY_TYPE(RECORD_TYPE_ESCHER_OPT, CRecordShapeProperties)
CREATE_BY_TYPE(RECORD_TYPE_ESCHER_SECONDARY_OPT, CRecordShapeProperties)
CREATE_BY_TYPE(RECORD_TYPE_ESCHER_TETRIARY_OPT, CRecordShapeProperties)
CREATE_BY_TYPE(RECORD_TYPE_ESCHER_REGROUPITEMS, CRecordRegGroupItems)
CREATE_BY_TYPE(RECORD_TYPE_EX_CDAUDIO, CRecordExCDAudioContainer)
CREATE_BY_TYPE(RECORD_TYPE_EX_WAVAUDIOLINK, CRecordWAVAudioLinkContainer)
CREATE_BY_TYPE(RECORD_TYPE_EX_WAVAUDIOEMBEDDED, CRecordWAVAudioEmbeddedContainer)
CREATE_BY_TYPE(RECORD_TYPE_EX_MIDIAUDIO, CRecordExMIDIAudioContainer)
//
CREATE_BY_TYPE(RECORD_TYPE_INTERACTIVEINFO_ATOM, CRecordInteractiveInfoAtom)
CREATE_BY_TYPE(RECORD_TYPE_TXINTERACTIVEINFO_ATOM, CRecordTextInteractiveInfoAtom)
//
CREATE_BY_TYPE ( RECORD_PROG_TAGS, SlideProgTagsContainer )
CREATE_BY_TYPE(RECORD_TYPE_SOUNDCOLLECTION, CRecordSoundCollectionContainer)
CREATE_BY_TYPE(RECORD_TYPE_EXOBJLIST, CRecordExObjListContainer)
CREATE_BY_TYPE(RECORD_TYPE_SOUND, CRecordSoundContainer)
CREATE_BY_TYPE(RECORD_TYPE_SOUNDDATA, CRecordSoundDataBlob)
default: break;
};
if (NULL == pRecord)
{
if (oHeader.IsContainer())
{
pRecord = new CRecordsContainer();
}
else
{
pRecord = new CUnknownRecord();
}
}
return pRecord;
}
#pragma once
#include "PPTFileDefines.h"
#include "../Reader/ReadStructures.h"
#include "../../../../ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/PPTShape/Enums.h"
using namespace NSPresentationEditor;
struct SRecordHeader
{
BYTE RecVersion;
USHORT RecInstance;
USHORT RecType;
UINT RecLen;
SRecordHeader()
{
RecVersion = RecInstance = RecType = RecLen = 0;
}
BOOL ReadFromStream(POLE::Stream * pStream)
{
RecVersion = RecInstance = RecType = RecLen = 0;
POLE::uint64 nRd = 0;
unsigned short rec =0;
nRd = pStream->read((unsigned char*)&(rec), 2);
if (nRd != 2) return FALSE;
//RecVersion = rec & 0xFF0F;
RecInstance = rec >> 4;
RecVersion = rec - (RecInstance<<4);
nRd = pStream->read((unsigned char*)&(RecType), 2);
nRd = pStream->read((unsigned char*)&(RecLen), 4);
long sz = pStream->size()-pStream->tell();
if (RecLen > sz )
{
RecLen = sz;
}
return TRUE;
}
BOOL IsContainer()
{
/*if ((RecVersion == PSFLAG_CONTAINER) || ((RecVersion & 0x0F) == 0x0F))
{
return TRUE;
}*/
if (1064 == RecType)
return FALSE;
if (RecVersion == 0x0F)
{
return TRUE;
}
return FALSE;
}
SRecordHeader& operator =(const SRecordHeader& oSrc)
{
RecVersion = oSrc.RecVersion;
RecInstance = oSrc.RecInstance;
RecType = oSrc.RecType;
RecLen = oSrc.RecLen;
return (*this);
}
void ToXmlWriter(XmlUtils::CXmlWriter* pWriter)
{
CString str = GetRecordName((DWORD)RecType);
pWriter->WriteNodeBegin(str, TRUE);
pWriter->WriteAttribute(_T("length"), CDirectory::ToString(RecLen));
pWriter->WriteAttribute(_T("type"), CDirectory::ToString(RecType));
pWriter->WriteAttribute(_T("instance"), CDirectory::ToString(RecInstance));
pWriter->WriteNodeEnd(str, TRUE);
}
void ToXmlWriter(XmlUtils::CXmlWriter* pWriter, POLE::Stream* pStream);
static CString ToString(SRecordHeader oHeader)
{
CString str = GetRecordName((DWORD)oHeader.RecType);
XmlUtils::CXmlWriter oWriter;
oWriter.WriteNodeBegin(str, TRUE);
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(oHeader.RecType));
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(oHeader.RecLen));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(oHeader.RecInstance));
oWriter.WriteNodeEnd(str, TRUE);
return oWriter.GetXmlString();
}
CString ToString()
{
return ToString(*this);
}
};
class IRecord
{
public:
SRecordHeader m_oHeader;
public:
//
virtual ~IRecord(){}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) = 0;
virtual CString ToString() = 0;
};
class CUnknownRecord : public IRecord
{
// - , ,
//
public:
CUnknownRecord()
{
}
~CUnknownRecord()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
StreamUtils::StreamSkip((long)m_oHeader.RecLen, pStream);
}
virtual CString ToString()
{
return m_oHeader.ToString();
}
};
IRecord* CreateByType(SRecordHeader oHeader);
class CRecordsContainer : public IRecord
{
protected:
std::vector<IRecord*> m_arRecords;
public:
CRecordsContainer() : m_arRecords()
{
}
virtual ~CRecordsContainer()
{
Clear();
}
void Clear()
{
size_t nCount = m_arRecords.size();
while(0 != nCount)
{
if (NULL != m_arRecords[nCount-1])
delete m_arRecords[nCount-1];
m_arRecords.pop_back();
--nCount;
}
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream);
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
if (0 == m_arRecords.size())
{
oWriter.WriteNodeEnd(strName, TRUE);
}
else
{
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
for (int nIndex = 0; nIndex < m_arRecords.size(); ++nIndex)
{
oWriter.WriteString(m_arRecords[nIndex]->ToString());
}
oWriter.WriteNodeEnd(strName);
}
return oWriter.GetXmlString();
}
template <typename T>
void GetRecordsByType(std::vector<T>* pArray, bool bIsChild, bool bOnlyFirst = false)
{
if (NULL == pArray)
return;
// , !!!!
for (int nIndex = 0; nIndex < m_arRecords.size(); ++nIndex)
{
T pRec = dynamic_cast<T>(m_arRecords[nIndex]);
if (NULL != pRec)
{
pArray->push_back(pRec);
if (bOnlyFirst)
{
return;
}
}
else if ((bIsChild) && (m_arRecords[nIndex]->m_oHeader.IsContainer()))
{
CRecordsContainer* pContainer = dynamic_cast<CRecordsContainer*>(m_arRecords[nIndex]);
if (NULL != pContainer)
{
pContainer->GetRecordsByType(pArray, bIsChild, bOnlyFirst);
}
}
}
}
};
/**************************************************************
... ( , )
**************************************************************/
/*
class CRecordDocument : public CRecordsContainer {};
class CRecordEnvironment : public CRecordsContainer {};
class CRecordExAviMovie : public CRecordsContainer {};
class CRecordExCDAudio : public CRecordsContainer {};
class CRecordExControl : public CRecordsContainer {};
class CRecordExEmbed : public CRecordsContainer {};
class CRecordExHyperlink : public CRecordsContainer {};
class CRecordExHyperlink9 : public CRecordsContainer {};
class CRecordExLink : public CRecordsContainer {};
class CRecordExMCIMovie : public CRecordsContainer {};
class CRecordExMIDIAudio : public CRecordsContainer {};
class CRecordExObjList : public CRecordsContainer {};
class CRecordExOleObjStg : public CRecordsContainer {};
class CRecordExQuickTimeMovie : public CRecordsContainer {};
class CRecordExVideo : public CRecordsContainer {};
class CRecordExWAVAudioEmbedded : public CRecordsContainer {};
class CRecordExWAVAudioLink : public CRecordsContainer {};
class CRecordFontCollection : public CRecordsContainer {};
class CRecordFontCollection10 : public CRecordsContainer {};
class CRecordHandout : public CRecordsContainer {};
class CRecordHeadersFooters : public CRecordsContainer {};
class CRecordHTMLPublishInfo : public CRecordsContainer {};
class CRecordInteractiveInfo : public CRecordsContainer {};
class CRecordList : public CRecordsContainer {};
class CRecordMainMaster : public CRecordsContainer {};
class CRecordMsofbtClientData : public CRecordsContainer {};
class CRecordNamedShow : public CRecordsContainer {};
class CRecordNamedShows : public CRecordsContainer {};
class CRecordNotes : public CRecordsContainer {};
class CRecordNotesTextViewInfo : public CRecordsContainer {};
class CRecordOutlineTextProps9 : public CRecordsContainer {};
class CRecordOutlineTextProps10 : public CRecordsContainer {};
class CRecordOutlineTextProps11 : public CRecordsContainer {};
class CRecordOutlineViewInfo : public CRecordsContainer {};
class CRecordParaBuild : public CRecordsContainer {};
class CRecordProgBinaryTag : public CRecordsContainer {};
class CRecordProgStringTag : public CRecordsContainer {};
class CRecordProgTags : public CRecordsContainer {};
class CRecordSlide : public CRecordsContainer {};
class CRecordSlideListTable10 : public CRecordsContainer {};
class CRecordSlideListWithText : public CRecordsContainer {};
class CRecordSlideSyncInfo12 : public CRecordsContainer {};
class CRecordSlideViewInfo : public CRecordsContainer {};
class CRecordSorterViewInfo : public CRecordsContainer {};
class CRecordSound : public CRecordsContainer {};
class CRecordSoundCollection : public CRecordsContainer {};
class CRecordSrKinsoku : public CRecordsContainer {};
class CRecordSummary : public CRecordsContainer {};
class CRecordVBAInfo : public CRecordsContainer {};
*/
/********************************************************************************
( )
********************************************************************************/
//-------------------------------------------------------------------------------
#define CREATE_BY_TYPE(RECORD_TYPE, CLASS_RECORD_NAME) \
case RECORD_TYPE: { pRecord = new CLASS_RECORD_NAME(); break; } \
//-------------------------------------------------------------------------------
#pragma once
#include "../../AVSOfficeStudio/Common/OfficeDrawing/ElementsContainer.h"
#include "../Records/TextFullSettings.h"
class CSlide : public CElementsContainer
{
public:
enum SlideType
{
stSlide = 0x00,
stMaster = 0x01,
stNote = 0x02,
stNone = 0xFF
};
public:
// SlideListWithText properties
CAtlArray<CTextFullSettings> m_arTextPlaceHolders;
// indentLevels
CSimpleMap<DWORD, CTextMasterStyle*> m_mapTextStyles;
SlideType m_eSlideType;
double m_dReadDuration;
public:
CSlide() : CElementsContainer(),
m_arTextPlaceHolders(), m_mapTextStyles()
{
m_eSlideType = stNone;
m_dReadDuration = -1.0;
m_parEmptyPictures = NULL;
}
public:
void SetUpTextStyle(IElement* pElem)
{
// shape
// -
// 1) master + TextMasterStyles
// 2) persist + TextMasterStyles
// 3) + TextMasterStyles
// " " - " "
// ( ) -
// .
// - ,
// , .cpp -
// (.. )
if (NULL == pElem)
return;
if (etShape != pElem->m_etType)
return;
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElem);
if (NULL == pShape)
return;
// ,
//if (_T("") == pShape->m_oShape.m_oText.m_sText) // - ??
// return;
CTextAttributesEx* pTextSettings = &(pShape->m_oShape.m_oText);
// masterstyle ( )
// - (.. )
// - - .. -
//
BOOL bIsPersistPresentSettings = FALSE;
BOOL bIsOwnPresentSettings = FALSE;
NSOfficePPT::TextType eTypeMaster = (NSOfficePPT::TextType)pTextSettings->m_lMasterTextType;
NSOfficePPT::TextType eTypePersist = NSOfficePPT::NoPresent;
NSOfficePPT::TextType eTypeOwn = (NSOfficePPT::TextType)pTextSettings->m_lTextType;
// persist ----------------------------------------------------------------------
LONG lCountPersistObjects = (LONG)m_arTextPlaceHolders.GetCount();
LONG lPersistIndex = pShape->m_lPersistIndex;
if ((lPersistIndex >= 0) && (lPersistIndex < lCountPersistObjects))
{
eTypePersist = (NSOfficePPT::TextType)m_arTextPlaceHolders[lPersistIndex].m_nTextType;
m_arTextPlaceHolders[lPersistIndex].ApplyProperties(pTextSettings);
bIsPersistPresentSettings = ((NULL != m_arTextPlaceHolders[lPersistIndex].m_pTextStyleProp) &&
(0 < m_arTextPlaceHolders[lPersistIndex].m_pTextStyleProp->m_lCount));
}
// ------------------------------------------------------------------------------
// own properties ---------------------------------------------------------------
if (NULL != pShape->m_pStream)
{
// .
LONG lPosition = 0; StreamUtils::StreamPosition(lPosition, pShape->m_pStream);
if (-1 != pShape->m_lOffsetTextStyle)
{
StreamUtils::StreamSeek(pShape->m_lOffsetTextStyle - 8, pShape->m_pStream);
SRecordHeader oHeader;
pShape->m_pStream->Read(&oHeader, sizeof(oHeader), NULL);
if (RECORD_TYPE_STYLE_TEXTPROP_ATOM == oHeader.RecType)
{
CRecordStyleTextPropAtom* pStyle = new CRecordStyleTextPropAtom();
pStyle->m_lCount = pShape->m_oShape.m_oText.m_sText.GetLength();
pStyle->ReadFromStream(oHeader, pShape->m_pStream);
pStyle->ApplyProperties(&(pShape->m_oShape.m_oText));
bIsOwnPresentSettings = (0 < pStyle->m_lCount);
RELEASEOBJECT(pStyle);
}
}
if (-1 != pShape->m_lOffsetTextProp)
{
StreamUtils::StreamSeek(pShape->m_lOffsetTextProp - 8, pShape->m_pStream);
SRecordHeader oHeader;
pShape->m_pStream->Read(&oHeader, sizeof(oHeader), NULL);
if (RECORD_TYPE_TEXTSPECINFO_ATOM == oHeader.RecType)
{
CRecordTextSpecInfoAtom* pSpecInfo = new CRecordTextSpecInfoAtom();
pSpecInfo->m_lCount = pShape->m_oShape.m_oText.m_sText.GetLength();
pSpecInfo->ReadFromStream(oHeader, pShape->m_pStream);
pSpecInfo->ApplyProperties(&(pShape->m_oShape.m_oText));
RELEASEOBJECT(pSpecInfo);
}
}
StreamUtils::StreamSeek(lPosition, pShape->m_pStream);
}
// ------------------------------------------------------------------------------
SetUpAllTextType(pTextSettings, eTypeMaster, eTypePersist, bIsPersistPresentSettings, eTypeOwn, bIsOwnPresentSettings);
// - -
//
//
if (0 == pShape->m_oShape.m_oText.m_arPFs.GetCount())
{
CTextMasterStyle* pStyle = this->m_mapTextStyles.Lookup(pShape->m_oShape.m_oText.m_lTextType);
if (NULL != pStyle)
{
if (0 < pStyle->m_lLevels)
{
pShape->m_oShape.m_oText.m_arPFs.Add(pStyle->m_arrLevels[0].oPFRun);
pShape->m_oShape.m_oText.m_arPFs[0].lCount = pShape->m_oShape.m_oText.m_sText.GetLength();
}
}
}
if (0 == pShape->m_oShape.m_oText.m_arCFs.GetCount())
{
CTextMasterStyle* pStyle = this->m_mapTextStyles.Lookup(pShape->m_oShape.m_oText.m_lTextType);
if (NULL != pStyle)
{
if (0 < pStyle->m_lLevels)
{
pShape->m_oShape.m_oText.m_arCFs.Add(pStyle->m_arrLevels[0].oCFRun);
pShape->m_oShape.m_oText.m_arCFs[0].lCount = pShape->m_oShape.m_oText.m_sText.GetLength();
}
}
}
// , placeholder'
// ,
LONG lPlaceholderIndex = pShape->m_lPlaceholderPosition;
if (-1 != lPlaceholderIndex)
{
CTextMasterStyle* pStyle = this->m_mapTextStyles.Lookup(lPlaceholderIndex);
if (NULL != pStyle)
{
LONG lCountPF = (LONG)pShape->m_oShape.m_oText.m_arPFs.GetCount();
LONG lCountCF = (LONG)pShape->m_oShape.m_oText.m_arCFs.GetCount();
LONG lLevels = (LONG)pStyle->m_arrLevels.GetCount();
if (0 != lLevels)
{
for (LONG lIndexPF = 0; lIndexPF < lCountPF; ++lIndexPF)
{
LONG lIndentLevel = pTextSettings->m_arPFs[lIndexPF].lIndentLevel;
if (lIndentLevel >= 0 && lIndentLevel < lLevels)
{
pTextSettings->m_arPFs[lIndexPF].ApplyBefore(pStyle->m_arrLevels[lIndentLevel].oPFRun);
}
}
for (LONG lIndexCF = 0; lIndexCF < lCountCF; ++lIndexCF)
{
pTextSettings->m_arCFs[lIndexCF].ApplyBefore(pStyle->m_arrLevels[0].oCFRun);
}
}
}
}
// ( !!!)
if (stSlide == m_eSlideType)
{
pShape->m_oShape.m_oText.ApplyProperties(this);
}
if ((pShape->m_oActions.m_bPresent) && (7 < m_arColorScheme.GetSize()))
{
ApplyHyperlink(pShape, m_arColorScheme[6]);
}
CPPTShape* pPPTShape = dynamic_cast<CPPTShape*>(pShape->m_oShape.m_pShape);
if (NULL != pPPTShape)
{
// -
switch (pPPTShape->m_eType)
{
case sptTextPlainText:
case sptTextStop:
case sptTextTriangle:
case sptTextTriangleInverted:
case sptTextChevron:
case sptTextChevronInverted:
case sptTextRingInside:
case sptTextRingOutside:
case sptTextArchUpCurve:
case sptTextArchDownCurve:
case sptTextCircleCurve:
case sptTextButtonCurve:
case sptTextArchUpPour:
case sptTextArchDownPour:
case sptTextCirclePour:
case sptTextButtonPour:
case sptTextCurveUp:
case sptTextCurveDown:
case sptTextCascadeUp:
case sptTextCascadeDown:
case sptTextWave1:
case sptTextWave2:
case sptTextWave3:
case sptTextWave4:
case sptTextInflate:
case sptTextDeflate:
case sptTextInflateBottom:
case sptTextDeflateBottom:
case sptTextInflateTop:
case sptTextDeflateTop:
case sptTextDeflateInflate:
case sptTextDeflateInflateDeflate:
case sptTextFadeRight:
case sptTextFadeLeft:
case sptTextFadeUp:
case sptTextFadeDown:
case sptTextSlantUp:
case sptTextSlantDown:
case sptTextCanUp:
case sptTextCanDown:
{
pShape->m_oShape.m_oText.m_arCFs.RemoveAll();
pShape->m_oShape.m_oText.m_arPFs.RemoveAll();
pShape->m_oShape.m_oText.m_oAttributes.m_oTextBrush = pShape->m_oShape.m_oBrush;
pShape->m_oShape.m_oText.m_oAttributes.m_nTextAlignHorizontal = 1;
pShape->m_oShape.m_oText.m_oAttributes.m_nTextAlignVertical = 1;
pShape->m_oShape.m_lDrawType = c_ShapeDrawType_Text;
break;
}
default:
break;
};
}
}
private:
void SetUpTextTypeStyle(CTextAttributesEx* pTextAttributes, NSOfficePPT::TextType eApplyType, LONG lApplyMode)
{
if ((NULL == pTextAttributes) || (NSOfficePPT::NoPresent == eApplyType) || (2 <= lApplyMode))
return;
CTextMasterStyle* pStyle = this->m_mapTextStyles.Lookup(eApplyType);
if (NULL == pStyle)
return;
for (size_t nIndex = 0; nIndex < pTextAttributes->m_arPFs.GetCount(); ++nIndex)
{
LONG lIndentLevel = pTextAttributes->m_arPFs[nIndex].lIndentLevel;
if (NULL != pStyle)
{
if (lIndentLevel < pStyle->m_lLevels)
{
switch (lApplyMode)
{
case 0:
{
pTextAttributes->m_arPFs[nIndex].ApplyBefore(pStyle->m_arrLevels[lIndentLevel].oPFRun);
break;
}
case 1:
{
pTextAttributes->m_arPFs[nIndex].ApplyAfter(pStyle->m_arrLevels[lIndentLevel].oPFRun);
break;
}
default:
break;
};
}
}
}
for (size_t nIndex = 0; nIndex < pTextAttributes->m_arCFs.GetCount(); ++nIndex)
{
if (NULL != pStyle)
{
LONG lIndentIndex = pTextAttributes->GetIndentLevelCF(nIndex);
if (lIndentIndex < pStyle->m_lLevels)
{
// .
switch (lApplyMode)
{
case 0:
{
pTextAttributes->m_arCFs[nIndex].ApplyBefore(pStyle->m_arrLevels[lIndentIndex].oCFRun);
break;
}
case 1:
{
pTextAttributes->m_arCFs[nIndex].ApplyAfter(pStyle->m_arrLevels[lIndentIndex].oCFRun);
break;
}
default:
break;
};
}
}
}
}
void SetUpAllTextType(CTextAttributesEx* pTextAttributes, NSOfficePPT::TextType eTypeMaster,
NSOfficePPT::TextType eTypePersist, BOOL bPersistPresent,
NSOfficePPT::TextType eTypeOwn, BOOL bOwnPresent)
{
if (bOwnPresent)
{
if (eTypeOwn != eTypePersist)
{
SetUpTextTypeStyle(pTextAttributes, eTypeOwn, 0);
}
if (eTypePersist != eTypeOwn)
{
SetUpTextTypeStyle(pTextAttributes, eTypePersist, 0);
}
if ((eTypeMaster != eTypePersist) && (eTypeMaster != eTypeOwn))
{
SetUpTextTypeStyle(pTextAttributes, eTypeMaster, 0);
}
}
else if (bPersistPresent)
{
SetUpTextTypeStyle(pTextAttributes, eTypePersist, 0);
if (eTypePersist != eTypeMaster)
{
SetUpTextTypeStyle(pTextAttributes, eTypeMaster, 0);
}
if (NSOfficePPT::NoPresent != eTypeOwn)
{
SetUpTextTypeStyle(pTextAttributes, eTypeOwn, 1);
}
}
else
{
SetUpTextTypeStyle(pTextAttributes, eTypeMaster, 0);
if (eTypePersist != eTypeMaster)
{
SetUpTextTypeStyle(pTextAttributes, eTypePersist, 1);
}
if (eTypeOwn != eTypePersist && ((NSOfficePPT::NoPresent != eTypePersist) || (eTypeMaster != eTypeOwn)))
{
SetUpTextTypeStyle(pTextAttributes, eTypeOwn, 1);
}
}
}
void ApplyHyperlink(CShapeElement* pShape, SColorAtom& oColor)
{
CAtlArray<CInteractiveInfo::CTextRange>* pRanges = &pShape->m_oActions.m_arRanges;
CTextAttributesEx* pTextAttributes = &pShape->m_oShape.m_oText;
LONG lCountHyper = (LONG)pRanges->GetCount();
LONG lCountCFs = (LONG)pTextAttributes->m_arCFs.GetCount();
if (0 == lCountHyper)
return;
CAtlArray<LONG> arStart;
CAtlArray<LONG> arEnd;
LONG lStartCur = 0;
LONG lEndCur = 0;
for (LONG iCF = 0; iCF < lCountCFs; ++iCF)
{
lEndCur = lStartCur + pTextAttributes->m_arCFs[iCF].lCount - 1;
arStart.Add(lStartCur);
arEnd.Add(lEndCur);
lStartCur = lEndCur + 1;
}
// Ranges
for (LONG iR = 0; iR < lCountHyper; ++iR)
{
LONG lStart = ((*pRanges)[iR]).m_lStart;
LONG lEnd = ((*pRanges)[iR]).m_lEnd;
if (lStart > lEnd)
continue;
LONG lStartFound = -1;
LONG lEndFound = -1;
lCountCFs = (LONG)pTextAttributes->m_arCFs.GetCount();
for (LONG iCF = 0; iCF < lCountCFs; ++iCF)
{
BOOL bStart = ((lStart >= arStart[iCF]) && (lStart <= arEnd[iCF]));
BOOL bEnd = ((lEnd >= arStart[iCF]) && (lEnd <= arEnd[iCF]));
if (-1 == lStartFound && bStart)
lStartFound = iCF;
if (-1 == lEndFound && bEnd)
lEndFound = iCF;
}
// ,
if (-1 == lStartFound || -1 == lEndFound)
continue;
if (lStartFound == lEndFound)
{
InsertCF(lStart, lEnd, pTextAttributes->m_arCFs, arStart, arEnd, lStartFound, oColor);
}
else if (lEndFound > lStartFound)
{
//
//
InsertCF(lStart, arEnd[lStartFound], pTextAttributes->m_arCFs, arStart, arEnd, lStartFound, oColor);
LONG lPlus = (LONG)pTextAttributes->m_arCFs.GetCount() - lCountCFs;
lCountCFs += lPlus;
InsertCF(arStart[lEndFound + lPlus], lEnd, pTextAttributes->m_arCFs, arStart, arEnd, lEndFound + lPlus, oColor);
}
}
// ...
/*for (size_t i = 0; i < pTextAttributes->m_arCFs.GetCount(); ++i)
{
pTextAttributes->m_arCFs[i].hasColor = true;
pTextAttributes->m_arCFs[i].oColor = oColor;
}*/
}
void InsertCF(LONG lStartH, LONG lEndH, CAtlArray<STextCFRun>& oArrayCF, CAtlArray<LONG>& arStart, CAtlArray<LONG>&arEnd, LONG lIndexFound, SColorAtom& oColor)
{
STextCFRun oRunOld = oArrayCF[lIndexFound];
STextCFRun oRunNew = oRunOld;
oRunNew.oColor = oColor;
oRunNew.fontStyle |= 0x04;
oRunNew.hasUnderline = true;
LONG lSize1 = lStartH - arStart[lIndexFound];
LONG lSize2 = lEndH - lStartH + 1;
LONG lSize3 = arEnd[lIndexFound] - lEndH;
if (lSize1 > 0 && lSize3 > 0)
{
oArrayCF[lIndexFound].lCount = lSize1;
arEnd[lIndexFound] = arStart[lIndexFound] + lSize1 - 1;
oRunNew.lCount = lSize2;
oArrayCF.InsertAt(lIndexFound + 1, oRunNew);
arStart.InsertAt(lIndexFound + 1, arEnd[lIndexFound] + 1);
arEnd.InsertAt(lIndexFound + 1, arStart[lIndexFound + 1] + lSize2 - 1);
oRunOld.lCount = lSize3;
oArrayCF.InsertAt(lIndexFound + 2, oRunOld);
arStart.InsertAt(lIndexFound + 2, arEnd[lIndexFound + 1] + 1);
arEnd.InsertAt(lIndexFound + 2, arStart[lIndexFound + 2] + lSize3 - 1);
}
else if (lSize1 > 0)
{
oArrayCF[lIndexFound].lCount = lSize1;
arEnd[lIndexFound] = arStart[lIndexFound] + lSize1 - 1;
oRunNew.lCount = lSize2;
oArrayCF.InsertAt(lIndexFound + 1, oRunNew);
arStart.InsertAt(lIndexFound + 1, arEnd[lIndexFound] + 1);
arEnd.InsertAt(lIndexFound + 1, arStart[lIndexFound + 1] + lSize2 - 1);
}
else if (lSize3 > 0)
{
oArrayCF[lIndexFound] = oRunNew;
oArrayCF[lIndexFound].lCount = lSize2;
arEnd[lIndexFound] = arStart[lIndexFound] + lSize2 - 1;
oRunOld.lCount = lSize3;
oArrayCF.InsertAt(lIndexFound + 1, oRunOld);
arStart.InsertAt(lIndexFound + 1, arEnd[lIndexFound] + 1);
arEnd.InsertAt(lIndexFound + 1, arStart[lIndexFound + 1] + lSize3 - 1);
}
else
{
oArrayCF[lIndexFound] = oRunNew;
}
}
};
\ No newline at end of file
#pragma once
#include "../../../ASCPresentationEditor/OfficeDrawing/Document.h"
class CElementInfo
{
public:
LONG m_lOffsetTextStyle;
LONG m_lOffsetTextProp;
POLE::Stream* m_pStream;
LONG m_lPersistIndex;
LONG m_lMasterTextType;
LONG m_lMasterPlaceholderType;
public:
CElementInfo()
{
m_lOffsetTextStyle = -1;
m_lOffsetTextProp = -1;
m_lPersistIndex = -1;
m_pStream = NULL;
m_lMasterTextType = -1;
m_lMasterPlaceholderType = -1;
}
CElementInfo(const CElementInfo& oSrc)
{
*this = oSrc;
}
CElementInfo& operator=(const CElementInfo& oSrc)
{
m_lOffsetTextStyle = oSrc.m_lOffsetTextStyle;
m_lOffsetTextProp = oSrc.m_lOffsetTextProp;
m_lPersistIndex = oSrc.m_lPersistIndex;
m_pStream = oSrc.m_pStream;
m_lMasterTextType = oSrc.m_lMasterTextType;
m_lMasterPlaceholderType = oSrc.m_lMasterPlaceholderType;
return *this;
}
~CElementInfo()
{
}
};
class CSlideInfo
{
public:
std::vector<CTextFullSettings> m_arTextPlaceHolders;
std::map<LONG, CElementInfo> m_mapElements;
//std::unordered_map<LONG, CElementInfo> m_mapElements;
std::vector<BOOL>* m_parEmptyPictures;
nullable_base<NSPresentationEditor::CTextStyles> m_pStyles[9];
public:
CSlideInfo()
{
}
~CSlideInfo()
{
}
CSlideInfo(const CSlideInfo& oSrc)
{
*this = oSrc;
}
CSlideInfo& operator=(const CSlideInfo& oSrc)
{
m_arTextPlaceHolders = oSrc.m_arTextPlaceHolders;
m_parEmptyPictures = oSrc.m_parEmptyPictures;
for (int i = 0; i < 9; ++i)
{
m_pStyles[i] = oSrc.m_pStyles[i];
}
//m_mapElements.clear();
//for (std::map<LONG, CElementInfo>::const_iterator it = oSrc.m_mapElements.begin(); it != oSrc.m_mapElements.end(); ++it)
//{
// m_mapElements.insert(std::pair<LONG, CElementInfo>(it->first,it->second));
//}
m_mapElements = oSrc.m_mapElements;
return *this;
}
DWORD GetIndexPicture(DWORD lIndex)
{
if (NULL == m_parEmptyPictures)
return lIndex;
LONG lResult = 0;
size_t nCount = m_parEmptyPictures->size();
if (lIndex > nCount)
return 0;
for (size_t nIndex = 0; nIndex < lIndex; ++nIndex)
{
if ((*m_parEmptyPictures)[nIndex])
++lResult;
}
return lIndex - lResult;
}
};
\ No newline at end of file
#include "SlidePersist.h"
#include "../Records/TextFullSettings.h"
SSlidePersist::SSlidePersist() : m_arTextAttrs()
{
}
SSlidePersist::SSlidePersist(const SSlidePersist& oSrc)
{
*this = oSrc;
}
CString SSlidePersist::ToString()
{
CString str = _T("");
str.Format(_T("<SlideInfo PsrRef='%d' SlideID='%d' />"), m_nPsrRef, m_nSlideID);
return str;
}
SSlidePersist& SSlidePersist::operator =(const SSlidePersist& oSrc)
{
m_nPsrRef = oSrc.m_nPsrRef;
m_nSlideID = oSrc.m_nSlideID;
m_arTextAttrs = oSrc.m_arTextAttrs;
return (*this);
}
\ No newline at end of file
#pragma once
#if defined(_WIN32) || defined (_WIN64)
#include <atlbase.h>
#include <atlstr.h>
#else
#include "../../../../DesktopEditor/common/ASCVariant.h"
#include "../../../../Common/DocxFormat/Source/Base/ASCString.h"
#endif
#include <vector>
/**************************************************************
...
**************************************************************/
class CTextFullSettings;
struct SSlidePersist
{
DWORD m_nPsrRef;
DWORD m_nSlideID;
std::vector<CTextFullSettings> m_arTextAttrs;
SSlidePersist();
SSlidePersist(const SSlidePersist& oSrc);
CString ToString();
SSlidePersist& operator =(const SSlidePersist& oSrc);
};
#pragma once
#include "../Reader/Records.h"
class CRecordAnimationInfoAtom : public CUnknownRecord
{
// ...
public:
CRecordAnimationInfoAtom()
{
}
~CRecordAnimationInfoAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#include "AnimationTypes.h"
//----------------------------------------------------------------------------------------------------------------------//
// Animation Types //
//----------------------------------------------------------------------------------------------------------------------//
/*
static const wchar_t EffectBehaviorBlindsHorizontal [] = L"blinds(horizontal)";
static const wchar_t EffectBehaviorBoxIn [] = L"box(in)";
static const wchar_t EffectBehaviorBoxOut [] = L"box(out)";
static const wchar_t EffectBehaviorCheckerboardAcross [] = L"checkerboard(across)";
static const wchar_t EffectBehaviorCheckerboardDown [] = L"checkerboard(down)";
static const wchar_t EffectBehaviorCircleIn [] = L"circle(in)";
static const wchar_t EffectBehaviorCircleOut [] = L"circle(out)";
static const wchar_t EffectBehaviorDiamondIn [] = L"diamond(in)";
static const wchar_t EffectBehaviorDiamonOut [] = L"diamond(out)";
static const wchar_t EffectBehaviorDissolve [] = L"dissolve";
static const wchar_t EffectBehaviorFade [] = L"fade";
static const wchar_t EffectBehaviorPlusIn [] = L"plus(in)";
static const wchar_t EffectBehaviorPlusOut [] = L"plus(out)";
static const wchar_t EffectBehaviorBarnInVertical [] = L"barn(inVertical)";
static const wchar_t EffectBehaviorBarnInHorizontal [] = L"barn(inHorizontal)";
static const wchar_t EffectBehaviorBarnOutVertical [] = L"barn(outVertical)";
static const wchar_t EffectBehaviorBarnOnHorizontal [] = L"barn(outHorizontal)";
static const wchar_t EffectBehaviorRandomBarHorizontal [] = L"randombar(horizontal)";
static const wchar_t EffectBehaviorRandomBarVertical [] = L"randombar(vertical)";
static const wchar_t EffectBehaviorStripsDownLeft [] = L"strips(downLeft)";
static const wchar_t EffectBehaviorStripsUpLeft [] = L"strips(upLeft)";
static const wchar_t EffectBehaviorStripsDownRight [] = L"strips(downRight)";
static const wchar_t EffectBehaviorStripsUpRight [] = L"strips(upRight)";
static const wchar_t EffectBehaviorWedge [] = L"wedge";
static const wchar_t EffectBehaviorWheel1 [] = L"wheel(1)";
static const wchar_t EffectBehaviorWheel2 [] = L"wheel(2)";
static const wchar_t EffectBehaviorWheel3 [] = L"wheel(3)";
static const wchar_t EffectBehaviorWheel4 [] = L"wheel(4)";
static const wchar_t EffectBehaviorWheel8 [] = L"wheel(8)";
static const wchar_t EffectBehaviorWipeRight [] = L"wipe(right)";
static const wchar_t EffectBehaviorWipeLeft [] = L"wipe(left)";
static const wchar_t EffectBehaviorWipeUp [] = L"wipe(up)";
static const wchar_t EffectBehaviorWipeDown [] = L"wipe(down)";
*/
#pragma region _MACROSES_
#define GET_ENUM_STRING(NAMEE,VALUEE) \
case TL_##NAMEE##VALUEE: \
return CString(_T("TL_")) + CString(_T(#NAMEE)) + CString(#VALUEE); \
break;
#if defined(_WIN32) || defined (_WIN64)
#define GET_EFFECT_NAME_BY_ID(VALUE,DESCRIPTION) \
case (##VALUE) : return CString(_T(#DESCRIPTION)); break;
#else
#define GET_EFFECT_NAME_BY_ID(VALUE,DESCRIPTION) \
case ##VALUE : return CString(_T(#DESCRIPTION)); break;
#endif
#pragma endregion
namespace Animations
{
CString Helpers::GetTimePropertyID4TimeNode ( TimePropertyID4TimeNode Value )
{
switch ( Value )
{
GET_ENUM_STRING ( TPID_, Display );
GET_ENUM_STRING ( TPID_, MasterPos );
GET_ENUM_STRING ( TPID_, SlaveType );
GET_ENUM_STRING ( TPID_, EffectID );
GET_ENUM_STRING ( TPID_, EffectDir );
GET_ENUM_STRING ( TPID_, AfterEffect );
GET_ENUM_STRING ( TPID_, SlideCount );
GET_ENUM_STRING ( TPID_, TimeFilter );
GET_ENUM_STRING ( TPID_, EventFilter );
GET_ENUM_STRING ( TPID_, HideWhenStopped );
GET_ENUM_STRING ( TPID_, GroupID );
GET_ENUM_STRING ( TPID_, EffectNodeType );
GET_ENUM_STRING ( TPID_, PlaceholderNode );
GET_ENUM_STRING ( TPID_, MediaVolume );
GET_ENUM_STRING ( TPID_, MediaMute );
GET_ENUM_STRING ( TPID_, ZoomToFullScreen );
default:
return CString ( _T("TimePropertyID4TimeNode : Unknown Enum") );
}
};
CString Helpers::GetTimeVariantTypeEnum ( TimeVariantTypeEnum Value )
{
switch ( Value )
{
GET_ENUM_STRING ( TVT_, Bool );
GET_ENUM_STRING ( TVT_, Int );
GET_ENUM_STRING ( TVT_, Float );
GET_ENUM_STRING ( TVT_, String );
default:
return CString ( _T("TimeVariantTypeEnum : Unknown Enum") );
}
};
CString Helpers::GetTimeNodeTypeEnum ( TimeNodeTypeEnum Value )
{
switch ( Value )
{
GET_ENUM_STRING ( TNT_, Parallel );
GET_ENUM_STRING ( TNT_, Sequential );
GET_ENUM_STRING ( TNT_, Behavior );
GET_ENUM_STRING ( TNT_, Media );
default:
return CString ( _T("TimeNodeTypeEnum : Unknown Enum") );
}
};
CString Helpers::GetTriggerObjectEnum ( TriggerObjectEnum Value )
{
switch ( Value )
{
GET_ENUM_STRING ( TOT_, None ); // None
GET_ENUM_STRING ( TOT_, VisualElement ); // An animatable object.
GET_ENUM_STRING ( TOT_, TimeNode ); // A time node.
GET_ENUM_STRING ( TOT_, RuntimeNodeRef ); // Runtime child time nodes.
default:
return CString ( _T("TriggerObjectEnum : Unknown Enum") );
}
}
CString Helpers::GetTimeVisualElementEnum ( TimeVisualElementEnum Value )
{
switch ( Value )
{
GET_ENUM_STRING ( TVET_, Shape );
GET_ENUM_STRING ( TVET_, Page );
GET_ENUM_STRING ( TVET_, TextRange );
GET_ENUM_STRING ( TVET_, Audio );
GET_ENUM_STRING ( TVET_, Video );
GET_ENUM_STRING ( TVET_, ChartElement );
GET_ENUM_STRING ( TVET_, ShapeOnly );
GET_ENUM_STRING ( TVET_, AllTextRange );
default:
return CString ( _T("TimeVisualElementEnum : Unknown Enum") );
}
}
CString Helpers::GetElementTypeEnum ( ElementTypeEnum Value )
{
switch ( Value )
{
GET_ENUM_STRING ( ET_, ShapeType );
GET_ENUM_STRING ( ET_, SoundType );
default:
return CString ( _T("ElementTypeEnum : Unknown Enum") );
}
}
CString Helpers::GetTimeAnimateBehaviorValueTypeEnum ( TimeAnimateBehaviorValueTypeEnum Value )
{
switch ( Value )
{
GET_ENUM_STRING ( TABVT_, String );
GET_ENUM_STRING ( TABVT_, Number );
GET_ENUM_STRING ( TABVT_, Color );
default:
return CString ( _T("TimeAnimateBehaviorValueTypeEnum : Unknown Enum") );
}
}
CString Helpers::IntToHexString ( DWORD dwValue )
{
CString sFormat;
sFormat.Format (_T("0x%.8x"), dwValue);
return sFormat;
}
CString Helpers::DoubleToString ( double dValue )
{
CString sFormat;
sFormat.Format (_T("%f"), dValue);
return sFormat;
}
CString Helpers::IntToString ( int nValue )
{
CString sFormat;
sFormat.Format (_T("%d"), nValue);
return sFormat;
}
CString Helpers::GetAnimationClassName ( AnimationsClassType Value )
{
switch ( Value )
{
case Animations::RT_TimeNode:
return CString (_T("TimeNodeAtom") );
case Animations::RT_TimePropertyList: // Specifies a TimePropertyList4TimeNodeContainer or TimePropertyList4TimeBehavior.
return CString (_T("TimePropertyList4TimeNodeContainer"));
case Animations::RT_TimeExtTimeNodeContainer:
return CString (_T("ExtTimeNodeContainer"));
case Animations::RT_SlideTime10Atom :
return CString (_T("SlideTime10Atom"));
case Animations::RT_SlideFlags10Atom:
return CString (_T("SlideFlags10Atom"));
case Animations::RT_HashCodeAtom:
return CString (_T("HashCode10Atom"));
case Animations::RT_TimeSequenceData:
return CString (_T("TimeSequenceDataAtom"));
case Animations::RT_TimeConditionContainer:
return CString (_T("TimeConditionContainer"));
case Animations::RT_TimeCondition:
return CString (_T("TimeConditionAtom"));
}
return CString (_T(""));
}
CString Helpers::GetEffectTypeOfGroup ( DWORD Value )
{
if ( 0x00000001 == Value )
return CString ( _T("Entrance") );
if ( 0x00000002 == Value )
return CString ( _T("Exit") );
if ( 0x00000003 == Value )
return CString ( _T("Emphasis") );
if ( 0x00000004 == Value )
return CString ( _T("MotionPath") );
if ( 0x00000005 == Value )
return CString ( _T("ActionVerb") );
if ( 0x00000006 == Value )
return CString ( _T("MediaCommand") );
return CString ( _T("") );
}
// the corresponding effect type is an entrance or an exit effect
CString Helpers::GetEffectEntranceOrExitNameByID ( DWORD EffectID )
{
switch ( EffectID )
{
GET_EFFECT_NAME_BY_ID ( 0x00000000, Custom ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000001, Appear ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000002, FlyIn ); //
GET_EFFECT_NAME_BY_ID ( 0x00000003, Blinds ); //
GET_EFFECT_NAME_BY_ID ( 0x00000004, Box ); //
GET_EFFECT_NAME_BY_ID ( 0x00000005, CheckBoard ); //
GET_EFFECT_NAME_BY_ID ( 0x00000006, Circle ); //
GET_EFFECT_NAME_BY_ID ( 0x00000007, Crawl ); //
GET_EFFECT_NAME_BY_ID ( 0x00000008, Diamond ); //
GET_EFFECT_NAME_BY_ID ( 0x00000009, Dissolve ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x0000000A, Fade ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x0000000B, FlashOnce ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x0000000C, Peek ); //
GET_EFFECT_NAME_BY_ID ( 0x0000000D, Plus ); //
GET_EFFECT_NAME_BY_ID ( 0x0000000E, RandomBars ); //
GET_EFFECT_NAME_BY_ID ( 0x0000000F, Spiral ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000010, Split ); //
GET_EFFECT_NAME_BY_ID ( 0x00000011, Stretch ); //
GET_EFFECT_NAME_BY_ID ( 0x00000012, Strips ); //
GET_EFFECT_NAME_BY_ID ( 0x00000013, Swivel ); //
GET_EFFECT_NAME_BY_ID ( 0x00000014, Wedge ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000015, Wheel ); //
GET_EFFECT_NAME_BY_ID ( 0x00000016, Wipe ); //
GET_EFFECT_NAME_BY_ID ( 0x00000017, Zoom ); //
GET_EFFECT_NAME_BY_ID ( 0x00000018, RandomEffects ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000019, Boomerang ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x0000001A, Bounce ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x0000001B, ColorReveal ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x0000001C, Credits ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x0000001D, EaseIn ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x0000001E, Float ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x0000001F, GrowAndTurn ); // The corresponding effect direction MUST be ignored.
//GET_EFFECT_NAME_BY_ID ( 0x00000020, Reserved ); //
//GET_EFFECT_NAME_BY_ID ( 0x00000021, Reserved ); //
GET_EFFECT_NAME_BY_ID ( 0x00000022, LightSpeed ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000023, PinWheel ); // The corresponding effect direction MUST be ignored.
//GET_EFFECT_NAME_BY_ID ( 0x00000024, Reserved ); //
GET_EFFECT_NAME_BY_ID ( 0x00000025, RiseUp ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000026, Swish ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000027, ThinLine ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000028, Unfold ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000029, Whip ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x0000002A, Ascend ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x0000002B, CenterRevolve ); // The corresponding effect direction MUST be ignored.
//GET_EFFECT_NAME_BY_ID ( 0x0000002C, Reserved ); //
GET_EFFECT_NAME_BY_ID ( 0x0000002D, FadedSwivel ); // The corresponding effect direction MUST be ignored.
//GET_EFFECT_NAME_BY_ID ( 0x0000002E, Reserved ); //
GET_EFFECT_NAME_BY_ID ( 0x0000002F, Descend ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000030, Sling ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000031, Spinner ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000032, Compress ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000033, Zip ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000034, ArcUp ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000035, FadedZoom ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000036, Glide ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000037, Expand ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000038, Flip ); // The corresponding effect direction MUST be ignored.
//GET_EFFECT_NAME_BY_ID ( 0x00000039, Reserved ); //
GET_EFFECT_NAME_BY_ID ( 0x0000003A, Fold ); // The corresponding effect direction MUST be ignored.
default :
break;
}
return CString(_T("Unknown EffectID"));
}
// the corresponding effect type is an emphasis effect
CString Helpers::GetEffectEmphasisNameByID ( DWORD EffectID )
{
switch ( EffectID )
{
GET_EFFECT_NAME_BY_ID ( 0x00000001, ChangeFillColor ); //
GET_EFFECT_NAME_BY_ID ( 0x00000002, ChangeFont ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000003, ChangeFillColor ); //
GET_EFFECT_NAME_BY_ID ( 0x00000004, ChangeFontSize ); //
GET_EFFECT_NAME_BY_ID ( 0x00000005, ChangeFontStyle ); //
GET_EFFECT_NAME_BY_ID ( 0x00000006, GrowAndShrink ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000007, ChangeFillColor ); //
GET_EFFECT_NAME_BY_ID ( 0x00000008, Spin ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000009, Transparency ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x0000000A, BoldFlash ); // The corresponding effect direction MUST be ignored.
//GET_EFFECT_NAME_BY_ID ( 0x0000000B, Reserved ); //
//GET_EFFECT_NAME_BY_ID ( 0x0000000C, Reserved ); //
//GET_EFFECT_NAME_BY_ID ( 0x0000000D, Reserved ); //
GET_EFFECT_NAME_BY_ID ( 0x0000000E, Blast ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x0000000F, BoldReveal ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000010, BrushOnColor ); // The corresponding effect direction MUST be ignored.
//GET_EFFECT_NAME_BY_ID ( 0x00000011, Reserved ); //
GET_EFFECT_NAME_BY_ID ( 0x00000012, BrushOnUnderline ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000013, ColorBlend ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000014, ColorWave ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000015, ComplementaryColor ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000016, ComplementaryColor2 ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000017, ContrastingColor ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000018, Darken ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000019, Desaturate ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x0000001A, FlashBulb ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x0000001B, Flicker ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x0000001C, GrowWithColor ); // The corresponding effect direction MUST be ignored.
//GET_EFFECT_NAME_BY_ID ( 0x0000001D, Reserved ); //
GET_EFFECT_NAME_BY_ID ( 0x0000001E, Lighten ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x0000001F, StyleEmphasis ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000020, Teeter ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000021, VerticalGrow ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000022, Wave ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000023, Blink ); // The corresponding effect direction MUST be ignored.
GET_EFFECT_NAME_BY_ID ( 0x00000024, Shimmer ); // The corresponding effect direction MUST be ignored.
default :
break;
}
return CString(_T("Unknown EffectID"));
}
// the corresponding effect type is a motion path effect
CString Helpers::GetEffectMotionPathNameByID ( DWORD EffectID )
{
switch ( EffectID )
{
GET_EFFECT_NAME_BY_ID ( 0x00000000, Custom );
GET_EFFECT_NAME_BY_ID ( 0x00000001, Circle );
GET_EFFECT_NAME_BY_ID ( 0x00000002, RightTriangle );
GET_EFFECT_NAME_BY_ID ( 0x00000003, Diamond );
GET_EFFECT_NAME_BY_ID ( 0x00000004, Hexagon );
GET_EFFECT_NAME_BY_ID ( 0x00000005, FivePointStar );
GET_EFFECT_NAME_BY_ID ( 0x00000006, CrescentMoon );
GET_EFFECT_NAME_BY_ID ( 0x00000007, Square );
GET_EFFECT_NAME_BY_ID ( 0x00000008, Trapezoid );
GET_EFFECT_NAME_BY_ID ( 0x00000009, Heart );
GET_EFFECT_NAME_BY_ID ( 0x0000000A, Octagon );
GET_EFFECT_NAME_BY_ID ( 0x0000000B, SixPointStar );
GET_EFFECT_NAME_BY_ID ( 0x0000000C, Football );
GET_EFFECT_NAME_BY_ID ( 0x0000000D, EqualTriangle );
GET_EFFECT_NAME_BY_ID ( 0x0000000E, Parallelogram );
GET_EFFECT_NAME_BY_ID ( 0x0000000F, Pentagon );
GET_EFFECT_NAME_BY_ID ( 0x00000010, FourPointStar );
GET_EFFECT_NAME_BY_ID ( 0x00000011, EightPointStar );
GET_EFFECT_NAME_BY_ID ( 0x00000012, Teardrop );
GET_EFFECT_NAME_BY_ID ( 0x00000013, PointyStar );
GET_EFFECT_NAME_BY_ID ( 0x00000014, CurvedSquare );
GET_EFFECT_NAME_BY_ID ( 0x00000015, CurvedX );
GET_EFFECT_NAME_BY_ID ( 0x00000016, VerticalFigure8 );
GET_EFFECT_NAME_BY_ID ( 0x00000017, CurvyStar );
GET_EFFECT_NAME_BY_ID ( 0x00000018, LoopDeLoop );
GET_EFFECT_NAME_BY_ID ( 0x00000019, BuzzSaw );
GET_EFFECT_NAME_BY_ID ( 0x0000001A, HorizontalFigure8 );
GET_EFFECT_NAME_BY_ID ( 0x0000001B, Peanut );
GET_EFFECT_NAME_BY_ID ( 0x0000001C, Figure8four );
GET_EFFECT_NAME_BY_ID ( 0x0000001D, Neutron );
GET_EFFECT_NAME_BY_ID ( 0x0000001E, Swoosh );
GET_EFFECT_NAME_BY_ID ( 0x0000001F, Bean );
GET_EFFECT_NAME_BY_ID ( 0x00000020, Plus );
GET_EFFECT_NAME_BY_ID ( 0x00000021, InvertedTriangle );
GET_EFFECT_NAME_BY_ID ( 0x00000022, InvertedSquare );
GET_EFFECT_NAME_BY_ID ( 0x00000023, Left );
GET_EFFECT_NAME_BY_ID ( 0x00000024, TurnRight );
GET_EFFECT_NAME_BY_ID ( 0x00000025, ArcDown );
GET_EFFECT_NAME_BY_ID ( 0x00000026, Zigzag );
GET_EFFECT_NAME_BY_ID ( 0x00000027, SCurve2 );
GET_EFFECT_NAME_BY_ID ( 0x00000028, SineWave );
GET_EFFECT_NAME_BY_ID ( 0x00000029, BounceLeft );
GET_EFFECT_NAME_BY_ID ( 0x0000002A, Down );
GET_EFFECT_NAME_BY_ID ( 0x0000002B, TurnUp );
GET_EFFECT_NAME_BY_ID ( 0x0000002C, ArcUp );
GET_EFFECT_NAME_BY_ID ( 0x0000002D, HeartBeat );
GET_EFFECT_NAME_BY_ID ( 0x0000002E, SpiralRight );
GET_EFFECT_NAME_BY_ID ( 0x0000002F, Wave );
GET_EFFECT_NAME_BY_ID ( 0x00000030, CurvyLeft );
GET_EFFECT_NAME_BY_ID ( 0x00000031, DiagonalDownRight );
GET_EFFECT_NAME_BY_ID ( 0x00000032, TurnDown );
GET_EFFECT_NAME_BY_ID ( 0x00000033, ArcLeft );
GET_EFFECT_NAME_BY_ID ( 0x00000034, Funnel );
GET_EFFECT_NAME_BY_ID ( 0x00000035, Spring );
GET_EFFECT_NAME_BY_ID ( 0x00000036, BounceRight );
GET_EFFECT_NAME_BY_ID ( 0x00000037, SpiralLeft );
GET_EFFECT_NAME_BY_ID ( 0x00000038, DiagonalUpRight );
GET_EFFECT_NAME_BY_ID ( 0x00000039, TurnUpRight );
GET_EFFECT_NAME_BY_ID ( 0x0000003A, ArcRight );
GET_EFFECT_NAME_BY_ID ( 0x0000003B, Scurve1 );
GET_EFFECT_NAME_BY_ID ( 0x0000003C, DecayingWave );
GET_EFFECT_NAME_BY_ID ( 0x0000003D, CurvyRight );
GET_EFFECT_NAME_BY_ID ( 0x0000003E, StairsDown );
GET_EFFECT_NAME_BY_ID ( 0x0000003F, Right );
GET_EFFECT_NAME_BY_ID ( 0x00000040, Up );
default :
break;
}
return CString(_T("Unknown EffectID"));
}
CString Helpers::GetEffectNameByID ( DWORD EffectType, DWORD EffectID )
{
switch ( EffectType )
{
case 0x00000001: // Entrance +
case 0x00000002: // Exit
return Animations::Helpers::GetEffectEntranceOrExitNameByID ( EffectID );
break;
case 0x00000003: // Emphasis +
return Animations::Helpers::GetEffectEmphasisNameByID ( EffectID );
break;
case 0x00000004: // Motion path +
return Animations::Helpers::GetEffectMotionPathNameByID ( EffectID );
break;
case 0x00000005: // Action verb
case 0x00000006: // Media command
default:
break;
}
return CString ( _T("") );
}
}
namespace Animations
{
IRecord* CAnimationFactory::BuildAnimationObject ( WORD Type )
{
switch ( Type )
{
case Animations::RT_SlideTime10Atom :
return new Animations::SlideTime10Atom ();
case Animations::RT_SlideFlags10Atom:
return new Animations::SlideFlags10Atom ();
case Animations::RT_HashCodeAtom:
return new Animations::HashCode10Atom ();
case Animations::RT_TimeExtTimeNodeContainer:
return new Animations::ExtTimeNodeContainer ();
case Animations::RT_TimeNode:
return new Animations::TimeNodeAtom ();
case Animations::RT_TimePropertyList: // Specifies a TimePropertyList4TimeNodeContainer or TimePropertyList4TimeBehavior.
return new Animations::TimePropertyList4TimeNodeContainer ();
case Animations::RT_TimeSequenceData:
return new Animations::TimeSequenceDataAtom ();
case Animations::RT_TimeConditionContainer:
return new TimeConditionContainer ();
case Animations::RT_TimeCondition:
return new TimeConditionAtom ();
case Animations::RT_TimeClientVisualElement:
return new ClientVisualElementContainer ();
case Animations::RT_VisualPageAtom:
return new VisualPageAtom ();
case Animations::RT_TimeEffectBehaviorContainer:
return new TimeEffectBehaviorContainer ();
case Animations::RT_TimeEffectBehavior:
return new TimeEffectBehaviorAtom ();
case Animations::RT_TimeBehavior:
return new TimeBehaviorAtom ();
case Animations::RT_TimeBehaviorContainer:
return new TimeBehaviorContainer ();
case Animations::RT_TimeMotionBehaviorContainer:
return new TimeMotionBehaviorContainer ();
case Animations::RT_TimeSetBehaviorContainer:
return new TimeSetBehaviorContainer ();
case Animations::RT_TimeAnimateBehaviorContainer:
return new TimeAnimateBehaviorContainer ();
case Animations::RT_TimeScaleBehaviorContainer:
return new TimeScaleBehaviorContainer ();
case Animations::RT_TimeRotationBehaviorContainer:
return new TimeRotationBehaviorContainer ();
case Animations::RT_TimeSlaveContainer:
return new SlaveContainer ();
case Animations::RT_TimeModifierAtom:
return new TimeModifierAtom();
}
return NULL;
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
#pragma once
#include "../Reader/Records.h"
class CRecordBlipEntityAtom : public CUnknownRecord
{
BYTE m_nWinBlipType;
BYTE* m_pImage;
public:
CRecordBlipEntityAtom()
{
}
~CRecordBlipEntityAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordBookmarkEntityAtom : public CUnknownRecord
{
UINT m_nID;
CStringW m_strName;
public:
CRecordBookmarkEntityAtom()
{
}
~CRecordBookmarkEntityAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordBookmarkSeedAtom : public CUnknownRecord
{
INT m_nBookmarkID;
public:
CRecordBookmarkSeedAtom()
{
}
~CRecordBookmarkSeedAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordCString : public CUnknownRecord
{
public:
CStringW m_strText;
public:
CRecordCString()
{
}
~CRecordCString()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_strText = StreamUtils::ReadCStringW(pStream, m_oHeader.RecLen / 2);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("String"), (CString)m_strText, &oWriter);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordColorSchemeAtom : public CUnknownRecord
{
SColorAtom m_oBackgroundColor;
SColorAtom m_oTextAndLinesColor;
SColorAtom m_oShadowsColor;
SColorAtom m_oTitleTextColor;
SColorAtom m_oFillsColor;
SColorAtom m_oAccentColor;
SColorAtom m_oAccentAndHyperlinkColor;
SColorAtom m_oAccentAndFollowingHyperlinkColor;
public:
CRecordColorSchemeAtom()
{
}
~CRecordColorSchemeAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
NSStreamReader::Read(pStream, m_oBackgroundColor);
NSStreamReader::Read(pStream, m_oTextAndLinesColor);
NSStreamReader::Read(pStream, m_oShadowsColor);
NSStreamReader::Read(pStream, m_oTitleTextColor);
NSStreamReader::Read(pStream, m_oFillsColor);
NSStreamReader::Read(pStream, m_oAccentColor);
NSStreamReader::Read(pStream, m_oAccentAndHyperlinkColor);
NSStreamReader::Read(pStream, m_oAccentAndFollowingHyperlinkColor);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
oWriter.WriteString(m_oBackgroundColor.ToString(_T("Background")));
oWriter.WriteString(m_oTextAndLinesColor.ToString(_T("TextAndLines")));
oWriter.WriteString(m_oShadowsColor.ToString(_T("ShadowsColor")));
oWriter.WriteString(m_oTitleTextColor.ToString(_T("TitleText")));
oWriter.WriteString(m_oFillsColor.ToString(_T("FillsColor")));
oWriter.WriteString(m_oAccentColor.ToString(_T("Accent")));
oWriter.WriteString(m_oAccentAndHyperlinkColor.ToString(_T("AccentAndHyperlink")));
oWriter.WriteString(m_oAccentAndFollowingHyperlinkColor.ToString(_T("AccentAndFollowingHyperlink")));
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
void ToArray(std::vector<SColorAtom>* pArray)
{
if (NULL != pArray)
{
pArray->push_back(m_oBackgroundColor);
pArray->push_back(m_oTextAndLinesColor);
pArray->push_back(m_oShadowsColor);
pArray->push_back(m_oTitleTextColor);
pArray->push_back(m_oFillsColor);
pArray->push_back(m_oAccentColor);
pArray->push_back(m_oAccentAndHyperlinkColor);
pArray->push_back(m_oAccentAndFollowingHyperlinkColor);
}
}
void ToArray(std::vector<CColor>* pArray)
{
CColor oColor;
if (NULL != pArray)
{
m_oBackgroundColor.ToColor(&oColor);
pArray->push_back(oColor);
m_oTextAndLinesColor.ToColor(&oColor);
pArray->push_back(oColor);
m_oShadowsColor.ToColor(&oColor);
pArray->push_back(oColor);
m_oTitleTextColor.ToColor(&oColor);
pArray->push_back(oColor);
m_oFillsColor.ToColor(&oColor);
pArray->push_back(oColor);
m_oAccentColor.ToColor(&oColor);
pArray->push_back(oColor);
m_oAccentAndHyperlinkColor.ToColor(&oColor);
pArray->push_back(oColor);
m_oAccentAndFollowingHyperlinkColor.ToColor(&oColor);
pArray->push_back(oColor);
}
}
};
\ No newline at end of file
#pragma once
#include "../Records/RecordsIncluder.h"
#define NO_ENCRYPT 0xE391C05F
#define ENCRYPT 0xF3D1C4DF
class CRecordCurrentUserAtom : public CUnknownRecord
{
public:
DWORD m_nSize; // must be 0x00000014
DWORD m_nToken; // encrypt or not
DWORD m_nOffsetToCurEdit; // offset to UserEditAtom in PPTDocStream
USHORT m_nLenUserName;
USHORT m_nDocFileVersion; // must be 0x03F4
BYTE m_nMajorVersion; // must be 0x03
BYTE m_nMinorVersion; // must be 0x00
CStringA m_strANSIUserName;
CStringW m_strUNICODEUserName;
DWORD m_nRelVersion; // 0x00000008 or 0x00000009
public:
CRecordCurrentUserAtom() : m_nToken(0)
{
m_nRelVersion = m_nDocFileVersion = m_nMinorVersion = m_nMajorVersion = m_nLenUserName = m_nOffsetToCurEdit = 0;
m_nSize = m_nToken =0;
}
~CRecordCurrentUserAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream * pStream)
{
m_oHeader = oHeader;
m_nSize = StreamUtils::ReadDWORD(pStream);
long sz = pStream->size() - pStream->tell();
if (m_nSize > sz )
{
m_nSize = sz ;
}
if (m_nSize < 16) return;
m_nToken = StreamUtils::ReadDWORD(pStream);
m_nOffsetToCurEdit = StreamUtils::ReadDWORD(pStream);
m_nLenUserName = StreamUtils::ReadWORD(pStream);
m_nDocFileVersion = StreamUtils::ReadWORD(pStream);
m_nMajorVersion = StreamUtils::ReadBYTE(pStream);
m_nMinorVersion = StreamUtils::ReadBYTE(pStream);
StreamUtils::StreamSkip(2, pStream);
m_strANSIUserName = StreamUtils::ReadCStringA(pStream, m_nLenUserName);
m_nRelVersion = StreamUtils::ReadDWORD(pStream);
m_strUNICODEUserName = StreamUtils::ReadCStringW(pStream, m_nLenUserName);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("Size"), m_nSize, &oWriter);
CDirectory::WriteValueToNode(_T("Token"), m_nToken, &oWriter);
CDirectory::WriteValueToNode(_T("OffsetToCurEdit"), m_nOffsetToCurEdit, &oWriter);
CString UserName = m_strANSIUserName;
if (UserName.GetLength() < 1)
UserName = m_strUNICODEUserName;
CDirectory::WriteValueToNode(_T("Name"), UserName, &oWriter);
CDirectory::WriteValueToNode(_T("RelVersion"), m_nRelVersion, &oWriter);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
BOOL IsSupported()
{
return (NO_ENCRYPT == m_nToken);
}
};
#pragma once
#include "../Reader/Records.h"
class CRecordDateTimeMCAtom : public CUnknownRecord
{
UINT m_mPosition;
BYTE m_nIndex;
public:
CRecordDateTimeMCAtom()
{
}
~CRecordDateTimeMCAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordDocRoutingSlipAtom : public CUnknownRecord
{
struct SDocRoutingSlipAtom
{
USHORT m_nType;
USHORT m_nLength;
CString m_strText;
};
UINT m_nLength;
UINT m_nRecipientCount;
UINT m_nCurrentRecipient;
USHORT m_usFlags;
SDocRoutingSlipAtom m_oOriginatorString;
SDocRoutingSlipAtom m_oRgRecipientRoutingSlipStrings;
SDocRoutingSlipAtom m_oSubjectString;
SDocRoutingSlipAtom m_oMessageString;
public:
CRecordDocRoutingSlipAtom()
{
}
~CRecordDocRoutingSlipAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordDocumentAtom : public CUnknownRecord
{
public:
SPointAtom m_oSlideSize;
SPointAtom m_oNotesSize;
SRatioAtom m_oServerZoom;
UINT m_nNotesMasterPersistIDRef;
UINT m_nHandoutMasterPersistIDRef;
USHORT m_nFirstSlideNum;
NSOfficePPT::SlideSizeType m_nSlideSizeType;
BOOL1 m_bSaveWithFonts;
BOOL1 m_bOmitTitlePlace;
BOOL1 m_bRightToLeft;
BOOL1 m_bShowComments;
public:
CRecordDocumentAtom()
{
}
~CRecordDocumentAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_oSlideSize.X = StreamUtils::ReadLONG(pStream);
m_oSlideSize.Y = StreamUtils::ReadLONG(pStream);
m_oNotesSize.X = StreamUtils::ReadLONG(pStream);
m_oNotesSize.Y = StreamUtils::ReadLONG(pStream);
m_oServerZoom.Number = StreamUtils::ReadLONG(pStream);
m_oServerZoom.Denom = StreamUtils::ReadLONG(pStream);
m_nNotesMasterPersistIDRef = (UINT)StreamUtils::ReadDWORD(pStream);
m_nHandoutMasterPersistIDRef = (UINT)StreamUtils::ReadDWORD(pStream);
m_nFirstSlideNum = StreamUtils::ReadWORD(pStream);
m_nSlideSizeType = (NSOfficePPT::SlideSizeType)StreamUtils::ReadWORD(pStream);
m_bSaveWithFonts = StreamUtils::ReadBYTE(pStream);
m_bOmitTitlePlace = StreamUtils::ReadBYTE(pStream);
m_bRightToLeft = StreamUtils::ReadBYTE(pStream);
m_bShowComments = StreamUtils::ReadBYTE(pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
oWriter.WriteString(m_oSlideSize.ToString());
oWriter.WriteString(m_oNotesSize.ToString());
oWriter.WriteString(m_oServerZoom.ToString());
CDirectory::WriteValueToNode(_T("NotesMasterPersistIDRef"), (DWORD)m_nNotesMasterPersistIDRef, &oWriter);
CDirectory::WriteValueToNode(_T("HandoutMasterPersistIDRef"), (DWORD)m_nHandoutMasterPersistIDRef, &oWriter);
CDirectory::WriteValueToNode(_T("FirstSlideNum"), (DWORD)m_nFirstSlideNum, &oWriter);
CDirectory::WriteValueToNode(_T("SlideSizeType"), (DWORD)m_nSlideSizeType, &oWriter);
CDirectory::WriteValueToNode(_T("SaveWithFonts"), (DWORD)m_bSaveWithFonts, &oWriter);
CDirectory::WriteValueToNode(_T("OmitTitlePlace"), (DWORD)m_bOmitTitlePlace, &oWriter);
CDirectory::WriteValueToNode(_T("RightToLeft"), (DWORD)m_bRightToLeft, &oWriter);
CDirectory::WriteValueToNode(_T("ShowComments"), (DWORD)m_bShowComments, &oWriter);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordDocument : public CRecordsContainer
{
public:
std::vector<SSlidePersist> m_arMasterPersists;
std::vector<SSlidePersist> m_arNotePersists;
std::vector<SSlidePersist> m_arSlidePersists;
public:
CRecordDocument() : m_arMasterPersists(), m_arNotePersists(), m_arSlidePersists()
{
}
~CRecordDocument()
{
m_arMasterPersists.clear();
m_arNotePersists.clear();
m_arSlidePersists.clear();
}
/*virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_arMasterPersists.clear();
m_arNotePersists.clear();
m_arSlidePersists.clear();
m_arRecords.clear();
UINT lCurLen = 0;
ULONG lReadLen = 0;
SRecordHeader oRec;
while (lCurLen < m_oHeader.RecLen)
{
pStream->Read(&oRec, sizeof(oRec), &lReadLen);
if (0 >= lReadLen)
{
break;
}
if (RECORD_TYPE_SLIDELISTWITHTEXT == oRec.RecType)
{
CRecordSlideListWithText* pAtom = new CRecordSlideListWithText();
pAtom->ReadFromStream(oRec, pStream);
std::vector<SSlidePersist>* pArray = NULL;
switch (pAtom->m_Type)
{
case CRecordSlideListWithText::CollectionOfMasterSlides:
{
pArray = &m_arMasterPersists;
break;
}
case CRecordSlideListWithText::CollectionOfNotesSlides:
{
pArray = &m_arNotePersists;
break;
}
case CRecordSlideListWithText::CollectionOfSlides:
{
pArray = &m_arSlidePersists;
break;
}
default:
{
// ...
lCurLen += (8 + oRec.RecLen);
continue;
}
};
size_t nCountItems = pAtom->m_arSlides.size();
for (size_t index = 0; index < nCountItems; ++index)
{
SSlidePersist oPersist;
oPersist.m_nPsrRef = pAtom->m_arSlides[index]->m_nPsrRef;
oPersist.m_nSlideID = pAtom->m_arSlides[index]->m_nSlideID;
oPersist.m_arTextAttrs.Append(pAtom->m_arTextPlaceHolders[index]);
pArray->Add(oPersist);
}
delete pAtom;
}
else
{
IRecord* pRecord = CreateByType(oRec);
pRecord->ReadFromStream(oRec, pStream);
m_arRecords.Add(pRecord);
}
lCurLen += (8 + oRec.RecLen);
}
}*/
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_arMasterPersists.clear();
m_arNotePersists.clear();
m_arSlidePersists.clear();
m_arRecords.clear();
CRecordsContainer::ReadFromStream(oHeader, pStream);
std::vector<CRecordSlideListWithText*> oArraySlideWithText;
this->GetRecordsByType(&oArraySlideWithText, true, false);
for (int nIndexList = 0; nIndexList < oArraySlideWithText.size(); ++nIndexList)
{
CRecordSlideListWithText* pAtom = oArraySlideWithText[nIndexList];
std::vector<SSlidePersist>* pArray = NULL;
switch (pAtom->m_Type)
{
case CRecordSlideListWithText::CollectionOfMasterSlides:
{
pArray = &m_arMasterPersists;
break;
}
case CRecordSlideListWithText::CollectionOfNotesSlides:
{
pArray = &m_arNotePersists;
break;
}
case CRecordSlideListWithText::CollectionOfSlides:
{
pArray = &m_arSlidePersists;
break;
}
default:
{
// ...
continue;
}
};
size_t nCountItems = pAtom->m_arSlides.size();
for (size_t index = 0; index < nCountItems; ++index)
{
SSlidePersist oPersist;
oPersist.m_nPsrRef = pAtom->m_arSlides[index]->m_nPsrRef;
oPersist.m_nSlideID = pAtom->m_arSlides[index]->m_nSlideID;
oPersist.m_arTextAttrs.insert(oPersist.m_arTextAttrs.end(), pAtom->m_arTextPlaceHolders[index].begin(),pAtom->m_arTextPlaceHolders[index].end());
pArray->push_back(oPersist);
}
}
}
virtual CString ToString()
{
return CRecordsContainer::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordDocumentTextInfo : public CRecordsContainer
{
public:
CRecordDocumentTextInfo()
{
}
~CRecordDocumentTextInfo()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
CRecordsContainer::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CRecordsContainer::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../../Reader/Records.h"
class CRecordBitmapBlip : public CUnknownRecord
{
BYTE m_pRgbUid[16];
BYTE m_nTag;
BYTE* m_pScan0;
public:
CRecordBitmapBlip()
{
}
~CRecordBitmapBlip()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../../Reader/Records.h"
#include "BlipStoreEntry.h"
class CRecordBlipStoreContainer : public CRecordsContainer
{
public:
CRecordBlipStoreContainer()
{
}
~CRecordBlipStoreContainer()
{
}
void SetUpEmptyInfos(std::vector<BOOL>* pArray)
{
if (NULL == pArray)
return;
pArray->clear();
for (int nIndex = 0; nIndex < m_arRecords.size(); ++nIndex)
{
CRecordBlipStoreEntry* pEntry = dynamic_cast<CRecordBlipStoreEntry*>(m_arRecords[nIndex]);
if (NULL != pEntry)
{
pArray->push_back(0 == pEntry->m_oHeader.RecInstance);
}
}
}
};
\ No newline at end of file
#pragma once
#include "../../Reader/Records.h"
class CRecordBlipStoreEntry : public CUnknownRecord
{
NSOfficeDrawing::BlipType m_btWin32;
NSOfficeDrawing::BlipType m_btMacOS;
BYTE m_pRgbUid[16];
WORD m_nTag;
DWORD m_nSize;
DWORD m_nCountRef;
DWORD m_nFoDelay;
NSOfficeDrawing::BlipUsage m_eUsage;
BYTE m_nLenName;
BYTE m_nUnused2;
BYTE m_nUnused3;
public:
CRecordBlipStoreEntry()
{
}
~CRecordBlipStoreEntry()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_btWin32 = (NSOfficeDrawing::BlipType)StreamUtils::ReadBYTE(pStream);
m_btMacOS = (NSOfficeDrawing::BlipType)StreamUtils::ReadBYTE(pStream);
pStream->read(m_pRgbUid, 16);
m_nTag = StreamUtils::ReadWORD(pStream);
m_nSize = StreamUtils::ReadDWORD(pStream);
m_nCountRef = StreamUtils::ReadDWORD(pStream);
m_nFoDelay = StreamUtils::ReadDWORD(pStream);
m_eUsage = (NSOfficeDrawing::BlipUsage)StreamUtils::ReadBYTE(pStream);
m_nLenName = StreamUtils::ReadBYTE(pStream);
m_nUnused2 = StreamUtils::ReadBYTE(pStream);
m_nUnused3 = StreamUtils::ReadBYTE(pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("Win32"), (DWORD)m_btWin32, &oWriter);
CDirectory::WriteValueToNode(_T("MacOS"), (DWORD)m_btMacOS, &oWriter);
//CDirectory::WriteValueToNode(_T("rgbUid"), CDirectory::BYTEArrayToString(m_pRgbUid, 16), &oWriter);
CDirectory::WriteValueToNode(_T("Tag"), (DWORD)m_nTag, &oWriter);
CDirectory::WriteValueToNode(_T("Size"), m_nSize, &oWriter);
CDirectory::WriteValueToNode(_T("CountRef"), m_nCountRef, &oWriter);
CDirectory::WriteValueToNode(_T("FoDelay"), m_nFoDelay, &oWriter);
CDirectory::WriteValueToNode(_T("Usage"), (DWORD)m_eUsage, &oWriter);
CDirectory::WriteValueToNode(_T("LenName"), (DWORD)m_nLenName, &oWriter);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../../Reader/Records.h"
class CRecordChildAnchor : public CUnknownRecord
{
public:
RECT m_oBounds;
public:
CRecordChildAnchor()
{
}
~CRecordChildAnchor()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_oBounds.left = StreamUtils::ReadLONG(pStream);
m_oBounds.top = StreamUtils::ReadLONG(pStream);
m_oBounds.right = StreamUtils::ReadLONG(pStream);
m_oBounds.bottom = StreamUtils::ReadLONG(pStream);
}
virtual CString ToString()
{
CString str = _T("");
str.Format(_T("(%d,%d,%d,%d)"), m_oBounds.left, m_oBounds.top, m_oBounds.right, m_oBounds.bottom);
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteAttribute(_T("rect"), str);
oWriter.WriteNodeEnd(strName, TRUE);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../../Reader/Records.h"
class CRecordClientAnchor : public CUnknownRecord
{
public:
SSmallRectAtom m_oBounds;
public:
CRecordClientAnchor()
{
}
~CRecordClientAnchor()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_oBounds.Top = StreamUtils::ReadSHORT(pStream);
m_oBounds.Left = StreamUtils::ReadSHORT(pStream);
m_oBounds.Right = StreamUtils::ReadSHORT(pStream);
m_oBounds.Bottom = StreamUtils::ReadSHORT(pStream);
}
virtual CString ToString()
{
CString str = _T("");
str.Format(_T("(%d,%d,%d,%d)"), m_oBounds.Left, m_oBounds.Top, m_oBounds.Right, m_oBounds.Bottom);
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteAttribute(_T("rect"), str);
oWriter.WriteNodeEnd(strName, TRUE);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../../Reader/Records.h"
#include "GroupShapeContainer.h"
class CRecordDrawingContainer : public CRecordsContainer
{
public:
CRecordDrawingContainer()
{
}
~CRecordDrawingContainer()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
CRecordsContainer::ReadFromStream(oHeader, pStream);
std::vector<CRecordGroupShapeContainer*> oArrayGroupContainer;
this->GetRecordsByType(&oArrayGroupContainer, false, false);
int nCountGroups = oArrayGroupContainer.size();
for (int i = 0; i < nCountGroups; ++i)
{
oArrayGroupContainer[i]->SetGroupRect();
}
}
};
\ No newline at end of file
#pragma once
#include "../../Reader/Records.h"
class CRecordDrawingGroup : public CUnknownRecord
{
UINT m_nMaxShapeId; // Maximum shape ID
UINT m_nIdClustersCount; // Number of FileIdClusters
UINT m_nShapesSavedCount; // Total number of shapes saved
UINT m_nDrawingsSavedCount; // Total number of drawings saved
std::vector<SFileIdCluster> m_arrIDs;
public:
CRecordDrawingGroup() : m_arrIDs()
{
}
~CRecordDrawingGroup()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_nMaxShapeId = (UINT)StreamUtils::ReadDWORD(pStream);
m_nIdClustersCount = (UINT)StreamUtils::ReadDWORD(pStream) - 1; // Office saves the actual value + 1
m_nShapesSavedCount = (UINT)StreamUtils::ReadDWORD(pStream);
m_nDrawingsSavedCount = (UINT)StreamUtils::ReadDWORD(pStream);
m_arrIDs.clear();
for (UINT nIndex = 0; nIndex < m_nIdClustersCount; ++nIndex)
{
SFileIdCluster elm;
m_arrIDs.push_back(elm);
m_arrIDs[nIndex].ReadFromStream(pStream);
}
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("MaxShapeID"), (DWORD)m_nMaxShapeId, &oWriter);
CDirectory::WriteValueToNode(_T("ClustersCount"), (DWORD)m_nIdClustersCount, &oWriter);
CDirectory::WriteValueToNode(_T("ShapesSavedCount"), (DWORD)m_nShapesSavedCount, &oWriter);
CDirectory::WriteValueToNode(_T("DrawingsSavedCount"), (DWORD)m_nDrawingsSavedCount, &oWriter);
for (size_t nIndex = 0; nIndex < m_arrIDs.size(); ++nIndex)
{
oWriter.WriteString(m_arrIDs[nIndex].ToString());
}
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../../Reader/Records.h"
class CRecordDrawingRecord : public CUnknownRecord
{
UINT m_nCountShapes;
/// The last MSOSPID given to an SP in this DG
UINT m_nPidCur;
public:
CRecordDrawingRecord()
{
}
~CRecordDrawingRecord()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_nCountShapes = (UINT)StreamUtils::ReadDWORD(pStream);
m_nPidCur = (UINT)StreamUtils::ReadDWORD(pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("DrawingID"), (DWORD)m_oHeader.RecInstance, &oWriter);
CDirectory::WriteValueToNode(_T("CountShapes"), (DWORD)m_nCountShapes, &oWriter);
CDirectory::WriteValueToNode(_T("PidCur"), (DWORD)m_nPidCur, &oWriter);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../../Reader/Records.h"
class CRecordGroupShape : public CUnknownRecord
{
public:
RECT m_oBounds;
public:
CRecordGroupShape()
{
}
~CRecordGroupShape()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_oBounds.left = StreamUtils::ReadLONG(pStream);
m_oBounds.top = StreamUtils::ReadLONG(pStream);
m_oBounds.right = StreamUtils::ReadLONG(pStream);
m_oBounds.bottom = StreamUtils::ReadLONG(pStream);
m_oBounds.left = (std::max)(0, (int)m_oBounds.left);
m_oBounds.top = (std::max)(0, (int)m_oBounds.top);
m_oBounds.right = (std::max)(0, (int)m_oBounds.right);
m_oBounds.bottom = (std::max)(0, (int)m_oBounds.bottom);
}
virtual CString ToString()
{
CString str = _T("");
str.Format(_T("(%d,%d,%d,%d)"), m_oBounds.left, m_oBounds.top, m_oBounds.right, m_oBounds.bottom);
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteAttribute(_T("rect"), str);
oWriter.WriteNodeEnd(strName, TRUE);
return oWriter.GetXmlString();
}
};
#pragma once
#include "ShapeContainer.h"
class CRecordGroupShapeContainer : public CRecordsContainer
{
private:
RECT m_rcGroupBounds;
RECT m_rcGroupClientAnchor;
public:
CRecordGroupShapeContainer()
{
m_rcGroupBounds.left = 0;
m_rcGroupBounds.top = 0;
m_rcGroupBounds.right = 0;
m_rcGroupBounds.bottom = 0;
m_rcGroupClientAnchor.left = 0;
m_rcGroupClientAnchor.top = 0;
m_rcGroupClientAnchor.right = 0;
m_rcGroupClientAnchor.bottom = 0;
}
~CRecordGroupShapeContainer()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
CRecordsContainer::ReadFromStream(oHeader, pStream);
// ...
std::vector<CRecordShapeContainer*> oArrayShapes;
this->GetRecordsByType(&oArrayShapes, false, false);
int nIndexBreak = -1;
for (int nIndex = 0; nIndex < oArrayShapes.size(); ++nIndex)
{
std::vector<CRecordGroupShape*> oArrayGroupShapes;
oArrayShapes[nIndex]->GetRecordsByType(&oArrayGroupShapes, false, true);
if (0 != oArrayGroupShapes.size())
{
m_rcGroupBounds.left = oArrayGroupShapes[0]->m_oBounds.left;
m_rcGroupBounds.top = oArrayGroupShapes[0]->m_oBounds.top;
m_rcGroupBounds.right = oArrayGroupShapes[0]->m_oBounds.right;
m_rcGroupBounds.bottom = oArrayGroupShapes[0]->m_oBounds.bottom;
std::vector<CRecordClientAnchor*> oArrayClients;
oArrayShapes[nIndex]->GetRecordsByType(&oArrayClients, false, true);
if (0 != oArrayClients.size())
{
m_rcGroupClientAnchor.left = (LONG)oArrayClients[0]->m_oBounds.Left;
m_rcGroupClientAnchor.top = (LONG)oArrayClients[0]->m_oBounds.Top;
m_rcGroupClientAnchor.right = (LONG)oArrayClients[0]->m_oBounds.Right;
m_rcGroupClientAnchor.bottom = (LONG)oArrayClients[0]->m_oBounds.Bottom;
}
else
{
std::vector<CRecordChildAnchor*> oArrayChilds;
oArrayShapes[nIndex]->GetRecordsByType(&oArrayChilds, false, true);
if (0 != oArrayChilds.size())
{
m_rcGroupClientAnchor.left = (LONG)oArrayChilds[0]->m_oBounds.left;
m_rcGroupClientAnchor.top = (LONG)oArrayChilds[0]->m_oBounds.top;
m_rcGroupClientAnchor.right = (LONG)oArrayChilds[0]->m_oBounds.right;
m_rcGroupClientAnchor.bottom = (LONG)oArrayChilds[0]->m_oBounds.bottom;
}
}
nIndexBreak = nIndex;
break;
}
}
LONG lW1 = m_rcGroupBounds.right - m_rcGroupBounds.left;
LONG lH1 = m_rcGroupBounds.bottom - m_rcGroupBounds.top;
LONG lW2 = m_rcGroupClientAnchor.right - m_rcGroupClientAnchor.left;
LONG lH2 = m_rcGroupClientAnchor.bottom - m_rcGroupClientAnchor.top;
BOOL bIsRecalc = ((lW1 > 0) && (lH1 > 0) && (lW2 > 0) && (lH2 > 0));
if (bIsRecalc)
{
for (int nIndex = 0; nIndex < oArrayShapes.size(); ++nIndex)
{
if (nIndex != nIndexBreak)
{
oArrayShapes[nIndex]->m_pGroupBounds = &m_rcGroupBounds;
oArrayShapes[nIndex]->m_pGroupClientAnchor = &m_rcGroupClientAnchor;
}
}
}
}
void SetGroupRect()
{
std::vector<CRecordGroupShapeContainer*> oArrayGroupContainer;
this->GetRecordsByType(&oArrayGroupContainer, false, false);
int nCountGroups = oArrayGroupContainer.size();
for (int i = 0; i < nCountGroups; ++i)
{
LONG lWidthGroup = m_rcGroupBounds.right - m_rcGroupBounds.left;
LONG lHeightGroup = m_rcGroupBounds.bottom - m_rcGroupBounds.top;
LONG lWidthClient = m_rcGroupClientAnchor.right - m_rcGroupClientAnchor.left;
LONG lHeightClient = m_rcGroupClientAnchor.bottom - m_rcGroupClientAnchor.top;
BOOL bIsRecalc = ((lWidthClient > 0) && (lHeightClient > 0) && (lWidthClient > 0) && (lHeightGroup > 0));
if (bIsRecalc)
{
// ,
double dScaleX = (double)(lWidthClient) / (lWidthGroup);
double dScaleY = (double)(lHeightClient) / (lHeightGroup);
RECT* prcChildAnchor = &oArrayGroupContainer[i]->m_rcGroupClientAnchor;
prcChildAnchor->left = m_rcGroupClientAnchor.left + (LONG)(dScaleX * (prcChildAnchor->left - m_rcGroupBounds.left));
prcChildAnchor->right = m_rcGroupClientAnchor.left + (LONG)(dScaleX * (prcChildAnchor->right - m_rcGroupBounds.left));
prcChildAnchor->top = m_rcGroupClientAnchor.top + (LONG)(dScaleY * (prcChildAnchor->top - m_rcGroupBounds.top));
prcChildAnchor->bottom = m_rcGroupClientAnchor.top + (LONG)(dScaleY * (prcChildAnchor->bottom - m_rcGroupBounds.top));
}
oArrayGroupContainer[i]->SetGroupRect();
}
}
virtual CString ToString()
{
return CRecordsContainer::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../../Reader/Records.h"
class CRecordRegGroupItems : public CUnknownRecord
{
public:
std::vector<WORD> m_arItemsNew;
std::vector<WORD> m_arItemsOld;
public:
CRecordRegGroupItems()
{
}
~CRecordRegGroupItems()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_arItemsNew.clear();
m_arItemsOld.clear();
LONG lCount = (LONG)(oHeader.RecLen / 4);
for (LONG i = 0; i < lCount; ++i)
{
WORD w1 = StreamUtils::ReadWORD(pStream);
WORD w2 = StreamUtils::ReadWORD(pStream);
m_arItemsNew.push_back(w1);
m_arItemsOld.push_back(w2);
}
}
virtual CString ToString()
{
if (0 == m_arItemsNew.size())
{
return CUnknownRecord::ToString();
}
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
for (size_t i = 0; i < m_arItemsNew.size(); ++i)
{
CString str = _T("");
str.Format(_T("<Item new='%d' old='%d' />"), m_arItemsNew[i], m_arItemsOld[i]);
oWriter.WriteString(str);
}
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../../Reader/Records.h"
class CRecordShape : public CUnknownRecord
{
public:
UINT m_nID;
bool m_bGroup;
bool m_bChild;
bool m_bPatriarch;
bool m_bDeleted;
bool m_bOleShape;
bool m_bHaveMaster;
bool m_bFlipH;
bool m_bFlipV;
bool m_bConnector;
bool m_bHaveAnchor;
bool m_bBackground;
bool m_bHaveSpt;
public:
CRecordShape()
{
}
~CRecordShape()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_nID = (UINT)StreamUtils::ReadDWORD(pStream);
UINT nFlag = (UINT)StreamUtils::ReadDWORD(pStream);
m_bGroup = ((nFlag & 0x01) == 0x01);
m_bChild = ((nFlag & 0x02) == 0x02);
m_bPatriarch = ((nFlag & 0x04) == 0x04);
m_bDeleted = ((nFlag & 0x08) == 0x08);
m_bOleShape = ((nFlag & 0x10) == 0x10);
m_bHaveMaster = ((nFlag & 0x20) == 0x20);
m_bFlipH = ((nFlag & 0x40) == 0x40);
m_bFlipV = ((nFlag & 0x80) == 0x80);
m_bConnector = ((nFlag & 0x0100) == 0x0100);
m_bHaveAnchor = ((nFlag & 0x0200) == 0x0200);
m_bBackground = ((nFlag & 0x0400) == 0x0400);
m_bHaveSpt = ((nFlag & 0x0800) == 0x0800);
LONG lSize = m_oHeader.RecLen - 8;
if (lSize > 0)
{
StreamUtils::StreamSkip(lSize, pStream);
}
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("ShapeID"), (DWORD)m_nID, &oWriter);
CDirectory::WriteValueToNode(_T("Group"), m_bGroup, &oWriter);
CDirectory::WriteValueToNode(_T("Child"), m_bChild, &oWriter);
CDirectory::WriteValueToNode(_T("Patriarch"), m_bPatriarch, &oWriter);
CDirectory::WriteValueToNode(_T("Deleted"), m_bDeleted, &oWriter);
CDirectory::WriteValueToNode(_T("OleShape"), m_bOleShape, &oWriter);
CDirectory::WriteValueToNode(_T("HaveMaster"), m_bHaveMaster, &oWriter);
CDirectory::WriteValueToNode(_T("FlipH"), m_bFlipH, &oWriter);
CDirectory::WriteValueToNode(_T("FlipV"), m_bFlipV, &oWriter);
CDirectory::WriteValueToNode(_T("Connector"), m_bConnector, &oWriter);
CDirectory::WriteValueToNode(_T("HaveAnchor"), m_bHaveAnchor, &oWriter);
CDirectory::WriteValueToNode(_T("Background"), m_bBackground, &oWriter);
CDirectory::WriteValueToNode(_T("HaveSpt"), m_bHaveSpt, &oWriter);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../ExObjRefAtom.h"
#include "../TextBytesAtom.h"
#include "../TextCharsAtom.h"
#include "../TextHeaderAtom.h"
#include "../PlaceHolderAtom.h"
#include "../StyleTextPropAtom.h"
#include "../OutlineTextRefAtom.h"
#include "../InteractiveInfoAtom.h"
#include "../TextInteractiveInfoAtom.h"
//#include "../../Reader/Slide.h"
#include "../../../../ASCPresentationEditor/OfficeDrawing/Document.h"
#include "Shape.h"
#include "ShapeProperties.h"
#include "../../Reader/ClassesAtom.h"
#include "../../Reader/SlideInfo.h"
#include "../../../../ASCPresentationEditor/OfficeDrawing/Shapes/BaseShape/PPTShape/ElementSettings.h"
const double EMU_MM = 36000;
using namespace NSOfficeDrawing;
using namespace NSPresentationEditor;
class CPPTElement
{
public:
static inline LONG CorrectPlaceHolderType(const LONG& lType)
{
switch (lType)
{
case 0x01:
case 0x0D:
case 0x11:
return 15; // title
case 0x02:
case 0x0E:
case 0x06:
case 0x12:
case 0x0C:
return 0; // body
case 0x03:
case 0x0F:
return 15; // centerTitle
case 0x04:
case 0x10:
return 0; // subtitle
case 0x13:
case 0x19:
return 9; // object
case 0x05:
case 0x14:
case 0x0B:
return 11; // slideImg
case 0x15:
return 14; // table
case 0x16:
return 2; // clipArt
case 0x17:
return 1; // chart
case 0x18:
return 8; // media
case 0x1A:
return 10; // picture
case 0x07:
return 5; // date
case 0x08:
return 12; // sldNum
case 0x09:
return 6; // footer
case 0x0A:
return 7; // header
default:
break;
}
return lType; // undefined
}
inline void SetUpProperties(IElement* pElement, CTheme* pTheme, CSlideInfo* pWrapper, CSlide* pSlide, CProperties* pProperties)
{
long lCount = pProperties->m_lCount;
switch (pElement->m_etType)
{
case NSPresentationEditor::etVideo:
{
for (long i = 0; i < lCount; ++i)
{
SetUpPropertyVideo((CVideoElement*)pElement, pTheme, pWrapper, pSlide, &pProperties->m_arProperties[i]);
}
break;
}
case NSPresentationEditor::etPicture:
{
for (long i = 0; i < lCount; ++i)
{
SetUpPropertyImage((CImageElement*)pElement, pTheme, pWrapper, pSlide, &pProperties->m_arProperties[i]);
}
break;
}
case NSPresentationEditor::etAudio:
{
for (long i = 0; i < lCount; ++i)
{
SetUpPropertyAudio((CAudioElement*)pElement, pTheme, pWrapper, pSlide, &pProperties->m_arProperties[i]);
}
break;
}
case NSPresentationEditor::etShape:
{
CShapeElement* pShapeElem = (CShapeElement*)pElement;
CPPTShape* pPPTShape = dynamic_cast<CPPTShape*>(pShapeElem->m_oShape.m_pShape);
if (NULL != pPPTShape)
{
pPPTShape->m_oCustomVML.SetAdjusts(&pPPTShape->m_arAdjustments);
}
for (long i = 0; i < lCount; ++i)
{
SetUpPropertyShape(pShapeElem, pTheme, pWrapper, pSlide, &pProperties->m_arProperties[i]);
}
if (NULL != pPPTShape)
{
pPPTShape->m_oCustomVML.ToCustomShape(pPPTShape, pPPTShape->m_oManager);
pPPTShape->ReCalculate();
}
break;
}
default:
break;
}
}
inline bool SetUpProperty(IElement* pElement, CTheme* pTheme, CSlideInfo* pInfo, CSlide* pSlide, CProperty* pProperty)
{
switch (pProperty->m_ePID)
{
case hspMaster:
{
pElement->m_lLayoutID = (LONG)pProperty->m_lValue;
return true;
}
case rotation:
{
pElement->m_dRotate = (double)((LONG)pProperty->m_lValue) / 0x00010000;
return true;
}
case fFlipH:
{
BYTE flag1 = (BYTE)pProperty->m_lValue;
BYTE flag3 = (BYTE)(pProperty->m_lValue >> 16);
bool bFlipH = (0x01 == (0x01 & flag1));
bool bFlipV = (0x02 == (0x02 & flag1));
bool bUseFlipH = (0x01 == (0x01 & flag3));
bool bUseFlipV = (0x02 == (0x02 & flag3));
if (bUseFlipH)
pElement->m_bFlipH = bFlipH;
if (bUseFlipV)
pElement->m_bFlipV = bFlipV;
return true;
}
default:
break;
}
return false;
}
inline void SetUpPropertyVideo(CVideoElement* pElement, CTheme* pTheme, CSlideInfo* pInfo, CSlide* pSlide, CProperty* pProperty)
{
SetUpProperty((IElement*)pElement, pTheme, pInfo, pSlide, pProperty);
}
inline void SetUpPropertyAudio(CAudioElement* pElement, CTheme* pTheme, CSlideInfo* pInfo, CSlide* pSlide, CProperty* pProperty)
{
SetUpProperty((IElement*)pElement, pTheme, pInfo, pSlide, pProperty);
}
inline void SetUpPropertyImage(CImageElement* pElement, CTheme* pTheme, CSlideInfo* pInfo, CSlide* pSlide, CProperty* pProperty)
{
if (SetUpProperty((IElement*)pElement, pTheme, pInfo, pSlide, pProperty))
return;
if (Pib == pProperty->m_ePID)
{
DWORD dwIndex = pInfo->GetIndexPicture(pProperty->m_lValue);
CString strVal = CDirectory::ToString(dwIndex);
pElement->m_strFileName = pElement->m_strFileName + strVal + L".jpg";
}
}
inline void SetUpPropertyShape(CShapeElement* pElement, CTheme* pTheme, CSlideInfo* pInfo, CSlide* pSlide, CProperty* pProperty)
{
if (SetUpProperty((IElement*)pElement, pTheme, pInfo, pSlide, pProperty))
return;
CShape* pParentShape = &pElement->m_oShape;
CPPTShape* pShape = dynamic_cast<CPPTShape*>(pParentShape->m_pShape);
CElementProperties* pElemProps = &pElement->m_oProperties;
if (NULL == pShape)
return;
bool bIsFilled = true;
bool bIsDraw = true;
switch (pProperty->m_ePID)
{
// ...
// geometry ----------------------------------------------------
// top, left, right, bottom logic
case NSOfficeDrawing::geoRight:
{
if (0 < pProperty->m_lValue)
pParentShape->m_dWidthLogic = (double)(pProperty->m_lValue);
break;
}
case NSOfficeDrawing::geoBottom:
{
if (0 < pProperty->m_lValue)
pParentShape->m_dHeightLogic = (double)(pProperty->m_lValue);
break;
}
// shapePath
case NSOfficeDrawing::shapePath:
{
pShape->m_oCustomVML.SetPath((RulesType)pProperty->m_lValue);
break;
}
// segmentsInfo
case NSOfficeDrawing::pSegmentInfo:
{
if (pProperty->m_bComplex)
{
pShape->m_oCustomVML.LoadSegments(pProperty);
}
break;
}
// verticesInfo
case NSOfficeDrawing::pVertices:
{
if (pProperty->m_bComplex)
{
pShape->m_oCustomVML.LoadVertices(pProperty);
}
break;
}
case NSOfficeDrawing::pGuides:
{
if (pProperty->m_bComplex)
{
pShape->m_oCustomVML.LoadGuides(pProperty);
}
break;
}
case NSOfficeDrawing::pAdjustHandles:
{
if (pProperty->m_bComplex)
{
pShape->m_oCustomVML.LoadAHs(pProperty);
}
break;
}
case NSOfficeDrawing::dxTextLeft:
{
pParentShape->m_dTextMarginX = (double)pProperty->m_lValue / EMU_MM;
//pElemProps->SetAt(CElementProperty::epTextMarginLeft, pProperty->m_lValue);
break;
}
case NSOfficeDrawing::dxTextRight:
{
pParentShape->m_dTextMarginRight = (double)pProperty->m_lValue / EMU_MM;
//pElemProps->SetAt(CElementProperty::epTextMarginRight, pProperty->m_lValue);
break;
}
case NSOfficeDrawing::dyTextTop:
{
//pParentShape->m_dTextMarginY = (double)pProperty->m_lValue / EMU_MM;
pElemProps->SetAt(CElementProperty::epTextMarginTop, pProperty->m_lValue);
break;
}
case NSOfficeDrawing::dyTextBottom:
{
pParentShape->m_dTextMarginBottom = (double)pProperty->m_lValue / EMU_MM;
//pElemProps->SetAt(CElementProperty::epTextMarginBottom, pProperty->m_lValue);
break;
}
case NSOfficeDrawing::WrapText:
{
pParentShape->m_oText.m_lWrapMode = (LONG)pProperty->m_lValue;
//pElemProps->SetAt(CElementProperty::epTextWrap, pProperty->m_lValue);
break;
}
case NSOfficeDrawing::adjustValue:
case NSOfficeDrawing::adjust2Value:
case NSOfficeDrawing::adjust3Value:
case NSOfficeDrawing::adjust4Value:
case NSOfficeDrawing::adjust5Value:
case NSOfficeDrawing::adjust6Value:
case NSOfficeDrawing::adjust7Value:
case NSOfficeDrawing::adjust8Value:
case NSOfficeDrawing::adjust9Value:
case NSOfficeDrawing::adjust10Value:
{
LONG lIndexAdj = pProperty->m_ePID - NSOfficeDrawing::adjustValue;
if (lIndexAdj >= 0 && lIndexAdj < pShape->m_arAdjustments.size())
{
//SetAdjustment(lIndexAdj, (LONG)pProperty->m_lValue);
pShape->m_oCustomVML.LoadAdjusts(lIndexAdj, (LONG)pProperty->m_lValue);
}
else
{
pShape->m_oCustomVML.LoadAdjusts(lIndexAdj, (LONG)pProperty->m_lValue);
}
break;
}
case NSOfficeDrawing::fillType:
{
DWORD dwType = pProperty->m_lValue;
if (NSOfficeDrawing::fillPattern == dwType ||
NSOfficeDrawing::fillTexture == dwType ||
NSOfficeDrawing::fillPicture == dwType)
{
//pElemProps->SetAt(CElementProperty::epBrushType, c_BrushTypeTexture);
//pElemProps->SetAt(CElementProperty::epBrushTxMode,
// (NSOfficeDrawing::fillPicture == dwType) ? c_BrushTextureModeStretch : c_BrushTextureModeTile);
pParentShape->m_oBrush.Type = c_BrushTypeTexture;
pParentShape->m_oBrush.TextureMode = (NSOfficeDrawing::fillPicture == dwType) ? c_BrushTextureModeStretch : c_BrushTextureModeTile;
}
else if (NSOfficeDrawing::fillShade == dwType ||
NSOfficeDrawing::fillShadeCenter == dwType ||
NSOfficeDrawing::fillShadeTitle == dwType)
{
pParentShape->m_oBrush.Type = c_BrushTypeVertical;
//pElemProps->SetAt(CElementProperty::epBrushType, c_BrushTypeVertical);
}
else if (NSOfficeDrawing::fillShadeShape == dwType || NSOfficeDrawing::fillShadeScale == dwType)
{
pParentShape->m_oBrush.Type = c_BrushTypeSolid;
//pElemProps->SetAt(CElementProperty::epBrushType, c_BrushTypeSolid);
}
else
{
pParentShape->m_oBrush.Type = c_BrushTypeSolid;
//pElemProps->SetAt(CElementProperty::epBrushType, c_BrushTypeSolid);
}
break;
}
case NSOfficeDrawing::fillBlip:
{
DWORD dwIndex = pInfo->GetIndexPicture(pProperty->m_lValue);
CString strVal = CDirectory::ToString(dwIndex);
int nIndex = pParentShape->m_oBrush.TexturePath.ReverseFind(FILE_SEPARATOR_CHAR);
int nLen = pParentShape->m_oBrush.TexturePath.GetLength() - 1;
if (nLen != nIndex)
{
pParentShape->m_oBrush.TexturePath.Delete(nIndex + 1, nLen - nIndex);
}
//pElemProps->SetAt(CElementProperty::epBrushTxPath, pParentShape->m_oBrush.TexturePath + strVal + L".jpg");
pParentShape->m_oBrush.TexturePath = pParentShape->m_oBrush.TexturePath + strVal + L".jpg";
break;
}
case NSOfficeDrawing::fillColor:
{
SColorAtom oAtom;
oAtom.FromValue(pProperty->m_lValue);
//pElemProps->SetAt(CElementProperty::epBrushColor1, oAtom.ToValueProperty());
oAtom.ToColor(&pParentShape->m_oBrush.Color1);
break;
}
case NSOfficeDrawing::fillBackColor:
{
SColorAtom oAtom;
oAtom.FromValue(pProperty->m_lValue);
//pElemProps->SetAt(CElementProperty::epBrushColor2, oAtom.ToValueProperty());
oAtom.ToColor(&pParentShape->m_oBrush.Color2);
break;
}
case NSOfficeDrawing::fillOpacity:
{
//pElemProps->SetAt(CElementProperty::epBrushAlpha1, (std::min)(255, CDirectory::NormFixedPoint(pProperty->m_lValue, 255)));
pParentShape->m_oBrush.Alpha1 = (BYTE)(std::min)(255, (int)CDirectory::NormFixedPoint(pProperty->m_lValue, 255));
break;
}
case NSOfficeDrawing::fillBackOpacity:
{
pParentShape->m_oBrush.Alpha2 = (BYTE)(std::min)(255, (int)CDirectory::NormFixedPoint(pProperty->m_lValue, 255));
//pElemProps->SetAt(CElementProperty::epBrushAlpha2,(std::min)(255, CDirectory::NormFixedPoint(pProperty->m_lValue, 255)));
break;
}
case NSOfficeDrawing::fillBackground:
{
//bIsFilled = false;
break;
}
case NSOfficeDrawing::fNoFillHitTest:
{
BYTE flag1 = (BYTE)(pProperty->m_lValue);
BYTE flag2 = (BYTE)(pProperty->m_lValue >> 16);
bool bNoFillHitTest = (0x01 == (0x01 & flag1));
bool bFillUseRect = (0x02 == (0x02 & flag1));
bool bFillShape = (0x04 == (0x04 & flag1));
bool bHitTestFill = (0x08 == (0x08 & flag1));
bool bFilled = (0x10 == (0x10 & flag1));
bool bUseShapeAnchor = (0x20 == (0x20 & flag1));
bool bRecolorFillAsPictures = (0x40 == (0x40 & flag1));
bool bUsebNoFillHitTest = (0x01 == (0x01 & flag2));
bool bUsebFillUseRect = (0x02 == (0x02 & flag2));
bool bUsebFillShape = (0x04 == (0x04 & flag2));
bool bUsebHitTestFill = (0x08 == (0x08 & flag2));
bool bUsebFilled = (0x10 == (0x10 & flag2));
bool bUsebUseShapeAnchor = (0x20 == (0x20 & flag2));
bool bUsebRecolorFillAsPictures = (0x40 == (0x40 & flag2));
if (bUsebFilled)
bIsFilled = bFilled;
break;
}
// line --------------------------------------------------------
case NSOfficeDrawing::lineColor:
{
SColorAtom oAtom;
oAtom.FromValue(pProperty->m_lValue);
//pElemProps->SetAt(CElementProperty::epPenColor, oAtom.ToValueProperty());
oAtom.ToColor(&pParentShape->m_oPen.Color);
break;
}
case NSOfficeDrawing::lineOpacity:
{
//pElemProps->SetAt(CElementProperty::epPenAlpha, min(255, CDirectory::NormFixedPoint(pProperty->m_lValue, 255)));
pParentShape->m_oPen.Alpha = (BYTE)(std::min)(255, (int)CDirectory::NormFixedPoint(pProperty->m_lValue, 255));
break;
}
case NSOfficeDrawing::lineWidth:
{
pParentShape->m_oPen.Size = (double)pProperty->m_lValue / EMU_MM;
//pElemProps->SetAt(CElementProperty::epPenWidth, pProperty->m_lValue);
break;
}
case NSOfficeDrawing::lineDashing:
{
BYTE nDashStyle = 0;
switch (pProperty->m_lValue)
{
case 0:
{
nDashStyle = 0;
break;
} // solid
case 1:
case 6:
case 7:
{
nDashStyle = 1;
break;
} // dash
case 2:
case 5:
{
nDashStyle = 2;
break;
} // dot
case 3:
case 8:
case 9:
{
nDashStyle = 3;
break;
} // dashdot
case 4:
case 10:
{
nDashStyle = 4;
break;
} // dashdotdot
default:
{
break;
}
};
//pElemProps->SetAt(CElementProperty::epLineDash, nDashStyle);
pParentShape->m_oPen.DashStyle = nDashStyle;
break;
}
case NSOfficeDrawing::lineJoinStyle:
{
BYTE nLineJoin = 2;
switch (pProperty->m_lValue)
{
case 0:
{
nLineJoin = 1;
break;
} // bevel
case 1:
{
nLineJoin = 1;
break;
} // Miter
case 2:
{
nLineJoin = 2;
break;
} // round
default:
{
break;
}
};
pParentShape->m_oPen.LineJoin = nLineJoin;
//pElemProps->SetAt(CElementProperty::epPenJoin, nLineJoin);
break;
}
case NSOfficeDrawing::lineStartArrowhead:
{
BYTE nStartCap = 0;
switch (pProperty->m_lValue)
{
case 1:
case 2:
case 5:
{
nStartCap = 0x14;
break;
}
case 3:
case 4:
{
nStartCap = 2;
break;
}
default:
{
break;
}
};
pParentShape->m_oPen.LineStartCap = nStartCap;
//pElemProps->SetAt(CElementProperty::epLineStartCap, nStartCap);
break;
}
case NSOfficeDrawing::lineEndArrowhead:
{
BYTE nEndCap = 0;
switch (pProperty->m_lValue)
{
case 1:
case 2:
case 5:
{
nEndCap = 0x14;
break;
}
case 3:
case 4:
{
nEndCap = 2;
break;
}
default:
{
break;
}
};
pParentShape->m_oPen.LineEndCap = nEndCap;
//pElemProps->SetAt(CElementProperty::epLineEndCap, nEndCap);
break;
}
case NSOfficeDrawing::fNoLineDrawDash:
{
BYTE flag1 = (BYTE)(pProperty->m_lValue);
BYTE flag2 = (BYTE)(pProperty->m_lValue >> 8);
BYTE flag3 = (BYTE)(pProperty->m_lValue >> 16);
BYTE flag4 = (BYTE)(pProperty->m_lValue >> 24);
bool bNoLineDrawDash = (0x01 == (0x01 & flag1));
bool bLineFillShape = (0x02 == (0x02 & flag1));
bool bHitTestLine = (0x04 == (0x04 & flag1));
bool bLine = (0x08 == (0x08 & flag1));
bool bArrowheadsOK = (0x10 == (0x10 & flag1));
bool bInsertPenOK = (0x20 == (0x20 & flag1));
bool bInsertPen = (0x40 == (0x40 & flag1));
bool bLineOpaqueBackColor = (0x02 == (0x02 & flag2));
bool bUsebNoLineDrawDash = (0x01 == (0x01 & flag3));
bool bUsebLineFillShape = (0x02 == (0x02 & flag3));
bool bUsebHitTestLine = (0x04 == (0x04 & flag3));
bool bUsebLine = (0x08 == (0x08 & flag3));
bool bUsebArrowheadsOK = (0x10 == (0x10 & flag3));
bool bUsebInsertPenOK = (0x20 == (0x20 & flag3));
bool bUsebInsertPen = (0x40 == (0x40 & flag3));
bool bUsebLineOpaqueBackColor = (0x02 == (0x02 & flag4));
if (bUsebLine)
bIsDraw = bLine;
break;
}
// text --------------------------------------------------------
case NSOfficeDrawing::gtextUNICODE:
{
if (pProperty->m_bComplex && 0 < pProperty->m_lValue)
{
CStringW str = CDirectory::BYTEArrayToStringW(pProperty->m_pOptions, pProperty->m_lValue);
//pParentShape->m_oText.m_sText = str;
}
break;
}
// font --------------------------------------------------------
case NSOfficeDrawing::gtextFont:
{
if (pProperty->m_bComplex && 0 < pProperty->m_lValue)
{
CStringW str = CDirectory::BYTEArrayToStringW(pProperty->m_pOptions, pProperty->m_lValue);
pParentShape->m_oText.m_oAttributes.m_oFont.Name = (CString)str;
//pElemProps->SetAt(CElementProperty::epFontName, (CString)str);
}
break;
}
case NSOfficeDrawing::gtextSize:
{
pParentShape->m_oText.m_oAttributes.m_oFont.Size = (INT)((pProperty->m_lValue >> 16) & 0x0000FFFF);
//pElemProps->SetAt(CElementProperty::epFontSize, (DWORD)((pProperty->m_lValue >> 16) & 0x0000FFFF));
break;
}
case NSOfficeDrawing::anchorText:
{
switch (pProperty->m_lValue)
{
case NSOfficeDrawing::anchorTop:
case NSOfficeDrawing::anchorTopBaseline:
{
//m_oText.m_nTextAlignHorizontal = 0;
pParentShape->m_oText.m_oAttributes.m_nTextAlignVertical = 0;
//pElemProps->SetAt(CElementProperty::epFontVertAlign, (DWORD)0);
break;
}
case NSOfficeDrawing::anchorMiddle:
{
//m_oText.m_nTextAlignHorizontal = 0;
pParentShape->m_oText.m_oAttributes.m_nTextAlignVertical = 1;
//pElemProps->SetAt(CElementProperty::epFontVertAlign, (DWORD)1);
break;
}
case NSOfficeDrawing::anchorBottom:
case NSOfficeDrawing::anchorBottomBaseline:
{
pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 0;
pParentShape->m_oText.m_oAttributes.m_nTextAlignVertical = 2;
//pElemProps->SetAt(CElementProperty::epFontHorAlign, (DWORD)0);
//pElemProps->SetAt(CElementProperty::epFontVertAlign, (DWORD)2);
break;
}
case NSOfficeDrawing::anchorTopCentered:
case NSOfficeDrawing::anchorTopCenteredBaseline:
{
pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 1;
pParentShape->m_oText.m_oAttributes.m_nTextAlignVertical = 0;
//pElemProps->SetAt(CElementProperty::epFontHorAlign, (DWORD)1);
//pElemProps->SetAt(CElementProperty::epFontVertAlign, (DWORD)0);
break;
}
case NSOfficeDrawing::anchorMiddleCentered:
{
pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 1;
pParentShape->m_oText.m_oAttributes.m_nTextAlignVertical = 1;
//pElemProps->SetAt(CElementProperty::epFontHorAlign, (DWORD)1);
//pElemProps->SetAt(CElementProperty::epFontVertAlign, (DWORD)1);
break;
}
case NSOfficeDrawing::anchorBottomCentered:
case NSOfficeDrawing::anchorBottomCenteredBaseline:
{
pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 1;
pParentShape->m_oText.m_oAttributes.m_nTextAlignVertical = 2;
//pElemProps->SetAt(CElementProperty::epFontHorAlign, (DWORD)1);
//pElemProps->SetAt(CElementProperty::epFontVertAlign, (DWORD)2);
break;
}
default:
{
pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 1;
pParentShape->m_oText.m_oAttributes.m_nTextAlignVertical = 0;
//pElemProps->SetAt(CElementProperty::epFontHorAlign, (DWORD)1);
//pElemProps->SetAt(CElementProperty::epFontVertAlign, (DWORD)0);
break;
}
};
break;
}
case NSOfficeDrawing::gtextAlign:
{
switch (pProperty->m_lValue)
{
case NSOfficeDrawing::alignTextLeft:
{
pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 0;
//pElemProps->SetAt(CElementProperty::epFontHorAlign, (DWORD)0);
break;
}
case NSOfficeDrawing::alignTextCenter:
{
pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 1;
//pElemProps->SetAt(CElementProperty::epFontHorAlign, (DWORD)1);
break;
}
case NSOfficeDrawing::alignTextRight:
{
pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 2;
//pElemProps->SetAt(CElementProperty::epFontHorAlign, (DWORD)2);
break;
}
default:
{
pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 1;
//pElemProps->SetAt(CElementProperty::epFontHorAlign, (DWORD)1);
}
};
break;
}
case NSOfficeDrawing::gtextFStrikethrough:
{
// -
BYTE flag1 = (BYTE)(pProperty->m_lValue);
BYTE flag2 = (BYTE)(pProperty->m_lValue >> 8);
BYTE flag3 = (BYTE)(pProperty->m_lValue >> 16);
BYTE flag4 = (BYTE)(pProperty->m_lValue >> 24);
bool bStrikethrought = (0x01 == (0x01 & flag1));
bool bSmallCaps = (0x02 == (0x02 & flag1));
bool bShadow = (0x04 == (0x04 & flag1));
bool bUnderline = (0x08 == (0x08 & flag1));
bool bItalic = (0x10 == (0x10 & flag1));
bool bBold = (0x20 == (0x20 & flag1));
bool bUseStrikethrought = (0x01 == (0x01 & flag3));
bool bUseSmallCaps = (0x02 == (0x02 & flag3));
bool bUseShadow = (0x04 == (0x04 & flag3));
bool bUseUnderline = (0x08 == (0x08 & flag3));
bool bUseItalic = (0x10 == (0x10 & flag3));
bool bUseBold = (0x20 == (0x20 & flag3));
bool bVertical = (0x20 == (0x20 & flag2));
bool bUseVertical = (0x20 == (0x20 & flag4));
if (bUseStrikethrought)
{
pParentShape->m_oText.m_oAttributes.m_oFont.Strikeout = (BYTE)bStrikethrought;
//pElemProps->SetAt(CElementProperty::epFontStrikeout, bStrikethrought);
}
if (bUseShadow)
{
pParentShape->m_oText.m_oAttributes.m_oTextShadow.Visible = true;
}
if (bUseUnderline)
{
pParentShape->m_oText.m_oAttributes.m_oFont.Underline = (BYTE)bUnderline;
//pElemProps->SetAt(CElementProperty::epFontUnderline, bUnderline);
}
if (bUseItalic)
{
pParentShape->m_oText.m_oAttributes.m_oFont.Italic = (BOOL)bItalic;
//pElemProps->SetAt(CElementProperty::epFontItalic, bItalic);
}
if (bUseBold)
{
pParentShape->m_oText.m_oAttributes.m_oFont.Bold = (BOOL)bBold;
//pElemProps->SetAt(CElementProperty::epFontBold, bBold);
}
if (bUseVertical)
{
pParentShape->m_oText.m_bVertical = (true == bVertical) ? TRUE : FALSE;
}
break;
}
case NSOfficeDrawing::fFitTextToShape:
{
BYTE flag1 = (BYTE)(pProperty->m_lValue);
BYTE flag2 = (BYTE)(pProperty->m_lValue >> 8);
BYTE flag3 = (BYTE)(pProperty->m_lValue >> 16);
BYTE flag4 = (BYTE)(pProperty->m_lValue >> 24);
bool bFitShapeToText = (0x02 == (0x02 & flag1));
bool bAutoTextMargin = (0x08 == (0x08 & flag1));
bool bSelectText = (0x10 == (0x10 & flag1));
bool bUseFitShapeToText = (0x02 == (0x02 & flag3));
bool bUseAutoTextMargin = (0x08 == (0x08 & flag3));
bool bUseSelectText = (0x10 == (0x10 & flag3));
if (bUseAutoTextMargin)
{
if (bAutoTextMargin)
{
pParentShape->m_dTextMarginX = 2.54;
pParentShape->m_dTextMarginRight = 1.27;
pParentShape->m_dTextMarginY = 2.54;
pParentShape->m_dTextMarginBottom = 1.27;
//pElemProps->SetAt(CElementProperty::epTextMarginLeft, (DWORD)(2.54 * EMU_MM));
//pElemProps->SetAt(CElementProperty::epTextMarginTop, (DWORD)(2.54 * EMU_MM));
//pElemProps->SetAt(CElementProperty::epTextMarginRight, (DWORD)(1.27 * EMU_MM));
//pElemProps->SetAt(CElementProperty::epTextMarginBottom, (DWORD)(1.27 * EMU_MM));
}
}
break;
}
// geometry shape
case NSOfficeDrawing::fFillOK:
{
BYTE flag1 = (BYTE)(pProperty->m_lValue);
BYTE flag2 = (BYTE)(pProperty->m_lValue >> 8);
BYTE flag3 = (BYTE)(pProperty->m_lValue >> 16);
BYTE flag4 = (BYTE)(pProperty->m_lValue >> 24);
bool bFillOk = (0x01 == (0x01 & flag1));
bool bFillShadeShapeOk = (0x02 == (0x02 & flag1));
bool bGTextOk = (0x04 == (0x04 & flag1));
bool bLineOk = (0x08 == (0x08 & flag1));
bool b3DOk = (0x10 == (0x10 & flag1));
bool bShadowOk = (0x20 == (0x20 & flag1));
bool bUseFillOk = (0x01 == (0x01 & flag3));
bool bUseFillShadeShapeOk = (0x02 == (0x02 & flag3));
bool bUseGTextOk = (0x04 == (0x04 & flag3));
bool bUseLineOk = (0x08 == (0x08 & flag3));
bool bUse3DOk = (0x10 == (0x10 & flag3));
bool bUseShadowOk = (0x20 == (0x20 & flag3));
if (bUseLineOk)
bIsDraw = bLineOk;
if (bUseFillOk)
bIsFilled = bFillOk;
break;
}
default:
break;
}
if (!bIsDraw)
{
pParentShape->m_oPen.Alpha = 0;
//pElemProps->SetAt(CElementProperty::epStroked, (DWORD)0);
}
if (!bIsFilled)
{
pParentShape->m_oBrush.Type = (int)c_BrushTypeSolid;
pParentShape->m_oBrush.Alpha1 = 0;
pParentShape->m_oBrush.Alpha2 = 0;
//pElemProps->SetAt(CElementProperty::epFilled, (DWORD)0);
}
}
};
//
// IElement...
// - video, image, shape, text, color -
class CRecordShapeContainer : public CRecordsContainer
{
private:
POLE::Stream* m_pStream;
public:
RECT* m_pGroupBounds;
RECT* m_pGroupClientAnchor;
public:
CRecordShapeContainer()
{
m_pStream = NULL;
m_pGroupBounds = NULL;
m_pGroupClientAnchor = NULL;
}
~CRecordShapeContainer()
{
m_pStream = NULL;
m_pGroupBounds = NULL;
m_pGroupClientAnchor = NULL;
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_pStream = pStream;
CRecordsContainer::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CRecordsContainer::ToString();
}
virtual void GetElement(IElement** ppElement, CExMedia* pMapIDs,
long lSlideWidth, long lSlideHeight, CTheme* pTheme, CLayout* pLayout,
CSlideInfo* pThemeWrapper, CSlideInfo* pSlideWrapper, CSlide* pSlide = NULL)
{
if (NULL == ppElement)
return;
*ppElement = NULL;
std::vector<CRecordShape*> oArrayShape;
this->GetRecordsByType(&oArrayShape, true, true);
if (0 == oArrayShape.size())
return;
std::vector<CRecordShapeProperties*> oArrayOptions;
this->GetRecordsByType(&oArrayOptions, true, /*true*/false/*secondary & tetriary*/);
PPTShapes::ShapeType eType = (PPTShapes::ShapeType)oArrayShape[0]->m_oHeader.RecInstance;
ElementType elType = GetTypeElem((NSOfficeDrawing::SPT)oArrayShape[0]->m_oHeader.RecInstance);
LONG lMasterID = -1;
if (NULL != pSlide)
{
bool bIsMaster = oArrayShape[0]->m_bHaveMaster;
if (bIsMaster)
{
for (int i = 0; i < oArrayOptions[0]->m_oProperties.m_lCount; ++i)
{
if (hspMaster == oArrayOptions[0]->m_oProperties.m_arProperties[i].m_ePID)
{
lMasterID = oArrayOptions[0]->m_oProperties.m_arProperties[i].m_lValue;
if (pLayout)
{
size_t nIndexMem = pLayout->m_arElements.size();
for (size_t nIndex = 0; nIndex < nIndexMem; ++nIndex)
{
if (lMasterID == pLayout->m_arElements[nIndex]->m_lID && (elType == pLayout->m_arElements[nIndex]->m_etType))
{
*ppElement = pLayout->m_arElements[nIndex]->CreateDublicate();
if (elType == etShape)
{
CShapeElement* pShape = dynamic_cast<CShapeElement*>(*ppElement);
if (NULL != pShape)
pShape->m_oShape.m_oText.m_arParagraphs.clear();
}
break;
}
}
}
break;
}
}
}
}
// - .
// placeholder (type & id)
IElement* pElem = *ppElement;
if (NULL == pElem)
{
switch (eType)
{
//case sptMin:
case sptMax:
case sptNil:
{
break;
}
case sptPictureFrame:
{
std::vector<CRecordExObjRefAtom*> oArrayEx;
this->GetRecordsByType(&oArrayEx, true, true);
CExFilesInfo oInfo;
CString strPathPicture = _T("");
// ( )
CExFilesInfo::ExFilesType exType = CExFilesInfo::eftNone;
CExFilesInfo* pInfo = pMapIDs->Lock(0xFFFFFFFF, exType);
if (NULL != pInfo)
{
oInfo = *pInfo;
strPathPicture = oInfo.m_strFilePath + FILE_SEPARATOR_STR;
}
if (0 != oArrayEx.size())
{
CExFilesInfo* pInfo = pMapIDs->Lock(oArrayEx[0]->m_nExObjID, exType);
if (NULL != pInfo)
{
oInfo = *pInfo;
}
}
if (CExFilesInfo::eftVideo == exType)
{
CVideoElement* pVideoElem = new CVideoElement();
pVideoElem->m_strFileName = oInfo.m_strFilePath + FILE_SEPARATOR_STR;
pElem = (IElement*)pVideoElem;
}
else if (CExFilesInfo::eftAudio == exType)
{
CAudioElement* pAudioElem = new CAudioElement();
pAudioElem->m_strFileName = oInfo.m_strFilePath + FILE_SEPARATOR_STR;
pAudioElem->m_dClipStartTime = oInfo.m_dStartTime;
pAudioElem->m_dClipEndTime = oInfo.m_dEndTime;
pAudioElem->m_bLoop = oInfo.m_bLoop;
if (NULL != pSlide)
{
pAudioElem->m_dStartTime = pSlide->m_dStartTime;
pAudioElem->m_dEndTime = pSlide->m_dEndTime;
pSlide->m_arElements.push_back(pAudioElem);
}
else
{
if (pLayout)
pLayout->m_arElements.push_back(pAudioElem);
}
CImageElement* pImageElem = new CImageElement();
pImageElem->m_strFileName = strPathPicture;
pElem = (IElement*)pImageElem;
//
//pElem = (IElement*)pAudioElem;
}
else
{
CImageElement* pImageElem = new CImageElement();
pImageElem->m_strFileName = oInfo.m_strFilePath + FILE_SEPARATOR_STR;
pElem = (IElement*)pImageElem;
}
break;
}
default:
{
// shape
CShapeElement* pShape = new CShapeElement(NSBaseShape::ppt, eType);
if (TRUE)//if (/* */OOXMLShapes::sptCustom != pShape->m_oShape.m_eType)
{
CExFilesInfo::ExFilesType exType = CExFilesInfo::eftNone;
CExFilesInfo* pTextureInfo = pMapIDs->Lock(0xFFFFFFFF, exType);
if (NULL != pTextureInfo)
{
pShape->m_oShape.m_oBrush.TexturePath = pTextureInfo->m_strFilePath + FILE_SEPARATOR_STR;
}
pElem = (IElement*)pShape;
}
else
{
delete pShape;
pShape = NULL;
}
break;
}
};
}
if (NULL == pElem)
return;
pElem->m_lID = oArrayShape[0]->m_nID;
std::vector<CRecordClientAnchor*> oArrayAnchor;
this->GetRecordsByType(&oArrayAnchor, true, true);
if (0 != oArrayAnchor.size())
{
pElem->m_rcBoundsOriginal.left = (LONG)oArrayAnchor[0]->m_oBounds.Left;
pElem->m_rcBoundsOriginal.top = (LONG)oArrayAnchor[0]->m_oBounds.Top;
pElem->m_rcBoundsOriginal.right = (LONG)oArrayAnchor[0]->m_oBounds.Right;
pElem->m_rcBoundsOriginal.bottom = (LONG)oArrayAnchor[0]->m_oBounds.Bottom;
}
else
{
std::vector<CRecordChildAnchor*> oArrayChildAnchor;
this->GetRecordsByType(&oArrayChildAnchor, true, true);
if (0 != oArrayChildAnchor.size())
{
pElem->m_rcBoundsOriginal.left = oArrayChildAnchor[0]->m_oBounds.left;
pElem->m_rcBoundsOriginal.top = oArrayChildAnchor[0]->m_oBounds.top;
pElem->m_rcBoundsOriginal.right = oArrayChildAnchor[0]->m_oBounds.right;
pElem->m_rcBoundsOriginal.bottom = oArrayChildAnchor[0]->m_oBounds.bottom;
RecalcGroupShapeAnchor(pElem->m_rcBoundsOriginal);
}
else
{
if (oArrayShape[0]->m_bBackground)
{
// background
pElem->m_rcBoundsOriginal.left = 0;
pElem->m_rcBoundsOriginal.top = 0;
pElem->m_rcBoundsOriginal.right = lSlideWidth;
pElem->m_rcBoundsOriginal.bottom = lSlideHeight;
}
else
{
// ...
pElem->m_rcBoundsOriginal.left = 0;
pElem->m_rcBoundsOriginal.top = 0;
pElem->m_rcBoundsOriginal.right = lSlideWidth;
pElem->m_rcBoundsOriginal.bottom = lSlideHeight;
//delete pElem;
//return;
}
}
}
double dScaleX = c_dMasterUnitsToMillimetreKoef;
double dScaleY = c_dMasterUnitsToMillimetreKoef;
pElem->NormalizeCoords(dScaleX, dScaleY);
pElem->m_bFlipH = oArrayShape[0]->m_bFlipH;
pElem->m_bFlipV = oArrayShape[0]->m_bFlipV;
//
CShapeElement* pShapeElem = dynamic_cast<CShapeElement*>(pElem);
if (NULL != pShapeElem)
{
CElementInfo oElementInfo;
pShapeElem->m_oShape.m_dWidthLogic = ShapeSizeVML;
pShapeElem->m_oShape.m_dHeightLogic = ShapeSizeVML;
// textheader present
std::vector<CRecordTextHeaderAtom*> oArrayTextHeader;
this->GetRecordsByType(&oArrayTextHeader, true, true);
if (0 < oArrayTextHeader.size())
{
pShapeElem->m_oShape.m_oText.m_lTextType = oArrayTextHeader[0]->m_nTextType;
pShapeElem->m_oShape.m_oText.m_lTextMasterType = oArrayTextHeader[0]->m_nTextType;
oElementInfo.m_lMasterTextType = oArrayTextHeader[0]->m_nTextType;
}
else
{
pShapeElem->m_oShape.m_oText.m_lTextType = NSOfficePPT::NoPresent;
pShapeElem->m_oShape.m_oText.m_lTextMasterType = NSOfficePPT::NoPresent;
oElementInfo.m_lMasterTextType = NSOfficePPT::NoPresent;
}
//
std::vector<CRecordOutlineTextRefAtom*> oArrayTextRefs;
this->GetRecordsByType(&oArrayTextRefs, true, true);
if (0 < oArrayTextRefs.size())
{
oElementInfo.m_lPersistIndex = oArrayTextRefs[0]->m_nIndex;
}
// placeholder
std::vector<CRecordPlaceHolderAtom*> oArrayPlace;
this->GetRecordsByType(&oArrayPlace, true, true);
if (0 < oArrayPlace.size())
{
pElem->m_lPlaceholderID = (LONG)(oArrayPlace[0]->m_nPosition);
pElem->m_lPlaceholderType = (LONG)(oArrayPlace[0]->m_nPlacementID);
oElementInfo.m_lMasterPlaceholderType = pElem->m_lPlaceholderType;
if (0 == pElem->m_lPlaceholderType)
pElem->m_lPlaceholderID = 1;
else if (15 == pElem->m_lPlaceholderType)
pElem->m_lPlaceholderID = -1;
pElem->m_lPlaceholderType = CPPTElement::CorrectPlaceHolderType(pElem->m_lPlaceholderType);
}
CString strText = _T("");
// ...
std::vector<CRecordTextBytesAtom*> oArrayTextBytes;
this->GetRecordsByType(&oArrayTextBytes, true, true);
if (0 < oArrayTextBytes.size())
{
strText = (CStringW)(oArrayTextBytes[0]->m_strText);
}
std::vector<CRecordTextCharsAtom*> oArrayTextChars;
this->GetRecordsByType(&oArrayTextChars, true, true);
if (0 < oArrayTextChars.size())
{
strText = oArrayTextChars[0]->m_strText;
}
// ...
// -
for (int nIndexProp = 0; nIndexProp < oArrayOptions.size(); ++nIndexProp)
{
CPPTElement oElement;
oElement.SetUpProperties(pElem, pTheme, pSlideWrapper, pSlide, &oArrayOptions[nIndexProp]->m_oProperties);
}
pElem->m_lLayoutID = lMasterID;
std::vector<CRecordStyleTextPropAtom*> oArrayTextStyle;
this->GetRecordsByType(&oArrayTextStyle, true, true);
if (0 != oArrayTextStyle.size())
{
oElementInfo.m_pStream = m_pStream;
oElementInfo.m_lOffsetTextStyle = oArrayTextStyle[0]->m_lOffsetInStream;
}
std::vector<CRecordTextSpecInfoAtom*> oArrayTextProp;
this->GetRecordsByType(&oArrayTextProp, true, true);
if (0 != oArrayTextProp.size())
{
oElementInfo.m_pStream = m_pStream;
oElementInfo.m_lOffsetTextProp = oArrayTextProp[0]->m_lOffsetInStream;
}
std::vector<CRecordTextRulerAtom*> oArrayTextRuler;
this->GetRecordsByType(&oArrayTextRuler, true, true);
if (0 != oArrayTextRuler.size())
{
pShapeElem->m_oShape.m_oText.m_oRuler = oArrayTextRuler[0]->m_oTextRuler;
}
std::vector<CRecordTextInteractiveInfoAtom*> oArrayTextInteractive;
this->GetRecordsByType(&oArrayTextInteractive, true);
if (0 != oArrayTextInteractive.size())
{
pShapeElem->m_oActions.m_bPresent = true;
int nSize = oArrayTextInteractive.size();
for (int i = 0; i < nSize; ++i)
{
CTextRange oRange;
oRange.m_lStart = oArrayTextInteractive[i]->m_lStart;
oRange.m_lEnd = oArrayTextInteractive[i]->m_lEnd;
pShapeElem->m_oActions.m_arRanges.push_back(oRange);
}
}
// . 90 270 0 180 -
// 90 .
double dAngle = pShapeElem->m_dRotate;
if (0 <= dAngle)
{
LONG lCount = (LONG)dAngle / 360;
dAngle -= (lCount * 360.0);
}
else
{
LONG lCount = (LONG)dAngle / 360;
dAngle += ((-lCount + 1) * 360.0);
}
if (((dAngle > 45) && (dAngle < 135)) || ((dAngle > 225) && (dAngle < 315)))
{
double dW = pShapeElem->m_rcBounds.GetWidth();
double dH = pShapeElem->m_rcBounds.GetHeight();
double dCx = (pShapeElem->m_rcBounds.left + pShapeElem->m_rcBounds.right) / 2.0;
double dCy = (pShapeElem->m_rcBounds.top + pShapeElem->m_rcBounds.bottom) / 2.0;
pShapeElem->m_rcBounds.left = dCx - dH / 2.0;
pShapeElem->m_rcBounds.right = dCx + dH / 2.0;
pShapeElem->m_rcBounds.top = dCy - dW / 2.0;
pShapeElem->m_rcBounds.bottom = dCy + dW / 2.0;
}
pSlideWrapper->m_mapElements.insert(std::pair<LONG, CElementInfo>(pShapeElem->m_lID, oElementInfo));
SetUpTextStyle(strText, pTheme, pLayout, pElem, pThemeWrapper, pSlideWrapper, pSlide);
}
else
{
for (int nIndexProp = 0; nIndexProp < oArrayOptions.size(); ++nIndexProp)
{
CPPTElement oElement;
oElement.SetUpProperties(pElem, pTheme, pSlideWrapper, pSlide, &oArrayOptions[nIndexProp]->m_oProperties);
}
pElem->m_lLayoutID = lMasterID;
}
if (NULL != pSlide)
{
pElem->m_dStartTime = pSlide->m_dStartTime;
pElem->m_dEndTime = pSlide->m_dEndTime;
pElem->m_oMetric.SetUnitsContainerSize(pSlide->m_lOriginalWidth, pSlide->m_lOriginalHeight);
}
else
{
pElem->m_dStartTime = 0;
pElem->m_dEndTime = 0;
pElem->m_oMetric.SetUnitsContainerSize(lSlideWidth, lSlideHeight);
}
pElem->m_bIsBackground = (true == oArrayShape[0]->m_bBackground);
*ppElement = pElem;
}
void RecalcGroupShapeAnchor(CDoubleRect& rcChildAnchor)
{
if ((NULL == m_pGroupBounds) || (NULL == m_pGroupClientAnchor))
return;
// ,
LONG lWidthClient = m_pGroupClientAnchor->right - m_pGroupClientAnchor->left;
LONG lHeightClient = m_pGroupClientAnchor->bottom - m_pGroupClientAnchor->top;
LONG lWidthGroup = m_pGroupBounds->right - m_pGroupBounds->left;
LONG lHeightGroup = m_pGroupBounds->bottom - m_pGroupBounds->top;
double dScaleX = (double)(lWidthClient) / (lWidthGroup);
double dScaleY = (double)(lHeightClient) / (lHeightGroup);
rcChildAnchor.left = m_pGroupClientAnchor->left + (LONG)(dScaleX * (rcChildAnchor.left - m_pGroupBounds->left));
rcChildAnchor.right = m_pGroupClientAnchor->left + (LONG)(dScaleX * (rcChildAnchor.right - m_pGroupBounds->left));
rcChildAnchor.top = m_pGroupClientAnchor->top + (LONG)(dScaleY * (rcChildAnchor.top - m_pGroupBounds->top));
rcChildAnchor.bottom = m_pGroupClientAnchor->top + (LONG)(dScaleY * (rcChildAnchor.bottom - m_pGroupBounds->top));
}
NSPresentationEditor::ElementType GetTypeElem(SPT eType)
{
switch (eType)
{
//case sptMin:
case sptMax:
case sptNil:
{
return etShape;
}
case sptPictureFrame:
{
return etPicture;
}
default:
{
return etShape;
}
};
return etShape;
}
AVSINLINE CString GetFileName(CString strFilePath)
{
int nIndex = strFilePath.ReverseFind(TCHAR('\\'));
if (-1 != nIndex)
{
return strFilePath.Mid(nIndex + 1);
}
return strFilePath;
}
protected:
void SetUpTextStyle(CString& strText, CTheme* pTheme, CLayout* pLayout, IElement* pElem, CSlideInfo* pThemeWrapper, CSlideInfo* pSlideWrapper, CSlide* pSlide = NULL)
{
// shape
// -
// 1) master + TextMasterStyles
// 2) persist + TextMasterStyles
// 3) + TextMasterStyles
// " " - " "
// ( ) -
// .
// - ,
// , .cpp -
// (.. )
if (NULL == pElem)
return;
if (etShape != pElem->m_etType)
return;
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElem);
if (NULL == pShape)
return;
CTextAttributesEx* pTextSettings = &(pShape->m_oShape.m_oText);
// masterstyle ( )
// - (.. )
// - - .. -
//
BOOL bIsPersistPresentSettings = FALSE;
BOOL bIsOwnPresentSettings = FALSE;
NSOfficePPT::TextType eTypeMaster = NSOfficePPT::NoPresent;
NSOfficePPT::TextType eTypePersist = NSOfficePPT::NoPresent;
NSOfficePPT::TextType eTypeOwn = (NSOfficePPT::TextType)pTextSettings->m_lTextType;
CShapeElement* pElementLayoutPH = NULL;
//
if (NULL != pSlide)
{
LONG ph_type = pShape->m_lPlaceholderType;
LONG ph_pos = pShape->m_lPlaceholderID;
pTextSettings->m_lPlaceholderType = ph_type;
size_t lElemsCount = 0;
if (pLayout)
{
for (size_t i = 0; i < pLayout->m_arElements.size(); ++i)
{
IElement* pPh = pLayout->m_arElements[i];
if ((etShape == pPh->m_etType) && (ph_type == pPh->m_lPlaceholderType) && (/*ph_pos == pPh->m_lPlaceholderID*/true))
{
pElementLayoutPH = dynamic_cast<CShapeElement*>(pPh);
eTypeMaster = (NSOfficePPT::TextType)pElementLayoutPH->m_oShape.m_oText.m_lTextMasterType;
break;
}
}
}
}
else
{
eTypeMaster = (NSOfficePPT::TextType)pTextSettings->m_lTextMasterType;
}
// ------------------------------------------------------------------------------
CElementInfo oElemInfo;
std::map<LONG, CElementInfo>::iterator pPair = pSlideWrapper->m_mapElements.find(pShape->m_lID);
if (pSlideWrapper->m_mapElements.end() != pPair)
oElemInfo = pPair->second;
// persist ----------------------------------------------------------------------
std::vector<CTextFullSettings>* pArrayPlaseHolders = &pSlideWrapper->m_arTextPlaceHolders;
LONG lCountPersistObjects = (LONG)pArrayPlaseHolders->size();
LONG lPersistIndex = oElemInfo.m_lPersistIndex;
if ((lPersistIndex >= 0) && (lPersistIndex < lCountPersistObjects))
{
CTextFullSettings* pSettings = &pArrayPlaseHolders->at(lPersistIndex);
eTypePersist = (NSOfficePPT::TextType)pSettings->m_nTextType;
strText = pSettings->ApplyProperties(pTextSettings);
if ((0 != pSettings->m_arRanges.size()) && (0 == pShape->m_oActions.m_arRanges.size()))
{
pShape->m_oActions.m_bPresent = true;
pShape->m_oActions.m_arRanges = pSettings->m_arRanges;
}
bIsPersistPresentSettings = ((NULL != pSettings->m_pTextStyleProp) && (0 < pSettings->m_pTextStyleProp->m_lCount));
}
// ------------------------------------------------------------------------------
// own properties ---------------------------------------------------------------
if (NULL != oElemInfo.m_pStream)
{
// .
LONG lPosition = 0; StreamUtils::StreamPosition(lPosition, oElemInfo.m_pStream);
if (-1 != oElemInfo.m_lOffsetTextStyle)
{
StreamUtils::StreamSeek(oElemInfo.m_lOffsetTextStyle - 8, oElemInfo.m_pStream);
SRecordHeader oHeader;
oHeader.ReadFromStream(oElemInfo.m_pStream) ;
if (RECORD_TYPE_STYLE_TEXTPROP_ATOM == oHeader.RecType)
{
CRecordStyleTextPropAtom* pStyle = new CRecordStyleTextPropAtom();
pStyle->m_lCount = strText.GetLength();
pStyle->ReadFromStream(oHeader, oElemInfo.m_pStream);
NSPresentationEditor::ConvertPPTTextToEditorStructure(pStyle->m_arrPFs, pStyle->m_arrCFs, strText, pShape->m_oShape.m_oText);
bIsOwnPresentSettings = (0 < pStyle->m_lCount);
RELEASEOBJECT(pStyle);
}
}
if (-1 != oElemInfo.m_lOffsetTextProp)
{
StreamUtils::StreamSeek(oElemInfo.m_lOffsetTextProp - 8, oElemInfo.m_pStream);
SRecordHeader oHeader;
oHeader.ReadFromStream(oElemInfo.m_pStream) ;
if (RECORD_TYPE_TEXTSPECINFO_ATOM == oHeader.RecType)
{
CRecordTextSpecInfoAtom* pSpecInfo = new CRecordTextSpecInfoAtom();
pSpecInfo->m_lCount = strText.GetLength();
pSpecInfo->ReadFromStream(oHeader, oElemInfo.m_pStream);
pSpecInfo->ApplyProperties(&(pShape->m_oShape.m_oText));
RELEASEOBJECT(pSpecInfo);
}
}
StreamUtils::StreamSeek(lPosition, oElemInfo.m_pStream);
}
// ------------------------------------------------------------------------------
// ()
if (NULL == pSlide)
{
int nTextMasterType = (int)eTypeMaster;
if (-1 != pShape->m_lPlaceholderType)
{
switch (oElemInfo.m_lMasterPlaceholderType)
{
case NSOfficePPT::Title:
case NSOfficePPT::MasterTitle:
case NSOfficePPT::VerticalTextTitle:
{
pTextSettings->m_lTextType = 1;
if (NSOfficePPT::_Title != eTypeMaster)
{
if (0 <= nTextMasterType && nTextMasterType < 9)
{
if (pThemeWrapper->m_pStyles[nTextMasterType].is_init())
pTextSettings->m_oStyles = pThemeWrapper->m_pStyles[nTextMasterType].get();
}
}
break;
}
case NSOfficePPT::CenteredTitle:
case NSOfficePPT::MasterCenteredTitle:
{
pTextSettings->m_lTextType = 1;
if (NSOfficePPT::_Title != eTypeMaster)
{
if (0 <= nTextMasterType && nTextMasterType < 9)
{
if (pThemeWrapper->m_pStyles[nTextMasterType].is_init())
pTextSettings->m_oStyles = pThemeWrapper->m_pStyles[nTextMasterType].get();
}
}
break;
}
case NSOfficePPT::Body:
case NSOfficePPT::MasterBody:
case NSOfficePPT::NotesBody:
case NSOfficePPT::MasterNotesBody:
case NSOfficePPT::VerticalTextBody:
case NSOfficePPT::MasterSubtitle:
case NSOfficePPT::Subtitle:
{
pTextSettings->m_lTextType = 2;
if (NSOfficePPT::_Body != eTypeMaster)
{
if (0 <= nTextMasterType && nTextMasterType < 9)
{
if (pThemeWrapper->m_pStyles[nTextMasterType].is_init())
pTextSettings->m_oStyles = pThemeWrapper->m_pStyles[nTextMasterType].get();
}
}
break;
}
default:
{
pTextSettings->m_lTextType = 3;
if (NSOfficePPT::Other != eTypeMaster)
{
if (0 <= nTextMasterType && nTextMasterType < 9)
{
if (pThemeWrapper->m_pStyles[nTextMasterType].is_init())
pTextSettings->m_oStyles = pThemeWrapper->m_pStyles[nTextMasterType].get();
}
}
break;
}
}
}
else
{
pTextSettings->m_lTextType = 0;
if (NSOfficePPT::Other != eTypeMaster)
{
if (0 <= nTextMasterType && nTextMasterType < 9)
{
if (pThemeWrapper->m_pStyles[nTextMasterType].is_init())
pTextSettings->m_oStyles = pThemeWrapper->m_pStyles[nTextMasterType].get();
}
}
}
// (persist own) - m_oStyles
if (eTypePersist != NSOfficePPT::NoPresent && eTypePersist != eTypeMaster)
{
int nIndexType = (int)eTypePersist;
if (0 <= nIndexType && nIndexType < 9)
{
if (pThemeWrapper->m_pStyles[nIndexType].is_init())
pTextSettings->m_oStyles.ApplyAfter(pThemeWrapper->m_pStyles[nIndexType].get());
}
}
if (eTypeOwn != NSOfficePPT::NoPresent && eTypeOwn != eTypePersist && eTypeOwn != eTypeMaster)
{
int nIndexType = (int)eTypeOwn;
if (0 <= nIndexType && nIndexType < 9)
{
if (pThemeWrapper->m_pStyles[nIndexType].is_init())
pTextSettings->m_oStyles.ApplyAfter(pThemeWrapper->m_pStyles[nIndexType].get());
}
}
}
else
{
if (-1 != pShape->m_lPlaceholderType)
{
if (NULL != pElementLayoutPH)
{
pTextSettings->m_oLayoutStyles = pElementLayoutPH->m_oShape.m_oText.m_oStyles;
pTextSettings->m_lTextType = pElementLayoutPH->m_oShape.m_oText.m_lTextType;
}
else
{
switch (oElemInfo.m_lMasterPlaceholderType)
{
case NSOfficePPT::Title:
case NSOfficePPT::MasterTitle:
case NSOfficePPT::VerticalTextTitle:
{
pTextSettings->m_lTextType = 1;
break;
}
case NSOfficePPT::CenteredTitle:
case NSOfficePPT::MasterCenteredTitle:
{
pTextSettings->m_lTextType = 1;
break;
}
case NSOfficePPT::Body:
case NSOfficePPT::MasterBody:
case NSOfficePPT::NotesBody:
case NSOfficePPT::MasterNotesBody:
case NSOfficePPT::VerticalTextBody:
{
pTextSettings->m_lTextType = 2;
break;
}
default:
{
pTextSettings->m_lTextType = 3;
break;
}
}
}
}
else
{
pTextSettings->m_lTextType = 0;
}
// (persist own) - m_oStyles
if (eTypePersist != NSOfficePPT::NoPresent && eTypePersist != eTypeMaster)
{
int nIndexType = (int)eTypePersist;
if (0 <= nIndexType && nIndexType < 9)
{
if (pThemeWrapper->m_pStyles[nIndexType].is_init())
pTextSettings->m_oStyles.ApplyAfter(pThemeWrapper->m_pStyles[nIndexType].get());
}
}
if (eTypeOwn != NSOfficePPT::NoPresent && eTypeOwn != eTypePersist && eTypeOwn != eTypeMaster)
{
int nIndexType = (int)eTypeOwn;
if (0 <= nIndexType && nIndexType < 9 && pLayout)
{
if (pThemeWrapper->m_pStyles[nIndexType].IsInit())
pTextSettings->m_oStyles.ApplyAfter(pThemeWrapper->m_pStyles[nIndexType].get());
}
}
}
if ((_T("") != strText) && 0 == pTextSettings->m_arParagraphs.size())
{
// .
std::vector<CTextPFRun_ppt> oArrayPF;
CTextPFRun_ppt elm;
elm.m_lCount = strText.GetLength();
elm.m_lLevel = 0;
oArrayPF.push_back(elm);
std::vector<CTextCFRun_ppt> oArrayCF;
CTextCFRun_ppt elm1;
elm1.m_lCount = elm.m_lCount;
oArrayCF.push_back(elm1);
NSPresentationEditor::ConvertPPTTextToEditorStructure(oArrayPF, oArrayCF, strText, *pTextSettings);
}
NSPresentationEditor::CColor oColor;
if ((NULL != pSlide) && !pSlide->m_bUseLayoutColorScheme)
{
oColor = pSlide->GetColor(11);
}
else if ((NULL != pLayout) && (!pLayout->m_bUseThemeColorScheme))
{
oColor = pLayout->GetColor(11);
}
else if (NULL != pTheme)
{
oColor = pTheme->GetColor(11);
}
oColor.m_lSchemeIndex = 11;
if (pShape->m_oActions.m_bPresent)
{
ApplyHyperlink(pShape, oColor);
}
CPPTShape* pPPTShape = dynamic_cast<CPPTShape*>(pShape->m_oShape.m_pShape);
if (NULL != pPPTShape)
{
// -
switch (pPPTShape->m_eType)
{
case sptTextPlainText:
case sptTextStop:
case sptTextTriangle:
case sptTextTriangleInverted:
case sptTextChevron:
case sptTextChevronInverted:
case sptTextRingInside:
case sptTextRingOutside:
case sptTextArchUpCurve:
case sptTextArchDownCurve:
case sptTextCircleCurve:
case sptTextButtonCurve:
case sptTextArchUpPour:
case sptTextArchDownPour:
case sptTextCirclePour:
case sptTextButtonPour:
case sptTextCurveUp:
case sptTextCurveDown:
case sptTextCascadeUp:
case sptTextCascadeDown:
case sptTextWave1:
case sptTextWave2:
case sptTextWave3:
case sptTextWave4:
case sptTextInflate:
case sptTextDeflate:
case sptTextInflateBottom:
case sptTextDeflateBottom:
case sptTextInflateTop:
case sptTextDeflateTop:
case sptTextDeflateInflate:
case sptTextDeflateInflateDeflate:
case sptTextFadeRight:
case sptTextFadeLeft:
case sptTextFadeUp:
case sptTextFadeDown:
case sptTextSlantUp:
case sptTextSlantDown:
case sptTextCanUp:
case sptTextCanDown:
{
pShape->m_oShape.m_oText.m_arParagraphs.clear();
pShape->m_oShape.m_oText.m_oAttributes.m_oTextBrush = pShape->m_oShape.m_oBrush;
pShape->m_oShape.m_oText.m_oAttributes.m_nTextAlignHorizontal = 1;
pShape->m_oShape.m_oText.m_oAttributes.m_nTextAlignVertical = 1;
pShape->m_oShape.m_lDrawType = c_ShapeDrawType_Text;
break;
}
default:
break;
};
}
}
void ApplyHyperlink(CShapeElement* pShape, CColor& oColor)
{
std::vector<CTextRange>* pRanges = &pShape->m_oActions.m_arRanges;
CTextAttributesEx* pTextAttributes = &pShape->m_oShape.m_oText;
LONG lCountHyper = (LONG)pRanges->size();
if (0 == lCountHyper)
return;
size_t nCountPars = pTextAttributes->m_arParagraphs.size();
for (LONG nIndexRange = 0; nIndexRange < lCountHyper; ++nIndexRange)
{
LONG lStart = (*pRanges)[nIndexRange].m_lStart;
LONG lEnd = (*pRanges)[nIndexRange].m_lEnd;
LONG lCurrentStart = 0;
for (size_t nIndexPar = 0; nIndexPar < nCountPars; ++nIndexPar)
{
CParagraph* pParagraph = &pTextAttributes->m_arParagraphs[nIndexPar];
for (size_t nIndexSpan = 0; nIndexSpan < pParagraph->m_arSpans.size(); ++nIndexSpan)
{
LONG lCurrentEnd = lCurrentStart + pParagraph->m_arSpans[nIndexSpan].m_strText.GetLength() - 1;
if (lCurrentStart > lEnd || lCurrentEnd < lStart)
{
lCurrentStart = lCurrentEnd + 1;
continue;
}
LONG lStart_ = (std::max)(lStart, lCurrentStart);
LONG lEnd_ = (std::min)(lEnd, lCurrentEnd);
CSpan oRunProp = pParagraph->m_arSpans[nIndexSpan];
CString strText = pParagraph->m_arSpans[nIndexSpan].m_strText;
if (lStart_ > lCurrentStart)
{
pParagraph->m_arSpans.insert(pParagraph->m_arSpans.begin() + nIndexSpan, oRunProp);
pParagraph->m_arSpans[nIndexSpan].m_strText = strText.Mid(0, lStart_ - lCurrentStart);
++nIndexSpan;
}
pParagraph->m_arSpans[nIndexSpan].m_oRun.Color = oColor;
pParagraph->m_arSpans[nIndexSpan].m_oRun.FontUnderline = (BOOL)TRUE;
pParagraph->m_arSpans[nIndexSpan].m_strText = strText.Mid(lStart_ - lCurrentStart, lEnd_ - lStart_ + 1);
if (lEnd_ < lCurrentEnd)
{
pParagraph->m_arSpans.insert(pParagraph->m_arSpans.begin() + nIndexSpan + 1, oRunProp);
++nIndexSpan;
pParagraph->m_arSpans[nIndexSpan].m_strText = strText.Mid(lEnd_ - lCurrentStart + 1, lCurrentEnd - lEnd_);
}
lCurrentStart = lCurrentEnd + 1;
}
}
}
}
};
#pragma once
#include "../../Reader/Records.h"
class CRecordShapeProperties : public CUnknownRecord
{
public:
CProperties m_oProperties;
public:
CRecordShapeProperties()
{
}
~CRecordShapeProperties()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
LONG lPosition = 0;
StreamUtils::StreamPosition(lPosition, pStream);
m_oProperties.FromStream(pStream, m_oHeader.RecInstance);
DWORD dwLen = m_oProperties.GetLen();
// , complex -
// ...
StreamUtils::StreamSeek(lPosition + m_oHeader.RecLen, pStream);
}
virtual CString ToString()
{
CString str = m_oProperties.ToString();
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
oWriter.WriteString(str);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../../Reader/Records.h"
class CRecordTextBox : public CUnknownRecord
{
BYTE* m_pData;
public:
CRecordTextBox()
{
}
~CRecordTextBox()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordEndDocument : public CUnknownRecord
{
public:
CRecordEndDocument()
{
}
~CRecordEndDocument()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "ExMediaAtom.h"
class CRecordExCDAudioContainer : public CRecordsContainer
{
public:
CRecordExMediaAtom m_oMedia;
double m_dStartTime;
double m_dEndTime;
public:
CRecordExCDAudioContainer()
{
m_dStartTime = 0;
m_dEndTime = 0;
}
~CRecordExCDAudioContainer()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
SRecordHeader oExHeader;
oExHeader.ReadFromStream(pStream);
m_oMedia.ReadFromStream(oExHeader, pStream);
StreamUtils::StreamSkip(8, pStream);
BYTE nTrack1 = StreamUtils::ReadBYTE(pStream);
BYTE nMinute1 = StreamUtils::ReadBYTE(pStream);
BYTE nSecond1 = StreamUtils::ReadBYTE(pStream);
BYTE nFrame1 = StreamUtils::ReadBYTE(pStream);
BYTE nTrack2 = StreamUtils::ReadBYTE(pStream);
BYTE nMinute2 = StreamUtils::ReadBYTE(pStream);
BYTE nSecond2 = StreamUtils::ReadBYTE(pStream);
BYTE nFrame2 = StreamUtils::ReadBYTE(pStream);
m_dStartTime = 60000 * nMinute1 + 1000 * nSecond1;
m_dEndTime = 60000 * nMinute2 + 1000 * nSecond2;
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteAttribute(_T("start"), m_dStartTime);
oWriter.WriteAttribute(_T("end"), m_dEndTime);
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
oWriter.WriteString(m_oMedia.ToString());
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordExControlAtom : public CUnknownRecord
{
UINT m_nSlideID;
public:
CRecordExControlAtom()
{
}
~CRecordExControlAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordExHyperlinkAtom : public CUnknownRecord
{
UINT m_nHyperlinkID;
public:
CRecordExHyperlinkAtom()
{
}
~CRecordExHyperlinkAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordExMIDIAudioContainer : public CRecordsContainer
{
public:
CRecordExMIDIAudioContainer()
{
}
~CRecordExMIDIAudioContainer()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
CRecordsContainer::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CRecordsContainer::ToString();
}
};
#pragma once
#include "../Reader/Records.h"
class CRecordExMediaAtom : public CUnknownRecord
{
public:
DWORD m_nExObjID;
bool m_bLoop;
bool m_bRewind;
bool m_bNarration;
public:
CRecordExMediaAtom()
{
}
~CRecordExMediaAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_nExObjID = StreamUtils::ReadDWORD(pStream);
USHORT nFlag = StreamUtils::ReadWORD(pStream);
m_bLoop = ((nFlag & 0x01) == 0x01);
m_bRewind = ((nFlag & 0x02) == 0x02);
m_bNarration = ((nFlag & 0x04) == 0x04);
StreamUtils::StreamSkip(2, pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("ID"), m_nExObjID, &oWriter);
CDirectory::WriteValueToNode(_T("Loop"), m_bLoop, &oWriter);
CDirectory::WriteValueToNode(_T("Rewind"), m_bRewind, &oWriter);
CDirectory::WriteValueToNode(_T("Narration"), m_bNarration, &oWriter);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordExObjListAtom : public CUnknownRecord
{
INT m_nObjectIdSeed;
public:
CRecordExObjListAtom()
{
}
~CRecordExObjListAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordExObjListContainer : public CRecordsContainer
{
public:
CRecordExObjListContainer()
{
}
~CRecordExObjListContainer()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
CRecordsContainer::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CRecordsContainer::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordExObjRefAtom : public CUnknownRecord
{
public:
DWORD m_nExObjID;
public:
CRecordExObjRefAtom()
{
}
~CRecordExObjRefAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_nExObjID = StreamUtils::ReadDWORD(pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("ID"), m_nExObjID, &oWriter);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordExOleEmbedAtom : public CUnknownRecord
{
UINT m_nColorFollow;
BOOL1 m_nCantLockServer;
BOOL1 m_nNoSizeToServer;
BOOL1 m_nIsTable;
public:
CRecordExOleEmbedAtom()
{
}
~CRecordExOleEmbedAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordExOleLinkAtom : public CUnknownRecord
{
UINT m_nSlideID;
UINT m_nOleUpdateMode;
public:
CRecordExOleLinkAtom()
{
}
~CRecordExOleLinkAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordExOleObjAtom : public CUnknownRecord
{
UINT m_nDrawAspect;
UINT m_nType;
UINT m_nExObjID;
UINT m_nSubType;
UINT m_nPersistID;
public:
CRecordExOleObjAtom()
{
}
~CRecordExOleObjAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordExVideoContainer : public CRecordsContainer
{
public:
CRecordExVideoContainer()
{
}
~CRecordExVideoContainer()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
CRecordsContainer::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CRecordsContainer::ToString();
}
};
\ No newline at end of file
#pragma once
#include "ExMediaAtom.h"
class CRecordWAVAudioEmbeddedContainer : public CRecordsContainer
{
public:
CRecordExMediaAtom m_oMedia;
DWORD m_nSoundID;
LONG m_nDuration;
public:
CRecordWAVAudioEmbeddedContainer()
{
m_nSoundID = 0;
m_nDuration = 0;
}
~CRecordWAVAudioEmbeddedContainer()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
SRecordHeader oExHeader;
oExHeader.ReadFromStream(pStream);
m_oMedia.ReadFromStream(oExHeader, pStream);
StreamUtils::StreamSkip(8, pStream);
m_nSoundID = StreamUtils::ReadDWORD(pStream);
m_nDuration = StreamUtils::ReadLONG(pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteAttribute(_T("start"), CDirectory::ToString(m_nSoundID));
oWriter.WriteAttribute(_T("end"), CDirectory::ToString(m_nDuration));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
oWriter.WriteString(m_oMedia.ToString());
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordWAVAudioLinkContainer : public CRecordsContainer
{
public:
CRecordWAVAudioLinkContainer()
{
}
~CRecordWAVAudioLinkContainer()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
CRecordsContainer::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CRecordsContainer::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordFontEntityAtom : public CUnknownRecord
{
public:
CStringW m_strFaceName;
BYTE m_lfCharSet;
bool m_bEmbedSubsetted;
bool m_bIsRaster;
bool m_bIsDevice;
bool m_bIsTrueType;
bool m_bIsNoFontSubstitution;
BYTE m_lfPitchAndFamily;
public:
CRecordFontEntityAtom()
{
}
~CRecordFontEntityAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_strFaceName = StreamUtils::ReadCStringW(pStream, 32);
m_lfCharSet = StreamUtils::ReadBYTE(pStream);
BYTE Mem = 0;
Mem = StreamUtils::ReadBYTE(pStream);
m_bEmbedSubsetted = ((Mem & 0x01) == 0x01);
Mem = 0;
Mem = StreamUtils::ReadBYTE(pStream);
m_bIsRaster = ((Mem & 0x01) == 0x01);
m_bIsDevice = ((Mem & 0x02) == 0x02);
m_bIsTrueType = ((Mem & 0x04) == 0x04);
m_bIsNoFontSubstitution = ((Mem & 0x08) == 0x08);
m_lfPitchAndFamily = StreamUtils::ReadBYTE(pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("FaceName"), m_strFaceName, &oWriter);
CDirectory::WriteValueToNode(_T("CharSet"), (DWORD)m_lfCharSet, &oWriter);
CDirectory::WriteValueToNode(_T("EmbedSubsetted"), m_bEmbedSubsetted, &oWriter);
CDirectory::WriteValueToNode(_T("IsRaster"), m_bIsRaster, &oWriter);
CDirectory::WriteValueToNode(_T("IsDevice"), m_bIsDevice, &oWriter);
CDirectory::WriteValueToNode(_T("IsTrueType"), m_bIsTrueType, &oWriter);
CDirectory::WriteValueToNode(_T("IsNoFontSubstitution"), m_bIsNoFontSubstitution, &oWriter);
CDirectory::WriteValueToNode(_T("PitchAndFamily"), (DWORD)m_lfPitchAndFamily, &oWriter);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
#pragma once
#include "../Reader/Records.h"
class CRecordGenericDateMCAtom : public CUnknownRecord
{
UINT m_nPosition;
public:
CRecordGenericDateMCAtom()
{
}
~CRecordGenericDateMCAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordGridSpacing10Atom : public CUnknownRecord
{
INT m_nX;
INT m_nY;
public:
CRecordGridSpacing10Atom()
{
}
~CRecordGridSpacing10Atom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordGuideAtom : public CUnknownRecord
{
DWORD m_nType;
DWORD m_nPos;
public:
CRecordGuideAtom()
{
}
~CRecordGuideAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_nType = StreamUtils::ReadDWORD(pStream);
m_nPos = StreamUtils::ReadDWORD(pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CString str = _T("Unknown");
if (0 == m_nType)
{
str = _T("horizontal");
}
else if (1 == m_nType)
{
str = _T("vertical");
}
CDirectory::WriteValueToNode(_T("Type"), str, &oWriter);
CDirectory::WriteValueToNode(_T("Pos"), m_nPos, &oWriter);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordHeadersFootersAtom : public CUnknownRecord
{
WORD m_nFormatID;
bool m_bHasDate;
bool m_bHasTodayDate;
bool m_bHasUserDate;
bool m_bHasSlideNumber;
bool m_bHasHeader;
bool m_bHasFooter;
public:
CRecordHeadersFootersAtom()
{
}
~CRecordHeadersFootersAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_nFormatID = StreamUtils::ReadWORD(pStream);
USHORT nFlag = StreamUtils::ReadWORD(pStream);
m_bHasDate = ((nFlag & 0x01) == 0x01);
m_bHasTodayDate = ((nFlag & 0x02) == 0x02);
m_bHasUserDate = ((nFlag & 0x04) == 0x04);
m_bHasSlideNumber = ((nFlag & 0x08) == 0x08);
m_bHasHeader = ((nFlag & 0x10) == 0x10);
m_bHasFooter = ((nFlag & 0x20) == 0x20);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("FormatID"), (DWORD)m_nFormatID, &oWriter);
CDirectory::WriteValueToNode(_T("HasDate"), m_bHasDate, &oWriter);
CDirectory::WriteValueToNode(_T("HasTodayDate"), m_bHasTodayDate, &oWriter);
CDirectory::WriteValueToNode(_T("HasUserDate"), m_bHasUserDate, &oWriter);
CDirectory::WriteValueToNode(_T("HasSlideNumber"), m_bHasSlideNumber, &oWriter);
CDirectory::WriteValueToNode(_T("HasHeader"), m_bHasHeader, &oWriter);
CDirectory::WriteValueToNode(_T("HasFooter"), m_bHasFooter, &oWriter);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordInteractiveInfoAtom : public CUnknownRecord
{
public:
CRecordInteractiveInfoAtom()
{
}
~CRecordInteractiveInfoAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordKinsokuAtom : public CUnknownRecord
{
UINT m_nLevel;
public:
CRecordKinsokuAtom()
{
}
~CRecordKinsokuAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordMasterPersistAtom : public CUnknownRecord
{
UINT m_nPsrRef;
INT m_nMasterID;
public:
CRecordMasterPersistAtom()
{
}
~CRecordMasterPersistAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordMasterTextPropAtom : public CUnknownRecord
{
public:
struct SMasterTextPropRun
{
DWORD lCount;
WORD lIndentLevel;
SMasterTextPropRun()
{
lCount = 0;
lIndentLevel = 0;
}
SMasterTextPropRun(const SMasterTextPropRun& oSrc)
{
lCount = oSrc.lCount;
lIndentLevel = oSrc.lIndentLevel;
}
SMasterTextPropRun& operator=(const SMasterTextPropRun& oSrc)
{
lCount = oSrc.lCount;
lIndentLevel = oSrc.lIndentLevel;
return *this;
}
};
private:
std::vector<SMasterTextPropRun> m_arrProps;
public:
CRecordMasterTextPropAtom()
{
}
~CRecordMasterTextPropAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_arrProps.clear();
size_t nCount = m_oHeader.RecLen / 6;
while (nCount != 0)
{
--nCount;
SMasterTextPropRun oRun;
oRun.lCount = StreamUtils::ReadDWORD(pStream);
oRun.lIndentLevel = StreamUtils::ReadWORD(pStream);
m_arrProps.push_back(oRun);
}
}
virtual CString ToString()
{
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
XmlUtils::CXmlWriter oWriter;
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
for (size_t nIndex = 0; nIndex < m_arrProps.size(); ++nIndex)
{
CString str = _T("");
str.Format(_T("<Run count='%d' indentlevel='%d' />"), m_arrProps[nIndex].lCount, m_arrProps[nIndex].lIndentLevel);
oWriter.WriteString(str);
}
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordMetafileBlob : public CUnknownRecord
{
SHORT m_nMM;
SHORT m_nExtX;
SHORT m_nExtY;
BYTE* m_pData;
public:
CRecordMetafileBlob()
{
}
~CRecordMetafileBlob()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordMouseTextInteractiveInfoAtom : public CUnknownRecord
{
STextRange m_oRange;
public:
CRecordMouseTextInteractiveInfoAtom()
{
}
~CRecordMouseTextInteractiveInfoAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordNamedShowSlidesAtom : public CUnknownRecord
{
std::vector<UINT> m_arRgSlideIdRef;
public:
CRecordNamedShowSlidesAtom()
{
}
~CRecordNamedShowSlidesAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordNoZoomViewInfoAtom : public CUnknownRecord
{
SScalingAtom m_oCurScale;
SPointAtom m_nOrigin;
BOOL1 m_bDraftMode;
public:
CRecordNoZoomViewInfoAtom()
{
}
~CRecordNoZoomViewInfoAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordNormalViewSetInfoAtom : public CUnknownRecord
{
SRatioAtom m_oLeftPortion;
SRatioAtom m_oTopPortion;
BYTE m_nVertBarState;
BYTE m_HorizBarState;
BOOL1 m_fPreferSingleSet;
BYTE m_nFlags;
public:
CRecordNormalViewSetInfoAtom()
{
}
~CRecordNormalViewSetInfoAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordNotesAtom : public CUnknownRecord
{
UINT m_nSlideIDRef;
bool m_bMasterObjects;
bool m_bMasterScheme;
bool m_bMasterBackground;
public:
CRecordNotesAtom()
{
}
~CRecordNotesAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_nSlideIDRef = (UINT)StreamUtils::ReadDWORD(pStream);
USHORT nFlag = StreamUtils::ReadWORD(pStream);
m_bMasterObjects = ((nFlag & 0x01) == 0x01);
m_bMasterScheme = ((nFlag & 0x02) == 0x02);
m_bMasterBackground = ((nFlag & 0x04) == 0x04);
StreamUtils::StreamSkip(2, pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("SlideIdRef"), (DWORD)m_nSlideIDRef, &oWriter);
CDirectory::WriteValueToNode(_T("MasterObjects"), m_bMasterObjects, &oWriter);
CDirectory::WriteValueToNode(_T("MasterScheme"), m_bMasterScheme, &oWriter);
CDirectory::WriteValueToNode(_T("MasterBackground"), m_bMasterBackground, &oWriter);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordNotesPersistAtom : public CUnknownRecord
{
UINT m_nPsrRef;
INT m_nNotesID;
public:
CRecordNotesPersistAtom()
{
}
~CRecordNotesPersistAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordOutlineTextRefAtom : public CUnknownRecord
{
public:
DWORD m_nIndex;
public:
CRecordOutlineTextRefAtom()
{
}
~CRecordOutlineTextRefAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_nIndex = StreamUtils::ReadDWORD(pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("Index"), m_nIndex, &oWriter);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include <map>
#include "../Reader/Records.h"
class CPersistDirectoryEntry
{
public:
DWORD m_nPersistID; // PersistOffsetID[index] = m_nPersistID + index
DWORD m_nPersistCount;
std::vector<DWORD> m_arPersistOffsets;
public:
CPersistDirectoryEntry() : m_arPersistOffsets()
{
m_nPersistID = 0;
m_nPersistCount = 0;
}
DWORD FromStream(POLE::Stream* pStream)
{
DWORD nFlag = StreamUtils::ReadDWORD(pStream);
m_nPersistID = (nFlag & 0x000FFFFF); // 20 bit
m_nPersistCount = (nFlag & 0xFFF00000) >> 20; // 12 bit
m_arPersistOffsets.clear();
for (DWORD index = 0; index < m_nPersistCount; ++index)
{
DWORD Mem = StreamUtils::ReadDWORD(pStream);
m_arPersistOffsets.push_back(Mem);
}
return 4 * (m_nPersistCount + 1);
}
};
class CRecordPersistDirectoryAtom : public CUnknownRecord
{
std::vector<CPersistDirectoryEntry> m_arEntries;
public:
CRecordPersistDirectoryAtom() : m_arEntries()
{
}
~CRecordPersistDirectoryAtom()
{
m_arEntries.clear();
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
DWORD nCountRead = 0;
DWORD nCountEnries = 0;
while (nCountRead < m_oHeader.RecLen)
{
CPersistDirectoryEntry elm;
m_arEntries.push_back(elm);
nCountRead += m_arEntries[nCountEnries].FromStream(pStream);
++nCountEnries;
}
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE);
return oWriter.GetXmlString();
}
void ToMap(std::map<DWORD, DWORD>* pMap)
{
pMap->clear();
for (size_t nEntry = 0; nEntry < m_arEntries.size(); ++nEntry)
{
DWORD nPID = m_arEntries[nEntry].m_nPersistID;
for (size_t nIndex = 0; nIndex < m_arEntries[nEntry].m_nPersistCount; ++nIndex)
{
DWORD nOffset = m_arEntries[nEntry].m_arPersistOffsets[nIndex];
pMap->insert(std::pair<DWORD, DWORD>(nPID, nOffset));
++nPID;
}
}
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordPlaceHolderAtom : public CUnknownRecord
{
public:
LONG m_nPosition;
BYTE m_nPlacementID;
BYTE m_nSize;
public:
CRecordPlaceHolderAtom()
{
}
~CRecordPlaceHolderAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_nPosition = StreamUtils::ReadLONG(pStream);
m_nPlacementID = StreamUtils::ReadBYTE(pStream);
m_nSize = StreamUtils::ReadBYTE(pStream);
StreamUtils::StreamSkip(2, pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("Position"), (DWORD)m_nPosition, &oWriter);
CDirectory::WriteValueToNode(_T("PlacementID"), (DWORD)m_nPlacementID, &oWriter);
CDirectory::WriteValueToNode(_T("Size"), (DWORD)m_nSize, &oWriter);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
// main
//#include "CurrentUserAtom.h"
#include "UserEditAtom.h"
#include "SlideListWithText.h"
#include "PersistDirectoryAtom.h"
#include "DocumentRecords.h"
#include "DocumentTextInfo.h"
// drawing records
#include "Drawing/ChildAnchor.h"
#include "Drawing/BitmapBlip.h"
#include "Drawing/BlipStoreContainer.h"
#include "Drawing/BlipStoreEntry.h"
#include "Drawing/ClientAnchor.h"
#include "Drawing/DrawingGroup.h"
#include "Drawing/DrawingRecord.h"
#include "Drawing/GroupShape.h"
#include "Drawing/GroupShapeContainer.h"
#include "Drawing/Shape.h"
#include "Drawing/ShapeProperties.h"
#include "Drawing/TextBox.h"
#include "Drawing/ShapeContainer.h"
#include "Drawing/RegGroupItems.h"
#include "Drawing/DrawingContainer.h"
// others
#include "AnimationInfoAtom.h"
#include "BlipEntityAtom.h"
#include "BookmarkEntityAtom.h"
#include "BookmarkSeedAtom.h"
#include "CString.h"
#include "ColorSchemeAtom.h"
#include "DateTimeMCAtom.h"
#include "DocRoutingSlipAtom.h"
#include "DocumentAtom.h"
#include "ExControlAtom.h"
#include "EndDocument.h"
#include "ExHyperlinkAtom.h"
#include "ExMediaAtom.h"
#include "ExVideoContainer.h"
#include "ExObjListAtom.h"
#include "ExObjRefAtom.h"
#include "ExOleEmbedAtom.h"
#include "ExOleLinkAtom.h"
#include "ExOleObjAtom.h"
#include "FontEntityAtom.h"
#include "GenericDateMCAtom.h"
#include "GridSpacing10Atom.h"
#include "GuideAtom.h"
#include "HeadersFootersAtom.h"
#include "KinsokuAtom.h"
#include "MasterPersistAtom.h"
#include "MasterTextPropAtom.h"
#include "MetafileBlob.h"
#include "MouseTextInteractiveInfoAtom.h"
#include "NamedShowSlidesAtom.h"
#include "NormalViewSetInfoAtom.h"
#include "NotesAtom.h"
#include "NotesPersistAtom.h"
#include "NoZoomViewInfoAtom.h"
#include "OutlineTextRefAtom.h"
#include "PlaceHolderAtom.h"
#include "RoundTripColorMappingAtom.h"
#include "RoundTripNewPlaceholderId12Atom.h"
#include "RoundTripThemeAtom.h"
#include "SlideNumberMCAtom.h"
#include "TextRulerAtom.h"
#include "ShapeFlags10Atom.h"
#include "ShapeFlagsAtom.h"
#include "SlideAtom.h"
#include "SlideContainer.h"
#include "SlideColorSchemeAtom.h"
#include "SlidePersistAtom.h"
#include "SlideViewInfoAtom.h"
#include "SoundCollAtom.h"
#include "SoundDataBlob.h"
#include "SSDocInfoAtom.h"
#include "SSlideLayoutAtom.h"
#include "SSSlideInfoAtom.h"
#include "StyleTextPropAtom.h"
#include "TextSpecInfoAtom.h"
#include "TextBookmarkAtom.h"
#include "TextBytesAtom.h"
#include "TextCFExceptionAtom.h"
#include "TextCharsAtom.h"
#include "TextHeaderAtom.h"
#include "TextMasterStyleAtom.h"
#include "TextPFExceptionAtom.h"
#include "TextSIExceptionAtom.h"
#include "VBAInfoAtom.h"
#include "ViewInfoAtom.h"
#include "ZoomViewInfoAtom.h"
#include "Animations/AnimationTypes.h"
#include "InteractiveInfoAtom.h"
#include "TextInteractiveInfoAtom.h"
//sound
#include "ExMIDIAudioContainer.h"
#include "ExCDAudioContainer.h"
#include "ExWAVAudioLinkContainer.h"
#include "ExWAVAudioEmbeddedContainer.h"
#include "ExObjListContainer.h"
#include "SoundCollectionContainer.h"
#include "SoundContainer.h"
#include "RoundTripOriginalMainMasterId12Atom.h"
#include "RoundTripCompositeMainMasterId12Atom.h"
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordRoundTripColorMappingAtom : public CUnknownRecord
{
CStringW m_pString;
public:
CRecordRoundTripColorMappingAtom()
{
}
~CRecordRoundTripColorMappingAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordTripCompositeMasterId12Atom : public CUnknownRecord
{
public:
DWORD m_dwID;
public:
CRecordTripCompositeMasterId12Atom()
{
m_dwID = 0xFFFFFFFF;
}
~CRecordTripCompositeMasterId12Atom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_dwID = StreamUtils::ReadDWORD(pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("ID"), m_dwID, &oWriter);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordRoundTripNewPlaceholderId12Atom : public CUnknownRecord
{
BYTE m_nFlags;
public:
CRecordRoundTripNewPlaceholderId12Atom()
{
}
~CRecordRoundTripNewPlaceholderId12Atom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordTripOriginalMasterId12Atom : public CUnknownRecord
{
public:
DWORD m_dwID;
public:
CRecordTripOriginalMasterId12Atom()
{
m_dwID = 0xFFFFFFFF;
}
~CRecordTripOriginalMasterId12Atom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_dwID = StreamUtils::ReadDWORD(pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("ID"), m_dwID, &oWriter);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordRoundTripThemeAtom : public CUnknownRecord
{
CString m_strData;
public:
CRecordRoundTripThemeAtom()
{
}
~CRecordRoundTripThemeAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordSSDocInfoAtom : public CUnknownRecord
{
SColorAtom m_oColor;
INT m_nRestartTime;
SHORT m_nStartSlide;
SHORT m_nEndSlide;
USHORT m_pName[32];
USHORT m_nFlags;
public:
CRecordSSDocInfoAtom()
{
}
~CRecordSSDocInfoAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CSlideShowSlideInfoAtom : public CUnknownRecord
{
public:
INT m_nSlideTime;
DWORD m_nSoundRef;
BYTE m_nEffectDirection;
BYTE m_nEffectType;
bool m_bManualAdvance;
// reserved1 (1 bit)
bool m_bHidden;
// reserved1 (1 bit)
bool m_bSound;
// reserved1 (1 bit)
bool m_bLoopSound;
// reserved1 (1 bit)
bool m_bStopSound;
// reserved1 (1 bit)
bool m_bAutoAdvance;
// reserved1 (1 bit)
bool m_bCursorVisible;
// reserved1 (3 bit)
BYTE m_nSpeed;
public:
CSlideShowSlideInfoAtom()
{
m_nSlideTime = -1;
m_nSoundRef = 0xFFFFFFFE;
m_nEffectDirection = 0;
m_nEffectType = 0;
m_bManualAdvance = false;
m_bHidden = false;
m_bSound = false;
m_bLoopSound = false;
m_bStopSound = false;
m_bAutoAdvance = false;
m_bCursorVisible = false;
m_nSpeed = 1;
}
~CSlideShowSlideInfoAtom()
{
}
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
{
m_oHeader = oHeader;
m_nSlideTime = (INT)StreamUtils::ReadDWORD ( pStream );
m_nSoundRef = StreamUtils::ReadDWORD ( pStream );
m_nEffectDirection = StreamUtils::ReadBYTE ( pStream );
m_nEffectType = StreamUtils::ReadBYTE ( pStream );
BYTE bValue = StreamUtils::ReadBYTE ( pStream );
m_bManualAdvance = (0x01 == (0x01 & bValue));
m_bHidden = (0x04 == (0x04 & bValue));
m_bSound = (0x10 == (0x10 & bValue));
m_bLoopSound = (0x40 == (0x40 & bValue));
bValue = StreamUtils::ReadBYTE ( pStream );
m_bStopSound = (0x01 == (0x01 & bValue));
m_bAutoAdvance = (0x04 == (0x04 & bValue));
m_bCursorVisible = (0x10 == (0x10 & bValue));
//DWORD dwValue = StreamUtils::ReadDWORD ( pStream );
//m_nSpeed = ( 0x01 == ( 0x01 & ((BYTE)dwValue) ) );
m_nSpeed = StreamUtils::ReadBYTE( pStream );
StreamUtils::StreamSkip(3, pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("SlideTime"), (LONG)m_nSlideTime, &oWriter);
CDirectory::WriteValueToNode(_T("SoundRef"), m_nSoundRef, &oWriter);
CDirectory::WriteValueToNode(_T("EffectDuration"), (DWORD)m_nEffectDirection, &oWriter);
CDirectory::WriteValueToNode(_T("EffectType"), (DWORD)m_nEffectType, &oWriter);
CDirectory::WriteValueToNode(_T("ManualAdvance"), m_bManualAdvance, &oWriter);
CDirectory::WriteValueToNode(_T("Hidden"), m_bHidden, &oWriter);
CDirectory::WriteValueToNode(_T("Sound"), m_bSound, &oWriter);
CDirectory::WriteValueToNode(_T("LoopSound"), m_bLoopSound, &oWriter);
CDirectory::WriteValueToNode(_T("StopSound"), m_bStopSound, &oWriter);
CDirectory::WriteValueToNode(_T("AutoAdvance"), m_bAutoAdvance, &oWriter);
CDirectory::WriteValueToNode(_T("CursorVisible"), m_bCursorVisible, &oWriter);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
double GetTimeTransition()
{
double dTime = 500.0;
if (0 == m_nSpeed)
{
dTime = 750.0;
}
else if (2 == m_nSpeed)
{
dTime = 250.0;
}
return dTime;
}
double GetTimeSlide()
{
return (double)m_nSlideTime;
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordSSlideLayoutAtom : public CUnknownRecord
{
INT m_nGeom;
BYTE m_pPlaceHolderID[8];
public:
CRecordSSlideLayoutAtom()
{
}
~CRecordSSlideLayoutAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordShapeFlags10Atom : public CUnknownRecord
{
BYTE m_nFlags;
public:
CRecordShapeFlags10Atom()
{
}
~CRecordShapeFlags10Atom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordShapeFlagsAtom : public CUnknownRecord
{
BYTE m_nFlags;
public:
CRecordShapeFlagsAtom()
{
}
~CRecordShapeFlagsAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordSlideAtom : public CUnknownRecord
{
public:
SSlideLayoutAtom m_oLayout;
UINT m_nMasterIDRef;
UINT m_nNotesIDRef;
bool m_bMasterObjects;
bool m_bMasterScheme;
bool m_bMasterBackground;
public:
CRecordSlideAtom()
{
}
~CRecordSlideAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_oLayout.m_nGeom = (INT)StreamUtils::ReadLONG(pStream);
for (int nIndex = 0; nIndex < 8; nIndex++)
{
m_oLayout.m_pPlaceHolderID[nIndex] = StreamUtils::ReadBYTE(pStream);
}
m_nMasterIDRef = (UINT)StreamUtils::ReadDWORD(pStream);
m_nNotesIDRef = (UINT)StreamUtils::ReadDWORD(pStream);
USHORT nFlag = StreamUtils::ReadWORD(pStream);
m_bMasterObjects = ((nFlag & 0x01) == 0x01);
m_bMasterScheme = ((nFlag & 0x02) == 0x02);
m_bMasterBackground = ((nFlag & 0x04) == 0x04);
StreamUtils::StreamSkip(2, pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
oWriter.WriteString(m_oLayout.ToString());
CDirectory::WriteValueToNode(_T("MasterIDRef"), (DWORD)m_nMasterIDRef, &oWriter);
CDirectory::WriteValueToNode(_T("NotesIDRef"), (DWORD)m_nNotesIDRef, &oWriter);
CDirectory::WriteValueToNode(_T("MasterObjects"), m_bMasterObjects, &oWriter);
CDirectory::WriteValueToNode(_T("MasterScheme"), m_bMasterScheme, &oWriter);
CDirectory::WriteValueToNode(_T("MasterBackground"), m_bMasterBackground, &oWriter);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordSlideColorSchemeAtom : public CUnknownRecord
{
SColorAtom m_arColors[8];
public:
CRecordSlideColorSchemeAtom()
{
}
~CRecordSlideColorSchemeAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
typedef CRecordSlideColorSchemeAtom CRecordSchemeListElementColorSchemeAtom;
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
#include "../Records/Animations/AnimationTypes.h"
#include "../Records/SSSlideInfoAtom.h"
class CRecordSlide : public CRecordsContainer
{
public:
SSlidePersist m_oPersist;
SlideProgTagsContainer* m_pSlideProgTagsContainer;
bool m_bExistsTransition;
CSlideShowSlideInfoAtom m_oSlideShowSlideInfoAtom;
int m_Index;
private:
DWORD m_lCountReferences;
public:
CRecordSlide()
{
m_bExistsTransition = false;
m_pSlideProgTagsContainer = NULL;
m_lCountReferences = 0;
m_Index = -1;
AddRef();
}
virtual ~CRecordSlide()
{
Clear();
RELEASEOBJECT ( m_pSlideProgTagsContainer );
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_arRecords.clear();
LONG lPosition = 0;
StreamUtils::StreamPosition(lPosition, pStream);
m_oHeader = oHeader;
UINT lCurLen = 0;
SRecordHeader oRec;
while (lCurLen < m_oHeader.RecLen)
{
if (oRec.ReadFromStream(pStream) == FALSE)
{
break;
}
if ( 0x03F9 == oRec.RecType )
{
m_bExistsTransition = true;
m_oSlideShowSlideInfoAtom.ReadFromStream ( oRec, pStream );
// TODO :
if ( 0 == m_oSlideShowSlideInfoAtom.m_nEffectType )
m_bExistsTransition = false;
lCurLen += (8 + oRec.RecLen);
continue;
}
IRecord* pRecord = CreateByType ( oRec );
if ( RECORD_PROG_TAGS == oRec.RecType )
{
m_pSlideProgTagsContainer = new SlideProgTagsContainer ();
m_pSlideProgTagsContainer->ReadFromStream(oRec, pStream);
}
else
{
pRecord->ReadFromStream(oRec, pStream);
m_arRecords.push_back(pRecord);
}
lCurLen += (8 + oRec.RecLen);
}
if (lCurLen != m_oHeader.RecLen)
{
// , !!!
LONG lPosition = 0;
StreamUtils::StreamSeek(lPosition + m_oHeader.RecLen, pStream);
}
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = _T("__SLIDE__");
oWriter.WriteNodeBegin(strName);
oWriter.WriteString(m_oPersist.ToString());
oWriter.WriteString(CRecordsContainer::ToString());
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
virtual CString ToString(DWORD nPID)
{
XmlUtils::CXmlWriter oWriter;
CString strName = _T("__SLIDE__");
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("id"), CDirectory::ToString(nPID));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
oWriter.WriteString(m_oPersist.ToString());
oWriter.WriteString(m_oSlideShowSlideInfoAtom.ToString());
oWriter.WriteString(CRecordsContainer::ToString());
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
BOOL IsSlide()
{
for (int nIndex = 0; nIndex < m_arRecords.size(); ++nIndex)
{
if ((RECORD_TYPE_SLIDE == m_arRecords[nIndex]->m_oHeader.RecType) ||
(RECORD_TYPE_MAINMASTER == m_arRecords[nIndex]->m_oHeader.RecType) ||
(RECORD_TYPE_NOTES == m_arRecords[nIndex]->m_oHeader.RecType))
{
return true;
}
}
return false;
}
void AddRef()
{
++m_lCountReferences;
}
void Release()
{
--m_lCountReferences;
if (0 == m_lCountReferences)
delete this;
}
CRecordSlide* QueryInterface()
{
AddRef();
return this;
}
};
#pragma once
#include "TextFullSettings.h"
#include "SlidePersistAtom.h"
class CRecordSlideListWithText : public CRecordsContainer
{
public:
enum Instances
{
CollectionOfSlides = 0,
CollectionOfMasterSlides = 1,
CollectionOfNotesSlides = 2
};
public:
std::vector<CRecordSlidePersistAtom*> m_arSlides;
std::vector<std::vector<CTextFullSettings>> m_arTextPlaceHolders;
Instances m_Type;
public:
CRecordSlideListWithText() : m_arSlides()
{
m_Type = CollectionOfSlides;
}
~CRecordSlideListWithText()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_Type = (Instances)m_oHeader.RecInstance;
if (m_oHeader.IsContainer())
{
// - ...
DWORD lSymbolCount = 0;
UINT lCurLen = 0;
SRecordHeader oRec;
while (lCurLen < m_oHeader.RecLen)
{
if (oRec.ReadFromStream(pStream) == FALSE)
{
break;
}
IRecord* pRecord = CreateByType(oRec);
if (RECORD_TYPE_STYLE_TEXTPROP_ATOM == oRec.RecType)
{
((CRecordStyleTextPropAtom*)(pRecord))->m_lCount = lSymbolCount;
}
else if (RECORD_TYPE_TEXTSPECINFO_ATOM == oRec.RecType)
{
((CRecordTextSpecInfoAtom*)(pRecord))->m_lCount = lSymbolCount;
}
pRecord->ReadFromStream(oRec, pStream);
lCurLen += (8 + oRec.RecLen);
if (RECORD_TYPE_SLIDE_PERSIST_ATOM == oRec.RecType)
{
m_arSlides.push_back((CRecordSlidePersistAtom*)pRecord);
std::vector<CTextFullSettings> elm;
m_arTextPlaceHolders.push_back(elm);
}
else
{
long nCurrentSlide = (long)m_arSlides.size() - 1;
if (0 > nCurrentSlide)
continue;
CRecordTextHeaderAtom* pHeader = dynamic_cast<CRecordTextHeaderAtom*>(pRecord);
if (NULL != pHeader)
{
CTextFullSettings oAttr;
m_arTextPlaceHolders[nCurrentSlide].push_back(oAttr);
m_arTextPlaceHolders[nCurrentSlide][m_arTextPlaceHolders[nCurrentSlide].size() - 1].m_nTextType = pHeader->m_nTextType;
m_arRecords.push_back(pRecord);
continue;
}
CRecordTextCharsAtom* pChars = dynamic_cast<CRecordTextCharsAtom*>(pRecord);
CRecordTextBytesAtom* pBytes = dynamic_cast<CRecordTextBytesAtom*>(pRecord);
long nCurrentTextHeader = (long)m_arTextPlaceHolders[nCurrentSlide].size() - 1;
if (0 > nCurrentTextHeader)
continue;
//
if (NULL != pChars)
{
m_arTextPlaceHolders[nCurrentSlide][nCurrentTextHeader].m_strText = pChars->m_strText;
lSymbolCount = (DWORD)pChars->m_strText.GetLength();
}
else if (NULL != pBytes)
{
m_arTextPlaceHolders[nCurrentSlide][nCurrentTextHeader].m_strText = (CStringW)pBytes->m_strText;
lSymbolCount = (DWORD)pBytes->m_strText.GetLength();
}
if (RECORD_TYPE_STYLE_TEXTPROP_ATOM == oRec.RecType)
{
m_arTextPlaceHolders[nCurrentSlide][nCurrentTextHeader].m_pTextStyleProp =
dynamic_cast<CRecordStyleTextPropAtom*>(pRecord);
}
if (RECORD_TYPE_TEXTSPECINFO_ATOM == oRec.RecType)
{
m_arTextPlaceHolders[nCurrentSlide][nCurrentTextHeader].m_pTextSpecInfo =
dynamic_cast<CRecordTextSpecInfoAtom*>(pRecord);
}
if (RECORD_TYPE_TEXTRULER_ATOM == oRec.RecType)
{
m_arTextPlaceHolders[nCurrentSlide][nCurrentTextHeader].m_pTextRuler =
dynamic_cast<CRecordTextRulerAtom*>(pRecord);
}
if (RECORD_TYPE_TXINTERACTIVEINFO_ATOM == oRec.RecType)
{
CRecordTextInteractiveInfoAtom* pTxRanges = dynamic_cast<CRecordTextInteractiveInfoAtom*>(pRecord);
NSPresentationEditor::CTextRange oRange;
oRange.m_lStart = pTxRanges->m_lStart;
oRange.m_lEnd = pTxRanges->m_lEnd;
m_arTextPlaceHolders[nCurrentSlide][nCurrentTextHeader].m_arRanges.push_back(oRange);
}
}
m_arRecords.push_back(pRecord);
}
}
}
virtual CString ToString()
{
return CRecordsContainer::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordSlideNumberMCAtom : public CUnknownRecord
{
UINT m_nPosition;
public:
CRecordSlideNumberMCAtom()
{
}
~CRecordSlideNumberMCAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordSlidePersistAtom : public CUnknownRecord
{
public:
DWORD m_nPsrRef;
bool m_bShouldCollapse;
bool m_bNonOutlineData;
INT m_nNumberText;
DWORD m_nSlideID;
public:
CRecordSlidePersistAtom()
{
}
~CRecordSlidePersistAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_nPsrRef = StreamUtils::ReadDWORD(pStream);
BYTE Mem = 0;
Mem = StreamUtils::ReadBYTE(pStream);
m_bShouldCollapse = ((Mem & 0x02) == 0x02);
m_bNonOutlineData = ((Mem & 0x04) == 0x04);
StreamUtils::StreamSkip(3, pStream);
m_nNumberText = (INT)StreamUtils::ReadLONG(pStream);
m_nSlideID = StreamUtils::ReadDWORD(pStream);
StreamUtils::StreamSkip(4, pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("PsrRef"), m_nPsrRef, &oWriter);
CDirectory::WriteValueToNode(_T("ShouldCollapse"), m_bShouldCollapse, &oWriter);
CDirectory::WriteValueToNode(_T("NonOutlineData"), m_bNonOutlineData, &oWriter);
CDirectory::WriteValueToNode(_T("NumberText_PlaceholderShapes"), (DWORD)m_nNumberText, &oWriter);
CDirectory::WriteValueToNode(_T("SlideID"), m_nSlideID, &oWriter);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordSlideViewInfoAtom : public CUnknownRecord
{
BOOL1 m_bShowGuides;
BOOL1 m_bSnapToGrid;
BOOL1 m_bSnapToShape;
public:
CRecordSlideViewInfoAtom()
{
}
~CRecordSlideViewInfoAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_bShowGuides = StreamUtils::ReadBYTE(pStream);
m_bSnapToGrid = StreamUtils::ReadBYTE(pStream);
m_bSnapToShape = StreamUtils::ReadBYTE(pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("ShowGuides"), (DWORD)m_bShowGuides, &oWriter);
CDirectory::WriteValueToNode(_T("SnapToGrid"), (DWORD)m_bSnapToGrid, &oWriter);
CDirectory::WriteValueToNode(_T("SnapToShape"), (DWORD)m_bSnapToShape, &oWriter);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordSoundCollAtom : public CUnknownRecord
{
INT m_nObjectIdSeed;
public:
CRecordSoundCollAtom()
{
}
~CRecordSoundCollAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordSoundCollectionContainer : public CRecordsContainer
{
public:
CRecordSoundCollectionContainer()
{
}
~CRecordSoundCollectionContainer()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
CRecordsContainer::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CRecordsContainer::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordSoundContainer : public CRecordsContainer
{
public:
CRecordSoundContainer()
{
}
~CRecordSoundContainer()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
CRecordsContainer::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CRecordsContainer::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordSoundDataBlob : public CUnknownRecord
{
BYTE* m_pData;
LONG m_lSize;
public:
CRecordSoundDataBlob()
{
m_pData = NULL;
m_lSize = 0;
}
~CRecordSoundDataBlob()
{
ReleaseData();
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_lSize = m_oHeader.RecLen;
if (0 < m_lSize)
{
m_pData = new BYTE[m_lSize];
pStream->read(m_pData, m_lSize);
}
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
void ReleaseData()
{
RELEASEARRAYOBJECTS(m_pData);
}
void SaveToFile(CString strFile)
{
if ((NULL == m_pData) || (0 >= m_lSize))
return;
CFile oFile;
oFile.CreateFile(strFile);
oFile.WriteFile((void*)m_pData, (DWORD)m_lSize);
oFile.CloseFile();
ReleaseData();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordStyleTextPropAtom : public CUnknownRecord
{
public:
// ,
//
LONG m_lOffsetInStream;
// .
// Text.Bytes/Chars.Atom
DWORD m_lCount;
public:
std::vector<CTextPFRun_ppt> m_arrPFs;
std::vector<CTextCFRun_ppt> m_arrCFs;
public:
CRecordStyleTextPropAtom()
{
m_lCount = 0;
m_lOffsetInStream = 0;
}
~CRecordStyleTextPropAtom()
{
m_lCount = 0;
}
void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
StreamUtils::StreamPosition(m_lOffsetInStream, pStream);
DWORD lMemCount = 0;
DWORD lCountItems = 0;
if (0 == m_lCount)
{
StreamUtils::StreamSeek(m_lOffsetInStream + m_oHeader.RecLen, pStream);
return;
}
while (lMemCount < m_lCount + 1)
{
CTextPFRun_ppt elm;
m_arrPFs.push_back(elm);
m_arrPFs[lCountItems].LoadFromStream(pStream);
lMemCount += m_arrPFs[lCountItems].m_lCount;
++lCountItems;
}
lMemCount = 0;
lCountItems = 0;
while (lMemCount < m_lCount + 1)
{
CTextCFRun_ppt elm;
m_arrCFs.push_back(elm);
m_arrCFs[lCountItems].LoadFromStream(pStream);
lMemCount += m_arrCFs[lCountItems].m_lCount;
++lCountItems;
}
// ...
// (.. - placeholder ) -
// m_lCount...
StreamUtils::StreamSeek(m_lOffsetInStream + m_oHeader.RecLen, pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
for (size_t nIndexPF = 0; nIndexPF < m_arrPFs.size(); ++nIndexPF)
{
oWriter.WriteString(m_arrPFs[nIndexPF].m_oRun.ToString(m_arrPFs[nIndexPF].m_lCount));
}
for (size_t nIndexCF = 0; nIndexCF < m_arrCFs.size(); ++nIndexCF)
{
oWriter.WriteString(m_arrCFs[nIndexCF].m_oRun.ToString(m_arrCFs[nIndexCF].m_lCount));
}
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
#pragma once
#include "../Reader/Records.h"
class CRecordTextBookmarkAtom : public CUnknownRecord
{
UINT m_nBegin;
UINT m_nEnd;
UINT m_nBookmarkID;
public:
CRecordTextBookmarkAtom()
{
}
~CRecordTextBookmarkAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordTextBytesAtom : public CUnknownRecord
{
public:
CString m_strText;
public:
CRecordTextBytesAtom()
{
}
~CRecordTextBytesAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
std::string tmpStrTextA = string2std_string(StreamUtils::ReadCStringA(pStream, m_oHeader.RecLen));
std::wstring tmpStrTextW (tmpStrTextA.begin(), tmpStrTextA.end());
m_strText = std_string2string(tmpStrTextW);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteAttribute(_T("text"), m_strText);
oWriter.WriteNodeEnd(strName, TRUE);
return oWriter.GetXmlString();
}
};
#pragma once
#include "../Reader/Records.h"
class CRecordTextCFExceptionAtom : public CUnknownRecord
{
public:
CTextCFRun_ppt m_oCFRun;
CRecordTextCFExceptionAtom()
{
}
~CRecordTextCFExceptionAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
LONG lPosition = 0;
StreamUtils::StreamPosition(lPosition, pStream);
m_oCFRun.LoadFromStream(pStream, false);
// ...
StreamUtils::StreamSeek(lPosition + m_oHeader.RecLen, pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
oWriter.WriteNodeBegin(_T("TextCFExceptionAtom"));
oWriter.WriteString(m_oCFRun.m_oRun.ToString(0));
oWriter.WriteNodeEnd(_T("TextCFExceptionAtom"));
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordTextCharsAtom : public CUnknownRecord
{
public:
CStringW m_strText;
public:
CRecordTextCharsAtom()
{
}
~CRecordTextCharsAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_strText = StreamUtils::ReadCStringW(pStream, m_oHeader.RecLen / 2);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteAttribute(_T("text"), (CString)m_strText);
oWriter.WriteNodeEnd(strName, TRUE);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "TextHeaderAtom.h"
#include "TextCharsAtom.h"
#include "TextBytesAtom.h"
#include "StyleTextPropAtom.h"
#include "TextSpecInfoAtom.h"
#include "TextRulerAtom.h"
#include "TextInteractiveInfoAtom.h"
#include "../../../../ASCPresentationEditor/OfficeDrawing/Interactive.h"
class CTextFullSettings
{
public:
CRecordStyleTextPropAtom* m_pTextStyleProp;
CRecordTextSpecInfoAtom* m_pTextSpecInfo;
CRecordTextRulerAtom* m_pTextRuler;
std::vector<NSPresentationEditor::CTextRange> m_arRanges;
CStringW m_strText;
DWORD m_nTextType;
public:
CTextFullSettings() : m_arRanges()
{
m_pTextStyleProp = NULL;
m_pTextSpecInfo = NULL;
m_pTextRuler = NULL;
m_nTextType = 0xFFFFFFFF;
m_strText.Empty();
}
CTextFullSettings(const CTextFullSettings& oSrc)
{
*this = oSrc;
}
CTextFullSettings& operator =(const CTextFullSettings& oSrc)
{
m_pTextStyleProp = oSrc.m_pTextStyleProp;
m_pTextSpecInfo = oSrc.m_pTextSpecInfo;
m_pTextRuler = oSrc.m_pTextRuler;
m_nTextType = oSrc.m_nTextType;
m_strText = oSrc.m_strText;
m_arRanges = oSrc.m_arRanges;
return (*this);
}
~CTextFullSettings()
{
m_pTextStyleProp = NULL;
m_pTextSpecInfo = NULL;
m_pTextRuler = NULL;
}
CString ApplyProperties(CTextAttributesEx* pTextAttributes)
{
if (NULL == pTextAttributes)
return m_strText;
pTextAttributes->m_lTextType = m_nTextType;
if (NULL != m_pTextStyleProp)
NSPresentationEditor::ConvertPPTTextToEditorStructure(m_pTextStyleProp->m_arrPFs, m_pTextStyleProp->m_arrCFs, m_strText, *pTextAttributes);
if (NULL != m_pTextRuler)
pTextAttributes->m_oRuler = m_pTextRuler->m_oTextRuler;
return m_strText;
}
};
#pragma once
#include "../Reader/Records.h"
class CRecordTextHeaderAtom : public CUnknownRecord
{
public:
UINT m_nTextType;
public:
CRecordTextHeaderAtom()
{
}
~CRecordTextHeaderAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_nTextType = (UINT)StreamUtils::ReadDWORD(pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("TextType"), (DWORD)m_nTextType, &oWriter);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordTextInteractiveInfoAtom : public CUnknownRecord
{
public:
LONG m_lStart;
LONG m_lEnd;
public:
CRecordTextInteractiveInfoAtom()
{
m_lStart = 0;
m_lEnd = 0;
}
~CRecordTextInteractiveInfoAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_lStart = StreamUtils::ReadLONG(pStream);
m_lEnd = StreamUtils::ReadLONG(pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("start"), m_lStart, &oWriter);
CDirectory::WriteValueToNode(_T("end"), m_lEnd, &oWriter);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordTextMasterStyleAtom : public CUnknownRecord, public NSPresentationEditor::CTextStyles
{
public:
LONG m_nTextType;
CRecordTextMasterStyleAtom() : NSPresentationEditor::CTextStyles()
{
m_nTextType = 0;
}
~CRecordTextMasterStyleAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
LONG lPosition = 0;
StreamUtils::StreamPosition(lPosition, pStream);
m_nTextType = m_oHeader.RecInstance;
bool bIsLevelsPresent = (0x05 <= m_oHeader.RecInstance);
LONG lLevels = StreamUtils::ReadWORD(pStream);
if (0 < lLevels)
LoadLevel(0, pStream, bIsLevelsPresent);
if (1 < lLevels)
LoadLevel(1, pStream, bIsLevelsPresent);
if (2 < lLevels)
LoadLevel(2, pStream, bIsLevelsPresent);
if (3 < lLevels)
LoadLevel(3, pStream, bIsLevelsPresent);
if (4 < lLevels)
LoadLevel(4, pStream, bIsLevelsPresent);
// : ----------------------------------------------
if (m_pLevels[0].is_init())
{
if (!m_pLevels[1].is_init())
m_pLevels[1] = m_pLevels[0].get();
else
m_pLevels[1]->ApplyBefore(m_pLevels[0].get());
}
if (m_pLevels[1].is_init())
{
if (!m_pLevels[2].is_init())
m_pLevels[2] = m_pLevels[1].get();
else
m_pLevels[2]->ApplyBefore(m_pLevels[1].get());
}
if (m_pLevels[2].is_init())
{
if (!m_pLevels[3].is_init())
m_pLevels[3] = m_pLevels[2].get();
else
m_pLevels[3]->ApplyBefore(m_pLevels[2].get());
}
if (m_pLevels[3].is_init())
{
if (!m_pLevels[4].is_init())
m_pLevels[4] = m_pLevels[3].get();
else
m_pLevels[4]->ApplyBefore(m_pLevels[3].get());
}
// -----------------------------------------------------------------------
// ...
StreamUtils::StreamSeek(lPosition + m_oHeader.RecLen, pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
for (int i = 0; i < 5; ++i)
{
oWriter.WriteString(_T("<TextStyleLevel>"));
if (m_pLevels[i].is_init())
{
oWriter.WriteString(m_pLevels[i]->m_oPFRun.ToString(0));
oWriter.WriteString(m_pLevels[i]->m_oCFRun.ToString(0));
}
oWriter.WriteString(_T("</TextStyleLevel>"));
}
//oWriter.WriteString(NSPresentationEditor::CTextStyles::ToString());
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
protected:
void LoadLevel(LONG lLevel, POLE::Stream* pStream, bool bIsLevelPresent)
{
LONG lLevelOld = lLevel;
if (bIsLevelPresent)
lLevel = StreamUtils::ReadSHORT(pStream);
CTextPFRun_ppt oPF;
CTextCFRun_ppt oCF;
oPF.LoadFromStream(pStream, false);
oCF.LoadFromStream(pStream, false);
m_pLevels[lLevelOld] = new NSPresentationEditor::CTextStyleLevel();
m_pLevels[lLevelOld]->m_oPFRun = oPF.m_oRun;
m_pLevels[lLevelOld]->m_oCFRun = oCF.m_oRun;
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordTextPFExceptionAtom : public CUnknownRecord
{
public:
CTextPFRun_ppt m_oPFRun;
CRecordTextPFExceptionAtom()
{
}
~CRecordTextPFExceptionAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
LONG lPosition = 0;
StreamUtils::StreamPosition(lPosition, pStream);
m_oPFRun.LoadFromStream(pStream, false);
// ...
StreamUtils::StreamSeek(lPosition + m_oHeader.RecLen, pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
oWriter.WriteNodeBegin(_T("TextPFExceptionAtom"));
oWriter.WriteString(m_oPFRun.m_oRun.ToString(0));
oWriter.WriteNodeEnd(_T("TextPFExceptionAtom"));
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordTextRulerAtom : public CUnknownRecord
{
public:
NSPresentationEditor::CTextRuler m_oTextRuler;
public:
CRecordTextRulerAtom()
{
}
~CRecordTextRulerAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
LONG lOffset = 0;
StreamUtils::StreamPosition(lOffset, pStream);
NSStreamReader::Read(pStream, m_oTextRuler);
// ...
StreamUtils::StreamSeek(lOffset + m_oHeader.RecLen, pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
oWriter.WriteString(m_oTextRuler.ToString());
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordTextSIExceptionAtom : public CUnknownRecord
{
public:
CTextSIRun m_oSIRun;
CRecordTextSIExceptionAtom()
{
}
~CRecordTextSIExceptionAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
LONG lPosition = 0;
StreamUtils::StreamPosition(lPosition, pStream);
NSStreamReader::Read(pStream, m_oSIRun, false);
// ...
StreamUtils::StreamSeek(lPosition + m_oHeader.RecLen, pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
oWriter.WriteNodeBegin(_T("TextPFExceptionAtom"));
oWriter.WriteString(m_oSIRun.ToString());
oWriter.WriteNodeEnd(_T("TextPFExceptionAtom"));
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordTextSpecInfoAtom : public CUnknownRecord
{
public:
// ,
//
LONG m_lOffsetInStream;
DWORD m_lCount;
private:
std::vector<NSPresentationEditor::CTextSIRun> m_arrSIs;
public:
CRecordTextSpecInfoAtom()
{
m_lCount = 0;
m_lOffsetInStream = 0;
}
~CRecordTextSpecInfoAtom()
{
m_lCount = 0;
}
void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
//return CUnknownRecord::ReadFromStream(oHeader, pStream);
m_oHeader = oHeader;
StreamUtils::StreamPosition(m_lOffsetInStream, pStream);
if (0 == m_lCount)
{
StreamUtils::StreamSeek(m_lOffsetInStream + m_oHeader.RecLen, pStream);
return;
}
DWORD lMemCount = 0;
DWORD lCountItems = 0;
while (lMemCount < m_lCount + 1)
{
NSPresentationEditor::CTextSIRun elm;
m_arrSIs.push_back(elm);
NSStreamReader::Read(pStream, m_arrSIs[lCountItems]);
lMemCount += m_arrSIs[lCountItems].lCount;
++lCountItems;
}
// ...
// (.. - placeholder ) -
// m_lCount...
StreamUtils::StreamSeek(m_lOffsetInStream + m_oHeader.RecLen, pStream);
}
void ApplyProperties(CTextAttributesEx* pTextAttributes)
{
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
for (size_t nIndexSI = 0; nIndexSI < m_arrSIs.size(); ++nIndexSI)
{
oWriter.WriteString(m_arrSIs[nIndexSI].ToString());
}
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
#pragma once
#include "../Reader/Records.h"
class CRecordUserEditAtom : public CUnknownRecord
{
public:
DWORD m_nLastSlideIdRef;
USHORT m_nVersion; // must be 0x0000
BYTE m_nMinorVersion; // must be 0x00
BYTE m_nMajorVersion; // must be 0x03
DWORD m_nOffsetLastEdit; // offset to prev UserEditAtom (0 - if no)
DWORD m_nOffsetPersistDirectory; // offset to PersistDirectoryAtom in PPTDocStream (for this user)
DWORD m_nOffsetDocPersistIdRef; // offset to PersistObjectDirectory in DocContainer must be 0x00000001
DWORD m_nPersistIdSeed; // for next
USHORT m_nLastView;
public:
CRecordUserEditAtom()
{
}
~CRecordUserEditAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_nLastSlideIdRef = StreamUtils::ReadDWORD(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_nPersistIdSeed = StreamUtils::ReadDWORD(pStream);
m_nLastView = StreamUtils::ReadWORD(pStream);
StreamUtils::StreamSkip(m_oHeader.RecLen - 22, pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("LastSlideIdRef"), m_nLastSlideIdRef, &oWriter);
CDirectory::WriteValueToNode(_T("OffsetLastEdit"), m_nOffsetLastEdit, &oWriter);
CDirectory::WriteValueToNode(_T("OffsetPersistDirectory"), m_nOffsetPersistDirectory, &oWriter);
CDirectory::WriteValueToNode(_T("OffsetDocPersistIdRef"), m_nOffsetDocPersistIdRef, &oWriter);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
CRecordUserEditAtom& operator =(const CRecordUserEditAtom& oSrc)
{
m_nLastSlideIdRef = oSrc.m_nLastSlideIdRef;
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;
return (*this);
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordVBAInfoAtom : public CUnknownRecord
{
UINT m_nObjStgDataRef;
UINT m_nHasMacros;
UINT m_nVersion;
public:
CRecordVBAInfoAtom()
{
}
~CRecordVBAInfoAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordViewInfoAtom : public CUnknownRecord
{
SScalingAtom m_oCurScale;
SScalingAtom m_oPrevScale;
SPointAtom m_oViewSize;
SPointAtom m_oOrigin;
BOOL1 m_bZoomToFit;
BOOL1 m_bDraftMode;
public:
CRecordViewInfoAtom()
{
}
~CRecordViewInfoAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_oCurScale.FromStream(pStream);
m_oPrevScale.FromStream(pStream);
NSStreamReader::Read(pStream, m_oViewSize);
NSStreamReader::Read(pStream, m_oOrigin);
m_bZoomToFit = StreamUtils::ReadBYTE(pStream);
m_bDraftMode = StreamUtils::ReadBYTE(pStream);
// 2 ...
StreamUtils::StreamSkip(2, pStream);
}
virtual CString ToString()
{
XmlUtils::CXmlWriter oWriter;
CString strName = GetRecordName((DWORD)m_oHeader.RecType);
oWriter.WriteNodeBegin(strName, TRUE);
oWriter.WriteAttribute(_T("length"), CDirectory::ToString(m_oHeader.RecLen));
oWriter.WriteAttribute(_T("type"), CDirectory::ToString(m_oHeader.RecType));
oWriter.WriteAttribute(_T("instance"), CDirectory::ToString(m_oHeader.RecInstance));
oWriter.WriteNodeEnd(strName, TRUE, FALSE);
CDirectory::WriteValueToNode(_T("CurScale"), m_oCurScale.ToString(), &oWriter);
CDirectory::WriteValueToNode(_T("PrevScale"), m_oPrevScale.ToString(), &oWriter);
CDirectory::WriteValueToNode(_T("ViewSize"), m_oViewSize.ToString(), &oWriter);
CDirectory::WriteValueToNode(_T("Origin"), m_oOrigin.ToString(), &oWriter);
CDirectory::WriteValueToNode(_T("ZoomToFit"), (DWORD)m_bZoomToFit, &oWriter);
CDirectory::WriteValueToNode(_T("DraftMode"), (DWORD)m_bDraftMode, &oWriter);
oWriter.WriteNodeEnd(strName);
return oWriter.GetXmlString();
}
};
\ No newline at end of file
#pragma once
#include "../Reader/Records.h"
class CRecordZoomViewInfoAtom : public CUnknownRecord
{
SScalingAtom m_oCurScale;
SPointAtom m_nOrigin;
BOOL1 m_bUseVarScale;
BOOL1 m_bDraftMode;
public:
CRecordZoomViewInfoAtom()
{
}
~CRecordZoomViewInfoAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
virtual CString ToString()
{
return CUnknownRecord::ToString();
}
};
\ No newline at end of file
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Name="PPTFormatLib"
ProjectGUID="{7B27E40E-F70A-4A74-A77C-0944D7931D15}"
RootNamespace="ASCOfficePPTFile"
Keyword="AtlProj"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
UseOfATL="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="false"
TargetEnvironment="1"
GenerateStublessProxies="true"
TypeLibraryName="$(IntDir)/ASCOfficePPTFile.tlb"
HeaderFileName="ASCOfficePPTFile.h"
DLLDataFileName=""
InterfaceIdentifierFileName="ASCOfficePPTFile_i.c"
ProxyFileName="ASCOfficePPTFile_p.c"
ValidateParameters="false"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;../../../../DesktopEditor/freetype-2.5.2/include&quot;"
PreprocessorDefinitions="_DEBUG;_LIB;_USE_MATH_DEFINES;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;PPT_FORMAT;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;_PRESENTATION_WRITER_;_SVG_CONVERT_TO_IMAGE_"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
IgnoreAllDefaultLibraries="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine=""
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
UseOfATL="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="false"
TargetEnvironment="3"
GenerateStublessProxies="true"
TypeLibraryName="$(IntDir)/ASCOfficePPTFile.tlb"
HeaderFileName="ASCOfficePPTFile.h"
DLLDataFileName=""
InterfaceIdentifierFileName="ASCOfficePPTFile_i.c"
ProxyFileName="ASCOfficePPTFile_p.c"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;../../../../DesktopEditor/freetype-2.5.2/include&quot;"
PreprocessorDefinitions="_DEBUG;_LIB;_USE_MATH_DEFINES;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;PPT_FORMAT;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;_PRESENTATION_WRITER_;_SVG_CONVERT_TO_IMAGE_"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
IgnoreAllDefaultLibraries="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
UseOfATL="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="false"
TargetEnvironment="1"
GenerateStublessProxies="true"
TypeLibraryName="$(IntDir)/ASCOfficePPTFile.tlb"
HeaderFileName="ASCOfficePPTFile.h"
DLLDataFileName=""
InterfaceIdentifierFileName="ASCOfficePPTFile_i.c"
ProxyFileName="ASCOfficePPTFile_p.c"
ValidateParameters="false"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories="&quot;../../../../DesktopEditor/freetype-2.5.2/include&quot;"
PreprocessorDefinitions="NDEBUG;_LIB;_USE_MATH_DEFINES;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;PPT_FORMAT;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;BUILD_CONFIG_FULL_VERSION;_PRESENTATION_WRITER_;_SVG_CONVERT_TO_IMAGE_"
StringPooling="true"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine=""
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
UseOfATL="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="false"
TargetEnvironment="3"
GenerateStublessProxies="true"
TypeLibraryName="$(IntDir)/ASCOfficePPTFile.tlb"
HeaderFileName="ASCOfficePPTFile.h"
DLLDataFileName=""
InterfaceIdentifierFileName="ASCOfficePPTFile_i.c"
ProxyFileName="ASCOfficePPTFile_p.c"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories="&quot;../../../../DesktopEditor/freetype-2.5.2/include&quot;;../../../../DocxFormat/Source/XML/libxml2/XML/include;D:\WORK\AVS\Sources\TeamlabOffice\branches\Docx2DoctConverter\ServerComponents\Common\DocxFormat\Source\XML\libxml2\XML\include;&quot;D:\WORK\AVS\Sources\TeamlabOffice\branches\Docx2DoctConverter\ServerComponents\ASCOfficeUtils\ZLIB\zlib-1.2.3&quot;"
PreprocessorDefinitions="NDEBUG;_LIB;_USE_MATH_DEFINES;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;PPT_FORMAT;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;BUILD_CONFIG_FULL_VERSION;_PRESENTATION_WRITER_;_SVG_CONVERT_TO_IMAGE_;DONT_WRITE_EMBEDDED_FONTS"
StringPooling="true"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
LinkLibraryDependencies="false"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine=""
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Common"
>
<File
RelativePath="..\..\..\..\XlsxSerializerCom\Reader\ChartFromToBinary.cpp"
>
</File>
<File
RelativePath="..\..\..\..\XlsxSerializerCom\Common\Common.cpp"
>
</File>
<File
RelativePath="..\..\..\..\XlsxSerializerCom\Reader\CommonWriter.cpp"
>
</File>
<File
RelativePath="..\..\..\..\XlsxSerializerCom\Reader\CSVReader.cpp"
>
</File>
<File
RelativePath="..\..\..\..\XlsxSerializerCom\Writer\CSVWriter.cpp"
>
</File>
<File
RelativePath="..\..\..\..\ASCOfficeDocxFile2\DocWrapper\DocxSerializer.cpp"
>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/bigobj"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\..\..\DesktopEditor\fontengine\FontManager.cpp"
>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/bigobj"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\..\..\ASCOfficeDocxFile2\DocWrapper\FontProcessor.cpp"
>
</File>
<File
RelativePath="..\..\..\..\ASCOfficeDocxFile2\DocWrapper\XlsxSerializer.cpp"
>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/bigobj"
/>
</FileConfiguration>
</File>
<Filter
Name="pole"
>
<File
RelativePath="..\..\..\..\ASCOfficeDocFile\pole\pole.cpp"
>
</File>
<File
RelativePath="..\..\..\..\ASCOfficeDocFile\pole\pole.h"
>
</File>
</Filter>
</Filter>
<Filter
Name="Reader"
>
<File
RelativePath="..\Reader\ClassesAtom.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCPresentationEditor\OfficeDrawing\Document.h"
>
</File>
<File
RelativePath="..\Reader\PPTDocumentInfo.h"
>
</File>
<File
RelativePath="..\Reader\PPTDocumentInfoOneUser.cpp"
>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/bigobj"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\Reader\PPTDocumentInfoOneUser.h"
>
</File>
<File
RelativePath="..\Reader\PPTFileDefines.h"
>
</File>
<File
RelativePath="..\Reader\PPTFileReader.h"
>
</File>
<File
RelativePath="..\Reader\ReadStructures.h"
>
</File>
<File
RelativePath="..\Reader\Records.cpp"
>
</File>
<File
RelativePath="..\Reader\Records.h"
>
</File>
<File
RelativePath="..\Reader\SlideInfo.h"
>
</File>
<File
RelativePath="..\Reader\SlidePersist.cpp"
>
</File>
<File
RelativePath="..\Reader\SlidePersist.h"
>
</File>
</Filter>
<Filter
Name="Records"
>
<File
RelativePath="..\Records\AnimationInfoAtom.h"
>
</File>
<File
RelativePath="..\Records\BlipEntityAtom.h"
>
</File>
<File
RelativePath="..\Records\BookmarkEntityAtom.h"
>
</File>
<File
RelativePath="..\Records\BookmarkSeedAtom.h"
>
</File>
<File
RelativePath="..\Records\ColorSchemeAtom.h"
>
</File>
<File
RelativePath="..\Records\CString.h"
>
</File>
<File
RelativePath="..\Records\CurrentUserAtom.h"
>
</File>
<File
RelativePath="..\Records\DateTimeMCAtom.h"
>
</File>
<File
RelativePath="..\Records\DocRoutingSlipAtom.h"
>
</File>
<File
RelativePath="..\Records\DocumentAtom.h"
>
</File>
<File
RelativePath="..\Records\DocumentRecords.h"
>
</File>
<File
RelativePath="..\Records\DocumentTextInfo.h"
>
</File>
<File
RelativePath="..\Records\EndDocument.h"
>
</File>
<File
RelativePath="..\Records\ExCDAudioContainer.h"
>
</File>
<File
RelativePath="..\Records\ExControlAtom.h"
>
</File>
<File
RelativePath="..\Records\ExHyperlinkAtom.h"
>
</File>
<File
RelativePath="..\Records\ExMediaAtom.h"
>
</File>
<File
RelativePath="..\Records\ExMIDIAudioContainer.h"
>
</File>
<File
RelativePath="..\Records\ExObjListAtom.h"
>
</File>
<File
RelativePath="..\Records\ExObjListContainer.h"
>
</File>
<File
RelativePath="..\Records\ExObjRefAtom.h"
>
</File>
<File
RelativePath="..\Records\ExOleEmbedAtom.h"
>
</File>
<File
RelativePath="..\Records\ExOleLinkAtom.h"
>
</File>
<File
RelativePath="..\Records\ExOleObjAtom.h"
>
</File>
<File
RelativePath="..\Records\ExVideoContainer.h"
>
</File>
<File
RelativePath="..\Records\ExWAVAudioEmbeddedContainer.h"
>
</File>
<File
RelativePath="..\Records\ExWAVAudioLinkContainer.h"
>
</File>
<File
RelativePath="..\Records\FontEntityAtom.h"
>
</File>
<File
RelativePath="..\Records\GenericDateMCAtom.h"
>
</File>
<File
RelativePath="..\Records\GridSpacing10Atom.h"
>
</File>
<File
RelativePath="..\Records\GuideAtom.h"
>
</File>
<File
RelativePath="..\Records\HeadersFootersAtom.h"
>
</File>
<File
RelativePath="..\Records\InteractiveInfoAtom.h"
>
</File>
<File
RelativePath="..\Records\KinsokuAtom.h"
>
</File>
<File
RelativePath="..\Records\MasterPersistAtom.h"
>
</File>
<File
RelativePath="..\Records\MasterTextPropAtom.h"
>
</File>
<File
RelativePath="..\Records\MetafileBlob.h"
>
</File>
<File
RelativePath="..\Records\MouseTextInteractiveInfoAtom.h"
>
</File>
<File
RelativePath="..\Records\NamedShowSlidesAtom.h"
>
</File>
<File
RelativePath="..\Records\NormalViewSetInfoAtom.h"
>
</File>
<File
RelativePath="..\Records\NotesAtom.h"
>
</File>
<File
RelativePath="..\Records\NotesPersistAtom.h"
>
</File>
<File
RelativePath="..\Records\NoZoomViewInfoAtom.h"
>
</File>
<File
RelativePath="..\Records\OutlineTextRefAtom.h"
>
</File>
<File
RelativePath="..\Records\PersistDirectoryAtom.h"
>
</File>
<File
RelativePath="..\Records\PlaceHolderAtom.h"
>
</File>
<File
RelativePath="..\Records\RecordsIncluder.h"
>
</File>
<File
RelativePath="..\Records\RoundTripColorMappingAtom.h"
>
</File>
<File
RelativePath="..\Records\RoundTripCompositeMainMasterId12Atom.h"
>
</File>
<File
RelativePath="..\Records\RoundTripNewPlaceholderId12Atom.h"
>
</File>
<File
RelativePath="..\Records\RoundTripOriginalMainMasterId12Atom.h"
>
</File>
<File
RelativePath="..\Records\RoundTripThemeAtom.h"
>
</File>
<File
RelativePath="..\Records\ShapeFlags10Atom.h"
>
</File>
<File
RelativePath="..\Records\ShapeFlagsAtom.h"
>
</File>
<File
RelativePath="..\Records\SlideAtom.h"
>
</File>
<File
RelativePath="..\Records\SlideColorSchemeAtom.h"
>
</File>
<File
RelativePath="..\Records\SlideContainer.h"
>
</File>
<File
RelativePath="..\Records\SlideListWithText.h"
>
</File>
<File
RelativePath="..\Records\SlideNumberMCAtom.h"
>
</File>
<File
RelativePath="..\Records\SlidePersistAtom.h"
>
</File>
<File
RelativePath="..\Records\SlideViewInfoAtom.h"
>
</File>
<File
RelativePath="..\Records\SoundCollAtom.h"
>
</File>
<File
RelativePath="..\Records\SoundCollectionContainer.h"
>
</File>
<File
RelativePath="..\Records\SoundContainer.h"
>
</File>
<File
RelativePath="..\Records\SoundDataBlob.h"
>
</File>
<File
RelativePath="..\Records\SSDocInfoAtom.h"
>
</File>
<File
RelativePath="..\Records\SSlideLayoutAtom.h"
>
</File>
<File
RelativePath="..\Records\SSSlideInfoAtom.h"
>
</File>
<File
RelativePath="..\Records\StyleTextPropAtom.h"
>
</File>
<File
RelativePath="..\Records\TextBookmarkAtom.h"
>
</File>
<File
RelativePath="..\Records\TextBytesAtom.h"
>
</File>
<File
RelativePath="..\Records\TextCFExceptionAtom.h"
>
</File>
<File
RelativePath="..\Records\TextCharsAtom.h"
>
</File>
<File
RelativePath="..\Records\TextFullSettings.h"
>
</File>
<File
RelativePath="..\Records\TextHeaderAtom.h"
>
</File>
<File
RelativePath="..\Records\TextInteractiveInfoAtom.h"
>
</File>
<File
RelativePath="..\Records\TextMasterStyleAtom.h"
>
</File>
<File
RelativePath="..\Records\TextPFExceptionAtom.h"
>
</File>
<File
RelativePath="..\Records\TextRulerAtom.h"
>
</File>
<File
RelativePath="..\Records\TextSIExceptionAtom.h"
>
</File>
<File
RelativePath="..\Records\TextSpecInfoAtom.h"
>
</File>
<File
RelativePath="..\Records\UserEditAtom.h"
>
</File>
<File
RelativePath="..\Records\VBAInfoAtom.h"
>
</File>
<File
RelativePath="..\Records\ViewInfoAtom.h"
>
</File>
<File
RelativePath="..\Records\ZoomViewInfoAtom.h"
>
</File>
<Filter
Name="Drawing"
>
<File
RelativePath="..\Records\Drawing\BitmapBlip.h"
>
</File>
<File
RelativePath="..\Records\Drawing\BlipStoreContainer.h"
>
</File>
<File
RelativePath="..\Records\Drawing\BlipStoreEntry.h"
>
</File>
<File
RelativePath="..\Records\Drawing\ChildAnchor.h"
>
</File>
<File
RelativePath="..\Records\Drawing\ClientAnchor.h"
>
</File>
<File
RelativePath="..\Records\Drawing\DrawingContainer.h"
>
</File>
<File
RelativePath="..\Records\Drawing\DrawingGroup.h"
>
</File>
<File
RelativePath="..\Records\Drawing\DrawingRecord.h"
>
</File>
<File
RelativePath="..\Records\Drawing\GroupShape.h"
>
</File>
<File
RelativePath="..\Records\Drawing\GroupShapeContainer.h"
>
</File>
<File
RelativePath="..\Records\Drawing\RegGroupItems.h"
>
</File>
<File
RelativePath="..\Records\Drawing\Shape.h"
>
</File>
<File
RelativePath="..\Records\Drawing\ShapeContainer.h"
>
</File>
<File
RelativePath="..\Records\Drawing\ShapeProperties.h"
>
</File>
<File
RelativePath="..\Records\Drawing\TextBox.h"
>
</File>
</Filter>
<Filter
Name="Animations"
>
<File
RelativePath="..\Records\Animations\AnimationTypes.cpp"
>
</File>
<File
RelativePath="..\Records\Animations\AnimationTypes.h"
>
</File>
</Filter>
</Filter>
<Filter
Name="PresentationEditor"
>
<File
RelativePath="..\..\..\..\ASCPresentationEditor\PPTXWriter\Converter.cpp"
>
</File>
<File
RelativePath="..\..\..\..\ASCPresentationEditor\PPTXWriter\Converter.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCPresentationEditor\PPTXWriter\CSS.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCPresentationEditor\OfficeDrawing\Effects.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCPresentationEditor\OfficeDrawing\Element.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCPresentationEditor\OfficeDrawing\ElementProperties.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCPresentationEditor\OfficeDrawing\Elements.cpp"
>
</File>
<File
RelativePath="..\..\..\..\ASCPresentationEditor\OfficeDrawing\Elements.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCPresentationEditor\PPTXWriter\ImageManager.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCPresentationEditor\OfficeDrawing\Layout.cpp"
>
</File>
<File
RelativePath="..\..\..\..\ASCPresentationEditor\OfficeDrawing\Layout.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCPresentationEditor\PPTXWriter\ShapeWriter.cpp"
>
</File>
<File
RelativePath="..\..\..\..\ASCPresentationEditor\PPTXWriter\ShapeWriter.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCPresentationEditor\OfficeDrawing\Slide.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCPresentationEditor\PPTXWriter\StylesWriter.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCPresentationEditor\OfficeDrawing\SVGConverter.cpp"
>
</File>
<File
RelativePath="..\..\..\..\ASCPresentationEditor\OfficeDrawing\SVGConverter.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCPresentationEditor\OfficeDrawing\SVGFramework.cpp"
>
</File>
<File
RelativePath="..\..\..\..\ASCPresentationEditor\OfficeDrawing\SVGFramework.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCPresentationEditor\OfficeDrawing\SVGTransformer.cpp"
>
</File>
<File
RelativePath="..\..\..\..\ASCPresentationEditor\OfficeDrawing\SVGTransformer.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCPresentationEditor\OfficeDrawing\TextAttributesEx.cpp"
>
</File>
<File
RelativePath="..\..\..\..\ASCPresentationEditor\OfficeDrawing\TextAttributesEx.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCPresentationEditor\OfficeDrawing\TextStructures.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCPresentationEditor\OfficeDrawing\Theme.cpp"
>
</File>
<File
RelativePath="..\..\..\..\ASCPresentationEditor\OfficeDrawing\Theme.h"
>
</File>
</Filter>
<Filter
Name="OOXWriter"
>
<File
RelativePath="..\..\..\..\ASCOfficeDocxFile2\BinReader\ChartWriter.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCOfficeDocxFile2\BinReader\CommentsWriter.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCOfficeDocxFile2\BinReader\ContentTypesWriter.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCOfficeDocxFile2\BinReader\DefaultThemeWriterWin.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCOfficeDocxFile2\BinReader\DocumentRelsWriter.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCOfficeDocxFile2\BinReader\DocumentWriter.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCOfficeDocxFile2\BinReader\FileWriter.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCOfficeDocxFile2\BinReader\fontTableWriter.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCOfficeDocxFile2\BinReader\HeaderFooterWriter.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCOfficeDocxFile2\BinReader\MediaWriter.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCOfficeDocxFile2\BinReader\NumberingWriter.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCOfficeDocxFile2\BinReader\SettingWriter.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCOfficeDocxFile2\BinReader\StylesWriter.h"
>
</File>
<File
RelativePath="..\..\..\..\ASCOfficeDocxFile2\BinReader\webSettingsWriter.h"
>
</File>
</Filter>
<File
RelativePath="..\PPTFormatLib.cpp"
>
</File>
<File
RelativePath="..\PPTFormatLib.h"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
// ASCOfficePPTFile.cpp : Implementation of DLL Exports.
#include "stdafx.h"
#include "resource.h"
#include "OfficePPTFile.h"
// The module attribute causes DllMain, DllRegisterServer and DllUnregisterServer to be automatically implemented for you
[ module(dll, uuid = "{53D294E3-FF41-4f04-81C9-258CA16F22B2}",
name = "ASCOfficePPTFile",
helpstring = "ASCOfficePPTFile 1.0 Type Library",
resource_name = "IDR_ASCOFFICEPPTFILE") ];
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define COMPONENT_NAME "OfficePPTFile"
#include "../../../Common/FileInfo.h"
#include "version.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE 9, 1
#pragma code_page(1251)
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION INTVER
PRODUCTVERSION INTVER
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
VALUE "CompanyName", COMPANY_NAME
VALUE "FileDescription", FILE_DESCRIPTION_ACTIVEX
VALUE "FileVersion", STRVER
VALUE "InternalName", COMPONENT_FILE_NAME_DLL
VALUE "LegalCopyright", LEGAL_COPYRIGHT
VALUE "OriginalFilename", COMPONENT_FILE_NAME_DLL
VALUE "ProductName", FILE_DESCRIPTION_ACTIVEX
VALUE "ProductVersion", STRVER
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
IDS_PROJNAME "ASCOfficePPTFile"
END
IDR_ASCOFFICEPPTFILE REGISTRY "ASCOfficePPTFile.rgs"
////////////////////////////////////////////////////////////////////////////
#endif
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
HKCR
{
NoRemove AppID
{
'%APPID%' = s 'ASCOfficePPTFile'
'ASCOfficePPTFile.DLL'
{
val AppID = s '%APPID%'
}
}
}
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficePPTFile", "ASCOfficePPTFile.vcproj", "{C1E5043D-4844-4893-980D-BD79CDCD05C1}"
ProjectSection(ProjectDependencies) = postProject
{7B27E40E-F70A-4A74-A77C-0944D7931D15} = {7B27E40E-F70A-4A74-A77C-0944D7931D15}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficeUtilsLib", "..\..\..\ASCOfficeUtils\ASCOfficeUtilsLib\Win\ASCOfficeUtilsLib.vcproj", "{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PPTXFormat", "..\..\..\ASCOfficePPTXFile\PPTXLib\PPTXFormat.vcproj", "{36636678-AE25-4BE6-9A34-2561D1BCF302}"
ProjectSection(ProjectDependencies) = postProject
{DC24710E-8DF2-4A7A-B7C3-2313E294143C} = {DC24710E-8DF2-4A7A-B7C3-2313E294143C}
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCHTMLRenderer", "..\..\..\ASCHTMLRenderer\ASCHTMLRendererLib.vcproj", "{DC24710E-8DF2-4A7A-B7C3-2313E294143C}"
ProjectSection(ProjectDependencies) = postProject
{818753F2-DBB9-4D3B-898A-A604309BE470} = {818753F2-DBB9-4D3B-898A-A604309BE470}
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} = {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6} = {3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D} = {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}
{BC52A07C-A797-423D-8C4F-8678805BBB36} = {BC52A07C-A797-423D-8C4F-8678805BBB36}
{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}
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
{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}") = "graphics", "..\..\..\DesktopEditor\graphics\graphics_vs2005.vcproj", "{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}"
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}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jpeg", "..\..\..\DesktopEditor\cximage\jpeg\Jpeg_vs2005.vcproj", "{818753F2-DBB9-4D3B-898A-A604309BE470}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocxFormat", "..\..\..\Common\DocxFormat\Projects\DocxFormat2005.vcproj", "{A100103A-353E-45E8-A9B8-90B87CC5C0B0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "font_engine", "..\..\..\DesktopEditor\fontengine\font_engine_vs2005.vcproj", "{C739151F-5384-41DF-A1A6-F089E2C1AD56}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "freetype", "..\..\..\DesktopEditor\freetype-2.5.2\builds\windows\vc2005\freetype.vcproj", "{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raster", "..\..\..\DesktopEditor\raster\raster_vs2005.vcproj", "{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jasper", "..\..\..\DesktopEditor\cximage\jasper\jasper_vs2005.vcproj", "{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdcr", "..\..\..\DesktopEditor\cximage\raw\libdcr_vs2005.vcproj", "{DF861D33-9BC1-418C-82B1-581F590FE169}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "png", "..\..\..\DesktopEditor\cximage\png\png_vs2005.vcproj", "{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mng", "..\..\..\DesktopEditor\cximage\mng\mng_vs2005.vcproj", "{40A69F40-063E-43FD-8543-455495D8733E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tiff", "..\..\..\DesktopEditor\cximage\tiff\Tiff_vs2005.vcproj", "{0588563C-F05C-428C-B21A-DD74756628B3}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpsd", "..\..\..\DesktopEditor\cximage\libpsd\libpsd_vs2005.vcproj", "{9A037A69-D1DF-4505-AB2A-6CB3641C476E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PPTFormatLib", "..\PPTFormatLib\Win32\PPTFormatLib.vcproj", "{7B27E40E-F70A-4A74-A77C-0944D7931D15}"
ProjectSection(ProjectDependencies) = postProject
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
{DC24710E-8DF2-4A7A-B7C3-2313E294143C} = {DC24710E-8DF2-4A7A-B7C3-2313E294143C}
{A100103A-353E-45E8-A9B8-90B87CC5C0B0} = {A100103A-353E-45E8-A9B8-90B87CC5C0B0}
{36636678-AE25-4BE6-9A34-2561D1BCF302} = {36636678-AE25-4BE6-9A34-2561D1BCF302}
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6} = {3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PptFormatTest", "..\..\..\Test\Applications\DocxFormatTests\PptFormatTest\win32\PptFormatTest.vcproj", "{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libxml2", "..\..\..\Common\DocxFormat\Source\XML\libxml2\win_build\libxml2.vcproj", "{21663823-DE45-479B-91D0-B4FEF4916EF0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Debug|Win32.ActiveCfg = Debug|Win32
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Debug|Win32.Build.0 = Debug|Win32
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Debug|x64.ActiveCfg = Debug|x64
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Debug|x64.Build.0 = Debug|x64
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Release|Win32.ActiveCfg = Release|Win32
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Release|Win32.Build.0 = Release|Win32
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Release|x64.ActiveCfg = Release|x64
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Release|x64.Build.0 = Release|x64
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}.Debug|Win32.ActiveCfg = Debug|Win32
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}.Debug|Win32.Build.0 = Debug|Win32
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}.Debug|x64.ActiveCfg = Debug|x64
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}.Debug|x64.Build.0 = Debug|x64
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}.Release|Win32.ActiveCfg = Release|Win32
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}.Release|Win32.Build.0 = Release|Win32
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}.Release|x64.ActiveCfg = Release|x64
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}.Release|x64.Build.0 = Release|x64
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Debug|Win32.ActiveCfg = Debug|Win32
{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}.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
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Release|x64.Build.0 = Release|x64
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug|Win32.ActiveCfg = Debug|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug|Win32.Build.0 = Debug|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug|x64.ActiveCfg = Debug|x64
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug|x64.Build.0 = Debug|x64
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release|Win32.ActiveCfg = Release|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release|Win32.Build.0 = Release|Win32
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release|x64.ActiveCfg = Release|x64
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release|x64.Build.0 = Release|x64
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug|Win32.ActiveCfg = Debug|Win32
{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}.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
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release|x64.Build.0 = Release|x64
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug|Win32.ActiveCfg = Debug|Win32
{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}.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
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Release|x64.Build.0 = Release|x64
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Debug|Win32.ActiveCfg = Debug|Win32
{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}.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
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Release|x64.Build.0 = Release|x64
{818753F2-DBB9-4D3B-898A-A604309BE470}.Debug|Win32.ActiveCfg = Debug|Win32
{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}.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
{818753F2-DBB9-4D3B-898A-A604309BE470}.Release|x64.Build.0 = Release|x64
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Debug|Win32.ActiveCfg = Debug|Win32
{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}.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
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release|x64.Build.0 = Release|x64
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Debug|Win32.ActiveCfg = Debug|Win32
{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}.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
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Release|x64.Build.0 = Release|x64
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.ActiveCfg = Debug|Win32
{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}.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
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.Build.0 = Release|x64
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Debug|Win32.ActiveCfg = Debug|Win32
{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}.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
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Release|x64.Build.0 = Release|x64
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Debug|Win32.ActiveCfg = Debug|Win32
{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}.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
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Release|x64.Build.0 = Release|x64
{DF861D33-9BC1-418C-82B1-581F590FE169}.Debug|Win32.ActiveCfg = Debug|Win32
{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}.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
{DF861D33-9BC1-418C-82B1-581F590FE169}.Release|x64.Build.0 = Release|x64
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Debug|Win32.ActiveCfg = Debug|Win32
{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}.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
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Release|x64.Build.0 = Release|x64
{40A69F40-063E-43FD-8543-455495D8733E}.Debug|Win32.ActiveCfg = Debug|Win32
{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}.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
{40A69F40-063E-43FD-8543-455495D8733E}.Release|x64.Build.0 = Release|x64
{0588563C-F05C-428C-B21A-DD74756628B3}.Debug|Win32.ActiveCfg = Debug|Win32
{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}.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
{0588563C-F05C-428C-B21A-DD74756628B3}.Release|x64.Build.0 = Release|x64
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Debug|Win32.ActiveCfg = Debug|Win32
{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}.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
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Release|x64.Build.0 = Release|x64
{7B27E40E-F70A-4A74-A77C-0944D7931D15}.Debug|Win32.ActiveCfg = Debug|Win32
{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}.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
{7B27E40E-F70A-4A74-A77C-0944D7931D15}.Release|x64.Build.0 = Release|x64
{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}.Debug|Win32.ActiveCfg = Debug|Win32
{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}.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
{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}.Release|x64.Build.0 = Release|x64
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|Win32.ActiveCfg = Debug|Win32
{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}.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
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(DPCodeReviewSolutionGUID) = preSolution
DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Name="ASCOfficePPTFile"
ProjectGUID="{C1E5043D-4844-4893-980D-BD79CDCD05C1}"
RootNamespace="ASCOfficePPTFile"
Keyword="AtlProj"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
UseOfATL="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="false"
TargetEnvironment="1"
GenerateStublessProxies="true"
TypeLibraryName="$(IntDir)/ASCOfficePPTFile.tlb"
HeaderFileName="ASCOfficePPTFile.h"
DLLDataFileName=""
InterfaceIdentifierFileName="ASCOfficePPTFile_i.c"
ProxyFileName="ASCOfficePPTFile_p.c"
ValidateParameters="false"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL;_ATL_ATTRIBUTES;_USE_MATH_DEFINES;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;PPT_FORMAT;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;USE_AVSOFFICESTUDIO_XMLUTILS;_PRESENTATION_WRITER_;_SVG_CONVERT_TO_IMAGE_"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="2"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
RegisterOutput="true"
IgnoreImportLibrary="true"
AdditionalDependencies="Urlmon.lib"
LinkIncremental="2"
IgnoreAllDefaultLibraries="false"
IgnoreDefaultLibraryNames=""
MergedIDLBaseFileName="_ASCOfficePPTFile.idl"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Performing registration"
CommandLine="regsvr32 /s /c &quot;$(TargetPath)&quot;"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
UseOfATL="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="false"
TargetEnvironment="3"
GenerateStublessProxies="true"
TypeLibraryName="$(IntDir)/ASCOfficePPTFile.tlb"
HeaderFileName="ASCOfficePPTFile.h"
DLLDataFileName=""
InterfaceIdentifierFileName="ASCOfficePPTFile_i.c"
ProxyFileName="ASCOfficePPTFile_p.c"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="_DEBUG;_USRDLL;_ATL_ATTRIBUTES;_USE_MATH_DEFINES;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;PPT_FORMAT;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;USE_AVSOFFICESTUDIO_XMLUTILS;_PRESENTATION_WRITER_;_SVG_CONVERT_TO_IMAGE_"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
RegisterOutput="true"
IgnoreImportLibrary="true"
AdditionalDependencies="Urlmon.lib"
LinkIncremental="2"
IgnoreAllDefaultLibraries="false"
IgnoreDefaultLibraryNames=""
MergedIDLBaseFileName="_ASCOfficePPTFile.idl"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Performing registration"
CommandLine="regsvr32 /s /c &quot;$(TargetPath)&quot;"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
UseOfATL="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="..\..\..\Redist\VersionControl.exe $(ProjectDir)version.h"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="false"
TargetEnvironment="1"
GenerateStublessProxies="true"
TypeLibraryName="$(IntDir)/ASCOfficePPTFile.tlb"
HeaderFileName="ASCOfficePPTFile.h"
DLLDataFileName=""
InterfaceIdentifierFileName="ASCOfficePPTFile_i.c"
ProxyFileName="ASCOfficePPTFile_p.c"
ValidateParameters="false"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL;_ATL_ATTRIBUTES;_USE_MATH_DEFINES;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;PPT_FORMAT;_USE_XMLLITE_READER_;USE_LITE_READER;USE_AVSOFFICESTUDIO_XMLUTILS;LIBXML_READER_ENABLED;_PRESENTATION_WRITER_;_SVG_CONVERT_TO_IMAGE_"
StringPooling="true"
RuntimeLibrary="2"
UsePrecompiledHeader="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
RegisterOutput="true"
IgnoreImportLibrary="true"
AdditionalDependencies="Urlmon.lib"
OutputFile="$(OutDir)\$(ProjectName).dll"
LinkIncremental="1"
IgnoreDefaultLibraryNames="libcmt.lib"
MergedIDLBaseFileName="_ASCOfficePPTFile.idl"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/$(TargetName).pdb"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
ImportLibrary="$(OutDir)/$(TargetName).lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Performing registration"
CommandLine="regsvr32 /s /c &quot;$(TargetPath)&quot;&#x0D;&#x0A;copy &quot;$(TargetPath)&quot; &quot;$(ProjectDir)..\..\..\Redist&quot;&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
UseOfATL="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="..\..\..\Redist\VersionControl.exe $(ProjectDir)version.h"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="false"
TargetEnvironment="3"
GenerateStublessProxies="true"
TypeLibraryName="$(IntDir)/ASCOfficePPTFile.tlb"
HeaderFileName="ASCOfficePPTFile.h"
DLLDataFileName=""
InterfaceIdentifierFileName="ASCOfficePPTFile_i.c"
ProxyFileName="ASCOfficePPTFile_p.c"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="NDEBUG;_USRDLL;_ATL_ATTRIBUTES;_USE_MATH_DEFINES;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;PPT_FORMAT;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;BUILD_CONFIG_FULL_VERSION;_PRESENTATION_WRITER_;_SVG_CONVERT_TO_IMAGE_;DONT_WRITE_EMBEDDED_FONTS"
StringPooling="true"
RuntimeLibrary="2"
UsePrecompiledHeader="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
RegisterOutput="true"
IgnoreImportLibrary="true"
AdditionalDependencies="Urlmon.lib"
OutputFile="$(OutDir)\$(ProjectName).dll"
LinkIncremental="1"
IgnoreDefaultLibraryNames="libcmt.lib"
MergedIDLBaseFileName="_ASCOfficePPTFile.idl"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/$(TargetName).pdb"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
ImportLibrary="$(OutDir)/$(TargetName).lib"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Performing registration"
CommandLine="regsvr32 /s /c &quot;$(TargetPath)&quot;&#x0D;&#x0A;copy &quot;$(TargetPath)&quot; &quot;$(ProjectDir)..\..\..\Redist\x64&quot;&#x0D;&#x0A;"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\ASCOfficePPTFile.cpp"
>
</File>
<File
RelativePath=".\stdafx.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseASC|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
RelativePath=".\ASCOfficePPTFile.rc"
>
</File>
<File
RelativePath=".\ASCOfficePPTFile.rgs"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\OfficePPTFile.h"
>
</File>
<File
RelativePath=".\Resource.h"
>
</File>
<File
RelativePath=".\stdafx.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
// OfficePPTFile3.h : Declaration of the CPPTFile3
#pragma once
#include "resource.h" // main symbols
#include "../../../Common/OfficeFileTemplate.h"
#include "../../../Common/ATLDefine.h"
#include "../../../Common/ASCUtils.h"
#include "../../../Common/VideoFileErrorDescription.h"
#include "../PPTFormatLib/PPTFormatLib.h"
// IAVSOfficePPTFile
[object, uuid("01AB4BA0-7AE9-4539-8B12-608233D307BC"), dual, pointer_default(unique)]
__interface IAVSOfficePPTFile : IAVSOfficeFileTemplate
{
[id(100 + 0), propget] HRESULT DrawingXml( [out, retval] BSTR* pbstrXml );
[id(100 + 1), propget] HRESULT TempDirectory( [out, retval] BSTR* pbstrDir );
[id(100 + 1), propput] HRESULT TempDirectory( [in] BSTR bstrDir );
[id(1000 + 0)] HRESULT Is_PPTFile([in] BSTR fileName, [out, retval] VARIANT_BOOL* Result);
[id(1000 + 1)] HRESULT GetDVDXml([out, retval] BSTR* bstrPTTXml);
[id(1000 + 2)] HRESULT GetBluRayXml([out, retval] BSTR* bstrDVDXml);
[id(2000 + 0)] HRESULT SetAdditionalParam([in] BSTR ParamName, [in] VARIANT ParamValue);
[id(2001 + 1)] HRESULT GetAdditionalParam([in] BSTR ParamName, [out, retval] VARIANT* ParamValue);
};
// _IAVSOfficePPTFileEvents
[dispinterface, uuid("DF3BE363-8404-4173-830A-984BF11790F5")]
__interface _IAVSOfficePPTFileEvents
{
[id(1)] HRESULT ProcessVideoFile([in] LONG ID, [in] LONG Percent, [in, out, ref] SHORT* Cancel);
};
// CAVSOfficePPTFile
[coclass, uuid("FC1AD867-FFA6-454a-82A0-1538465A55EB"), event_source(com), threading(apartment), vi_progid("AVSOfficePPTFile.OfficePPTFile"), progid("AVSOfficePPTFile.OfficePPTFile.1"), version(1.0)]
class ATL_NO_VTABLE CAVSOfficePPTFile :
public IAVSOfficePPTFile,
public CAVSATLError
{
public:
CAVSOfficePPTFile() :
CAVSATLError(__uuidof(CAVSOfficePPTFile), __uuidof(IAVSOfficePPTFile)), m_hSynchMutex(NULL)
{
}
__event __interface _IAVSOfficePPTFileEvents;
__event __interface _IAVSOfficeFileTemplateEvents2;
DECLARE_PROTECT_FINAL_CONSTRUCT()
HRESULT FinalConstruct()
{
m_hSynchMutex = CreateMutex(NULL, FALSE, NULL);
m_Status = 0;
return S_OK;
}
void FinalRelease()
{
RELEASEHANDLE ( m_hSynchMutex );
}
private:
COfficePPTFile PPTFile;
HANDLE m_hSynchMutex;
LONG m_Status;
public:
STDMETHOD(get_DrawingXml)(BSTR* pbstrXml)
{
if (NULL == pbstrXml)
return S_FALSE;
return S_OK;
}
STDMETHOD(get_TempDirectory)(BSTR* pbstrDir)
{
if (NULL == pbstrDir)
return S_FALSE;
*pbstrDir = PPTFile.get_TempDirectory().AllocSysString();
return S_OK;
}
STDMETHOD(put_TempDirectory)(BSTR bstrDir)
{
PPTFile.put_TempDirectory((CStringW)bstrDir);
return S_OK;
}
STDMETHOD(Is_PPTFile)(BSTR fileName, VARIANT_BOOL* Result)
{
CSynchAccess oSynchAccess(m_hSynchMutex);
return S_OK;
}
STDMETHOD(LoadFromFile)(BSTR sSrcFileName, BSTR sDstPath, BSTR sXMLOptions)
{
CSynchAccess oSynchAccess(m_hSynchMutex);
return PPTFile.LoadFromFile(CString(sSrcFileName), CString(sDstPath), CString(sXMLOptions));
}
STDMETHOD(SaveToFile)(BSTR sDstFileName, BSTR sSrcPath, BSTR sXMLOptions)
{
return S_OK;
}
// ...
STDMETHOD(GetDVDXml)(BSTR* bstrDVDXml)
{
return S_OK;
}
STDMETHOD(GetBluRayXml)(BSTR* bstrBluRayXml)
{
return S_OK;
}
STDMETHOD(SetAdditionalParam)(BSTR ParamName, VARIANT ParamValue)
{
return S_OK;
}
STDMETHOD(GetAdditionalParam)(BSTR ParamName, VARIANT* ParamValue)
{
if (NULL == ParamValue)
return S_FALSE;
PPTFile.GetAdditionalParam(CString(ParamName), ParamValue);
return S_OK;
}
};
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by AVSOfficePPTFile.rc
//
#define IDS_PROJNAME 100
#define IDR_ASCOFFICEPPTFILE 101
#define IDB_COFFICEPPTFILE 102
#define IDB_OFFICEPPTFILE 103
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 201
#define _APS_NEXT_COMMAND_VALUE 32768
#define _APS_NEXT_CONTROL_VALUE 201
#define _APS_NEXT_SYMED_VALUE 104
#endif
#endif
// stdafx.cpp : source file that includes just the standard includes
// AVSPPTFile3.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently,
// but are changed infrequently
#pragma once
#ifndef STRICT
#define STRICT
#endif
// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef WINVER // Allow use of features specific to Windows XP or later.
#define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
#endif
#ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later.
#define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE.
#endif
#define _ATL_APARTMENT_THREADED
#define _ATL_NO_AUTOMATIC_NAMESPACE
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
#define _CRT_SECURE_NO_DEPRECATE
#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#endif
#include <atlbase.h>
#include <atlcom.h>
//#include <atlwin.h>
//#include <math.h>
//#include <gdiplus.h>
using namespace ATL;
//#pragma comment(lib, "gdiplus.lib")
//
#pragma warning(disable: 4244)
#ifdef _DEBUG
#define AVS_PPT_LOG_FILE
#endif
#include "../../../Common/ASCATLError.h"
#pragma once
//1
//0
//1
//257
#define INTVER 1,0,1,257
#define STRVER "1,0,1,257\0"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment