Commit f9e80f36 authored by ElenaSubbotina's avatar ElenaSubbotina

variations for oox formats

parent 2d570818
......@@ -358,26 +358,34 @@ bool COfficeFileFormatChecker::isOOXFormatFile(const std::wstring & fileName)
std::string::size_type res1 = std::string::npos;
std::string::size_type res = 0;
if ((std::string::npos != strContentTypes.find(docxFormatLine)) ||
(std::string::npos != strContentTypes.find(dotxFormatLine)) ||
(std::string::npos != strContentTypes.find(docmFormatLine)) ||
(std::string::npos != strContentTypes.find(dotmFormatLine)))
(std::string::npos != strContentTypes.find(docmFormatLine)))
{
nFileType = AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX;
}
else if ((std::string::npos != strContentTypes.find(xlsxFormatLine)) ||
(std::string::npos != strContentTypes.find(xltxFormatLine)) ||
(std::string::npos != strContentTypes.find(xlsmFormatLine)) ||
(std::string::npos != strContentTypes.find(xltmFormatLine)))
else if ((std::string::npos != strContentTypes.find(dotxFormatLine)))
{
nFileType = AVS_OFFICESTUDIO_FILE_DOCUMENT_DOTX;
}
else if ((std::string::npos != strContentTypes.find(dotmFormatLine)))
{
nFileType = AVS_OFFICESTUDIO_FILE_DOCUMENT_DOTM;
}
else if ((std::string::npos != strContentTypes.find(xlsxFormatLine)) ||
(std::string::npos != strContentTypes.find(xlsmFormatLine)))
{
nFileType = AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX;
}
else if ((std::string::npos != strContentTypes.find(pptxFormatLine)) ||
(std::string::npos != strContentTypes.find(potxFormatLine)) ||
else if ((std::string::npos != strContentTypes.find(xltxFormatLine)))
{
nFileType = AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLTX;
}
else if ((std::string::npos != strContentTypes.find(xltmFormatLine)))
{
nFileType = AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLTM;
}
else if ((std::string::npos != strContentTypes.find(pptxFormatLine)) ||
(std::string::npos != strContentTypes.find(pptmFormatLine)) ||
(std::string::npos != strContentTypes.find(ppsmFormatLine)) ||
(std::string::npos != strContentTypes.find(potmFormatLine)))
(std::string::npos != strContentTypes.find(ppsmFormatLine)))
{
nFileType = AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX;
}
......@@ -385,7 +393,14 @@ bool COfficeFileFormatChecker::isOOXFormatFile(const std::wstring & fileName)
{
nFileType = AVS_OFFICESTUDIO_FILE_PRESENTATION_PPSX;
}
else if ((std::string::npos != strContentTypes.find(potxFormatLine)))
{
nFileType = AVS_OFFICESTUDIO_FILE_PRESENTATION_POTX;
}
else if ((std::string::npos != strContentTypes.find(potmFormatLine)))
{
nFileType = AVS_OFFICESTUDIO_FILE_PRESENTATION_POTM;
}
delete []pBuffer;
pBuffer = NULL;
......@@ -519,6 +534,9 @@ std::wstring COfficeFileFormatChecker::GetExtensionByType(int type)
switch (type)
{
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX: return L".docx";
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCM: return L".docm";
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOTX: return L".dotx";
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOTM: return L".dotm";
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOC: return L".doc";
case AVS_OFFICESTUDIO_FILE_DOCUMENT_ODT: return L".odt";
case AVS_OFFICESTUDIO_FILE_DOCUMENT_RTF: return L".rtf";
......@@ -530,11 +548,17 @@ std::wstring COfficeFileFormatChecker::GetExtensionByType(int type)
case AVS_OFFICESTUDIO_FILE_DOCUMENT_MOBI: return L".mobi";
case AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX: return L".pptx";
case AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTM: return L".pptm";
case AVS_OFFICESTUDIO_FILE_PRESENTATION_PPT: return L".ppt";
case AVS_OFFICESTUDIO_FILE_PRESENTATION_ODP: return L".odp";
case AVS_OFFICESTUDIO_FILE_PRESENTATION_PPSX: return L".ppsx";
case AVS_OFFICESTUDIO_FILE_PRESENTATION_POTX: return L".potx";
case AVS_OFFICESTUDIO_FILE_PRESENTATION_POTM: return L".potm";
case AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX: return L".xlsx";
case AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSM: return L".xlsm";
case AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLTX: return L".xltx";
case AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLTM: return L".xltm";
case AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLS: return L".xls";
case AVS_OFFICESTUDIO_FILE_SPREADSHEET_ODS: return L".ods";
case AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV: return L".csv";
......@@ -581,6 +605,12 @@ int COfficeFileFormatChecker::GetFormatByExtension(const std::wstring& ext)
{
if (L".docx" == ext)
return AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX;
if (L".docm" == ext)
return AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCM;
if (L".dotx" == ext)
return AVS_OFFICESTUDIO_FILE_DOCUMENT_DOTX;
if (L".dotm" == ext)
return AVS_OFFICESTUDIO_FILE_DOCUMENT_DOTM;
if (L".doc" == ext)
return AVS_OFFICESTUDIO_FILE_DOCUMENT_DOC;
if (L".odt" == ext)
......@@ -603,15 +633,27 @@ int COfficeFileFormatChecker::GetFormatByExtension(const std::wstring& ext)
if (L".pptx" == ext)
return AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX;
if (L".pptm" == ext)
return AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTM;
if (L".ppt" == ext)
return AVS_OFFICESTUDIO_FILE_PRESENTATION_PPT;
if (L".odp" == ext)
return AVS_OFFICESTUDIO_FILE_PRESENTATION_ODP;
if (L".ppsx" == ext)
return AVS_OFFICESTUDIO_FILE_PRESENTATION_PPSX;
if (L".potx" == ext)
return AVS_OFFICESTUDIO_FILE_PRESENTATION_POTX;
if (L".potm" == ext)
return AVS_OFFICESTUDIO_FILE_PRESENTATION_POTM;
if (L".xlsx" == ext)
return AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX;
if (L".xlsm" == ext)
return AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSM;
if (L".xltx" == ext)
return AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLTX;
if (L".xltm" == ext)
return AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLTM;
if (L".xls" == ext)
return AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLS;
if (L".ods" == ext)
......
......@@ -44,18 +44,27 @@
#define AVS_OFFICESTUDIO_FILE_DOCUMENT_EPUB AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0008
#define AVS_OFFICESTUDIO_FILE_DOCUMENT_FB2 AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0009
#define AVS_OFFICESTUDIO_FILE_DOCUMENT_MOBI AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x000a
#define AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCM AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x000b
#define AVS_OFFICESTUDIO_FILE_DOCUMENT_DOTX AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x000c
#define AVS_OFFICESTUDIO_FILE_DOCUMENT_DOTM AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x000d
#define AVS_OFFICESTUDIO_FILE_PRESENTATION 0x0080
#define AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0001
#define AVS_OFFICESTUDIO_FILE_PRESENTATION_PPT AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0002
#define AVS_OFFICESTUDIO_FILE_PRESENTATION_ODP AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0003
#define AVS_OFFICESTUDIO_FILE_PRESENTATION_PPSX AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0004
#define AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTM AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0005
#define AVS_OFFICESTUDIO_FILE_PRESENTATION_POTX AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0006
#define AVS_OFFICESTUDIO_FILE_PRESENTATION_POTM AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x0007
#define AVS_OFFICESTUDIO_FILE_SPREADSHEET 0x0100
#define AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0001
#define AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLS AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0002
#define AVS_OFFICESTUDIO_FILE_SPREADSHEET_ODS AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0003
#define AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0004
#define AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSM AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0005
#define AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLTX AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0006
#define AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLTM AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0007
#define AVS_OFFICESTUDIO_FILE_CROSSPLATFORM 0x0200
#define AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDF AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0001
......
This diff is collapsed.
......@@ -55,12 +55,22 @@ namespace NExtractTools
int doct_bin2docx_dir (const std::wstring &sFrom, const std::wstring &sToResult, const std::wstring &sTo, bool bFromChanges, const std::wstring &sThemeDir, InputParams& params);
int doct2docx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, bool bFromChanges, const std::wstring &sThemeDir, InputParams& params);
int xlsx2xlst_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
int dotx2docx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
int dotx2docx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
int dotm2docm (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
int dotm2docm_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
int xlsx2xlst_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
int xlsx_dir2xlst_bin (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params, bool bXmlOptions);
int xlsx2xlst (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
int xlst_bin2xlsx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, bool bFromChanges, const std::wstring &sThemeDir, InputParams& params);
int xlst_bin2xlsx_dir (const std::wstring &sFrom, const std::wstring &sToResult, const std::wstring &sTo, bool bFromChanges, const std::wstring &sThemeDir, InputParams& params);
int xlst2xlsx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, bool bFromChanges, const std::wstring &sThemeDir, InputParams& params);
int xltx2xlsx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
int xltx2xlsx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
int xltm2xlsm (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
int xltm2xlsm_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
int pptx2pptt_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
int pptx_dir2pptt_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
......@@ -80,6 +90,10 @@ namespace NExtractTools
int ppsx2pptx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
int ppsx2pptx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
int potx2pptx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
int potx2pptx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
int potm2pptm (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
int potm2pptm_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
int ppt2pptx (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);
......
......@@ -109,25 +109,45 @@ namespace NExtractTools
switch (OfficeFileFormatChecker.nFileType)
{
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX:
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCM:
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOTX:
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOTM:
{
if (0 == sExt2.compare(_T(".doct"))) res = TCD_DOCX2DOCT;
else if (0 == sExt2.compare(_T(".bin"))) res = TCD_DOCX2DOCT_BIN;
else if (0 == sExt2.compare(_T(".rtf"))) res = TCD_DOCX2RTF;
else if (0 == sExt2.compare(_T(".odt"))) res = TCD_DOCX2ODT;
else if (0 == sExt2.compare(_T(".docx"))) res = TCD_DOTX2DOCX;
else if (0 == sExt2.compare(_T(".docm"))) res = TCD_DOTM2DOCM;
}break;
case AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX:
case AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSM:
case AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLTX:
case AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLTM:
{
if (0 == sExt2.compare(_T(".xlst"))) res = TCD_XLSX2XLST;
else if (0 == sExt2.compare(_T(".bin"))) res = TCD_XLSX2XLST_BIN;
else if (0 == sExt2.compare(_T(".csv"))) res = TCD_XLSX2CSV;
else if (0 == sExt2.compare(_T(".ods"))) res = TCD_XLSX2ODS;
else if (0 == sExt2.compare(_T(".xlsx"))) res = TCD_XLTX2XLSX;
else if (0 == sExt2.compare(_T(".xlsm"))) res = TCD_XLTM2XLSM;
}break;
case AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX:
case AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTM:
case AVS_OFFICESTUDIO_FILE_PRESENTATION_PPSX:
case AVS_OFFICESTUDIO_FILE_PRESENTATION_POTX:
case AVS_OFFICESTUDIO_FILE_PRESENTATION_POTM:
{
if (0 == sExt2.compare(_T(".bin"))) res = TCD_PPTX2PPTT_BIN;
else if (0 == sExt2.compare(_T(".pptt"))) res = TCD_PPTX2PPTT;
else if (0 == sExt2.compare(_T(".pptx"))) res = TCD_PPSX2PPTX;
else if (0 == sExt2.compare(_T(".pptx")))
{
if (OfficeFileFormatChecker.nFileType == AVS_OFFICESTUDIO_FILE_PRESENTATION_PPSX)
res = TCD_PPSX2PPTX;
if (OfficeFileFormatChecker.nFileType == AVS_OFFICESTUDIO_FILE_PRESENTATION_POTX)
res = TCD_POTX2PPTX;
}
else if (0 == sExt2.compare(_T(".pptm"))) res = TCD_POTM2PPTM;
else if (0 == sExt2.compare(_T(".odp"))) res = TCD_PPTX2ODP;
}break;
case AVS_OFFICESTUDIO_FILE_TEAMLAB_DOCY:
......
......@@ -62,16 +62,23 @@ namespace NExtractTools
TCD_DOCT2DOCX,
TCD_DOCX2DOCT_BIN,
TCD_DOCT_BIN2DOCX,
TCD_DOTX2DOCX,
TCD_DOTM2DOCM,
TCD_XLSX2XLST,
TCD_XLST2XLSX,
TCD_XLSX2XLST_BIN,
TCD_XLST_BIN2XLSX,
TCD_XLTX2XLSX,
TCD_XLTM2XLSM,
TCD_PPTX2PPTT,
TCD_PPTT2PPTX,
TCD_PPTX2PPTT_BIN,
TCD_PPTT_BIN2PPTX,
TCD_PPSX2PPTX,
TCD_POTX2PPTX,
TCD_POTM2PPTM,
TCD_ZIPDIR,
TCD_UNZIPDIR,
......@@ -89,7 +96,6 @@ namespace NExtractTools
TCD_T2BIN,
TCD_BIN2T,
TCD_PPSX2PPTX,
//ppt 2
TCD_PPT2PPTX,
TCD_PPT2PPTT,
......@@ -136,7 +142,7 @@ namespace NExtractTools
TCD_PPTT2ODP,
TCD_PPTX_BIN2ODP,
TCD_XML2DOCX,
TCD_XML2DOCX,
TCD_DOCX2XML,
//
TCD_MSCRYPT2,
......@@ -718,7 +724,7 @@ namespace NExtractTools
int nDelimitersCount = 6;
int aDelimiters[6] = { 0, 0, 0, 0, 0, 0 };
for(int i = 0; i < dwBytesRead; ++i)
for (DWORD i = 0; i < dwBytesRead; ++i)
{
char cCurChar = pBuffer[i];
if ('\n' == cCurChar)
......@@ -900,7 +906,25 @@ namespace NExtractTools
else if (0 == sArg3.compare(_T("ppsx2pptx"))) {
res = TCD_PPSX2PPTX;
}
else if (0 == sArg3.compare(_T("ppt2pptx"))) {
else if (0 == sArg3.compare(_T("potx2pptx"))) {
res = TCD_POTX2PPTX;
}
else if (0 == sArg3.compare(_T("potm2pptm"))) {
res = TCD_POTM2PPTM;
}
else if (0 == sArg3.compare(_T("xltx2xlsx"))) {
res = TCD_XLTX2XLSX;
}
else if (0 == sArg3.compare(_T("xltm2xlsm"))) {
res = TCD_XLTM2XLSM;
}
else if (0 == sArg3.compare(_T("dotx2docx"))) {
res = TCD_DOTX2DOCX;
}
else if (0 == sArg3.compare(_T("dotm2docm"))) {
res = TCD_DOTM2DOCM;
}
else if (0 == sArg3.compare(_T("ppt2pptx"))) {
res = TCD_PPT2PPTX;
}
else if (0 == sArg3.compare(_T("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