Commit 0fc749f8 authored by ElenaSubbotina's avatar ElenaSubbotina

Merge remote-tracking branch 'origin/release/v5.0.0' into develop

parents c0a061f2 03267ba2
......@@ -1274,16 +1274,27 @@ void style_page_layout_properties::xlsx_serialize(std::wostream & strm, oox::xls
{
if (horizontal_margins.fo_margin_left_ && horizontal_margins.fo_margin_left_->get_type() == odf_types::length_or_percent::Length)
CP_XML_ATTR(L"left" , horizontal_margins.fo_margin_left_->get_length().get_value_unit(odf_types::length::inch));
else CP_XML_ATTR(L"left", 0);
if (horizontal_margins.fo_margin_right_ && horizontal_margins.fo_margin_right_->get_type() == odf_types::length_or_percent::Length)
CP_XML_ATTR(L"right" , horizontal_margins.fo_margin_right_->get_length().get_value_unit(odf_types::length::inch));
else CP_XML_ATTR(L"right", 0);
if (vertical_margins.fo_margin_top_ && vertical_margins.fo_margin_top_->get_type() == odf_types::length_or_percent::Length)
CP_XML_ATTR(L"top" , vertical_margins.fo_margin_top_->get_length().get_value_unit(odf_types::length::inch));
else CP_XML_ATTR(L"top", 1.025);
if (vertical_margins.fo_margin_bottom_ && vertical_margins.fo_margin_bottom_->get_type() == odf_types::length_or_percent::Length)
CP_XML_ATTR(L"bottom" , vertical_margins.fo_margin_bottom_->get_length().get_value_unit(odf_types::length::inch));
else CP_XML_ATTR(L"bottom", 1.025);
CP_XML_ATTR(L"header" , vertical_margins.fo_margin_top_->get_length().get_value_unit(odf_types::length::inch));
CP_XML_ATTR(L"footer" , vertical_margins.fo_margin_bottom_->get_length().get_value_unit(odf_types::length::inch));
if (vertical_margins.fo_margin_top_)
CP_XML_ATTR(L"header" , vertical_margins.fo_margin_top_->get_length().get_value_unit(odf_types::length::inch));
else CP_XML_ATTR(L"header", 0.7875);
if (vertical_margins.fo_margin_bottom_)
CP_XML_ATTR(L"footer" , vertical_margins.fo_margin_bottom_->get_length().get_value_unit(odf_types::length::inch));
else CP_XML_ATTR(L"footer", 0.7875);
}
}
if (attlist_.fo_page_width_ || attlist_.fo_page_height_ || attlist_.style_print_orientation_)
......
......@@ -264,28 +264,20 @@ void table_rows::xlsx_convert(oox::xlsx_conversion_context & Context)
table_table_rows_->xlsx_convert(Context);
else
{
if (table_table_row_.size() > 1)
while (table_table_row_.size() > 1)
{
//check 2 last rows for repeate > 65000 & 1024
table_table_row* row_last = dynamic_cast<table_table_row*>(table_table_row_[table_table_row_.size() - 1].get());
table_table_row* row_last_1 = dynamic_cast<table_table_row*>(table_table_row_[table_table_row_.size() - 2].get());
if (row_last->empty_content_cells() && row_last_1->empty_content_cells())
{
if (row_last->attlist_.table_number_rows_repeated_ > 1000 &&
row_last_1->attlist_.table_number_rows_repeated_ > 1000 ||
row_last_1->attlist_.table_number_rows_repeated_ > 0xf000)
{
std::wstring style = row_last->attlist_.table_style_name_.get_value_or(L"");
std::wstring style_1 = row_last->attlist_.table_style_name_.get_value_or(L"");
if (style == style_1)//check for empty also ????
{
row_last_1->attlist_.table_number_rows_repeated_ = 1024;
table_table_row_.pop_back();
}
}
}
std::wstring style = row_last->attlist_.table_style_name_.get_value_or(L"");
std::wstring style_1 = row_last->attlist_.table_style_name_.get_value_or(L"");
if (style != style_1)break;
if (row_last_1->empty_content_cells() == false) break;
if (row_last->empty_content_cells() == false) break;
row_last_1->attlist_.table_number_rows_repeated_ += row_last->attlist_.table_number_rows_repeated_;
table_table_row_.pop_back();
}
for (size_t i = 0; i < table_table_row_.size(); i++)
{
......
......@@ -44,7 +44,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\Common\OfficeDrawing;&quot;..\..\DesktopEditor\freetype-2.5.2\include&quot;;..\..\Common\OfficeDrawing\Shapes"
AdditionalIncludeDirectories="../../DesktopEditor/xml/build/vs2005;../../DesktopEditor/xml/libxml2/include"
PreprocessorDefinitions="_DEBUG;_CONSOLE;USE_ATL_CSTRINGS;_USE_MATH_DEFINES;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;PPT_FORMAT;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;_PRESENTATION_WRITER_;_SVG_CONVERT_TO_IMAGE_;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="false"
BasicRuntimeChecks="3"
......
......@@ -2122,6 +2122,8 @@ namespace NSGuidesVML
for (size_t nIndex = 0; nIndex < oArray.size(); ++nIndex)
{
if (oPath.m_arParts.size() <= nIndex)
break;
const CPartPath& oPart = oPath.m_arParts[nIndex];
m_lWidth = oPart.width;
m_lHeight = oPart.height;
......
......@@ -166,23 +166,28 @@ namespace PPTX
pWriter->WriteBYTE(1);
pWriter->EndRecord();
DocWrapper::FontProcessor fp;
NSBinPptxRW::CDrawingConverter oDrawingConverter;
DocWrapper::FontProcessor oFontProcessor;
NSBinPptxRW::CDrawingConverter oDrawingConverter;
BinDocxRW::CDocxSerializer oDocxSerializer;
NSBinPptxRW::CBinaryFileWriter* old_writer = oDrawingConverter.m_pBinaryWriter;
NSCommon::smart_ptr<OOX::IFileContainer> old_rels = *pWriter->m_pCurrentContainer;
BinDocxRW::CDocxSerializer* old_serial = pWriter->m_pMainDocument;
oDrawingConverter.m_pBinaryWriter = pWriter;
oDocxSerializer.m_pParamsWriter = new BinDocxRW::ParamsWriter(pWriter, &oFontProcessor, &oDrawingConverter, NULL);
BinDocxRW::ParamsWriter oParamsWriter(pWriter, &fp, &oDrawingConverter, NULL);
BinDocxRW::BinaryFileWriter oBinaryFileWriter(oParamsWriter);
pWriter->m_pMainDocument = &oDocxSerializer;
BinDocxRW::BinaryFileWriter oBinaryFileWriter(*oDocxSerializer.m_pParamsWriter);
pWriter->StartRecord(2);
oBinaryFileWriter.intoBindoc(oox_unpacked.GetPath());
pWriter->EndRecord();
oDrawingConverter.m_pBinaryWriter = old_writer;
*pWriter->m_pCurrentContainer = old_rels;
*pWriter->m_pCurrentContainer = old_rels;
pWriter->m_pMainDocument = old_serial;
}
else if (office_checker.nFileType == AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX)
//if ( std::wstring::npos != sProgID.find(L"Excel.Sheet")) //"ET.Xlsx.6" !!!
......
......@@ -46,7 +46,10 @@ BiffStructurePtr XFExtGradient::clone()
void XFExtGradient::load(CFRecord& record)
{
record >> gradient >> cGradStops;
for(size_t i = 0; i < cGradStops; ++i)
if (cGradStops > 256) cGradStops = 256;
for(size_t i = 0; !record.isEOF() && i < cGradStops; ++i)
{
GradStop grad_stop;
record >> grad_stop;
......
......@@ -61,8 +61,10 @@ void XFExtNoFRT::load(CFRecord& record)
unsigned short cexts;
record >> cexts;
for(unsigned short i = 0; !record.isEOF() && i < cexts; ++i)
for(unsigned short i = 0; i < cexts; ++i)
{
if (record.checkFitReadSafe(4) == false)
break;
ExtProp prop;
record >> prop;
rgExt.push_back(prop);
......
......@@ -189,13 +189,15 @@ static const struct ActionNamesEmf
do
{
if (m_oStream.CanRead() < 8)
if (m_oStream.IsEof())
break;
if (m_oStream.CanRead() < 8)
return SetError();
m_oStream >> ulType;
m_oStream >> ulSize;
if (ulSize < 1)
if (ulSize < 1)
continue;
m_ulRecordPos = m_oStream.Tell();
......
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