Compare commits

..

4 Commits

Author SHA1 Message Date
6fc611fdfc XlsFormat - convert pivot tables 2017-07-04 18:50:39 +03:00
0cabb63336 debug 2017-07-04 13:54:52 +03:00
f501bf7930 remove curl for ios 2017-07-04 11:52:23 +03:00
7b617dc9e9 fix curl path 2017-07-04 10:40:26 +03:00
32 changed files with 383 additions and 175 deletions

View File

@ -49,8 +49,8 @@
6967917D1D9E8AEE002CA4BA /* BinReaderWriterDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 696791791D9E8AEE002CA4BA /* BinReaderWriterDefines.h */; };
6967917E1D9E8AEE002CA4BA /* BinWriters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967917A1D9E8AEE002CA4BA /* BinWriters.cpp */; };
6967917F1D9E8AEE002CA4BA /* BinWriters.h in Headers */ = {isa = PBXBuildFile; fileRef = 6967917B1D9E8AEE002CA4BA /* BinWriters.h */; };
69BBDF251F0B8AAC00EB1BF7 /* FileDownloader_mac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 69BBDF241F0B8AAC00EB1BF7 /* FileDownloader_mac.mm */; };
69F181AF1C77274E00B2952B /* FileDownloader.h in Headers */ = {isa = PBXBuildFile; fileRef = 69F181AD1C77274E00B2952B /* FileDownloader.h */; };
69F181B51C77276D00B2952B /* FileDownloader_curl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 69F181B31C77276D00B2952B /* FileDownloader_curl.cpp */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@ -97,8 +97,8 @@
696791791D9E8AEE002CA4BA /* BinReaderWriterDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BinReaderWriterDefines.h; path = ../../BinWriter/BinReaderWriterDefines.h; sourceTree = "<group>"; };
6967917A1D9E8AEE002CA4BA /* BinWriters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BinWriters.cpp; path = ../../BinWriter/BinWriters.cpp; sourceTree = "<group>"; };
6967917B1D9E8AEE002CA4BA /* BinWriters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BinWriters.h; path = ../../BinWriter/BinWriters.h; sourceTree = "<group>"; };
69BBDF241F0B8AAC00EB1BF7 /* FileDownloader_mac.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp.preprocessed; fileEncoding = 4; name = FileDownloader_mac.mm; path = ../../../Common/FileDownloader/FileDownloader_mac.mm; sourceTree = "<group>"; };
69F181AD1C77274E00B2952B /* FileDownloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileDownloader.h; path = ../../../Common/FileDownloader/FileDownloader.h; sourceTree = "<group>"; };
69F181B31C77276D00B2952B /* FileDownloader_curl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileDownloader_curl.cpp; path = ../../../Common/FileDownloader/FileDownloader_curl.cpp; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -230,7 +230,7 @@
isa = PBXGroup;
children = (
69F181AD1C77274E00B2952B /* FileDownloader.h */,
69F181B31C77276D00B2952B /* FileDownloader_curl.cpp */,
69BBDF241F0B8AAC00EB1BF7 /* FileDownloader_mac.mm */,
);
name = Common;
sourceTree = "<group>";
@ -339,7 +339,6 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
69F181B51C77276D00B2952B /* FileDownloader_curl.cpp in Sources */,
17C1FE961ACC42C4006B99B3 /* Common.cpp in Sources */,
17C1FE971ACC42C4006B99B3 /* ChartFromToBinary.cpp in Sources */,
17C1FE981ACC42C4006B99B3 /* CSVReader.cpp in Sources */,
@ -348,6 +347,7 @@
17C1FE9B1ACC42C4006B99B3 /* CSVWriter.cpp in Sources */,
69414A301CB51666003E771B /* ChartWriter.cpp in Sources */,
6967917E1D9E8AEE002CA4BA /* BinWriters.cpp in Sources */,
69BBDF251F0B8AAC00EB1BF7 /* FileDownloader_mac.mm in Sources */,
17C1FE9C1ACC42C4006B99B3 /* XlsxSerializer.cpp in Sources */,
690FE0851E9BBD68004B26D0 /* Readers.cpp in Sources */,
17C1FE9D1ACC42C4006B99B3 /* FontProcessor.cpp in Sources */,
@ -379,6 +379,7 @@
unix,
_IOS,
DONT_WRITE_EMBEDDED_FONTS,
_XCODE,
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
HEADER_SEARCH_PATHS = (
@ -416,6 +417,7 @@
unix,
_IOS,
DONT_WRITE_EMBEDDED_FONTS,
_XCODE,
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
HEADER_SEARCH_PATHS = (

View File

@ -39,12 +39,10 @@ SXDI::SXDI()
{
}
SXDI::~SXDI()
{
}
BaseObjectPtr SXDI::clone()
{
return BaseObjectPtr(new SXDI(*this));
@ -61,5 +59,22 @@ void SXDI::readFields(CFRecord& record)
}
}
int SXDI::serialize(std::wostream & strm)
{
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"dataField")
{
if (stName.value().empty() == false)
CP_XML_ATTR(L"name", stName.value());
CP_XML_ATTR(L"fld", isxvdData);
CP_XML_ATTR(L"baseField", df);
CP_XML_ATTR(L"baseItem", isxvi);
CP_XML_ATTR(L"numFmtId", ifmt);
}
}
return 0;
}
} // namespace XLS

