From c2605bb582437b645c07da9ae9a38de60a758343 Mon Sep 17 00:00:00 2001 From: ElenaSubbotina Date: Thu, 26 Oct 2017 12:55:06 +0300 Subject: [PATCH] x2t - vps --- .../DocDocxConverter/OpenXmlPackage.cpp | 8 +- .../TablePropertyExceptions.h | 5 +- .../DocDocxConverter/VMLShapeMapping.cpp | 2 +- .../WordprocessingDocument.cpp | 2 +- .../BinWriter/BinEquationWriter.h | 10 +- ASCOfficeOdfFile/include/cpdoccore/CPHash.h | 55 ------ ASCOfficeOdfFile/linux/OdfFileReaderLib.pro | 1 - .../src/docx/docx_conversion_context.h | 5 +- .../src/docx/oox_chart_legend.cpp | 2 +- ASCOfficeOdfFile/src/docx/oox_chart_shape.cpp | 2 +- ASCOfficeOdfFile/src/docx/oox_data_labels.cpp | 2 +- ASCOfficeOdfFile/src/docx/oox_layout.cpp | 2 +- ASCOfficeOdfFile/src/docx/oox_plot_area.cpp | 2 +- ASCOfficeOdfFile/src/docx/oox_title.cpp | 2 +- ASCOfficeOdfFile/src/docx/xlsx_border.cpp | 2 +- ASCOfficeOdfFile/src/odf/odf_content_xml.cpp | 4 - .../src/odf/table_calculation_settings.cpp | 6 +- ASCOfficeOdfFile/src/odf/table_xlsx.cpp | 1 - ASCOfficeOdfFile/win32/cpcommon.vcproj | 4 - .../source/OdfFormat/odf_drawing_context.cpp | 2 - .../OdfFormat/office_elements_create.cpp | 7 +- .../source/Oox2OdfConverter/DocxConverter.cpp | 4 +- .../source/Oox2OdfConverter/PptxConverter.cpp | 3 +- .../PPTFormatLib/PPTXWriter/Converter.cpp | 2 +- .../PPTFormatLib/PPTXWriter/ShapeWriter.cpp | 4 +- .../PPTFormatLib/Reader/PPTDocumentInfo.h | 2 +- .../Reader/PPTDocumentInfoOneUser.cpp | 4 +- .../Records/Animations/AnimationTypes.h | 161 +++++++----------- .../Records/Drawing/GroupShapeContainer.h | 2 +- .../PPTFormatLib/Records/ExOleObjAtom.h | 4 +- .../PPTFormatLib/Records/VBAInfoAtom.h | 2 +- .../PPTXFormat/Logic/Geometry.cpp | 2 + .../PPTXFormat/Logic/GraphicFrame.cpp | 1 - .../PPTXFormat/Logic/Timing/AnimMotion.h | 2 +- .../source/XlsXlsxConverter/XlsConverter.cpp | 2 +- Common/OfficeFileFormatChecker2.cpp | 4 - .../fontconverter/FontFileType1.cpp | 2 +- 37 files changed, 113 insertions(+), 214 deletions(-) delete mode 100644 ASCOfficeOdfFile/include/cpdoccore/CPHash.h diff --git a/ASCOfficeDocFile/DocDocxConverter/OpenXmlPackage.cpp b/ASCOfficeDocFile/DocDocxConverter/OpenXmlPackage.cpp index 468c2633f5..b556504c7b 100644 --- a/ASCOfficeDocFile/DocDocxConverter/OpenXmlPackage.cpp +++ b/ASCOfficeDocFile/DocDocxConverter/OpenXmlPackage.cpp @@ -142,9 +142,11 @@ namespace DocFileFormat } HRESULT OpenXmlPackage::SaveOLEObject( const std::wstring& fileName, const OleObjectFileStructure& oleObjectFileStructure ) { - POLE::Storage *storageOut = new POLE::Storage(fileName.c_str()); - - if (storageOut == NULL || docFile == NULL) return S_FALSE; + if (docFile == NULL) return S_FALSE; + + POLE::Storage *storageOut = new POLE::Storage(fileName.c_str()); + if (storageOut == NULL) return S_FALSE; + if (storageOut->open(true, true)==false) { delete storageOut; diff --git a/ASCOfficeDocFile/DocDocxConverter/TablePropertyExceptions.h b/ASCOfficeDocFile/DocDocxConverter/TablePropertyExceptions.h index 72a2bbb695..cfd17e7579 100644 --- a/ASCOfficeDocFile/DocDocxConverter/TablePropertyExceptions.h +++ b/ASCOfficeDocFile/DocDocxConverter/TablePropertyExceptions.h @@ -62,8 +62,9 @@ namespace DocFileFormat for (std::list::iterator oSpmIter = papx->grpprl->begin(); oSpmIter != papx->grpprl->end(); ++oSpmIter) { - if (oSpmIter->OpCode == sprmTDefTableShd || oSpmIter->OpCode == sprmTDefTableShd2nd || - oSpmIter->OpCode == sprmTDefTableShd2nd || oSpmIter->OpCode == sprmTDefTableShd3rd) + if (oSpmIter->OpCode == sprmTDefTableShd || + oSpmIter->OpCode == sprmTDefTableShd2nd || + oSpmIter->OpCode == sprmTDefTableShd3rd) { m_bSkipShading97 = TRUE; } diff --git a/ASCOfficeDocFile/DocDocxConverter/VMLShapeMapping.cpp b/ASCOfficeDocFile/DocDocxConverter/VMLShapeMapping.cpp index 883ce4b036..9aa7da2a1c 100644 --- a/ASCOfficeDocFile/DocDocxConverter/VMLShapeMapping.cpp +++ b/ASCOfficeDocFile/DocDocxConverter/VMLShapeMapping.cpp @@ -744,7 +744,7 @@ namespace DocFileFormat text = FormatUtils::XmlEncode(text); - if (0 <= text.find(L"\n")) + if (std::wstring::npos != text.find(L"\n")) { m_textpath.AppendText(text); } diff --git a/ASCOfficeDocFile/DocDocxConverter/WordprocessingDocument.cpp b/ASCOfficeDocFile/DocDocxConverter/WordprocessingDocument.cpp index 3557378869..5b79de221b 100644 --- a/ASCOfficeDocFile/DocDocxConverter/WordprocessingDocument.cpp +++ b/ASCOfficeDocFile/DocDocxConverter/WordprocessingDocument.cpp @@ -71,7 +71,7 @@ namespace ImageHelper __BITMAPINFOHEADER * header = (__BITMAPINFOHEADER*)data; if (!header) return result; - result == Global::msoblipDIB; + result = Global::msoblipDIB; if (header->biWidth > 100000 || header->biHeight > 100000 || header->biSize != 40) { diff --git a/ASCOfficeDocxFile2/BinWriter/BinEquationWriter.h b/ASCOfficeDocxFile2/BinWriter/BinEquationWriter.h index 17c905adc3..40036384d8 100644 --- a/ASCOfficeDocxFile2/BinWriter/BinEquationWriter.h +++ b/ASCOfficeDocxFile2/BinWriter/BinEquationWriter.h @@ -557,11 +557,11 @@ namespace MathEquation BYTE horAlign; switch(eHorAlign) { - case matrixhoralignLeft: horAlign = SimpleTypes::xalignLeft; - case matrixhoralignCenter: horAlign = SimpleTypes::xalignCenter; - case matrixhoralignRight: horAlign = SimpleTypes::xalignRight; - case matrixhoralignEqualSign: horAlign = SimpleTypes::xalignCenter; - case matrixhoralignCommaSign: horAlign = SimpleTypes::xalignCenter; + case matrixhoralignLeft: horAlign = SimpleTypes::xalignLeft; break; + case matrixhoralignCenter: horAlign = SimpleTypes::xalignCenter; break; + case matrixhoralignRight: horAlign = SimpleTypes::xalignRight; break; + case matrixhoralignEqualSign: horAlign = SimpleTypes::xalignCenter; break; + case matrixhoralignCommaSign: horAlign = SimpleTypes::xalignCenter; break; } WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::McJc, horAlign); diff --git a/ASCOfficeOdfFile/include/cpdoccore/CPHash.h b/ASCOfficeOdfFile/include/cpdoccore/CPHash.h deleted file mode 100644 index 9ebdf916d5..0000000000 --- a/ASCOfficeOdfFile/include/cpdoccore/CPHash.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * (c) Copyright Ascensio System SIA 2010-2017 - * - * This program is a free software product. You can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License (AGPL) - * version 3 as published by the Free Software Foundation. In accordance with - * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect - * that Ascensio System SIA expressly excludes the warranty of non-infringement - * of any third-party rights. - * - * This program is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For - * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html - * - * You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, - * EU, LV-1021. - * - * The interactive user interfaces in modified source and object code versions - * of the Program must display Appropriate Legal Notices, as required under - * Section 5 of the GNU AGPL version 3. - * - * Pursuant to Section 7(b) of the License you must retain the original Product - * logo when distributing the program. Pursuant to Section 7(e) we decline to - * grant you any rights under trademark law for use of our trademarks. - * - * All the Product's GUI elements, including illustrations and icon sets, as - * well as technical writing content are licensed under the terms of the - * Creative Commons Attribution-ShareAlike 4.0 International. See the License - * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode - * - */ -#pragma once - -#include "../../include/cpdoccore/CPOptional.h" - -namespace boost -{ - template< class T > struct hash; -} - -namespace cpdoccore { - -template -std::size_t hash_value(typename optional::Type const & val) -{ - if (val) - { - boost::hash(*val); - } - else - return 0; -} - -} - diff --git a/ASCOfficeOdfFile/linux/OdfFileReaderLib.pro b/ASCOfficeOdfFile/linux/OdfFileReaderLib.pro index cc2e51c249..fbb57d6d3b 100644 --- a/ASCOfficeOdfFile/linux/OdfFileReaderLib.pro +++ b/ASCOfficeOdfFile/linux/OdfFileReaderLib.pro @@ -555,7 +555,6 @@ HEADERS += \ ../src/docx/xlsx_xf.h \ ../include/logging.h \ ../include/cpdoccore/CPColorUtils.h \ - ../include/cpdoccore/CPHash.h \ ../include/cpdoccore/CPNoncopyable.h \ ../include/cpdoccore/CPOptional.h \ ../include/cpdoccore/CPScopedPtr.h \ diff --git a/ASCOfficeOdfFile/src/docx/docx_conversion_context.h b/ASCOfficeOdfFile/src/docx/docx_conversion_context.h index 67347dcb11..9b23406c0f 100644 --- a/ASCOfficeOdfFile/src/docx/docx_conversion_context.h +++ b/ASCOfficeOdfFile/src/docx/docx_conversion_context.h @@ -224,8 +224,9 @@ public: bool & get_use_image_replace() { bool res = false; - if (frames_.size()>0) return frames_.back().use_image_replace; - else return res; + if (!frames_.empty()) return frames_.back().use_image_replace; + else + throw; } std::wstring & get_text_stream_shape() diff --git a/ASCOfficeOdfFile/src/docx/oox_chart_legend.cpp b/ASCOfficeOdfFile/src/docx/oox_chart_legend.cpp index d865f40c1f..f0f97d5c7d 100644 --- a/ASCOfficeOdfFile/src/docx/oox_chart_legend.cpp +++ b/ASCOfficeOdfFile/src/docx/oox_chart_legend.cpp @@ -32,7 +32,7 @@ #include -#include +#include #include #include "oox_chart_legend.h" diff --git a/ASCOfficeOdfFile/src/docx/oox_chart_shape.cpp b/ASCOfficeOdfFile/src/docx/oox_chart_shape.cpp index aebcc65b64..e165b400e3 100644 --- a/ASCOfficeOdfFile/src/docx/oox_chart_shape.cpp +++ b/ASCOfficeOdfFile/src/docx/oox_chart_shape.cpp @@ -30,7 +30,7 @@ * */ #include -#include +#include #include #include "oox_chart_shape.h" diff --git a/ASCOfficeOdfFile/src/docx/oox_data_labels.cpp b/ASCOfficeOdfFile/src/docx/oox_data_labels.cpp index 3d32aec875..406b6bebb8 100644 --- a/ASCOfficeOdfFile/src/docx/oox_data_labels.cpp +++ b/ASCOfficeOdfFile/src/docx/oox_data_labels.cpp @@ -31,7 +31,7 @@ */ -#include +#include #include #include "oox_data_labels.h" diff --git a/ASCOfficeOdfFile/src/docx/oox_layout.cpp b/ASCOfficeOdfFile/src/docx/oox_layout.cpp index 9d5e997b71..0e9b8601d8 100644 --- a/ASCOfficeOdfFile/src/docx/oox_layout.cpp +++ b/ASCOfficeOdfFile/src/docx/oox_layout.cpp @@ -32,7 +32,7 @@ #include "oox_layout.h" #include -#include +#include #include #include "../odf/style_text_properties.h" diff --git a/ASCOfficeOdfFile/src/docx/oox_plot_area.cpp b/ASCOfficeOdfFile/src/docx/oox_plot_area.cpp index b2eca764e7..f3e52946b5 100644 --- a/ASCOfficeOdfFile/src/docx/oox_plot_area.cpp +++ b/ASCOfficeOdfFile/src/docx/oox_plot_area.cpp @@ -33,7 +33,7 @@ #include "oox_plot_area.h" #include #include -#include +#include #include #include "../odf/style_text_properties.h" diff --git a/ASCOfficeOdfFile/src/docx/oox_title.cpp b/ASCOfficeOdfFile/src/docx/oox_title.cpp index c727dcade2..dcedaba54b 100644 --- a/ASCOfficeOdfFile/src/docx/oox_title.cpp +++ b/ASCOfficeOdfFile/src/docx/oox_title.cpp @@ -32,7 +32,7 @@ #include "oox_title.h" #include -#include +#include #include #include "../odf/style_text_properties.h" diff --git a/ASCOfficeOdfFile/src/docx/xlsx_border.cpp b/ASCOfficeOdfFile/src/docx/xlsx_border.cpp index 8b548476ef..e99370dbb5 100644 --- a/ASCOfficeOdfFile/src/docx/xlsx_border.cpp +++ b/ASCOfficeOdfFile/src/docx/xlsx_border.cpp @@ -32,7 +32,7 @@ #include "xlsx_border.h" #include -#include +#include #include #include "../odf/style_text_properties.h" diff --git a/ASCOfficeOdfFile/src/odf/odf_content_xml.cpp b/ASCOfficeOdfFile/src/odf/odf_content_xml.cpp index 2b4bbb4add..083a5b0c9c 100644 --- a/ASCOfficeOdfFile/src/odf/odf_content_xml.cpp +++ b/ASCOfficeOdfFile/src/odf/odf_content_xml.cpp @@ -87,10 +87,6 @@ void content_xml_t::add_child_element( xml::sax * Reader, const std::wstring & N else if ( CP_CHECK_NAME(L"math", L"math") || CP_CHECK_NAME(L"", L"math")) { create_element_and_read(Reader, Ns, Name, xml_content_, getContext(), true); - } - else if CP_CHECK_NAME(L"manifest", L"manifest") - { - create_element_and_read(Reader, Ns, Name, xml_content_, getContext(), true); } } diff --git a/ASCOfficeOdfFile/src/odf/table_calculation_settings.cpp b/ASCOfficeOdfFile/src/odf/table_calculation_settings.cpp index 1e774adf6d..c39e601034 100644 --- a/ASCOfficeOdfFile/src/odf/table_calculation_settings.cpp +++ b/ASCOfficeOdfFile/src/odf/table_calculation_settings.cpp @@ -62,9 +62,9 @@ void table_calculation_settings::add_child_element( xml::sax * Reader, const std { CP_CREATE_ELEMENT(table_null_date_); } - else if CP_CHECK_NAME(L"table", L"null-date") - { - } + //else if CP_CHECK_NAME(L"table", L"iteration") + //{ + //} else CP_NOT_APPLICABLE_ELM(); } diff --git a/ASCOfficeOdfFile/src/odf/table_xlsx.cpp b/ASCOfficeOdfFile/src/odf/table_xlsx.cpp index 7569a1fbfe..dcb78eb36e 100644 --- a/ASCOfficeOdfFile/src/odf/table_xlsx.cpp +++ b/ASCOfficeOdfFile/src/odf/table_xlsx.cpp @@ -490,7 +490,6 @@ void table_table_column::xlsx_convert(oox::xlsx_conversion_context & Context) size_t style_ = Context.get_style_manager().xfId(NULL,NULL, &cellFormatProperties, NULL, L"", set_default); - if (style_>=0) //if (set_default) CP_XML_ATTR(L"style", style_ ); } diff --git a/ASCOfficeOdfFile/win32/cpcommon.vcproj b/ASCOfficeOdfFile/win32/cpcommon.vcproj index ccc236b7cb..8d9baf0a8e 100644 --- a/ASCOfficeOdfFile/win32/cpcommon.vcproj +++ b/ASCOfficeOdfFile/win32/cpcommon.vcproj @@ -1111,10 +1111,6 @@ RelativePath="..\include\cpdoccore\CPColorUtils.h" > - - diff --git a/ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp b/ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp index 6909edd034..3497448a7e 100644 --- a/ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp +++ b/ASCOfficeOdfFileW/source/OdfFormat/odf_drawing_context.cpp @@ -2463,8 +2463,6 @@ void odf_drawing_context::start_action(std::wstring value) event_->attlist_.presentation_action_ = L"last-page"; else if (std::wstring::npos != value.find(L"endshow")) event_->attlist_.presentation_action_ = L"end"; - else if (std::wstring::npos != value.find(L"endshow")) - event_->attlist_.presentation_action_ = L"end"; } else if (std::wstring::npos != value.find(L"hlinksldjump")) { diff --git a/ASCOfficeOdfFileW/source/OdfFormat/office_elements_create.cpp b/ASCOfficeOdfFileW/source/OdfFormat/office_elements_create.cpp index b2df9e7fc0..4382ee41c6 100644 --- a/ASCOfficeOdfFileW/source/OdfFormat/office_elements_create.cpp +++ b/ASCOfficeOdfFileW/source/OdfFormat/office_elements_create.cpp @@ -75,11 +75,8 @@ office_element_creator * office_element_creator::get() { if (!instance_) { - if (!instance_) - { - office_element_creator * temp = new office_element_creator(); - instance_ = temp; - } + office_element_creator * temp = new office_element_creator(); + instance_ = temp; } return instance_; diff --git a/ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp b/ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp index 49c5ef0e3c..4c7291b951 100644 --- a/ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp +++ b/ASCOfficeOdfFileW/source/Oox2OdfConverter/DocxConverter.cpp @@ -2733,10 +2733,10 @@ void DocxConverter::convert(SimpleTypes::CHexColor<> *color, std::wstring strColor = L"#" + oRgbColor->ToString().substr(2);//.Right(6); odf_color = odf_types::color(strColor); - delete oRgbColor; - result = true; } + if (oRgbColor) + delete oRgbColor; } if(theme_color && result == false) { diff --git a/ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp b/ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp index 4715f344d0..7df70ccd03 100644 --- a/ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp +++ b/ASCOfficeOdfFileW/source/Oox2OdfConverter/PptxConverter.cpp @@ -925,9 +925,10 @@ void PptxConverter::convert(PPTX::Logic::Table *oox_table) } void PptxConverter::convert(PPTX::Logic::TableRow *oox_table_row) { - odp_context->slide_context()->start_table_row(oox_table_row->Height.IsInit()); if (!oox_table_row) return; + odp_context->slide_context()->start_table_row(oox_table_row->Height.IsInit()); + if (oox_table_row->Height.IsInit()) { odf_writer::style_table_row_properties * table_row_properties = odp_context->styles_context()->last_state()->get_table_row_properties(); diff --git a/ASCOfficePPTFile/PPTFormatLib/PPTXWriter/Converter.cpp b/ASCOfficePPTFile/PPTFormatLib/PPTXWriter/Converter.cpp index cb2791fc52..87a7c092b9 100644 --- a/ASCOfficePPTFile/PPTFormatLib/PPTXWriter/Converter.cpp +++ b/ASCOfficePPTFile/PPTFormatLib/PPTXWriter/Converter.cpp @@ -959,7 +959,7 @@ void NSPresentationEditor::CPPTXWriter::WriteSlide(int nIndexSlide) void NSPresentationEditor::CPPTXWriter::WriteTransition(CStringWriter& oWriter, CTransition& transition) { - if (!transition.m_nEffectType == 0xFF) return; + if (transition.m_nEffectType == 0xFF) return; std::wstring type; diff --git a/ASCOfficePPTFile/PPTFormatLib/PPTXWriter/ShapeWriter.cpp b/ASCOfficePPTFile/PPTFormatLib/PPTXWriter/ShapeWriter.cpp index 3cab9e50c4..cb99d8f47d 100644 --- a/ASCOfficePPTFile/PPTFormatLib/PPTXWriter/ShapeWriter.cpp +++ b/ASCOfficePPTFile/PPTFormatLib/PPTXWriter/ShapeWriter.cpp @@ -787,9 +787,9 @@ void NSPresentationEditor::CShapeWriter::WriteShapeInfo() { if (m_pShapeElement->m_lPlaceholderSizePreset == 1) m_oWriter.WriteString(std::wstring(L" size=\"half\"")); - if (m_pShapeElement->m_lPlaceholderSizePreset == 2) + else if (m_pShapeElement->m_lPlaceholderSizePreset == 2) m_oWriter.WriteString(std::wstring(L" size=\"quarter\"")); - if (m_pShapeElement->m_lPlaceholderSizePreset == 3) + else if (m_pShapeElement->m_lPlaceholderSizePreset == 3) { if (isBodyPlaceholder(m_pShapeElement->m_lPlaceholderType)) m_oWriter.WriteString(std::wstring(L" size=\"half\"")); diff --git a/ASCOfficePPTFile/PPTFormatLib/Reader/PPTDocumentInfo.h b/ASCOfficePPTFile/PPTFormatLib/Reader/PPTDocumentInfo.h index 2fbe78a2c3..ffcb91869d 100644 --- a/ASCOfficePPTFile/PPTFormatLib/Reader/PPTDocumentInfo.h +++ b/ASCOfficePPTFile/PPTFormatLib/Reader/PPTDocumentInfo.h @@ -100,7 +100,7 @@ public: { delete pInfo; - if (pInfo->m_bEncrypt) + if (m_oCurrentUser.m_bIsEncrypt) return false; else continue; diff --git a/ASCOfficePPTFile/PPTFormatLib/Reader/PPTDocumentInfoOneUser.cpp b/ASCOfficePPTFile/PPTFormatLib/Reader/PPTDocumentInfoOneUser.cpp index d02d1d24da..e08658c5b9 100644 --- a/ASCOfficePPTFile/PPTFormatLib/Reader/PPTDocumentInfoOneUser.cpp +++ b/ASCOfficePPTFile/PPTFormatLib/Reader/PPTDocumentInfoOneUser.cpp @@ -2432,12 +2432,14 @@ void CPPTUserInfo::AddAudioTransition (DWORD dwSlideID, CTransition* pTransition if (NULL==pTransition) return; - CAudioElement* pAudio = new CAudioElement (); + CAudioElement* pAudio = new CAudioElement (); if (pAudio) { pAudio->m_strAudioFileName = strFilePath; } // ??? недоделка ??? + + pAudio->Release(); } void CPPTUserInfo::CreateDefaultStyle(NSPresentationEditor::CTextStyles& pStyle, NSPresentationEditor::CTheme* pTheme) diff --git a/ASCOfficePPTFile/PPTFormatLib/Records/Animations/AnimationTypes.h b/ASCOfficePPTFile/PPTFormatLib/Records/Animations/AnimationTypes.h index 0fe37913b3..3266680ee4 100644 --- a/ASCOfficePPTFile/PPTFormatLib/Records/Animations/AnimationTypes.h +++ b/ASCOfficePPTFile/PPTFormatLib/Records/Animations/AnimationTypes.h @@ -526,7 +526,7 @@ namespace Animations //{ // if (RT_ParaBuild == header.RecType) // { - // rgChildRec = new ParaBuildContainer (); + // rgChildRec = new ParaBuildContainer (); // if (rgChildRec) // rgChildRec->ReadFromStream (header, pStream); // } @@ -982,60 +982,25 @@ namespace Animations switch ( VariableType ) { - case TL_TPID_Display : - pRecord = new TimeDisplayType (); - case TL_TPID_MasterPos : - pRecord = new TimeMasterRelType (); - case TL_TPID_SlaveType : - pRecord = new TimeSlaveType (); + case TL_TPID_Display: pRecord = new TimeDisplayType (); break; + case TL_TPID_MasterPos: pRecord = new TimeMasterRelType (); break; + case TL_TPID_SlaveType: pRecord = new TimeSlaveType (); break; + case TL_TPID_EffectID: pRecord = new TimeEffectID (); break; + case TL_TPID_EffectDir: pRecord = new TimeEffectDir (); break; + case TL_TPID_EffectType: pRecord = new TimeEffectType (); break; + case TL_TPID_AfterEffect: pRecord = new TimeAfterEffect (); break; + case TL_TPID_SlideCount: pRecord = new TimeSlideCount (); break; + case TL_TPID_TimeFilter: pRecord = new TimeNodeTimeFilter (); break; + case TL_TPID_EventFilter: pRecord = new TimeEventFilter (); break; + case TL_TPID_HideWhenStopped: pRecord = new TimeHideWhenStopped (); break; + case TL_TPID_GroupID: pRecord = new TimeGroupID (); break; + case TL_TPID_EffectNodeType: pRecord = new TimeEffectNodeType (); break; + case TL_TPID_PlaceholderNode: pRecord = new TimePlaceholderNode (); break; + case TL_TPID_MediaVolume: pRecord = new TimeMediaVolume (); break; + case TL_TPID_MediaMute: pRecord = new TimeMediaMute (); break; + case TL_TPID_ZoomToFullScreen: pRecord = new TimeZoomToFullScreen (); break; + default : break; - case TL_TPID_EffectID : - pRecord = new TimeEffectID (); - break; - case TL_TPID_EffectDir : - pRecord = new TimeEffectDir (); - break; - case TL_TPID_EffectType : - pRecord = new TimeEffectType (); - break; - case TL_TPID_AfterEffect : - pRecord = new TimeAfterEffect (); - break; - case TL_TPID_SlideCount : - pRecord = new TimeSlideCount (); - break; - case TL_TPID_TimeFilter : - pRecord = new TimeNodeTimeFilter (); - break; - case TL_TPID_EventFilter : - pRecord = new TimeEventFilter (); - break; - case TL_TPID_HideWhenStopped : - pRecord = new TimeHideWhenStopped (); - break; - case TL_TPID_GroupID : - pRecord = new TimeGroupID (); - break; - case TL_TPID_EffectNodeType : - pRecord = new TimeEffectNodeType (); - break; - case TL_TPID_PlaceholderNode : - pRecord = new TimePlaceholderNode (); - break; - case TL_TPID_MediaVolume : - pRecord = new TimeMediaVolume (); - break; - case TL_TPID_MediaMute : - pRecord = new TimeMediaMute (); - break; - case TL_TPID_ZoomToFullScreen : - pRecord = new TimeZoomToFullScreen (); - break; - -#if defined(_DEBUG) && (defined(_WIN32) || defined(_WIN64)) - default : assert (0); - break; -#endif } pRecord->ReadFromStream ( ReadHeader, pStream ); @@ -1359,7 +1324,7 @@ namespace Animations if ( RT_TimePropertyList == header.RecType ) { - propertyList = new TimePropertyList4TimeBehavior(); + propertyList = new TimePropertyList4TimeBehavior(); if (propertyList) { propertyList->ReadFromStream (header, pStream); @@ -1371,7 +1336,7 @@ namespace Animations if ( RT_TimeVariantList == header.RecType ) { - stringList = new TimeStringListContainer(); + stringList = new TimeStringListContainer(); if (stringList) { stringList->ReadFromStream (header, pStream); @@ -1420,7 +1385,7 @@ namespace Animations if ( RT_TimeVariantList == ReadHeader.RecType ) { - haveStringList = true; + haveStringList = true; stringList.ReadFromStream ( ReadHeader, pStream ); } } @@ -2394,8 +2359,8 @@ namespace Animations if ( RT_TimePropertyList == nRecord ) { - haveTimePropertyList = true; - timePropertyList = new TimePropertyList4TimeNodeContainer (); + haveTimePropertyList = true; + timePropertyList = new TimePropertyList4TimeNodeContainer (); timePropertyList->ReadFromStream ( ReadHeader, pStream ); continue; @@ -2403,8 +2368,8 @@ namespace Animations if ( RT_TimeSetBehaviorContainer == nRecord ) { - haveSetBehavior = true; - timeSetBehavior = new TimeSetBehaviorContainer(); + haveSetBehavior = true; + timeSetBehavior = new TimeSetBehaviorContainer(); timeSetBehavior->ReadFromStream ( ReadHeader, pStream ); continue; @@ -2412,8 +2377,8 @@ namespace Animations if ( RT_TimeColorBehaviorContainer == nRecord ) { - haveColorBehavior = true; - timeColorBehavior = new TimeColorBehaviorContainer(); + haveColorBehavior = true; + timeColorBehavior = new TimeColorBehaviorContainer(); timeColorBehavior->ReadFromStream ( ReadHeader, pStream ); continue; @@ -2421,8 +2386,8 @@ namespace Animations if ( RT_TimeClientVisualElement == nRecord ) { - haveClientVisualElement = true; - clientVisualElement = new ClientVisualElementContainer (); + haveClientVisualElement = true; + clientVisualElement = new ClientVisualElementContainer (); clientVisualElement->ReadFromStream ( ReadHeader, pStream ); continue; @@ -2433,7 +2398,7 @@ namespace Animations extTimeContainer = CAnimationFactory::BuildAnimationObject (nRecord); // ExtTimeNodeContainer if (extTimeContainer) { - haveExtTimeContainer = true; + haveExtTimeContainer = true; extTimeContainer->ReadFromStream ( ReadHeader, pStream ); continue; } @@ -2547,14 +2512,14 @@ namespace Animations if ( ReadHeader.ReadFromStream(pStream) == false) break; - lCurLen += 8 + ReadHeader.RecLen; + lCurLen += 8 + ReadHeader.RecLen; //AnimationsClassType nRecord = (AnimationsClassType)ReadHeader.RecType; WORD nRecord = ReadHeader.RecType; if ( RT_TimeExtTimeNodeContainer == nRecord ) { - ExtTimeNodeContainer* pContainer = new ExtTimeNodeContainer (); + ExtTimeNodeContainer* pContainer = new ExtTimeNodeContainer (); if (pContainer) { pContainer->ReadFromStream ( ReadHeader, pStream ); @@ -2566,11 +2531,11 @@ namespace Animations if ( RT_BuildList == nRecord ) { - buildList = new BuildListContainer (); + buildList = new BuildListContainer (); if (buildList) { buildList->ReadFromStream ( ReadHeader, pStream ); - haveBuildList = true; + haveBuildList = true; continue; } @@ -2590,11 +2555,11 @@ namespace Animations if ( RT_TimeSequenceData == nRecord ) { - timeSequenceDataAtom = new TimeSequenceDataAtom (); + timeSequenceDataAtom = new TimeSequenceDataAtom (); if (timeSequenceDataAtom) { timeSequenceDataAtom->ReadFromStream ( ReadHeader, pStream ); - haveSequenceAtom = true; + haveSequenceAtom = true; continue; } @@ -2602,11 +2567,11 @@ namespace Animations if ( RT_TimeIterateData == nRecord ) { - timeIterateDataAtom = new TimeIterateDataAtom (); + timeIterateDataAtom = new TimeIterateDataAtom (); if (timeIterateDataAtom) { timeIterateDataAtom->ReadFromStream ( ReadHeader, pStream ); - haveIterateDataAtom = true; + haveIterateDataAtom = true; continue; } @@ -2614,7 +2579,7 @@ namespace Animations if ( RT_TimePropertyList == nRecord ) { - timePropertyList = new TimePropertyList4TimeNodeContainer (); + timePropertyList = new TimePropertyList4TimeNodeContainer (); if (timePropertyList) { timePropertyList->ReadFromStream ( ReadHeader, pStream ); @@ -2626,22 +2591,22 @@ namespace Animations if ( RT_TimeEffectBehaviorContainer == nRecord ) { - timeEffectBehavior = new TimeEffectBehaviorContainer(); + timeEffectBehavior = new TimeEffectBehaviorContainer(); if (timeEffectBehavior) { timeEffectBehavior->ReadFromStream ( ReadHeader, pStream ); - haveEffectBehavior = true; + haveEffectBehavior = true; continue; } } if ( RT_TimeColorBehaviorContainer == nRecord ) { - timeColorBehavior = new TimeColorBehaviorContainer(); + timeColorBehavior = new TimeColorBehaviorContainer(); if (timeColorBehavior) { timeColorBehavior->ReadFromStream ( ReadHeader, pStream ); - haveColorBehavior = true; + haveColorBehavior = true; continue; } @@ -2649,11 +2614,11 @@ namespace Animations if ( RT_TimeMotionBehaviorContainer == nRecord ) { - timeMotionBehavior = new TimeMotionBehaviorContainer (); + timeMotionBehavior = new TimeMotionBehaviorContainer (); if (timeMotionBehavior) { timeMotionBehavior->ReadFromStream ( ReadHeader, pStream ); - haveMotionBehavior = true; + haveMotionBehavior = true; continue; } @@ -2661,11 +2626,11 @@ namespace Animations if ( RT_TimeSetBehaviorContainer == nRecord ) { - timeSetBehavior = new TimeSetBehaviorContainer (); + timeSetBehavior = new TimeSetBehaviorContainer (); if (timeSetBehavior) { timeSetBehavior->ReadFromStream ( ReadHeader, pStream ); - haveSetBehavior = true; + haveSetBehavior = true; continue; } @@ -2673,11 +2638,11 @@ namespace Animations if ( RT_TimeAnimateBehaviorContainer == nRecord ) { - timeAnimateBehavior = new TimeAnimateBehaviorContainer (); + timeAnimateBehavior = new TimeAnimateBehaviorContainer (); if (timeAnimateBehavior) { timeAnimateBehavior->ReadFromStream ( ReadHeader, pStream ); - haveAnimateBehavior = true; + haveAnimateBehavior = true; continue; } @@ -2685,7 +2650,7 @@ namespace Animations if ( RT_TimeRotationBehaviorContainer == nRecord ) { - timeRotationBehavior = new TimeRotationBehaviorContainer (); + timeRotationBehavior = new TimeRotationBehaviorContainer (); if (timeRotationBehavior) { timeRotationBehavior->ReadFromStream ( ReadHeader, pStream ); @@ -2697,11 +2662,11 @@ namespace Animations if ( RT_TimeScaleBehaviorContainer == nRecord ) { - timeScaleBehavior = new TimeScaleBehaviorContainer (); + timeScaleBehavior = new TimeScaleBehaviorContainer (); if (timeScaleBehavior) { timeScaleBehavior->ReadFromStream ( ReadHeader, pStream ); - haveScaleBehavior = true; + haveScaleBehavior = true; continue; } @@ -2709,8 +2674,8 @@ namespace Animations if (RT_TimeClientVisualElement == nRecord) { - haveClientVisualElement = true; - clientVisualElement = new ClientVisualElementContainer (); + haveClientVisualElement = true; + clientVisualElement = new ClientVisualElementContainer (); clientVisualElement->ReadFromStream ( ReadHeader, pStream ); continue; @@ -2718,11 +2683,11 @@ namespace Animations if ( RT_TimeSlaveContainer == nRecord ) { - rgSlave = new SlaveContainer (); + rgSlave = new SlaveContainer (); if (rgSlave) { rgSlave->ReadFromStream ( ReadHeader, pStream ); - haveSlaveContainer = true; + haveSlaveContainer = true; continue; } @@ -2730,7 +2695,7 @@ namespace Animations if (RT_TimeModifierAtom == nRecord) { - TimeModifierAtom* atom = new TimeModifierAtom (); + TimeModifierAtom* atom = new TimeModifierAtom (); if (atom) { atom->ReadFromStream ( ReadHeader, pStream ); @@ -3176,7 +3141,7 @@ namespace Animations SlaveContainer* pSlave = pContainer->rgSlave; if(pSlave->haveSetBehavior) // после анимации к объекту может быть применена дополнительная анимация { - m_HaveAfterEffect = true; + m_HaveAfterEffect = true; // эффект исчезновения элемента (Appear) m_oAfterEffect.m_nDuration = 1.0; @@ -3336,7 +3301,7 @@ namespace Animations Effects* pEffects = NULL; if (mSearch == m_oAnimation.end()) { - pEffects = new Effects (); + pEffects = new Effects (); m_oAnimation.insert(std::pair( oEffect.m_nRefID, pEffects)); }else pEffects = mSearch->second; @@ -3594,7 +3559,7 @@ namespace Animations { if (2 == container.clientVisualElement.m_oVisualShapeAtom.m_Type) // указывает на то что анимация применяется к тексту { - m_oTopEffect.m_bIgnoreShape = true; + m_oTopEffect.m_bIgnoreShape = true; m_oTopEffect.m_nTextSequence = container.clientVisualElement.m_oVisualShapeAtom.m_nData1; // номер параграфа - не нормальзован m_oTopEffect.m_bRemoveEmptyBlocks = true; @@ -3792,7 +3757,7 @@ public: if (Animations::RT_TimeExtTimeNodeContainer == ReadHeader.RecType) { - extTimeNodeContainer = new Animations::ExtTimeNodeContainer (); + extTimeNodeContainer = new Animations::ExtTimeNodeContainer (); if (extTimeNodeContainer) { extTimeNodeContainer->ReadFromStream ( ReadHeader, pStream ); @@ -3802,7 +3767,7 @@ public: if (Animations::RT_BuildList == ReadHeader.RecType) { - buildListContainer = new Animations::BuildListContainer (); + buildListContainer = new Animations::BuildListContainer (); if (buildListContainer) { buildListContainer->ReadFromStream ( ReadHeader, pStream ); diff --git a/ASCOfficePPTFile/PPTFormatLib/Records/Drawing/GroupShapeContainer.h b/ASCOfficePPTFile/PPTFormatLib/Records/Drawing/GroupShapeContainer.h index 8981e03270..e4ae78d264 100644 --- a/ASCOfficePPTFile/PPTFormatLib/Records/Drawing/GroupShapeContainer.h +++ b/ASCOfficePPTFile/PPTFormatLib/Records/Drawing/GroupShapeContainer.h @@ -144,7 +144,7 @@ public: LONG lWidthClient = m_rcGroupClientAnchor.right - m_rcGroupClientAnchor.left; LONG lHeightClient = m_rcGroupClientAnchor.bottom - m_rcGroupClientAnchor.top; - bool bIsRecalc = ((lWidthClient > 0) && (lHeightClient > 0) && (lWidthClient > 0) && (lHeightGroup > 0)); + bool bIsRecalc = ((lWidthClient > 0) && (lHeightClient > 0) && (lWidthGroup > 0) && (lHeightGroup > 0)); if (bIsRecalc) { diff --git a/ASCOfficePPTFile/PPTFormatLib/Records/ExOleObjAtom.h b/ASCOfficePPTFile/PPTFormatLib/Records/ExOleObjAtom.h index abbf4c207a..ca1f74ed24 100644 --- a/ASCOfficePPTFile/PPTFormatLib/Records/ExOleObjAtom.h +++ b/ASCOfficePPTFile/PPTFormatLib/Records/ExOleObjAtom.h @@ -98,12 +98,12 @@ public: BYTE* pDataUncompress = new BYTE[decompressedSize + 64]; if (NSZLib::Decompress(pData, compressedSize, pDataUncompress, decompressedSize)) { - RELEASEOBJECT(pData); + delete []pData; pData = pDataUncompress; } else { - RELEASEOBJECT(pData); + delete []pData; } } //if (pDecryptor) diff --git a/ASCOfficePPTFile/PPTFormatLib/Records/VBAInfoAtom.h b/ASCOfficePPTFile/PPTFormatLib/Records/VBAInfoAtom.h index d3e7dbe300..d5317873fd 100644 --- a/ASCOfficePPTFile/PPTFormatLib/Records/VBAInfoAtom.h +++ b/ASCOfficePPTFile/PPTFormatLib/Records/VBAInfoAtom.h @@ -99,7 +99,7 @@ public: BYTE* pDataUncompress = new BYTE[decompressedSize]; NSZLib::Decompress(pData, compressedSize, pDataUncompress, decompressedSize); - RELEASEOBJECT(pData); + delete []pData; pData = pDataUncompress; } diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Geometry.cpp b/ASCOfficePPTXFile/PPTXFormat/Logic/Geometry.cpp index a61ce9a76b..41bcdd5fd1 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Geometry.cpp +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Geometry.cpp @@ -130,6 +130,8 @@ namespace PPTX std::to_wstring((int)(dkoefX * txRect.right)) + L"," + std::to_wstring((int)(dkoefY * txRect.bottom)); } + if (lpShapeElement) + delete lpShapeElement; } } } diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/GraphicFrame.cpp b/ASCOfficePPTXFile/PPTXFormat/Logic/GraphicFrame.cpp index 73de6fc7a7..edc162c7e6 100755 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/GraphicFrame.cpp +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/GraphicFrame.cpp @@ -259,7 +259,6 @@ namespace PPTX else { olePic.Init(); //старый вариант описания объекта через spid в VmlDrawing - olePic->spPr.xfrm; Logic::PrstGeom* geom = new Logic::PrstGeom(); geom->prst = L"rect"; diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Timing/AnimMotion.h b/ASCOfficePPTXFile/PPTXFormat/Logic/Timing/AnimMotion.h index 3567866dca..782dcfb33c 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Timing/AnimMotion.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Timing/AnimMotion.h @@ -105,7 +105,7 @@ namespace PPTX oValue.m_strValue += XmlUtils::CreateNode(_T("p:by"), oAttr1); } - if (fromY.IsInit() || fromY.IsInit()) + if (fromX.IsInit() || fromY.IsInit()) { XmlUtils::CAttribute oAttr1; oAttr1.Write(_T("x"), fromX); diff --git a/ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp b/ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp index 6b42842167..291d28bdd6 100644 --- a/ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp +++ b/ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp @@ -1663,7 +1663,7 @@ void XlsConverter::convert_geometry_text(std::vector & if (bools->fUsegFItalic && bools->fItalic) xlsx_context->get_drawing_context().set_wordart_italic (true); if (bools->fUsegFVertical && bools->fVertical) xlsx_context->get_drawing_context().set_wordart_vertical(true); if (bools->fUsegFUnderline && bools->fUnderline) xlsx_context->get_drawing_context().set_wordart_underline(true); - if (bools->fUsegStrikethrough && bools->fStrikethrough)xlsx_context->get_drawing_context().set_wordart_strike(true); + if (bools->fUsegFStrikethrough && bools->fStrikethrough)xlsx_context->get_drawing_context().set_wordart_strike(true); //if (bools->fUsegFShrinkFit && bools->fShrinkFit) } diff --git a/Common/OfficeFileFormatChecker2.cpp b/Common/OfficeFileFormatChecker2.cpp index e776512f43..6230c60468 100644 --- a/Common/OfficeFileFormatChecker2.cpp +++ b/Common/OfficeFileFormatChecker2.cpp @@ -417,10 +417,6 @@ bool COfficeFileFormatChecker::isOOXFormatFile(const std::wstring & fileName) { nFileType = AVS_OFFICESTUDIO_FILE_PRESENTATION_PPSM; } - else if (std::string::npos != strContentTypes.find(ppsmFormatLine)) - { - nFileType = AVS_OFFICESTUDIO_FILE_PRESENTATION_PPSM; - } else if (std::string::npos != strContentTypes.find(ppsxFormatLine)) { nFileType = AVS_OFFICESTUDIO_FILE_PRESENTATION_PPSX; diff --git a/DesktopEditor/fontengine/fontconverter/FontFileType1.cpp b/DesktopEditor/fontengine/fontconverter/FontFileType1.cpp index 4996cd40b2..b7fd82409b 100644 --- a/DesktopEditor/fontengine/fontconverter/FontFileType1.cpp +++ b/DesktopEditor/fontengine/fontconverter/FontFileType1.cpp @@ -507,7 +507,7 @@ namespace NSFontConverter } } - delete sData; + delete []sData; } nIndex += nLength + 3;