mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-20 01:04:34 +08:00
.
This commit is contained in:
@ -37,7 +37,9 @@
|
||||
#include "PPTDocumentInfo.h"
|
||||
|
||||
#define CURRENT_USER_STREAM "Current User"
|
||||
|
||||
#define DOCUMENT_STREAM "PowerPoint Document"
|
||||
|
||||
#define PICTURE_STREAM "Pictures"
|
||||
#define HEADER_STREAM "Header"
|
||||
|
||||
@ -58,21 +60,26 @@ public:
|
||||
m_bDualStorage = false;
|
||||
|
||||
POLE::Stream *pStm = new POLE::Stream( m_pPowerPointStg, CURRENT_USER_STREAM);
|
||||
if (pStm == NULL) return;
|
||||
|
||||
if ( ReadCurrentUser(pStm))
|
||||
m_bIsPPTFile = TRUE;
|
||||
if ( ReadCurrentUser(pStm) )
|
||||
{
|
||||
m_bIsPPTFile = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
RELEASEOBJECT(pStm);
|
||||
|
||||
|
||||
std::string stream_name = std::string(PP97_DUALSTORAGE) + std::string("/") + std::string(CURRENT_USER_STREAM);
|
||||
pStm = new POLE::Stream( m_pPowerPointStg, stream_name);
|
||||
if (pStm == NULL) return;
|
||||
|
||||
if (pStm == NULL)
|
||||
return;
|
||||
|
||||
m_bDualStorage = true;
|
||||
if ( ReadCurrentUser(pStm))
|
||||
m_bIsPPTFile = TRUE;
|
||||
if ( ReadCurrentUser(pStm))
|
||||
{
|
||||
m_bIsPPTFile = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
RELEASEOBJECT(pStm);
|
||||
@ -126,6 +133,8 @@ protected:
|
||||
|
||||
bool ReadCurrentUser(POLE::Stream *pStm)
|
||||
{
|
||||
if (!pStm) return false;
|
||||
|
||||
SRecordHeader oHeader;
|
||||
bool isPP = false;
|
||||
|
||||
|
||||
@ -83,15 +83,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jbig", "..\..\DesktopEditor
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jbig2", "..\..\DesktopEditor\raster\JBig2\win32\jbig2.vcproj", "{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficePPTFile", "ASCOfficePPTFile.vcproj", "{C1E5043D-4844-4893-980D-BD79CDCD05C1}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363} = {F8274B05-168E-4D6E-B843-AA7510725363}
|
||||
{7B27E40E-F70A-4A74-A77C-0944D7931D15} = {7B27E40E-F70A-4A74-A77C-0944D7931D15}
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302} = {36636678-AE25-4BE6-9A34-2561D1BCF302}
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OfficeUtilsLib", "..\..\OfficeUtils\win32\OfficeUtilsLib.vcproj", "{F8274B05-168E-4D6E-B843-AA7510725363}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PptFormatTest", "PptFormatTest\PptFormatTest.vcproj", "{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}"
|
||||
@ -538,28 +529,6 @@ Global
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Unicode Release|Win32.Build.0 = Release|Win32
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Unicode Release|x64.ActiveCfg = Release|x64
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Unicode Release|x64.Build.0 = Release|x64
|
||||
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Debug|x64.Build.0 = Debug|x64
|
||||
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Release|Win32.Build.0 = Release|Win32
|
||||
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Release|x64.ActiveCfg = Release|x64
|
||||
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Release|x64.Build.0 = Release|x64
|
||||
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.ReleaseASC|Win32.ActiveCfg = Release|x64
|
||||
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.ReleaseASC|x64.ActiveCfg = Release|x64
|
||||
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.ReleaseASC|x64.Build.0 = Release|x64
|
||||
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.ReleaseOpenSource|Win32.ActiveCfg = Release|x64
|
||||
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.ReleaseOpenSource|x64.ActiveCfg = Release|x64
|
||||
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.ReleaseOpenSource|x64.Build.0 = Release|x64
|
||||
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Unicode Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Unicode Debug|Win32.Build.0 = Debug|Win32
|
||||
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Unicode Debug|x64.ActiveCfg = Debug|x64
|
||||
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Unicode Debug|x64.Build.0 = Debug|x64
|
||||
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Unicode Release|Win32.ActiveCfg = Release|Win32
|
||||
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Unicode Release|Win32.Build.0 = Release|Win32
|
||||
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Unicode Release|x64.ActiveCfg = Release|x64
|
||||
{C1E5043D-4844-4893-980D-BD79CDCD05C1}.Unicode Release|x64.Build.0 = Release|x64
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Debug|x64.ActiveCfg = Debug|x64
|
||||
|
||||
@ -47,21 +47,22 @@ int _tmain(int argc, _TCHAR* argv[])
|
||||
std::wstring dstTempPath = FileSystem::Directory::CreateDirectoryWithUniqueName(outputDir);
|
||||
|
||||
std::wstring tempPath = FileSystem::Directory::CreateDirectoryWithUniqueName(outputDir);
|
||||
// Ppt->Pptx
|
||||
COfficePPTFile pptFile;
|
||||
|
||||
pptFile.put_TempDirectory(tempPath);
|
||||
|
||||
HRESULT hRes = pptFile.LoadFromFile(sSrcPpt, dstTempPath);
|
||||
COfficePPTFile pptFile;
|
||||
|
||||
if (hRes != S_OK)return 2;
|
||||
|
||||
COfficeUtils oCOfficeUtils(NULL);
|
||||
if (S_OK != oCOfficeUtils.CompressFileOrDirectory(dstTempPath.c_str(), sDstPptx, -1))
|
||||
return 1;
|
||||
pptFile.put_TempDirectory(tempPath);
|
||||
|
||||
HRESULT hRes = pptFile.LoadFromFile(sSrcPpt, dstTempPath);
|
||||
|
||||
if (hRes == S_OK)
|
||||
{
|
||||
COfficeUtils oCOfficeUtils(NULL);
|
||||
hRes = oCOfficeUtils.CompressFileOrDirectory(dstTempPath.c_str(), sDstPptx, -1);
|
||||
}
|
||||
|
||||
FileSystem::Directory::DeleteDirectory(dstTempPath);
|
||||
FileSystem::Directory::DeleteDirectory(tempPath);
|
||||
return 0;
|
||||
|
||||
return hRes;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user