View File

@ -49,6 +49,8 @@ public:
void readFields(CFRecord& record);
int serialize(std::wostream & strm);
static const ElementType type = typeSXDI;
short isxvdData;

View File

@ -53,6 +53,15 @@ void SXDtr::readFields(CFRecord& record)
{
record >> yr >> mon >> dom >> hr >> min >> sec;
}
std::wstring SXDtr::get_string_date()
{
std::wstringstream s;
s << yr << L"-" << (mon < 10 ? L"0" : L"") << mon << L"-" << (dom < 10 ? L"0" : L"") << dom << L"T"
<< (hr < 10 ? L"0" : L"") << hr << L":" << (min < 10 ? L"0" : L"") << min << L":" << (sec < 10 ? L"0" : L"") << sec;
return s.str();
}
int SXDtr::serialize(std::wostream & strm)
{
@ -60,10 +69,8 @@ int SXDtr::serialize(std::wostream & strm)
{
CP_XML_NODE(L"d")
{
std::wstringstream s;
s << yr << L"-" << mon << L"-" << dom << L"T" << hr << L":" << min << L":" << sec;
CP_XML_ATTR(L"v", s.str());
CP_XML_ATTR(L"v", get_string_date());
}
}

View File

@ -59,6 +59,8 @@ public:
unsigned char min;
unsigned char sec;
std::wstring get_string_date();
};
} // namespace XLS

View File

@ -50,17 +50,15 @@ BaseObjectPtr SXLI::clone()
}
void SXLI::readFields(CFRecord& record)
{// 0 or 2 records SXLIItem
int size_item = (record.getDataSize() - record.getRdPtr()) / 2;
if (size_item < 8)
{
while(true)
{
//??
return;
}
int size_item = record.getDataSize() - record.getRdPtr();
for (int k = 0; k < 2; k++)
{
if (size_item < 8)
{
break;
}
SXLIItem item;
unsigned short flags;
@ -74,12 +72,13 @@ void SXLI::readFields(CFRecord& record)
item.fGrand = GETBIT(flags, 11);
item.fMultiDataOnAxis = GETBIT(flags, 12);
int count = (size_item - 8) / 2;
for (int i = 0; i < count; i++)
//if (!item.fGrand && item.itmType != 0x000E)
{
short val; record >> val;
item.rgisxvi.push_back(val);
for (short i = 0; i < item.isxviMac; i++)
{
short val; record >> val;
item.rgisxvi.push_back(val);
}
}
m_arItems.push_back(item);
}

View File

@ -73,10 +73,6 @@ int SXVI::serialize(std::wostream & strm)
{
CP_XML_NODE(L"item")
{
if (itmType == 0)
{
CP_XML_ATTR(L"x", iCache);
}
if (fMissing)
CP_XML_ATTR(L"m", 1);
if (fHidden)
@ -86,6 +82,10 @@ int SXVI::serialize(std::wostream & strm)
if (fFormula)
CP_XML_ATTR(L"f", 1);
if (itmType == 0)
{
CP_XML_ATTR(L"x", iCache);
}
switch(itmType)
{
case 0x0001: CP_XML_ATTR(L"t", L"default"); break;

View File

@ -40,6 +40,11 @@ namespace XLS
DBB::DBB()
{
bString = false;
bDate = false;
bNumber = false;
bEmpty = false;
fShortIitms = false;
}
@ -64,6 +69,12 @@ const bool DBB::loadContent(BinProcessor& proc)
while(count--)
{
m_arSXOPER.push_back(elements_.front()); elements_.pop_front();
SXOPER* operatr = dynamic_cast<SXOPER*>(m_arSXOPER.back().get());
bString |= operatr->bString;
bDate |= operatr->bDate;
bNumber |= operatr->bNumber;
bEmpty |= operatr->bEmpty;
}
if (!m_SXDBB && m_arSXOPER.empty())

View File

@ -55,7 +55,12 @@ public:
std::vector<BaseObjectPtr> m_arSXOPER;
//---------------------------------------------------
bool fShortIitms;
bool fShortIitms;
bool bString;
bool bDate;
bool bNumber;
bool bEmpty;
};
} // namespace XLS

View File

@ -95,6 +95,12 @@ int DREF::serialize(std::wostream & strm)
}
else if(ref)
{
CP_XML_ATTR(L"type", L"worksheet");
CP_XML_NODE(L"worksheetSource")
{
CP_XML_ATTR(L"ref", ref->ref.toString());
CP_XML_ATTR(L"sheet", ref->stFile);
}
}
}
}

View File

