Commit 73dd12fe authored by ElenaSubbotina's avatar ElenaSubbotina

OdfFormatReader - ускорена конвертация таблиц огромных размеров. Ограничение...

OdfFormatReader - ускорена конвертация таблиц огромных размеров. Ограничение на количество столбцов(16384).
parent 1e54f505
......@@ -60,7 +60,7 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
_CP_OPT(std::wstring) strStrokeColor;
_CP_OPT(int) iStroke;
_CP_OPT(double) dStrokeWidth;
_CP_OPT(std::wstring) strStrokeOpacity;
_CP_OPT(double) dStrokeOpacity;
_CP_OPT(bool) bWordArt;
odf_reader::GetProperty(prop, L"wordArt", bWordArt);
......@@ -68,7 +68,7 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
odf_reader::GetProperty(prop, L"stroke-color" , strStrokeColor);
odf_reader::GetProperty(prop, L"stroke" , iStroke);
odf_reader::GetProperty(prop, L"stroke-width" , dStrokeWidth);
odf_reader::GetProperty(prop, L"stroke-opacity" , strStrokeOpacity);
odf_reader::GetProperty(prop, L"stroke-opacity" , dStrokeOpacity);
if ((!strStrokeColor && !iStroke && !dStrokeWidth) && !always_draw)return;
......@@ -78,7 +78,7 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
{
std::wstring color, dash_style, fill = L"a:solidFill" ;
if (strStrokeColor) color = strStrokeColor.get();
if (strStrokeColor) color = *strStrokeColor;
if (iStroke)
{
......@@ -86,7 +86,7 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
else dash_style = _ooxDashStyle[iStroke.get()];
}
if ((dStrokeWidth) && (dStrokeWidth.get()>= 0) && fill != L"a:noFill")
if ((dStrokeWidth) && (*dStrokeWidth >= 0) && fill != L"a:noFill")
{
int val = dStrokeWidth.get() * 12700; //in emu (1 pt = 12700)
if (val < 10) val = 12700;
......@@ -99,14 +99,14 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
{
if (fill != L"a:noFill")
{
if (color.length()<1 && always_draw) color = L"000000";
else if (color.length()<1) color = L"ffffff";
if (color.length() < 1 && always_draw) color = L"000000";
else if (color.length() <1 ) color = L"ffffff";
CP_XML_NODE(L"a:srgbClr")
{
CP_XML_ATTR(L"val",color);
if (strStrokeOpacity)CP_XML_NODE(L"a:alpha"){CP_XML_ATTR(L"val",strStrokeOpacity.get());}
if (dStrokeOpacity) CP_XML_NODE(L"a:alpha"){CP_XML_ATTR(L"val", *dStrokeOpacity);}
}
}
......@@ -115,7 +115,7 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
{
_CP_OPT(std::wstring) strVal;
if (dash_style.length() >0 && dash_style != L"solid")
if (dash_style.length() > 0 && dash_style != L"solid")
{
CP_XML_NODE(L"a:prstDash"){CP_XML_ATTR(L"val", dash_style);}
}
......
......@@ -269,19 +269,24 @@ void xlsx_conversion_context::end_table()
{
unsigned int cMin = get_table_context().columns_count() + 1;
unsigned int cMax = (std::max)((unsigned int)1024, get_table_context().columns_count() + 100);
CP_XML_WRITER(current_sheet().cols())
{
CP_XML_NODE(L"col")
{
//CP_XML_ATTR(L"collapsed", L"false");
//CP_XML_ATTR(L"hidden", L"false");
CP_XML_ATTR(L"max", cMax);
CP_XML_ATTR(L"min", cMin);
//CP_XML_ATTR(L"style", 0);
CP_XML_ATTR(L"width", lastWidht);
CP_XML_ATTR(L"customWidth", 0);
}
}
if (cMin < 16384)
{
if (cMax > 16384) cMax = 16384;
CP_XML_WRITER(current_sheet().cols())
{
CP_XML_NODE(L"col")
{
//CP_XML_ATTR(L"collapsed", L"false");
//CP_XML_ATTR(L"hidden", L"false");
CP_XML_ATTR(L"max", cMax);
CP_XML_ATTR(L"min", cMin);
//CP_XML_ATTR(L"style", 0);
CP_XML_ATTR(L"width", lastWidht);
CP_XML_ATTR(L"customWidth", 0);
}
}
}
}
current_sheet().cols() << L"</cols>";
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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