diff --git a/ASCOfficePPTFile/PPTFormatLib/Win32/PPTFormatLib.vcxproj b/ASCOfficePPTFile/PPTFormatLib/Win32/PPTFormatLib.vcxproj index bbb8080ea6..6a90b78c26 100644 --- a/ASCOfficePPTFile/PPTFormatLib/Win32/PPTFormatLib.vcxproj +++ b/ASCOfficePPTFile/PPTFormatLib/Win32/PPTFormatLib.vcxproj @@ -494,6 +494,7 @@ + diff --git a/ASCOfficePPTFile/PPTFormatLib/Win32/PPTFormatLib.vcxproj.filters b/ASCOfficePPTFile/PPTFormatLib/Win32/PPTFormatLib.vcxproj.filters index 9d33fa2602..fbdf1084bb 100644 --- a/ASCOfficePPTFile/PPTFormatLib/Win32/PPTFormatLib.vcxproj.filters +++ b/ASCOfficePPTFile/PPTFormatLib/Win32/PPTFormatLib.vcxproj.filters @@ -859,5 +859,8 @@ Records + + OOXWriter + \ No newline at end of file diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Timing/CTn.h b/ASCOfficePPTXFile/PPTXFormat/Logic/Timing/CTn.h index b7daa9d36d..699b44761d 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Timing/CTn.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Timing/CTn.h @@ -123,9 +123,9 @@ namespace PPTX XmlUtils::CNodeValue oValue; oValue.WriteNullable(stCondLst); - oValue.WriteNullable(iterate); oValue.WriteNullable(endCondLst); oValue.WriteNullable(endSync); + oValue.WriteNullable(iterate); oValue.WriteNullable(childTnLst); oValue.WriteNullable(subTnLst); @@ -161,18 +161,18 @@ namespace PPTX if (stCondLst.IsInit()) stCondLst->toXmlWriter(pWriter); - if (iterate.IsInit()) + if (endCondLst.IsInit()) + endCondLst->toXmlWriter(pWriter); + + if (endSync.IsInit()) + endSync->toXmlWriter(pWriter); + + if (iterate.IsInit()) iterate->toXmlWriter(pWriter); if (childTnLst.IsInit()) childTnLst->toXmlWriter(pWriter); - if (endCondLst.IsInit()) - endCondLst->toXmlWriter(pWriter); - - if (endSync.IsInit()) - endSync->toXmlWriter(pWriter); - if (subTnLst.IsInit()) subTnLst->toXmlWriter(pWriter); diff --git a/Common/OfficeFileFormatChecker.h b/Common/OfficeFileFormatChecker.h index 328fcd7543..c8798ff000 100644 --- a/Common/OfficeFileFormatChecker.h +++ b/Common/OfficeFileFormatChecker.h @@ -85,6 +85,7 @@ public: bool isRtfFormatFile (unsigned char* pBuffer,int dwBytes); bool isHtmlFormatFile (unsigned char* pBuffer,int dwBytes, bool testCloseTag); + bool isMultiPartsHtmlFormatFile(unsigned char* pBuffer, int dwBytes); bool isPdfFormatFile (unsigned char* pBuffer,int dwBytes, std::wstring & documentID); bool isOpenOfficeFlatFormatFile(unsigned char* pBuffer,int dwBytes); diff --git a/Common/OfficeFileFormatChecker2.cpp b/Common/OfficeFileFormatChecker2.cpp index 0f4e9ff4ec..003cd1dda7 100644 --- a/Common/OfficeFileFormatChecker2.cpp +++ b/Common/OfficeFileFormatChecker2.cpp @@ -53,6 +53,21 @@ bool COfficeFileFormatChecker::isRtfFormatFile(unsigned char* pBuffer,int dwByte return false; } +bool COfficeFileFormatChecker::isMultiPartsHtmlFormatFile(unsigned char* pBuffer, int dwBytes) +{ + if (pBuffer == NULL) return false; + + const char *contentTypeFormatLine1 = "Content-Type: multipart/related"; + const char *contentTypeFormatLine2 = "Content-Type: text/html"; // может быть и вне заданого буфера (todooo) + + std::string xml_string((char*)pBuffer, dwBytes); + + if ((std::string::npos != xml_string.find(contentTypeFormatLine1)) && (std::string::npos != xml_string.find(contentTypeFormatLine2))) + { + return true; + } + return false; +} bool COfficeFileFormatChecker::isHtmlFormatFile(unsigned char* pBuffer, int dwBytes, bool testCloseTag) { if (pBuffer == NULL || dwBytes < 4) return false; @@ -93,7 +108,7 @@ bool COfficeFileFormatChecker::isHtmlFormatFile(unsigned char* pBuffer, int dwBy } } } - return false; + return false; } bool COfficeFileFormatChecker::isBinaryDoctFormatFile (unsigned char* pBuffer,int dwBytes) @@ -513,6 +528,10 @@ bool COfficeFileFormatChecker::isOfficeFile(const std::wstring & _fileName) { nFileType = AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLS; // without compaund container } + else if (isMultiPartsHtmlFormatFile(buffer, sizeRead)) + { + nFileType = AVS_OFFICESTUDIO_FILE_DOCUMENT_MHT; + } //------------------------------------------------------------------------------------------------ file.CloseFile();