@ -74,14 +74,16 @@ private:
FDB::FDB()
{
bString = false;
bDate = false;
bNumber = false;
bEmpty = false;
}
FDB::~FDB()
{
}
BaseObjectPtr FDB::clone()
{
return BaseObjectPtr(new FDB(*this));
@ -123,10 +125,15 @@ const bool FDB::loadContent(BinProcessor& proc)
while(count > 0)
{
SXOPER * oper = dynamic_cast<SXOPER*> (elements_.front().get());
if (oper)
SXOPER * operatr = dynamic_cast<SXOPER*> (elements_.front().get());
if (operatr)
{
m_arGRPSXOPER.push_back(elements_.front());
//bString |= operatr->bString;
//bDate |= operatr->bDate;
//bNumber |= operatr->bNumber;
//bEmpty |= operatr->bEmpty;
}
else
{
@ -150,6 +157,13 @@ const bool FDB::loadContent(BinProcessor& proc)
while(count--)
{
m_arSRCSXOPER.push_back(elements_.front()); elements_.pop_front();
SXOPER* operatr = dynamic_cast<SXOPER*> (m_arSRCSXOPER.back().get());
bString |= operatr->bString;
bDate |= operatr->bDate;
bNumber |= operatr->bNumber;
bEmpty |= operatr->bEmpty;
}
return true;
@ -167,7 +181,15 @@ int FDB::serialize(std::wostream & strm)
CP_XML_NODE(L"cacheField")
{
CP_XML_ATTR(L"name", fdb->stFieldName.value());
CP_XML_ATTR(L"numFmtId", fdb_type->wTypeSql);
if (fdb_type->wTypeSql > 0)
{
CP_XML_ATTR(L"numFmtId", fdb_type->wTypeSql);
}
if (m_arSRCSXOPER.empty())
{
CP_XML_ATTR(L"databaseField", 0);
}
switch(fdb_type->wTypeSql)//format code
{
@ -189,32 +211,60 @@ int FDB::serialize(std::wostream & strm)
{
//{formula
}
//caption, databaseFields, ..
if (m_arSRCSXOPER.empty() == false)
{
CP_XML_NODE(L"sharedItems")
{
//CP_XML_ATTR(L"containsSemiMixedTypes", 0);
CP_XML_ATTR(L"containsNonDate", fdb->fNonDates);
CP_XML_ATTR(L"containsDate", fdb->fDateInField);
CP_XML_ATTR(L"containsNumber", fdb->fNumField);
CP_XML_ATTR(L"containsBlank", fdb->fTextEtcField);
//CP_XML_ATTR(L"containsString", 0);
//использовать поля присутствия из xls низя - они частенько записаны неверно!!
//if (!fdb->fNonDates) CP_XML_ATTR(L"containsNonDate", fdb->fNonDates);
//if (fdb->fDateInField) CP_XML_ATTR(L"containsDate", fdb->fDateInField);
//if (fdb->fNumField) CP_XML_ATTR(L"containsNumber", fdb->fNumField);
////CP_XML_ATTR(L"containsBlank", fdb->fTextEtcField);
//if (m_arSRCSXOPER.empty())
//{
// if (!fdb->fTextEtcField)
// {
// CP_XML_ATTR(L"containsString", 0);
// }
// else if (fdb->fNumField || fdb->fDateInField)
// {
// CP_XML_ATTR(L"containsBlank", 1);
// CP_XML_ATTR(L"containsString", 0);
// }
//}
if ((bDate & bNumber) || (bNumber & bString))
{
CP_XML_ATTR(L"containsSemiMixedTypes", 1);
}
else if ( bDate & bString)
{
CP_XML_ATTR(L"containsMixedTypes", 1);
}
else if (!bEmpty && !bString)
{
CP_XML_ATTR(L"containsSemiMixedTypes", 0);
}
if (bNumber) CP_XML_ATTR(L"containsNumber", 1);
if (bDate) CP_XML_ATTR(L"containsDate", 1);
if (!bString) CP_XML_ATTR(L"containsString", 0);
if (bEmpty) CP_XML_ATTR(L"containsBlank", 1);
if (fdb->fnumMinMaxValid)
{
if (fdb->fDateInField)
{
CP_XML_ATTR(L"minDate", 0); // "2007-11-18T00:00:00"
CP_XML_ATTR(L"maxDate", 0); // "2007-12-25T00:00:00"
}
else if (fdb->fNumField)
{
CP_XML_ATTR(L"minValue", 0);
CP_XML_ATTR(L"maxValue", 0);
}
//if (fdb->fDateInField)
//{
// CP_XML_ATTR(L"minDate", 0); // "2007-11-18T00:00:00"
// CP_XML_ATTR(L"maxDate", 0); // "2007-12-25T00:00:00"
//}
//else if (fdb->fNumField)
//{
// CP_XML_ATTR(L"minValue", 0);
// CP_XML_ATTR(L"maxValue", 0);
//}
}
CP_XML_ATTR(L"count", fdb->catm);
CP_XML_ATTR(L"count", m_arSRCSXOPER.size());
for (size_t i = 0; i < m_arSRCSXOPER.size(); i++)
{

View File

@ -59,6 +59,12 @@ public:
std::vector<BaseObjectPtr> m_arGRPSXOPER;
BaseObjectPtr m_SXRANGE;
std::vector<BaseObjectPtr> m_arSxIsxoper;
bool bString;
bool bDate;
bool bNumber;
bool bEmpty;
};
} // namespace XLS

View File

@ -116,6 +116,7 @@ int PIVOTCACHEDEFINITION::serialize_definitions(std::wostream & strm)
{
CP_XML_ATTR(L"r:id", L"rId1" );
}
CP_XML_ATTR(L"enableRefresh", 1);
CP_XML_ATTR(L"refreshedBy", db->rgb.value());
CP_XML_ATTR(L"refreshedDate", db_ex->numDate.data.value);
CP_XML_ATTR(L"recordCount", db->crdbUsed);

View File

@ -31,29 +31,26 @@
*/
#include "PIVOTLI.h"
#include <Logic/Biff_records/SXLI.h>
#include <Logic/Biff_records/Continue.h>
#include "../Biff_records/SXLI.h"
#include "../Biff_records/Continue.h"
namespace XLS
{
PIVOTLI::PIVOTLI()
{
}
PIVOTLI::~PIVOTLI()
{
}
BaseObjectPtr PIVOTLI::clone()
{
return BaseObjectPtr(new PIVOTLI(*this));
}
// PIVOTLI = SXLI *Continue
const bool PIVOTLI::loadContent(BinProcessor& proc)
{
@ -61,10 +58,53 @@ const bool PIVOTLI::loadContent(BinProcessor& proc)
{
return false;
}
m_SXLI = elements_.back();
elements_.pop_back();
proc.repeated<Continue>(0, 0);
return true;
}
int PIVOTLI::serialize(std::wostream & strm)
{
SXLI* line_items = dynamic_cast<SXLI*>(m_SXLI.get());
if (!line_items) return 0;
CP_XML_WRITER(strm)
{
for (size_t i = 0; i < line_items->m_arItems.size(); i++)
{
CP_XML_NODE(L"i")
{
switch(line_items->m_arItems[i].itmType)
{
case 0x0001: CP_XML_ATTR(L"t", L"default"); break;
case 0x0002: CP_XML_ATTR(L"t", L"sum"); break;
case 0x0003: CP_XML_ATTR(L"t", L"countA"); break;
case 0x0004: CP_XML_ATTR(L"t", L"count"); break;
case 0x0005: CP_XML_ATTR(L"t", L"avg"); break;
case 0x0006: CP_XML_ATTR(L"t", L"max"); break;
case 0x0007: CP_XML_ATTR(L"t", L"min"); break;
case 0x0008: CP_XML_ATTR(L"t", L"product"); break;
case 0x0009: CP_XML_ATTR(L"t", L"stdDev"); break;
case 0x000A: CP_XML_ATTR(L"t", L"stdDevP"); break;
case 0x000B: CP_XML_ATTR(L"t", L"var"); break;
case 0x000C: CP_XML_ATTR(L"t", L"varP"); break;
case 0x000D: CP_XML_ATTR(L"t", L"grand"); break;
case 0x000E: CP_XML_ATTR(L"t", L"blank"); break;
}
for (size_t j = 0; j < line_items->m_arItems[i].rgisxvi.size(); j++)
{
CP_XML_NODE(L"x")
{
CP_XML_ATTR(L"v", line_items->m_arItems[i].rgisxvi[j]);
}
}
}
}
}
}
} // namespace XLS

View File

@ -36,8 +36,6 @@
namespace XLS
{
// Logical representation of PIVOTLI union of records
class PIVOTLI: public CompositeObject
{
BASE_OBJECT_DEFINE_CLASS_NAME(PIVOTLI)
@ -49,7 +47,11 @@ public:
virtual const bool loadContent(BinProcessor& proc);
static const ElementType type = typePIVOTLI;
int serialize(std::wostream & strm);
static const ElementType type = typePIVOTLI;
BaseObjectPtr m_SXLI;
};
} // namespace XLS

View File

@ -31,13 +31,12 @@
*/
#include "PIVOTPI.h"
#include <Logic/Biff_records/SXPI.h>
#include <Logic/Biff_records/Continue.h>
#include "../Biff_records/SXPI.h"
#include "../Biff_records/Continue.h"
namespace XLS
{
PIVOTPI::PIVOTPI()
{
}
@ -53,7 +52,6 @@ BaseObjectPtr PIVOTPI::clone()
return BaseObjectPtr(new PIVOTPI(*this));
}
// PIVOTPI = SXPI *Continue
const bool PIVOTPI::loadContent(BinProcessor& proc)
{
@ -69,5 +67,22 @@ const bool PIVOTPI::loadContent(BinProcessor& proc)
return true;
}
int PIVOTPI::serialize(std::wostream & strm)
{
SXPI* page_items = dynamic_cast<SXPI*>(m_SXPI.get());
if (!page_items) return 0;
CP_XML_WRITER(strm)
{
for (size_t i = 0; i < page_items->m_arItems.size(); i++)
{
CP_XML_NODE(L"pageField")
{
CP_XML_ATTR(L"fld", page_items->m_arItems[i].isxvd);
CP_XML_ATTR(L"hier",0);
}
}
}
}
} // namespace XLS

View File

@ -47,6 +47,8 @@ public:
virtual const bool loadContent(BinProcessor& proc);
int serialize(std::wostream & strm);
static const ElementType type = typePIVOTPI;
BaseObjectPtr m_SXPI;

View File

@ -80,20 +80,73 @@ int PIVOTVD::serialize(std::wostream & strm)
Sxvd* vd = dynamic_cast<Sxvd*>(m_Sxvd.get());
SXVDEx* vd_ex = dynamic_cast<SXVDEx*>(m_SXVDEx.get());
if (!vd || !vd_ex) return 0;
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"pivotField")
{
//CP_XML_ATTR(L"axis", );
//CP_XML_ATTR(L"compact", );
//CP_XML_ATTR(L"outline", );
//CP_XML_ATTR(L"subtotalTop", );
//CP_XML_ATTR(L"showAll", );
//CP_XML_ATTR(L"includeNewItemsInFilter", );
//CP_XML_ATTR(L"sortType", );
//CP_XML_ATTR(L"rankBy", );
//CP_XML_ATTR(L"axis", );
if (vd->sxaxis.bRw) CP_XML_ATTR(L"axis", L"axisRow");
else if (vd->sxaxis.bCol) CP_XML_ATTR(L"axis", L"axisCol");
else if (vd->sxaxis.bPage) CP_XML_ATTR(L"axis", L"axisPage");
else if (vd->sxaxis.bData)
{
CP_XML_ATTR(L"dataField", 1);
}
CP_XML_ATTR(L"compact", 0);
if (vd_ex->ifmt > 0)
{
CP_XML_ATTR(L"numFmtId", vd_ex->ifmt);
}
if (vd->stName.value().empty() == false)
CP_XML_ATTR(L"name", vd->stName.value());
if (vd->fCounta) CP_XML_ATTR(L"countASubtotal", 1);
if (vd->fCount) CP_XML_ATTR(L"countSubtotal", 1);
if (vd->fDefault) CP_XML_ATTR(L"defaultSubtotal", 1);
if (vd->fSum) CP_XML_ATTR(L"sumSubtotal", 1);
if (vd->fAverage) CP_XML_ATTR(L"avgSubtotal", 1);
if (vd->fMax) CP_XML_ATTR(L"maxSubtotal", 1);
if (vd->fMin) CP_XML_ATTR(L"minSubtotal", 1);
if (vd->fProduct) CP_XML_ATTR(L"productSubtotal", 1);
if (vd->fStdev) CP_XML_ATTR(L"stdSubtotal", 1);
if (vd->fStdevp) CP_XML_ATTR(L"stdDevSubtotal", 1);
if (vd->fVariance) CP_XML_ATTR(L"varSubtotal", 1);
if (vd->fVariancep) CP_XML_ATTR(L"varPSubtotal", 1);
CP_XML_ATTR(L"outline", vd_ex->fOutline);
CP_XML_ATTR(L"subtotalTop", vd_ex->fSubtotalAtTop);
CP_XML_ATTR(L"showAll", vd_ex->fShowAllItems);
if (vd_ex->fNotDragToData) CP_XML_ATTR(L"dragToData", 0);
if (!vd_ex->fDragToRow) CP_XML_ATTR(L"dragToRow", 0);
if (!vd_ex->fDragToColumn) CP_XML_ATTR(L"dragToCol", 0);
if (!vd_ex->fDragToPage) CP_XML_ATTR(L"dragToPage", 0);
if (vd_ex->fHideNewItems) CP_XML_ATTR(L"hideNewItems", 1);
if (vd_ex->fInsertBlankRow) CP_XML_ATTR(L"insertBlankRow", 1);
if (vd_ex->fPageBreaksBetweenItems) CP_XML_ATTR(L"insertPageBreak", 1);
if (!vd_ex->fTopAutoShow) CP_XML_ATTR(L"topAutoShow", 0);
//if (!vd_ex->fDragToHide) CP_XML_ATTR(L"dragOff", 0); //??
if (vd_ex->fServerBased) CP_XML_ATTR(L"serverField", 1);
//CP_XML_ATTR(L"", vd_ex->fCalculatedField);
CP_XML_ATTR(L"includeNewItemsInFilter", 1);
//CP_XML_ATTR(L"nonAutoSortDefault", !vd_ex->fAutoSort);
if (vd_ex->fAutoSort)
{
// vd_ex->isxdiAutoSort
if (vd_ex->fAscendSort) CP_XML_ATTR(L"sortType", L"ascending");
}
if (vd_ex->isxdiAutoShow >= 0)
{
CP_XML_ATTR(L"rankBy", vd_ex->isxdiAutoShow);
}
if (!m_arSXVI.empty())
{
CP_XML_NODE(L"items")

View File

@ -107,7 +107,10 @@ int PIVOTVIEW::serialize(std::wostream & strm)
CP_XML_ATTR(L"applyPatternFormats", view->fAtrPat);
CP_XML_ATTR(L"applyAlignmentFormats", view->fAtrAlc);
CP_XML_ATTR(L"applyWidthHeightFormats", view->fAtrProc);
CP_XML_ATTR(L"dataCaption", view->stData.value());
if (!view->stData.value().empty())
{
CP_XML_ATTR(L"dataCaption", view->stData.value());
}
//updatedVersion="2"
//asteriskTotals="1"
//showMemberPropertyTips="0"
@ -144,14 +147,15 @@ int PIVOTVIEW::serialize(std::wostream & strm)
ivd->serialize(CP_XML_STREAM());
}
}
CP_XML_NODE(L"rowItems")
if (core->m_arPIVOTLI.size() == 2)//0 or 2
{
CP_XML_ATTR(L"count", view->cRw);
//for (size_t i = 0; i < m_arPIVOTLI.size(); i++)
//{
// PIVOTLI* line = dynamic_cast<PIVOTLI*>(m_arPIVOTLI[i].get());
// m_arPIVOTIVD[i]->serialize(CP_XML_STREAM());
//}
CP_XML_NODE(L"rowItems")
{
CP_XML_ATTR(L"count", view->cRw);
PIVOTLI* line = dynamic_cast<PIVOTLI*>(core->m_arPIVOTLI[0].get());
line->serialize(CP_XML_STREAM());
}
}
if (core->m_arPIVOTIVD.size() == 2)//0 or 2
{
@ -163,13 +167,15 @@ int PIVOTVIEW::serialize(std::wostream & strm)
ivd->serialize(CP_XML_STREAM());
}
}
CP_XML_NODE(L"colItems")
if (core->m_arPIVOTLI.size() == 2)//0 or 2
{
CP_XML_ATTR(L"count", view->cCol);
//for (size_t i = 0; i < m_arPIVOTLI.size(); i++)
//{
// m_arPIVOTIVD[i]->serialize(CP_XML_STREAM());
//}
CP_XML_NODE(L"colItems")
{
CP_XML_ATTR(L"count", view->cCol);
PIVOTLI* line = dynamic_cast<PIVOTLI*>(core->m_arPIVOTLI[1].get());
line->serialize(CP_XML_STREAM());
}
}
if (core->m_PIVOTPI)
{

View File

@ -43,6 +43,10 @@ namespace XLS
SXOPER::SXOPER()
{
bString = false;
bDate = false;
bNumber = false;
bEmpty = false;
}
SXOPER::~SXOPER()
@ -59,21 +63,27 @@ const bool SXOPER::loadContent(BinProcessor& proc)
{
if(proc.optional<SxNil>())
{
bEmpty = true;
}
else if(proc.optional<SXNum>())
{
bNumber = true;
}
else if(proc.optional<SxBool>())
{
bNumber = true;
}
else if(proc.optional<SxErr>())
{
bNumber = true;
}
else if(proc.optional<SXString>())
{
bString = true;
}
else if(proc.optional<SXDtr>())
{
bDate =true;
}
else
return false;

View File

@ -52,6 +52,11 @@ public:
static const ElementType type = typeSXOPER;
BaseObjectPtr m_element;
bool bString;
bool bDate;
bool bNumber;
bool bEmpty;
};
} // namespace XLS

View File

@ -140,12 +140,8 @@ int SXRANGE::serialize(std::wostream & strm)
SXDtr* startDate = dynamic_cast<SXDtr*>(m_arSXDtr[0].get());
SXDtr* endDate = dynamic_cast<SXDtr*>(m_arSXDtr[1].get());
std::wstringstream s_start, s_end;
s_start << startDate->yr << L"-" << startDate->mon << L"-" << startDate->dom << L"T" << startDate->hr << L":" << startDate->min << L":" << startDate->sec;
s_end << endDate->yr << L"-" << endDate->mon << L"-" << endDate->dom << L"T" << endDate->hr << L":" << endDate->min << L":" << endDate->sec;
CP_XML_ATTR(L"startDate", s_start.str());
CP_XML_ATTR(L"endDate", s_end.str());
CP_XML_ATTR(L"startDate", startDate->get_string_date());
CP_XML_ATTR(L"endDate", endDate->get_string_date());
}
if (m_arSXNum.size() == 3)
{

View File

@ -1920,7 +1920,14 @@ void XlsConverter::convert(XLS::PIVOTVIEW * pivot_view)
pivot_view->serialize(strm);
xlsx_context->get_pivots_context().add_view(strm.str(), pivot_view->indexCache);
int index_view = xlsx_context->get_pivots_context().add_view(strm.str(), pivot_view->indexCache);
if (index_view > 0)
{
xlsx_context->current_sheet().sheet_rels().add(oox::relationship(L"pvId" + std::to_wstring(index_view),
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable",
L"../pivotTables/pivotTable" + std::to_wstring(index_view) + L".xml"));
}
}
void XlsConverter::convert(XLS::PIVOTCACHEDEFINITION * pivot_cached)

View File

@ -285,10 +285,6 @@ void xlsx_conversion_context::end_document()
{
for (int i = 0; i < pivot_view_count; i++)
{
//std::wstring rId = L"pvId" + std::to_wstring(i+1);
//static const std::wstring sType = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable";
//const std::wstring sName = std::wstring(L"../pivotTables/pivotTable" + std::to_wstring(i + 1) + L".xml");
package::pivot_table_content_ptr content = package::pivot_table_content::create();
xlsx_pivots_context_.dump_rels_view(i, content->get_rels());

View File

@ -176,16 +176,20 @@ void xl_files::write(const std::wstring & RootPath)
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"xl";
NSDirectory::CreateDirectory(path.c_str());
sheets_files_.set_rels(&rels_files_);
{
pivot_cache_files_.set_rels(&rels_files_);
pivot_cache_files_.set_main_document(get_main_document());
pivot_cache_files_.write(path);
}
{
pivot_table_files_.set_main_document(get_main_document());
pivot_table_files_.write(path);
}
sheets_files_.set_rels(&rels_files_);
sheets_files_.set_main_document( this->get_main_document() );
sheets_files_.write(path);
int index = 1;
if (true)
{
//workbook_->hyperlinks->write(path);
rels_files_.add( relationship( L"hId1", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", L"xl/workbook.xml" ) );
}
if (sharedStrings_)
{
sharedStrings_->write(path);
@ -217,15 +221,7 @@ void xl_files::write(const std::wstring & RootPath)
charts_files_.set_main_document(get_main_document());
charts_files_.write(path);
}
{
pivot_cache_files_.set_rels(&rels_files_);
pivot_cache_files_.set_main_document(get_main_document());
pivot_cache_files_.write(path);
}
{
pivot_table_files_.set_main_document(get_main_document());
pivot_table_files_.write(path);
}
if (drawings_)
{
drawings_->set_main_document(get_main_document());
@ -340,7 +336,7 @@ void xl_pivot_cache_files::write(const std::wstring & RootPath)
{
const std::wstring fileNameR = std::wstring(L"pivotCacheRecords") + std::to_wstring(i + 1) + L".xml";
contentTypes.add_override(std::wstring(L"/xl/pivotCache/") + fileNameR, kWSConTypeD);
contentTypes.add_override(std::wstring(L"/xl/pivotCache/") + fileNameR, kWSConTypeR);
package::simple_element(fileNameR, content_records).write(path);
}

View File

@ -31,14 +31,11 @@
*/
#include "xlsx_pivots_context.h"
#include <boost/make_shared.hpp>
#include <simple_xml_writer.h>
namespace oox {
class xlsx_pivots_context::Impl
{
public:
@ -73,13 +70,14 @@ int xlsx_pivots_context::get_cache_count()
{
return (int)impl_->caches_.size();
}
void xlsx_pivots_context::dump_rels_cache(int index, rels & Rels)
{
if (impl_->caches_[index].recordsData_.empty())
if (impl_->caches_[index].recordsData_.empty() == false)
{
Rels.add(relationship(L"rId1",
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheRecords",
L"pivotCacheRecords" + std::to_wstring(index) + L".xml", L""));
L"pivotCacheRecords" + std::to_wstring(index + 1) + L".xml", L""));
}
}
void xlsx_pivots_context::dump_rels_view(int index, rels & Rels)
@ -104,10 +102,14 @@ void xlsx_pivots_context::write_table_view_to(int index, std::wostream & strm)
{
strm << impl_->views_[index].data_;
}
void xlsx_pivots_context::add_view(std::wstring table_view, int indexCache)
int xlsx_pivots_context::add_view(std::wstring table_view, int indexCache)
{
if (table_view.empty()) return 0;
Impl::_pivot_view v = {table_view, indexCache};
impl_->views_.push_back(v);
return (int)impl_->views_.size();
}
int xlsx_pivots_context::get_view_count()

View File

@ -43,7 +43,7 @@ public:
xlsx_pivots_context();
~xlsx_pivots_context();
void add_view(std::wstring table_view, int indexCache);
int add_view(std::wstring table_view, int indexCache);
int get_view_count();
void add_cache(std::wstring definitions, std::wstring records);

View File

@ -27,7 +27,7 @@ if exist %VC64% (
SET VC=%VC64%
)
call "%VC%\vcvarsall.bat %MACHINE%"
call "%VC%\vcvarsall.bat" %MACHINE%
cd curl
call buildconf.bat

View File

@ -1,3 +1,4 @@
CD /D %~dp0
SET CURL_FOLDER=curl
IF NOT EXIST %CURL_FOLDER% CALL git clone https://github.com/curl/curl.git %CURL_FOLDER%
CD %CURL_FOLDER%

View File

@ -40,8 +40,8 @@
#include <stdio.h>
#include "../3dParty/curl/include/curl/curl.h"
#include "../3dParty/curl/include/curl/easy.h"
#include "../3dParty/curl/curl/include/curl/curl.h"
#include "../3dParty/curl/curl/include/curl/easy.h"
class CFileDownloaderBaseCURL : public CFileDownloaderBase

View File

@ -1,5 +1,10 @@
#include "FileDownloader.h"
#include <Cocoa/Cocoa.h>
#if _IOS
#import <Foundation/Foundation.h>
#else
#include <Cocoa/Cocoa.h>
#endif
static NSString* StringWToNSString ( const std::wstring& Str )
{
@ -34,21 +39,30 @@ public :
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *filePath = StringWToNSString ( m_sFilePath );
[urlData writeToFile:filePath atomically:YES];
#ifndef _ASC_USE_ARC_
#if defined(_IOS)
return 0;
#else
#ifndef _ASC_USE_ARC_
[stringURL release];
[url release];
[urlData release];
#endif
#endif
#endif
return 0;
}
#ifndef _ASC_USE_ARC_
#if defined(_IOS)
return 1;
#else
#ifndef _ASC_USE_ARC_
[stringURL release];
[url release];
#endif
#endif
#endif
return 1;
}
};

View File

@ -21,7 +21,6 @@
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
177C43321AD7C0EF00055DD7 /* libcurl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 177C432F1AD7C0D100055DD7 /* libcurl.a */; };
17C8DEC71ACD696100902C85 /* X2tConverter.mm in Sources */ = {isa = PBXBuildFile; fileRef = 17C27A191AC2DB3D00E1D003 /* X2tConverter.mm */; };
17C8DECC1ACD696100902C85 /* X2tConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = 17C27A171AC2DB3D00E1D003 /* X2tConverter.h */; settings = {ATTRIBUTES = (Public, ); }; };
691A8BD31E2FA68F00DCB54A /* liblibxml2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 691A8BD01E2FA67E00DCB54A /* liblibxml2.a */; };
@ -59,20 +58,6 @@
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
177C432E1AD7C0D100055DD7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 177C432A1AD7C0D000055DD7 /* libcurl.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = CD8AE2B416187F770095DC1B;
remoteInfo = curl;
};
177C43301AD7C0E400055DD7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 177C432A1AD7C0D000055DD7 /* libcurl.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = CD8AE2B316187F770095DC1B;
remoteInfo = curl;
};
17C8DEDB1ACD6A3900902C85 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 17E17F561AC457CD00BEA2EA /* ASCOfficeDocxFile2Lib.xcodeproj */;
@ -440,7 +425,6 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
177C432A1AD7C0D000055DD7 /* libcurl.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = libcurl.xcodeproj; path = ../../../../Common/3dParty/curl/projects/Mac/libcurl.xcodeproj; sourceTree = "<group>"; };
17C27A171AC2DB3D00E1D003 /* X2tConverter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = X2tConverter.h; sourceTree = "<group>"; };
17C27A191AC2DB3D00E1D003 /* X2tConverter.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = X2tConverter.mm; sourceTree = "<group>"; };
17C8DED01ACD696100902C85 /* libX2tConverter.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libX2tConverter.a; sourceTree = BUILT_PRODUCTS_DIR; };
@ -509,21 +493,12 @@
69415F311CB51D41003E771B /* libASCOfficeDocxFile2Lib_ios.a in Frameworks */,
69415F271CB51C37003E771B /* libOfficeUtils.a in Frameworks */,
698AF4C31C0745980080D889 /* libicu.a in Frameworks */,
177C43321AD7C0EF00055DD7 /* libcurl.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
177C432B1AD7C0D000055DD7 /* Products */ = {
isa = PBXGroup;
children = (
177C432F1AD7C0D100055DD7 /* libcurl.a */,
);
name = Products;
sourceTree = "<group>";
};
17C27A0B1AC2DB3C00E1D003 = {
isa = PBXGroup;
children = (
@ -548,7 +523,6 @@
69DA322C1CEE08DC00E10AF0 /* metafile.xcodeproj */,
69DA32261CEE087D00E10AF0 /* cximage.xcodeproj */,
698AF4BB1C0740960080D889 /* icu.xcodeproj */,
177C432A1AD7C0D000055DD7 /* libcurl.xcodeproj */,
17E17F561AC457CD00BEA2EA /* ASCOfficeDocxFile2Lib.xcodeproj */,
69DA32501CEE095900E10AF0 /* freetype.xcodeproj */,
69DA325C1CEE09BB00E10AF0 /* PPTXFormatLib.xcodeproj */,
@ -859,7 +833,6 @@
69415FE21CB5245A003E771B /* PBXTargetDependency */,
69415FDF1CB5244D003E771B /* PBXTargetDependency */,
698AF4C21C0745930080D889 /* PBXTargetDependency */,
177C43311AD7C0E400055DD7 /* PBXTargetDependency */,
69DA32EE1CEE100400E10AF0 /* PBXTargetDependency */,
17C8DEDC1ACD6A3900902C85 /* PBXTargetDependency */,
);
@ -936,10 +909,6 @@
ProductGroup = 69415FBE1CB5243F003E771B /* Products */;
ProjectRef = 69415FBD1CB5243F003E771B /* jpeg.xcodeproj */;
},
{
ProductGroup = 177C432B1AD7C0D000055DD7 /* Products */;
ProjectRef = 177C432A1AD7C0D000055DD7 /* libcurl.xcodeproj */;
},
{
ProductGroup = 69415FBB1CB5243F003E771B /* Products */;
ProjectRef = 69415FBA1CB5243F003E771B /* libpsd.xcodeproj */;
@ -1006,13 +975,6 @@
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
177C432F1AD7C0D100055DD7 /* libcurl.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libcurl.a;
remoteRef = 177C432E1AD7C0D100055DD7 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
17E17F5B1AC457CD00BEA2EA /* libASCOfficeDocxFile2Lib_ios.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
@ -1228,11 +1190,6 @@
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
177C43311AD7C0E400055DD7 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = curl;
targetProxy = 177C43301AD7C0E400055DD7 /* PBXContainerItemProxy */;
};
17C8DEDC1ACD6A3900902C85 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = ASCOfficeDocxFile2Lib_ios;