mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
для стыковки с docxFile2 как код: код лежащий в PPTXFile поменял namespace OOX -> PPTX; отделение com интерфейса от логики.
git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@58310 954022d7-b5bf-4e40-9824-e11837661b57
This commit is contained in:
committed by
Alexander Trofimov
parent
30fd8af8b5
commit
6847df2da0
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
229
ASCOfficePPTXFile/ASCOfficeDrawingConverterComInterface.h
Normal file
229
ASCOfficePPTXFile/ASCOfficeDrawingConverterComInterface.h
Normal file
@ -0,0 +1,229 @@
|
||||
// AVSOfficeDrawingConverter.h : Declaration of the CAVSOfficeDrawingConverter.h
|
||||
|
||||
#pragma once
|
||||
#include "stdafx.h"
|
||||
#include "resource.h" // main symbols
|
||||
|
||||
#include "../Common/OfficeFileTemplate.h"
|
||||
#include "ASCOfficeDrawingConverter.h"
|
||||
|
||||
// IAVSODObjectProps
|
||||
[object, uuid("44B693E1-F4F9-4547-ACEF-0AE037C84485"), dual, pointer_default(unique)]
|
||||
__interface IAVSODObjectProps : IDispatch
|
||||
{
|
||||
[id(1)] HRESULT GetProperty([in] LONG lId, [out, retval] VARIANT* pProp);
|
||||
[id(2)] HRESULT SetProperty([in] LONG lId, [in] VARIANT prop);
|
||||
|
||||
[id(1000)] HRESULT SetAdditionalParam([in] BSTR ParamName, [in] VARIANT ParamValue);
|
||||
[id(1001)] HRESULT GetAdditionalParam([in] BSTR ParamName, [out, retval] VARIANT* ParamValue);
|
||||
};
|
||||
|
||||
// IAVSOfficeDrawingConverter
|
||||
[object, uuid("8E0FBC40-9B34-40bf-B68A-0FA320E1B004"), dual, pointer_default(unique)]
|
||||
__interface IAVSOfficeDrawingConverter : IDispatch
|
||||
{
|
||||
[id(1)] HRESULT SetMainDocument([in] IUnknown* pDocument);
|
||||
[id(2)] HRESULT SetRelsPath([in] BSTR bsRelsPath);
|
||||
[id(3)] HRESULT SetMediaDstPath([in] BSTR bsMediaPath);
|
||||
|
||||
[id(9)] HRESULT AddShapeType([in] BSTR bsXml);
|
||||
[id(10)] HRESULT AddObject([in] BSTR bsXml, [out] BSTR* pMainProps, [out, satype("BYTE")] SAFEARRAY** ppBinary);
|
||||
[id(11)] HRESULT SaveObject([in, satype("BYTE")] SAFEARRAY* pBinaryObj, [in] LONG lStart, [in] LONG lLength, [in] BSTR bsMainProps, [out] BSTR* bsXml);
|
||||
[id(12)] HRESULT SaveObjectEx([in, satype("BYTE")] SAFEARRAY* pBinaryObj, [in] LONG lStart, [in] LONG lLength, [in] BSTR bsMainProps, [in] LONG lDocType, [out] BSTR* bsXml);
|
||||
|
||||
[id(13)] HRESULT GetRecordBinary([in] LONG lRecordType, [in] BSTR bsXml, [out, satype("BYTE")] SAFEARRAY** ppBinary);
|
||||
[id(14)] HRESULT GetRecordXml([in, satype("BYTE")] SAFEARRAY* pBinaryObj, [in] LONG lStart, [in] LONG lLength, [in] LONG lRecType, [in] LONG lDocType, [out] BSTR* bsXml);
|
||||
|
||||
[id(20)] HRESULT AddObject2([in] BSTR bsXml, [in, satype("BYTE")] SAFEARRAY* pBinaryObj, [out] BSTR* pXmlOutput);
|
||||
|
||||
[id(30)] HRESULT GetThemeBinary([in] BSTR bsThemeFilePath, [out, satype("BYTE")] SAFEARRAY** ppBinary);
|
||||
[id(31)] HRESULT SaveThemeXml([in, satype("BYTE")] SAFEARRAY* pBinaryTheme, [in] LONG lStart, [in] LONG lLength, [in] BSTR bsThemePath);
|
||||
|
||||
[id(40)] HRESULT SetDstContentRels();
|
||||
[id(41)] HRESULT SaveDstContentRels([in] BSTR bsRelsPath);
|
||||
[id(42)] HRESULT WriteRels([in] BSTR bsType, [in] BSTR bsTarget, [in] BSTR bsTargetMode, [out] LONG* lId);
|
||||
|
||||
[id(50)] HRESULT LoadClrMap([in] BSTR bsXml);
|
||||
|
||||
[id(60)] HRESULT GetTxBodyBinary([in] BSTR bsXml, [out, satype("BYTE")] SAFEARRAY** ppBinary);
|
||||
[id(61)] HRESULT GetTxBodyXml([in, satype("BYTE")] SAFEARRAY* pBinary, [in] LONG lStart, [in] LONG lLength, BSTR* pbstrXml);
|
||||
[id(62)] HRESULT SetFontDir([in] BSTR bsFontDir);
|
||||
|
||||
[id(1000)] HRESULT SetAdditionalParam([in] BSTR ParamName, [in] VARIANT ParamValue);
|
||||
[id(1001)] HRESULT GetAdditionalParam([in] BSTR ParamName, [out, retval] VARIANT* ParamValue);
|
||||
};
|
||||
|
||||
// CAVSODObjectProps
|
||||
[coclass, uuid("4AB04382-4B51-4674-A691-BE2691A5F387"), threading(apartment), vi_progid("AVSOfficePPTXFile.ODObjectProps"), progid("AVSOfficePPTXFile.ODObjectProps.1"), version(1.0), registration_script("control.rgs")]
|
||||
class ATL_NO_VTABLE CAVSODObjectProps
|
||||
: public IAVSODObjectProps
|
||||
{
|
||||
private:
|
||||
CElementProps m_oProps;
|
||||
|
||||
public:
|
||||
|
||||
CAVSODObjectProps() : m_oProps()
|
||||
{
|
||||
}
|
||||
|
||||
~CAVSODObjectProps()
|
||||
{
|
||||
}
|
||||
|
||||
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
||||
|
||||
HRESULT FinalConstruct()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void FinalRelease()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
STDMETHOD(GetProperty)(LONG lId, VARIANT* pProp)
|
||||
{
|
||||
return m_oProps.GetProperty(lId, pProp);
|
||||
}
|
||||
STDMETHOD(SetProperty)(LONG lId, VARIANT prop)
|
||||
{
|
||||
return m_oProps.SetProperty(lId, prop);
|
||||
}
|
||||
|
||||
STDMETHOD(SetAdditionalParam)(BSTR ParamName, VARIANT ParamValue)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
STDMETHOD(GetAdditionalParam)(BSTR ParamName, VARIANT* ParamValue)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
};
|
||||
|
||||
// CAVSOfficeDrawingConverter
|
||||
[coclass, uuid("BA240E3F-CFE4-45d7-96BB-97CDD73F63C3"), event_source(com), threading(apartment), vi_progid("AVSOfficePPTXFile.ODConverter"), progid("AVSOfficePPTXFile.ODConverter.1"), version(1.0), registration_script("control.rgs")]
|
||||
class ATL_NO_VTABLE CAVSOfficeDrawingConverter
|
||||
: public IAVSOfficeDrawingConverter
|
||||
{
|
||||
private:
|
||||
NSBinPptxRW::CDrawingConverter m_oDrawingConverter;
|
||||
public:
|
||||
|
||||
__event __interface _IAVSOfficeFileTemplateEvents2;
|
||||
|
||||
CAVSOfficeDrawingConverter()
|
||||
{
|
||||
}
|
||||
|
||||
~CAVSOfficeDrawingConverter()
|
||||
{
|
||||
}
|
||||
|
||||
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
||||
|
||||
HRESULT FinalConstruct()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void FinalRelease()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
STDMETHOD(SetMainDocument)(IUnknown* pDocument)
|
||||
{
|
||||
|
||||
return m_oDrawingConverter.SetMainDocument(pDocument);
|
||||
}
|
||||
STDMETHOD(SetRelsPath)(BSTR bsRelsPath)
|
||||
{
|
||||
return m_oDrawingConverter.SetRelsPath(bsRelsPath);
|
||||
}
|
||||
STDMETHOD(SetMediaDstPath)(BSTR bsMediaPath)
|
||||
{
|
||||
return m_oDrawingConverter.SetMediaDstPath(bsMediaPath);
|
||||
}
|
||||
|
||||
STDMETHOD(AddShapeType)(BSTR bsXml)
|
||||
{
|
||||
return m_oDrawingConverter.AddShapeType(bsXml);
|
||||
}
|
||||
STDMETHOD(AddObject)(BSTR bsXml, BSTR* pMainProps, SAFEARRAY** ppBinary)
|
||||
{
|
||||
return m_oDrawingConverter.AddObject(bsXml, pMainProps, ppBinary);
|
||||
}
|
||||
STDMETHOD(AddObject2)(BSTR bsXml, SAFEARRAY* pBinaryObj, BSTR* pXmlOutput)
|
||||
{
|
||||
return m_oDrawingConverter.AddObject2(bsXml, pBinaryObj, pXmlOutput);
|
||||
}
|
||||
|
||||
STDMETHOD(GetThemeBinary)(BSTR bsThemeFilePath, SAFEARRAY** ppBinary)
|
||||
{
|
||||
return m_oDrawingConverter.GetThemeBinary(bsThemeFilePath, ppBinary);
|
||||
}
|
||||
|
||||
STDMETHOD(SaveThemeXml)(SAFEARRAY* pBinaryTheme, LONG lStart, LONG lLength, BSTR bsThemePath)
|
||||
{
|
||||
return m_oDrawingConverter.SaveThemeXml(pBinaryTheme, lStart, lLength, bsThemePath);
|
||||
}
|
||||
STDMETHOD(SaveObject)(SAFEARRAY* pBinaryObj, LONG lStart, LONG lLength, BSTR bsMainProps, BSTR* bsXml)
|
||||
{
|
||||
return m_oDrawingConverter.SaveObject(pBinaryObj, lStart, lLength, bsMainProps, bsXml);
|
||||
}
|
||||
STDMETHOD(SaveObjectEx)(SAFEARRAY* pBinaryObj, LONG lStart, LONG lLength, BSTR bsMainProps, LONG lDocType, BSTR* bsXml)
|
||||
{
|
||||
return m_oDrawingConverter.SaveObjectEx(pBinaryObj, lStart, lLength, bsMainProps, lDocType, bsXml);
|
||||
}
|
||||
|
||||
STDMETHOD(GetRecordBinary)(LONG lRecordType, BSTR bsXml, SAFEARRAY** ppBinary)
|
||||
{
|
||||
return m_oDrawingConverter.GetRecordBinary(lRecordType, bsXml, ppBinary);
|
||||
}
|
||||
STDMETHOD(GetRecordXml)(SAFEARRAY* pBinaryObj, LONG lStart, LONG lLength, LONG lRecType, LONG lDocType, BSTR* bsXml)
|
||||
{
|
||||
return m_oDrawingConverter.GetRecordXml(pBinaryObj, lStart, lLength, lRecType, lDocType, bsXml);
|
||||
}
|
||||
|
||||
STDMETHOD(SetDstContentRels)()
|
||||
{
|
||||
return m_oDrawingConverter.SetDstContentRels();
|
||||
}
|
||||
STDMETHOD(SaveDstContentRels)(BSTR bsRelsPath)
|
||||
{
|
||||
return m_oDrawingConverter.SaveDstContentRels(bsRelsPath);
|
||||
}
|
||||
STDMETHOD(WriteRels)(BSTR bsType, BSTR bsTarget, BSTR bsTargetMode, LONG* lId)
|
||||
{
|
||||
return m_oDrawingConverter.WriteRels(bsType, bsTarget, bsTargetMode, lId);
|
||||
}
|
||||
|
||||
STDMETHOD(LoadClrMap)(BSTR bsXml)
|
||||
{
|
||||
return m_oDrawingConverter.LoadClrMap(bsXml);
|
||||
}
|
||||
|
||||
STDMETHOD(GetTxBodyBinary)(BSTR bsXml, SAFEARRAY** ppBinary)
|
||||
{
|
||||
return m_oDrawingConverter.GetTxBodyBinary(bsXml, ppBinary);
|
||||
}
|
||||
STDMETHOD(GetTxBodyXml)(SAFEARRAY* pBinary, LONG lStart, LONG lLength, BSTR *pbstrXml)
|
||||
{
|
||||
return m_oDrawingConverter.GetTxBodyXml(pBinary, lStart, lLength, pbstrXml);
|
||||
}
|
||||
STDMETHOD(SetFontDir)(BSTR bsFontDir)
|
||||
{
|
||||
return m_oDrawingConverter.SetFontDir(bsFontDir);
|
||||
}
|
||||
|
||||
STDMETHOD(SetAdditionalParam)(BSTR ParamName, VARIANT ParamValue)
|
||||
{
|
||||
return m_oDrawingConverter.SetAdditionalParam(ParamName, ParamValue);
|
||||
}
|
||||
STDMETHOD(GetAdditionalParam)(BSTR ParamName, VARIANT* ParamValue)
|
||||
{
|
||||
return m_oDrawingConverter.GetAdditionalParam(ParamName, ParamValue);
|
||||
}
|
||||
};
|
||||
@ -3,8 +3,8 @@
|
||||
#include "stdafx.h"
|
||||
#include "resource.h"
|
||||
|
||||
#include "ASCOfficePPTXFile.h"
|
||||
#include "ASCOfficeDrawingConverter.h"
|
||||
#include "ASCOfficePPTXFileComInterface.h"
|
||||
#include "ASCOfficeDrawingConverterComInterface.h"
|
||||
|
||||
// The module attribute causes DllMain, DllRegisterServer and DllUnregisterServer to be automatically implemented for you
|
||||
[ module(dll, uuid = "{95DEE027-7707-4078-A314-33D35AE842FD}",
|
||||
|
||||
@ -1,62 +1,28 @@
|
||||
// CAVSOfficePPTXFile.h : Declaration of the CAVSOfficePPTXFile
|
||||
|
||||
#pragma once
|
||||
#include "stdafx.h"
|
||||
#include "resource.h" // main symbols
|
||||
|
||||
#include "../Common/OfficeFileTemplate.h"
|
||||
#ifndef ASC_OFFICE_PPTX_FILE
|
||||
#define ASC_OFFICE_PPTX_FILE
|
||||
|
||||
//todo
|
||||
#include <atlbase.h>
|
||||
#include <atlstr.h>
|
||||
#include "../Common/DocxFormat/Source/Base/Base.h"
|
||||
#include "PPTXFormat/PPTXEvent.h"
|
||||
#include "../../../../Common/GdiPlusEx.h"
|
||||
|
||||
#include <shellapi.h>
|
||||
#include <shlobj.h>
|
||||
#include <shlwapi.h>
|
||||
#pragma comment( lib, "shell32.lib" ) // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> shell32.lib
|
||||
typedef void (*load_from_resource)(void*, int, CString&);
|
||||
typedef bool (*extract_to_directory)(void*, CString&, CString&);
|
||||
typedef bool (*compress_from_directory)(void*, CString&, CString&);
|
||||
typedef bool (*progress_operation)(void*, long, long);
|
||||
|
||||
#include "Editor\PPTXWriter.h"
|
||||
|
||||
// IAVSOfficePPTXFile
|
||||
[object, uuid("ED1EC17E-EE0E-4cae-9E63-1C57235CE286"), dual, pointer_default(unique)]
|
||||
__interface IAVSOfficePPTXFile : IAVSOfficeFileTemplate
|
||||
class CGdiPlusInit;
|
||||
namespace PPTX
|
||||
{
|
||||
// [id(3), helpstring("method SaveAsDrawingXML")] HRESULT SaveAsDrawingXML([in] BSTR sSrcFileName, [in] BSTR sDestPath, [in] BSTR sDestXMLFileName);
|
||||
class Folder;
|
||||
}
|
||||
|
||||
[propget, id(4), helpstring("property TempDirectory")] HRESULT TempDirectory([out, retval] BSTR* pVal);
|
||||
[propput, id(4), helpstring("property TempDirectory")] HRESULT TempDirectory([in] BSTR newVal);
|
||||
[id(5), helpstring("method GetDVDXml")] HRESULT GetDVDXml([out,retval] BSTR* pbstrPTTXml);
|
||||
[id(6), helpstring("method GetBluRayXml")] HRESULT GetBluRayXml([out,retval] BSTR* pbstrDVDXml);
|
||||
[propget, id(7), helpstring("property DrawingXml")] HRESULT DrawingXml([out, retval] BSTR* pVal);
|
||||
|
||||
[id(2000 + 0)] HRESULT SetAdditionalParam([in] BSTR ParamName, [in] VARIANT ParamValue);
|
||||
[id(2001 + 1)] HRESULT GetAdditionalParam([in] BSTR ParamName, [out, retval] VARIANT* ParamValue);
|
||||
};
|
||||
|
||||
// IAVSOfficePPTXFile2
|
||||
[object, uuid("4F4EA472-EC78-495c-B627-5798EA364468"), dual, pointer_default(unique)]
|
||||
__interface IAVSOfficePPTXFile2 : IDispatch
|
||||
{
|
||||
[id(10000 + 0)] HRESULT OpenFileToPPTY([in] BSTR bsInputDir, [in] BSTR bsFileDst);
|
||||
[id(10000 + 1)] HRESULT OpenDirectoryToPPTY([in] BSTR bsInputDir, [in] BSTR bsFileDst);
|
||||
|
||||
[id(10000 + 2)] HRESULT SetMediaDir([in] BSTR bsMediaDir);
|
||||
[id(10000 + 3)] HRESULT SetFontDir([in] BSTR bsFontDir);
|
||||
|
||||
[id(10000 + 4)] HRESULT SetUseSystemFonts([in] VARIANT_BOOL useSystemFonts);
|
||||
[id(10000 + 5)] HRESULT ConvertPPTYToPPTX([in] BSTR bsInputFile, [in] BSTR bsFileDst);
|
||||
|
||||
[id(10000 + 6)] HRESULT SetThemesDir([in] BSTR bsThemesPath);
|
||||
};
|
||||
|
||||
// CAVSOfficePPTXFile
|
||||
[coclass, uuid("5731F488-94FF-44b7-8A3E-54CBB746F5B1"), event_source(com), threading(apartment), vi_progid("AVSOfficePPTXFile.OfficePPTXFile"), progid("AVSOfficePPTXFile.OfficePPTXFile.1"), version(1.0), registration_script("control.rgs")]
|
||||
class ATL_NO_VTABLE CAVSOfficePPTXFile
|
||||
: public IAVSOfficePPTXFile
|
||||
, public IAVSOfficePPTXFile2
|
||||
, public PPTX::IPPTXEvent
|
||||
class CPPTXFile : public PPTX::IPPTXEvent
|
||||
{
|
||||
private:
|
||||
OfficeUtils::IOfficeUtils* m_pOfficeUtils;
|
||||
//todo
|
||||
//OfficeUtils::IOfficeUtils* m_pOfficeUtils;
|
||||
PPTX::Folder* m_pFolder;
|
||||
CStringW m_strTempDir;
|
||||
CString m_strDirectory;
|
||||
@ -69,424 +35,42 @@ private:
|
||||
|
||||
CString m_strFolderThemes;
|
||||
|
||||
CGdiPlusInit m_oInit;
|
||||
|
||||
CGdiPlusInit* m_pInit;
|
||||
load_from_resource m_fCallbackResource;
|
||||
extract_to_directory m_fCallbackExtract;
|
||||
compress_from_directory m_fCallbackCompress;
|
||||
progress_operation m_fCallbackProgress;
|
||||
void* m_pCallbackArg;
|
||||
public:
|
||||
|
||||
__event __interface _IAVSOfficeFileTemplateEvents2;
|
||||
CAVSOfficePPTXFile()
|
||||
{
|
||||
WCHAR buffer[4096];
|
||||
GetTempPathW(4096, buffer);
|
||||
m_strTempDir = CStringW(buffer);
|
||||
GetLongPathNameW(m_strTempDir.GetString(), buffer, 4096);
|
||||
m_strTempDir = CStringW(buffer) + CStringW("_PPTX\\");
|
||||
|
||||
//
|
||||
m_strFontDirectory = _T("");
|
||||
m_strMediaDirectory = _T("");
|
||||
m_bIsUseSystemFonts = FALSE;
|
||||
m_strEmbeddedFontsDirectory = _T("");
|
||||
|
||||
m_strFolderThemes = _T("");
|
||||
}
|
||||
|
||||
~CAVSOfficePPTXFile()
|
||||
{
|
||||
}
|
||||
|
||||
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
||||
|
||||
HRESULT FinalConstruct()
|
||||
{
|
||||
m_pFolder = NULL;
|
||||
m_pOfficeUtils = NULL;
|
||||
|
||||
if (S_OK != CoCreateInstance(__uuidof(OfficeUtils::COfficeUtils), NULL, CLSCTX_INPROC_SERVER, __uuidof(OfficeUtils::IOfficeUtils),(void**)&m_pOfficeUtils))
|
||||
return S_FALSE;
|
||||
|
||||
m_oInit.Init();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void FinalRelease()
|
||||
{
|
||||
RELEASEINTERFACE(m_pOfficeUtils);
|
||||
RELEASEOBJECT(m_pFolder);
|
||||
}
|
||||
CPPTXFile(load_from_resource fCallbackResource, extract_to_directory fCallbackExtract, compress_from_directory fCallbackCompress, progress_operation fCallbackProgress, void* pCallbackArg);
|
||||
|
||||
~CPPTXFile();
|
||||
public:
|
||||
HRESULT LoadFromFile(BSTR sSrcFileName, BSTR sDstPath, BSTR sXMLOptions)
|
||||
{
|
||||
CStringW localTempDir(sDstPath);
|
||||
if((sDstPath != NULL) || (localTempDir != ""))
|
||||
{
|
||||
int res = SHCreateDirectoryExW(NULL, localTempDir.GetString(), NULL);
|
||||
if((res != ERROR_SUCCESS) && (res != ERROR_ALREADY_EXISTS) && (res != ERROR_FILE_EXISTS))
|
||||
return S_FALSE;
|
||||
put_TempDirectory(sDstPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
int res = SHCreateDirectoryExW(NULL, m_strTempDir, NULL);
|
||||
if((res != ERROR_SUCCESS) && (res != ERROR_ALREADY_EXISTS) && (res != ERROR_FILE_EXISTS))
|
||||
return S_FALSE;
|
||||
}
|
||||
localTempDir = m_strTempDir;
|
||||
|
||||
/*
|
||||
SHFILEOPSTRUCTW shfos;
|
||||
ZeroMemory(&shfos, sizeof(shfos));
|
||||
shfos.wFunc = FO_DELETE;
|
||||
CStringW _local = localTempDir + CStringW(L"*.*");
|
||||
_local.AppendChar(0);
|
||||
_local.AppendChar(0);
|
||||
shfos.pFrom = _local.GetString();
|
||||
shfos.fFlags = FOF_SILENT + FOF_NOCONFIRMATION;
|
||||
if(SHFileOperationW(&shfos) != 0)
|
||||
return S_FALSE;
|
||||
*/
|
||||
|
||||
if(m_pOfficeUtils == NULL)
|
||||
return S_FALSE;
|
||||
|
||||
BSTR bsParam = localTempDir.AllocSysString();
|
||||
HRESULT hr = m_pOfficeUtils->ExtractToDirectory( sSrcFileName, bsParam, NULL, 0);
|
||||
SysFreeString(bsParam);
|
||||
if(hr != S_OK)
|
||||
return hr;
|
||||
|
||||
RELEASEOBJECT(m_pFolder);
|
||||
m_pFolder = new PPTX::Folder();
|
||||
|
||||
if(!m_pFolder->isValid(localTempDir))
|
||||
{
|
||||
RELEASEOBJECT(m_pFolder);
|
||||
return S_FALSE;
|
||||
}
|
||||
m_pFolder->read(localTempDir, (PPTX::IPPTXEvent*)this);
|
||||
if(GetPercent() < 1000000)
|
||||
{
|
||||
RELEASEOBJECT(m_pFolder);
|
||||
return S_FALSE;
|
||||
}
|
||||
smart_ptr<PPTX::Presentation> presentation = m_pFolder->get(OOX::FileTypes::Presentation).smart_dynamic_cast<PPTX::Presentation>();
|
||||
if (!presentation.is_init())
|
||||
{
|
||||
RemoveDirOrFile(m_strTempDir, false);
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
m_strDirectory = (CString)sSrcFileName;
|
||||
int nIndex = m_strDirectory.ReverseFind(TCHAR('\\'));
|
||||
if (-1 != nIndex)
|
||||
m_strDirectory = m_strDirectory.Mid(0, nIndex);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT LoadFromFile(BSTR sSrcFileName, BSTR sDstPath, BSTR sXMLOptions);
|
||||
public:
|
||||
HRESULT SaveToFile(BSTR sDstFileName, BSTR sSrcPath, BSTR sXMLOptions)
|
||||
{
|
||||
if (NULL == m_pFolder)
|
||||
return S_FALSE;
|
||||
|
||||
OOX::CPath oPath;
|
||||
oPath.m_strFilename = CString(sSrcPath);
|
||||
m_pFolder->write(oPath);
|
||||
|
||||
return m_pOfficeUtils->CompressFileOrDirectory( sSrcPath, sDstFileName, -1 );
|
||||
}
|
||||
|
||||
HRESULT SaveToFile(BSTR sDstFileName, BSTR sSrcPath, BSTR sXMLOptions);
|
||||
public:
|
||||
STDMETHOD(get_TempDirectory)(BSTR* pVal)
|
||||
{
|
||||
*pVal = m_strTempDir.AllocSysString();
|
||||
return S_OK;
|
||||
}
|
||||
STDMETHOD(put_TempDirectory)(BSTR newVal)
|
||||
{
|
||||
CStringW TempStr(newVal);
|
||||
if(PathIsDirectoryW(TempStr.GetString()))
|
||||
{
|
||||
if(TempStr.Right(1) != L"\\")
|
||||
TempStr += L"\\";
|
||||
m_strTempDir = TempStr;
|
||||
return S_OK;
|
||||
}
|
||||
return S_FALSE;
|
||||
}
|
||||
STDMETHOD(get_TempDirectory)(BSTR* pVal);
|
||||
STDMETHOD(put_TempDirectory)(BSTR newVal);
|
||||
public:
|
||||
STDMETHOD(GetDVDXml)(BSTR* pbstrPTTXml)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
STDMETHOD(GetBluRayXml)(BSTR* pbstrDVDXml)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
STDMETHOD(GetDVDXml)(BSTR* pbstrPTTXml);
|
||||
STDMETHOD(GetBluRayXml)(BSTR* pbstrDVDXml);
|
||||
public:
|
||||
STDMETHOD(get_DrawingXml)(BSTR* pVal)
|
||||
{
|
||||
if ((NULL == m_pFolder) || (NULL == pVal))
|
||||
return S_FALSE;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHOD(SetAdditionalParam)(BSTR ParamName, VARIANT ParamValue)
|
||||
{
|
||||
CString sParamName; sParamName = ParamName;
|
||||
if (_T("EmbeddedFontsDirectory") == sParamName && ParamValue.vt == VT_BSTR)
|
||||
{
|
||||
m_strEmbeddedFontsDirectory = ParamValue.bstrVal;
|
||||
return S_OK;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHOD(GetAdditionalParam)(BSTR ParamName, VARIANT* ParamValue)
|
||||
{
|
||||
if (NULL == ParamValue)
|
||||
return S_FALSE;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
virtual bool Progress(long ID, long Percent)
|
||||
{
|
||||
SHORT res = 0;
|
||||
percent = Percent;
|
||||
OnProgressEx(ID, Percent, &res);
|
||||
return (res != 0);
|
||||
}
|
||||
|
||||
STDMETHOD(get_DrawingXml)(BSTR* pVal);
|
||||
STDMETHOD(SetAdditionalParam)(BSTR ParamName, VARIANT ParamValue);
|
||||
STDMETHOD(GetAdditionalParam)(BSTR ParamName, VARIANT* ParamValue);
|
||||
virtual bool Progress(long ID, long Percent);
|
||||
// to PPTY
|
||||
STDMETHOD(SetMediaDir)(BSTR bsMediaDir)
|
||||
{
|
||||
m_strMediaDirectory = bsMediaDir;
|
||||
return S_OK;
|
||||
}
|
||||
STDMETHOD(SetFontDir)(BSTR bsFontDir)
|
||||
{
|
||||
m_strFontDirectory = bsFontDir;
|
||||
return S_OK;
|
||||
}
|
||||
STDMETHOD(SetThemesDir)(BSTR bsDir)
|
||||
{
|
||||
m_strFolderThemes = bsDir;
|
||||
return S_OK;
|
||||
}
|
||||
STDMETHOD(SetUseSystemFonts)(VARIANT_BOOL useSystemFonts)
|
||||
{
|
||||
m_bIsUseSystemFonts = (VARIANT_TRUE == useSystemFonts);
|
||||
return S_OK;
|
||||
}
|
||||
STDMETHOD(OpenFileToPPTY)(BSTR bsInput, BSTR bsOutput)
|
||||
{
|
||||
int res = SHCreateDirectoryExW(NULL, m_strTempDir, NULL);
|
||||
if((res != ERROR_SUCCESS) && (res != ERROR_ALREADY_EXISTS) && (res != ERROR_FILE_EXISTS))
|
||||
return S_FALSE;
|
||||
|
||||
if (m_pOfficeUtils == NULL)
|
||||
return S_FALSE;
|
||||
|
||||
BSTR localTempDir = m_strTempDir.AllocSysString();
|
||||
HRESULT hr = m_pOfficeUtils->ExtractToDirectory(bsInput, localTempDir, NULL, 0);
|
||||
if(hr != S_OK)
|
||||
return hr;
|
||||
|
||||
SysFreeString(localTempDir);
|
||||
|
||||
RELEASEOBJECT(m_pFolder);
|
||||
m_pFolder = new PPTX::Folder();
|
||||
|
||||
if (!m_pFolder->isValid(m_strTempDir))
|
||||
{
|
||||
RELEASEOBJECT(m_pFolder);
|
||||
return S_FALSE;
|
||||
}
|
||||
m_pFolder->read(m_strTempDir, (PPTX::IPPTXEvent*)this);
|
||||
if(GetPercent() < 1000000)
|
||||
{
|
||||
RELEASEOBJECT(m_pFolder);
|
||||
return S_FALSE;
|
||||
}
|
||||
smart_ptr<PPTX::Presentation> presentation = m_pFolder->get(OOX::FileTypes::Presentation).smart_dynamic_cast<PPTX::Presentation>();
|
||||
if (!presentation.is_init())
|
||||
{
|
||||
RemoveDirOrFile(m_strTempDir, false);
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
m_strDirectory = (CString)bsInput;
|
||||
int nIndex = m_strDirectory.ReverseFind(TCHAR('\\'));
|
||||
if (-1 != nIndex)
|
||||
m_strDirectory = m_strDirectory.Mid(0, nIndex);
|
||||
|
||||
NSBinPptxRW::CBinaryFileWriter oBinaryWriter;
|
||||
oBinaryWriter.m_oCommon.CheckFontPicker();
|
||||
oBinaryWriter.m_oCommon.m_pNativePicker->Init(m_strFontDirectory);
|
||||
|
||||
CString sDstFileOutput = bsOutput;
|
||||
m_strMediaDirectory = sDstFileOutput;
|
||||
nIndex = m_strMediaDirectory.ReverseFind(TCHAR('\\'));
|
||||
if (-1 != nIndex)
|
||||
m_strMediaDirectory = m_strMediaDirectory.Mid(0, nIndex);
|
||||
|
||||
oBinaryWriter.m_strMainFolder = m_strMediaDirectory;
|
||||
m_strMediaDirectory = m_strMediaDirectory + _T("\\media");
|
||||
oBinaryWriter.m_oCommon.m_oImageManager.m_strDstMedia = m_strMediaDirectory;
|
||||
|
||||
CDirectory::CreateDirectory(m_strMediaDirectory);
|
||||
|
||||
if (_T("") != m_strEmbeddedFontsDirectory)
|
||||
{
|
||||
CDirectory::CreateDirectory(m_strEmbeddedFontsDirectory);
|
||||
|
||||
if (NULL != oBinaryWriter.m_oCommon.m_pFontPicker)
|
||||
{
|
||||
oBinaryWriter.m_oCommon.m_pNativePicker->m_bIsEmbeddedFonts = TRUE;
|
||||
oBinaryWriter.m_oCommon.m_pNativePicker->m_oEmbeddedFonts.m_strEmbeddedFontsFolder = m_strEmbeddedFontsDirectory;
|
||||
}
|
||||
}
|
||||
|
||||
PPTX2EditorAdvanced::Convert(oBinaryWriter, *m_pFolder, m_strDirectory, sDstFileOutput);
|
||||
|
||||
return S_OK;
|
||||
|
||||
}
|
||||
STDMETHOD(OpenDirectoryToPPTY)(BSTR bsInput, BSTR bsOutput)
|
||||
{
|
||||
RELEASEOBJECT(m_pFolder);
|
||||
m_pFolder = new PPTX::Folder();
|
||||
|
||||
if (!m_pFolder->isValid((CString)bsInput))
|
||||
{
|
||||
RELEASEOBJECT(m_pFolder);
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
m_pFolder->read((CString)bsInput, (PPTX::IPPTXEvent*)this);
|
||||
if(GetPercent() < 1000000)
|
||||
{
|
||||
RELEASEOBJECT(m_pFolder);
|
||||
return S_FALSE;
|
||||
}
|
||||
smart_ptr<PPTX::Presentation> presentation = m_pFolder->get(OOX::FileTypes::Presentation).smart_dynamic_cast<PPTX::Presentation>();
|
||||
if (!presentation.is_init())
|
||||
{
|
||||
RemoveDirOrFile(m_strTempDir, false);
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
m_strDirectory = (CString)bsInput;
|
||||
int nIndex = m_strDirectory.ReverseFind(TCHAR('\\'));
|
||||
if (-1 != nIndex)
|
||||
m_strDirectory = m_strDirectory.Mid(0, nIndex);
|
||||
|
||||
NSBinPptxRW::CBinaryFileWriter oBinaryWriter;
|
||||
oBinaryWriter.m_oCommon.CheckFontPicker();
|
||||
oBinaryWriter.m_oCommon.m_pNativePicker->Init(m_strFontDirectory);
|
||||
|
||||
CString sDstFileOutput = (CString)bsOutput;
|
||||
m_strMediaDirectory = sDstFileOutput;
|
||||
nIndex = m_strMediaDirectory.ReverseFind(TCHAR('\\'));
|
||||
if (-1 != nIndex)
|
||||
m_strMediaDirectory = m_strMediaDirectory.Mid(0, nIndex);
|
||||
|
||||
oBinaryWriter.m_strMainFolder = m_strMediaDirectory;
|
||||
m_strMediaDirectory = m_strMediaDirectory + _T("\\media");
|
||||
oBinaryWriter.m_oCommon.m_oImageManager.m_strDstMedia = m_strMediaDirectory;
|
||||
|
||||
CDirectory::CreateDirectory(m_strMediaDirectory);
|
||||
|
||||
PPTX2EditorAdvanced::Convert(oBinaryWriter, *m_pFolder, m_strDirectory, sDstFileOutput);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHOD(ConvertPPTYToPPTX)(BSTR bsInput, BSTR bsOutput)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_strTempDir = _T("C:\\PPTMemory\\PPTX_test");
|
||||
#endif
|
||||
|
||||
int len = m_strTempDir.GetLength();
|
||||
while (len != 0 && m_strTempDir[len - 1] == (TCHAR)'\\')
|
||||
{
|
||||
m_strTempDir.Delete(len - 1);
|
||||
--len;
|
||||
}
|
||||
|
||||
NSBinPptxRW::CPPTXWriter oWriter;
|
||||
oWriter.Init(m_strTempDir);
|
||||
|
||||
CFile oFileBinary;
|
||||
oFileBinary.OpenFile((CString)bsInput);
|
||||
LONG lFileSize = (LONG)oFileBinary.GetFileSize();
|
||||
BYTE* pSrcBuffer = new BYTE[lFileSize];
|
||||
oFileBinary.ReadFile(pSrcBuffer, (DWORD)lFileSize);
|
||||
oFileBinary.CloseFile();
|
||||
CString srcFolder = CDirectory::GetFolderPath((CString)bsInput);
|
||||
oWriter.OpenPPTY(pSrcBuffer, lFileSize, srcFolder, m_strFolderThemes);
|
||||
RELEASEARRAYOBJECTS(pSrcBuffer);
|
||||
|
||||
BSTR bsInput2 = m_strTempDir.AllocSysString();
|
||||
HRESULT hRes = m_pOfficeUtils->CompressFileOrDirectory(bsInput2, bsOutput, -1 );
|
||||
SysFreeString(bsInput2);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
RemoveDirOrFile(m_strTempDir);
|
||||
|
||||
return hRes;
|
||||
}
|
||||
|
||||
STDMETHOD(SetMediaDir)(BSTR bsMediaDir);
|
||||
STDMETHOD(SetFontDir)(BSTR bsFontDir);
|
||||
STDMETHOD(SetThemesDir)(BSTR bsDir);
|
||||
STDMETHOD(SetUseSystemFonts)(VARIANT_BOOL useSystemFonts);
|
||||
STDMETHOD(OpenFileToPPTY)(BSTR bsInput, BSTR bsOutput);
|
||||
STDMETHOD(OpenDirectoryToPPTY)(BSTR bsInput, BSTR bsOutput);
|
||||
STDMETHOD(ConvertPPTYToPPTX)(BSTR bsInput, BSTR bsOutput);
|
||||
private:
|
||||
|
||||
INT32 RemoveDirOrFile(CString sPath, bool bIsRemoveHead = true)
|
||||
{
|
||||
DWORD dwFileAttrib = ::GetFileAttributes( sPath );
|
||||
if( dwFileAttrib != INVALID_FILE_ATTRIBUTES )
|
||||
{
|
||||
DWORD dwResult = 0;
|
||||
if( 0 != (FILE_ATTRIBUTE_DIRECTORY & dwFileAttrib) )
|
||||
{
|
||||
HANDLE Handle;
|
||||
WIN32_FIND_DATA FindData;
|
||||
DWORDLONG Result = 0;
|
||||
|
||||
Handle = FindFirstFile( ( sPath + _T("\\*.*") ), &FindData );
|
||||
if ( Handle == INVALID_HANDLE_VALUE )
|
||||
return 0;
|
||||
do
|
||||
{
|
||||
BOOL bRes = TRUE;
|
||||
if( ( CString( FindData.cFileName ) != _T(".") ) && ( CString( FindData.cFileName ) != _T("..") ) )
|
||||
if( FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY )
|
||||
Result += RemoveDirOrFile( sPath + _T("\\") + FindData.cFileName ); //
|
||||
else
|
||||
bRes = DeleteFile( sPath + _T("\\") + FindData.cFileName );
|
||||
if( FALSE == bRes )
|
||||
dwResult += 1;
|
||||
}
|
||||
while( FindNextFile( Handle, &FindData ) != 0 );
|
||||
FindClose( Handle );
|
||||
|
||||
if (bIsRemoveHead)
|
||||
{
|
||||
BOOL bRes = RemoveDirectory( sPath );
|
||||
if( FALSE == bRes )
|
||||
dwResult += 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( FALSE == DeleteFile( sPath ) )
|
||||
dwResult = 1;
|
||||
}
|
||||
|
||||
return dwResult;
|
||||
}// 0 - <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
return 0;
|
||||
}
|
||||
INT32 RemoveDirOrFile(CString sPath, bool bIsRemoveHead = true);
|
||||
};
|
||||
#endif //ASC_OFFICE_PPTX_FILE
|
||||
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="windows-1251"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Version="8.00"
|
||||
Name="ASCOfficePPTXFile"
|
||||
ProjectGUID="{70078FE7-BE4F-493C-84F3-F98F151587F5}"
|
||||
RootNamespace="ASCOfficePPTXFile"
|
||||
@ -53,8 +53,8 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\..\Addons\ZLib"
|
||||
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL;_ATL_ATTRIBUTES"
|
||||
AdditionalIncludeDirectories="..\..\..\..\Addons\ZLib;"$(SolutionDir)/../Common/DocxFormat/Source/XML/libxml2/XML/include""
|
||||
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL;_ATL_ATTRIBUTES;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
@ -81,7 +81,7 @@
|
||||
AdditionalDependencies="Msimg32.lib"
|
||||
OutputFile="$(OutDir)/ASCOfficePPTXFile.dll"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories=""
|
||||
AdditionalLibraryDirectories="$(SolutionDir)/../Common/DocxFormat/Source/XML/libxml2/win_build/Release"
|
||||
IgnoreDefaultLibraryNames="LIBC;LIBCD"
|
||||
ModuleDefinitionFile=""
|
||||
MergedIDLBaseFileName="_ASCOfficePPTXFile.idl"
|
||||
@ -440,6 +440,14 @@
|
||||
RelativePath=".\ASCOfficePPTXFile.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ASCOfficePPTXFileRealization.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\DocxFormat\Source\XML\libxml2\libxml2.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="stdafx.cpp"
|
||||
>
|
||||
@ -476,6 +484,10 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\DocxFormat\Source\XML\stringcommon.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
@ -485,10 +497,22 @@
|
||||
RelativePath=".\ASCOfficeDrawingConverter.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ASCOfficeDrawingConverterComInterface.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ASCOfficePPTXFile.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ASCOfficePPTXFileComInterface.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\DocxFormat\Source\XML\libxml2\libxml2.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="Resource.h"
|
||||
>
|
||||
@ -497,6 +521,10 @@
|
||||
RelativePath="stdafx.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\Common\DocxFormat\Source\XML\stringcommon.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
|
||||
237
ASCOfficePPTXFile/ASCOfficePPTXFileComInterface.h
Normal file
237
ASCOfficePPTXFile/ASCOfficePPTXFileComInterface.h
Normal file
@ -0,0 +1,237 @@
|
||||
// CAVSOfficePPTXFile.h : Declaration of the CAVSOfficePPTXFile
|
||||
|
||||
#pragma once
|
||||
#include "stdafx.h"
|
||||
#include "resource.h" // main symbols
|
||||
|
||||
#include "../Common/OfficeFileTemplate.h"
|
||||
#include "ASCOfficePPTXFile.h"
|
||||
|
||||
#include "../Common/DocxFormat/Source/SystemUtility/File.h"
|
||||
|
||||
void comLoadTheme(void* pArg, int nIndex, CString& strDstFolder);
|
||||
bool comExtractFile(void* pArg, CString& sFile, CString& sDir);
|
||||
bool comCompressFile(void* pArg, CString& sDir, CString& sFile);
|
||||
bool comProgress(void* pArg, long ID, long Percent);
|
||||
|
||||
// IAVSOfficePPTXFile
|
||||
[object, uuid("ED1EC17E-EE0E-4cae-9E63-1C57235CE286"), dual, pointer_default(unique)]
|
||||
__interface IAVSOfficePPTXFile : IAVSOfficeFileTemplate
|
||||
{
|
||||
// [id(3), helpstring("method SaveAsDrawingXML")] HRESULT SaveAsDrawingXML([in] BSTR sSrcFileName, [in] BSTR sDestPath, [in] BSTR sDestXMLFileName);
|
||||
|
||||
[propget, id(4), helpstring("property TempDirectory")] HRESULT TempDirectory([out, retval] BSTR* pVal);
|
||||
[propput, id(4), helpstring("property TempDirectory")] HRESULT TempDirectory([in] BSTR newVal);
|
||||
[id(5), helpstring("method GetDVDXml")] HRESULT GetDVDXml([out,retval] BSTR* pbstrPTTXml);
|
||||
[id(6), helpstring("method GetBluRayXml")] HRESULT GetBluRayXml([out,retval] BSTR* pbstrDVDXml);
|
||||
[propget, id(7), helpstring("property DrawingXml")] HRESULT DrawingXml([out, retval] BSTR* pVal);
|
||||
|
||||
[id(2000 + 0)] HRESULT SetAdditionalParam([in] BSTR ParamName, [in] VARIANT ParamValue);
|
||||
[id(2001 + 1)] HRESULT GetAdditionalParam([in] BSTR ParamName, [out, retval] VARIANT* ParamValue);
|
||||
};
|
||||
|
||||
// IAVSOfficePPTXFile2
|
||||
[object, uuid("4F4EA472-EC78-495c-B627-5798EA364468"), dual, pointer_default(unique)]
|
||||
__interface IAVSOfficePPTXFile2 : IDispatch
|
||||
{
|
||||
[id(10000 + 0)] HRESULT OpenFileToPPTY([in] BSTR bsInputDir, [in] BSTR bsFileDst);
|
||||
[id(10000 + 1)] HRESULT OpenDirectoryToPPTY([in] BSTR bsInputDir, [in] BSTR bsFileDst);
|
||||
|
||||
[id(10000 + 2)] HRESULT SetMediaDir([in] BSTR bsMediaDir);
|
||||
[id(10000 + 3)] HRESULT SetFontDir([in] BSTR bsFontDir);
|
||||
|
||||
[id(10000 + 4)] HRESULT SetUseSystemFonts([in] VARIANT_BOOL useSystemFonts);
|
||||
[id(10000 + 5)] HRESULT ConvertPPTYToPPTX([in] BSTR bsInputFile, [in] BSTR bsFileDst);
|
||||
|
||||
[id(10000 + 6)] HRESULT SetThemesDir([in] BSTR bsThemesPath);
|
||||
};
|
||||
|
||||
// CAVSOfficePPTXFile
|
||||
[coclass, uuid("5731F488-94FF-44b7-8A3E-54CBB746F5B1"), event_source(com), threading(apartment), vi_progid("AVSOfficePPTXFile.OfficePPTXFile"), progid("AVSOfficePPTXFile.OfficePPTXFile.1"), version(1.0), registration_script("control.rgs")]
|
||||
class ATL_NO_VTABLE CAVSOfficePPTXFile
|
||||
: public IAVSOfficePPTXFile
|
||||
, public IAVSOfficePPTXFile2
|
||||
{
|
||||
private:
|
||||
CPPTXFile m_oCPPTXFile;
|
||||
public:
|
||||
|
||||
__event __interface _IAVSOfficeFileTemplateEvents2;
|
||||
CAVSOfficePPTXFile() : m_oCPPTXFile(comLoadTheme, comExtractFile, comCompressFile, comProgress, this)
|
||||
{
|
||||
}
|
||||
|
||||
~CAVSOfficePPTXFile()
|
||||
{
|
||||
}
|
||||
|
||||
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
||||
|
||||
HRESULT FinalConstruct()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void FinalRelease()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
HRESULT LoadFromFile(BSTR sSrcFileName, BSTR sDstPath, BSTR sXMLOptions)
|
||||
{
|
||||
return m_oCPPTXFile.LoadFromFile(sSrcFileName, sDstPath, sXMLOptions);
|
||||
}
|
||||
public:
|
||||
HRESULT SaveToFile(BSTR sDstFileName, BSTR sSrcPath, BSTR sXMLOptions)
|
||||
{
|
||||
return m_oCPPTXFile.SaveToFile(sDstFileName, sSrcPath, sXMLOptions);
|
||||
}
|
||||
|
||||
public:
|
||||
STDMETHOD(get_TempDirectory)(BSTR* pVal)
|
||||
{
|
||||
return m_oCPPTXFile.get_TempDirectory(pVal);
|
||||
}
|
||||
STDMETHOD(put_TempDirectory)(BSTR newVal)
|
||||
{
|
||||
return m_oCPPTXFile.put_TempDirectory(newVal);
|
||||
}
|
||||
public:
|
||||
STDMETHOD(GetDVDXml)(BSTR* pbstrPTTXml)
|
||||
{
|
||||
return m_oCPPTXFile.GetDVDXml(pbstrPTTXml);
|
||||
}
|
||||
STDMETHOD(GetBluRayXml)(BSTR* pbstrDVDXml)
|
||||
{
|
||||
return m_oCPPTXFile.GetBluRayXml(pbstrDVDXml);
|
||||
}
|
||||
public:
|
||||
STDMETHOD(get_DrawingXml)(BSTR* pVal)
|
||||
{
|
||||
return m_oCPPTXFile.get_DrawingXml(pVal);
|
||||
}
|
||||
|
||||
STDMETHOD(SetAdditionalParam)(BSTR ParamName, VARIANT ParamValue)
|
||||
{
|
||||
return m_oCPPTXFile.SetAdditionalParam(ParamName, ParamValue);
|
||||
}
|
||||
|
||||
STDMETHOD(GetAdditionalParam)(BSTR ParamName, VARIANT* ParamValue)
|
||||
{
|
||||
return m_oCPPTXFile.GetAdditionalParam(ParamName, ParamValue);
|
||||
}
|
||||
|
||||
// to PPTY
|
||||
STDMETHOD(SetMediaDir)(BSTR bsMediaDir)
|
||||
{
|
||||
return m_oCPPTXFile.SetMediaDir(bsMediaDir);
|
||||
}
|
||||
STDMETHOD(SetFontDir)(BSTR bsFontDir)
|
||||
{
|
||||
return m_oCPPTXFile.SetFontDir(bsFontDir);
|
||||
}
|
||||
STDMETHOD(SetThemesDir)(BSTR bsDir)
|
||||
{
|
||||
return m_oCPPTXFile.SetThemesDir(bsDir);
|
||||
}
|
||||
STDMETHOD(SetUseSystemFonts)(VARIANT_BOOL useSystemFonts)
|
||||
{
|
||||
return m_oCPPTXFile.SetUseSystemFonts(useSystemFonts);
|
||||
}
|
||||
STDMETHOD(OpenFileToPPTY)(BSTR bsInput, BSTR bsOutput)
|
||||
{
|
||||
return m_oCPPTXFile.OpenFileToPPTY(bsInput, bsOutput);
|
||||
}
|
||||
STDMETHOD(OpenDirectoryToPPTY)(BSTR bsInput, BSTR bsOutput)
|
||||
{
|
||||
return m_oCPPTXFile.OpenDirectoryToPPTY(bsInput, bsOutput);
|
||||
}
|
||||
STDMETHOD(ConvertPPTYToPPTX)(BSTR bsInput, BSTR bsOutput)
|
||||
{
|
||||
return m_oCPPTXFile.ConvertPPTYToPPTX(bsInput, bsOutput);
|
||||
}
|
||||
void LoadResourceFile(HINSTANCE hInst, LPCTSTR sResName, LPCTSTR sResType, const CString& strDstFile)
|
||||
{
|
||||
HRSRC hrRes = FindResource(hInst, sResName, sResType);
|
||||
if (!hrRes)
|
||||
return;
|
||||
|
||||
HGLOBAL hGlobal = LoadResource(hInst, hrRes);
|
||||
DWORD sz = SizeofResource(hInst, hrRes);
|
||||
void* ptrRes = LockResource(hGlobal);
|
||||
|
||||
CFile oFile;
|
||||
oFile.CreateFile(strDstFile);
|
||||
oFile.WriteFile(ptrRes, sz);
|
||||
|
||||
UnlockResource(hGlobal);
|
||||
FreeResource(hGlobal);
|
||||
}
|
||||
};
|
||||
|
||||
void comLoadTheme(void* pArg, int nIndex, CString& strDstFolder)
|
||||
{
|
||||
CAVSOfficePPTXFile* pCAVSOfficePPTXFile = static_cast<CAVSOfficePPTXFile*>(pArg);
|
||||
HINSTANCE hInst = _AtlBaseModule.GetModuleInstance();
|
||||
|
||||
CString strThemeNotes = _T("");
|
||||
strThemeNotes.Format(_T("\\ppt\\theme\\theme%d.xml"), nIndex);
|
||||
pCAVSOfficePPTXFile->LoadResourceFile(hInst, MAKEINTRESOURCE(IDB_XML_NOTESTHEME), _T("PPTXW"), strDstFolder + strThemeNotes);
|
||||
|
||||
CDirectory::CreateDirectory(strDstFolder + _T("\\ppt\\notesMasters"));
|
||||
pCAVSOfficePPTXFile->LoadResourceFile(hInst, MAKEINTRESOURCE(IDB_XML_NOTESMASTER), _T("PPTXW"), strDstFolder + _T("\\ppt\\notesMasters\\notesMaster1.xml"));
|
||||
|
||||
CDirectory::CreateDirectory(strDstFolder + _T("\\ppt\\notesMasters\\_rels"));
|
||||
CString strThemeNotesNum = _T("");
|
||||
strThemeNotesNum.Format(_T("%d"), nIndex);
|
||||
CString strVal = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
|
||||
<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\
|
||||
<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"../theme/theme") + strThemeNotesNum + _T(".xml\"/></Relationships>");
|
||||
CFile oFileRels;
|
||||
oFileRels.CreateFile(strDstFolder + _T("\\ppt\\notesMasters\\_rels\\notesMaster1.xml.rels"));
|
||||
oFileRels.WriteStringUTF8(strVal);
|
||||
oFileRels.CloseFile();
|
||||
}
|
||||
bool comExtractFile(void* pArg, CString& sFile, CString& sDir)
|
||||
{
|
||||
OfficeUtils::IOfficeUtils* pOfficeUtils = NULL;
|
||||
|
||||
if (S_OK != CoCreateInstance(__uuidof(OfficeUtils::COfficeUtils), NULL, CLSCTX_INPROC_SERVER, __uuidof(OfficeUtils::IOfficeUtils),(void**)&pOfficeUtils))
|
||||
return false;
|
||||
|
||||
BSTR bsFile = sFile.AllocSysString();
|
||||
BSTR bsDir = sDir.AllocSysString();
|
||||
HRESULT hr = pOfficeUtils->ExtractToDirectory( bsFile, bsDir, NULL, 0);
|
||||
SysFreeString(bsFile);
|
||||
SysFreeString(bsDir);
|
||||
if(hr != S_OK)
|
||||
return false;
|
||||
|
||||
RELEASEINTERFACE(pOfficeUtils);
|
||||
return true;
|
||||
}
|
||||
bool comCompressFile(void* pArg, CString& sDir, CString& sFile)
|
||||
{
|
||||
OfficeUtils::IOfficeUtils* pOfficeUtils = NULL;
|
||||
|
||||
if (S_OK != CoCreateInstance(__uuidof(OfficeUtils::COfficeUtils), NULL, CLSCTX_INPROC_SERVER, __uuidof(OfficeUtils::IOfficeUtils),(void**)&pOfficeUtils))
|
||||
return false;
|
||||
|
||||
BSTR bsDir = sDir.AllocSysString();
|
||||
BSTR bsFile = sFile.AllocSysString();
|
||||
HRESULT hr = pOfficeUtils->CompressFileOrDirectory( bsDir, bsFile, -1 );
|
||||
SysFreeString(bsDir);
|
||||
SysFreeString(bsFile);
|
||||
if(hr != S_OK)
|
||||
return false;
|
||||
|
||||
RELEASEINTERFACE(pOfficeUtils);
|
||||
return true;
|
||||
}
|
||||
bool comProgress(void* pArg, long ID, long Percent)
|
||||
{
|
||||
CAVSOfficePPTXFile* pCAVSOfficePPTXFile = static_cast<CAVSOfficePPTXFile*>(pArg);
|
||||
SHORT res = 0;
|
||||
pCAVSOfficePPTXFile->OnProgressEx(ID, Percent, &res);
|
||||
return (res != 0);
|
||||
}
|
||||
396
ASCOfficePPTXFile/ASCOfficePPTXFileRealization.cpp
Normal file
396
ASCOfficePPTXFile/ASCOfficePPTXFileRealization.cpp
Normal file
@ -0,0 +1,396 @@
|
||||
#include "stdafx.h"
|
||||
#include "ASCOfficePPTXFile.h"
|
||||
|
||||
#include "PPTXFormat/PPTXEvent.h"
|
||||
#include "../../../../Common/GdiPlusEx.h"
|
||||
|
||||
#include <shellapi.h>
|
||||
#include <shlobj.h>
|
||||
#include <shlwapi.h>
|
||||
#pragma comment( lib, "shell32.lib" ) // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> shell32.lib
|
||||
|
||||
#include "Editor\PPTXWriter.h"
|
||||
|
||||
CPPTXFile::CPPTXFile(load_from_resource fCallbackResource, extract_to_directory fCallbackExtract, compress_from_directory fCallbackCompress, progress_operation fCallbackProgress, void* pCallbackArg)
|
||||
{
|
||||
WCHAR buffer[4096];
|
||||
GetTempPathW(4096, buffer);
|
||||
m_strTempDir = CStringW(buffer);
|
||||
GetLongPathNameW(m_strTempDir.GetString(), buffer, 4096);
|
||||
m_strTempDir = CStringW(buffer) + CStringW("_PPTX\\");
|
||||
|
||||
//
|
||||
m_strFontDirectory = _T("");
|
||||
m_strMediaDirectory = _T("");
|
||||
m_bIsUseSystemFonts = FALSE;
|
||||
m_strEmbeddedFontsDirectory = _T("");
|
||||
|
||||
m_strFolderThemes = _T("");
|
||||
|
||||
m_fCallbackResource = fCallbackResource;
|
||||
m_fCallbackExtract = fCallbackExtract;
|
||||
m_fCallbackCompress = fCallbackCompress;
|
||||
m_fCallbackProgress = fCallbackProgress;
|
||||
m_pCallbackArg = pCallbackArg;
|
||||
|
||||
m_pFolder = NULL;
|
||||
//m_pOfficeUtils = NULL;
|
||||
|
||||
//if (S_OK != CoCreateInstance(__uuidof(OfficeUtils::COfficeUtils), NULL, CLSCTX_INPROC_SERVER, __uuidof(OfficeUtils::IOfficeUtils),(void**)&m_pOfficeUtils))
|
||||
// return S_FALSE;
|
||||
|
||||
m_pInit = new CGdiPlusInit();
|
||||
m_pInit->Init();
|
||||
}
|
||||
CPPTXFile::~CPPTXFile()
|
||||
{
|
||||
RELEASEOBJECT(m_pFolder);
|
||||
RELEASEOBJECT(m_pInit);
|
||||
}
|
||||
HRESULT CPPTXFile::LoadFromFile(BSTR sSrcFileName, BSTR sDstPath, BSTR sXMLOptions)
|
||||
{
|
||||
CStringW localTempDir(sDstPath);
|
||||
if((sDstPath != NULL) || (localTempDir != ""))
|
||||
{
|
||||
int res = SHCreateDirectoryExW(NULL, localTempDir.GetString(), NULL);
|
||||
if((res != ERROR_SUCCESS) && (res != ERROR_ALREADY_EXISTS) && (res != ERROR_FILE_EXISTS))
|
||||
return S_FALSE;
|
||||
put_TempDirectory(sDstPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
int res = SHCreateDirectoryExW(NULL, m_strTempDir, NULL);
|
||||
if((res != ERROR_SUCCESS) && (res != ERROR_ALREADY_EXISTS) && (res != ERROR_FILE_EXISTS))
|
||||
return S_FALSE;
|
||||
}
|
||||
localTempDir = m_strTempDir;
|
||||
|
||||
/*
|
||||
SHFILEOPSTRUCTW shfos;
|
||||
ZeroMemory(&shfos, sizeof(shfos));
|
||||
shfos.wFunc = FO_DELETE;
|
||||
CStringW _local = localTempDir + CStringW(L"*.*");
|
||||
_local.AppendChar(0);
|
||||
_local.AppendChar(0);
|
||||
shfos.pFrom = _local.GetString();
|
||||
shfos.fFlags = FOF_SILENT + FOF_NOCONFIRMATION;
|
||||
if(SHFileOperationW(&shfos) != 0)
|
||||
return S_FALSE;
|
||||
*/
|
||||
|
||||
if(!m_fCallbackExtract(m_pCallbackArg, CString(sSrcFileName), localTempDir))
|
||||
return S_FALSE;
|
||||
|
||||
RELEASEOBJECT(m_pFolder);
|
||||
m_pFolder = new PPTX::Folder();
|
||||
|
||||
if(!m_pFolder->isValid(localTempDir))
|
||||
{
|
||||
RELEASEOBJECT(m_pFolder);
|
||||
return S_FALSE;
|
||||
}
|
||||
m_pFolder->read(localTempDir, (PPTX::IPPTXEvent*)this);
|
||||
if(GetPercent() < 1000000)
|
||||
{
|
||||
RELEASEOBJECT(m_pFolder);
|
||||
return S_FALSE;
|
||||
}
|
||||
smart_ptr<PPTX::Presentation> presentation = m_pFolder->get(PPTX::FileTypes::Presentation).smart_dynamic_cast<PPTX::Presentation>();
|
||||
if (!presentation.is_init())
|
||||
{
|
||||
RemoveDirOrFile(m_strTempDir, false);
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
m_strDirectory = (CString)sSrcFileName;
|
||||
int nIndex = m_strDirectory.ReverseFind(TCHAR('\\'));
|
||||
if (-1 != nIndex)
|
||||
m_strDirectory = m_strDirectory.Mid(0, nIndex);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CPPTXFile::SaveToFile(BSTR sDstFileName, BSTR sSrcPath, BSTR sXMLOptions)
|
||||
{
|
||||
if (NULL == m_pFolder)
|
||||
return S_FALSE;
|
||||
|
||||
OOX::CPath oPath;
|
||||
oPath.m_strFilename = CString(sSrcPath);
|
||||
m_pFolder->write(oPath);
|
||||
|
||||
return m_fCallbackCompress(m_pCallbackArg, CString(sSrcPath), CString(sDstFileName)) ? S_OK : S_FALSE;
|
||||
}
|
||||
HRESULT CPPTXFile::get_TempDirectory(BSTR* pVal)
|
||||
{
|
||||
*pVal = m_strTempDir.AllocSysString();
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CPPTXFile::put_TempDirectory(BSTR newVal)
|
||||
{
|
||||
CStringW TempStr(newVal);
|
||||
if(PathIsDirectoryW(TempStr.GetString()))
|
||||
{
|
||||
if(TempStr.Right(1) != L"\\")
|
||||
TempStr += L"\\";
|
||||
m_strTempDir = TempStr;
|
||||
return S_OK;
|
||||
}
|
||||
return S_FALSE;
|
||||
}
|
||||
HRESULT CPPTXFile::GetDVDXml(BSTR* pbstrPTTXml)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CPPTXFile::GetBluRayXml(BSTR* pbstrDVDXml)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CPPTXFile::get_DrawingXml(BSTR* pVal)
|
||||
{
|
||||
if ((NULL == m_pFolder) || (NULL == pVal))
|
||||
return S_FALSE;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CPPTXFile::SetAdditionalParam(BSTR ParamName, VARIANT ParamValue)
|
||||
{
|
||||
CString sParamName; sParamName = ParamName;
|
||||
if (_T("EmbeddedFontsDirectory") == sParamName && ParamValue.vt == VT_BSTR)
|
||||
{
|
||||
m_strEmbeddedFontsDirectory = ParamValue.bstrVal;
|
||||
return S_OK;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CPPTXFile::GetAdditionalParam(BSTR ParamName, VARIANT* ParamValue)
|
||||
{
|
||||
if (NULL == ParamValue)
|
||||
return S_FALSE;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
bool CPPTXFile::Progress(long ID, long Percent)
|
||||
{
|
||||
percent = Percent;
|
||||
return m_fCallbackProgress(m_pCallbackArg, ID, Percent);
|
||||
}
|
||||
|
||||
// to PPTY
|
||||
HRESULT CPPTXFile::SetMediaDir(BSTR bsMediaDir)
|
||||
{
|
||||
m_strMediaDirectory = bsMediaDir;
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CPPTXFile::SetFontDir(BSTR bsFontDir)
|
||||
{
|
||||
m_strFontDirectory = bsFontDir;
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CPPTXFile::SetThemesDir(BSTR bsDir)
|
||||
{
|
||||
m_strFolderThemes = bsDir;
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CPPTXFile::SetUseSystemFonts(VARIANT_BOOL useSystemFonts)
|
||||
{
|
||||
m_bIsUseSystemFonts = (VARIANT_TRUE == useSystemFonts);
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CPPTXFile::OpenFileToPPTY(BSTR bsInput, BSTR bsOutput)
|
||||
{
|
||||
int res = SHCreateDirectoryExW(NULL, m_strTempDir, NULL);
|
||||
if((res != ERROR_SUCCESS) && (res != ERROR_ALREADY_EXISTS) && (res != ERROR_FILE_EXISTS))
|
||||
return S_FALSE;
|
||||
|
||||
if(!m_fCallbackExtract(m_pCallbackArg, CString(bsInput), m_strTempDir))
|
||||
return S_FALSE;
|
||||
|
||||
RELEASEOBJECT(m_pFolder);
|
||||
m_pFolder = new PPTX::Folder();
|
||||
|
||||
if (!m_pFolder->isValid(m_strTempDir))
|
||||
{
|
||||
RELEASEOBJECT(m_pFolder);
|
||||
return S_FALSE;
|
||||
}
|
||||
m_pFolder->read(m_strTempDir, (PPTX::IPPTXEvent*)this);
|
||||
if(GetPercent() < 1000000)
|
||||
{
|
||||
RELEASEOBJECT(m_pFolder);
|
||||
return S_FALSE;
|
||||
}
|
||||
smart_ptr<PPTX::Presentation> presentation = m_pFolder->get(PPTX::FileTypes::Presentation).smart_dynamic_cast<PPTX::Presentation>();
|
||||
if (!presentation.is_init())
|
||||
{
|
||||
RemoveDirOrFile(m_strTempDir, false);
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
m_strDirectory = (CString)bsInput;
|
||||
int nIndex = m_strDirectory.ReverseFind(TCHAR('\\'));
|
||||
if (-1 != nIndex)
|
||||
m_strDirectory = m_strDirectory.Mid(0, nIndex);
|
||||
|
||||
NSBinPptxRW::CBinaryFileWriter oBinaryWriter;
|
||||
oBinaryWriter.m_oCommon.CheckFontPicker();
|
||||
oBinaryWriter.m_oCommon.m_pNativePicker->Init(m_strFontDirectory);
|
||||
|
||||
CString sDstFileOutput = bsOutput;
|
||||
m_strMediaDirectory = sDstFileOutput;
|
||||
nIndex = m_strMediaDirectory.ReverseFind(TCHAR('\\'));
|
||||
if (-1 != nIndex)
|
||||
m_strMediaDirectory = m_strMediaDirectory.Mid(0, nIndex);
|
||||
|
||||
oBinaryWriter.m_strMainFolder = m_strMediaDirectory;
|
||||
m_strMediaDirectory = m_strMediaDirectory + _T("\\media");
|
||||
oBinaryWriter.m_oCommon.m_oImageManager.m_strDstMedia = m_strMediaDirectory;
|
||||
|
||||
CDirectory::CreateDirectory(m_strMediaDirectory);
|
||||
|
||||
if (_T("") != m_strEmbeddedFontsDirectory)
|
||||
{
|
||||
CDirectory::CreateDirectory(m_strEmbeddedFontsDirectory);
|
||||
|
||||
if (NULL != oBinaryWriter.m_oCommon.m_pFontPicker)
|
||||
{
|
||||
oBinaryWriter.m_oCommon.m_pNativePicker->m_bIsEmbeddedFonts = TRUE;
|
||||
oBinaryWriter.m_oCommon.m_pNativePicker->m_oEmbeddedFonts.m_strEmbeddedFontsFolder = m_strEmbeddedFontsDirectory;
|
||||
}
|
||||
}
|
||||
|
||||
PPTX2EditorAdvanced::Convert(oBinaryWriter, *m_pFolder, m_strDirectory, sDstFileOutput);
|
||||
|
||||
return S_OK;
|
||||
|
||||
}
|
||||
HRESULT CPPTXFile::OpenDirectoryToPPTY(BSTR bsInput, BSTR bsOutput)
|
||||
{
|
||||
RELEASEOBJECT(m_pFolder);
|
||||
m_pFolder = new PPTX::Folder();
|
||||
|
||||
if (!m_pFolder->isValid((CString)bsInput))
|
||||
{
|
||||
RELEASEOBJECT(m_pFolder);
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
m_pFolder->read((CString)bsInput, (PPTX::IPPTXEvent*)this);
|
||||
if(GetPercent() < 1000000)
|
||||
{
|
||||
RELEASEOBJECT(m_pFolder);
|
||||
return S_FALSE;
|
||||
}
|
||||
smart_ptr<PPTX::Presentation> presentation = m_pFolder->get(PPTX::FileTypes::Presentation).smart_dynamic_cast<PPTX::Presentation>();
|
||||
if (!presentation.is_init())
|
||||
{
|
||||
RemoveDirOrFile(m_strTempDir, false);
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
m_strDirectory = (CString)bsInput;
|
||||
int nIndex = m_strDirectory.ReverseFind(TCHAR('\\'));
|
||||
if (-1 != nIndex)
|
||||
m_strDirectory = m_strDirectory.Mid(0, nIndex);
|
||||
|
||||
NSBinPptxRW::CBinaryFileWriter oBinaryWriter;
|
||||
oBinaryWriter.m_oCommon.CheckFontPicker();
|
||||
oBinaryWriter.m_oCommon.m_pNativePicker->Init(m_strFontDirectory);
|
||||
|
||||
CString sDstFileOutput = (CString)bsOutput;
|
||||
m_strMediaDirectory = sDstFileOutput;
|
||||
nIndex = m_strMediaDirectory.ReverseFind(TCHAR('\\'));
|
||||
if (-1 != nIndex)
|
||||
m_strMediaDirectory = m_strMediaDirectory.Mid(0, nIndex);
|
||||
|
||||
oBinaryWriter.m_strMainFolder = m_strMediaDirectory;
|
||||
m_strMediaDirectory = m_strMediaDirectory + _T("\\media");
|
||||
oBinaryWriter.m_oCommon.m_oImageManager.m_strDstMedia = m_strMediaDirectory;
|
||||
|
||||
CDirectory::CreateDirectory(m_strMediaDirectory);
|
||||
|
||||
PPTX2EditorAdvanced::Convert(oBinaryWriter, *m_pFolder, m_strDirectory, sDstFileOutput);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CPPTXFile::ConvertPPTYToPPTX(BSTR bsInput, BSTR bsOutput)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_strTempDir = _T("C:\\PPTMemory\\PPTX_test");
|
||||
#endif
|
||||
|
||||
int len = m_strTempDir.GetLength();
|
||||
while (len != 0 && m_strTempDir[len - 1] == (TCHAR)'\\')
|
||||
{
|
||||
m_strTempDir.Delete(len - 1);
|
||||
--len;
|
||||
}
|
||||
|
||||
NSBinPptxRW::CPPTXWriter oWriter(m_fCallbackResource, m_pCallbackArg);
|
||||
oWriter.Init(m_strTempDir);
|
||||
|
||||
CFile oFileBinary;
|
||||
oFileBinary.OpenFile((CString)bsInput);
|
||||
LONG lFileSize = (LONG)oFileBinary.GetFileSize();
|
||||
BYTE* pSrcBuffer = new BYTE[lFileSize];
|
||||
oFileBinary.ReadFile(pSrcBuffer, (DWORD)lFileSize);
|
||||
oFileBinary.CloseFile();
|
||||
CString srcFolder = CDirectory::GetFolderPath((CString)bsInput);
|
||||
oWriter.OpenPPTY(pSrcBuffer, lFileSize, srcFolder, m_strFolderThemes);
|
||||
RELEASEARRAYOBJECTS(pSrcBuffer);
|
||||
|
||||
HRESULT hRes = m_fCallbackCompress(m_pCallbackArg, m_strTempDir, CString(bsOutput)) ? S_OK : S_FALSE;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
RemoveDirOrFile(m_strTempDir);
|
||||
|
||||
return hRes;
|
||||
}
|
||||
INT32 CPPTXFile::RemoveDirOrFile(CString sPath, bool bIsRemoveHead)
|
||||
{
|
||||
DWORD dwFileAttrib = ::GetFileAttributes( sPath );
|
||||
if( dwFileAttrib != INVALID_FILE_ATTRIBUTES )
|
||||
{
|
||||
DWORD dwResult = 0;
|
||||
if( 0 != (FILE_ATTRIBUTE_DIRECTORY & dwFileAttrib) )
|
||||
{
|
||||
HANDLE Handle;
|
||||
WIN32_FIND_DATA FindData;
|
||||
DWORDLONG Result = 0;
|
||||
|
||||
Handle = FindFirstFile( ( sPath + _T("\\*.*") ), &FindData );
|
||||
if ( Handle == INVALID_HANDLE_VALUE )
|
||||
return 0;
|
||||
do
|
||||
{
|
||||
BOOL bRes = TRUE;
|
||||
if( ( CString( FindData.cFileName ) != _T(".") ) && ( CString( FindData.cFileName ) != _T("..") ) )
|
||||
if( FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY )
|
||||
Result += RemoveDirOrFile( sPath + _T("\\") + FindData.cFileName ); //
|
||||
else
|
||||
bRes = DeleteFile( sPath + _T("\\") + FindData.cFileName );
|
||||
if( FALSE == bRes )
|
||||
dwResult += 1;
|
||||
}
|
||||
while( FindNextFile( Handle, &FindData ) != 0 );
|
||||
FindClose( Handle );
|
||||
|
||||
if (bIsRemoveHead)
|
||||
{
|
||||
BOOL bRes = RemoveDirectory( sPath );
|
||||
if( FALSE == bRes )
|
||||
dwResult += 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( FALSE == DeleteFile( sPath ) )
|
||||
dwResult = 1;
|
||||
}
|
||||
|
||||
return dwResult;
|
||||
}// 0 - <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
return 0;
|
||||
}
|
||||
@ -398,7 +398,7 @@ namespace NSBinPptxRW
|
||||
IUnknown* m_pMainDocument;
|
||||
|
||||
smart_ptr<PPTX::FileContainer> ThemeDoc;
|
||||
smart_ptr<OOX::WritingElement> ClrMapDoc;
|
||||
smart_ptr<PPTX::WritingElement> ClrMapDoc;
|
||||
|
||||
private:
|
||||
BYTE* m_pStreamData;
|
||||
@ -1221,7 +1221,6 @@ namespace NSBinPptxRW
|
||||
SAFEARRAY* m_pSourceArray;
|
||||
|
||||
LONG m_lDocumentType;
|
||||
IUnknown* m_pDrawingConverter;
|
||||
|
||||
CRelsGenerator* m_pRels;
|
||||
CAtlArray<CRelsGenerator*> m_stackRels;
|
||||
@ -1239,7 +1238,6 @@ namespace NSBinPptxRW
|
||||
m_strContentTypes = _T("");
|
||||
|
||||
m_lDocumentType = XMLWRITER_DOC_TYPE_PPTX;
|
||||
m_pDrawingConverter = NULL;
|
||||
|
||||
m_pRels = new CRelsGenerator();
|
||||
m_nCurrentRelsStack = -1;
|
||||
|
||||
@ -20,7 +20,7 @@ namespace PPTX2EditorAdvanced
|
||||
CAtlArray<smart_ptr<PPTX::NotesSlide>> _notes;
|
||||
CAtlArray<smart_ptr<PPTX::NotesMaster>> _notesMasters;
|
||||
|
||||
smart_ptr<PPTX::Presentation> presentation = oFolder.get(OOX::FileTypes::Presentation).smart_dynamic_cast<PPTX::Presentation>();
|
||||
smart_ptr<PPTX::Presentation> presentation = oFolder.get(PPTX::FileTypes::Presentation).smart_dynamic_cast<PPTX::Presentation>();
|
||||
int cx = presentation->sldSz->cx;
|
||||
int cy = presentation->sldSz->cy;
|
||||
|
||||
@ -173,7 +173,7 @@ namespace PPTX2EditorAdvanced
|
||||
oBinaryWriter.WriteULONG(0);
|
||||
|
||||
// App
|
||||
smart_ptr<PPTX::App> app = oFolder.get(OOX::FileTypes::App).smart_dynamic_cast<PPTX::App>();
|
||||
smart_ptr<PPTX::App> app = oFolder.get(PPTX::FileTypes::App).smart_dynamic_cast<PPTX::App>();
|
||||
if (app.is_init())
|
||||
{
|
||||
oBinaryWriter.StartMainRecord(NSMainTables::App);
|
||||
@ -181,7 +181,7 @@ namespace PPTX2EditorAdvanced
|
||||
}
|
||||
|
||||
// Core
|
||||
smart_ptr<PPTX::Core> core = oFolder.get(OOX::FileTypes::Core).smart_dynamic_cast<PPTX::Core>();
|
||||
smart_ptr<PPTX::Core> core = oFolder.get(PPTX::FileTypes::Core).smart_dynamic_cast<PPTX::Core>();
|
||||
if (core.is_init())
|
||||
{
|
||||
oBinaryWriter.StartMainRecord(NSMainTables::Core);
|
||||
@ -189,7 +189,7 @@ namespace PPTX2EditorAdvanced
|
||||
}
|
||||
|
||||
// ViewProps
|
||||
smart_ptr<PPTX::ViewProps> viewProps = presentation->get(OOX::FileTypes::ViewProps).smart_dynamic_cast<PPTX::ViewProps>();
|
||||
smart_ptr<PPTX::ViewProps> viewProps = presentation->get(PPTX::FileTypes::ViewProps).smart_dynamic_cast<PPTX::ViewProps>();
|
||||
if (viewProps.is_init())
|
||||
{
|
||||
oBinaryWriter.StartMainRecord(NSMainTables::ViewProps);
|
||||
@ -197,7 +197,7 @@ namespace PPTX2EditorAdvanced
|
||||
}
|
||||
|
||||
// TableStyles
|
||||
smart_ptr<PPTX::TableStyles> tablestyles = presentation->get(OOX::FileTypes::TableStyles).smart_dynamic_cast<PPTX::TableStyles>();
|
||||
smart_ptr<PPTX::TableStyles> tablestyles = presentation->get(PPTX::FileTypes::TableStyles).smart_dynamic_cast<PPTX::TableStyles>();
|
||||
if (tablestyles.is_init())
|
||||
{
|
||||
oBinaryWriter.StartMainRecord(NSMainTables::TableStyles);
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
#pragma once
|
||||
#include "Converter.h"
|
||||
|
||||
typedef void (*load_from_resource)(void*, int, CString&);
|
||||
|
||||
namespace NSBinPptxRW
|
||||
{
|
||||
class CPPTXWriter
|
||||
@ -37,13 +39,17 @@ namespace NSBinPptxRW
|
||||
|
||||
BOOL m_bIsDefaultNoteMaster;
|
||||
PPTX::NotesSlide m_oDefaultNote;
|
||||
|
||||
|
||||
load_from_resource m_fCallback;
|
||||
void* m_pCallbackArg;
|
||||
public:
|
||||
|
||||
CPPTXWriter()
|
||||
CPPTXWriter(load_from_resource fCallback, void* pCallbackArg)
|
||||
{
|
||||
m_strDstFolder = _T("");
|
||||
m_bIsDefaultNoteMaster = TRUE;
|
||||
m_fCallback = fCallback;
|
||||
m_pCallbackArg = pCallbackArg;
|
||||
}
|
||||
~CPPTXWriter()
|
||||
{
|
||||
@ -909,25 +915,7 @@ namespace NSBinPptxRW
|
||||
}
|
||||
void CreateDefaultNotesMasters(int nIndexTheme)
|
||||
{
|
||||
HINSTANCE hInst = _AtlBaseModule.GetModuleInstance();
|
||||
|
||||
CString strThemeNotes = _T("");
|
||||
strThemeNotes.Format(_T("\\ppt\\theme\\theme%d.xml"), (int)m_arThemes.GetCount() + 1);
|
||||
LoadResourceFile(hInst, MAKEINTRESOURCE(IDB_XML_NOTESTHEME), _T("PPTXW"), m_strDstFolder + strThemeNotes);
|
||||
|
||||
CDirectory::CreateDirectory(m_strDstFolder + _T("\\ppt\\notesMasters"));
|
||||
LoadResourceFile(hInst, MAKEINTRESOURCE(IDB_XML_NOTESMASTER), _T("PPTXW"), m_strDstFolder + _T("\\ppt\\notesMasters\\notesMaster1.xml"));
|
||||
|
||||
CDirectory::CreateDirectory(m_strDstFolder + _T("\\ppt\\notesMasters\\_rels"));
|
||||
CString strThemeNotesNum = _T("");
|
||||
strThemeNotesNum.Format(_T("%d"), (int)m_arThemes.GetCount() + 1);
|
||||
CString strVal = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
|
||||
<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\
|
||||
<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"../theme/theme") + strThemeNotesNum + _T(".xml\"/></Relationships>");
|
||||
CFile oFileRels;
|
||||
oFileRels.CreateFile(m_strDstFolder + _T("\\ppt\\notesMasters\\_rels\\notesMaster1.xml.rels"));
|
||||
oFileRels.WriteStringUTF8(strVal);
|
||||
oFileRels.CloseFile();
|
||||
m_fCallback(m_pCallbackArg, nIndexTheme, m_strDstFolder);
|
||||
}
|
||||
void CreateDefaultNote()
|
||||
{
|
||||
@ -977,25 +965,5 @@ namespace NSBinPptxRW
|
||||
|
||||
m_oDefaultNote.clrMapOvr = new PPTX::Logic::ClrMapOvr();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
void LoadResourceFile(HINSTANCE hInst, LPCTSTR sResName, LPCTSTR sResType, const CString& strDstFile)
|
||||
{
|
||||
HRSRC hrRes = FindResource(hInst, sResName, sResType);
|
||||
if (!hrRes)
|
||||
return;
|
||||
|
||||
HGLOBAL hGlobal = LoadResource(hInst, hrRes);
|
||||
DWORD sz = SizeofResource(hInst, hrRes);
|
||||
void* ptrRes = LockResource(hGlobal);
|
||||
|
||||
CFile oFile;
|
||||
oFile.CreateFile(strDstFile);
|
||||
oFile.WriteFile(ptrRes, sz);
|
||||
|
||||
UnlockResource(hGlobal);
|
||||
FreeResource(hGlobal);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -80,11 +80,11 @@ namespace PPTX
|
||||
|
||||
Normalize();
|
||||
}
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::ContentTypes::File& content)const
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("xmlns"), OOX::g_Namespaces.xmlns.m_strLink);
|
||||
oAttr.Write(_T("xmlns:vt"), OOX::g_Namespaces.vt.m_strLink);
|
||||
oAttr.Write(_T("xmlns"), PPTX::g_Namespaces.xmlns.m_strLink);
|
||||
oAttr.Write(_T("xmlns:vt"), PPTX::g_Namespaces.vt.m_strLink);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.Write2(_T("Template"), Template);
|
||||
@ -144,9 +144,9 @@ namespace PPTX
|
||||
}
|
||||
|
||||
public:
|
||||
virtual const OOX::FileType type() const
|
||||
virtual const PPTX::FileType type() const
|
||||
{
|
||||
return OOX::FileTypes::App;
|
||||
return PPTX::FileTypes::App;
|
||||
}
|
||||
virtual const OOX::CPath DefaultDirectory() const
|
||||
{
|
||||
@ -192,8 +192,8 @@ namespace PPTX
|
||||
|
||||
pWriter->StartAttributes();
|
||||
|
||||
pWriter->WriteAttribute(_T("xmlns"), OOX::g_Namespaces.xmlns.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:vt"), OOX::g_Namespaces.vt.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns"), PPTX::g_Namespaces.xmlns.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:vt"), PPTX::g_Namespaces.vt.m_strLink);
|
||||
|
||||
pWriter->EndAttributes();
|
||||
|
||||
|
||||
@ -140,14 +140,14 @@ namespace PPTX
|
||||
m_arAuthors[m_arAuthors.GetCount() - 1].fromXML(oCm);
|
||||
}
|
||||
}
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::ContentTypes::File& content)const
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
virtual const OOX::FileType type() const
|
||||
virtual const PPTX::FileType type() const
|
||||
{
|
||||
return OOX::FileTypes::CommentAuthors;
|
||||
return PPTX::FileTypes::CommentAuthors;
|
||||
}
|
||||
virtual const OOX::CPath DefaultDirectory() const
|
||||
{
|
||||
@ -169,9 +169,9 @@ namespace PPTX
|
||||
pWriter->StartNode(_T("p:cmAuthorLst"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), OOX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:r"), OOX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:p"), OOX::g_Namespaces.p.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:r"), PPTX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:p"), PPTX::g_Namespaces.p.m_strLink);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->WriteArray2(m_arAuthors);
|
||||
|
||||
@ -292,14 +292,14 @@ namespace PPTX
|
||||
m_arComments[m_arComments.GetCount() - 1].fromXML(oCm);
|
||||
}
|
||||
}
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::ContentTypes::File& content)const
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
virtual const OOX::FileType type() const
|
||||
virtual const PPTX::FileType type() const
|
||||
{
|
||||
return OOX::FileTypes::SlideComments;
|
||||
return PPTX::FileTypes::SlideComments;
|
||||
}
|
||||
virtual const OOX::CPath DefaultDirectory() const
|
||||
{
|
||||
@ -321,9 +321,9 @@ namespace PPTX
|
||||
pWriter->StartNode(_T("p:cmLst"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), OOX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:r"), OOX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:p"), OOX::g_Namespaces.p.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:r"), PPTX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:p"), PPTX::g_Namespaces.p.m_strLink);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->WriteArray2(m_arComments);
|
||||
|
||||
@ -39,8 +39,8 @@ namespace PPTX
|
||||
oNode.ReadNodeValueBase(_T("dcterms:modified"), modified);
|
||||
oNode.ReadNodeValueBase(_T("dcterms:created"), created);
|
||||
|
||||
// created = OOX::DateTime::Parse(document.Root.element("created").text().ToString());
|
||||
// modified = OOX::DateTime::Parse(document.Root.element("modified").text().ToString());
|
||||
// created = PPTX::DateTime::Parse(document.Root.element("created").text().ToString());
|
||||
// modified = PPTX::DateTime::Parse(document.Root.element("modified").text().ToString());
|
||||
/*
|
||||
category = document.Root.element("category").text();
|
||||
contentStatus = document.Root.element("contentStatus").text();
|
||||
@ -48,18 +48,18 @@ namespace PPTX
|
||||
//identifier - ???
|
||||
// keywords = document.Root.element("keywords").text();
|
||||
language = document.Root.element("language").text();
|
||||
// lastPrinted = OOX::DateTime::Parse(document.Root.element("lastPrinted").text().ToString());
|
||||
// lastPrinted = PPTX::DateTime::Parse(document.Root.element("lastPrinted").text().ToString());
|
||||
subject = document.Root.element("subject").text();
|
||||
version = document.Root.element("version").text();
|
||||
*/
|
||||
}
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::ContentTypes::File& content)const
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("xmlns:dc"), OOX::g_Namespaces.dc.m_strLink);
|
||||
//oAttr.Write(_T("xmlns:cp"), OOX::g_Namespaces.cp.m_strLink);
|
||||
oAttr.Write(_T("xmlns:dcterms"), OOX::g_Namespaces.dcterms.m_strLink);
|
||||
oAttr.Write(_T("xmlns:xsi"), OOX::g_Namespaces.xsi.m_strLink);
|
||||
oAttr.Write(_T("xmlns:dc"), PPTX::g_Namespaces.dc.m_strLink);
|
||||
//oAttr.Write(_T("xmlns:cp"), PPTX::g_Namespaces.cp.m_strLink);
|
||||
oAttr.Write(_T("xmlns:dcterms"), PPTX::g_Namespaces.dcterms.m_strLink);
|
||||
oAttr.Write(_T("xmlns:xsi"), PPTX::g_Namespaces.xsi.m_strLink);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.Write2(_T("dc:title"), title);
|
||||
@ -113,9 +113,9 @@ namespace PPTX
|
||||
}
|
||||
|
||||
public:
|
||||
virtual const OOX::FileType type() const
|
||||
virtual const PPTX::FileType type() const
|
||||
{
|
||||
return OOX::FileTypes::Core;
|
||||
return PPTX::FileTypes::Core;
|
||||
}
|
||||
virtual const OOX::CPath DefaultDirectory() const
|
||||
{
|
||||
@ -149,10 +149,10 @@ namespace PPTX
|
||||
|
||||
pWriter->StartAttributes();
|
||||
|
||||
pWriter->WriteAttribute(_T("xmlns:cp"), OOX::g_Namespaces.cp.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:dc"), OOX::g_Namespaces.dc.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:dcterms"), OOX::g_Namespaces.dcterms.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:xsi"), OOX::g_Namespaces.xsi.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:cp"), PPTX::g_Namespaces.cp.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:dc"), PPTX::g_Namespaces.dc.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:dcterms"), PPTX::g_Namespaces.dcterms.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:xsi"), PPTX::g_Namespaces.xsi.m_strLink);
|
||||
|
||||
pWriter->EndAttributes();
|
||||
|
||||
@ -172,9 +172,9 @@ namespace PPTX
|
||||
nullable_string creator;
|
||||
nullable_string lastModifiedBy;
|
||||
nullable_string revision;
|
||||
// nullable_property<OOX::DateTime> created;
|
||||
// nullable_property<PPTX::DateTime> created;
|
||||
nullable_string created;
|
||||
// nullable_property<OOX::DateTime> modified;
|
||||
// nullable_property<PPTX::DateTime> modified;
|
||||
nullable_string modified;
|
||||
/*
|
||||
nullable_property<std::string> category;
|
||||
@ -183,7 +183,7 @@ namespace PPTX
|
||||
//identifier - ???
|
||||
// nullable_property<std::string> keywords;
|
||||
nullable_property<std::string> language;
|
||||
nullable_property<OOX::DateTime> lastPrinted;
|
||||
nullable_property<PPTX::DateTime> lastPrinted;
|
||||
nullable_property<std::string> subject;
|
||||
nullable_property<std::string> version;
|
||||
*/
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
#include "./../WritingElement.h"
|
||||
#include "ExtensionTable.h"
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
namespace ContentTypes
|
||||
{
|
||||
@ -62,6 +62,6 @@ namespace OOX
|
||||
CString m_extension;
|
||||
};
|
||||
} // namespace ContentTypes
|
||||
} // namespace OOX
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // OOX_CONTENT_TYPES_DEFAULT_INCLUDE_H_
|
||||
@ -6,7 +6,7 @@
|
||||
#include "Default.h"
|
||||
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
namespace ContentTypes
|
||||
{
|
||||
@ -58,6 +58,6 @@ namespace OOX
|
||||
}
|
||||
};
|
||||
} // namespace ContentTypes
|
||||
} // namespace OOX
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // OOX_CONTENT)TYPES_DEFAULT_TABLE_INCLUDE_H_
|
||||
@ -5,7 +5,7 @@
|
||||
#include "../../../../Common/DocxFormat/Source/Base/Base.h"
|
||||
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
namespace ContentTypes
|
||||
{
|
||||
@ -56,6 +56,6 @@ namespace OOX
|
||||
CAtlMap<CString, CString> m_table;
|
||||
};
|
||||
} // namespace ContentTypes
|
||||
} // namespace OOX
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // OOX_CONTENT_TYPES_EXTENSION_TABLE_INCLUDE_H_
|
||||
@ -7,11 +7,11 @@
|
||||
#include "./../FileType.h"
|
||||
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
namespace ContentTypes
|
||||
{
|
||||
static const CPath s_filename = L"[Content_Types].xml";
|
||||
static const OOX::CPath s_filename = L"[Content_Types].xml";
|
||||
|
||||
class File
|
||||
{
|
||||
@ -19,7 +19,7 @@ namespace OOX
|
||||
File()
|
||||
{
|
||||
}
|
||||
File(const CPath& path)
|
||||
File(const OOX::CPath& path)
|
||||
{
|
||||
read(path);
|
||||
}
|
||||
@ -28,7 +28,7 @@ namespace OOX
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void read(const CPath& path)
|
||||
virtual void read(const OOX::CPath& path)
|
||||
{
|
||||
OOX::CPath oPath = path / s_filename;
|
||||
XmlUtils::CXmlNode oNode;
|
||||
@ -38,7 +38,7 @@ namespace OOX
|
||||
Override = oNode;
|
||||
}
|
||||
}
|
||||
virtual void write(const CPath& path) const
|
||||
virtual void write(const OOX::CPath& path) const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("xmlns"), _T("http://schemas.openxmlformats.org/package/2006/content-types"));
|
||||
@ -57,7 +57,7 @@ namespace OOX
|
||||
}
|
||||
|
||||
public:
|
||||
void registration(const CString& type, const CPath& directory, const CPath& filename)
|
||||
void registration(const CString& type, const OOX::CPath& directory, const OOX::CPath& filename)
|
||||
{
|
||||
Override.add(type, directory / filename.m_strFilename);
|
||||
Default.add(directory / filename.m_strFilename);
|
||||
@ -68,6 +68,6 @@ namespace OOX
|
||||
DefaultTable Default;
|
||||
};
|
||||
} // namespace ContentTypes
|
||||
} // namespace OOX
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // DOCX_CONTENT_TYPES_FILE_INCLUDE_H_
|
||||
@ -5,7 +5,7 @@
|
||||
#include "./../WritingElement.h"
|
||||
#include "../../../../Common/DocxFormat/Source/SystemUtility/SystemUtility.h"
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
namespace ContentTypes
|
||||
{
|
||||
@ -15,7 +15,7 @@ namespace OOX
|
||||
Override()
|
||||
{
|
||||
}
|
||||
Override(const CString& type, const CPath& path) : m_type(type), m_part(path)
|
||||
Override(const CString& type, const OOX::CPath& path) : m_type(type), m_part(path)
|
||||
{
|
||||
}
|
||||
virtual ~Override()
|
||||
@ -65,6 +65,6 @@ namespace OOX
|
||||
OOX::CPath m_part;
|
||||
};
|
||||
} // namespace ContentTypes
|
||||
} // namespace OOX
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // OOX_CONTENT_TYPES_OVERRIDE_INCLUDE_H_
|
||||
@ -5,7 +5,7 @@
|
||||
#include "./../WritingVector.h"
|
||||
#include "Override.h"
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
namespace ContentTypes
|
||||
{
|
||||
@ -41,6 +41,6 @@ namespace OOX
|
||||
}
|
||||
};
|
||||
} // namespace ContentTypes
|
||||
} // namespace OOX
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // OOX_CONTENT_TYPES_OVERRIDE_TABLE_INCLUDE_H_
|
||||
@ -5,7 +5,7 @@
|
||||
#include "../../../Common/DocxFormat/Source/Utility/Utility.h"
|
||||
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
class DateTime
|
||||
{
|
||||
@ -46,6 +46,6 @@ namespace OOX
|
||||
};
|
||||
|
||||
const CString DateTime::s_pattern = _T("%YYYY-%MM-%DDT%hh:%mm:%ssZ");
|
||||
} // namespace OOX
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // OOX_DATE_TIME_INCLUDE_H_
|
||||
@ -6,7 +6,7 @@
|
||||
#include "../FileTypes.h"
|
||||
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
class External : public File
|
||||
{
|
||||
@ -14,7 +14,7 @@ namespace OOX
|
||||
External()
|
||||
{
|
||||
}
|
||||
External(const CPath& uri)
|
||||
External(const OOX::CPath& uri)
|
||||
{
|
||||
read(uri);
|
||||
}
|
||||
@ -23,23 +23,23 @@ namespace OOX
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void read(const CPath& uri)
|
||||
virtual void read(const OOX::CPath& uri)
|
||||
{
|
||||
m_uri = uri;
|
||||
}
|
||||
virtual void write(const CPath& filename, const CPath& directory, ContentTypes::File& content) const
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, ContentTypes::File& content) const
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
AVSINLINE CPath Uri() const
|
||||
AVSINLINE OOX::CPath Uri() const
|
||||
{
|
||||
return m_uri;
|
||||
}
|
||||
|
||||
protected:
|
||||
CPath m_uri;
|
||||
OOX::CPath m_uri;
|
||||
};
|
||||
} // namespace OOX
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // OOX_EXTERNAL_INCLUDE_H_
|
||||
@ -5,7 +5,7 @@
|
||||
#include "External.h"
|
||||
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
class ExternalAudio : public External
|
||||
{
|
||||
@ -13,7 +13,7 @@ namespace OOX
|
||||
ExternalAudio()
|
||||
{
|
||||
}
|
||||
ExternalAudio(const CPath& uri)
|
||||
ExternalAudio(const OOX::CPath& uri)
|
||||
{
|
||||
read(uri);
|
||||
}
|
||||
@ -26,15 +26,15 @@ namespace OOX
|
||||
{
|
||||
return FileTypes::ExternalAudio;
|
||||
}
|
||||
virtual const CPath DefaultDirectory() const
|
||||
virtual const OOX::CPath DefaultDirectory() const
|
||||
{
|
||||
return type().DefaultDirectory();
|
||||
}
|
||||
virtual const CPath DefaultFileName() const
|
||||
virtual const OOX::CPath DefaultFileName() const
|
||||
{
|
||||
return type().DefaultFileName();
|
||||
}
|
||||
};
|
||||
} // namespace OOX
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // OOX_EXTERNALAUDIO_INCLUDE_H_
|
||||
@ -5,7 +5,7 @@
|
||||
#include "External.h"
|
||||
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
class ExternalImage : public External
|
||||
{
|
||||
@ -13,7 +13,7 @@ namespace OOX
|
||||
ExternalImage()
|
||||
{
|
||||
}
|
||||
ExternalImage(const CPath& uri)
|
||||
ExternalImage(const OOX::CPath& uri)
|
||||
{
|
||||
read(uri);
|
||||
}
|
||||
@ -26,15 +26,15 @@ namespace OOX
|
||||
{
|
||||
return FileTypes::ExternalImage;
|
||||
}
|
||||
virtual const CPath DefaultDirectory() const
|
||||
virtual const OOX::CPath DefaultDirectory() const
|
||||
{
|
||||
return type().DefaultDirectory();
|
||||
}
|
||||
virtual const CPath DefaultFileName() const
|
||||
virtual const OOX::CPath DefaultFileName() const
|
||||
{
|
||||
return type().DefaultFileName();
|
||||
}
|
||||
};
|
||||
} // namespace OOX
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // OOX_EXTERNALIMAGE_INCLUDE_H_
|
||||
@ -5,7 +5,7 @@
|
||||
#include "External.h"
|
||||
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
class ExternalVideo : public External
|
||||
{
|
||||
@ -13,7 +13,7 @@ namespace OOX
|
||||
ExternalVideo()
|
||||
{
|
||||
}
|
||||
ExternalVideo(const CPath& uri)
|
||||
ExternalVideo(const OOX::CPath& uri)
|
||||
{
|
||||
read(uri);
|
||||
}
|
||||
@ -26,15 +26,15 @@ namespace OOX
|
||||
{
|
||||
return FileTypes::ExternalVideo;
|
||||
}
|
||||
virtual const CPath DefaultDirectory() const
|
||||
virtual const OOX::CPath DefaultDirectory() const
|
||||
{
|
||||
return type().DefaultDirectory();
|
||||
}
|
||||
virtual const CPath DefaultFileName() const
|
||||
virtual const OOX::CPath DefaultFileName() const
|
||||
{
|
||||
return type().DefaultFileName();
|
||||
}
|
||||
};
|
||||
} // namespace OOX
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // OOX_EXTERNALVIDEO_INCLUDE_H_
|
||||
@ -5,7 +5,7 @@
|
||||
#include "External.h"
|
||||
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
class HyperLink : public External
|
||||
{
|
||||
@ -13,7 +13,7 @@ namespace OOX
|
||||
HyperLink()
|
||||
{
|
||||
}
|
||||
HyperLink(const CPath& uri)
|
||||
HyperLink(const OOX::CPath& uri)
|
||||
{
|
||||
read(uri);
|
||||
}
|
||||
@ -26,15 +26,15 @@ namespace OOX
|
||||
{
|
||||
return FileTypes::HyperLink;
|
||||
}
|
||||
virtual const CPath DefaultDirectory() const
|
||||
virtual const OOX::CPath DefaultDirectory() const
|
||||
{
|
||||
return type().DefaultDirectory();
|
||||
}
|
||||
virtual const CPath DefaultFileName() const
|
||||
virtual const OOX::CPath DefaultFileName() const
|
||||
{
|
||||
return type().DefaultFileName();
|
||||
}
|
||||
};
|
||||
} // namespace OOX
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // OOX_HYPERLINK_INCLUDE_H_
|
||||
@ -8,7 +8,7 @@
|
||||
#include "FileType.h"
|
||||
#include "ContentTypes/File.h"
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
class File
|
||||
{
|
||||
@ -17,14 +17,14 @@ namespace OOX
|
||||
virtual ~File(){}
|
||||
|
||||
public:
|
||||
virtual void read(const CPath& filename) = 0;
|
||||
virtual void write(const CPath& filename, const CPath& directory, ContentTypes::File& content) const = 0;
|
||||
virtual void read(const OOX::CPath& filename) = 0;
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, ContentTypes::File& content) const = 0;
|
||||
|
||||
public:
|
||||
virtual const OOX::FileType type() const = 0;
|
||||
virtual const CPath DefaultDirectory() const = 0;
|
||||
virtual const CPath DefaultFileName() const = 0;
|
||||
virtual const PPTX::FileType type() const = 0;
|
||||
virtual const OOX::CPath DefaultDirectory() const = 0;
|
||||
virtual const OOX::CPath DefaultFileName() const = 0;
|
||||
};
|
||||
} // namespace OOX
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // OOX_FILE_INCLUDE_H_
|
||||
@ -4,12 +4,12 @@
|
||||
|
||||
#include "../../../Common/DocxFormat/Source/SystemUtility/SystemUtility.h"
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
class FileType
|
||||
{
|
||||
public:
|
||||
FileType(const CPath& defaultDirectory, const CPath& defaultFileName,
|
||||
FileType(const OOX::CPath& defaultDirectory, const OOX::CPath& defaultFileName,
|
||||
const CString& overrideType,
|
||||
const CString& relationType) : m_defaultDirectory(defaultDirectory),
|
||||
m_defaultFileName(defaultFileName),
|
||||
@ -46,11 +46,11 @@ namespace OOX
|
||||
{
|
||||
return m_relationType;
|
||||
}
|
||||
inline const CPath DefaultDirectory() const
|
||||
inline const OOX::CPath DefaultDirectory() const
|
||||
{
|
||||
return m_defaultDirectory;
|
||||
}
|
||||
inline const CPath DefaultFileName() const
|
||||
inline const OOX::CPath DefaultFileName() const
|
||||
{
|
||||
return m_defaultFileName;
|
||||
}
|
||||
@ -58,8 +58,8 @@ namespace OOX
|
||||
private:
|
||||
CString m_overrideType;
|
||||
CString m_relationType;
|
||||
CPath m_defaultDirectory;
|
||||
CPath m_defaultFileName;
|
||||
OOX::CPath m_defaultDirectory;
|
||||
OOX::CPath m_defaultFileName;
|
||||
};
|
||||
|
||||
static const bool operator ==(const CString& type, const FileType& file)
|
||||
@ -70,6 +70,6 @@ namespace OOX
|
||||
{
|
||||
return (file.RelationType() == type);
|
||||
}
|
||||
} // namespace OOX
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // OOX_FILE_TYPE_INCLUDE_H_
|
||||
@ -5,7 +5,7 @@
|
||||
#include "FileType.h"
|
||||
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
namespace FileTypes
|
||||
{
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
#include "ContentTypes/File.h"
|
||||
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
class IFileBuilder
|
||||
{
|
||||
@ -14,8 +14,8 @@ namespace OOX
|
||||
virtual ~IFileBuilder();
|
||||
|
||||
public:
|
||||
virtual void Commit(const CPath& path) = 0;
|
||||
virtual void Finalize(const CPath& path, const CPath& directory, ContentTypes::File& content) = 0;
|
||||
virtual void Commit(const OOX::CPath& path) = 0;
|
||||
virtual void Finalize(const OOX::CPath& path, const OOX::CPath& directory, ContentTypes::File& content) = 0;
|
||||
};
|
||||
} // namespace OOX
|
||||
|
||||
|
||||
@ -16,54 +16,54 @@
|
||||
#include "FileTypes.h"
|
||||
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
UnknowTypeFile IFileContainer::unknow;
|
||||
|
||||
void IFileContainer::read(const CPath& filename)
|
||||
void IFileContainer::read(const OOX::CPath& filename)
|
||||
{
|
||||
OOX::Rels::File rels(filename);
|
||||
PPTX::Rels::File rels(filename);
|
||||
read(rels, filename.GetDirectory());
|
||||
}
|
||||
|
||||
|
||||
void IFileContainer::read(const Rels::File& rels, const CPath& path)
|
||||
void IFileContainer::read(const Rels::File& rels, const OOX::CPath& path)
|
||||
{
|
||||
#ifndef NODOCX
|
||||
/*BOOST_FOREACH(const OOX::Rels::RelationShip& relation, *rels.Relations)
|
||||
/*BOOST_FOREACH(const PPTX::Rels::RelationShip& relation, *rels.Relations)
|
||||
{
|
||||
add(relation.rId(), OOX::CreateFile(path, relation));
|
||||
add(relation.rId(), PPTX::CreateFile(path, relation));
|
||||
}*/
|
||||
|
||||
size_t nCount = rels.Relations.m_items.GetCount();
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
{
|
||||
add(rels.Relations.m_items[i].rId(), OOX::CreateFile(path, rels.Relations.m_items[i]));
|
||||
add(rels.Relations.m_items[i].rId(), PPTX::CreateFile(path, rels.Relations.m_items[i]));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void IFileContainer::write(const CPath& filename, const CPath& directory, ContentTypes::File& content) const
|
||||
void IFileContainer::write(const OOX::CPath& filename, const OOX::CPath& directory, ContentTypes::File& content) const
|
||||
{
|
||||
OOX::Rels::File rels;
|
||||
CPath current = filename.GetDirectory();
|
||||
PPTX::Rels::File rels;
|
||||
OOX::CPath current = filename.GetDirectory();
|
||||
write(rels, current, directory, content);
|
||||
rels.write(filename);
|
||||
}
|
||||
|
||||
|
||||
void IFileContainer::write(Rels::File& rels, const CPath& curdir, const CPath& directory, ContentTypes::File& content) const
|
||||
void IFileContainer::write(Rels::File& rels, const OOX::CPath& curdir, const OOX::CPath& directory, ContentTypes::File& content) const
|
||||
{
|
||||
CAtlMap<CString, size_t> namepair;
|
||||
|
||||
POSITION pos = m_container.GetStartPosition();
|
||||
while (NULL != pos)
|
||||
{
|
||||
const CAtlMap<CString, smart_ptr<OOX::File>>::CPair* pPair = m_container.GetNext(pos);
|
||||
const CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* pPair = m_container.GetNext(pos);
|
||||
|
||||
smart_ptr<OOX::File> pFile = pPair->m_value;
|
||||
smart_ptr<OOX::External> pExt = pFile.smart_dynamic_cast<OOX::External>();
|
||||
smart_ptr<PPTX::File> pFile = pPair->m_value;
|
||||
smart_ptr<PPTX::External> pExt = pFile.smart_dynamic_cast<PPTX::External>();
|
||||
|
||||
if (!pExt.IsInit())
|
||||
{
|
||||
@ -90,17 +90,17 @@ namespace OOX
|
||||
}
|
||||
|
||||
|
||||
void IFileContainer::Commit(const CPath& path)
|
||||
void IFileContainer::Commit(const OOX::CPath& path)
|
||||
{
|
||||
CAtlMap<CString, size_t> namepair;
|
||||
|
||||
POSITION pos = m_container.GetStartPosition();
|
||||
while (NULL != pos)
|
||||
{
|
||||
CAtlMap<CString, smart_ptr<OOX::File>>::CPair* pPair = m_container.GetNext(pos);
|
||||
CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* pPair = m_container.GetNext(pos);
|
||||
|
||||
smart_ptr<OOX::File> pFile = pPair->m_value;
|
||||
smart_ptr<OOX::External> pExt = pFile.smart_dynamic_cast<OOX::External>();
|
||||
smart_ptr<PPTX::File> pFile = pPair->m_value;
|
||||
smart_ptr<PPTX::External> pExt = pFile.smart_dynamic_cast<PPTX::External>();
|
||||
|
||||
if (!pExt.IsInit())
|
||||
{
|
||||
@ -115,7 +115,7 @@ namespace OOX
|
||||
|
||||
OOX::CSystemUtility::CreateDirectories(path / defdir);
|
||||
|
||||
smart_ptr<OOX::IFileBuilder> fileBuilder = pPair->m_value.smart_dynamic_cast<OOX::IFileBuilder>();
|
||||
smart_ptr<PPTX::IFileBuilder> fileBuilder = pPair->m_value.smart_dynamic_cast<PPTX::IFileBuilder>();
|
||||
if (fileBuilder.is_init())
|
||||
fileBuilder->Commit(path / defdir / name);
|
||||
}
|
||||
@ -123,10 +123,10 @@ namespace OOX
|
||||
}
|
||||
|
||||
|
||||
void IFileContainer::Finalize(const CPath& filename, const CPath& directory, ContentTypes::File& content)
|
||||
void IFileContainer::Finalize(const OOX::CPath& filename, const OOX::CPath& directory, ContentTypes::File& content)
|
||||
{
|
||||
OOX::Rels::File rels;
|
||||
CPath current = filename.GetDirectory();
|
||||
PPTX::Rels::File rels;
|
||||
OOX::CPath current = filename.GetDirectory();
|
||||
Finalize(rels, current, directory, content);
|
||||
rels.write(filename);
|
||||
}
|
||||
@ -139,10 +139,10 @@ namespace OOX
|
||||
POSITION pos = m_container.GetStartPosition();
|
||||
while (NULL != pos)
|
||||
{
|
||||
CAtlMap<CString, smart_ptr<OOX::File>>::CPair* pPair = m_container.GetNext(pos);
|
||||
CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* pPair = m_container.GetNext(pos);
|
||||
|
||||
smart_ptr<OOX::File> pFile = pPair->m_value;
|
||||
smart_ptr<OOX::External> pExt = pFile.smart_dynamic_cast<OOX::External>();
|
||||
smart_ptr<PPTX::File> pFile = pPair->m_value;
|
||||
smart_ptr<PPTX::External> pExt = pFile.smart_dynamic_cast<PPTX::External>();
|
||||
|
||||
if (!pExt.IsInit())
|
||||
{
|
||||
@ -157,7 +157,7 @@ namespace OOX
|
||||
|
||||
OOX::CSystemUtility::CreateDirectories(curdir / defdir);
|
||||
|
||||
smart_ptr<OOX::IFileBuilder> fileBuilder = pFile.smart_dynamic_cast<OOX::IFileBuilder>();
|
||||
smart_ptr<PPTX::IFileBuilder> fileBuilder = pFile.smart_dynamic_cast<PPTX::IFileBuilder>();
|
||||
|
||||
if ( fileBuilder.is_init() )
|
||||
{
|
||||
@ -183,7 +183,7 @@ namespace OOX
|
||||
POSITION pos = m_container.GetStartPosition();
|
||||
while (NULL != pos)
|
||||
{
|
||||
smart_ptr<OOX::File> pFile = m_container.GetNextValue(pos);
|
||||
smart_ptr<PPTX::File> pFile = m_container.GetNextValue(pos);
|
||||
|
||||
smart_ptr<Image> pImage = pFile.smart_dynamic_cast<Image>();
|
||||
if (pImage.is_init())
|
||||
@ -203,7 +203,7 @@ namespace OOX
|
||||
|
||||
smart_ptr<Image> IFileContainer::image(const RId& rId) const
|
||||
{
|
||||
const CAtlMap<CString, smart_ptr<OOX::File>>::CPair* pPair = m_container.Lookup(rId.get());
|
||||
const CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* pPair = m_container.Lookup(rId.get());
|
||||
if (NULL == pPair)
|
||||
return smart_ptr<Image>();
|
||||
return pPair->m_value.smart_dynamic_cast<Image>();
|
||||
@ -211,7 +211,7 @@ namespace OOX
|
||||
|
||||
smart_ptr<HyperLink> IFileContainer::hyperlink(const RId& rId) const
|
||||
{
|
||||
const CAtlMap<CString, smart_ptr<OOX::File>>::CPair* pPair = m_container.Lookup(rId.get());
|
||||
const CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* pPair = m_container.Lookup(rId.get());
|
||||
if (NULL == pPair)
|
||||
return smart_ptr<HyperLink>();
|
||||
return pPair->m_value.smart_dynamic_cast<HyperLink>();
|
||||
@ -219,7 +219,7 @@ namespace OOX
|
||||
|
||||
smart_ptr<OleObject> IFileContainer::oleObject(const RId& rId) const
|
||||
{
|
||||
const CAtlMap<CString, smart_ptr<OOX::File>>::CPair* pPair = m_container.Lookup(rId.get());
|
||||
const CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* pPair = m_container.Lookup(rId.get());
|
||||
if (NULL == pPair)
|
||||
return smart_ptr<OleObject>();
|
||||
return pPair->m_value.smart_dynamic_cast<OleObject>();
|
||||
@ -230,7 +230,7 @@ namespace OOX
|
||||
POSITION pos = m_container.GetStartPosition();
|
||||
while (NULL != pos)
|
||||
{
|
||||
const CAtlMap<CString, smart_ptr<OOX::File>>::CPair* pPair = m_container.GetNext(pos);
|
||||
const CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* pPair = m_container.GetNext(pos);
|
||||
if (type == pPair->m_value->type())
|
||||
return true;
|
||||
}
|
||||
@ -240,41 +240,41 @@ namespace OOX
|
||||
|
||||
const bool IFileContainer::exist(const RId& rId) const
|
||||
{
|
||||
const CAtlMap<CString, smart_ptr<OOX::File>>::CPair* pPair = m_container.Lookup(rId.get());
|
||||
const CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* pPair = m_container.Lookup(rId.get());
|
||||
return (NULL != pPair);
|
||||
}
|
||||
|
||||
|
||||
const bool IFileContainer::isExternal(const OOX::RId& rId) const
|
||||
const bool IFileContainer::isExternal(const PPTX::RId& rId) const
|
||||
{
|
||||
const CAtlMap<CString, smart_ptr<OOX::File>>::CPair* pPair = m_container.Lookup(rId.get());
|
||||
const CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* pPair = m_container.Lookup(rId.get());
|
||||
|
||||
if (NULL != pPair)
|
||||
{
|
||||
CString type = pPair->m_value->type().RelationType();
|
||||
CString name = pPair->m_value->type().DefaultFileName().m_strFilename;
|
||||
|
||||
return (((type == OOX::FileTypes::ExternalAudio.RelationType()) || (type == OOX::FileTypes::ExternalImage.RelationType())
|
||||
|| (type == OOX::FileTypes::ExternalVideo.RelationType())) && (name == _T("")));
|
||||
return (((type == PPTX::FileTypes::ExternalAudio.RelationType()) || (type == PPTX::FileTypes::ExternalImage.RelationType())
|
||||
|| (type == PPTX::FileTypes::ExternalVideo.RelationType())) && (name == _T("")));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
smart_ptr<OOX::File> IFileContainer::get(const FileType& type)
|
||||
smart_ptr<PPTX::File> IFileContainer::get(const FileType& type)
|
||||
{
|
||||
POSITION pos = m_container.GetStartPosition();
|
||||
while (NULL != pos)
|
||||
{
|
||||
CAtlMap<CString, smart_ptr<OOX::File>>::CPair* pPair = m_container.GetNext(pos);
|
||||
CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* pPair = m_container.GetNext(pos);
|
||||
if (type == pPair->m_value->type())
|
||||
return pPair->m_value;
|
||||
}
|
||||
return smart_ptr<OOX::File>(new UnknowTypeFile(unknow));
|
||||
return smart_ptr<PPTX::File>(new UnknowTypeFile(unknow));
|
||||
}
|
||||
|
||||
|
||||
const RId IFileContainer::add(const smart_ptr<OOX::File>& file)
|
||||
const RId IFileContainer::add(const smart_ptr<PPTX::File>& file)
|
||||
{
|
||||
const RId rId = maxRId().next();
|
||||
add(rId, file);
|
||||
@ -282,48 +282,48 @@ namespace OOX
|
||||
}
|
||||
|
||||
|
||||
void IFileContainer::add(const OOX::RId rId, const smart_ptr<OOX::File>& file)
|
||||
void IFileContainer::add(const PPTX::RId rId, const smart_ptr<PPTX::File>& file)
|
||||
{
|
||||
//m_lMaxRid = max(m_lMaxRid, rId.get());
|
||||
m_container.SetAt(rId.get(), file);
|
||||
}
|
||||
|
||||
|
||||
smart_ptr<OOX::File> IFileContainer::find(const FileType& type) const
|
||||
smart_ptr<PPTX::File> IFileContainer::find(const FileType& type) const
|
||||
{
|
||||
POSITION pos = m_container.GetStartPosition();
|
||||
while (NULL != pos)
|
||||
{
|
||||
const CAtlMap<CString, smart_ptr<OOX::File>>::CPair* pPair = m_container.GetNext(pos);
|
||||
const CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* pPair = m_container.GetNext(pos);
|
||||
if (type == pPair->m_value->type())
|
||||
return pPair->m_value;
|
||||
}
|
||||
return smart_ptr<OOX::File>((OOX::File*)new UnknowTypeFile());
|
||||
return smart_ptr<PPTX::File>((PPTX::File*)new UnknowTypeFile());
|
||||
}
|
||||
|
||||
smart_ptr<OOX::File> IFileContainer::find(const OOX::RId& rId) const
|
||||
smart_ptr<PPTX::File> IFileContainer::find(const PPTX::RId& rId) const
|
||||
{
|
||||
const CAtlMap<CString, smart_ptr<OOX::File>>::CPair* pPair = m_container.Lookup(rId.get());
|
||||
const CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* pPair = m_container.Lookup(rId.get());
|
||||
if (NULL != pPair)
|
||||
return pPair->m_value;
|
||||
|
||||
smart_ptr<OOX::File> pointer;
|
||||
smart_ptr<PPTX::File> pointer;
|
||||
return pointer;
|
||||
}
|
||||
|
||||
|
||||
smart_ptr<OOX::File> IFileContainer::operator [](const OOX::RId rId)
|
||||
smart_ptr<PPTX::File> IFileContainer::operator [](const PPTX::RId rId)
|
||||
{
|
||||
CAtlMap<CString, smart_ptr<OOX::File>>::CPair* pPair = m_container.Lookup(rId.get());
|
||||
CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* pPair = m_container.Lookup(rId.get());
|
||||
if (NULL != pPair)
|
||||
return pPair->m_value;
|
||||
|
||||
smart_ptr<OOX::File> pointer;
|
||||
smart_ptr<PPTX::File> pointer;
|
||||
return pointer;
|
||||
}
|
||||
|
||||
|
||||
smart_ptr<OOX::File> IFileContainer::operator [](const FileType& type)
|
||||
smart_ptr<PPTX::File> IFileContainer::operator [](const FileType& type)
|
||||
{
|
||||
return find(type);
|
||||
}
|
||||
@ -334,4 +334,4 @@ namespace OOX
|
||||
return RId(m_lMaxRid);
|
||||
}
|
||||
|
||||
} // namespace OOX
|
||||
} // namespace PPTX
|
||||
@ -6,16 +6,16 @@
|
||||
#include "UnknowTypeFile.h"
|
||||
#include "IFileBuilder.h"
|
||||
|
||||
namespace OOX {class File;}
|
||||
namespace OOX {class FileType;}
|
||||
namespace OOX {namespace Rels {class File;}}
|
||||
namespace OOX {namespace ContentTypes {class File;}}
|
||||
namespace OOX {class Image;}
|
||||
namespace OOX {class HyperLink;}
|
||||
namespace OOX {class OleObject;}
|
||||
namespace PPTX {class File;}
|
||||
namespace PPTX {class FileType;}
|
||||
namespace PPTX {namespace Rels {class File;}}
|
||||
namespace PPTX {namespace ContentTypes {class File;}}
|
||||
namespace PPTX {class Image;}
|
||||
namespace PPTX {class HyperLink;}
|
||||
namespace PPTX {class OleObject;}
|
||||
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
class IFileContainer
|
||||
{
|
||||
@ -28,22 +28,22 @@ namespace OOX
|
||||
{
|
||||
}
|
||||
protected:
|
||||
CAtlMap<CString, smart_ptr<OOX::File>> m_container;
|
||||
CAtlMap<CString, smart_ptr<PPTX::File>> m_container;
|
||||
size_t m_lMaxRid;
|
||||
|
||||
protected:
|
||||
void read(const OOX::CPath& filename);
|
||||
void read(const Rels::File& rels, const CPath& path);
|
||||
void write(const CPath& filename, const CPath& directory, ContentTypes::File& content) const;
|
||||
void write(Rels::File& rels, const CPath& current, const CPath& directory, ContentTypes::File& content) const;
|
||||
void read(const Rels::File& rels, const OOX::CPath& path);
|
||||
void write(const OOX::CPath& filename, const OOX::CPath& directory, ContentTypes::File& content) const;
|
||||
void write(Rels::File& rels, const OOX::CPath& current, const OOX::CPath& directory, ContentTypes::File& content) const;
|
||||
|
||||
protected:
|
||||
void Commit(const CPath& path);
|
||||
void Finalize(const CPath& filename, const CPath& directory, ContentTypes::File& content);
|
||||
void Finalize(Rels::File& rels, const CPath& current, const CPath& directory, ContentTypes::File& content);
|
||||
void Commit(const OOX::CPath& path);
|
||||
void Finalize(const OOX::CPath& filename, const OOX::CPath& directory, ContentTypes::File& content);
|
||||
void Finalize(Rels::File& rels, const OOX::CPath& current, const OOX::CPath& directory, ContentTypes::File& content);
|
||||
|
||||
public:
|
||||
void extractPictures(const CPath& path) const;
|
||||
void extractPictures(const OOX::CPath& path) const;
|
||||
|
||||
public:
|
||||
virtual smart_ptr<Image> image(const RId& rId) const;
|
||||
@ -54,20 +54,20 @@ namespace OOX
|
||||
public:
|
||||
template<typename T> const bool exist() const;
|
||||
const bool exist(const FileType& type) const;
|
||||
const bool exist(const OOX::RId& rId) const;
|
||||
const bool isExternal(const OOX::RId& rId) const;
|
||||
const bool exist(const PPTX::RId& rId) const;
|
||||
const bool isExternal(const PPTX::RId& rId) const;
|
||||
|
||||
smart_ptr<OOX::File> get(const FileType& type);
|
||||
const RId add(const smart_ptr<OOX::File>& file);
|
||||
void add(const OOX::RId rId, const smart_ptr<OOX::File>& file);
|
||||
smart_ptr<PPTX::File> get(const FileType& type);
|
||||
const RId add(const smart_ptr<PPTX::File>& file);
|
||||
void add(const PPTX::RId rId, const smart_ptr<PPTX::File>& file);
|
||||
|
||||
smart_ptr<OOX::File> find(const FileType& type) const;
|
||||
smart_ptr<PPTX::File> find(const FileType& type) const;
|
||||
|
||||
smart_ptr<OOX::File> find(const OOX::RId& type) const;
|
||||
smart_ptr<PPTX::File> find(const PPTX::RId& type) const;
|
||||
|
||||
smart_ptr<OOX::File> operator [](const OOX::RId rId);
|
||||
smart_ptr<PPTX::File> operator [](const PPTX::RId rId);
|
||||
|
||||
smart_ptr<OOX::File> operator [](const FileType& type);
|
||||
smart_ptr<PPTX::File> operator [](const FileType& type);
|
||||
|
||||
template<typename T> T& find();
|
||||
|
||||
@ -93,6 +93,6 @@ namespace OOX
|
||||
return dynamic_cast<T&>(find(file.type()));
|
||||
}
|
||||
|
||||
} // namespace OOX
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // OOX_IFILE_CONTAINER_INCLUDE_H_
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
#include "Media.h"
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
class Audio : public Media
|
||||
{
|
||||
@ -12,7 +12,7 @@ namespace OOX
|
||||
Audio()
|
||||
{
|
||||
}
|
||||
Audio(const CPath& filename)
|
||||
Audio(const OOX::CPath& filename)
|
||||
{
|
||||
read(filename);
|
||||
}
|
||||
@ -25,15 +25,15 @@ namespace OOX
|
||||
{
|
||||
return FileTypes::Audio;
|
||||
}
|
||||
virtual const CPath DefaultDirectory() const
|
||||
virtual const OOX::CPath DefaultDirectory() const
|
||||
{
|
||||
return type().DefaultDirectory();
|
||||
}
|
||||
virtual const CPath DefaultFileName() const
|
||||
virtual const OOX::CPath DefaultFileName() const
|
||||
{
|
||||
return m_filename.GetFilename();
|
||||
}
|
||||
};
|
||||
} // namespace OOX
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // OOX_AUDIO_INCLUDE_H_
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
#include "Media.h"
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
class Image : public Media
|
||||
{
|
||||
@ -12,7 +12,7 @@ namespace OOX
|
||||
Image()
|
||||
{
|
||||
}
|
||||
Image(const CPath& filename)
|
||||
Image(const OOX::CPath& filename)
|
||||
{
|
||||
read(filename);
|
||||
}
|
||||
@ -21,13 +21,13 @@ namespace OOX
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void write(const CPath& filename, const CPath& directory, ContentTypes::File& content) const
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, ContentTypes::File& content) const
|
||||
{
|
||||
CString newFilename = filename.GetFilename();
|
||||
CPath newFilePath = filename.GetDirectory();
|
||||
OOX::CPath newFilePath = filename.GetDirectory();
|
||||
|
||||
newFilename.Replace((TCHAR)' ', (TCHAR)'_');
|
||||
if (CSystemUtility::IsFileExist(m_filename) && !CSystemUtility::IsFileExist(newFilePath/newFilename))
|
||||
if (OOX::CSystemUtility::IsFileExist(m_filename) && !OOX::CSystemUtility::IsFileExist(newFilePath/newFilename))
|
||||
{
|
||||
//if (m_filename.GetExtention(true) == _T(".svm"))
|
||||
//{
|
||||
@ -54,15 +54,15 @@ namespace OOX
|
||||
{
|
||||
return FileTypes::Image;
|
||||
}
|
||||
virtual const CPath DefaultDirectory() const
|
||||
virtual const OOX::CPath DefaultDirectory() const
|
||||
{
|
||||
return type().DefaultDirectory();
|
||||
}
|
||||
virtual const CPath DefaultFileName() const
|
||||
virtual const OOX::CPath DefaultFileName() const
|
||||
{
|
||||
return m_filename.GetFilename();
|
||||
}
|
||||
};
|
||||
} // namespace OOX
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // OOX_IMAGE_INCLUDE_H_
|
||||
@ -11,7 +11,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
class Media : public File
|
||||
{
|
||||
@ -19,7 +19,7 @@ namespace OOX
|
||||
Media()
|
||||
{
|
||||
}
|
||||
Media(const CPath& filename)
|
||||
Media(const OOX::CPath& filename)
|
||||
{
|
||||
read(filename);
|
||||
}
|
||||
@ -28,11 +28,11 @@ namespace OOX
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void read(const CPath& filename)
|
||||
virtual void read(const OOX::CPath& filename)
|
||||
{
|
||||
m_filename = filename;
|
||||
}
|
||||
virtual void write(const CPath& filename, const CPath& directory, ContentTypes::File& content) const
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, ContentTypes::File& content) const
|
||||
{
|
||||
//std::wstring newFilename = filename.filename();
|
||||
//boost::filesystem::wpath newFilePath = filename.parent_path();
|
||||
@ -51,11 +51,11 @@ namespace OOX
|
||||
}
|
||||
|
||||
public:
|
||||
const CPath filename() const
|
||||
const OOX::CPath filename() const
|
||||
{
|
||||
return m_filename;
|
||||
}
|
||||
void copy_to(const CPath& path) const
|
||||
void copy_to(const OOX::CPath& path) const
|
||||
{
|
||||
//std::wstring newFilename = m_filename.filename();
|
||||
//boost::replace_all(newFilename, L" ", L"_");
|
||||
@ -65,8 +65,8 @@ namespace OOX
|
||||
}
|
||||
|
||||
protected:
|
||||
CPath m_filename;
|
||||
OOX::CPath m_filename;
|
||||
};
|
||||
} // namespace OOX
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // OOX_MEDIA_INCLUDE_H_
|
||||
@ -5,7 +5,7 @@
|
||||
#include "Media.h"
|
||||
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
class OleObject : public Media
|
||||
{
|
||||
@ -39,11 +39,11 @@ namespace OOX
|
||||
{
|
||||
return FileTypes::OleObject;
|
||||
}
|
||||
virtual const CPath DefaultDirectory() const
|
||||
virtual const OOX::CPath DefaultDirectory() const
|
||||
{
|
||||
return type().DefaultDirectory();
|
||||
}
|
||||
virtual const CPath DefaultFileName() const
|
||||
virtual const OOX::CPath DefaultFileName() const
|
||||
{
|
||||
return m_filename.GetFilename();
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
#include "Media.h"
|
||||
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
class Video : public Media
|
||||
{
|
||||
@ -13,7 +13,7 @@ namespace OOX
|
||||
Video()
|
||||
{
|
||||
}
|
||||
Video(const CPath& filename)
|
||||
Video(const OOX::CPath& filename)
|
||||
{
|
||||
read(filename);
|
||||
}
|
||||
@ -26,15 +26,15 @@ namespace OOX
|
||||
{
|
||||
return FileTypes::Video;
|
||||
}
|
||||
virtual const CPath DefaultDirectory() const
|
||||
virtual const OOX::CPath DefaultDirectory() const
|
||||
{
|
||||
return type().DefaultDirectory();
|
||||
}
|
||||
virtual const CPath DefaultFileName() const
|
||||
virtual const OOX::CPath DefaultFileName() const
|
||||
{
|
||||
return m_filename.GetFilename();
|
||||
}
|
||||
};
|
||||
} // namespace OOX
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // OOX_VIDEO_INCLUDE_H_
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
#include "Namespaces.h"
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
class NamespaceOwn
|
||||
{
|
||||
@ -14,6 +14,6 @@ namespace OOX
|
||||
|
||||
//const Namespaces NamespaceOwn::ns;
|
||||
static Namespaces g_Namespaces;
|
||||
} // namespace OOX
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // OOX_NAMESPACE_OWN_INCLUDE_H_
|
||||
@ -5,7 +5,7 @@
|
||||
#include "../../../Common/DocxFormat/Source/Base/Base.h"
|
||||
#include <atlstr.h>
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
class Namespace
|
||||
{
|
||||
@ -98,6 +98,6 @@ namespace OOX
|
||||
const Namespace xsd;
|
||||
const Namespace xsi;
|
||||
};
|
||||
} // namespace OOX
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // OOX_NAMESPACES_INCLUDE_H_
|
||||
@ -5,7 +5,7 @@
|
||||
#include "../../../Common/DocxFormat/Source/Base/Base.h"
|
||||
#include "../../../Common/DocxFormat/Source/XML/XmlUtils.h"
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
class RId
|
||||
{
|
||||
@ -98,6 +98,6 @@ namespace OOX
|
||||
private:
|
||||
CString m_id;
|
||||
};
|
||||
} // namespace OOX
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // OOX_RID_INCLUDE_H_
|
||||
@ -12,7 +12,7 @@
|
||||
#include "../../../../Common/DocxFormat/Source/SystemUtility/SystemUtility.h"
|
||||
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Rels
|
||||
{
|
||||
@ -22,7 +22,7 @@ namespace OOX
|
||||
File()
|
||||
{
|
||||
}
|
||||
File(const CPath& filename)
|
||||
File(const OOX::CPath& filename)
|
||||
{
|
||||
read(filename);
|
||||
}
|
||||
@ -31,34 +31,34 @@ namespace OOX
|
||||
}
|
||||
|
||||
public:
|
||||
void read(const CPath& filename)
|
||||
void read(const OOX::CPath& filename)
|
||||
{
|
||||
CPath strFile = createFileName(filename);
|
||||
OOX::CPath strFile = createFileName(filename);
|
||||
|
||||
if (CSystemUtility::IsFileExist(strFile))
|
||||
if (OOX::CSystemUtility::IsFileExist(strFile))
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
if (oNode.FromXmlFile2(strFile.GetPath()))
|
||||
Relations = oNode;
|
||||
}
|
||||
}
|
||||
void read2(const CPath& filename)
|
||||
void read2(const OOX::CPath& filename)
|
||||
{
|
||||
CPath strFile = filename;
|
||||
OOX::CPath strFile = filename;
|
||||
|
||||
if (CSystemUtility::IsFileExist(strFile))
|
||||
if (OOX::CSystemUtility::IsFileExist(strFile))
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
if (oNode.FromXmlFile2(strFile.GetPath()))
|
||||
Relations = oNode;
|
||||
}
|
||||
}
|
||||
void write(const CPath& filename) const
|
||||
void write(const OOX::CPath& filename) const
|
||||
{
|
||||
if (0 < Relations.m_items.GetCount())
|
||||
{
|
||||
CPath file = createFileName(filename);
|
||||
CSystemUtility::CreateDirectories(file.GetDirectory());
|
||||
OOX::CPath file = createFileName(filename);
|
||||
OOX::CSystemUtility::CreateDirectories(file.GetDirectory());
|
||||
|
||||
XmlUtils::CXmlWriter oWriter;
|
||||
oWriter.WriteNodeBegin(_T("Relationship"), TRUE);
|
||||
@ -78,7 +78,7 @@ namespace OOX
|
||||
}
|
||||
|
||||
public:
|
||||
void registration(const RId& rId, const FileType& type, const CPath& filename)
|
||||
void registration(const RId& rId, const FileType& type, const OOX::CPath& filename)
|
||||
{
|
||||
if(!(type == FileTypes::Unknow))
|
||||
{
|
||||
@ -109,7 +109,7 @@ namespace OOX
|
||||
}
|
||||
|
||||
private:
|
||||
const CPath createFileName(const CPath& filename) const
|
||||
const OOX::CPath createFileName(const OOX::CPath& filename) const
|
||||
{
|
||||
CString strTemp = filename.GetDirectory() + _T("\\_rels\\");
|
||||
if (filename.GetFilename() == _T(""))
|
||||
@ -123,6 +123,6 @@ namespace OOX
|
||||
RelationTable Relations;
|
||||
};
|
||||
} // namespace Rels
|
||||
} // namespace OOX
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // OOX_RELS_FILE_INCLUDE_H_
|
||||
@ -6,18 +6,18 @@
|
||||
#include "./../RId.h"
|
||||
#include "./../External/External.h"
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Rels
|
||||
{
|
||||
class RelationShip : public WritingElement
|
||||
{
|
||||
public:
|
||||
RelationShip(const OOX::RId& rId, const CString& type, const OOX::CPath& filename) : m_rId(rId), m_target(filename), m_type(type)
|
||||
RelationShip(const PPTX::RId& rId, const CString& type, const OOX::CPath& filename) : m_rId(rId), m_target(filename), m_type(type)
|
||||
{
|
||||
m_target.m_strFilename.Replace(_T(" "), _T("_"));
|
||||
}
|
||||
RelationShip(const OOX::RId& rId, const smart_ptr<External> external): m_rId(rId), m_target(external->Uri()),
|
||||
RelationShip(const PPTX::RId& rId, const smart_ptr<External> external): m_rId(rId), m_target(external->Uri()),
|
||||
m_type(external->type().RelationType())
|
||||
{
|
||||
m_mode = new CString(_T("External"));
|
||||
@ -65,11 +65,11 @@ namespace OOX
|
||||
{
|
||||
return m_type;
|
||||
}
|
||||
const CPath filename() const
|
||||
const OOX::CPath filename() const
|
||||
{
|
||||
return m_target;
|
||||
}
|
||||
const CPath target() const
|
||||
const OOX::CPath target() const
|
||||
{
|
||||
return m_target;
|
||||
}
|
||||
@ -86,11 +86,11 @@ namespace OOX
|
||||
|
||||
private:
|
||||
RId m_rId;
|
||||
CPath m_target;
|
||||
OOX::CPath m_target;
|
||||
CString m_type;
|
||||
nullable_string m_mode;
|
||||
};
|
||||
} // namespace Rels
|
||||
} // namespace OOX
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // OOX_RELS_RELATION_SHIP_INCLUDE_H_
|
||||
@ -6,9 +6,9 @@
|
||||
#include "RelationShip.h"
|
||||
#include "./../RId.h"
|
||||
|
||||
namespace OOX {class External;}
|
||||
namespace PPTX {class External;}
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Rels
|
||||
{
|
||||
@ -32,16 +32,16 @@ namespace OOX
|
||||
}
|
||||
|
||||
public:
|
||||
void registration(const RId& rId, const CString& type, const CPath& filename)
|
||||
void registration(const RId& rId, const CString& type, const OOX::CPath& filename)
|
||||
{
|
||||
m_items.Add(RelationShip(rId, type, filename));
|
||||
}
|
||||
void registration(const RId& rId, const smart_ptr<OOX::External> external)
|
||||
void registration(const RId& rId, const smart_ptr<PPTX::External> external)
|
||||
{
|
||||
m_items.Add(RelationShip(rId, external));
|
||||
}
|
||||
};
|
||||
} // namespace Rels
|
||||
} // namespace OOX
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // OOX_RELS_RELATION_TABLE_INCLUDE_H_
|
||||
@ -6,7 +6,7 @@
|
||||
#include "FileTypes.h"
|
||||
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
class UnknowTypeFile : public File
|
||||
{
|
||||
@ -19,10 +19,10 @@ namespace OOX
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void read(const CPath& filename)
|
||||
virtual void read(const OOX::CPath& filename)
|
||||
{
|
||||
}
|
||||
virtual void write(const CPath& filename, const CPath& directory, ContentTypes::File& content) const
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, ContentTypes::File& content) const
|
||||
{
|
||||
}
|
||||
|
||||
@ -31,11 +31,11 @@ namespace OOX
|
||||
{
|
||||
return FileTypes::Unknow;
|
||||
}
|
||||
virtual const CPath DefaultDirectory() const
|
||||
virtual const OOX::CPath DefaultDirectory() const
|
||||
{
|
||||
return type().DefaultDirectory();
|
||||
}
|
||||
virtual const CPath DefaultFileName() const
|
||||
virtual const OOX::CPath DefaultFileName() const
|
||||
{
|
||||
return type().DefaultFileName();
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
#include "../../../Common/DocxFormat/Source/XML/XmlUtils.h"
|
||||
#include "atlstr.h"
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
#define WritingElement_AdditionConstructors(Class) \
|
||||
Class(XmlUtils::CXmlNode& oNode)\
|
||||
@ -177,7 +177,7 @@ namespace OOX
|
||||
virtual CString toXML() const = 0;
|
||||
virtual EElementType getType() const
|
||||
{
|
||||
return OOX::et_Unknown;
|
||||
return PPTX::et_Unknown;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
#include "WritingElement.h"
|
||||
|
||||
namespace OOX
|
||||
namespace PPTX
|
||||
{
|
||||
template <typename T>
|
||||
class WritingVector : public WritingElement
|
||||
@ -61,6 +61,6 @@ namespace OOX
|
||||
return et_Unknown;
|
||||
}
|
||||
};
|
||||
} // namespace OOX
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // OOX_WRITING_VECTOR_INCLUDE_H_
|
||||
@ -16,38 +16,38 @@ namespace PPTX
|
||||
//not implement FileContainer.read
|
||||
}
|
||||
|
||||
void FileContainer::read(const OOX::Rels::File& rels, const OOX::CPath& path)
|
||||
void FileContainer::read(const PPTX::Rels::File& rels, const OOX::CPath& path)
|
||||
{
|
||||
//not implement FileContainer.read
|
||||
}
|
||||
|
||||
void FileContainer::read(const OOX::CPath& filename, FileMap& map, IPPTXEvent* Event)
|
||||
{
|
||||
OOX::Rels::File rels(filename);
|
||||
PPTX::Rels::File rels(filename);
|
||||
OOX::CPath path = filename.GetDirectory();
|
||||
read(rels, path, map, Event);
|
||||
}
|
||||
|
||||
void FileContainer::read(const OOX::Rels::File& rels, const OOX::CPath& path, FileMap& map, IPPTXEvent* Event)
|
||||
void FileContainer::read(const PPTX::Rels::File& rels, const OOX::CPath& path, FileMap& map, IPPTXEvent* Event)
|
||||
{
|
||||
bool bIsSlide = false;
|
||||
OOX::File* pSrcFile = dynamic_cast<OOX::File*>(this);
|
||||
PPTX::File* pSrcFile = dynamic_cast<PPTX::File*>(this);
|
||||
if (NULL != pSrcFile)
|
||||
bIsSlide = (pSrcFile->type() == OOX::FileTypes::Slide) ? true : false;
|
||||
bIsSlide = (pSrcFile->type() == PPTX::FileTypes::Slide) ? true : false;
|
||||
|
||||
size_t nCount = rels.Relations.m_items.GetCount();
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
{
|
||||
const OOX::Rels::RelationShip* pRelation = &(rels.Relations.m_items[i]);
|
||||
const PPTX::Rels::RelationShip* pRelation = &(rels.Relations.m_items[i]);
|
||||
OOX::CPath normPath = path / pRelation->target();
|
||||
|
||||
CAtlMap<CString, smart_ptr<OOX::File>>::CPair* pPair = map.find(normPath);
|
||||
CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* pPair = map.find(normPath);
|
||||
|
||||
if (bIsSlide && (pRelation->type() == OOX::FileTypes::Slide))
|
||||
if (bIsSlide && (pRelation->type() == PPTX::FileTypes::Slide))
|
||||
{
|
||||
long percent = Event->GetPercent();
|
||||
|
||||
smart_ptr<OOX::File> file = smart_ptr<OOX::File>(new OOX::HyperLink(pRelation->target()));
|
||||
smart_ptr<PPTX::File> file = smart_ptr<PPTX::File>(new PPTX::HyperLink(pRelation->target()));
|
||||
|
||||
bool res = Event->Progress(0, percent + m_lPercent);
|
||||
if (res)
|
||||
@ -68,7 +68,7 @@ namespace PPTX
|
||||
{
|
||||
long percent = Event->GetPercent();
|
||||
|
||||
smart_ptr<OOX::File> file = PPTX::FileFactory::CreateFilePPTX(path, *pRelation, map);
|
||||
smart_ptr<PPTX::File> file = PPTX::FileFactory::CreateFilePPTX(path, *pRelation, map);
|
||||
bool res = Event->Progress(0, percent + m_lPercent);
|
||||
if (res)
|
||||
{
|
||||
@ -93,25 +93,25 @@ namespace PPTX
|
||||
}
|
||||
}
|
||||
|
||||
void FileContainer::write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::ContentTypes::File& content) const
|
||||
void FileContainer::write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content) const
|
||||
{
|
||||
OOX::Rels::File rels;
|
||||
PPTX::Rels::File rels;
|
||||
OOX::CPath current = filename.GetDirectory();
|
||||
write(rels, current, directory, content);
|
||||
rels.write(filename);
|
||||
}
|
||||
|
||||
void FileContainer::write(OOX::Rels::File& rels, const OOX::CPath& curdir, const OOX::CPath& directory, OOX::ContentTypes::File& content) const
|
||||
void FileContainer::write(PPTX::Rels::File& rels, const OOX::CPath& curdir, const OOX::CPath& directory, PPTX::ContentTypes::File& content) const
|
||||
{
|
||||
CAtlMap<CString, size_t> namepair;
|
||||
|
||||
POSITION pos = m_container.GetStartPosition();
|
||||
while (NULL != pos)
|
||||
{
|
||||
const CAtlMap<CString, smart_ptr<OOX::File>>::CPair* pPair = m_container.GetNext(pos);
|
||||
const CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* pPair = m_container.GetNext(pos);
|
||||
|
||||
smart_ptr<OOX::File> pFile = pPair->m_value;
|
||||
smart_ptr<OOX::External> pExt = pFile.smart_dynamic_cast<OOX::External>();
|
||||
smart_ptr<PPTX::File> pFile = pPair->m_value;
|
||||
smart_ptr<PPTX::External> pExt = pFile.smart_dynamic_cast<PPTX::External>();
|
||||
|
||||
if (!pExt.IsInit())
|
||||
{
|
||||
@ -160,7 +160,7 @@ namespace PPTX
|
||||
POSITION pos = m_container.GetStartPosition();
|
||||
while (NULL != pos)
|
||||
{
|
||||
smart_ptr<OOX::File> pFile = m_container.GetNextValue(pos);
|
||||
smart_ptr<PPTX::File> pFile = m_container.GetNextValue(pos);
|
||||
|
||||
smart_ptr<PPTX::WrapperFile> pWrapFile = pFile.smart_dynamic_cast<PPTX::WrapperFile>();
|
||||
smart_ptr<PPTX::FileContainer> pWrapCont = pFile.smart_dynamic_cast<PPTX::FileContainer>();
|
||||
@ -177,21 +177,21 @@ namespace PPTX
|
||||
}
|
||||
}
|
||||
|
||||
void CCommonRels::_read(const OOX::Rels::File& rels, const OOX::CPath& path)
|
||||
void CCommonRels::_read(const PPTX::Rels::File& rels, const OOX::CPath& path)
|
||||
{
|
||||
size_t nCount = rels.Relations.m_items.GetCount();
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
{
|
||||
const OOX::Rels::RelationShip* pRelation = &(rels.Relations.m_items[i]);
|
||||
const PPTX::Rels::RelationShip* pRelation = &(rels.Relations.m_items[i]);
|
||||
|
||||
smart_ptr<OOX::File> _file = PPTX::FileFactory::CreateFilePPTX_OnlyMedia(path, *pRelation);
|
||||
smart_ptr<PPTX::File> _file = PPTX::FileFactory::CreateFilePPTX_OnlyMedia(path, *pRelation);
|
||||
add(pRelation->rId(), _file);
|
||||
}
|
||||
}
|
||||
|
||||
void CCommonRels::_read(const OOX::CPath& filename)
|
||||
{
|
||||
OOX::Rels::File rels(filename);
|
||||
PPTX::Rels::File rels(filename);
|
||||
OOX::CPath path = filename.GetDirectory();
|
||||
_read(rels, path);
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
class FileContainer : public OOX::IFileContainer
|
||||
class FileContainer : public PPTX::IFileContainer
|
||||
{
|
||||
public:
|
||||
FileContainer()
|
||||
@ -21,12 +21,12 @@ namespace PPTX
|
||||
}
|
||||
protected:
|
||||
void read(const OOX::CPath& filename);
|
||||
void read(const OOX::Rels::File& rels, const OOX::CPath& path);
|
||||
void read(const PPTX::Rels::File& rels, const OOX::CPath& path);
|
||||
|
||||
void read(const OOX::CPath& filename, FileMap& map, IPPTXEvent* Event);
|
||||
void read(const OOX::Rels::File& rels, const OOX::CPath& path, FileMap& map, IPPTXEvent* Event);
|
||||
void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::ContentTypes::File& content) const;
|
||||
void write(OOX::Rels::File& rels, const OOX::CPath& current, const OOX::CPath& directory, OOX::ContentTypes::File& content) const;
|
||||
void read(const PPTX::Rels::File& rels, const OOX::CPath& path, FileMap& map, IPPTXEvent* Event);
|
||||
void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content) const;
|
||||
void write(PPTX::Rels::File& rels, const OOX::CPath& current, const OOX::CPath& directory, PPTX::ContentTypes::File& content) const;
|
||||
|
||||
void WrittenSetFalse();
|
||||
|
||||
@ -42,7 +42,7 @@ namespace PPTX
|
||||
}
|
||||
|
||||
void _read(const OOX::CPath& filename);
|
||||
void _read(const OOX::Rels::File& rels, const OOX::CPath& path);
|
||||
void _read(const PPTX::Rels::File& rels, const OOX::CPath& path);
|
||||
};
|
||||
} // namespace PPTX
|
||||
|
||||
|
||||
@ -32,69 +32,69 @@
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
const smart_ptr<OOX::File> FileFactory::CreateFilePPTX(const OOX::CPath& path, const OOX::Rels::RelationShip& relation, FileMap& map)
|
||||
const smart_ptr<PPTX::File> FileFactory::CreateFilePPTX(const OOX::CPath& path, const PPTX::Rels::RelationShip& relation, FileMap& map)
|
||||
{
|
||||
OOX::CPath filename = path / relation.filename();
|
||||
|
||||
if (relation.type() == OOX::FileTypes::App)
|
||||
return smart_ptr<OOX::File>(new PPTX::App(filename, map));
|
||||
else if (relation.type() == OOX::FileTypes::Core)
|
||||
return smart_ptr<OOX::File>(new PPTX::Core(filename, map));
|
||||
else if (relation.type() == OOX::FileTypes::Presentation)
|
||||
return smart_ptr<OOX::File>(new PPTX::Presentation(filename, map));
|
||||
else if (relation.type() == OOX::FileTypes::Theme)
|
||||
return smart_ptr<OOX::File>(new PPTX::Theme(filename, map));
|
||||
else if (relation.type() == OOX::FileTypes::SlideMaster)
|
||||
return smart_ptr<OOX::File>(new PPTX::SlideMaster(filename, map));
|
||||
else if (relation.type() == OOX::FileTypes::SlideLayout)
|
||||
return smart_ptr<OOX::File>(new PPTX::SlideLayout(filename, map));
|
||||
else if (relation.type() == OOX::FileTypes::Slide)
|
||||
return smart_ptr<OOX::File>(new PPTX::Slide(filename, map));
|
||||
else if (relation.type() == OOX::FileTypes::HandoutMaster)
|
||||
return smart_ptr<OOX::File>(new PPTX::HandoutMaster(filename, map));
|
||||
else if (relation.type() == OOX::FileTypes::NotesMaster)
|
||||
return smart_ptr<OOX::File>(new PPTX::NotesMaster(filename, map));
|
||||
else if (relation.type() == OOX::FileTypes::NotesSlide)
|
||||
return smart_ptr<OOX::File>(new PPTX::NotesSlide(filename, map));
|
||||
else if (relation.type() == OOX::FileTypes::PresProps)
|
||||
return smart_ptr<OOX::File>(new PPTX::PresProps(filename, map));
|
||||
else if (relation.type() == OOX::FileTypes::ViewProps)
|
||||
return smart_ptr<OOX::File>(new PPTX::ViewProps(filename, map));
|
||||
else if (relation.type() == OOX::FileTypes::TableStyles)
|
||||
return smart_ptr<OOX::File>(new PPTX::TableStyles(filename, map));
|
||||
else if (relation.type() == OOX::FileTypes::VmlDrawing)
|
||||
return smart_ptr<OOX::File>(new PPTX::VmlDrawing(filename, map));
|
||||
else if (relation.type() == OOX::FileTypes::HyperLink)
|
||||
return smart_ptr<OOX::File>(new OOX::HyperLink(relation.target()));
|
||||
else if ((relation.type() == OOX::FileTypes::ExternalImage) && (relation.isExternal()))
|
||||
return smart_ptr<OOX::File>(new OOX::ExternalImage(relation.target()));
|
||||
else if ((relation.type() == OOX::FileTypes::ExternalAudio) && (relation.isExternal()))
|
||||
return smart_ptr<OOX::File>(new OOX::ExternalAudio(relation.target()));
|
||||
else if ((relation.type() == OOX::FileTypes::ExternalVideo) && (relation.isExternal()))
|
||||
return smart_ptr<OOX::File>(new OOX::ExternalVideo(relation.target()));
|
||||
else if (relation.type() == OOX::FileTypes::Image)
|
||||
return smart_ptr<OOX::File>(new OOX::Image(filename));
|
||||
else if (relation.type() == OOX::FileTypes::Audio)
|
||||
return smart_ptr<OOX::File>(new OOX::Audio(filename));
|
||||
else if (relation.type() == OOX::FileTypes::Video)
|
||||
return smart_ptr<OOX::File>(new OOX::Video(filename));
|
||||
else if (relation.type() == OOX::FileTypes::Media) // FOR NONE OPTIMIZED PPTX FILES
|
||||
return smart_ptr<OOX::File>(new OOX::HyperLink(filename));
|
||||
else if (relation.type() == OOX::FileTypes::Data) // <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> filepath
|
||||
return smart_ptr<OOX::File>(new OOX::Image(filename));
|
||||
else if (relation.type() == OOX::FileTypes::DrawingDiag)
|
||||
return smart_ptr<OOX::File>(new OOX::Image(filename)); // <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> filepath
|
||||
else if (relation.type() == OOX::FileTypes::Chart)
|
||||
return smart_ptr<OOX::File>(new OOX::Image(filename)); // <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> filepath
|
||||
else if (relation.type() == OOX::FileTypes::CommentAuthors)
|
||||
return smart_ptr<OOX::File>(new PPTX::Authors(filename, map));
|
||||
else if (relation.type() == OOX::FileTypes::SlideComments)
|
||||
return smart_ptr<OOX::File>(new PPTX::Comments(filename, map));
|
||||
if (relation.type() == PPTX::FileTypes::App)
|
||||
return smart_ptr<PPTX::File>(new PPTX::App(filename, map));
|
||||
else if (relation.type() == PPTX::FileTypes::Core)
|
||||
return smart_ptr<PPTX::File>(new PPTX::Core(filename, map));
|
||||
else if (relation.type() == PPTX::FileTypes::Presentation)
|
||||
return smart_ptr<PPTX::File>(new PPTX::Presentation(filename, map));
|
||||
else if (relation.type() == PPTX::FileTypes::Theme)
|
||||
return smart_ptr<PPTX::File>(new PPTX::Theme(filename, map));
|
||||
else if (relation.type() == PPTX::FileTypes::SlideMaster)
|
||||
return smart_ptr<PPTX::File>(new PPTX::SlideMaster(filename, map));
|
||||
else if (relation.type() == PPTX::FileTypes::SlideLayout)
|
||||
return smart_ptr<PPTX::File>(new PPTX::SlideLayout(filename, map));
|
||||
else if (relation.type() == PPTX::FileTypes::Slide)
|
||||
return smart_ptr<PPTX::File>(new PPTX::Slide(filename, map));
|
||||
else if (relation.type() == PPTX::FileTypes::HandoutMaster)
|
||||
return smart_ptr<PPTX::File>(new PPTX::HandoutMaster(filename, map));
|
||||
else if (relation.type() == PPTX::FileTypes::NotesMaster)
|
||||
return smart_ptr<PPTX::File>(new PPTX::NotesMaster(filename, map));
|
||||
else if (relation.type() == PPTX::FileTypes::NotesSlide)
|
||||
return smart_ptr<PPTX::File>(new PPTX::NotesSlide(filename, map));
|
||||
else if (relation.type() == PPTX::FileTypes::PresProps)
|
||||
return smart_ptr<PPTX::File>(new PPTX::PresProps(filename, map));
|
||||
else if (relation.type() == PPTX::FileTypes::ViewProps)
|
||||
return smart_ptr<PPTX::File>(new PPTX::ViewProps(filename, map));
|
||||
else if (relation.type() == PPTX::FileTypes::TableStyles)
|
||||
return smart_ptr<PPTX::File>(new PPTX::TableStyles(filename, map));
|
||||
else if (relation.type() == PPTX::FileTypes::VmlDrawing)
|
||||
return smart_ptr<PPTX::File>(new PPTX::VmlDrawing(filename, map));
|
||||
else if (relation.type() == PPTX::FileTypes::HyperLink)
|
||||
return smart_ptr<PPTX::File>(new PPTX::HyperLink(relation.target()));
|
||||
else if ((relation.type() == PPTX::FileTypes::ExternalImage) && (relation.isExternal()))
|
||||
return smart_ptr<PPTX::File>(new PPTX::ExternalImage(relation.target()));
|
||||
else if ((relation.type() == PPTX::FileTypes::ExternalAudio) && (relation.isExternal()))
|
||||
return smart_ptr<PPTX::File>(new PPTX::ExternalAudio(relation.target()));
|
||||
else if ((relation.type() == PPTX::FileTypes::ExternalVideo) && (relation.isExternal()))
|
||||
return smart_ptr<PPTX::File>(new PPTX::ExternalVideo(relation.target()));
|
||||
else if (relation.type() == PPTX::FileTypes::Image)
|
||||
return smart_ptr<PPTX::File>(new PPTX::Image(filename));
|
||||
else if (relation.type() == PPTX::FileTypes::Audio)
|
||||
return smart_ptr<PPTX::File>(new PPTX::Audio(filename));
|
||||
else if (relation.type() == PPTX::FileTypes::Video)
|
||||
return smart_ptr<PPTX::File>(new PPTX::Video(filename));
|
||||
else if (relation.type() == PPTX::FileTypes::Media) // FOR NONE OPTIMIZED PPTX FILES
|
||||
return smart_ptr<PPTX::File>(new PPTX::HyperLink(filename));
|
||||
else if (relation.type() == PPTX::FileTypes::Data) // <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> filepath
|
||||
return smart_ptr<PPTX::File>(new PPTX::Image(filename));
|
||||
else if (relation.type() == PPTX::FileTypes::DrawingDiag)
|
||||
return smart_ptr<PPTX::File>(new PPTX::Image(filename)); // <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> filepath
|
||||
else if (relation.type() == PPTX::FileTypes::Chart)
|
||||
return smart_ptr<PPTX::File>(new PPTX::Image(filename)); // <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> filepath
|
||||
else if (relation.type() == PPTX::FileTypes::CommentAuthors)
|
||||
return smart_ptr<PPTX::File>(new PPTX::Authors(filename, map));
|
||||
else if (relation.type() == PPTX::FileTypes::SlideComments)
|
||||
return smart_ptr<PPTX::File>(new PPTX::Comments(filename, map));
|
||||
|
||||
return smart_ptr<OOX::File>(new OOX::UnknowTypeFile());
|
||||
return smart_ptr<PPTX::File>(new PPTX::UnknowTypeFile());
|
||||
}
|
||||
|
||||
const smart_ptr<OOX::File> FileFactory::CreateFilePPTX_OnlyMedia(const OOX::CPath& path, const OOX::Rels::RelationShip& relation)
|
||||
const smart_ptr<PPTX::File> FileFactory::CreateFilePPTX_OnlyMedia(const OOX::CPath& path, const PPTX::Rels::RelationShip& relation)
|
||||
{
|
||||
bool bIsDownload = false;
|
||||
CString strFile = relation.filename().GetPath();
|
||||
@ -113,15 +113,15 @@ namespace PPTX
|
||||
|
||||
CString strT = relation.type();
|
||||
|
||||
if (strT == OOX::FileTypes::Image ||
|
||||
strT == OOX::FileTypes::Data ||
|
||||
strT == OOX::FileTypes::DrawingDiag ||
|
||||
strT == OOX::FileTypes::Chart)
|
||||
if (strT == PPTX::FileTypes::Image ||
|
||||
strT == PPTX::FileTypes::Data ||
|
||||
strT == PPTX::FileTypes::DrawingDiag ||
|
||||
strT == PPTX::FileTypes::Chart)
|
||||
{
|
||||
return smart_ptr<OOX::File>(new OOX::Image(filename));
|
||||
return smart_ptr<PPTX::File>(new PPTX::Image(filename));
|
||||
}
|
||||
|
||||
return smart_ptr<OOX::File>(new OOX::UnknowTypeFile());
|
||||
return smart_ptr<PPTX::File>(new PPTX::UnknowTypeFile());
|
||||
}
|
||||
|
||||
} // namespace PPTX
|
||||
@ -4,16 +4,16 @@
|
||||
|
||||
#include "DocxFormat/File.h"
|
||||
|
||||
//namespace OOX {class File;}
|
||||
namespace OOX {namespace Rels {class RelationShip;}}
|
||||
//namespace PPTX {class File;}
|
||||
namespace PPTX {namespace Rels {class RelationShip;}}
|
||||
namespace PPTX {class FileMap;}
|
||||
namespace PPTX
|
||||
{
|
||||
class FileFactory
|
||||
{
|
||||
public:
|
||||
static const smart_ptr<OOX::File> CreateFilePPTX(const OOX::CPath& path, const OOX::Rels::RelationShip& relation, FileMap& map);
|
||||
static const smart_ptr<OOX::File> CreateFilePPTX_OnlyMedia(const OOX::CPath& path, const OOX::Rels::RelationShip& relation);
|
||||
static const smart_ptr<PPTX::File> CreateFilePPTX(const OOX::CPath& path, const PPTX::Rels::RelationShip& relation, FileMap& map);
|
||||
static const smart_ptr<PPTX::File> CreateFilePPTX_OnlyMedia(const OOX::CPath& path, const PPTX::Rels::RelationShip& relation);
|
||||
};
|
||||
} // namespace PPTX
|
||||
|
||||
|
||||
@ -16,16 +16,16 @@ namespace PPTX
|
||||
{
|
||||
}
|
||||
public:
|
||||
CAtlMap<CString, smart_ptr<OOX::File>> m_map;
|
||||
CAtlMap<CString, smart_ptr<PPTX::File>> m_map;
|
||||
|
||||
public:
|
||||
|
||||
AVSINLINE CAtlMap<CString, smart_ptr<OOX::File>>::CPair* find(const OOX::CPath& path)
|
||||
AVSINLINE CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* find(const OOX::CPath& path)
|
||||
{
|
||||
return m_map.Lookup(path.m_strFilename);
|
||||
}
|
||||
|
||||
AVSINLINE void add(const OOX::CPath& key, const smart_ptr<OOX::File>& value)
|
||||
AVSINLINE void add(const OOX::CPath& key, const smart_ptr<PPTX::File>& value)
|
||||
{
|
||||
m_map.SetAt(key.m_strFilename, value);
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ namespace PPTX
|
||||
|
||||
void Folder::read(const OOX::CPath& path, IPPTXEvent* Event)
|
||||
{
|
||||
OOX::Rels::File rels(path);
|
||||
PPTX::Rels::File rels(path);
|
||||
PPTX::FileMap map;
|
||||
long files = CountFiles(path);
|
||||
if(files == 0)
|
||||
@ -35,19 +35,19 @@ namespace PPTX
|
||||
return;
|
||||
|
||||
POSITION pos = NULL;
|
||||
smart_ptr<PPTX::Presentation> _presentation = FileContainer::get(OOX::FileTypes::Presentation).smart_dynamic_cast<PPTX::Presentation>();
|
||||
smart_ptr<PPTX::Presentation> _presentation = FileContainer::get(PPTX::FileTypes::Presentation).smart_dynamic_cast<PPTX::Presentation>();
|
||||
if (_presentation.is_init())
|
||||
{
|
||||
_presentation->commentAuthors = _presentation->get(OOX::FileTypes::CommentAuthors).smart_dynamic_cast<PPTX::Authors>();
|
||||
_presentation->commentAuthors = _presentation->get(PPTX::FileTypes::CommentAuthors).smart_dynamic_cast<PPTX::Authors>();
|
||||
}
|
||||
|
||||
pos = map.m_map.GetStartPosition();
|
||||
while (NULL != pos)
|
||||
{
|
||||
CAtlMap<CString, smart_ptr<OOX::File>>::CPair* pPair = map.m_map.GetNext(pos);
|
||||
const OOX::FileType& curType = pPair->m_value->type();
|
||||
CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* pPair = map.m_map.GetNext(pos);
|
||||
const PPTX::FileType& curType = pPair->m_value->type();
|
||||
|
||||
if (OOX::FileTypes::ThemePPTX == curType)
|
||||
if (PPTX::FileTypes::ThemePPTX == curType)
|
||||
{
|
||||
smart_ptr<PPTX::Theme> pTheme = pPair->m_value.smart_dynamic_cast<PPTX::Theme>();
|
||||
if (pTheme.IsInit())
|
||||
@ -58,10 +58,10 @@ namespace PPTX
|
||||
pos = map.m_map.GetStartPosition();
|
||||
while (NULL != pos)
|
||||
{
|
||||
CAtlMap<CString, smart_ptr<OOX::File>>::CPair* pPair = map.m_map.GetNext(pos);
|
||||
const OOX::FileType& curType = pPair->m_value->type();
|
||||
CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* pPair = map.m_map.GetNext(pos);
|
||||
const PPTX::FileType& curType = pPair->m_value->type();
|
||||
|
||||
if (OOX::FileTypes::SlideMaster == curType)
|
||||
if (PPTX::FileTypes::SlideMaster == curType)
|
||||
{
|
||||
smart_ptr<PPTX::SlideMaster> pointer = pPair->m_value.smart_dynamic_cast<PPTX::SlideMaster>();
|
||||
if (pointer.is_init())
|
||||
@ -72,10 +72,10 @@ namespace PPTX
|
||||
pos = map.m_map.GetStartPosition();
|
||||
while (NULL != pos)
|
||||
{
|
||||
CAtlMap<CString, smart_ptr<OOX::File>>::CPair* pPair = map.m_map.GetNext(pos);
|
||||
const OOX::FileType& curType = pPair->m_value->type();
|
||||
CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* pPair = map.m_map.GetNext(pos);
|
||||
const PPTX::FileType& curType = pPair->m_value->type();
|
||||
|
||||
if (OOX::FileTypes::SlideLayout == curType)
|
||||
if (PPTX::FileTypes::SlideLayout == curType)
|
||||
{
|
||||
smart_ptr<PPTX::SlideLayout> pointer = pPair->m_value.smart_dynamic_cast<PPTX::SlideLayout>();
|
||||
if (pointer.is_init())
|
||||
@ -86,10 +86,10 @@ namespace PPTX
|
||||
pos = map.m_map.GetStartPosition();
|
||||
while (NULL != pos)
|
||||
{
|
||||
CAtlMap<CString, smart_ptr<OOX::File>>::CPair* pPair = map.m_map.GetNext(pos);
|
||||
const OOX::FileType& curType = pPair->m_value->type();
|
||||
CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* pPair = map.m_map.GetNext(pos);
|
||||
const PPTX::FileType& curType = pPair->m_value->type();
|
||||
|
||||
if (OOX::FileTypes::Slide == curType)
|
||||
if (PPTX::FileTypes::Slide == curType)
|
||||
{
|
||||
smart_ptr<PPTX::Slide> pointer = pPair->m_value.smart_dynamic_cast<PPTX::Slide>();
|
||||
if (pointer.is_init())
|
||||
@ -100,10 +100,10 @@ namespace PPTX
|
||||
pos = map.m_map.GetStartPosition();
|
||||
while (NULL != pos)
|
||||
{
|
||||
CAtlMap<CString, smart_ptr<OOX::File>>::CPair* pPair = map.m_map.GetNext(pos);
|
||||
const OOX::FileType& curType = pPair->m_value->type();
|
||||
CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* pPair = map.m_map.GetNext(pos);
|
||||
const PPTX::FileType& curType = pPair->m_value->type();
|
||||
|
||||
if (OOX::FileTypes::NotesMaster == curType)
|
||||
if (PPTX::FileTypes::NotesMaster == curType)
|
||||
{
|
||||
smart_ptr<PPTX::NotesMaster> pointer = pPair->m_value.smart_dynamic_cast<PPTX::NotesMaster>();
|
||||
if (pointer.is_init())
|
||||
@ -118,8 +118,8 @@ namespace PPTX
|
||||
{
|
||||
OOX::CSystemUtility::CreateDirectories(path);
|
||||
|
||||
OOX::Rels::File rels;
|
||||
OOX::ContentTypes::File content;
|
||||
PPTX::Rels::File rels;
|
||||
PPTX::ContentTypes::File content;
|
||||
|
||||
OOX::CPath dir = path;
|
||||
FileContainer::write(rels, path, dir, content);
|
||||
@ -136,7 +136,7 @@ namespace PPTX
|
||||
|
||||
const bool Folder::isValid(const OOX::CPath& path) const
|
||||
{
|
||||
return true;//FileContainer::exist(OOX::FileTypes::Presentation);
|
||||
return true;//FileContainer::exist(PPTX::FileTypes::Presentation);
|
||||
}
|
||||
|
||||
void Folder::extractPictures(const OOX::CPath& path)
|
||||
|
||||
@ -45,11 +45,11 @@ namespace PPTX
|
||||
if (hf.is_init())
|
||||
hf->SetParentFilePointer(this);
|
||||
}
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::ContentTypes::File& content)const
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("xmlns:a"), OOX::g_Namespaces.a.m_strLink);
|
||||
oAttr.Write(_T("xmlns:r"), OOX::g_Namespaces.r.m_strLink);
|
||||
oAttr.Write(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink);
|
||||
oAttr.Write(_T("xmlns:r"), PPTX::g_Namespaces.r.m_strLink);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.Write(cSld);
|
||||
@ -65,9 +65,9 @@ namespace PPTX
|
||||
}
|
||||
|
||||
public:
|
||||
virtual const OOX::FileType type() const
|
||||
virtual const PPTX::FileType type() const
|
||||
{
|
||||
return OOX::FileTypes::HandoutMaster;
|
||||
return PPTX::FileTypes::HandoutMaster;
|
||||
}
|
||||
virtual const OOX::CPath DefaultDirectory() const
|
||||
{
|
||||
|
||||
@ -66,7 +66,7 @@ namespace PPTX
|
||||
|
||||
public:
|
||||
|
||||
OOX::RId link;
|
||||
PPTX::RId link;
|
||||
|
||||
// trim
|
||||
nullable_double st;
|
||||
|
||||
@ -54,7 +54,7 @@ namespace PPTX
|
||||
{
|
||||
if (pRels != NULL)
|
||||
{
|
||||
smart_ptr<OOX::Image> p = pRels->image(*embed);
|
||||
smart_ptr<PPTX::Image> p = pRels->image(*embed);
|
||||
if (p.is_init())
|
||||
return p->filename().m_strFilename;
|
||||
}
|
||||
@ -73,7 +73,7 @@ namespace PPTX
|
||||
{
|
||||
if (pRels != NULL)
|
||||
{
|
||||
smart_ptr<OOX::Image> p = pRels->image(*link);
|
||||
smart_ptr<PPTX::Image> p = pRels->image(*link);
|
||||
if (p.is_init())
|
||||
return p->filename().m_strFilename;
|
||||
}
|
||||
|
||||
@ -116,8 +116,8 @@ namespace PPTX
|
||||
CAtlArray<UniEffect> Effects;
|
||||
|
||||
nullable_limit<Limit::BlipCompression> cstate;
|
||||
nullable<OOX::RId> embed;
|
||||
nullable<OOX::RId> link;
|
||||
nullable<PPTX::RId> embed;
|
||||
nullable<PPTX::RId> link;
|
||||
//private:
|
||||
public:
|
||||
CString m_namespace;
|
||||
|
||||
@ -323,7 +323,7 @@ namespace PPTX
|
||||
if (!blip.is_init())
|
||||
blip = new PPTX::Logic::Blip();
|
||||
|
||||
blip->embed = new OOX::RId((size_t)lId);
|
||||
blip->embed = new PPTX::RId((size_t)lId);
|
||||
|
||||
pReader->Skip(1); // end attribute
|
||||
break;
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
#include "..\SlideLayout.h"
|
||||
#include "..\SlideMaster.h"
|
||||
|
||||
#include "../../ASCOfficeDrawingConverter.h"
|
||||
//#include "../../ASCOfficeDrawingConverter.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
|
||||
@ -38,10 +38,10 @@ namespace PPTX
|
||||
NvGraphicFramePr nvGraphicFramePr;
|
||||
Xfrm xfrm;
|
||||
//property<Graphic> grpahic;
|
||||
//nullable_property<OOX::RId> dm;
|
||||
//nullable_property<OOX::RId> lo;
|
||||
//nullable_property<OOX::RId> qs;
|
||||
//nullable_property<OOX::RId> cs;
|
||||
//nullable_property<PPTX::RId> dm;
|
||||
//nullable_property<PPTX::RId> lo;
|
||||
//nullable_property<PPTX::RId> qs;
|
||||
//nullable_property<PPTX::RId> cs;
|
||||
nullable_string spid;
|
||||
nullable<Table> Table;
|
||||
nullable<SmartArt> smartArt;
|
||||
|
||||
@ -14,7 +14,7 @@ namespace PPTX
|
||||
{
|
||||
if(id.IsInit() && *id != _T(""))
|
||||
{
|
||||
OOX::RId rid(*id);
|
||||
PPTX::RId rid(*id);
|
||||
|
||||
CString sLink = _T("");
|
||||
if(parentFileIs<Slide>())
|
||||
|
||||
@ -176,7 +176,7 @@ namespace PPTX
|
||||
public:
|
||||
nullable<WavAudioFile> snd;
|
||||
|
||||
nullable_string id;//<OOX::RId> id;// <xsd:attribute ref="r:id" use="optional"/>
|
||||
nullable_string id;//<PPTX::RId> id;// <xsd:attribute ref="r:id" use="optional"/>
|
||||
nullable_string invalidUrl;//default=""
|
||||
nullable_string action;//default=""
|
||||
nullable_string tgtFrame;//default=""
|
||||
|
||||
@ -45,7 +45,7 @@ namespace PPTX
|
||||
}
|
||||
public:
|
||||
CString name;
|
||||
OOX::RId link;
|
||||
PPTX::RId link;
|
||||
nullable_string contentType;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
|
||||
@ -56,7 +56,7 @@ namespace PPTX
|
||||
|
||||
public:
|
||||
nullable_string name;
|
||||
OOX::RId embed;
|
||||
PPTX::RId embed;
|
||||
public:
|
||||
CString m_name;
|
||||
protected:
|
||||
|
||||
@ -63,8 +63,8 @@ namespace PPTX
|
||||
virtual CString toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("xmlns:") + OOX::g_Namespaces.p.m_strName, OOX::g_Namespaces.p.m_strLink);
|
||||
oAttr.Write(_T("xmlns:") + OOX::g_Namespaces.a.m_strName, OOX::g_Namespaces.a.m_strLink);
|
||||
oAttr.Write(_T("xmlns:") + PPTX::g_Namespaces.p.m_strName, PPTX::g_Namespaces.p.m_strLink);
|
||||
oAttr.Write(_T("xmlns:") + PPTX::g_Namespaces.a.m_strName, PPTX::g_Namespaces.a.m_strLink);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.Write(lnRef);
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
#include "..\SlideLayout.h"
|
||||
#include "..\SlideMaster.h"
|
||||
|
||||
#include "../../ASCOfficeDrawingConverter.h"
|
||||
//#include "../../ASCOfficeDrawingConverter.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
@ -31,7 +31,7 @@ namespace PPTX
|
||||
strDataPath = parentFileAs<Theme>().GetMediaFullPathNameFromRId(*id_data);
|
||||
else if (pRels != NULL)
|
||||
{
|
||||
smart_ptr<OOX::Image> p = pRels->image(*id_data);
|
||||
smart_ptr<PPTX::Image> p = pRels->image(*id_data);
|
||||
if (p.is_init())
|
||||
strDataPath = p->filename().m_strFilename;
|
||||
}
|
||||
@ -40,7 +40,7 @@ namespace PPTX
|
||||
if (_T("") == strDataPath)
|
||||
return;
|
||||
|
||||
nullable<OOX::RId> id_drawing;
|
||||
nullable<PPTX::RId> id_drawing;
|
||||
|
||||
XmlUtils::CXmlNode oNode;
|
||||
oNode.FromXmlFile2(strDataPath);
|
||||
@ -73,7 +73,7 @@ namespace PPTX
|
||||
strDWPath = parentFileAs<Theme>().GetMediaFullPathNameFromRId(*id_drawing);
|
||||
else if (pRels != NULL)
|
||||
{
|
||||
smart_ptr<OOX::Image> p = pRels->image(*id_drawing);
|
||||
smart_ptr<PPTX::Image> p = pRels->image(*id_drawing);
|
||||
if (p.is_init())
|
||||
strDWPath = p->filename().m_strFilename;
|
||||
}
|
||||
@ -97,88 +97,89 @@ namespace PPTX
|
||||
|
||||
void ChartRec::toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
LPSAFEARRAY pArray = NULL;
|
||||
//todo
|
||||
//LPSAFEARRAY pArray = NULL;
|
||||
|
||||
FileContainer* pRels = NULL;
|
||||
if (pWriter->m_pCommonRels.is_init())
|
||||
pRels = pWriter->m_pCommonRels.operator ->();
|
||||
//FileContainer* pRels = NULL;
|
||||
//if (pWriter->m_pCommonRels.is_init())
|
||||
// pRels = pWriter->m_pCommonRels.operator ->();
|
||||
|
||||
CString strDataPath = _T("");
|
||||
if(id_data.IsInit())
|
||||
{
|
||||
if(parentFileIs<Slide>())
|
||||
strDataPath = parentFileAs<Slide>().GetMediaFullPathNameFromRId(*id_data);
|
||||
else if(parentFileIs<SlideLayout>())
|
||||
strDataPath = parentFileAs<SlideLayout>().GetMediaFullPathNameFromRId(*id_data);
|
||||
else if(parentFileIs<SlideMaster>())
|
||||
strDataPath = parentFileAs<SlideMaster>().GetMediaFullPathNameFromRId(*id_data);
|
||||
else if(parentFileIs<Theme>())
|
||||
strDataPath = parentFileAs<Theme>().GetMediaFullPathNameFromRId(*id_data);
|
||||
else if (pRels != NULL)
|
||||
{
|
||||
smart_ptr<OOX::Image> p = pRels->image(*id_data);
|
||||
if (p.is_init())
|
||||
strDataPath = p->filename().m_strFilename;
|
||||
}
|
||||
}
|
||||
//CString strDataPath = _T("");
|
||||
//if(id_data.IsInit())
|
||||
//{
|
||||
// if(parentFileIs<Slide>())
|
||||
// strDataPath = parentFileAs<Slide>().GetMediaFullPathNameFromRId(*id_data);
|
||||
// else if(parentFileIs<SlideLayout>())
|
||||
// strDataPath = parentFileAs<SlideLayout>().GetMediaFullPathNameFromRId(*id_data);
|
||||
// else if(parentFileIs<SlideMaster>())
|
||||
// strDataPath = parentFileAs<SlideMaster>().GetMediaFullPathNameFromRId(*id_data);
|
||||
// else if(parentFileIs<Theme>())
|
||||
// strDataPath = parentFileAs<Theme>().GetMediaFullPathNameFromRId(*id_data);
|
||||
// else if (pRels != NULL)
|
||||
// {
|
||||
// smart_ptr<PPTX::Image> p = pRels->image(*id_data);
|
||||
// if (p.is_init())
|
||||
// strDataPath = p->filename().m_strFilename;
|
||||
// }
|
||||
//}
|
||||
|
||||
if (_T("") == strDataPath)
|
||||
return;
|
||||
//if (_T("") == strDataPath)
|
||||
// return;
|
||||
|
||||
XlsxCom::IAVSOfficeXlsxSerizer* pSerializer = NULL;
|
||||
if (!SUCCEEDED(CoCreateInstance(XlsxCom::CLSID_CAVSOfficeXlsxSerizer, NULL, CLSCTX_ALL, XlsxCom::IID_IAVSOfficeXlsxSerizer, (void**)&pSerializer)))
|
||||
return;
|
||||
//DocxFile2::IAVSOfficeXlsxSerizer* pSerializer = NULL;
|
||||
//if (!SUCCEEDED(CoCreateInstance(__uuidof(DocxFile2::CAVSOfficeXlsxSerizer), NULL, CLSCTX_ALL, __uuidof(DocxFile2::IAVSOfficeXlsxSerizer), (void**)&pSerializer)))
|
||||
// return;
|
||||
|
||||
IAVSOfficeDrawingConverter* pDrawingConverter = NULL;
|
||||
CoCreateInstance(__uuidof(CAVSOfficeDrawingConverter), NULL, CLSCTX_ALL, __uuidof(IAVSOfficeDrawingConverter), (void**)&pDrawingConverter);
|
||||
if (NULL == pDrawingConverter)
|
||||
{
|
||||
RELEASEINTERFACE(pSerializer);
|
||||
return;
|
||||
}
|
||||
//IAVSOfficeDrawingConverter* pDrawingConverter = NULL;
|
||||
//CoCreateInstance(__uuidof(CAVSOfficeDrawingConverter), NULL, CLSCTX_ALL, __uuidof(IAVSOfficeDrawingConverter), (void**)&pDrawingConverter);
|
||||
//if (NULL == pDrawingConverter)
|
||||
//{
|
||||
// RELEASEINTERFACE(pSerializer);
|
||||
// return;
|
||||
//}
|
||||
|
||||
VARIANT var;
|
||||
|
||||
var.vt = VT_UNKNOWN;
|
||||
pWriter->m_oCommon.m_pFontPicker->QueryInterface(IID_IUnknown, (void**)&(var.punkVal));
|
||||
pDrawingConverter->SetAdditionalParam(L"FontPicker", var);
|
||||
RELEASEINTERFACE((var.punkVal));
|
||||
//VARIANT var;
|
||||
//
|
||||
//var.vt = VT_UNKNOWN;
|
||||
//pWriter->m_oCommon.m_pFontPicker->QueryInterface(IID_IUnknown, (void**)&(var.punkVal));
|
||||
//pDrawingConverter->SetAdditionalParam(L"FontPicker", var);
|
||||
//RELEASEINTERFACE((var.punkVal));
|
||||
|
||||
var.vt = VT_ARRAY;
|
||||
//var.vt = VT_ARRAY;
|
||||
|
||||
NSBinPptxRW::CBinaryFileWriter oWriter;
|
||||
LPSAFEARRAY pSerializeIM = oWriter.Serialize(&pWriter->m_oCommon.m_oImageManager);
|
||||
var.parray = pSerializeIM;
|
||||
pDrawingConverter->SetAdditionalParam(L"SerializeImageManager", var);
|
||||
//NSBinPptxRW::CBinaryFileWriter oWriter;
|
||||
//LPSAFEARRAY pSerializeIM = oWriter.Serialize(&pWriter->m_oCommon.m_oImageManager);
|
||||
//var.parray = pSerializeIM;
|
||||
//pDrawingConverter->SetAdditionalParam(L"SerializeImageManager", var);
|
||||
|
||||
RELEASEARRAY(pSerializeIM);
|
||||
//RELEASEARRAY(pSerializeIM);
|
||||
|
||||
pSerializer->SetDrawingConverter((IUnknown*)pDrawingConverter);
|
||||
//pSerializer->SetDrawingConverter((IUnknown*)pDrawingConverter);
|
||||
|
||||
BSTR bsPath = strDataPath.AllocSysString();
|
||||
pSerializer->LoadChart(bsPath, &pArray);
|
||||
SysFreeString(bsPath);
|
||||
//BSTR bsPath = strDataPath.AllocSysString();
|
||||
//pSerializer->LoadChart(bsPath, &pArray);
|
||||
//SysFreeString(bsPath);
|
||||
|
||||
if (NULL != pArray)
|
||||
{
|
||||
var.parray = NULL;
|
||||
pDrawingConverter->GetAdditionalParam(L"SerializeImageManager", &var);
|
||||
//if (NULL != pArray)
|
||||
//{
|
||||
// var.parray = NULL;
|
||||
// pDrawingConverter->GetAdditionalParam(L"SerializeImageManager", &var);
|
||||
|
||||
if (var.parray != NULL)
|
||||
{
|
||||
NSBinPptxRW::CBinaryFileReader oReader;
|
||||
oReader.Deserialize(&pWriter->m_oCommon.m_oImageManager, var.parray);
|
||||
// if (var.parray != NULL)
|
||||
// {
|
||||
// NSBinPptxRW::CBinaryFileReader oReader;
|
||||
// oReader.Deserialize(&pWriter->m_oCommon.m_oImageManager, var.parray);
|
||||
|
||||
RELEASEARRAY((var.parray));
|
||||
}
|
||||
// RELEASEARRAY((var.parray));
|
||||
// }
|
||||
|
||||
pWriter->WriteBYTEArray((BYTE*)pArray->pvData, pArray->rgsabound[0].cElements);
|
||||
}
|
||||
// pWriter->WriteBYTEArray((BYTE*)pArray->pvData, pArray->rgsabound[0].cElements);
|
||||
//}
|
||||
|
||||
RELEASEARRAY(pArray);
|
||||
//RELEASEARRAY(pArray);
|
||||
|
||||
RELEASEINTERFACE(pDrawingConverter);
|
||||
RELEASEINTERFACE(pSerializer);
|
||||
//RELEASEINTERFACE(pDrawingConverter);
|
||||
//RELEASEINTERFACE(pSerializer);
|
||||
}
|
||||
|
||||
void ChartRec::toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
@ -194,88 +195,88 @@ xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"
|
||||
|
||||
void ChartRec::fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
ULONG lLen = pReader->GetLong();
|
||||
m_pData = pReader->GetArray(lLen);
|
||||
//ULONG lLen = pReader->GetLong();
|
||||
//m_pData = pReader->GetArray(lLen);
|
||||
|
||||
m_lChartNumber = pReader->m_lChartNumber;
|
||||
pReader->m_lChartNumber++;
|
||||
int lId = pReader->m_pRels->WriteChart(m_lChartNumber, pReader->m_lDocumentType);
|
||||
//m_lChartNumber = pReader->m_lChartNumber;
|
||||
//pReader->m_lChartNumber++;
|
||||
//int lId = pReader->m_pRels->WriteChart(m_lChartNumber, pReader->m_lDocumentType);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
XlsxCom::IAVSOfficeXlsxSerizer* pSerializer = NULL;
|
||||
if (!SUCCEEDED(CoCreateInstance(XlsxCom::CLSID_CAVSOfficeXlsxSerizer, NULL, CLSCTX_ALL, XlsxCom::IID_IAVSOfficeXlsxSerizer, (void**)&pSerializer)))
|
||||
return;
|
||||
//// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
//DocxFile2::IAVSOfficeXlsxSerizer* pSerializer = NULL;
|
||||
//if (!SUCCEEDED(CoCreateInstance(__uuidof(DocxFile2::CAVSOfficeXlsxSerizer), NULL, CLSCTX_ALL, __uuidof(DocxFile2::IAVSOfficeXlsxSerizer), (void**)&pSerializer)))
|
||||
// return;
|
||||
|
||||
IAVSOfficeDrawingConverter* pDrawingConverter = NULL;
|
||||
CoCreateInstance(__uuidof(CAVSOfficeDrawingConverter), NULL, CLSCTX_ALL, __uuidof(IAVSOfficeDrawingConverter), (void**)&pDrawingConverter);
|
||||
if (NULL == pDrawingConverter)
|
||||
{
|
||||
RELEASEINTERFACE(pSerializer);
|
||||
return;
|
||||
}
|
||||
//IAVSOfficeDrawingConverter* pDrawingConverter = NULL;
|
||||
//CoCreateInstance(__uuidof(CAVSOfficeDrawingConverter), NULL, CLSCTX_ALL, __uuidof(IAVSOfficeDrawingConverter), (void**)&pDrawingConverter);
|
||||
//if (NULL == pDrawingConverter)
|
||||
//{
|
||||
// RELEASEINTERFACE(pSerializer);
|
||||
// return;
|
||||
//}
|
||||
|
||||
VARIANT varDir;
|
||||
varDir.vt = VT_BSTR;
|
||||
varDir.bstrVal = pReader->m_strFolder.AllocSysString();
|
||||
pDrawingConverter->SetAdditionalParam(L"SourceFileDir2", varDir);
|
||||
SysFreeString(varDir.bstrVal);
|
||||
//VARIANT varDir;
|
||||
//varDir.vt = VT_BSTR;
|
||||
//varDir.bstrVal = pReader->m_strFolder.AllocSysString();
|
||||
//pDrawingConverter->SetAdditionalParam(L"SourceFileDir2", varDir);
|
||||
//SysFreeString(varDir.bstrVal);
|
||||
|
||||
VARIANT var;
|
||||
var.vt = VT_ARRAY;
|
||||
//VARIANT var;
|
||||
//var.vt = VT_ARRAY;
|
||||
|
||||
NSBinPptxRW::CBinaryFileWriter oWriter;
|
||||
LPSAFEARRAY pSerializeIM = oWriter.Serialize(pReader->m_pRels->m_pManager);
|
||||
var.parray = pSerializeIM;
|
||||
pDrawingConverter->SetAdditionalParam(L"SerializeImageManager2", var);
|
||||
//NSBinPptxRW::CBinaryFileWriter oWriter;
|
||||
//LPSAFEARRAY pSerializeIM = oWriter.Serialize(pReader->m_pRels->m_pManager);
|
||||
//var.parray = pSerializeIM;
|
||||
//pDrawingConverter->SetAdditionalParam(L"SerializeImageManager2", var);
|
||||
|
||||
RELEASEARRAY(pSerializeIM);
|
||||
//RELEASEARRAY(pSerializeIM);
|
||||
|
||||
pSerializer->SetDrawingConverter((IUnknown*)pDrawingConverter);
|
||||
//pSerializer->SetDrawingConverter((IUnknown*)pDrawingConverter);
|
||||
|
||||
CString strDstChart = pReader->m_pRels->m_pManager->GetDstMedia();
|
||||
int nPos = strDstChart.ReverseFind(TCHAR('m'));
|
||||
if (-1 != nPos)
|
||||
strDstChart = strDstChart.Mid(0, nPos);
|
||||
//CString strDstChart = pReader->m_pRels->m_pManager->GetDstMedia();
|
||||
//int nPos = strDstChart.ReverseFind(TCHAR('m'));
|
||||
//if (-1 != nPos)
|
||||
// strDstChart = strDstChart.Mid(0, nPos);
|
||||
|
||||
strDstChart += _T("charts");
|
||||
if (1 == m_lChartNumber)
|
||||
{
|
||||
CDirectory::CreateDirectory(strDstChart);
|
||||
}
|
||||
CString strChart = _T("");
|
||||
strChart.Format(_T("chart%d.xml"), m_lChartNumber);
|
||||
//strDstChart += _T("charts");
|
||||
//if (1 == m_lChartNumber)
|
||||
//{
|
||||
// CDirectory::CreateDirectory(strDstChart);
|
||||
//}
|
||||
//CString strChart = _T("");
|
||||
//strChart.Format(_T("chart%d.xml"), m_lChartNumber);
|
||||
|
||||
strChart = strDstChart + _T("\\") + strChart;
|
||||
//strChart = strDstChart + _T("\\") + strChart;
|
||||
|
||||
BSTR bsFile = strChart.AllocSysString();
|
||||
BSTR bsContentTypes = NULL;
|
||||
//BSTR bsFile = strChart.AllocSysString();
|
||||
//BSTR bsContentTypes = NULL;
|
||||
|
||||
if (pReader->m_lDocumentType == XMLWRITER_DOC_TYPE_DOCX)
|
||||
pSerializer->SaveChart(m_pData, 0, lLen, bsFile, L"/word/charts/", &bsContentTypes);
|
||||
else if (pReader->m_lDocumentType == XMLWRITER_DOC_TYPE_XLSX)
|
||||
pSerializer->SaveChart(m_pData, 0, lLen, bsFile, L"/xl/charts/", &bsContentTypes);
|
||||
else
|
||||
pSerializer->SaveChart(m_pData, 0, lLen, bsFile, L"/ppt/charts/", &bsContentTypes);
|
||||
//if (pReader->m_lDocumentType == XMLWRITER_DOC_TYPE_DOCX)
|
||||
// pSerializer->SaveChart(m_pData, 0, lLen, bsFile, L"/word/charts/", &bsContentTypes);
|
||||
//else if (pReader->m_lDocumentType == XMLWRITER_DOC_TYPE_XLSX)
|
||||
// pSerializer->SaveChart(m_pData, 0, lLen, bsFile, L"/xl/charts/", &bsContentTypes);
|
||||
//else
|
||||
// pSerializer->SaveChart(m_pData, 0, lLen, bsFile, L"/ppt/charts/", &bsContentTypes);
|
||||
|
||||
pReader->m_strContentTypes += ((CString)bsContentTypes);
|
||||
SysFreeString(bsContentTypes);
|
||||
SysFreeString(bsFile);
|
||||
//pReader->m_strContentTypes += ((CString)bsContentTypes);
|
||||
//SysFreeString(bsContentTypes);
|
||||
//SysFreeString(bsFile);
|
||||
|
||||
var.parray = NULL;
|
||||
pDrawingConverter->GetAdditionalParam(L"SerializeImageManager2", &var);
|
||||
//var.parray = NULL;
|
||||
//pDrawingConverter->GetAdditionalParam(L"SerializeImageManager2", &var);
|
||||
|
||||
if (var.parray != NULL)
|
||||
{
|
||||
NSBinPptxRW::CBinaryFileReader oReader;
|
||||
oReader.Deserialize(pReader->m_pRels->m_pManager, var.parray);
|
||||
//if (var.parray != NULL)
|
||||
//{
|
||||
// NSBinPptxRW::CBinaryFileReader oReader;
|
||||
// oReader.Deserialize(pReader->m_pRels->m_pManager, var.parray);
|
||||
|
||||
RELEASEARRAY((var.parray));
|
||||
}
|
||||
// RELEASEARRAY((var.parray));
|
||||
//}
|
||||
|
||||
RELEASEINTERFACE(pDrawingConverter);
|
||||
RELEASEINTERFACE(pSerializer);
|
||||
//RELEASEINTERFACE(pDrawingConverter);
|
||||
//RELEASEINTERFACE(pSerializer);
|
||||
|
||||
id_data = new OOX::RId((size_t)lId);
|
||||
//id_data = new PPTX::RId((size_t)lId);
|
||||
}
|
||||
} // namespace Logic
|
||||
} // namespace PPTX
|
||||
|
||||
@ -57,7 +57,7 @@ namespace PPTX
|
||||
|
||||
public:
|
||||
|
||||
nullable<OOX::RId> id_data;
|
||||
nullable<PPTX::RId> id_data;
|
||||
|
||||
nullable<PPTX::Logic::SpTree> diag;
|
||||
smart_ptr<FileContainer> m_oCommonRels;
|
||||
@ -128,7 +128,7 @@ namespace PPTX
|
||||
|
||||
public:
|
||||
|
||||
nullable<OOX::RId> id_data;
|
||||
nullable<PPTX::RId> id_data;
|
||||
|
||||
LONG m_lChartNumber;
|
||||
LPSAFEARRAY m_pData;
|
||||
|
||||
@ -62,7 +62,7 @@ namespace PPTX
|
||||
|
||||
//sndTgt
|
||||
nullable_string name;
|
||||
nullable<OOX::RId> embed;
|
||||
nullable<PPTX::RId> embed;
|
||||
nullable_bool builtIn;
|
||||
|
||||
nullable<SpTgt> spTgt;
|
||||
|
||||
@ -42,7 +42,7 @@ namespace PPTX
|
||||
}
|
||||
|
||||
public:
|
||||
OOX::RId embed;
|
||||
PPTX::RId embed;
|
||||
nullable_string name;
|
||||
nullable_bool loop;
|
||||
protected:
|
||||
|
||||
@ -310,7 +310,7 @@ namespace PPTX
|
||||
if (!pFill->blip.is_init())
|
||||
pFill->blip = new PPTX::Logic::Blip();
|
||||
|
||||
pFill->blip->embed = new OOX::RId((size_t)lId);
|
||||
pFill->blip->embed = new PPTX::RId((size_t)lId);
|
||||
if (pFill->blip.is_init())
|
||||
pFill->blip->m_namespace = _T("a");
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ namespace PPTX
|
||||
|
||||
public:
|
||||
nullable_string id;
|
||||
OOX::RId rid;
|
||||
PPTX::RId rid;
|
||||
public:
|
||||
CString m_name;
|
||||
protected:
|
||||
|
||||
@ -48,11 +48,11 @@ namespace PPTX
|
||||
if (notesStyle.is_init())
|
||||
notesStyle->SetParentFilePointer(this);
|
||||
}
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::ContentTypes::File& content)const
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("xmlns:a"), OOX::g_Namespaces.a.m_strLink);
|
||||
oAttr.Write(_T("xmlns:r"), OOX::g_Namespaces.r.m_strLink);
|
||||
oAttr.Write(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink);
|
||||
oAttr.Write(_T("xmlns:r"), PPTX::g_Namespaces.r.m_strLink);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.Write(cSld);
|
||||
@ -69,9 +69,9 @@ namespace PPTX
|
||||
}
|
||||
|
||||
public:
|
||||
virtual const OOX::FileType type() const
|
||||
virtual const PPTX::FileType type() const
|
||||
{
|
||||
return OOX::FileTypes::NotesMaster;
|
||||
return PPTX::FileTypes::NotesMaster;
|
||||
}
|
||||
virtual const OOX::CPath DefaultDirectory() const
|
||||
{
|
||||
@ -84,12 +84,12 @@ namespace PPTX
|
||||
|
||||
void ApplyRels()
|
||||
{
|
||||
Theme = (FileContainer::get(OOX::FileTypes::ThemePPTX)).smart_dynamic_cast<PPTX::Theme>();
|
||||
Theme = (FileContainer::get(PPTX::FileTypes::ThemePPTX)).smart_dynamic_cast<PPTX::Theme>();
|
||||
|
||||
if (Theme.IsInit())
|
||||
Theme->SetColorMap(clrMap);
|
||||
|
||||
TableStyles = (Theme->Presentation->get(OOX::FileTypes::TableStyles)).smart_dynamic_cast<PPTX::TableStyles>();
|
||||
TableStyles = (Theme->Presentation->get(PPTX::FileTypes::TableStyles)).smart_dynamic_cast<PPTX::TableStyles>();
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
@ -109,8 +109,8 @@ namespace PPTX
|
||||
pWriter->StartNode(_T("p:notesMaster"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), OOX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:r"), OOX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:r"), PPTX::g_Namespaces.r.m_strLink);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
cSld.toXmlWriter(pWriter);
|
||||
|
||||
@ -42,12 +42,12 @@ namespace PPTX
|
||||
if (clrMapOvr.IsInit())
|
||||
clrMapOvr->SetParentFilePointer(this);
|
||||
}
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::ContentTypes::File& content)const
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("xmlns:a"), OOX::g_Namespaces.a.m_strLink);
|
||||
oAttr.Write(_T("xmlns:r"), OOX::g_Namespaces.r.m_strLink);
|
||||
oAttr.Write(_T("xmlns:p"), OOX::g_Namespaces.p.m_strLink);
|
||||
oAttr.Write(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink);
|
||||
oAttr.Write(_T("xmlns:r"), PPTX::g_Namespaces.r.m_strLink);
|
||||
oAttr.Write(_T("xmlns:p"), PPTX::g_Namespaces.p.m_strLink);
|
||||
|
||||
oAttr.Write(_T("showMasterPhAnim"), showMasterPhAnim);
|
||||
oAttr.Write(_T("showMasterSp"), showMasterSp);
|
||||
@ -65,9 +65,9 @@ namespace PPTX
|
||||
}
|
||||
|
||||
public:
|
||||
virtual const OOX::FileType type() const
|
||||
virtual const PPTX::FileType type() const
|
||||
{
|
||||
return OOX::FileTypes::NotesSlide;
|
||||
return PPTX::FileTypes::NotesSlide;
|
||||
}
|
||||
virtual const OOX::CPath DefaultDirectory() const
|
||||
{
|
||||
@ -97,9 +97,9 @@ namespace PPTX
|
||||
pWriter->StartNode(_T("p:notes"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), OOX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:r"), OOX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:p"), OOX::g_Namespaces.p.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:r"), PPTX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:p"), PPTX::g_Namespaces.p.m_strLink);
|
||||
pWriter->WriteAttribute(_T("showMasterPhAnim"), showMasterPhAnim);
|
||||
pWriter->WriteAttribute(_T("showMasterSp"), showMasterSp);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
@ -33,12 +33,12 @@ namespace PPTX
|
||||
if (oNode.GetNode(_T("p:clrMru"), oNodeClr))
|
||||
oNodeClr.LoadArray(_T("*"), ClrMru);
|
||||
}
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::ContentTypes::File& content)const
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("xmlns:a"), OOX::g_Namespaces.a.m_strLink);
|
||||
oAttr.Write(_T("xmlns:r"), OOX::g_Namespaces.r.m_strLink);
|
||||
oAttr.Write(_T("xmlns:p"), OOX::g_Namespaces.p.m_strLink);
|
||||
oAttr.Write(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink);
|
||||
oAttr.Write(_T("xmlns:r"), PPTX::g_Namespaces.r.m_strLink);
|
||||
oAttr.Write(_T("xmlns:p"), PPTX::g_Namespaces.p.m_strLink);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
oValue.WriteArray(_T("p:clrMru"), ClrMru);
|
||||
@ -53,9 +53,9 @@ namespace PPTX
|
||||
|
||||
pWriter->StartAttributes();
|
||||
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), OOX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:r"), OOX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:p"), OOX::g_Namespaces.p.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:r"), PPTX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:p"), PPTX::g_Namespaces.p.m_strLink);
|
||||
|
||||
pWriter->EndAttributes();
|
||||
|
||||
@ -63,9 +63,9 @@ namespace PPTX
|
||||
}
|
||||
|
||||
public:
|
||||
virtual const OOX::FileType type() const
|
||||
virtual const PPTX::FileType type() const
|
||||
{
|
||||
return OOX::FileTypes::PresProps;
|
||||
return PPTX::FileTypes::PresProps;
|
||||
}
|
||||
virtual const OOX::CPath DefaultDirectory() const
|
||||
{
|
||||
|
||||
@ -139,12 +139,12 @@ namespace PPTX
|
||||
|
||||
Normalize();
|
||||
}
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::ContentTypes::File& content)const
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("xmlns:a"), OOX::g_Namespaces.a.m_strLink);
|
||||
oAttr.Write(_T("xmlns:r"), OOX::g_Namespaces.r.m_strLink);
|
||||
oAttr.Write(_T("xmlns:p"), OOX::g_Namespaces.p.m_strLink);
|
||||
oAttr.Write(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink);
|
||||
oAttr.Write(_T("xmlns:r"), PPTX::g_Namespaces.r.m_strLink);
|
||||
oAttr.Write(_T("xmlns:p"), PPTX::g_Namespaces.p.m_strLink);
|
||||
|
||||
oAttr.Write(_T("autoCompressPictures"), attrAutoCompressPictures);
|
||||
oAttr.Write(_T("bookmarkIdSeed"), attrBookmarkIdSeed);
|
||||
@ -340,9 +340,9 @@ namespace PPTX
|
||||
|
||||
pWriter->StartAttributes();
|
||||
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), OOX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:r"), OOX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:p"), OOX::g_Namespaces.p.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:r"), PPTX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:p"), PPTX::g_Namespaces.p.m_strLink);
|
||||
|
||||
pWriter->WriteAttribute(_T("autoCompressPictures"), attrAutoCompressPictures);
|
||||
pWriter->WriteAttribute(_T("bookmarkIdSeed"), attrBookmarkIdSeed);
|
||||
@ -375,9 +375,9 @@ namespace PPTX
|
||||
}
|
||||
|
||||
public:
|
||||
virtual const OOX::FileType type() const
|
||||
virtual const PPTX::FileType type() const
|
||||
{
|
||||
return OOX::FileTypes::Presentation;
|
||||
return PPTX::FileTypes::Presentation;
|
||||
}
|
||||
virtual const OOX::CPath DefaultDirectory() const
|
||||
{
|
||||
|
||||
@ -97,12 +97,12 @@ namespace PPTX
|
||||
if (timing.IsInit())
|
||||
timing->SetParentFilePointer(this);
|
||||
}
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::ContentTypes::File& content)const
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("xmlns:a"), OOX::g_Namespaces.a.m_strLink);
|
||||
oAttr.Write(_T("xmlns:r"), OOX::g_Namespaces.r.m_strLink);
|
||||
oAttr.Write(_T("xmlns:p"), OOX::g_Namespaces.p.m_strLink);
|
||||
oAttr.Write(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink);
|
||||
oAttr.Write(_T("xmlns:r"), PPTX::g_Namespaces.r.m_strLink);
|
||||
oAttr.Write(_T("xmlns:p"), PPTX::g_Namespaces.p.m_strLink);
|
||||
oAttr.Write(_T("show"), show);
|
||||
oAttr.Write(_T("showMasterPhAnim"), showMasterPhAnim);
|
||||
oAttr.Write(_T("showMasterSp"), showMasterSp);
|
||||
@ -122,9 +122,9 @@ namespace PPTX
|
||||
}
|
||||
|
||||
public:
|
||||
virtual const OOX::FileType type() const
|
||||
virtual const PPTX::FileType type() const
|
||||
{
|
||||
return OOX::FileTypes::Slide;
|
||||
return PPTX::FileTypes::Slide;
|
||||
}
|
||||
virtual const OOX::CPath DefaultDirectory() const
|
||||
{
|
||||
@ -167,28 +167,28 @@ namespace PPTX
|
||||
}
|
||||
return false;
|
||||
}
|
||||
virtual CString GetMediaFullPathNameFromRId(const OOX::RId& rid)const
|
||||
virtual CString GetMediaFullPathNameFromRId(const PPTX::RId& rid)const
|
||||
{
|
||||
smart_ptr<OOX::Image> p = image(rid);
|
||||
smart_ptr<PPTX::Image> p = image(rid);
|
||||
if (!p.is_init())
|
||||
return _T("");
|
||||
return p->filename().m_strFilename;
|
||||
}
|
||||
virtual CString GetFullHyperlinkNameFromRId(const OOX::RId& rid)const
|
||||
virtual CString GetFullHyperlinkNameFromRId(const PPTX::RId& rid)const
|
||||
{
|
||||
smart_ptr<OOX::HyperLink> p = hyperlink(rid);
|
||||
smart_ptr<PPTX::HyperLink> p = hyperlink(rid);
|
||||
if (!p.is_init())
|
||||
return _T("");
|
||||
return p->Uri().m_strFilename;
|
||||
}
|
||||
virtual CString GetLinkFromRId(const OOX::RId& rid)const
|
||||
virtual CString GetLinkFromRId(const PPTX::RId& rid)const
|
||||
{
|
||||
//return relsTable.Links.GetTargetById(rid);
|
||||
smart_ptr<OOX::External> pExt = find(rid).smart_dynamic_cast<OOX::External>();
|
||||
smart_ptr<PPTX::External> pExt = find(rid).smart_dynamic_cast<PPTX::External>();
|
||||
if (pExt.IsInit())
|
||||
return pExt->Uri().m_strFilename;
|
||||
|
||||
smart_ptr<OOX::Media> pMedia = find(rid).smart_dynamic_cast<OOX::Media>();
|
||||
smart_ptr<PPTX::Media> pMedia = find(rid).smart_dynamic_cast<PPTX::Media>();
|
||||
if (pMedia.IsInit())
|
||||
return pMedia->filename().m_strFilename;
|
||||
|
||||
@ -253,9 +253,9 @@ namespace PPTX
|
||||
pWriter->StartNode(_T("p:sld"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), OOX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:r"), OOX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:p"), OOX::g_Namespaces.p.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:r"), PPTX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:p"), PPTX::g_Namespaces.p.m_strLink);
|
||||
|
||||
pWriter->WriteAttribute(_T("showMasterPhAnim"), showMasterPhAnim);
|
||||
pWriter->WriteAttribute(_T("showMasterSp"), showMasterSp);
|
||||
@ -364,17 +364,17 @@ namespace PPTX
|
||||
public:
|
||||
void ApplyRels()
|
||||
{
|
||||
Layout = FileContainer::get(OOX::FileTypes::SlideLayout).smart_dynamic_cast<PPTX::SlideLayout>();//boost::shared_dynamic_cast<PPTX::SlideLayout, OOX::File>(FileContainer::get(OOX::FileTypes::SlideLayout));
|
||||
Note = FileContainer::get(OOX::FileTypes::NotesSlide).smart_dynamic_cast<PPTX::NotesSlide>();
|
||||
comments = FileContainer::get(OOX::FileTypes::SlideComments).smart_dynamic_cast<PPTX::Comments>();
|
||||
Layout = FileContainer::get(PPTX::FileTypes::SlideLayout).smart_dynamic_cast<PPTX::SlideLayout>();//boost::shared_dynamic_cast<PPTX::SlideLayout, PPTX::File>(FileContainer::get(PPTX::FileTypes::SlideLayout));
|
||||
Note = FileContainer::get(PPTX::FileTypes::NotesSlide).smart_dynamic_cast<PPTX::NotesSlide>();
|
||||
comments = FileContainer::get(PPTX::FileTypes::SlideComments).smart_dynamic_cast<PPTX::Comments>();
|
||||
Master = Layout->Master;
|
||||
Theme = Layout->Theme;
|
||||
|
||||
TableStyles = Theme->Presentation->get(OOX::FileTypes::TableStyles).smart_dynamic_cast<PPTX::TableStyles>();//boost::shared_dynamic_cast<PPTX::TableStyles, OOX::File>(Theme->Presentation->get(OOX::FileTypes::TableStyles));
|
||||
TableStyles = Theme->Presentation->get(PPTX::FileTypes::TableStyles).smart_dynamic_cast<PPTX::TableStyles>();//boost::shared_dynamic_cast<PPTX::TableStyles, PPTX::File>(Theme->Presentation->get(PPTX::FileTypes::TableStyles));
|
||||
|
||||
if (exist(OOX::FileTypes::VmlDrawing))
|
||||
if (exist(PPTX::FileTypes::VmlDrawing))
|
||||
{
|
||||
Vml = FileContainer::get(OOX::FileTypes::VmlDrawing).smart_dynamic_cast<PPTX::VmlDrawing>();//boost::shared_dynamic_cast<PPTX::VmlDrawing, OOX::File>(FileContainer::get(OOX::FileTypes::VmlDrawing));
|
||||
Vml = FileContainer::get(PPTX::FileTypes::VmlDrawing).smart_dynamic_cast<PPTX::VmlDrawing>();//boost::shared_dynamic_cast<PPTX::VmlDrawing, PPTX::File>(FileContainer::get(PPTX::FileTypes::VmlDrawing));
|
||||
Vml->FillRIds();
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,13 +75,13 @@ namespace PPTX
|
||||
oNode.ReadAttributeBase(L"type", attrType);
|
||||
oNode.ReadAttributeBase(L"userDrawn", userDrawn);
|
||||
}
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::ContentTypes::File& content)const
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
|
||||
oAttr.Write(_T("xmlns:a"), OOX::g_Namespaces.a.m_strLink);
|
||||
oAttr.Write(_T("xmlns:r"), OOX::g_Namespaces.r.m_strLink);
|
||||
oAttr.Write(_T("xmlns:p"), OOX::g_Namespaces.p.m_strLink);
|
||||
oAttr.Write(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink);
|
||||
oAttr.Write(_T("xmlns:r"), PPTX::g_Namespaces.r.m_strLink);
|
||||
oAttr.Write(_T("xmlns:p"), PPTX::g_Namespaces.p.m_strLink);
|
||||
|
||||
oAttr.Write(_T("matchingName"), matchingName);
|
||||
oAttr.Write(_T("preserve"), preserve);
|
||||
@ -106,9 +106,9 @@ namespace PPTX
|
||||
}
|
||||
|
||||
public:
|
||||
virtual const OOX::FileType type() const
|
||||
virtual const PPTX::FileType type() const
|
||||
{
|
||||
return OOX::FileTypes::SlideLayout;
|
||||
return PPTX::FileTypes::SlideLayout;
|
||||
}
|
||||
virtual const OOX::CPath DefaultDirectory() const
|
||||
{
|
||||
@ -216,16 +216,16 @@ namespace PPTX
|
||||
Master->GetBackground(bg, ARGB);
|
||||
}
|
||||
}
|
||||
virtual CString GetMediaFullPathNameFromRId(const OOX::RId& rid)const
|
||||
virtual CString GetMediaFullPathNameFromRId(const PPTX::RId& rid)const
|
||||
{
|
||||
smart_ptr<OOX::Image> p = image(rid);
|
||||
smart_ptr<PPTX::Image> p = image(rid);
|
||||
if (!p.is_init())
|
||||
return _T("");
|
||||
return p->filename().m_strFilename;
|
||||
}
|
||||
virtual CString GetFullHyperlinkNameFromRId(const OOX::RId& rid)const
|
||||
virtual CString GetFullHyperlinkNameFromRId(const PPTX::RId& rid)const
|
||||
{
|
||||
smart_ptr<OOX::HyperLink> p = hyperlink(rid);
|
||||
smart_ptr<PPTX::HyperLink> p = hyperlink(rid);
|
||||
if (!p.is_init())
|
||||
return _T("");
|
||||
return p->Uri().m_strFilename;
|
||||
@ -377,9 +377,9 @@ namespace PPTX
|
||||
pWriter->StartNode(_T("p:sldLayout"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), OOX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:r"), OOX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:p"), OOX::g_Namespaces.p.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:r"), PPTX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:p"), PPTX::g_Namespaces.p.m_strLink);
|
||||
|
||||
pWriter->WriteAttribute(_T("matchingName"), matchingName);
|
||||
pWriter->WriteAttribute(_T("preserve"), preserve);
|
||||
@ -426,7 +426,7 @@ namespace PPTX
|
||||
public:
|
||||
void ApplyRels()
|
||||
{
|
||||
smart_ptr<OOX::File> pFile = FileContainer::get(OOX::FileTypes::SlideMaster);
|
||||
smart_ptr<PPTX::File> pFile = FileContainer::get(PPTX::FileTypes::SlideMaster);
|
||||
|
||||
Master = pFile.smart_dynamic_cast<PPTX::SlideMaster>();
|
||||
|
||||
@ -435,7 +435,7 @@ namespace PPTX
|
||||
|
||||
if (Theme.IsInit())
|
||||
{
|
||||
TableStyles = Theme->Presentation->get(OOX::FileTypes::TableStyles).smart_dynamic_cast<PPTX::TableStyles>();
|
||||
TableStyles = Theme->Presentation->get(PPTX::FileTypes::TableStyles).smart_dynamic_cast<PPTX::TableStyles>();
|
||||
}
|
||||
}
|
||||
const OOX::CPath GetPathBySpid(const CString& spid)const
|
||||
|
||||
@ -83,12 +83,12 @@ namespace PPTX
|
||||
if(txStyles.is_init())
|
||||
txStyles->SetParentFilePointer(this);
|
||||
}
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::ContentTypes::File& content)const
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("xmlns:p"), OOX::g_Namespaces.p.m_strLink);
|
||||
oAttr.Write(_T("xmlns:a"), OOX::g_Namespaces.a.m_strLink);
|
||||
oAttr.Write(_T("xmlns:r"), OOX::g_Namespaces.r.m_strLink);
|
||||
oAttr.Write(_T("xmlns:p"), PPTX::g_Namespaces.p.m_strLink);
|
||||
oAttr.Write(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink);
|
||||
oAttr.Write(_T("xmlns:r"), PPTX::g_Namespaces.r.m_strLink);
|
||||
oAttr.Write(_T("preserve"), preserve);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
@ -109,9 +109,9 @@ namespace PPTX
|
||||
}
|
||||
|
||||
public:
|
||||
virtual const OOX::FileType type() const
|
||||
virtual const PPTX::FileType type() const
|
||||
{
|
||||
return OOX::FileTypes::SlideMaster;
|
||||
return PPTX::FileTypes::SlideMaster;
|
||||
}
|
||||
virtual const OOX::CPath DefaultDirectory() const
|
||||
{
|
||||
@ -285,16 +285,16 @@ namespace PPTX
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual CString GetMediaFullPathNameFromRId(const OOX::RId& rid)const
|
||||
virtual CString GetMediaFullPathNameFromRId(const PPTX::RId& rid)const
|
||||
{
|
||||
smart_ptr<OOX::Image> p = image(rid);
|
||||
smart_ptr<PPTX::Image> p = image(rid);
|
||||
if (!p.is_init())
|
||||
return _T("");
|
||||
return p->filename().m_strFilename;
|
||||
}
|
||||
virtual CString GetFullHyperlinkNameFromRId(const OOX::RId& rid)const
|
||||
virtual CString GetFullHyperlinkNameFromRId(const PPTX::RId& rid)const
|
||||
{
|
||||
smart_ptr<OOX::HyperLink> p = hyperlink(rid);
|
||||
smart_ptr<PPTX::HyperLink> p = hyperlink(rid);
|
||||
if (!p.is_init())
|
||||
return _T("");
|
||||
return p->Uri().m_strFilename;
|
||||
@ -370,9 +370,9 @@ namespace PPTX
|
||||
pWriter->StartNode(_T("p:sldMaster"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), OOX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:r"), OOX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:p"), OOX::g_Namespaces.p.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:r"), PPTX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:p"), PPTX::g_Namespaces.p.m_strLink);
|
||||
pWriter->WriteAttribute(_T("preserve"), preserve);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
@ -471,12 +471,12 @@ namespace PPTX
|
||||
public:
|
||||
void ApplyRels()
|
||||
{
|
||||
Theme = (FileContainer::get(OOX::FileTypes::ThemePPTX)).smart_dynamic_cast<PPTX::Theme>();
|
||||
Theme = (FileContainer::get(PPTX::FileTypes::ThemePPTX)).smart_dynamic_cast<PPTX::Theme>();
|
||||
|
||||
if (Theme.IsInit())
|
||||
Theme->SetColorMap(clrMap);
|
||||
//Theme->Master.reset((PPTX::WrapperFile*)this);
|
||||
TableStyles = (Theme->Presentation->get(OOX::FileTypes::TableStyles)).smart_dynamic_cast<PPTX::TableStyles>();
|
||||
TableStyles = (Theme->Presentation->get(PPTX::FileTypes::TableStyles)).smart_dynamic_cast<PPTX::TableStyles>();
|
||||
}
|
||||
const OOX::CPath GetPathBySpid(const CString& spid)const
|
||||
{
|
||||
|
||||
@ -53,7 +53,7 @@ namespace PPTX
|
||||
Styles.GetNextValue(pos).SetParentFilePointer(this);
|
||||
}
|
||||
}
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::ContentTypes::File& content)const
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const
|
||||
{
|
||||
CString strValue = _T("");
|
||||
POSITION pos = Styles.GetStartPosition();
|
||||
@ -73,9 +73,9 @@ namespace PPTX
|
||||
}
|
||||
|
||||
public:
|
||||
virtual const OOX::FileType type() const
|
||||
virtual const PPTX::FileType type() const
|
||||
{
|
||||
return OOX::FileTypes::TableStyles;
|
||||
return PPTX::FileTypes::TableStyles;
|
||||
}
|
||||
virtual const OOX::CPath DefaultDirectory() const
|
||||
{
|
||||
@ -199,7 +199,7 @@ namespace PPTX
|
||||
|
||||
pWriter->StartAttributes();
|
||||
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), OOX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("def"), def);
|
||||
|
||||
pWriter->EndAttributes();
|
||||
|
||||
@ -88,10 +88,10 @@ namespace PPTX
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
extraClrSchemeLst[i].SetParentFilePointer(this);
|
||||
}
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::ContentTypes::File& content)const
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("xmlns:a"), OOX::g_Namespaces.a.m_strLink);
|
||||
oAttr.Write(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink);
|
||||
oAttr.Write(_T("name"), name);
|
||||
|
||||
XmlUtils::CNodeValue oValue;
|
||||
@ -140,9 +140,9 @@ namespace PPTX
|
||||
pWriter->StartNode(_T("a:themeOverride"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), OOX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:r"), OOX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:p"), OOX::g_Namespaces.p.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:r"), PPTX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:p"), PPTX::g_Namespaces.p.m_strLink);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
themeElements.clrScheme.toXmlWriter(pWriter);
|
||||
@ -156,9 +156,9 @@ namespace PPTX
|
||||
pWriter->StartNode(_T("a:theme"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), OOX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:r"), OOX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:p"), OOX::g_Namespaces.p.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:r"), PPTX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:p"), PPTX::g_Namespaces.p.m_strLink);
|
||||
pWriter->WriteAttribute2(_T("name"), name);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
@ -248,9 +248,9 @@ namespace PPTX
|
||||
}
|
||||
|
||||
public:
|
||||
virtual const OOX::FileType type() const
|
||||
virtual const PPTX::FileType type() const
|
||||
{
|
||||
return OOX::FileTypes::ThemePPTX;
|
||||
return PPTX::FileTypes::ThemePPTX;
|
||||
}
|
||||
virtual const OOX::CPath DefaultDirectory() const
|
||||
{
|
||||
@ -315,16 +315,16 @@ namespace PPTX
|
||||
props.SetMajorLatin(themeElements.fontScheme.majorFont.latin);
|
||||
props.SetMinorLatin(themeElements.fontScheme.minorFont.latin);
|
||||
}
|
||||
virtual CString GetMediaFullPathNameFromRId(const OOX::RId& rid)const
|
||||
virtual CString GetMediaFullPathNameFromRId(const PPTX::RId& rid)const
|
||||
{
|
||||
smart_ptr<OOX::Image> p = image(rid);
|
||||
smart_ptr<PPTX::Image> p = image(rid);
|
||||
if (!p.is_init())
|
||||
return _T("");
|
||||
return p->filename().m_strFilename;
|
||||
}
|
||||
virtual CString GetFullHyperlinkNameFromRId(const OOX::RId& rid)const
|
||||
virtual CString GetFullHyperlinkNameFromRId(const PPTX::RId& rid)const
|
||||
{
|
||||
smart_ptr<OOX::HyperLink> p = hyperlink(rid);
|
||||
smart_ptr<PPTX::HyperLink> p = hyperlink(rid);
|
||||
if (!p.is_init())
|
||||
return _T("");
|
||||
return p->Uri().m_strFilename;
|
||||
|
||||
@ -74,12 +74,12 @@ namespace PPTX
|
||||
if(SorterViewPr.is_init())
|
||||
SorterViewPr->SetParentFilePointer(this);
|
||||
}
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::ContentTypes::File& content)const
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("xmlns:a"), OOX::g_Namespaces.a.m_strLink);
|
||||
oAttr.Write(_T("xmlns:r"), OOX::g_Namespaces.r.m_strLink);
|
||||
oAttr.Write(_T("xmlns:p"), OOX::g_Namespaces.p.m_strLink);
|
||||
oAttr.Write(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink);
|
||||
oAttr.Write(_T("xmlns:r"), PPTX::g_Namespaces.r.m_strLink);
|
||||
oAttr.Write(_T("xmlns:p"), PPTX::g_Namespaces.p.m_strLink);
|
||||
oAttr.WriteLimitNullable(_T("lastView"), attrLastView);
|
||||
oAttr.Write(_T("showComments"), attrShowComments);
|
||||
|
||||
@ -101,9 +101,9 @@ namespace PPTX
|
||||
}
|
||||
|
||||
public:
|
||||
virtual const OOX::FileType type() const
|
||||
virtual const PPTX::FileType type() const
|
||||
{
|
||||
return OOX::FileTypes::ViewProps;
|
||||
return PPTX::FileTypes::ViewProps;
|
||||
}
|
||||
virtual const OOX::CPath DefaultDirectory() const
|
||||
{
|
||||
@ -141,9 +141,9 @@ namespace PPTX
|
||||
|
||||
pWriter->StartAttributes();
|
||||
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), OOX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:r"), OOX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:p"), OOX::g_Namespaces.p.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:r"), PPTX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:p"), PPTX::g_Namespaces.p.m_strLink);
|
||||
pWriter->WriteAttribute(_T("lastView"), attrLastView);
|
||||
pWriter->WriteAttribute(_T("showComments"), attrShowComments);
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ namespace PPTX
|
||||
|
||||
m_strDocument = oNode.GetXml();
|
||||
}
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::ContentTypes::File& content)const
|
||||
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, PPTX::ContentTypes::File& content)const
|
||||
{
|
||||
XmlUtils::SaveToFile(filename.m_strFilename, m_strDocument);
|
||||
|
||||
@ -44,9 +44,9 @@ namespace PPTX
|
||||
}
|
||||
|
||||
public:
|
||||
virtual const OOX::FileType type() const
|
||||
virtual const PPTX::FileType type() const
|
||||
{
|
||||
return OOX::FileTypes::VmlDrawing;
|
||||
return PPTX::FileTypes::VmlDrawing;
|
||||
}
|
||||
virtual const OOX::CPath DefaultDirectory() const
|
||||
{
|
||||
@ -89,7 +89,7 @@ namespace PPTX
|
||||
}
|
||||
|
||||
nullable_string id;
|
||||
nullable<OOX::RId> rid;
|
||||
nullable<PPTX::RId> rid;
|
||||
|
||||
oNode.ReadAttributeBase(L"id", id);
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
class WrapperFile : public OOX::File
|
||||
class WrapperFile : public PPTX::File
|
||||
{
|
||||
public:
|
||||
WrapperFile()
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
class WrapperWritingElement : public OOX::WritingElement
|
||||
class WrapperWritingElement : public PPTX::WritingElement
|
||||
{
|
||||
public:
|
||||
WrapperWritingElement() : parentElement(NULL), parentFile(NULL)
|
||||
@ -57,9 +57,9 @@ namespace PPTX
|
||||
fromXML(oNode);
|
||||
}
|
||||
|
||||
virtual OOX::EElementType getType() const
|
||||
virtual PPTX::EElementType getType() const
|
||||
{
|
||||
return OOX::et_Unknown;
|
||||
return PPTX::et_Unknown;
|
||||
}
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -43,7 +43,7 @@
|
||||
#include <atlctl.h>
|
||||
#include <atlhost.h>
|
||||
#include <atlcoll.h>
|
||||
#include "../Common/atldefine.h"
|
||||
#include "../../Common/atldefine.h"
|
||||
|
||||
#define _USE_MATH_DEFINES
|
||||
#include <math.h>
|
||||
@ -60,37 +60,4 @@ using namespace ATL;
|
||||
#include "../../ASCImageStudio3/ASCGraphics/Interfaces/ASCRenderer.h"
|
||||
#include "../../Common/Config.h"
|
||||
|
||||
#import "../../Redist/ASCOfficeUtils.dll" named_guids raw_interfaces_only rename_namespace("OfficeUtils")
|
||||
#import "../../Redist/ASCOfficeDocxFile2.dll" named_guids raw_interfaces_only rename_namespace("DocxFile2")
|
||||
#import "../../Redist/XlsxSerializerCom.dll" named_guids raw_interfaces_only rename_namespace("XlsxCom"), exclude("_IAVSOfficeFileTemplateEvents"), exclude("_IAVSOfficeFileTemplateEvents2")
|
||||
|
||||
#ifdef BUILD_CONFIG_OPENSOURCE_VERSION
|
||||
|
||||
#import "../Redist/OfficeCore.dll" named_guids raw_interfaces_only rename_namespace("OfficeCore")
|
||||
|
||||
namespace MediaCore
|
||||
{
|
||||
typedef OfficeCore::IUncompressedFrame IAVSUncompressedVideoFrame;
|
||||
const GUID CLSID_CAVSUncompressedVideoFrame = OfficeCore::CLSID_CUncompressedFrame;
|
||||
const GUID IID_IAVSUncompressedVideoFrame = OfficeCore::IID_IUncompressedFrame;
|
||||
}
|
||||
|
||||
namespace ASCGraphics
|
||||
{
|
||||
typedef OfficeCore::IWinFonts IASCFontManager;
|
||||
const GUID CLSID_CASCFontManager = OfficeCore::CLSID_CWinFonts;
|
||||
const GUID IID_IASCFontManager = OfficeCore::IID_IWinFonts;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#define AVS_USE_CONVERT_PPTX_TOCUSTOM_VML
|
||||
|
||||
#import "../../Redist/ASCMediaCore3.dll" named_guids raw_interfaces_only rename_namespace("MediaCore"), exclude("tagRECT")
|
||||
#import "../../Redist/ASCImageStudio3.dll" named_guids raw_interfaces_only rename_namespace("ImageStudio"), exclude("IASCRenderer")
|
||||
#import "../../Redist/ASCHTMLRenderer.dll" named_guids raw_interfaces_only rename_namespace("HtmlRenderer"), exclude("IASCRenderer")
|
||||
|
||||
#import "../../Redist/ASCGraphics.dll" named_guids raw_interfaces_only rename_namespace("ASCGraphics"), exclude("IASCRenderer")
|
||||
#import "../../Redist/ASCFontConverter.dll" named_guids raw_interfaces_only rename_namespace("Fonts")
|
||||
|
||||
#endif
|
||||
//#define AVS_USE_CONVERT_PPTX_TOCUSTOM_VML
|
||||
@ -1,278 +1,11 @@
|
||||
#pragma once
|
||||
#include "./../BaseShape.h"
|
||||
#include "CustomGeomShape.h"
|
||||
#include "PPTShapeEnum.h"
|
||||
|
||||
using namespace NSOfficeDrawing;
|
||||
using namespace NSPresentationEditor;
|
||||
|
||||
namespace PPTShapes
|
||||
{
|
||||
enum ShapeType : unsigned short
|
||||
{
|
||||
sptMin = 0,
|
||||
sptNotPrimitive = sptMin,
|
||||
sptCRect = 1,
|
||||
sptCRoundRect = 2,
|
||||
sptCEllipse = 3,
|
||||
sptCDiamond = 4,
|
||||
sptCIsocelesTriangle = 5,//
|
||||
sptCRtTriangle = 6,
|
||||
sptCParallelogram = 7,
|
||||
sptCTrapezoid = 8,
|
||||
sptCHexagon = 9,
|
||||
sptCOctagon = 10,
|
||||
sptCPlus = 11,
|
||||
sptCStar5 = 12,//
|
||||
sptCRightArrow = 13,
|
||||
sptCThickArrow = 14,//
|
||||
sptCHomePlate = 15,
|
||||
sptCCube = 16,
|
||||
sptCBalloon = 17,//
|
||||
sptCSeal = 18,//
|
||||
sptCArc = 19,
|
||||
sptCLine = 20,
|
||||
sptCPlaque = 21,
|
||||
sptCCan = 22,
|
||||
sptCDonut = 23,
|
||||
sptCTextSimple = 24,//
|
||||
sptCTextOctagon = 25,//
|
||||
sptCTextHexagon = 26,//
|
||||
sptCTextCurve = 27,//
|
||||
sptCTextWave = 28,//
|
||||
sptCTextRing = 29,//
|
||||
sptCTextOnCurve = 30,//
|
||||
sptCTextOnRing = 31,//
|
||||
sptCStraightConnector1 = 32,
|
||||
sptCBentConnector2 = 33,
|
||||
sptCBentConnector3 = 34,
|
||||
sptCBentConnector4 = 35,
|
||||
sptCBentConnector5 = 36,
|
||||
sptCCurvedConnector2 = 37,
|
||||
sptCCurvedConnector3 = 38,
|
||||
sptCCurvedConnector4 = 39,
|
||||
sptCCurvedConnector5 = 40,
|
||||
sptCCallout1 = 41,
|
||||
sptCCallout2 = 42,
|
||||
sptCCallout3 = 43,
|
||||
sptCAccentCallout1 = 44,
|
||||
sptCAccentCallout2 = 45,
|
||||
sptCAccentCallout3 = 46,
|
||||
sptCBorderCallout1 = 47,
|
||||
sptCBorderCallout2 = 48,
|
||||
sptCBorderCallout3 = 49,
|
||||
sptCAccentBorderCallout1 = 50,
|
||||
sptCAccentBorderCallout2 = 51,
|
||||
sptCAccentBorderCallout3 = 52,
|
||||
sptCRibbon = 53,
|
||||
sptCRibbon2 = 54,
|
||||
sptCChevron = 55,
|
||||
sptCPentagon = 56,
|
||||
sptCNoSmoking = 57,
|
||||
sptCStar8 = 58,//
|
||||
sptCStar16 = 59,//
|
||||
sptCStar32 = 60,//
|
||||
sptCWedgeRectCallout = 61,
|
||||
sptCWedgeRoundRectCallout = 62,
|
||||
sptCWedgeEllipseCallout = 63,
|
||||
sptCWave = 64,
|
||||
sptCFoldedCorner = 65,
|
||||
sptCLeftArrow = 66,
|
||||
sptCDownArrow = 67,
|
||||
sptCUpArrow = 68,//
|
||||
sptCLeftRightArrow = 69,
|
||||
sptCUpDownArrow = 70,
|
||||
sptCIrregularSeal1 = 71,
|
||||
sptCIrregularSeal2 = 72,
|
||||
sptCLightningBolt = 73,
|
||||
sptCHeart = 74,
|
||||
sptCFrame = 75,
|
||||
sptCQuadArrow = 76,
|
||||
sptCLeftArrowCallout = 77,
|
||||
sptCRightArrowCallout = 78,
|
||||
sptCUpArrowCallout = 79,
|
||||
sptCDownArrowCallout = 80,
|
||||
sptCLeftRightArrowCallout = 81,
|
||||
sptCUpDownArrowCallout = 82,
|
||||
sptCQuadArrowCallout = 83,
|
||||
sptCBevel = 84,
|
||||
sptCLeftBracket = 85,
|
||||
sptCRightBracket = 86,
|
||||
sptCLeftBrace = 87,
|
||||
sptCRightBrace = 88,
|
||||
sptCLeftUpArrow = 89,
|
||||
sptCBentUpArrow = 90,
|
||||
sptCBentArrow = 91,
|
||||
sptCStar24 = 92,//
|
||||
sptCStripedRightArrow = 93,
|
||||
sptCNotchedRightArrow = 94,
|
||||
sptCBlockArc = 95,
|
||||
sptCSmileyFace = 96,
|
||||
sptCVerticalScroll = 97,
|
||||
sptCHorizontalScroll = 98,
|
||||
sptCCircularArrow = 99,
|
||||
sptCNotchedCircularArrow = 100,//
|
||||
sptCUturnArrow = 101,
|
||||
sptCCurvedRightArrow = 102,
|
||||
sptCCurvedLeftArrow = 103,
|
||||
sptCCurvedUpArrow = 104,
|
||||
sptCCurvedDownArrow = 105,
|
||||
sptCCloudCallout = 106,
|
||||
sptCEllipseRibbon = 107,
|
||||
sptCEllipseRibbon2 = 108,
|
||||
sptCFlowChartProcess = 109,
|
||||
sptCFlowChartDecision = 110,
|
||||
sptCFlowChartInputOutput = 111,
|
||||
sptCFlowChartPredefinedProcess = 112,
|
||||
sptCFlowChartInternalStorage = 113,
|
||||
sptCFlowChartDocument = 114,
|
||||
sptCFlowChartMultidocument = 115,
|
||||
sptCFlowChartTerminator = 116,
|
||||
sptCFlowChartPreparation = 117,
|
||||
sptCFlowChartManualInput = 118,
|
||||
sptCFlowChartManualOperation = 119,
|
||||
sptCFlowChartConnector = 120,
|
||||
sptCFlowChartPunchedCard = 121,
|
||||
sptCFlowChartPunchedTape = 122,
|
||||
sptCFlowChartSummingJunction = 123,
|
||||
sptCFlowChartOr = 124,
|
||||
sptCFlowChartCollate = 125,
|
||||
sptCFlowChartSort = 126,
|
||||
sptCFlowChartExtract = 127,
|
||||
sptCFlowChartMerge = 128,
|
||||
sptCFlowChartOfflineStorage = 129,
|
||||
sptCFlowChartOnlineStorage = 130,
|
||||
sptCFlowChartMagneticTape = 131,
|
||||
sptCFlowChartMagneticDisk = 132,
|
||||
sptCFlowChartMagneticDrum = 133,
|
||||
sptCFlowChartDisplay = 134,
|
||||
sptCFlowChartDelay = 135,
|
||||
sptCTextPlain = 136,
|
||||
sptCTextStop = 137,
|
||||
sptCTextTriangle = 138,
|
||||
sptCTextTriangleInverted = 139,
|
||||
sptCTextChevron = 140,
|
||||
sptCTextChevronInverted = 141,
|
||||
sptCTextRingInside = 142,
|
||||
sptCTextRingOutside = 143,
|
||||
sptCTextArchUp = 144,
|
||||
sptCTextArchDown = 145,
|
||||
sptCTextCircle = 146,
|
||||
sptCTextButton = 147,
|
||||
sptCTextArchUpPour = 148,
|
||||
sptCTextArchDownPour = 149,
|
||||
sptCTextCirclePour = 150,
|
||||
sptCTextButtonPour = 151,
|
||||
sptCTextCurveUp = 152,
|
||||
sptCTextCurveDown = 153,
|
||||
sptCTextCascadeUp = 154,
|
||||
sptCTextCascadeDown = 155,
|
||||
sptCTextWave1 = 156,
|
||||
sptCTextWave2 = 157,
|
||||
sptCTextWave3 = 158,//
|
||||
sptCTextWave4 = 159,
|
||||
sptCTextInflate = 160,
|
||||
sptCTextDeflate = 161,
|
||||
sptCTextInflateBottom = 162,
|
||||
sptCTextDeflateBottom = 163,
|
||||
sptCTextInflateTop = 164,
|
||||
sptCTextDeflateTop = 165,
|
||||
sptCTextDeflateInflate = 166,
|
||||
sptCTextDeflateInflateDeflate = 167,
|
||||
sptCTextFadeRight = 168,
|
||||
sptCTextFadeLeft = 169,
|
||||
sptCTextFadeUp = 170,
|
||||
sptCTextFadeDown = 171,
|
||||
sptCTextSlantUp = 172,
|
||||
sptCTextSlantDown = 173,
|
||||
sptCTextCanUp = 174,
|
||||
sptCTextCanDown = 175,
|
||||
sptCFlowChartAlternateProcess = 176,
|
||||
sptCFlowChartOffpageConnector = 177,
|
||||
sptCCallout90 = 178,//
|
||||
sptCAccentCallout90 = 179,//
|
||||
sptCBorderCallout90 = 180,//
|
||||
sptCAccentBorderCallout90 = 181,//
|
||||
sptCLeftRightUpArrow = 182,
|
||||
sptCSun = 183,
|
||||
sptCMoon = 184,
|
||||
sptCBracketPair = 185,
|
||||
sptCBracePair = 186,
|
||||
sptCStar4 = 187,//
|
||||
sptCDoubleWave = 188,
|
||||
sptCActionButtonBlank = 189,
|
||||
sptCActionButtonHome = 190,
|
||||
sptCActionButtonHelp = 191,
|
||||
sptCActionButtonInformation = 192,
|
||||
sptCActionButtonForwardNext = 193,
|
||||
sptCActionButtonBackPrevious = 194,
|
||||
sptCActionButtonEnd = 195,
|
||||
sptCActionButtonBeginning = 196,
|
||||
sptCActionButtonReturn = 197,
|
||||
sptCActionButtonDocument = 198,
|
||||
sptCActionButtonSound = 199,
|
||||
sptCActionButtonMovie = 200,
|
||||
sptCHostControl = 201,//
|
||||
sptCTextBox = 202,//
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
sptCChartPlus = 203,
|
||||
sptCChartStar,
|
||||
sptCChartX,
|
||||
sptCChord,
|
||||
sptCCloud,
|
||||
sptCCorner,
|
||||
sptCCornerTabs,
|
||||
sptCDecagon,
|
||||
sptCDiagStripe,
|
||||
sptCDodecagon,
|
||||
sptCFunnel,
|
||||
sptCGear6,
|
||||
sptCGear9,
|
||||
sptCHalfFrame,
|
||||
sptCHeptagon,
|
||||
sptCLeftCircularArrow,
|
||||
sptCLeftRightCircularArrow,
|
||||
sptCLeftRightRibbon,
|
||||
sptCLineInv,
|
||||
sptCMathDivide,
|
||||
sptCMathEqual,
|
||||
sptCMathMinus,
|
||||
sptCMathMultiply,
|
||||
sptCMathNotEqual,
|
||||
sptCMathPlus,
|
||||
sptCNonIsoscelesTrapezoid,
|
||||
sptCPie,
|
||||
sptCPieWedge,
|
||||
sptCPlaqueTabs,
|
||||
sptCRound1Rect,
|
||||
sptCRound2DiagRect,
|
||||
sptCRound2SameRect,
|
||||
sptCSnip1Rect,
|
||||
sptCSnip2DiagRect,
|
||||
sptCSnip2SameRect,
|
||||
sptCSnipRoundRect,
|
||||
sptCSquareTabs,
|
||||
sptCStar10,
|
||||
sptCStar12,
|
||||
//sptCStar16,
|
||||
//sptCStar24,
|
||||
//sptCStar32,
|
||||
//sptCStar4,
|
||||
//sptCStar5,
|
||||
sptCStar6,
|
||||
sptCStar7,
|
||||
//sptCStar8,
|
||||
sptCSwooshArrow,
|
||||
sptCTeardrop,
|
||||
sptCTextDoubleWave1,
|
||||
sptCTriangle,
|
||||
|
||||
sptMax,
|
||||
sptNil = 0x0FFF,
|
||||
sptCustom = 0x1000
|
||||
};
|
||||
}
|
||||
|
||||
class CPPTShape : public CBaseShape
|
||||
{
|
||||
public:
|
||||
|
||||
@ -0,0 +1,269 @@
|
||||
#pragma once
|
||||
|
||||
namespace PPTShapes
|
||||
{
|
||||
enum ShapeType : unsigned short
|
||||
{
|
||||
sptMin = 0,
|
||||
sptNotPrimitive = sptMin,
|
||||
sptCRect = 1,
|
||||
sptCRoundRect = 2,
|
||||
sptCEllipse = 3,
|
||||
sptCDiamond = 4,
|
||||
sptCIsocelesTriangle = 5,//
|
||||
sptCRtTriangle = 6,
|
||||
sptCParallelogram = 7,
|
||||
sptCTrapezoid = 8,
|
||||
sptCHexagon = 9,
|
||||
sptCOctagon = 10,
|
||||
sptCPlus = 11,
|
||||
sptCStar5 = 12,//
|
||||
sptCRightArrow = 13,
|
||||
sptCThickArrow = 14,//
|
||||
sptCHomePlate = 15,
|
||||
sptCCube = 16,
|
||||
sptCBalloon = 17,//
|
||||
sptCSeal = 18,//
|
||||
sptCArc = 19,
|
||||
sptCLine = 20,
|
||||
sptCPlaque = 21,
|
||||
sptCCan = 22,
|
||||
sptCDonut = 23,
|
||||
sptCTextSimple = 24,//
|
||||
sptCTextOctagon = 25,//
|
||||
sptCTextHexagon = 26,//
|
||||
sptCTextCurve = 27,//
|
||||
sptCTextWave = 28,//
|
||||
sptCTextRing = 29,//
|
||||
sptCTextOnCurve = 30,//
|
||||
sptCTextOnRing = 31,//
|
||||
sptCStraightConnector1 = 32,
|
||||
sptCBentConnector2 = 33,
|
||||
sptCBentConnector3 = 34,
|
||||
sptCBentConnector4 = 35,
|
||||
sptCBentConnector5 = 36,
|
||||
sptCCurvedConnector2 = 37,
|
||||
sptCCurvedConnector3 = 38,
|
||||
sptCCurvedConnector4 = 39,
|
||||
sptCCurvedConnector5 = 40,
|
||||
sptCCallout1 = 41,
|
||||
sptCCallout2 = 42,
|
||||
sptCCallout3 = 43,
|
||||
sptCAccentCallout1 = 44,
|
||||
sptCAccentCallout2 = 45,
|
||||
sptCAccentCallout3 = 46,
|
||||
sptCBorderCallout1 = 47,
|
||||
sptCBorderCallout2 = 48,
|
||||
sptCBorderCallout3 = 49,
|
||||
sptCAccentBorderCallout1 = 50,
|
||||
sptCAccentBorderCallout2 = 51,
|
||||
sptCAccentBorderCallout3 = 52,
|
||||
sptCRibbon = 53,
|
||||
sptCRibbon2 = 54,
|
||||
sptCChevron = 55,
|
||||
sptCPentagon = 56,
|
||||
sptCNoSmoking = 57,
|
||||
sptCStar8 = 58,//
|
||||
sptCStar16 = 59,//
|
||||
sptCStar32 = 60,//
|
||||
sptCWedgeRectCallout = 61,
|
||||
sptCWedgeRoundRectCallout = 62,
|
||||
sptCWedgeEllipseCallout = 63,
|
||||
sptCWave = 64,
|
||||
sptCFoldedCorner = 65,
|
||||
sptCLeftArrow = 66,
|
||||
sptCDownArrow = 67,
|
||||
sptCUpArrow = 68,//
|
||||
sptCLeftRightArrow = 69,
|
||||
sptCUpDownArrow = 70,
|
||||
sptCIrregularSeal1 = 71,
|
||||
sptCIrregularSeal2 = 72,
|
||||
sptCLightningBolt = 73,
|
||||
sptCHeart = 74,
|
||||
sptCFrame = 75,
|
||||
sptCQuadArrow = 76,
|
||||
sptCLeftArrowCallout = 77,
|
||||
sptCRightArrowCallout = 78,
|
||||
sptCUpArrowCallout = 79,
|
||||
sptCDownArrowCallout = 80,
|
||||
sptCLeftRightArrowCallout = 81,
|
||||
sptCUpDownArrowCallout = 82,
|
||||
sptCQuadArrowCallout = 83,
|
||||
sptCBevel = 84,
|
||||
sptCLeftBracket = 85,
|
||||
sptCRightBracket = 86,
|
||||
sptCLeftBrace = 87,
|
||||
sptCRightBrace = 88,
|
||||
sptCLeftUpArrow = 89,
|
||||
sptCBentUpArrow = 90,
|
||||
sptCBentArrow = 91,
|
||||
sptCStar24 = 92,//
|
||||
sptCStripedRightArrow = 93,
|
||||
sptCNotchedRightArrow = 94,
|
||||
sptCBlockArc = 95,
|
||||
sptCSmileyFace = 96,
|
||||
sptCVerticalScroll = 97,
|
||||
sptCHorizontalScroll = 98,
|
||||
sptCCircularArrow = 99,
|
||||
sptCNotchedCircularArrow = 100,//
|
||||
sptCUturnArrow = 101,
|
||||
sptCCurvedRightArrow = 102,
|
||||
sptCCurvedLeftArrow = 103,
|
||||
sptCCurvedUpArrow = 104,
|
||||
sptCCurvedDownArrow = 105,
|
||||
sptCCloudCallout = 106,
|
||||
sptCEllipseRibbon = 107,
|
||||
sptCEllipseRibbon2 = 108,
|
||||
sptCFlowChartProcess = 109,
|
||||
sptCFlowChartDecision = 110,
|
||||
sptCFlowChartInputOutput = 111,
|
||||
sptCFlowChartPredefinedProcess = 112,
|
||||
sptCFlowChartInternalStorage = 113,
|
||||
sptCFlowChartDocument = 114,
|
||||
sptCFlowChartMultidocument = 115,
|
||||
sptCFlowChartTerminator = 116,
|
||||
sptCFlowChartPreparation = 117,
|
||||
sptCFlowChartManualInput = 118,
|
||||
sptCFlowChartManualOperation = 119,
|
||||
sptCFlowChartConnector = 120,
|
||||
sptCFlowChartPunchedCard = 121,
|
||||
sptCFlowChartPunchedTape = 122,
|
||||
sptCFlowChartSummingJunction = 123,
|
||||
sptCFlowChartOr = 124,
|
||||
sptCFlowChartCollate = 125,
|
||||
sptCFlowChartSort = 126,
|
||||
sptCFlowChartExtract = 127,
|
||||
sptCFlowChartMerge = 128,
|
||||
sptCFlowChartOfflineStorage = 129,
|
||||
sptCFlowChartOnlineStorage = 130,
|
||||
sptCFlowChartMagneticTape = 131,
|
||||
sptCFlowChartMagneticDisk = 132,
|
||||
sptCFlowChartMagneticDrum = 133,
|
||||
sptCFlowChartDisplay = 134,
|
||||
sptCFlowChartDelay = 135,
|
||||
sptCTextPlain = 136,
|
||||
sptCTextStop = 137,
|
||||
sptCTextTriangle = 138,
|
||||
sptCTextTriangleInverted = 139,
|
||||
sptCTextChevron = 140,
|
||||
sptCTextChevronInverted = 141,
|
||||
sptCTextRingInside = 142,
|
||||
sptCTextRingOutside = 143,
|
||||
sptCTextArchUp = 144,
|
||||
sptCTextArchDown = 145,
|
||||
sptCTextCircle = 146,
|
||||
sptCTextButton = 147,
|
||||
sptCTextArchUpPour = 148,
|
||||
sptCTextArchDownPour = 149,
|
||||
sptCTextCirclePour = 150,
|
||||
sptCTextButtonPour = 151,
|
||||
sptCTextCurveUp = 152,
|
||||
sptCTextCurveDown = 153,
|
||||
sptCTextCascadeUp = 154,
|
||||
sptCTextCascadeDown = 155,
|
||||
sptCTextWave1 = 156,
|
||||
sptCTextWave2 = 157,
|
||||
sptCTextWave3 = 158,//
|
||||
sptCTextWave4 = 159,
|
||||
sptCTextInflate = 160,
|
||||
sptCTextDeflate = 161,
|
||||
sptCTextInflateBottom = 162,
|
||||
sptCTextDeflateBottom = 163,
|
||||
sptCTextInflateTop = 164,
|
||||
sptCTextDeflateTop = 165,
|
||||
sptCTextDeflateInflate = 166,
|
||||
sptCTextDeflateInflateDeflate = 167,
|
||||
sptCTextFadeRight = 168,
|
||||
sptCTextFadeLeft = 169,
|
||||
sptCTextFadeUp = 170,
|
||||
sptCTextFadeDown = 171,
|
||||
sptCTextSlantUp = 172,
|
||||
sptCTextSlantDown = 173,
|
||||
sptCTextCanUp = 174,
|
||||
sptCTextCanDown = 175,
|
||||
sptCFlowChartAlternateProcess = 176,
|
||||
sptCFlowChartOffpageConnector = 177,
|
||||
sptCCallout90 = 178,//
|
||||
sptCAccentCallout90 = 179,//
|
||||
sptCBorderCallout90 = 180,//
|
||||
sptCAccentBorderCallout90 = 181,//
|
||||
sptCLeftRightUpArrow = 182,
|
||||
sptCSun = 183,
|
||||
sptCMoon = 184,
|
||||
sptCBracketPair = 185,
|
||||
sptCBracePair = 186,
|
||||
sptCStar4 = 187,//
|
||||
sptCDoubleWave = 188,
|
||||
sptCActionButtonBlank = 189,
|
||||
sptCActionButtonHome = 190,
|
||||
sptCActionButtonHelp = 191,
|
||||
sptCActionButtonInformation = 192,
|
||||
sptCActionButtonForwardNext = 193,
|
||||
sptCActionButtonBackPrevious = 194,
|
||||
sptCActionButtonEnd = 195,
|
||||
sptCActionButtonBeginning = 196,
|
||||
sptCActionButtonReturn = 197,
|
||||
sptCActionButtonDocument = 198,
|
||||
sptCActionButtonSound = 199,
|
||||
sptCActionButtonMovie = 200,
|
||||
sptCHostControl = 201,//
|
||||
sptCTextBox = 202,//
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
sptCChartPlus = 203,
|
||||
sptCChartStar,
|
||||
sptCChartX,
|
||||
sptCChord,
|
||||
sptCCloud,
|
||||
sptCCorner,
|
||||
sptCCornerTabs,
|
||||
sptCDecagon,
|
||||
sptCDiagStripe,
|
||||
sptCDodecagon,
|
||||
sptCFunnel,
|
||||
sptCGear6,
|
||||
sptCGear9,
|
||||
sptCHalfFrame,
|
||||
sptCHeptagon,
|
||||
sptCLeftCircularArrow,
|
||||
sptCLeftRightCircularArrow,
|
||||
sptCLeftRightRibbon,
|
||||
sptCLineInv,
|
||||
sptCMathDivide,
|
||||
sptCMathEqual,
|
||||
sptCMathMinus,
|
||||
sptCMathMultiply,
|
||||
sptCMathNotEqual,
|
||||
sptCMathPlus,
|
||||
sptCNonIsoscelesTrapezoid,
|
||||
sptCPie,
|
||||
sptCPieWedge,
|
||||
sptCPlaqueTabs,
|
||||
sptCRound1Rect,
|
||||
sptCRound2DiagRect,
|
||||
sptCRound2SameRect,
|
||||
sptCSnip1Rect,
|
||||
sptCSnip2DiagRect,
|
||||
sptCSnip2SameRect,
|
||||
sptCSnipRoundRect,
|
||||
sptCSquareTabs,
|
||||
sptCStar10,
|
||||
sptCStar12,
|
||||
//sptCStar16,
|
||||
//sptCStar24,
|
||||
//sptCStar32,
|
||||
//sptCStar4,
|
||||
//sptCStar5,
|
||||
sptCStar6,
|
||||
sptCStar7,
|
||||
//sptCStar8,
|
||||
sptCSwooshArrow,
|
||||
sptCTeardrop,
|
||||
sptCTextDoubleWave1,
|
||||
sptCTriangle,
|
||||
|
||||
sptMax,
|
||||
sptNil = 0x0FFF,
|
||||
sptCustom = 0x1000
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user