Commit 9ade8203 authored by Alexey.Musinov's avatar Alexey.Musinov

Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop

* 'develop' of https://github.com/ONLYOFFICE/core:
  .
  fix unsize shape text rect
  XlsFormat - pivot charts
  fix bug #35396. version up.
  .
  OdfFormatWriter - data label position XlsFormatReader - fix pivots
parents 358c1613 b3a83ad6
......@@ -2087,6 +2087,7 @@ namespace DocFileFormat
nElemSize = 4;
bTruncated = true;
}
else nElemSize = 2;
long dwSize = nElems * nElemSize;
......
......@@ -209,6 +209,7 @@ SOURCES += \
../src/odf/datatypes/wrapoption.cpp \
../src/odf/datatypes/writingmode.cpp \
../src/odf/datatypes/xlink.cpp \
../src/odf/datatypes/chartlabelposition.cpp \
../src/docx/xlsx_conditionalFormatting.cpp \
../src/docx/xlsx_dxfs.cpp \
../src/docx/docx_content_type.cpp \
......
......@@ -119,3 +119,4 @@
#include "../src/odf/datatypes/wrapoption.cpp"
#include "../src/odf/datatypes/writingmode.cpp"
#include "../src/odf/datatypes/xlink.cpp"
#include "../src/odf/datatypes/chartlabelposition.cpp"
......@@ -235,7 +235,7 @@ std::wstring mediaitems::add_or_find(const std::wstring & href, RelsType type, b
outputPath = outputPath.substr(0, n_svm) + L".png";
}
//------------------------------------------------
if (inputFileName.empty()) return L"";
//if (inputFileName.empty()) return L""; - Book 27.ods - пустые линки на картинки
id = std::wstring(L"picId") + std::to_wstring(count_image + 1);
count_image++;
......
......@@ -124,6 +124,7 @@ void oox_chart_series::parse_properties()
data_labels_->set_showCatName(*boolVal);
}
odf_reader::GetProperty(content_.properties_, L"data-label-number", intVal);
if (intVal)
{
if (!data_labels_) data_labels_ = oox_data_labels();
......@@ -131,6 +132,13 @@ void oox_chart_series::parse_properties()
if (*intVal == 1) data_labels_->set_showVal(true);
if (*intVal == 2) data_labels_->set_showPercent(true);
}
odf_reader::GetProperty(content_.properties_, L"label-position", intVal);
if (intVal)
{
if (!data_labels_) data_labels_ = oox_data_labels();
data_labels_->set_position(*intVal);
}
}
void oox_chart_series::setValues(int ind, std::vector<std::wstring> & values)
{
......
......@@ -49,6 +49,8 @@ oox_data_labels::oox_data_labels()//подписи на значениях
showPercent_ = false;
showSerName_ = false;
showVal_ = false;
position_ = -1; //not set
}
void oox_data_labels::set_common_dLbl ( std::vector<odf_reader::_property> & text_properties)
......@@ -105,6 +107,29 @@ void oox_data_labels::oox_serialize(std::wostream & _Wostream)
}
}
}
if (position_ >= 0 && position_ < 13)
{
CP_XML_NODE(L"c:dLblPos")
{
switch (position_)
{
case 0: CP_XML_ATTR(L"val", L"bestFit");break;
case 1: CP_XML_ATTR(L"val", L"b"); break;
case 2: CP_XML_ATTR(L"val", L"b"); break;
case 3: CP_XML_ATTR(L"val", L"b"); break;
case 4: CP_XML_ATTR(L"val", L"ctr"); break;
case 5: CP_XML_ATTR(L"val", L"inEnd"); break;
case 6: CP_XML_ATTR(L"val", L"l"); break;
case 7: CP_XML_ATTR(L"val", L"inBase"); break;
case 8: CP_XML_ATTR(L"val", L"outEnd"); break;
case 9: CP_XML_ATTR(L"val", L"r"); break;
case 10: CP_XML_ATTR(L"val", L"t"); break;
case 11: CP_XML_ATTR(L"val", L"t"); break;
case 12: CP_XML_ATTR(L"val", L"t"); break;
}
}
}
CP_XML_NODE(L"c:showLegendKey")
{
......
......@@ -59,8 +59,10 @@ public:
void set_showSerName (bool Val){showSerName_ = Val;}
void set_showVal (bool Val){showVal_ = Val;}
void add_dLbl(int ind, std::vector<odf_reader::_property> & text_properties);
void set_common_dLbl ( std::vector<odf_reader::_property> & text_properties);
void set_position (int Val){position_ = Val;}
void add_dLbl (int ind, std::vector<odf_reader::_property> & text_properties);
void set_common_dLbl ( std::vector<odf_reader::_property> & text_properties);
private:
......@@ -72,6 +74,8 @@ private:
bool showSerName_; // (Show Series Name) §21.2.2.188
bool showVal_; // (Show Value) §21.2.2.189
int position_;
std::vector<odf_reader::_property> textPr_;
std::map<int, std::vector<odf_reader::_property>> dLbls_;
......
......@@ -514,7 +514,7 @@ void xlsx_drawing_context::process_position_properties(drawing_object_descriptio
}
void xlsx_drawing_context::process_image(drawing_object_description & obj,_xlsx_drawing & drawing, xlsx_drawings_ptr xlsx_drawings_)
void xlsx_drawing_context::process_image(drawing_object_description & obj, _xlsx_drawing & drawing, xlsx_drawings_ptr xlsx_drawings_)
{
if (!drawing.fill.bitmap)
{
......
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "chartlabelposition.h"
#include <boost/algorithm/string.hpp>
#include <ostream>
namespace cpdoccore { namespace odf_types {
std::wostream & operator << (std::wostream & _Wostream, const chart_label_position & _Val)
{
switch(_Val.get_type())
{
case chart_label_position::avoid_overlap: _Wostream << L"avoid-overlap"; break;
case chart_label_position::bottom: _Wostream << L"bottom"; break;
case chart_label_position::bottom_left: _Wostream << L"bottom-left"; break;
case chart_label_position::bottom_right: _Wostream << L"bottom_right"; break;
case chart_label_position::center: _Wostream << L"center"; break;
case chart_label_position::inside: _Wostream << L"insidev"; break;
case chart_label_position::left: _Wostream << L"left"; break;
case chart_label_position::near_origin: _Wostream << L"near-origin"; break;
case chart_label_position::outside: _Wostream << L"outside"; break;
case chart_label_position::right: _Wostream << L"right"; break;
case chart_label_position::top: _Wostream << L"top"; break;
case chart_label_position::top_left: _Wostream << L"top-left"; break;
case chart_label_position::top_right: _Wostream << L"top-right"; break;
}
return _Wostream;
}
chart_label_position chart_label_position::parse(const std::wstring & Str)
{
std::wstring tmp = Str;
boost::algorithm::to_lower(tmp);
if (tmp == L"avoid-overlap") return chart_label_position( avoid_overlap );
else if (tmp == L"bottom") return chart_label_position( bottom );
else if (tmp == L"bottom-left") return chart_label_position( bottom_left );
else if (tmp == L"bottom-right")return chart_label_position( bottom_right );
else if (tmp == L"center") return chart_label_position( center );
else if (tmp == L"inside") return chart_label_position( inside );
else if (tmp == L"left") return chart_label_position( left );
else if (tmp == L"near-origin") return chart_label_position( near_origin );
else if (tmp == L"outside") return chart_label_position( outside );
else if (tmp == L"right") return chart_label_position( right );
else if (tmp == L"top") return chart_label_position( top );
else if (tmp == L"top-left") return chart_label_position( top_left );
else if (tmp == L"top-right") return chart_label_position( top_right );
else
{
return chart_label_position( near_origin );
}
}
} }
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include <iosfwd>
#include <string>
#include "odfattributes.h"
//
namespace cpdoccore { namespace odf_types {
class chart_label_position
{
public:
enum type
{
avoid_overlap,
bottom,
bottom_left,
bottom_right,
center,
inside,
left,
near_origin,
outside,
right,
top,
top_left,
top_right
};
chart_label_position() {}
chart_label_position(type _Type) : type_(_Type)
{}
type get_type() const
{
return type_;
};
static chart_label_position parse(const std::wstring & Str);
private:
type type_;
};
std::wostream & operator << (std::wostream & _Wostream, const chart_label_position & _Val);
}
APPLY_PARSE_XML_ATTRIBUTES(odf_types::chart_label_position);
}
......@@ -62,7 +62,6 @@ chart_solid_type chart_solid_type::parse(const std::wstring & Str)
return chart_solid_type( pyramid );
else
{
BOOST_THROW_EXCEPTION( errors::invalid_attribute() );
return chart_solid_type( cuboid );
}
}
......
......@@ -151,6 +151,9 @@ void style_chart_properties::add_attributes( const xml::attributes_wc_ptr & Attr
CP_APPLY_ATTR(L"chart:error-category", strVal);
if (strVal)content_.push_back(_property(L"error-category", chart_error_category(chart_error_category::parse(strVal.get())).get_type() ));
CP_APPLY_ATTR(L"chart:label-position", strVal);
if (strVal)content_.push_back(_property(L"label-position", chart_label_position(chart_label_position::parse(strVal.get())).get_type() ));
common_rotation_angle_attlist_.add_attributes(Attributes);
//CP_APPLY_ATTR(L"chart:scale-text", chart_scale_text_ );
......
......@@ -49,6 +49,7 @@
#include "datatypes/charterrorcategory.h"
#include "datatypes/chartseriessource.h"
#include "datatypes/chartregressiontype.h"
#include "datatypes/chartlabelposition.h"
#include "datatypes/direction.h"
namespace cpdoccore {
......
......@@ -385,6 +385,14 @@
RelativePath="..\src\odf\datatypes\chartlabelarrangement.h"
>
</File>
<File
RelativePath="..\src\odf\datatypes\chartlabelposition.cpp"
>
</File>
<File
RelativePath="..\src\odf\datatypes\chartlabelposition.h"
>
</File>
<File
RelativePath="..\src\odf\datatypes\chartregressiontype.cpp"
>
......
......@@ -51,7 +51,7 @@ const std::list<std::string> TxtFile::readAnsiOrCodePage() // == readUtf8without
std::list<std::string> result;
NSFile::CFileBinary file_binary;
if (file_binary.OpenFile(m_path) != S_OK) return result;
if (file_binary.OpenFile(m_path) == false) return result;
DWORD file_size = file_binary.GetFileSize();
char *file_data = new char[file_size];
......@@ -118,7 +118,7 @@ const std::list<std::wstring> TxtFile::readUnicode()
std::list<std::wstring> result;
NSFile::CFileBinary file_binary;
if (file_binary.OpenFile(m_path) != S_OK) return result;
if (file_binary.OpenFile(m_path) == false ) return result;
DWORD file_size = file_binary.GetFileSize();
char *file_data = new char[file_size];
......@@ -135,7 +135,7 @@ const std::list<std::wstring> TxtFile::readBigEndian()
std::list<std::wstring> result;
NSFile::CFileBinary file_binary;
if (file_binary.OpenFile(m_path) != S_OK) return result;
if (file_binary.OpenFile(m_path) == false) return result;
DWORD file_size = file_binary.GetFileSize();
char *file_data = new char[file_size];
......@@ -160,7 +160,7 @@ const std::list<std::string> TxtFile::readUtf8()
std::list<std::string> result;
NSFile::CFileBinary file_binary;
if (file_binary.OpenFile(m_path) != S_OK) return result;
if (file_binary.OpenFile(m_path) == false) return result;
DWORD file_size = file_binary.GetFileSize();
char *file_data = new char[file_size];
......
......@@ -94,5 +94,6 @@ int _tmain(int argc, _TCHAR* argv[])
HRESULT hr = convert_single(argv[1]);
//HRESULT hr = convert_directory(argv[1]);
return hr;
}
\ No newline at end of file
......@@ -51,7 +51,6 @@ public:
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeBRAI;
......
......@@ -31,7 +31,7 @@
*/
#include "BookExt.h"
#include <Logic/Biff_structures/FrtHeader.h>
#include "../Biff_structures/FrtHeader.h"
namespace XLS
{
......
......@@ -80,7 +80,7 @@ int Legend::serialize(std::wostream & _stream, int size)
{
CP_XML_NODE(L"c:legendPos")
{
if (y1Kf > 0.5)
if (y1Kf > 0.5 && y1Kf > x1Kf)
{
CP_XML_ATTR(L"val", "b");
x = x - (size - 1 ) * dx / 2;
......@@ -92,7 +92,7 @@ int Legend::serialize(std::wostream & _stream, int size)
y = y - (size - 1 ) * dy / 2;
dy = dy * size;
}
else if (x2Kf > 0.5)
else if (x2Kf > 0.5 && x2Kf > y2Kf)
{
CP_XML_ATTR(L"val", "l");
y = y - (size - 1 ) * dy / 2;
......
......@@ -39,12 +39,10 @@ OleDbConn::OleDbConn()
{
}
OleDbConn::~OleDbConn()
{
}
BaseObjectPtr OleDbConn::clone()
{
return BaseObjectPtr(new OleDbConn(*this));
......@@ -52,9 +50,12 @@ BaseObjectPtr OleDbConn::clone()
void OleDbConn::readFields(CFRecord& record)
{
Log::error("OleDbConn record is not implemented.");
unsigned short flags;
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
record >> frtHeaderOld >> flags >> cst;
fPasswd = GETBIT(flags, 0);
fLocal = GETBIT(flags, 1);
}
} // namespace XLS
......
......@@ -32,12 +32,11 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/FrtHeaderOld.h"
namespace XLS
{
// Logical representation of OleDbConn record in BIFF8
class OleDbConn: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(OleDbConn)
......@@ -47,12 +46,15 @@ public:
~OleDbConn();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeOleDbConn;
static const ElementType type = typeOleDbConn;
FrtHeaderOld frtHeaderOld;
bool fPasswd;
bool fLocal;
unsigned short cst;
};
} // namespace XLS
......
......@@ -39,12 +39,10 @@ PivotChartBits::PivotChartBits()
{
}
PivotChartBits::~PivotChartBits()
{
}
BaseObjectPtr PivotChartBits::clone()
{
return BaseObjectPtr(new PivotChartBits(*this));
......@@ -52,8 +50,10 @@ BaseObjectPtr PivotChartBits::clone()
void PivotChartBits::readFields(CFRecord& record)
{
Log::error("PivotChartBits record is not implemented.");
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
unsigned short unused1, flags, reserved1, reserved2, reserved3;
record >> rt >> unused1 >> flags >> reserved1 >> reserved2 >> reserved3;
fGXHide = GETBIT(flags, 0);
}
} // namespace XLS
......
......@@ -36,8 +36,6 @@
namespace XLS
{
// Logical representation of PivotChartBits record in BIFF8
class PivotChartBits: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(PivotChartBits)
......@@ -47,12 +45,13 @@ public:
~PivotChartBits();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typePivotChartBits;
static const ElementType type = typePivotChartBits;
unsigned short rt;
bool fGXHide;
};
} // namespace XLS
......
......@@ -39,12 +39,10 @@ Qsi::Qsi()
{
}
Qsi::~Qsi()
{
}
BaseObjectPtr Qsi::clone()
{
return BaseObjectPtr(new Qsi(*this));
......@@ -52,9 +50,30 @@ BaseObjectPtr Qsi::clone()
void Qsi::readFields(CFRecord& record)
{
Log::error("Qsi record is not implemented.");
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
unsigned short flags1, flags2;
_UINT32 reserved;
record >> flags1 >> itblAutoFmt >> flags2 >> reserved >> rgchName;
fTitles = GETBIT(flags1, 0);
fRowNums = GETBIT(flags1, 1);
fDisableRefresh = GETBIT(flags1, 2);
fAsync = GETBIT(flags1, 3);
fNewAsync = GETBIT(flags1, 4);
fAutoRefresh = GETBIT(flags1, 5);
fShrink = GETBIT(flags1, 6);
fFill = GETBIT(flags1, 7);
fAutoFormat = GETBIT(flags1, 8);
fSaveData = GETBIT(flags1, 9);
fDisableEdit = GETBIT(flags1, 10);
fOverwrite = GETBIT(flags1, 13);
fibitAtrNum = GETBIT(flags2, 0);
fibitAtrFnt = GETBIT(flags2, 1);
fibitAtrAlc = GETBIT(flags2, 2);
fibitAtrBdr = GETBIT(flags2, 3);
fibitAtrPat = GETBIT(flags2, 4);
fibitAtrProt = GETBIT(flags2, 5);
}
} // namespace XLS
......
......@@ -32,12 +32,11 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/BiffString.h"
namespace XLS
{
// Logical representation of Qsi record in BIFF8
class Qsi: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(Qsi)
......@@ -47,11 +46,31 @@ public:
~Qsi();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeQsi;
static const ElementType type = typeQsi;
bool fTitles;
bool fRowNums;
bool fDisableRefresh;
bool fAsync;
bool fNewAsync;
bool fAutoRefresh;
bool fShrink;
bool fFill;
bool fAutoFormat;
bool fSaveData;
bool fDisableEdit;
bool fOverwrite;
unsigned short itblAutoFmt; //AutoFmt8
bool fibitAtrNum;
bool fibitAtrFnt;
bool fibitAtrAlc;
bool fibitAtrBdr;
bool fibitAtrPat;
bool fibitAtrProt;
XLUnicodeString rgchName;
};
} // namespace XLS
......
......@@ -39,12 +39,10 @@ Qsif::Qsif()
{
}
Qsif::~Qsif()
{
}
BaseObjectPtr Qsif::clone()
{
return BaseObjectPtr(new Qsif(*this));
......@@ -52,8 +50,22 @@ BaseObjectPtr Qsif::clone()
void Qsif::readFields(CFRecord& record)
{
Log::error("Qsif record is not implemented.");
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
unsigned short flags1, flags2;
record >> frtHeaderOld >> flags1 >> flags2 >> idField;
fUserIns = GETBIT(flags1, 0);
fFillDown = GETBIT(flags1, 1);
fSortDes = GETBIT(flags1, 2);
iSortKey = GETBITS(flags1, 3, 10);
fRowNums = GETBIT(flags1, 11);
fSorted = GETBIT(flags1, 13);
fClipped = GETBIT(flags2, 0);
if (record.getRdPtr() >= record.getDataSize())
return;
record >> idList >> rgbTitle;
}
} // namespace XLS
......
......@@ -32,12 +32,12 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/FrtHeaderOld.h"
#include "../Biff_structures/BiffString.h"
namespace XLS
{
// Logical representation of Qsif record in BIFF8
class Qsif: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(Qsif)
......@@ -47,12 +47,22 @@ public:
~Qsif();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeQsif;
static const ElementType type = typeQsif;
FrtHeaderOld frtHeaderOld;
bool fUserIns;
bool fFillDown;
bool fSortDes;
unsigned char iSortKey;
bool fRowNums;
bool fSorted;
bool fClipped;
_UINT32 idField;
_UINT32 idList;
XLUnicodeString rgbTitle;
};
} // namespace XLS
......
......@@ -187,6 +187,27 @@ void SXAddl_SXCView_SXDId::readFields(CFRecord& record)
record >> stName;
}
//----------------------------------------------------------------------------
BaseObjectPtr SXAddl_SXCCacheField_SXDIfdbMempropMap::clone()
{
return BaseObjectPtr(new SXAddl_SXCCacheField_SXDIfdbMempropMap(*this));
}
void SXAddl_SXCCacheField_SXDIfdbMempropMap::readFields(CFRecord& record)
{
m_SXAddlHdr.load(record);
record.skipNunBytes(6);
int sz = record.getDataSize() - record.getRdPtr();
for (int i = 0; i < sz/2; i++)
{
unsigned short val;
record >> val;
rgMap.push_back(val);
}
}
} // namespace XLS
......@@ -159,7 +159,14 @@ public:
class SXAddl_SXCCacheField_SXDCaption : public SXAddl {};
class SXAddl_SXCCacheField_SXDEnd : public SXAddl {};
class SXAddl_SXCCacheField_SXDId : public SXAddl {};
class SXAddl_SXCCacheField_SXDIfdbMempropMap: public SXAddl {};
class SXAddl_SXCCacheField_SXDIfdbMempropMap: public SXAddl
{
public:
virtual void readFields(CFRecord& record);
virtual BaseObjectPtr clone();
std::vector<unsigned short> rgMap;
};
class SXAddl_SXCCacheField_SXDIfdbMpMapCount: public SXAddl {};
class SXAddl_SXCCacheField_SXDProperty : public SXAddl {};
class SXAddl_SXCCacheField_SXDPropName : public SXAddl {};
......
......@@ -49,11 +49,10 @@ public:
virtual void load(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, bool full_ref = false);
ExtSheetPair iTabs;
RgceAreaRel area;
ExtSheetPair iTabs;
RgceAreaRel area;
const CellRef& cell_base_ref;
};
......
......@@ -81,8 +81,6 @@ const bool CHART::loadContent(BinProcessor& proc)
elements_.pop_back();
count--;
}
// reader.SeekNextSubstream();
return true;
}
......
......@@ -101,7 +101,7 @@ int DBB::serialize(std::wostream & strm)
{
m_arSXOPER[indexOPER++]->serialize(CP_XML_STREAM());
}
else
else if (posBlob < dbb->size)
{
if (arPivotCacheFieldShortSize[i])//fShortIitms
{
......
......@@ -190,11 +190,8 @@ int FDB::serialize(std::wostream & strm)
{
CP_XML_ATTR(L"name", fdb->stFieldName.value());
if (fdb_type->wTypeSql > 0)
{
CP_XML_ATTR(L"numFmtId", fdb_type->wTypeSql);
CP_XML_ATTR(L"numFmtId", fdb_type->wTypeSql);
//CP_XML_ATTR(L"sqlType", fdb_type->wTypeSql); //in db
}
if (m_arSRCSXOPER.empty() && m_arGRPSXOPER.empty() == false)
{
CP_XML_ATTR(L"databaseField", 0);
......@@ -250,6 +247,7 @@ int FDB::serialize(std::wostream & strm)
if (bNumber) bInteger = false;
else bNumber = true;
}
if ((bDate & bNumber) || (bNumber & bString))
{
CP_XML_ATTR(L"containsSemiMixedTypes", 1);
......@@ -262,13 +260,19 @@ int FDB::serialize(std::wostream & strm)
{
CP_XML_ATTR(L"containsSemiMixedTypes", 0);
}
if (bNumber) CP_XML_ATTR(L"containsNumber", 1);
if (bDate && ! (bNumber || bInteger || bString || bEmpty ))
{
CP_XML_ATTR(L"containsNonDate", 0);
}
if (bDate) CP_XML_ATTR(L"containsDate", 1);
if (!bString && (bInteger || bDate || bNumber || bEmpty))
{
CP_XML_ATTR(L"containsString", 0);
}
if (bEmpty) CP_XML_ATTR(L"containsBlank", 1);
if (bNumber) CP_XML_ATTR(L"containsNumber", 1);
if (bInteger) CP_XML_ATTR(L"containsInteger", 1);
if (!bString && (bInteger || bDate || bNumber || bEmpty))
CP_XML_ATTR(L"containsString", 0);
if (fdb->fnumMinMaxValid)
{
......@@ -296,8 +300,13 @@ int FDB::serialize(std::wostream & strm)
{
CP_XML_NODE(L"fieldGroup")
{
if (fdb->ifdbParent > 0)
if (fdb->fHasParent)
{
CP_XML_ATTR(L"par", fdb->ifdbParent);
CP_XML_ATTR(L"base", index);
}
else
CP_XML_ATTR(L"base", fdb->ifdbBase);
if (m_SXRANGE)
m_SXRANGE->serialize(CP_XML_STREAM());
......
......@@ -67,7 +67,8 @@ public:
bool bInteger;
bool bBool;
GlobalWorkbookInfoPtr global_info;
int index;
GlobalWorkbookInfoPtr global_info;
};
} // namespace XLS
......
......@@ -91,9 +91,13 @@ const bool PIVOTCACHE::loadContent(BinProcessor& proc)
}
count = proc.repeated<FDB>(0, 0);
int i = 0;
while(count--)
{
m_arFDB.push_back(elements_.front()); elements_.pop_front();
FDB* fdb = dynamic_cast<FDB*>(m_arFDB.back().get());
fdb->index = i++;
}
count = proc.repeated<DBB>(0, 0);
......
......@@ -68,6 +68,14 @@ const bool PIVOTVIEW::loadContent(BinProcessor& proc)
}
m_PIVOTCORE = elements_.back();
elements_.pop_back();
PIVOTCORE *core = dynamic_cast<PIVOTCORE*>(m_PIVOTCORE.get());
SxView* view = dynamic_cast<SxView*>(core->m_SxView.get());
if (view)
{
name = view->stTable.value();
}
if (proc.optional<PIVOTFRT>())
{
......@@ -98,9 +106,7 @@ int PIVOTVIEW::serialize(std::wostream & strm)
CP_XML_ATTR(L"name", view->stTable.value());
CP_XML_ATTR(L"cacheId", view->iCache);
CP_XML_ATTR(L"useAutoFormatting", view->fAutoFormat);
CP_XML_ATTR(L"dataOnRows", view->sxaxis4Data.bRw);
CP_XML_ATTR(L"autoFormatId", view->itblAutoFmt);
CP_XML_ATTR(L"applyNumberFormats", view->fAtrNum);
CP_XML_ATTR(L"applyBorderFormats", view->fAtrBdr);
CP_XML_ATTR(L"applyFontFormats", view->fAtrFnt);
......@@ -111,15 +117,16 @@ int PIVOTVIEW::serialize(std::wostream & strm)
{
CP_XML_ATTR(L"dataCaption", view->stData.value());
}
//updatedVersion="2"
//asteriskTotals="1"
//showMemberPropertyTips="0"
//itemPrintTitles="1"
//createdVersion="1"
//indent="0"
//compact="0"
//compactData="0"
//gridDropZones="1"
CP_XML_ATTR(L"asteriskTotals", 1);
CP_XML_ATTR(L"showMemberPropertyTips", 0);
CP_XML_ATTR(L"useAutoFormatting", view->fAutoFormat);
CP_XML_ATTR(L"autoFormatId", view->itblAutoFmt);
CP_XML_ATTR(L"itemPrintTitles", 1);
CP_XML_ATTR(L"indent", 0);
CP_XML_ATTR(L"compact", 0);
CP_XML_ATTR(L"compactData", 0);
CP_XML_ATTR(L"gridDropZones", 1);
CP_XML_NODE(L"location")
{
CP_XML_ATTR(L"ref", view->ref.toString());
......
......@@ -54,7 +54,8 @@ public:
BaseObjectPtr m_PIVOTCORE;
BaseObjectPtr m_PIVOTFRT;
//----------------------------------
int indexCache;
int indexCache;
std::wstring name;
};
} // namespace XLS
......
......@@ -31,38 +31,36 @@
*/
#include "SERIESFORMAT.h"
#include <Logic/Biff_records/Series.h>
#include <Logic/Biff_records/Begin.h>
#include <Logic/Biff_records/SerToCrt.h>
#include <Logic/Biff_records/SerParent.h>
#include <Logic/Biff_records/SerAuxTrend.h>
#include <Logic/Biff_records/SerAuxErrBar.h>
#include <Logic/Biff_records/LegendException.h>
#include <Logic/Biff_records/End.h>
#include <Logic/Biff_records/SerAuxTrend.h>
#include <Logic/Biff_records/SerAuxErrBar.h>
#include <Logic/Biff_records/AttachedLabel.h>
#include <Logic/Biff_unions/AI.h>
#include <Logic/Biff_unions/SS.h>
#include <Logic/Biff_unions/ATTACHEDLABEL.h>
#include <Logic/Biff_unions/TEXTPROPS.h>
#include <Logic/Biff_unions/CHARTFOMATS.h>
#include "AI.h"
#include "SS.h"
#include "ATTACHEDLABEL.h"
#include "TEXTPROPS.h"
#include "CHARTFOMATS.h"
#include "../Biff_records/Series.h"
#include "../Biff_records/Begin.h"
#include "../Biff_records/SerToCrt.h"
#include "../Biff_records/SerParent.h"
#include "../Biff_records/SerAuxTrend.h"
#include "../Biff_records/SerAuxErrBar.h"
#include "../Biff_records/LegendException.h"
#include "../Biff_records/End.h"
#include "../Biff_records/SerAuxTrend.h"
#include "../Biff_records/SerAuxErrBar.h"
#include "../Biff_records/AttachedLabel.h"
#include "../Biff_records/BRAI.h"
namespace XLS
{
SERIESFORMAT::SERIESFORMAT()
{
}
SERIESFORMAT::~SERIESFORMAT()
{
}
// (SerToCrt / (SerParent (SerAuxTrend / SerAuxErrBar)))
class Parenthesis_SERIESFORMAT_1: public ABNFParenthesis
{
......@@ -353,5 +351,6 @@ int SERIESFORMAT::serialize_parent(std::wostream & _stream, CHARTFORMATS* chart_
return 0;
}
} // namespace XLS
......@@ -75,7 +75,6 @@ public:
//-----------------------------------------------------------------------
BaseObjectPtr m_SERIESFORMAT_ext;
};
} // namespace XLS
......@@ -130,7 +130,7 @@ int SXOPER::serialize(std::wostream & strm)
{
CP_XML_NODE(node)
{
if (!value.empty())
if (!value.empty() || bString)
{
CP_XML_ATTR(L"v", value);
}
......
......@@ -32,64 +32,65 @@
#include "ChartSheetSubstream.h"
#include <Logic/Biff_records/WriteProtect.h>
#include <Logic/Biff_records/SheetExt.h>
#include <Logic/Biff_records/WebPub.h>
#include <Logic/Biff_records/HFPicture.h>
#include <Logic/Biff_records/PrintSize.h>
#include <Logic/Biff_records/HeaderFooter.h>
#include <Logic/Biff_records/Fbi.h>
#include <Logic/Biff_records/Fbi2.h>
#include <Logic/Biff_records/ClrtClient.h>
#include <Logic/Biff_records/Palette.h>
#include <Logic/Biff_records/SXViewLink.h>
#include <Logic/Biff_records/PivotChartBits.h>
#include <Logic/Biff_records/SBaseRef.h>
#include <Logic/Biff_records/MsoDrawingGroup.h>
#include <Logic/Biff_records/Units.h>
#include <Logic/Biff_records/CodeName.h>
#include <Logic/Biff_records/EOF.h>
#include <Logic/Biff_records/BOF.h>
#include <Logic/Biff_records/AreaFormat.h>
#include <Logic/Biff_records/SerToCrt.h>
#include <Logic/Biff_records/AxisParent.h>
#include <Logic/Biff_records/Series.h>
#include <Logic/Biff_records/BRAI.h>
#include <Logic/Biff_records/SIIndex.h>
#include <Logic/Biff_records/DataFormat.h>
#include <Logic/Biff_records/Text.h>
#include <Logic/Biff_records/Pos.h>
#include <Logic/Biff_records/Pie.h>
#include <Logic/Biff_records/ShtProps.h>
#include <Logic/Biff_records/Chart3d.h>
#include <Logic/Biff_records/ChartFormat.h>
#include <Logic/Biff_records/Legend.h>
#include <Logic/Biff_records/AttachedLabel.h>
#include <Logic/Biff_records/DataLabExtContents.h>
#include <Logic/Biff_records/CrtLine.h>
#include <Logic/Biff_records/Dat.h>
#include <Logic/Biff_records/Chart.h>
#include <Logic/Biff_records/ExternSheet.h>
#include <Logic/Biff_unions/PAGESETUP.h>
#include <Logic/Biff_unions/BACKGROUND.h>
#include <Logic/Biff_unions/PROTECTION_COMMON.h>
#include <Logic/Biff_unions/OBJECTS.h>
#include <Logic/Biff_unions/CHARTFOMATS.h>
#include <Logic/Biff_unions/SERIESDATA.h>
#include <Logic/Biff_unions/WINDOW.h>
#include <Logic/Biff_unions/CUSTOMVIEW.h>
#include <Logic/Biff_unions/CRTMLFRT.h>
#include <Logic/Biff_unions/FRAME.h>
#include <Logic/Biff_unions/ATTACHEDLABEL.h>
#include <Logic/Biff_unions/SERIESFORMAT.h>
#include <Logic/Biff_unions/CRT.h>
#include <Logic/Biff_unions/AXISPARENT.h>
#include <Logic/Biff_unions/AXES.h>
#include <Logic/Biff_unions/SS.h>
#include <Logic/Biff_unions/AI.h>
#include <Logic/Biff_unions/LD.h>
#include <Logic/Biff_unions/DAT.h>
#include "Biff_records/WriteProtect.h"
#include "Biff_records/SheetExt.h"
#include "Biff_records/WebPub.h"
#include "Biff_records/HFPicture.h"
#include "Biff_records/PrintSize.h"
#include "Biff_records/HeaderFooter.h"
#include "Biff_records/Fbi.h"
#include "Biff_records/Fbi2.h"
#include "Biff_records/ClrtClient.h"
#include "Biff_records/Palette.h"
#include "Biff_records/SXViewLink.h"
#include "Biff_records/PivotChartBits.h"
#include "Biff_records/SBaseRef.h"
#include "Biff_records/MsoDrawingGroup.h"
#include "Biff_records/Units.h"
#include "Biff_records/CodeName.h"
#include "Biff_records/EOF.h"
#include "Biff_records/BOF.h"
#include "Biff_records/AreaFormat.h"
#include "Biff_records/SerToCrt.h"
#include "Biff_records/AxisParent.h"
#include "Biff_records/Series.h"
#include "Biff_records/BRAI.h"
#include "Biff_records/SIIndex.h"
#include "Biff_records/DataFormat.h"
#include "Biff_records/Text.h"
#include "Biff_records/Pos.h"
#include "Biff_records/Pie.h"
#include "Biff_records/ShtProps.h"
#include "Biff_records/Chart3d.h"
#include "Biff_records/ChartFormat.h"
#include "Biff_records/Legend.h"
#include "Biff_records/AttachedLabel.h"
#include "Biff_records/DataLabExtContents.h"
#include "Biff_records/CrtLine.h"
#include "Biff_records/Dat.h"
#include "Biff_records/Chart.h"
#include "Biff_records/ExternSheet.h"
#include "Biff_unions/PAGESETUP.h"
#include "Biff_unions/BACKGROUND.h"
#include "Biff_unions/PROTECTION_COMMON.h"
#include "Biff_unions/OBJECTS.h"
#include "Biff_unions/CHARTFOMATS.h"
#include "Biff_unions/SERIESDATA.h"
#include "Biff_unions/WINDOW.h"
#include "Biff_unions/CUSTOMVIEW.h"
#include "Biff_unions/CRTMLFRT.h"
#include "Biff_unions/FRAME.h"
#include "Biff_unions/ATTACHEDLABEL.h"
#include "Biff_unions/SERIESFORMAT.h"
#include "Biff_unions/CRT.h"
#include "Biff_unions/AXISPARENT.h"
#include "Biff_unions/AXES.h"
#include "Biff_unions/SS.h"
#include "Biff_unions/AI.h"
#include "Biff_unions/LD.h"
#include "Biff_unions/DAT.h"
#include "Biff_unions/PIVOTVIEW.h"
#include "../../XlsXlsxConverter/XlsConverter.h"
#include "../../XlsXlsxConverter/xlsx_conversion_context.h"
......@@ -202,10 +203,30 @@ const bool ChartSheetSubstream::loadContent(BinProcessor& proc)
proc.optional<PROTECTION_COMMON>(); break;
case rt_Palette: proc.optional<Palette>(); break;
case rt_SXViewLink: proc.optional<SXViewLink>(); break;
case rt_PivotChartBits: proc.optional<PivotChartBits>(); break;
case rt_SBaseRef: proc.optional<SBaseRef>(); break;
case rt_SXViewLink:
{
if (proc.optional<SXViewLink>())
{
m_SXViewLink = elements_.back();
elements_.pop_back();
}
}break;
case rt_PivotChartBits:
{
if (proc.optional<PivotChartBits>())
{
m_PivotChartBits = elements_.back();
elements_.pop_back();
}
}break;
case rt_SBaseRef:
{
if (proc.optional<SBaseRef>())
{
m_SBaseRef = elements_.back();
elements_.pop_back();
}
}break;
case rt_Obj:
case rt_MsoDrawing:
{
......@@ -224,9 +245,18 @@ const bool ChartSheetSubstream::loadContent(BinProcessor& proc)
{
if (proc.optional<ExternSheet>())
{
m_ExternSheet = elements_.back();
elements_.pop_back();
}
}break;
case rt_Units: proc.mandatory<Units>(); break;
case rt_Units:
{
if (proc.mandatory<Units>())
{
m_Units = elements_.back();
elements_.pop_back();
}
}break;
case rt_Chart:
{
if ( proc.mandatory<CHARTFORMATS>() )
......@@ -348,15 +378,14 @@ void ChartSheetSubstream::recalc(SERIESDATA* data)
{
}
int ChartSheetSubstream::serialize (std::wostream & _stream)
int ChartSheetSubstream::serialize(std::wostream & _stream)
{
AreaFormat *chart_area_format = NULL;
CHARTFORMATS *chart_formats = dynamic_cast<CHARTFORMATS*>(m_CHARTFORMATS.get());
if (!chart_formats) return 0;
AreaFormat *chart_area_format = NULL;
FRAME *chart_frame = dynamic_cast<FRAME*>(chart_formats->m_FRAME.get());
if (chart_frame)
chart_area_format = dynamic_cast<AreaFormat*>(chart_frame->m_AreaFormat.get());
if (chart_frame) chart_area_format = dynamic_cast<AreaFormat*>(chart_frame->m_AreaFormat.get());
ShtProps *sht_props = dynamic_cast<ShtProps*>(chart_formats->m_ShtProps.get());
Chart *chart_rect = dynamic_cast<Chart*>(chart_formats->m_ChartRect.get());
......@@ -368,7 +397,26 @@ int ChartSheetSubstream::serialize (std::wostream & _stream)
if ((chart_area_format) && (chart_area_format->fInvertNeg)) CP_XML_ATTR(L"val", 1); //????
else CP_XML_ATTR(L"val", 0);
}
if (m_SXViewLink)
{
SXViewLink *link = dynamic_cast<SXViewLink*>(m_SXViewLink.get());
CP_XML_NODE(L"c:pivotSource")
{
CP_XML_NODE(L"c:name")
{
std::wstring name = link->stPivotTable.value();
std::wstring::size_type pos = name.find(L"]");
if (std::wstring::npos != pos)
name = L"[]" + name.substr(pos + 1);
CP_XML_STREAM() << name;
}
CP_XML_NODE(L"c:fmtId")
{
CP_XML_ATTR(L"val", 0);
}
}
}
CP_XML_NODE(L"c:chart")
{
serialize_title (CP_XML_STREAM());
......@@ -405,6 +453,40 @@ int ChartSheetSubstream::serialize (std::wostream & _stream)
}
}
}
if (m_SXViewLink)
{
CP_XML_NODE(L"c:extLst")
{
CP_XML_NODE(L"c:ext")
{
CP_XML_ATTR(L"uri", L"{781A3756-C4B2-4CAC-9D66-4F8BD8637D16}");
CP_XML_ATTR(L"xmlns:c14", L"http://schemas.microsoft.com/office/drawing/2007/8/2/chart");
CP_XML_NODE(L"c14:pivotOptions")
{
CP_XML_NODE(L"c14:dropZoneFilter")
{
CP_XML_ATTR(L"val", 1);
}
CP_XML_NODE(L"c14:dropZoneCategories")
{
CP_XML_ATTR(L"val", 1);
}
CP_XML_NODE(L"c14:dropZoneData")
{
CP_XML_ATTR(L"val", 1);
}
CP_XML_NODE(L"c14:dropZoneSeries")
{
CP_XML_ATTR(L"val", 1);
}
CP_XML_NODE(L"c14:dropZonesVisible")
{
CP_XML_ATTR(L"val", 1);
}
}
}
}
}
}
if (chart_rect)
......@@ -685,7 +767,7 @@ int ChartSheetSubstream::serialize_plot_area (std::wostream & _stream)
}
format->serialize(CP_XML_STREAM());
for (int i = 0 ; i < it->second.size(); i++)
for (size_t i = 0 ; i < it->second.size(); i++)
{
SERIESFORMAT * series = dynamic_cast<SERIESFORMAT *>(chart_formats->m_arSERIESFORMAT[it->second[i]].get());
if (series == NULL) continue;
......@@ -718,6 +800,11 @@ int ChartSheetSubstream::serialize_plot_area (std::wostream & _stream)
serialize_dPt(CP_XML_STREAM(), it->second[i], crt, (std::max)(ser->cValx, ser->cValy));//+bubbles
/* if (arPivotData.empty() == false)
{
series->set_ref(arPivotData, i * 2);
}*/
if (crt->m_iChartType == CHART_TYPE_Scatter ||
crt->m_iChartType == CHART_TYPE_Bubble)
{
......@@ -729,6 +816,7 @@ int ChartSheetSubstream::serialize_plot_area (std::wostream & _stream)
}
else
{
serialize_ser(L"c:cat", CP_XML_STREAM(), series_id, series->m_arAI[2], ser->sdtX, ser->cValx);
serialize_ser(L"c:val", CP_XML_STREAM(), series_id, series->m_arAI[1], ser->sdtY, ser->cValy);
}
......
......@@ -75,6 +75,12 @@ public:
BaseObjectPtr m_OBJECTSCHART;
std::vector<BaseObjectPtr> m_arWINDOW;
std::vector<BaseObjectPtr> m_arCUSTOMVIEW;
BaseObjectPtr m_Units;
BaseObjectPtr m_ExternSheet;
BaseObjectPtr m_SXViewLink;
BaseObjectPtr m_PivotChartBits;
BaseObjectPtr m_SBaseRef;
private:
void recalc(CHARTFORMATS* charts);
......@@ -82,10 +88,7 @@ private:
std::map<int, std::vector<int>> m_mapTypeChart;//тут нужен несортированый .. пока оставим этот
GlobalWorkbookInfoPtr pGlobalWorkbookInfo;
};
} // namespace XLS
......
......@@ -31,48 +31,49 @@
*/
#include "WorksheetSubstream.h"
#include <Logic/Biff_records/Uncalced.h>
#include <Logic/Biff_records/Index.h>
#include <Logic/Biff_unions/GLOBALS.h>
#include <Logic/Biff_unions/PAGESETUP.h>
#include <Logic/Biff_records/Dimensions.h>
#include <Logic/Biff_records/HFPicture.h>
#include <Logic/Biff_records/Note.h>
#include <Logic/Biff_records/DxGCol.h>
#include <Logic/Biff_records/MergeCells.h>
#include <Logic/Biff_records/LRng.h>
#include <Logic/Biff_records/CodeName.h>
#include <Logic/Biff_records/WebPub.h>
#include <Logic/Biff_records/Window1.h>
#include <Logic/Biff_records/CellWatch.h>
#include <Logic/Biff_records/SheetExt.h>
#include <Logic/Biff_records/EOF.h>
#include <Logic/Biff_records/BOF.h>
#include <Logic/Biff_records/DefaultRowHeight.h>
#include <Logic/Biff_records/Label.h>
#include <Logic/Biff_unions/BACKGROUND.h>
#include <Logic/Biff_unions/BIGNAME.h>
#include <Logic/Biff_unions/PROTECTION_COMMON.h>
#include <Logic/Biff_unions/COLUMNS.h>
#include <Logic/Biff_unions/SCENARIOS.h>
#include <Logic/Biff_unions/SORTANDFILTER.h>
#include <Logic/Biff_unions/CELLTABLE.h>
#include <Logic/Biff_unions/OBJECTS.h>
#include <Logic/Biff_unions/PIVOTVIEW.h>
#include <Logic/Biff_unions/DCON.h>
#include <Logic/Biff_unions/WINDOW.h>
#include <Logic/Biff_unions/CUSTOMVIEW.h>
#include <Logic/Biff_unions/SORT.h>
#include <Logic/Biff_unions/QUERYTABLE.h>
#include <Logic/Biff_unions/PHONETICINFO.h>
#include <Logic/Biff_unions/CONDFMTS.h>
#include <Logic/Biff_unions/HLINK.h>
#include <Logic/Biff_unions/DVAL.h>
#include <Logic/Biff_unions/FEAT.h>
#include <Logic/Biff_unions/FEAT11.h>
#include <Logic/Biff_unions/RECORD12.h>
#include <Logic/Biff_unions/SHFMLA_SET.h>
#include "Biff_records/Uncalced.h"
#include "Biff_records/Index.h"
#include "Biff_unions/GLOBALS.h"
#include "Biff_unions/PAGESETUP.h"
#include "Biff_records/Dimensions.h"
#include "Biff_records/HFPicture.h"
#include "Biff_records/Note.h"
#include "Biff_records/DxGCol.h"
#include "Biff_records/MergeCells.h"
#include "Biff_records/LRng.h"
#include "Biff_records/CodeName.h"
#include "Biff_records/WebPub.h"
#include "Biff_records/Window1.h"
#include "Biff_records/CellWatch.h"
#include "Biff_records/SheetExt.h"
#include "Biff_records/EOF.h"
#include "Biff_records/BOF.h"
#include "Biff_records/DefaultRowHeight.h"
#include "Biff_records/Label.h"
#include "Biff_unions/BACKGROUND.h"
#include "Biff_unions/BIGNAME.h"
#include "Biff_unions/PROTECTION_COMMON.h"
#include "Biff_unions/COLUMNS.h"
#include "Biff_unions/SCENARIOS.h"
#include "Biff_unions/SORTANDFILTER.h"
#include "Biff_unions/CELLTABLE.h"
#include "Biff_unions/OBJECTS.h"
#include "Biff_unions/PIVOTVIEW.h"
#include "Biff_unions/DCON.h"
#include "Biff_unions/WINDOW.h"
#include "Biff_unions/CUSTOMVIEW.h"
#include "Biff_unions/SORT.h"
#include "Biff_unions/QUERYTABLE.h"
#include "Biff_unions/PHONETICINFO.h"
#include "Biff_unions/CONDFMTS.h"
#include "Biff_unions/HLINK.h"
#include "Biff_unions/DVAL.h"
#include "Biff_unions/FEAT.h"
#include "Biff_unions/FEAT11.h"
#include "Biff_unions/RECORD12.h"
#include "Biff_unions/SHFMLA_SET.h"
#include "Biff_structures/ODRAW/OfficeArtDgContainer.h"
......@@ -292,6 +293,9 @@ const bool WorksheetSubstream::loadContent(BinProcessor& proc)
m_arPIVOTVIEW.insert(m_arPIVOTVIEW.begin(), elements_.back());
elements_.pop_back();
count--;
PIVOTVIEW *view = dynamic_cast<PIVOTVIEW*>(m_arPIVOTVIEW.back().get());
mapPivotViews.insert(std::make_pair(view->name, m_arPIVOTVIEW.back()));
}
}break;
case rt_DCon:
......
......@@ -90,6 +90,9 @@ public:
std::vector<BiffStructurePtr> m_arHFPictureDrawing;
//-------------------------------------------------------------------
std::map<std::wstring, BaseObjectPtr> mapPivotViews;
private:
void LoadHFPicture(); //todoooo - обобщить
......
......@@ -357,7 +357,11 @@ void XlsConverter::convert(XLS::WorkbookStreamObject* woorkbook)
xls_global_info->current_sheet = -1;
xlsx_context->start_table(xls_global_info->sheets_names.size() > i ? xls_global_info->sheets_names[i] : L"ChartSheet_" + std::to_wstring(count_chart_sheets));
convert_chart_sheet(dynamic_cast<XLS::ChartSheetSubstream*>(woorkbook->m_arWorksheetSubstream[i].get()));
xlsx_context->set_chart_view();
XLS::ChartSheetSubstream* chart = dynamic_cast<XLS::ChartSheetSubstream*>(woorkbook->m_arWorksheetSubstream[i].get());
convert_chart_sheet(chart);
}
xlsx_context->end_table();
......@@ -369,7 +373,7 @@ void XlsConverter::convert(XLS::WorkbookStreamObject* woorkbook)
}
}
void XlsConverter::convert(XLS::WorksheetSubstream* sheet)
void XlsConverter::convert (XLS::WorksheetSubstream* sheet)
{
if (sheet == NULL) return;
......
......@@ -104,6 +104,13 @@ bool xlsx_conversion_context::start_table(const std::wstring & name)
return true;
}
void xlsx_conversion_context::set_chart_view()
{
if (sheets_.empty()) return;
get_table_context().set_chart_view();
}
void xlsx_conversion_context::set_state(const std::wstring & state)
{
if (state.empty()) return;
......
......@@ -66,6 +66,7 @@ public:
bool start_table(const std::wstring & name);
void set_state(const std::wstring & state);
void set_chart_view();
void end_table();
void start_chart();
......
......@@ -61,6 +61,21 @@ void xlsx_table_context::start_table(const std::wstring & name)
tables_state_.push_back( table_state_ptr(new table_state(context_)));
}
void xlsx_table_context::set_chart_view()
{
CP_XML_WRITER(context_.current_sheet().sheetViews())
{
CP_XML_NODE(L"sheetViews")
{
CP_XML_NODE(L"sheetView")
{
CP_XML_ATTR(L"showGridLines", 0);
CP_XML_ATTR(L"workbookViewId", 0);
}
}
}
}
void xlsx_table_context::end_table()
{
if (!get_drawing_context().empty())
......
......@@ -60,6 +60,7 @@ public:
public:
void start_table(const std::wstring & name);
void set_chart_view();
void end_table();
xlsx_drawing_context & get_drawing_context();
......
......@@ -7,7 +7,7 @@
QT -= core
QT -= gui
VERSION = 2.4.468.0
VERSION = 2.4.471.0
DEFINES += INTVER=$$VERSION
TARGET = x2t
......
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