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

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

parent d0a0d896
This diff is collapsed.
......@@ -4,11 +4,11 @@
/* 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:
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555
protocol : dce , ms_ext, c_ext
Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 7.00.0555
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
......@@ -21,12 +21,17 @@
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 440
#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
#include "rpc.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__
#define __ASCOfficeOdfFileW_h__
......
......@@ -2,7 +2,7 @@
#include "stdafx.h"
#include "OfficeOdfFileW.h"
#include "../../ASCOfficeUtils/ASCOfficeUtilsLib/OfficeUtils.h"
#include "../../OfficeUtils/src/OfficeUtils.h"
#include <string>
......
......@@ -150,8 +150,18 @@ void Lbl::readFields(CFRecord& record)
record.skipNunBytes(4);
Name_bin.setSize(cch); // this is to process built-in string values
record >> Name_bin;
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
record >> Name_bin;
}
rgce.load(record, cce);
......
......@@ -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)
{
TxO * txO = new TxO(mso_drawing_);
......
......@@ -67,13 +67,8 @@ int DXFPat::serialize(std::wostream & stream)
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 18: CP_XML_ATTR(L"patternType", L"gray0625"); break; //6.25% gray
}
}
if (!parent->icvBNinch)
{
CP_XML_NODE(L"bgColor")
{
CP_XML_ATTR(L"indexed", icvBackground);
default:
CP_XML_ATTR(L"patternType", L"solid");
}
}
if (!parent->icvFNinch)
......@@ -83,7 +78,15 @@ int DXFPat::serialize(std::wostream & stream)
{
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()
if (sheet_info.customColumnsWidth.find(colR) != sheet_info.customColumnsWidth.end())
{
column_width = sheet_info.customColumnsWidth[colR];
column_width = sheet_info.customColumnsWidth[colR] / 1024.;
}
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.;
......
......@@ -131,6 +131,11 @@ void OfficeArtContainer::loadFields(XLS::CFRecord& record)
case TertiaryFOPT:
art_record = OfficeArtRecordPtr(new OfficeArtTertiaryFOPT);
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)
......
......@@ -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 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
default:
CP_XML_ATTR(L"patternType", L"solid");
}
}
if (xfPropType == 3)
......
......@@ -102,6 +102,7 @@ BaseObjectPtr AXES::clone()
// AXES = [IVAXIS DVAXIS [SERIESAXIS] / DVAXIS DVAXIS] *3ATTACHEDLABEL [PlotArea FRAME]
const bool AXES::loadContent(BinProcessor& proc)
{
bool res = false;
if (proc.optional<Parenthesis_AXES_1>())
{
int count = elements_.size();
......@@ -159,6 +160,7 @@ const bool AXES::loadContent(BinProcessor& proc)
elements_.pop_front();
count--;
}
res = true;
}
int count = proc.repeated<ATTACHEDLABEL>(0, 3);
......@@ -180,7 +182,7 @@ const bool AXES::loadContent(BinProcessor& proc)
elements_.pop_back();
}
return true;
return res;
}
int AXES::serialize(std::wostream & _stream)
......
......@@ -46,13 +46,14 @@ const bool AXISPARENT::loadContent(BinProcessor& proc)
elements_.pop_back();
}
if (proc.optional<AXES>())
int count = proc.repeated<AXES>(0, 0);
if (count > 0)
{
m_AXES = elements_.back();
elements_.pop_back();
}
int count = proc.repeated<CRT>(1, 4);
count = proc.repeated<CRT>(1, 4);
while(count > 0 && !elements_.empty())
{
......
......@@ -48,23 +48,54 @@ const bool SERIESAXIS::loadContent(BinProcessor& proc)
m_Axis = elements_.back();
elements_.pop_back();
proc.mandatory<Begin>(); elements_.pop_back();
if (proc.optional<CatSerRange>())
while (true)
{
m_CatSerRange = elements_.back();
elements_.pop_back();
}
if (proc.mandatory<AXS>())
{
m_AXS = elements_.back();
elements_.pop_back();
}
proc.optional<CRTMLFRT>();
proc.mandatory<End>(); elements_.pop_back();
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>())
{
m_CatSerRange = elements_.back();
elements_.pop_back();
}
}break;
case rt_IFmtRecord:
case rt_Tick:
case rt_FontX:
case rt_AxisLine:
{
if (proc.mandatory<AXS>())
{
m_AXS = elements_.back();
elements_.pop_back();
}
}break;
case rt_CrtMlFrt:
{
proc.optional<CRTMLFRT>();
}break;
default:
{
proc.SkipRecord();
}break;
}
}
return true;
}
int SERIESAXIS::serialize(std::wostream & _stream)
......
......@@ -263,7 +263,8 @@ void ChartSheetSubstream::recalc(CHARTFORMATS* charts)
{
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;
......@@ -291,8 +292,15 @@ void ChartSheetSubstream::recalc(CHARTFORMATS* charts)
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;
CRT * crt = dynamic_cast<CRT*>(parent0->m_arCRT[iCrt].get());
std::map<int,std::vector<int>>::iterator it = m_mapTypeChart.find(iCrt);
......@@ -409,8 +417,11 @@ int ChartSheetSubstream::serialize_3D (std::wostream & _stream)
}
AXES * axes = dynamic_cast<AXES*> (parent->m_AXES.get());
wallSpPr = axes->m_Wall_FRAME;
floorSpPr = axes->m_Floor_FRAME;
if (axes)
{
wallSpPr = axes->m_Wall_FRAME;
floorSpPr = axes->m_Floor_FRAME;
}
}
}
if (!chart3D) return 0;
......@@ -714,15 +725,17 @@ int ChartSheetSubstream::serialize_plot_area (std::wostream & _stream)
}
AXES * axes = dynamic_cast<AXES*>(parent->m_AXES.get());
for (int a = 0 ; a < axes->m_arAxesId.size(); a++)
if (axes)
{
CP_XML_NODE(L"c:axId")
for (int a = 0 ; a < axes->m_arAxesId.size(); a++)
{
CP_XML_ATTR(L"val", axes->m_arAxesId[a].first);
CP_XML_NODE(L"c:axId")
{
CP_XML_ATTR(L"val", axes->m_arAxesId[a].first);
}
}
}
//else error complex_29s.xls
}
}
......@@ -733,7 +746,11 @@ int ChartSheetSubstream::serialize_plot_area (std::wostream & _stream)
AXES* axes = dynamic_cast<AXES*> (parent->m_AXES.get());
bool secondary = ax_parent->iax;
axes->serialize(CP_XML_STREAM(), secondary);
if (axes)
{
axes->serialize(CP_XML_STREAM(), secondary);
}
//else error complex_29s.xls
}
if (PlotAreaFRAME)
......
......@@ -176,6 +176,7 @@ const bool WorksheetSubstream::loadContent(BinProcessor& proc)
case rt_Protect: proc.optional<PROTECTION_COMMON>(); break;
case rt_ScenMan: proc.optional<SCENARIOS>(); break;
case rt_Sort:
case rt_AutoFilterInfo:
{
if (proc.optional<SORTANDFILTER>())// Let it be optional
{
......
......@@ -16,7 +16,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XlsXlsxConverter", "..\sour
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficeXlsFileTest", "..\ASCOfficeXlsFileTest\ASCOfficeXlsFileTest.vcproj", "{C2882DDD-07E6-4314-AD4B-48F43F38D722}"
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
EndProject
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