Commit c2605bb5 authored by ElenaSubbotina's avatar ElenaSubbotina

x2t - vps

parent ab2703c8
......@@ -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;
......
......@@ -62,8 +62,9 @@ namespace DocFileFormat
for (std::list<SinglePropertyModifier>::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;
}
......
......@@ -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);
}
......
......@@ -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)
{
......
......@@ -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);
......
/*
* (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 <class T>
std::size_t hash_value(typename optional<T>::Type const & val)
{
if (val)
{
boost::hash<T>(*val);
}
else
return 0;
}
}
......@@ -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 \
......
......@@ -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()
......
......@@ -32,7 +32,7 @@
#include <boost/functional.hpp>
#include <cpdoccore/CPHash.h>
#include <cpdoccore/CPOptional.h>
#include <cpdoccore/xml/simple_xml_writer.h>
#include "oox_chart_legend.h"
......
......@@ -30,7 +30,7 @@
*
*/
#include <boost/functional.hpp>
#include <cpdoccore/CPHash.h>
#include <cpdoccore/CPOptional.h>
#include <cpdoccore/xml/simple_xml_writer.h>
#include "oox_chart_shape.h"
......
......@@ -31,7 +31,7 @@
*/
#include <cpdoccore/CPHash.h>
#include <cpdoccore/CPOptional.h>
#include <cpdoccore/xml/simple_xml_writer.h>
#include "oox_data_labels.h"
......
......@@ -32,7 +32,7 @@
#include "oox_layout.h"
#include <boost/functional.hpp>
#include <cpdoccore/CPHash.h>
#include <cpdoccore/CPOptional.h>
#include <cpdoccore/xml/simple_xml_writer.h>
#include "../odf/style_text_properties.h"
......
......@@ -33,7 +33,7 @@
#include "oox_plot_area.h"
#include <boost/foreach.hpp>
#include <boost/functional.hpp>
#include <cpdoccore/CPHash.h>
#include <cpdoccore/CPOptional.h>
#include <cpdoccore/xml/simple_xml_writer.h>
#include "../odf/style_text_properties.h"
......
......@@ -32,7 +32,7 @@
#include "oox_title.h"
#include <boost/functional.hpp>
#include <cpdoccore/CPHash.h>
#include <cpdoccore/CPOptional.h>
#include <cpdoccore/xml/simple_xml_writer.h>
#include "../odf/style_text_properties.h"
......
......@@ -32,7 +32,7 @@
#include "xlsx_border.h"
#include <boost/functional.hpp>
#include <cpdoccore/CPHash.h>
#include <cpdoccore/CPOptional.h>
#include <cpdoccore/xml/simple_xml_writer.h>
#include "../odf/style_text_properties.h"
......
......@@ -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);
}
}
......
......@@ -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();
}
......
......@@ -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_ );
}
......
......@@ -1111,10 +1111,6 @@
RelativePath="..\include\cpdoccore\CPColorUtils.h"
>
</File>
<File
RelativePath="..\include\cpdoccore\CPHash.h"
>
</File>
<File
RelativePath="..\include\cpdoccore\CPNoncopyable.h"
>
......
......@@ -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"))
{
......
......@@ -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_;
......
......@@ -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)
{
......
......@@ -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();
......
......@@ -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;
......
......@@ -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\""));
......
......@@ -100,7 +100,7 @@ public:
{
delete pInfo;
if (pInfo->m_bEncrypt)
if (m_oCurrentUser.m_bIsEncrypt)
return false;
else
continue;
......
......@@ -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)
......
......@@ -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)
{
......
......@@ -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)
......
......@@ -99,7 +99,7 @@ public:
BYTE* pDataUncompress = new BYTE[decompressedSize];
NSZLib::Decompress(pData, compressedSize, pDataUncompress, decompressedSize);
RELEASEOBJECT(pData);
delete []pData;
pData = pDataUncompress;
}
......
......@@ -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;
}
}
}
......
......@@ -259,7 +259,6 @@ namespace PPTX
else
{
olePic.Init(); //старый вариант описания объекта через spid в VmlDrawing
olePic->spPr.xfrm;
Logic::PrstGeom* geom = new Logic::PrstGeom();
geom->prst = L"rect";
......
......@@ -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);
......
......@@ -1663,7 +1663,7 @@ void XlsConverter::convert_geometry_text(std::vector<ODRAW::OfficeArtFOPTEPtr> &
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)
}
......
......@@ -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;
......
......@@ -507,7 +507,7 @@ namespace NSFontConverter
}
}
delete sData;
delete []sData;
}
nIndex += nLength + 3;
......
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