DocFormatReader - странности при сохранении формул из docx в doc

This commit is contained in:
ElenaSubbotina
2016-04-08 14:47:16 +03:00
committed by Alexander Trofimov
parent 1a05729019
commit 1e54cf2602
4 changed files with 28 additions and 37 deletions

View File

@ -1,29 +1,36 @@
// DocFormatTest.cpp : Defines the entry point for the console application.
//
#include "../../../../ASCOfficeDocFile/DocFormatLib/DocFormatLib.h"
#include "../DocFormatLib/DocFormatLib.h"
#include "../../../../ASCOfficeDocFile/win32/ASCOfficeCriticalSection.h"
#include "../win32/ASCOfficeCriticalSection.h"
#include "../../OfficeUtils/src/OfficeUtils.h"
#include "../../Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.h"
#include <string>
#include <tchar.h>
int _tmain(int argc, _TCHAR* argv[])
{
std::wstring sSrcDoc = _T("d:\\test\\_doc\\PZ.doc");
std::wstring sResBackDocx = _T("d:\\test\\_doc\\PZ.doc-my.docx");
std::wstring sSrcDoc = argv[1];
std::wstring sDstDocx = argv[2];
std::wstring sTemp = _T("d:\\home/lena/Documents/temp");
std::wstring sXMLOptions = _T("");
std::wstring outputDir = FileSystem::Directory::GetFolderPath(sDstDocx);
std::wstring dstTempPath = FileSystem::Directory::CreateDirectoryWithUniqueName(outputDir);
// doc->docx
COfficeDocFile docFile;
docFile.put_TempDirectory(sTemp);
HRESULT hRes = docFile.LoadFromFile( sSrcDoc, sResBackDocx, NULL);
HRESULT hRes = docFile.LoadFromFile( sSrcDoc, dstTempPath, NULL);
if (hRes != S_OK)return 2;
COfficeUtils oCOfficeUtils(NULL);
if (S_OK != oCOfficeUtils.CompressFileOrDirectory(dstTempPath.c_str(), sDstDocx, -1))
return 1;
FileSystem::Directory::DeleteDirectory(dstTempPath);
return 0;
}