Commit c985d1e0 authored by ElenaSubbotina's avatar ElenaSubbotina

OdfFormatWriter - data label position

XlsFormatReader - fix pivots
parent 5aaf90eb
......@@ -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,7 +59,9 @@ 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_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"
>
......
......@@ -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
......@@ -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 >> frtHeaderOld >> flags >> cst;
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
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)
......@@ -48,11 +47,14 @@ public:
BaseObjectPtr clone();
void readFields(CFRecord& record);
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)
......@@ -48,11 +46,12 @@ public:
BaseObjectPtr clone();
void readFields(CFRecord& record);
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.");
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);
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
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)
......@@ -48,10 +47,30 @@ public:
BaseObjectPtr clone();
void readFields(CFRecord& record);
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)
......@@ -48,11 +48,21 @@ public:
BaseObjectPtr clone();
void readFields(CFRecord& record);
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,7 +49,6 @@ public:
virtual void load(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, bool full_ref = false);
ExtSheetPair iTabs;
......
......@@ -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"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,6 +67,7 @@ public:
bool bInteger;
bool bBool;
int index;
GlobalWorkbookInfoPtr global_info;
};
......
......@@ -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);
......
......@@ -98,9 +98,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 +109,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());
......
......@@ -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);
}
......
......@@ -202,10 +202,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 +244,18 @@ const bool ChartSheetSubstream::loadContent(BinProcessor& proc)
{
if (proc.optional<ExternSheet>())
{
m_ExternSheet = elements_.back();
elements_.pop_back();
}
}break;
case rt_Units:
{
if (proc.mandatory<Units>())
{
m_Units = elements_.back();
elements_.pop_back();
}
}break;
case rt_Units: proc.mandatory<Units>(); break;
case rt_Chart:
{
if ( proc.mandatory<CHARTFORMATS>() )
......@@ -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());
......
......@@ -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);
......
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