Commit f43a0bbf authored by ElenaSubbotina's avatar ElenaSubbotina

.

parent 746c2282
...@@ -1708,7 +1708,60 @@ namespace NExtractTools ...@@ -1708,7 +1708,60 @@ namespace NExtractTools
pptFile.put_TempDirectory(sTemp); pptFile.put_TempDirectory(sTemp);
long hRes = pptFile.LoadFromFile(sFrom, sTo, params.getPassword()); bool bMacros = false;
long hRes = pptFile.LoadFromFile(sFrom, sTo, params.getPassword(), bMacros);
if (AVS_ERROR_DRM == hRes)
{
if(!params.getDontSaveAdditional())
{
copyOrigin(sFrom, *params.m_sFileTo);
}
return AVS_FILEUTILS_ERROR_CONVERT_DRM;
}
else if (AVS_ERROR_PASSWORD == hRes)
{
return AVS_FILEUTILS_ERROR_CONVERT_PASSWORD;
}
return 0 == hRes ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
}
// ppt -> pptm
int ppt2pptm (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params)
{
std::wstring sResultPptxDir = sTemp + FILE_SEPARATOR_STR + _T("pptx_unpacked");
NSDirectory::CreateDirectory(sResultPptxDir);
int hRes = ppt2pptm_dir(sFrom, sResultPptxDir, sTemp, params);
if(SUCCEEDED_X2T(hRes))
{
COfficeUtils oCOfficeUtils(NULL);
if(S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultPptxDir, sTo, true))
return 0;
}
else if (AVS_ERROR_DRM == hRes)
{
if(!params.getDontSaveAdditional())
{
copyOrigin(sFrom, *params.m_sFileTo);
}
return AVS_FILEUTILS_ERROR_CONVERT_DRM;
}
else if (AVS_ERROR_PASSWORD == hRes)
{
return AVS_FILEUTILS_ERROR_CONVERT_PASSWORD;
}
return AVS_FILEUTILS_ERROR_CONVERT;
}
int ppt2pptm_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params)
{
COfficePPTFile pptFile;
pptFile.put_TempDirectory(sTemp);
bool bMacros = true;
long hRes = pptFile.LoadFromFile(sFrom, sTo, params.getPassword(), bMacros);
if (AVS_ERROR_DRM == hRes) if (AVS_ERROR_DRM == hRes)
{ {
...@@ -1753,7 +1806,8 @@ namespace NExtractTools ...@@ -1753,7 +1806,8 @@ namespace NExtractTools
pptFile.put_TempDirectory(sTemp); pptFile.put_TempDirectory(sTemp);
long nRes = pptFile.LoadFromFile(sFrom, sTempUnpackedPPTX, params.getPassword()); bool bMacros = true;
long nRes = pptFile.LoadFromFile(sFrom, sTempUnpackedPPTX, params.getPassword(), bMacros);
if (SUCCEEDED_X2T(nRes)) if (SUCCEEDED_X2T(nRes))
{ {
...@@ -3970,6 +4024,10 @@ namespace NExtractTools ...@@ -3970,6 +4024,10 @@ namespace NExtractTools
case TCD_PPT2PPTX: case TCD_PPT2PPTX:
{ {
result = ppt2pptx (sFileFrom, sFileTo, sTempDir, oInputParams); result = ppt2pptx (sFileFrom, sFileTo, sTempDir, oInputParams);
}break;
case TCD_PPT2PPTM:
{
result = ppt2pptm (sFileFrom, sFileTo, sTempDir, oInputParams);
}break; }break;
case TCD_PPT2PPTT: case TCD_PPT2PPTT:
{ {
......
...@@ -115,6 +115,8 @@ namespace NExtractTools ...@@ -115,6 +115,8 @@ namespace NExtractTools
int ppt2pptx_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params); int ppt2pptx_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
int ppt2pptt_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params); int ppt2pptt_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
int ppt2pptt (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params); int ppt2pptt (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
int ppt2pptm (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
int ppt2pptm_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
int rtf2docx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params); int rtf2docx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
int rtf2docx_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params); int rtf2docx_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
......
...@@ -261,7 +261,7 @@ namespace NExtractTools ...@@ -261,7 +261,7 @@ namespace NExtractTools
case AVS_OFFICESTUDIO_FILE_PRESENTATION_PPT: case AVS_OFFICESTUDIO_FILE_PRESENTATION_PPT:
{ {
if (0 == sExt2.compare(_T(".pptx"))) res = TCD_PPT2PPTX; if (0 == sExt2.compare(_T(".pptx"))) res = TCD_PPT2PPTX;
else if (0 == sExt2.compare(_T(".pptm"))) res = TCD_PPT2PPTX; else if (0 == sExt2.compare(_T(".pptm"))) res = TCD_PPT2PPTM;
else if (0 == sExt2.compare(_T(".bin"))) res = TCD_PPT2PPTT_BIN; else if (0 == sExt2.compare(_T(".bin"))) res = TCD_PPT2PPTT_BIN;
else if (0 == sExt2.compare(_T(".pptt"))) res = TCD_PPT2PPTT; else if (0 == sExt2.compare(_T(".pptt"))) res = TCD_PPT2PPTT;
}break; }break;
......
...@@ -108,6 +108,7 @@ namespace NExtractTools ...@@ -108,6 +108,7 @@ namespace NExtractTools
TCD_PPT2PPTX, TCD_PPT2PPTX,
TCD_PPT2PPTT, TCD_PPT2PPTT,
TCD_PPT2PPTT_BIN, TCD_PPT2PPTT_BIN,
TCD_PPT2PPTM,
//doc 2 //doc 2
TCD_DOC2DOCT, TCD_DOC2DOCT,
TCD_DOC2DOCT_BIN, TCD_DOC2DOCT_BIN,
...@@ -953,6 +954,9 @@ namespace NExtractTools ...@@ -953,6 +954,9 @@ namespace NExtractTools
} }
else if (0 == sArg3.compare(_T("ppt2pptx"))) { else if (0 == sArg3.compare(_T("ppt2pptx"))) {
res = TCD_PPT2PPTX; res = TCD_PPT2PPTX;
}
else if (0 == sArg3.compare(_T("ppt2pptm"))) {
res = TCD_PPT2PPTM;
} }
else if (0 == sArg3.compare(_T("doc2docx"))) { else if (0 == sArg3.compare(_T("doc2docx"))) {
res = TCD_DOC2DOCX; res = TCD_DOC2DOCX;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment