Commit 8608d0aa authored by ElenaSubbotina's avatar ElenaSubbotina Committed by Alexander Trofimov

XlsFormat - исправление ошибок по результатам тестирования

parent d0a0d896
This diff is collapsed.
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
/* File created by MIDL compiler version 7.00.0555 */ /* File created by MIDL compiler version 7.00.0555 */
/* at Thu Feb 25 16:45:28 2016 /* at Tue Mar 29 15:32:08 2016
*/ */
/* Compiler settings for .\ASCOfficeOdfFileW.idl: /* Compiler settings for .\ASCOfficeOdfFileW.idl:
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 7.00.0555
protocol : dce , ms_ext, c_ext protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level: VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable) __declspec(uuid()), __declspec(selectany), __declspec(novtable)
...@@ -21,12 +21,17 @@ ...@@ -21,12 +21,17 @@
/* verify that the <rpcndr.h> version is high enough to compile this file*/ /* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__ #ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 440 #define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif #endif
#include "rpc.h" #include "rpc.h"
#include "rpcndr.h" #include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif // __RPCNDR_H_VERSION__
#ifndef __ASCOfficeOdfFileW_h__ #ifndef __ASCOfficeOdfFileW_h__
#define __ASCOfficeOdfFileW_h__ #define __ASCOfficeOdfFileW_h__
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#include "stdafx.h" #include "stdafx.h"
#include "OfficeOdfFileW.h" #include "OfficeOdfFileW.h"
#include "../../ASCOfficeUtils/ASCOfficeUtilsLib/OfficeUtils.h" #include "../../OfficeUtils/src/OfficeUtils.h"
#include <string> #include <string>
......
...@@ -150,8 +150,18 @@ void Lbl::readFields(CFRecord& record) ...@@ -150,8 +150,18 @@ void Lbl::readFields(CFRecord& record)
record.skipNunBytes(4); record.skipNunBytes(4);
if (record.getGlobalWorkbookInfo()->Version < 0x600)
{
LPAnsiStringNoCch s;
s.setSize(cch);
record >> s;
Name_bin = s;
}
else
{
Name_bin.setSize(cch); // this is to process built-in string values Name_bin.setSize(cch); // this is to process built-in string values
record >> Name_bin; record >> Name_bin;
}
rgce.load(record, cce); rgce.load(record, cce);
......
...@@ -285,16 +285,6 @@ void Obj::readFields(CFRecord& record) ...@@ -285,16 +285,6 @@ void Obj::readFields(CFRecord& record)
} }
} }
//else if ( OBJ_Chart == cmo.ot)
//{
// record.skipNunBytes(18);
// if (nNameLen > 0)
// {
// record >> old_version.name;
// }
// record.skipNunBytes(nMacrosSize);
//}
else if(OBJ_Text == cmo.ot) else if(OBJ_Text == cmo.ot)
{ {
TxO * txO = new TxO(mso_drawing_); TxO * txO = new TxO(mso_drawing_);
......
...@@ -67,13 +67,8 @@ int DXFPat::serialize(std::wostream & stream) ...@@ -67,13 +67,8 @@ int DXFPat::serialize(std::wostream & stream)
case 16: CP_XML_ATTR(L"patternType", L"thinDiagCross"); break; //Thin diagonal crosshatch case 16: CP_XML_ATTR(L"patternType", L"thinDiagCross"); break; //Thin diagonal crosshatch
case 17: CP_XML_ATTR(L"patternType", L"gray125"); break; //12.5% gray case 17: CP_XML_ATTR(L"patternType", L"gray125"); break; //12.5% gray
case 18: CP_XML_ATTR(L"patternType", L"gray0625"); break; //6.25% gray case 18: CP_XML_ATTR(L"patternType", L"gray0625"); break; //6.25% gray
} default:
} CP_XML_ATTR(L"patternType", L"solid");
if (!parent->icvBNinch)
{
CP_XML_NODE(L"bgColor")
{
CP_XML_ATTR(L"indexed", icvBackground);
} }
} }
if (!parent->icvFNinch) if (!parent->icvFNinch)
...@@ -84,6 +79,14 @@ int DXFPat::serialize(std::wostream & stream) ...@@ -84,6 +79,14 @@ int DXFPat::serialize(std::wostream & stream)
CP_XML_ATTR(L"indexed", icvForeground); CP_XML_ATTR(L"indexed", icvForeground);
} }
} }
if (!parent->icvBNinch)
{
CP_XML_NODE(L"bgColor")
{
CP_XML_ATTR(L"indexed", icvBackground);
}
}
} }
} }
} }
......
...@@ -88,10 +88,10 @@ void OfficeArtClientAnchorSheet::calculate() ...@@ -88,10 +88,10 @@ void OfficeArtClientAnchorSheet::calculate()
if (sheet_info.customColumnsWidth.find(colR) != sheet_info.customColumnsWidth.end()) if (sheet_info.customColumnsWidth.find(colR) != sheet_info.customColumnsWidth.end())
{ {
column_width = sheet_info.customColumnsWidth[colR]; column_width = sheet_info.customColumnsWidth[colR] / 1024.;
} }
else else
column_width = sheet_info.defaultColumnWidth; column_width = sheet_info.defaultColumnWidth / 1024.;
width = (double)(((256. * column_width + (int)(128. / Digit_Width)) / 256.) * Digit_Width) * 72 / 96.; width = (double)(((256. * column_width + (int)(128. / Digit_Width)) / 256.) * Digit_Width) * 72 / 96.;
......
...@@ -131,6 +131,11 @@ void OfficeArtContainer::loadFields(XLS::CFRecord& record) ...@@ -131,6 +131,11 @@ void OfficeArtContainer::loadFields(XLS::CFRecord& record)
case TertiaryFOPT: case TertiaryFOPT:
art_record = OfficeArtRecordPtr(new OfficeArtTertiaryFOPT); art_record = OfficeArtRecordPtr(new OfficeArtTertiaryFOPT);
break; break;
default:
{
Log::warning(std::wstring(L"Unknown OfficeArt record of type 0x") +
STR::int2hex_wstr(rh_child.recType, sizeof(rh_child.recType)));
}break;
} }
if(art_record) if(art_record)
......
...@@ -207,6 +207,8 @@ void XFProp::serialize_attr(CP_ATTR_NODE) ...@@ -207,6 +207,8 @@ void XFProp::serialize_attr(CP_ATTR_NODE)
case 16: CP_XML_ATTR(L"patternType", L"thinDiagCross"); break; //Thin diagonal crosshatch case 16: CP_XML_ATTR(L"patternType", L"thinDiagCross"); break; //Thin diagonal crosshatch
case 17: CP_XML_ATTR(L"patternType", L"gray125"); break; //12.5% gray case 17: CP_XML_ATTR(L"patternType", L"gray125"); break; //12.5% gray
case 18: CP_XML_ATTR(L"patternType", L"gray0625"); break; //6.25% gray case 18: CP_XML_ATTR(L"patternType", L"gray0625"); break; //6.25% gray
default:
CP_XML_ATTR(L"patternType", L"solid");
} }
} }
if (xfPropType == 3) if (xfPropType == 3)
......
...@@ -102,6 +102,7 @@ BaseObjectPtr AXES::clone() ...@@ -102,6 +102,7 @@ BaseObjectPtr AXES::clone()
// AXES = [IVAXIS DVAXIS [SERIESAXIS] / DVAXIS DVAXIS] *3ATTACHEDLABEL [PlotArea FRAME] // AXES = [IVAXIS DVAXIS [SERIESAXIS] / DVAXIS DVAXIS] *3ATTACHEDLABEL [PlotArea FRAME]
const bool AXES::loadContent(BinProcessor& proc) const bool AXES::loadContent(BinProcessor& proc)
{ {
bool res = false;
if (proc.optional<Parenthesis_AXES_1>()) if (proc.optional<Parenthesis_AXES_1>())
{ {
int count = elements_.size(); int count = elements_.size();
...@@ -159,6 +160,7 @@ const bool AXES::loadContent(BinProcessor& proc) ...@@ -159,6 +160,7 @@ const bool AXES::loadContent(BinProcessor& proc)
elements_.pop_front(); elements_.pop_front();
count--; count--;
} }
res = true;
} }
int count = proc.repeated<ATTACHEDLABEL>(0, 3); int count = proc.repeated<ATTACHEDLABEL>(0, 3);
...@@ -180,7 +182,7 @@ const bool AXES::loadContent(BinProcessor& proc) ...@@ -180,7 +182,7 @@ const bool AXES::loadContent(BinProcessor& proc)
elements_.pop_back(); elements_.pop_back();
} }
return true; return res;
} }
int AXES::serialize(std::wostream & _stream) int AXES::serialize(std::wostream & _stream)
......
...@@ -46,13 +46,14 @@ const bool AXISPARENT::loadContent(BinProcessor& proc) ...@@ -46,13 +46,14 @@ const bool AXISPARENT::loadContent(BinProcessor& proc)
elements_.pop_back(); elements_.pop_back();
} }
if (proc.optional<AXES>()) int count = proc.repeated<AXES>(0, 0);
if (count > 0)
{ {
m_AXES = elements_.back(); m_AXES = elements_.back();
elements_.pop_back(); elements_.pop_back();
} }
int count = proc.repeated<CRT>(1, 4); count = proc.repeated<CRT>(1, 4);
while(count > 0 && !elements_.empty()) while(count > 0 && !elements_.empty())
{ {
......
...@@ -48,23 +48,54 @@ const bool SERIESAXIS::loadContent(BinProcessor& proc) ...@@ -48,23 +48,54 @@ const bool SERIESAXIS::loadContent(BinProcessor& proc)
m_Axis = elements_.back(); m_Axis = elements_.back();
elements_.pop_back(); elements_.pop_back();
proc.mandatory<Begin>(); elements_.pop_back(); while (true)
{
CFRecordType::TypeId type = proc.getNextRecordType();
if (type == rt_NONE) break;
if (type == rt_End)
{
if (proc.mandatory<End>())
elements_.pop_back();
break;
}
switch(type)
{
case rt_Begin:
{
if (proc.optional<Begin>())
elements_.pop_back();
}break;
case rt_CatSerRange:
{
if (proc.optional<CatSerRange>()) if (proc.optional<CatSerRange>())
{ {
m_CatSerRange = elements_.back(); m_CatSerRange = elements_.back();
elements_.pop_back(); elements_.pop_back();
} }
}break;
case rt_IFmtRecord:
case rt_Tick:
case rt_FontX:
case rt_AxisLine:
{
if (proc.mandatory<AXS>()) if (proc.mandatory<AXS>())
{ {
m_AXS = elements_.back(); m_AXS = elements_.back();
elements_.pop_back(); elements_.pop_back();
} }
}break;
case rt_CrtMlFrt:
{
proc.optional<CRTMLFRT>(); proc.optional<CRTMLFRT>();
proc.mandatory<End>(); elements_.pop_back(); }break;
default:
{
proc.SkipRecord();
}break;
}
}
return true; return true;
} }
int SERIESAXIS::serialize(std::wostream & _stream) int SERIESAXIS::serialize(std::wostream & _stream)
......
...@@ -263,7 +263,8 @@ void ChartSheetSubstream::recalc(CHARTFORMATS* charts) ...@@ -263,7 +263,8 @@ void ChartSheetSubstream::recalc(CHARTFORMATS* charts)
{ {
if (charts == NULL) return; if (charts == NULL) return;
AXISPARENT* parent0 = dynamic_cast<AXISPARENT*>(charts->m_arAXISPARENT[0].get()); int ind_AXIS = 0;
AXISPARENT* parent0 = dynamic_cast<AXISPARENT*>(charts->m_arAXISPARENT[ind_AXIS].get());
int iCrt = -1; int iCrt = -1;
...@@ -291,8 +292,15 @@ void ChartSheetSubstream::recalc(CHARTFORMATS* charts) ...@@ -291,8 +292,15 @@ void ChartSheetSubstream::recalc(CHARTFORMATS* charts)
iCrt = serCrt->id; iCrt = serCrt->id;
if (iCrt > parent0->m_arCRT.size() && iCrt < 0) while ((parent0->m_arCRT.size() <= iCrt) && (ind_AXIS < charts->m_arAXISPARENT.size()) && (charts->m_arAXISPARENT.size() > 1))
{
parent0 = dynamic_cast<AXISPARENT*>(charts->m_arAXISPARENT[++ind_AXIS].get());
}
if (iCrt >= parent0->m_arCRT.size() || iCrt < 0)
continue; continue;
CRT * crt = dynamic_cast<CRT*>(parent0->m_arCRT[iCrt].get()); CRT * crt = dynamic_cast<CRT*>(parent0->m_arCRT[iCrt].get());
std::map<int,std::vector<int>>::iterator it = m_mapTypeChart.find(iCrt); std::map<int,std::vector<int>>::iterator it = m_mapTypeChart.find(iCrt);
...@@ -409,10 +417,13 @@ int ChartSheetSubstream::serialize_3D (std::wostream & _stream) ...@@ -409,10 +417,13 @@ int ChartSheetSubstream::serialize_3D (std::wostream & _stream)
} }
AXES * axes = dynamic_cast<AXES*> (parent->m_AXES.get()); AXES * axes = dynamic_cast<AXES*> (parent->m_AXES.get());
if (axes)
{
wallSpPr = axes->m_Wall_FRAME; wallSpPr = axes->m_Wall_FRAME;
floorSpPr = axes->m_Floor_FRAME; floorSpPr = axes->m_Floor_FRAME;
} }
} }
}
if (!chart3D) return 0; if (!chart3D) return 0;
CP_XML_WRITER(_stream) CP_XML_WRITER(_stream)
...@@ -714,7 +725,8 @@ int ChartSheetSubstream::serialize_plot_area (std::wostream & _stream) ...@@ -714,7 +725,8 @@ int ChartSheetSubstream::serialize_plot_area (std::wostream & _stream)
} }
AXES * axes = dynamic_cast<AXES*>(parent->m_AXES.get()); AXES * axes = dynamic_cast<AXES*>(parent->m_AXES.get());
if (axes)
{
for (int a = 0 ; a < axes->m_arAxesId.size(); a++) for (int a = 0 ; a < axes->m_arAxesId.size(); a++)
{ {
CP_XML_NODE(L"c:axId") CP_XML_NODE(L"c:axId")
...@@ -722,7 +734,8 @@ int ChartSheetSubstream::serialize_plot_area (std::wostream & _stream) ...@@ -722,7 +734,8 @@ int ChartSheetSubstream::serialize_plot_area (std::wostream & _stream)
CP_XML_ATTR(L"val", axes->m_arAxesId[a].first); CP_XML_ATTR(L"val", axes->m_arAxesId[a].first);
} }
} }
}
//else error complex_29s.xls
} }
} }
...@@ -733,8 +746,12 @@ int ChartSheetSubstream::serialize_plot_area (std::wostream & _stream) ...@@ -733,8 +746,12 @@ int ChartSheetSubstream::serialize_plot_area (std::wostream & _stream)
AXES* axes = dynamic_cast<AXES*> (parent->m_AXES.get()); AXES* axes = dynamic_cast<AXES*> (parent->m_AXES.get());
bool secondary = ax_parent->iax; bool secondary = ax_parent->iax;
if (axes)
{
axes->serialize(CP_XML_STREAM(), secondary); axes->serialize(CP_XML_STREAM(), secondary);
} }
//else error complex_29s.xls
}
if (PlotAreaFRAME) if (PlotAreaFRAME)
PlotAreaFRAME->serialize(CP_XML_STREAM()); PlotAreaFRAME->serialize(CP_XML_STREAM());
......
...@@ -176,6 +176,7 @@ const bool WorksheetSubstream::loadContent(BinProcessor& proc) ...@@ -176,6 +176,7 @@ const bool WorksheetSubstream::loadContent(BinProcessor& proc)
case rt_Protect: proc.optional<PROTECTION_COMMON>(); break; case rt_Protect: proc.optional<PROTECTION_COMMON>(); break;
case rt_ScenMan: proc.optional<SCENARIOS>(); break; case rt_ScenMan: proc.optional<SCENARIOS>(); break;
case rt_Sort: case rt_Sort:
case rt_AutoFilterInfo:
{ {
if (proc.optional<SORTANDFILTER>())// Let it be optional if (proc.optional<SORTANDFILTER>())// Let it be optional
{ {
......
...@@ -16,7 +16,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XlsXlsxConverter", "..\sour ...@@ -16,7 +16,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XlsXlsxConverter", "..\sour
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficeXlsFileTest", "..\ASCOfficeXlsFileTest\ASCOfficeXlsFileTest.vcproj", "{C2882DDD-07E6-4314-AD4B-48F43F38D722}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficeXlsFileTest", "..\ASCOfficeXlsFileTest\ASCOfficeXlsFileTest.vcproj", "{C2882DDD-07E6-4314-AD4B-48F43F38D722}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{4260FEDF-E1DA-447F-991B-62F17DF5533E} = {4260FEDF-E1DA-447F-991B-62F17DF5533E} {F8274B05-168E-4D6E-B843-AA7510725363} = {F8274B05-168E-4D6E-B843-AA7510725363}
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
{CBEDD0D1-10A8-45C1-AF81-8492F40964CA} = {CBEDD0D1-10A8-45C1-AF81-8492F40964CA}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "graphics", "..\..\DesktopEditor\graphics\graphics_vs2005.vcproj", "{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "graphics", "..\..\DesktopEditor\graphics\graphics_vs2005.vcproj", "{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}"
......
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