Commit b0adc188 authored by ElenaSubbotina's avatar ElenaSubbotina

fix users files

parent 048fbc4b
......@@ -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);
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,29 +264,21 @@ 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;
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++)
{
table_table_row_[i]->xlsx_convert(Context);
......
......@@ -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;
......
......@@ -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);
......
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