mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-19 22:36:13 +08:00
Compare commits
29 Commits
core-linux
...
core-linux
| Author | SHA1 | Date | |
|---|---|---|---|
| 704b3b709f | |||
| e4674915c2 | |||
| 51fe936e5f | |||
| d8b177411f | |||
| 717b628055 | |||
| e4f94646b6 | |||
| dcec7447e4 | |||
| 5f12552f78 | |||
| d293769c1f | |||
| b45e772a50 | |||
| fdb7716abc | |||
| f72d6dfe0e | |||
| 23029a6a92 | |||
| eda8e4d13f | |||
| 64f578e59f | |||
| 16c57b50cc | |||
| 83c0ba9dab | |||
| a2443dadeb | |||
| 789bb1d4b3 | |||
| 4138ae5ce2 | |||
| 239b5dbf11 | |||
| c046776b9c | |||
| 055a02570b | |||
| 1e2e5996f3 | |||
| 875717acd4 | |||
| 033feeaf9d | |||
| de336e5f96 | |||
| 82b3dbdae6 | |||
| d1227f7759 |
@ -3734,6 +3734,18 @@ public:
|
||||
res = Read2(length, &Binary_DocumentTableReader::Read_Background, this, &oBackground);
|
||||
m_oDocumentWriter.m_oBackground.WriteString(oBackground.Write());
|
||||
}
|
||||
else if ( c_oSerParType::BookmarkStart == type )
|
||||
{
|
||||
OOX::Logic::CBookmarkStart oBookmarkStart;
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadBookmarkStart, this, &oBookmarkStart);
|
||||
m_oDocumentWriter.m_oContent.WriteString(oBookmarkStart.toXML());
|
||||
}
|
||||
else if ( c_oSerParType::BookmarkEnd == type )
|
||||
{
|
||||
OOX::Logic::CBookmarkEnd oBookmarkEnd;
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadBookmarkEnd, this, &oBookmarkEnd);
|
||||
m_oDocumentWriter.m_oContent.WriteString(oBookmarkEnd.toXML());
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
@ -3872,6 +3884,18 @@ public:
|
||||
SdtWraper oSdt(1);
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadSdt, this, &oSdt);
|
||||
}
|
||||
else if ( c_oSerParType::BookmarkStart == type )
|
||||
{
|
||||
OOX::Logic::CBookmarkStart oBookmarkStart;
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadBookmarkStart, this, &oBookmarkStart);
|
||||
m_oDocumentWriter.m_oContent.WriteString(oBookmarkStart.toXML());
|
||||
}
|
||||
else if ( c_oSerParType::BookmarkEnd == type )
|
||||
{
|
||||
OOX::Logic::CBookmarkEnd oBookmarkEnd;
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadBookmarkEnd, this, &oBookmarkEnd);
|
||||
m_oDocumentWriter.m_oContent.WriteString(oBookmarkEnd.toXML());
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
@ -4267,6 +4291,57 @@ public:
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
}
|
||||
int ReadBookmarkStart(BYTE type, long length, void* poResult)
|
||||
{
|
||||
int res = c_oSerConstants::ReadOk;
|
||||
OOX::Logic::CBookmarkStart* pBookmarkStart = static_cast<OOX::Logic::CBookmarkStart*>(poResult);
|
||||
if ( c_oSerBookmark::Id == type )
|
||||
{
|
||||
pBookmarkStart->m_oId.Init();
|
||||
pBookmarkStart->m_oId->SetValue(m_oBufferedStream.GetLong());
|
||||
}
|
||||
else if ( c_oSerBookmark::Name == type )
|
||||
{
|
||||
pBookmarkStart->m_sName.Init();
|
||||
pBookmarkStart->m_sName->append(m_oBufferedStream.GetString3(length));
|
||||
}
|
||||
else if ( c_oSerBookmark::DisplacedByCustomXml == type )
|
||||
{
|
||||
pBookmarkStart->m_oDisplacedByCustomXml.Init();
|
||||
pBookmarkStart->m_oDisplacedByCustomXml->SetValue((SimpleTypes::EDisplacedByCustomXml)m_oBufferedStream.GetUChar());
|
||||
}
|
||||
else if ( c_oSerBookmark::ColFirst == type )
|
||||
{
|
||||
pBookmarkStart->m_oColFirst.Init();
|
||||
pBookmarkStart->m_oColFirst->SetValue(m_oBufferedStream.GetLong());
|
||||
}
|
||||
else if ( c_oSerBookmark::ColLast == type )
|
||||
{
|
||||
pBookmarkStart->m_oColLast.Init();
|
||||
pBookmarkStart->m_oColLast->SetValue(m_oBufferedStream.GetLong());
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
}
|
||||
int ReadBookmarkEnd(BYTE type, long length, void* poResult)
|
||||
{
|
||||
int res = c_oSerConstants::ReadOk;
|
||||
OOX::Logic::CBookmarkEnd* pBookmarkEnd = static_cast<OOX::Logic::CBookmarkEnd*>(poResult);
|
||||
if ( c_oSerBookmark::Id == type )
|
||||
{
|
||||
pBookmarkEnd->m_oId.Init();
|
||||
pBookmarkEnd->m_oId->SetValue(m_oBufferedStream.GetLong());
|
||||
}
|
||||
else if ( c_oSerBookmark::DisplacedByCustomXml == type )
|
||||
{
|
||||
pBookmarkEnd->m_oDisplacedByCustomXml.Init();
|
||||
pBookmarkEnd->m_oDisplacedByCustomXml->SetValue((SimpleTypes::EDisplacedByCustomXml)m_oBufferedStream.GetUChar());
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
}
|
||||
|
||||
int ReadHyperlink(BYTE type, long length, void* poResult)
|
||||
{
|
||||
@ -4460,6 +4535,18 @@ public:
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadMathSSup, this, poResult);
|
||||
GetRunStringWriter().WriteString(std::wstring(_T("</m:sSup>")));
|
||||
}
|
||||
else if ( c_oSer_OMathContentType::BookmarkStart == type )
|
||||
{
|
||||
OOX::Logic::CBookmarkStart oBookmarkStart;
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadBookmarkStart, this, &oBookmarkStart);
|
||||
GetRunStringWriter().WriteString(oBookmarkStart.toXML());
|
||||
}
|
||||
else if ( c_oSer_OMathContentType::BookmarkEnd == type )
|
||||
{
|
||||
OOX::Logic::CBookmarkEnd oBookmarkEnd;
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadBookmarkEnd, this, &oBookmarkEnd);
|
||||
GetRunStringWriter().WriteString(oBookmarkEnd.toXML());
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
@ -6923,6 +7010,18 @@ public:
|
||||
SdtWraper oSdt(2);
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadSdt, this, &oSdt);
|
||||
}
|
||||
else if (c_oSerDocTableType::BookmarkStart == type)
|
||||
{
|
||||
OOX::Logic::CBookmarkStart oBookmarkStart;
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadBookmarkStart, this, &oBookmarkStart);
|
||||
pCStringWriter->WriteString(oBookmarkStart.toXML());
|
||||
}
|
||||
else if (c_oSerDocTableType::BookmarkEnd == type)
|
||||
{
|
||||
OOX::Logic::CBookmarkEnd oBookmarkEnd;
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadBookmarkEnd, this, &oBookmarkEnd);
|
||||
pCStringWriter->WriteString(oBookmarkEnd.toXML());
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
@ -6960,6 +7059,18 @@ public:
|
||||
SdtWraper oSdt(3);
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadSdt, this, &oSdt);
|
||||
}
|
||||
else if (c_oSerDocTableType::BookmarkStart == type)
|
||||
{
|
||||
OOX::Logic::CBookmarkStart oBookmarkStart;
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadBookmarkStart, this, &oBookmarkStart);
|
||||
pCStringWriter->WriteString(oBookmarkStart.toXML());
|
||||
}
|
||||
else if (c_oSerDocTableType::BookmarkEnd == type)
|
||||
{
|
||||
OOX::Logic::CBookmarkEnd oBookmarkEnd;
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadBookmarkEnd, this, &oBookmarkEnd);
|
||||
pCStringWriter->WriteString(oBookmarkEnd.toXML());
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
|
||||
@ -476,7 +476,9 @@ extern int g_nCurFormatVersion;
|
||||
MoveFromRangeStart = 18,
|
||||
MoveFromRangeEnd = 19,
|
||||
MoveToRangeStart = 20,
|
||||
MoveToRangeEnd = 21
|
||||
MoveToRangeEnd = 21,
|
||||
BookmarkStart = 22,
|
||||
BookmarkEnd = 23
|
||||
};}
|
||||
namespace c_oSerDocTableType{enum c_oSerDocTableType
|
||||
{
|
||||
@ -491,7 +493,9 @@ extern int g_nCurFormatVersion;
|
||||
Cell_Pr = 7,
|
||||
Cell_Content = 8,
|
||||
tblGridChange = 9,
|
||||
Sdt = 10
|
||||
Sdt = 10,
|
||||
BookmarkStart = 11,
|
||||
BookmarkEnd = 12
|
||||
};}
|
||||
namespace c_oSerRunType{enum c_oSerRunType
|
||||
{
|
||||
@ -900,7 +904,9 @@ extern int g_nCurFormatVersion;
|
||||
Ins = 62,
|
||||
Del = 63,
|
||||
columnbreak = 64,
|
||||
ARPr = 65
|
||||
ARPr = 65,
|
||||
BookmarkStart = 66,
|
||||
BookmarkEnd = 67
|
||||
};}
|
||||
namespace c_oSer_FramePrType{ enum c_oSer_FramePrType
|
||||
{
|
||||
@ -1105,6 +1111,14 @@ extern int g_nCurFormatVersion;
|
||||
Name = 6,
|
||||
UserId = 7
|
||||
};}
|
||||
namespace c_oSerBookmark{enum c_oSerBookmark
|
||||
{
|
||||
Id = 0,
|
||||
Name = 1,
|
||||
DisplacedByCustomXml = 2,
|
||||
ColFirst = 3,
|
||||
ColLast = 4
|
||||
};}
|
||||
}
|
||||
|
||||
#endif // #ifndef DOCX_BIN_READER_WRITER_DEFINES
|
||||
|
||||
@ -3076,6 +3076,20 @@ namespace BinDocxRW
|
||||
OOX::Logic::CBdo* pBdo = static_cast<OOX::Logic::CBdo*>(item);
|
||||
WriteDocumentContent(pBdo->m_arrItems);
|
||||
}break;
|
||||
case OOX::et_w_bookmarkStart:
|
||||
{
|
||||
OOX::Logic::CBookmarkStart* pBookmarkStart = static_cast<OOX::Logic::CBookmarkStart*>(item);
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerParType::BookmarkStart);
|
||||
WriteBookmarkStart(*pBookmarkStart);
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}break;
|
||||
case OOX::et_w_bookmarkEnd:
|
||||
{
|
||||
OOX::Logic::CBookmarkEnd* pBookmarkEnd = static_cast<OOX::Logic::CBookmarkEnd*>(item);
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerParType::BookmarkEnd);
|
||||
WriteBookmarkEnd(*pBookmarkEnd);
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -3249,6 +3263,22 @@ namespace BinDocxRW
|
||||
WriteComment(OOX::et_w_commentRangeEnd, pCommentRangeEnd->m_oId);
|
||||
break;
|
||||
}
|
||||
case OOX::et_w_bookmarkStart:
|
||||
{
|
||||
OOX::Logic::CBookmarkStart* pBookmarkStart = static_cast<OOX::Logic::CBookmarkStart*>(item);
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerParType::BookmarkStart);
|
||||
WriteBookmarkStart(*pBookmarkStart);
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
break;
|
||||
}
|
||||
case OOX::et_w_bookmarkEnd:
|
||||
{
|
||||
OOX::Logic::CBookmarkEnd* pBookmarkEnd = static_cast<OOX::Logic::CBookmarkEnd*>(item);
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerParType::BookmarkEnd);
|
||||
WriteBookmarkEnd(*pBookmarkEnd);
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
break;
|
||||
}
|
||||
//todo moveRange on all levels(body, p ...)
|
||||
// case OOX::et_w_moveFromRangeStart:
|
||||
// {
|
||||
@ -3660,11 +3690,60 @@ namespace BinDocxRW
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
void WriteBookmarkStart(const OOX::Logic::CBookmarkStart& oBookmarkStart)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
if (oBookmarkStart.m_oId.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerBookmark::Id);
|
||||
m_oBcw.m_oStream.WriteLONG(oBookmarkStart.m_oId->GetValue());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if (oBookmarkStart.m_sName.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerBookmark::Name);
|
||||
m_oBcw.m_oStream.WriteStringW3(oBookmarkStart.m_sName.get());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if (oBookmarkStart.m_oDisplacedByCustomXml.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerBookmark::DisplacedByCustomXml);
|
||||
m_oBcw.m_oStream.WriteBYTE((BYTE)oBookmarkStart.m_oDisplacedByCustomXml->GetValue());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if (oBookmarkStart.m_oColFirst.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerBookmark::ColFirst);
|
||||
m_oBcw.m_oStream.WriteLONG(oBookmarkStart.m_oColFirst->GetValue());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if (oBookmarkStart.m_oColLast.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerBookmark::ColLast);
|
||||
m_oBcw.m_oStream.WriteLONG(oBookmarkStart.m_oColLast->GetValue());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
void WriteBookmarkEnd(const OOX::Logic::CBookmarkEnd& oBookmarkEnd)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
if (oBookmarkEnd.m_oId.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerBookmark::Id);
|
||||
m_oBcw.m_oStream.WriteLONG(oBookmarkEnd.m_oId->GetValue());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if (oBookmarkEnd.m_oDisplacedByCustomXml.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerBookmark::DisplacedByCustomXml);
|
||||
m_oBcw.m_oStream.WriteBYTE((BYTE)oBookmarkEnd.m_oDisplacedByCustomXml->GetValue());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
|
||||
void WriteHyperlink(OOX::Logic::CHyperlink* pHyperlink)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
std::wstring sField;
|
||||
std::wstring sLink;
|
||||
if(pHyperlink->m_oId.IsInit())
|
||||
{
|
||||
@ -3677,24 +3756,20 @@ namespace BinDocxRW
|
||||
}
|
||||
}
|
||||
|
||||
if(!sLink.empty())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerParType::Hyperlink);
|
||||
WriteHyperlinkContent(sLink, pHyperlink);
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteParagraphContent(pHyperlink->m_arrItems, true);
|
||||
}
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerParType::Hyperlink);
|
||||
WriteHyperlinkContent(sLink, pHyperlink);
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
void WriteHyperlinkContent(std::wstring& sLink, OOX::Logic::CHyperlink* pHyperlink)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
//Link
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_HyperlinkType::Link);
|
||||
m_oBcw.m_oStream.WriteStringW3(sLink);
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
if(!sLink.empty())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_HyperlinkType::Link);
|
||||
m_oBcw.m_oStream.WriteStringW3(sLink);
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
//Anchor
|
||||
if(pHyperlink->m_sAnchor.IsInit())
|
||||
{
|
||||
@ -4097,6 +4172,22 @@ namespace BinDocxRW
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
break;
|
||||
}
|
||||
case OOX::et_w_bookmarkStart:
|
||||
{
|
||||
OOX::Logic::CBookmarkStart* pBookmarkStart = static_cast<OOX::Logic::CBookmarkStart*>(item);
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::BookmarkStart);
|
||||
WriteBookmarkStart(*pBookmarkStart);
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
break;
|
||||
}
|
||||
case OOX::et_w_bookmarkEnd:
|
||||
{
|
||||
OOX::Logic::CBookmarkEnd* pBookmarkEnd = static_cast<OOX::Logic::CBookmarkEnd*>(item);
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::BookmarkEnd);
|
||||
WriteBookmarkEnd(*pBookmarkEnd);
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -6638,6 +6729,20 @@ namespace BinDocxRW
|
||||
OOX::Logic::CBdo* pBdo = static_cast<OOX::Logic::CBdo*>(item);
|
||||
WriteTableContent(pBdo->m_arrItems, pTblPr, nRows, nCols);
|
||||
}
|
||||
else if(OOX::et_w_bookmarkStart == item->getType())
|
||||
{
|
||||
OOX::Logic::CBookmarkStart* pBookmarkStart = static_cast<OOX::Logic::CBookmarkStart*>(item);
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerDocTableType::BookmarkStart);
|
||||
WriteBookmarkStart(*pBookmarkStart);
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
else if(OOX::et_w_bookmarkEnd == item->getType())
|
||||
{
|
||||
OOX::Logic::CBookmarkEnd* pBookmarkEnd = static_cast<OOX::Logic::CBookmarkEnd*>(item);
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerDocTableType::BookmarkEnd);
|
||||
WriteBookmarkEnd(*pBookmarkEnd);
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
void WriteRow(const OOX::Logic::CTr& Row, OOX::Logic::CTableProperty* pTblPr, int nCurRowIndex, int nRows, int nCols)
|
||||
@ -6698,6 +6803,20 @@ namespace BinDocxRW
|
||||
OOX::Logic::CBdo* pBdo = static_cast<OOX::Logic::CBdo*>(item);
|
||||
WriteRowContent(pBdo->m_arrItems, pTblPr, nCurRowIndex, nRows, nCols);
|
||||
}
|
||||
else if(OOX::et_w_bookmarkStart == item->getType())
|
||||
{
|
||||
OOX::Logic::CBookmarkStart* pBookmarkStart = static_cast<OOX::Logic::CBookmarkStart*>(item);
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerDocTableType::BookmarkStart);
|
||||
WriteBookmarkStart(*pBookmarkStart);
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
else if(OOX::et_w_bookmarkEnd == item->getType())
|
||||
{
|
||||
OOX::Logic::CBookmarkEnd* pBookmarkEnd = static_cast<OOX::Logic::CBookmarkEnd*>(item);
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerDocTableType::BookmarkEnd);
|
||||
WriteBookmarkEnd(*pBookmarkEnd);
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
void WriteCell(OOX::Logic::CTc& tc, OOX::Logic::CTableProperty* pTblPr, int nCurRowIndex, int nCurColIndex, int nRows, int nCols)
|
||||
|
||||
@ -133,7 +133,8 @@ xlsx_table_state::xlsx_table_state(xlsx_conversion_context * Context, std::wstri
|
||||
xlsx_drawing_context_ (Context->get_drawing_context_handle()),
|
||||
xlsx_comments_context_ (Context->get_comments_context_handle()),
|
||||
table_column_last_width_(0.0),
|
||||
in_cell(false)
|
||||
in_cell(false),
|
||||
bEndTable(false)
|
||||
|
||||
{
|
||||
memset(&group_row_,0,sizeof(_group_row));
|
||||
|
||||
@ -91,6 +91,9 @@ public:
|
||||
void end_row ();
|
||||
|
||||
void add_empty_row(int count);
|
||||
|
||||
void set_end_table(){ bEndTable = true; }
|
||||
bool get_end_table(){ return bEndTable; }
|
||||
|
||||
std::wstring current_row_style () const;
|
||||
std::wstring default_row_cell_style () const;
|
||||
@ -153,6 +156,7 @@ public:
|
||||
friend class xlsx_table_context;
|
||||
|
||||
private:
|
||||
bool bEndTable;
|
||||
xlsx_conversion_context * context_;
|
||||
|
||||
std::wstring tableName_;
|
||||
|
||||
@ -195,7 +195,14 @@ std::wstring cellType2Str(XlsxCellType::type type)
|
||||
|
||||
boost::int64_t convertDate(int Year, int Month, int Day)
|
||||
{
|
||||
boost::int64_t daysFrom1900 = boost::gregorian::date_duration(boost::gregorian::date(Year, Month, Day) - boost::gregorian::date(1900, 1, 1)).days() + 1;
|
||||
if (Year < 1400 || Year >10000)
|
||||
return - 1;
|
||||
if (Month < 1 || Month > 12)
|
||||
return - 1;
|
||||
if (Day < 1 || Day > 31)
|
||||
return - 1;
|
||||
|
||||
boost::int64_t daysFrom1900 = boost::gregorian::date_duration(boost::gregorian::date(Year, Month, Day) - boost::gregorian::date(1900, 1, 1)).days() + 1;
|
||||
|
||||
if (Year <= 1900 &&
|
||||
Month <= 2 &&
|
||||
|
||||
@ -78,13 +78,16 @@ int table_table_cell_content::xlsx_convert(oox::xlsx_conversion_context & Contex
|
||||
|
||||
void table_table_row::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
bool bEndTable = Context.get_table_context().state()->get_end_table();
|
||||
|
||||
if (attlist_.table_number_rows_repeated_ > 1 && empty())
|
||||
{
|
||||
Context.get_table_context().state()->add_empty_row(attlist_.table_number_rows_repeated_);
|
||||
return;
|
||||
}
|
||||
if (attlist_.table_number_rows_repeated_ > 0xf000 && empty_content_cells())
|
||||
if (attlist_.table_number_rows_repeated_ > 0x0f00 && empty_content_cells() || bEndTable)//0xf000 - conv_KDZO3J3xLIbZ5fC0HR0__xlsx.ods
|
||||
{
|
||||
Context.get_table_context().state()->set_end_table();
|
||||
Context.get_table_context().state()->add_empty_row(attlist_.table_number_rows_repeated_);
|
||||
return; //conv_hSX8n3lVbhALjt0aafg__xlsx.ods, conv_MA2CauoNfX_7ejKS5eg__xlsx.ods
|
||||
}
|
||||
@ -731,7 +734,15 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
int y, m, d;
|
||||
if (oox::parseDate(attr.office_date_value_.get(), y, m, d))
|
||||
{
|
||||
number_val = boost::lexical_cast<std::wstring>(oox::convertDate(y, m, d));
|
||||
boost::int64_t intDate = oox::convertDate(y, m, d);
|
||||
if (intDate > 0)
|
||||
{
|
||||
number_val = boost::lexical_cast<std::wstring>(intDate);
|
||||
}
|
||||
else
|
||||
{
|
||||
str_val = attr.office_date_value_.get();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -742,11 +753,19 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
if (attr.office_time_value_)
|
||||
{
|
||||
const std::wstring tv = attr.office_time_value_.get();
|
||||
int h,m;
|
||||
int h, m;
|
||||
double s;
|
||||
if (oox::parseTime(tv, h, m, s))
|
||||
{
|
||||
number_val = boost::lexical_cast<std::wstring>(oox::convertTime(h, m, s));
|
||||
boost::int64_t intTime = oox::convertTime(h, m, s);
|
||||
if (intTime > 0)
|
||||
{
|
||||
number_val = boost::lexical_cast<std::wstring>(intTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
str_val = tv;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -999,7 +1018,15 @@ void table_covered_table_cell::xlsx_convert(oox::xlsx_conversion_context & Conte
|
||||
int y, m, d;
|
||||
if (oox::parseDate(attr.office_date_value_.get(), y, m, d))
|
||||
{
|
||||
number_val = boost::lexical_cast<std::wstring>(oox::convertDate(y, m, d));
|
||||
boost::int64_t intDate = oox::convertDate(y, m, d);
|
||||
if (intDate > 0)
|
||||
{
|
||||
number_val = boost::lexical_cast<std::wstring>(intDate);
|
||||
}
|
||||
else
|
||||
{
|
||||
str_val = attr.office_date_value_.get();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,7 +67,9 @@ public:
|
||||
}
|
||||
|
||||
HRESULT LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath, std::wstring password, bool &bMacros);
|
||||
|
||||
|
||||
long OpenFile(const std::wstring & fileName, const std::wstring & password, bool &bMacros);
|
||||
bool CloseFile();
|
||||
private:
|
||||
|
||||
int m_Status;
|
||||
@ -76,8 +78,7 @@ private:
|
||||
std::wstring m_strTempDirectory;
|
||||
std::wstring m_sTempDecryptFileName;
|
||||
|
||||
long OpenFile(const std::wstring & fileName, const std::wstring & password, bool &bMacros);
|
||||
bool CloseFile();
|
||||
|
||||
|
||||
std::wstring GetDirectory(std::wstring strFileName);
|
||||
};
|
||||
|
||||
@ -637,11 +637,18 @@ namespace PPTX
|
||||
{
|
||||
pWriter->StartRecord(SPTREE_TYPE_OLE);
|
||||
|
||||
if (oleObject->m_sShapeId.IsInit() && (!blipFill.blip->embed.IsInit() && blipFill.blip->oleFilepathImage.empty()) &&
|
||||
parentFileIs<PPTX::Slide>() && parentFileAs<PPTX::Slide>().Vml.IsInit())
|
||||
OOX::CVmlDrawing *pVml = NULL;
|
||||
|
||||
if (parentFileIs<PPTX::Slide>())
|
||||
{
|
||||
OOX::CVmlDrawing *pVml = parentFileAs<PPTX::Slide>().Vml.operator->();
|
||||
|
||||
pVml = parentFileAs<PPTX::Slide>().Vml.operator->();
|
||||
}
|
||||
else if (parentFileIs<PPTX::SlideMaster>())
|
||||
{
|
||||
pVml = parentFileAs<PPTX::SlideMaster>().Vml.operator->();
|
||||
}
|
||||
if (oleObject->m_sShapeId.IsInit() && pVml && !blipFill.blip->embed.IsInit() && blipFill.blip->oleFilepathImage.empty())
|
||||
{
|
||||
std::map<std::wstring, OOX::CVmlDrawing::_vml_shape>::iterator pPair = pVml->m_mapShapes.find(*oleObject->m_sShapeId);
|
||||
if (pVml->m_mapShapes.end() != pPair)
|
||||
{
|
||||
|
||||
@ -60,7 +60,7 @@ HRESULT convert_single(std::wstring srcFileName)
|
||||
std::wstring dstPath;
|
||||
|
||||
bool bMacros = true;
|
||||
hr = ConvertXls2Xlsx(srcFileName, dstTempPath, L"password", L"C:\\Windows\\Fonts", NULL, bMacros);
|
||||
hr = ConvertXls2Xlsx(srcFileName, dstTempPath, L"password", L"C:\\Windows\\Fonts", L"C:\\Windows\\Temp", NULL, bMacros);
|
||||
|
||||
if (bMacros)
|
||||
{
|
||||
|
||||
@ -57,6 +57,8 @@ namespace writer
|
||||
static const char colon = ':';
|
||||
static const char amp = '&';
|
||||
static const char apos = '\'';
|
||||
static const char a = '\x0a';
|
||||
|
||||
static const char * cdata_open() { return "<![CDATA["; }
|
||||
static const char * cdata_close() { return "]]>"; }
|
||||
static const char * amp_str(){ return "&"; }
|
||||
@ -64,6 +66,7 @@ namespace writer
|
||||
static const char * right_brocket_str() { return ">"; }
|
||||
static const char * apos_str() { return "'"; }
|
||||
static const char * quote_str() { return """; }
|
||||
static const char * a_str() { return " "; }
|
||||
};
|
||||
|
||||
template <>
|
||||
@ -78,14 +81,17 @@ namespace writer
|
||||
static const wchar_t colon = L':';
|
||||
static const wchar_t amp = L'&';
|
||||
static const wchar_t apos = L'\'';
|
||||
static const wchar_t * cdata_open() { return L"<![CDATA["; }
|
||||
static const wchar_t a = L'\x0a';
|
||||
|
||||
static const wchar_t * cdata_open() { return L"<![CDATA["; }
|
||||
static const wchar_t * cdata_close() { return L"]]>"; }
|
||||
static const wchar_t * amp_str(){ return L"&"; }
|
||||
static const wchar_t * left_brocket_str() { return L"<"; }
|
||||
static const wchar_t * right_brocket_str() { return L">"; }
|
||||
static const wchar_t * apos_str() { return L"'"; }
|
||||
static const wchar_t * quote_str() { return L"""; }
|
||||
};
|
||||
static const wchar_t * a_str() { return L" "; }
|
||||
};
|
||||
|
||||
template <class V>
|
||||
class element;
|
||||
@ -279,7 +285,9 @@ namespace writer
|
||||
case chars<T>::quote:
|
||||
wr_.puts(chars<T>::quote_str()); break;
|
||||
|
||||
default:
|
||||
case chars<T>::a:
|
||||
wr_.puts(chars<T>::a_str()); break;
|
||||
default:
|
||||
wr_.putc(*str); break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,8 +35,7 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
Array::Array(const CellRef& cell_base_ref_init)
|
||||
: formula(false, cell_base_ref_init)
|
||||
Array::Array(const CellRef& cell_base_ref_init) :formula(false, cell_base_ref_init)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -32,8 +32,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include <Logic/Biff_structures/CellRangeRef.h>
|
||||
#include <Logic/Biff_structures/ArrayParsedFormula.h>
|
||||
#include "../Biff_structures/CellRangeRef.h"
|
||||
#include "../Biff_structures/ArrayParsedFormula.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
@ -49,7 +49,6 @@ public:
|
||||
~Array();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
|
||||
@ -46,13 +46,15 @@ static inline void trim(std::wstring &s)
|
||||
if (s[i] != 0) break;
|
||||
else new_size--;
|
||||
}
|
||||
if (new_size < s.length())
|
||||
if (new_size < (int)s.length())
|
||||
s.erase(new_size);
|
||||
}
|
||||
|
||||
AutoFilter::AutoFilter()
|
||||
{
|
||||
wTopN = wJoin = 0;
|
||||
size = 0xffffffff;
|
||||
bExist = false;
|
||||
}
|
||||
|
||||
|
||||
@ -68,6 +70,15 @@ BaseObjectPtr AutoFilter::clone()
|
||||
|
||||
void AutoFilter::readFields(CFRecord& record)
|
||||
{
|
||||
size_t pos_record = record.getRdPtr();
|
||||
|
||||
if (size == 0xffffffff) size = record.getDataSize() - pos_record;
|
||||
|
||||
if (size > 0)
|
||||
{
|
||||
bExist = true;
|
||||
}
|
||||
|
||||
m_bAutoFilter12 = false;
|
||||
|
||||
unsigned short flags;
|
||||
@ -93,13 +104,13 @@ void AutoFilter::readFields(CFRecord& record)
|
||||
record >> doper2;
|
||||
}
|
||||
|
||||
if ((doper1.vt == BIFF_BYTE(0)) && (doper2.vt == BIFF_BYTE(0)))
|
||||
if (doper1.vt == 0 && doper2.vt == 0)
|
||||
{
|
||||
m_bAutoFilter12 = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (doper1.vt == BIFF_BYTE(0x06))
|
||||
if (doper1.vt == 0x06)
|
||||
{
|
||||
XLUnicodeStringNoCch s;
|
||||
s.setSize(doper1.vtValueStr.cch);
|
||||
@ -109,7 +120,7 @@ void AutoFilter::readFields(CFRecord& record)
|
||||
trim(str1);
|
||||
}
|
||||
|
||||
if (doper2.vt == BIFF_BYTE(0x06))
|
||||
if (doper2.vt == 0x06)
|
||||
{
|
||||
XLUnicodeStringNoCch s;
|
||||
s.setSize(doper2.vtValueStr.cch);
|
||||
@ -119,9 +130,9 @@ void AutoFilter::readFields(CFRecord& record)
|
||||
trim(str2);
|
||||
}
|
||||
|
||||
if (record.getRdPtr() < record.getDataSize())
|
||||
if (record.getRdPtr() - pos_record < size)
|
||||
{
|
||||
int sz = record.getDataSize() - record.getRdPtr();
|
||||
int sz = size - (record.getRdPtr() - pos_record);
|
||||
char *dd = new char [sz];
|
||||
|
||||
memcpy(dd, record.getCurData<char>(), sz);
|
||||
|
||||
@ -32,13 +32,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include <Logic/Biff_structures/AFDOper.h>
|
||||
#include "../Biff_structures/AFDOper.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of AutoFilter record in BIFF8
|
||||
class AutoFilter: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(AutoFilter)
|
||||
@ -74,6 +72,9 @@ public:
|
||||
std::wstring str1;
|
||||
std::wstring str2;
|
||||
|
||||
//----------------------------------------
|
||||
bool bExist;
|
||||
_UINT32 size;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -31,6 +31,13 @@
|
||||
*/
|
||||
|
||||
#include "AutoFilter12.h"
|
||||
#include "../Biff_structures/DXFN12List.h"
|
||||
|
||||
#include "../Biff_structures/BiffString.h"
|
||||
|
||||
#include "../Biff_structures/AFDOper.h"
|
||||
#include "../Biff_structures/AF12Criteria.h"
|
||||
#include "../Biff_structures/AF12CellIcon.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
@ -58,20 +65,29 @@ void AutoFilter12::readFields(CFRecord& record)
|
||||
|
||||
record >> frtRefHeader >> iEntry >> fHideArrow >> ft >> cft >> cCriteria >> cDateGroupings >> flags >> unused2 >> idList;
|
||||
|
||||
_UINT16 _iEntry = iEntry;
|
||||
_UINT32 _fHideArrow = fHideArrow;
|
||||
_UINT32 _ft = ft;
|
||||
_UINT32 _cft = cft;
|
||||
_UINT32 _cCriteria = cCriteria;
|
||||
_UINT32 _cDateGroupings = cDateGroupings;
|
||||
_UINT32 _idList = idList;
|
||||
_GUID_ guid_num;
|
||||
record >> guid_num;
|
||||
guidSview = STR::guid2bstr(guid_num);
|
||||
|
||||
// TODO доделать
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------
|
||||
std::list<CFRecordPtr>& recs = continue_records[rt_ContinueFrt12];
|
||||
size_t size = recs.size();
|
||||
|
||||
switch(ft)
|
||||
{
|
||||
case 0x00000000://not exist
|
||||
break;
|
||||
case 0x00000001: rgb = BiffStructurePtr(new DXFN12List); //color
|
||||
break;
|
||||
case 0x00000002: rgb = BiffStructurePtr(new DXFN12List); //font
|
||||
break;
|
||||
case 0x00000003: rgb = BiffStructurePtr(new AF12CellIcon); //icon
|
||||
break;
|
||||
}
|
||||
if (rgb)
|
||||
rgb->load(record);
|
||||
|
||||
while( !recs.empty() )
|
||||
{
|
||||
record.appendRawData(recs.front());
|
||||
@ -82,11 +98,12 @@ void AutoFilter12::readFields(CFRecord& record)
|
||||
record >> frtRefHeaderContinue;
|
||||
if (frtRefHeaderContinue.rt == 0x087F)
|
||||
{
|
||||
if ( (ft == BIFF_DWORD(0)) && (cCriteria > 0) )
|
||||
if ( ft == 0 && cCriteria > 0)
|
||||
{
|
||||
AF12CriteriaPtr item(new AF12Criteria);
|
||||
item->load(record);
|
||||
rgbAF12Criteries.push_back(item);
|
||||
|
||||
arAF12Criteries.push_back(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,17 +32,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecordContinued.h"
|
||||
#include <Logic/Biff_structures/FrtRefHeader.h>
|
||||
#include <Logic/Biff_structures/BiffString.h>
|
||||
#include <Logic/Biff_structures/FrtRefHeader.h>
|
||||
#include <Logic/Biff_structures/AFDOper.h>
|
||||
#include <Logic/Biff_structures/AF12Criteria.h>
|
||||
|
||||
#include "../Biff_structures/FrtRefHeader.h"
|
||||
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of AutoFilter12 record in BIFF8
|
||||
class AutoFilter12: public BiffRecordContinued
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(AutoFilter12)
|
||||
@ -53,21 +49,24 @@ public:
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeAutoFilter12;
|
||||
|
||||
FrtRefHeader frtRefHeader;
|
||||
_UINT16 iEntry;
|
||||
BIFF_DWORD fHideArrow;
|
||||
BIFF_DWORD ft;
|
||||
BIFF_DWORD cft;
|
||||
BIFF_DWORD cCriteria;
|
||||
BIFF_DWORD cDateGroupings;
|
||||
BIFF_DWORD idList;
|
||||
|
||||
BiffStructurePtrVector rgbAF12Criteries;
|
||||
_UINT16 iEntry;
|
||||
_UINT32 fHideArrow;
|
||||
_UINT32 ft;
|
||||
_UINT32 cft;
|
||||
_UINT32 cCriteria;
|
||||
_UINT32 cDateGroupings;
|
||||
_UINT32 idList;
|
||||
|
||||
std::wstring guidSview;
|
||||
BiffStructurePtr rgb;
|
||||
|
||||
BiffStructurePtrVector arAF12Criteries;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -33,8 +33,8 @@
|
||||
|
||||
#include "BiffRecord.h"
|
||||
|
||||
#include <Logic/Biff_structures/ChartParsedFormula.h>
|
||||
#include <Logic/Biff_structures/CellRangeRef.h>
|
||||
#include "../Biff_structures/ChartParsedFormula.h"
|
||||
#include "../Biff_structures/CellRangeRef.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
@ -70,7 +70,7 @@ const bool BiffRecord::read(CFStreamCacheReader& reader, BaseObject* parent, con
|
||||
size_t rdPtr = record->getRdPtr();
|
||||
size_t typeId = getTypeId();
|
||||
|
||||
if(record->getDataSize() != record->getRdPtr() && getTypeId() != rt_ANY_TYPE && getTypeId() != rt_MsoDrawing)
|
||||
if(record->getDataSize() != record->getRdPtr() && getTypeId() != rt_ANY_TYPE/* && getTypeId() != rt_MsoDrawing*/)
|
||||
{
|
||||
Log::warning(STR::int2str(record->getDataSize() - record->getRdPtr(), 10) + " unsigned chars were not processed while reading from " + record->getTypeString());
|
||||
}
|
||||
|
||||
@ -36,8 +36,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of BookBool record in BIFF8
|
||||
class BookBool: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(BookBool)
|
||||
@ -47,20 +45,18 @@ public:
|
||||
~BookBool();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeBookBool;
|
||||
|
||||
//-----------------------------
|
||||
bool fNoSaveSup;
|
||||
bool fHasEnvelope;
|
||||
bool fEnvelopeVisible;
|
||||
bool fEnvelopeInitDone;
|
||||
bool fHideBorderUnselLists;
|
||||
|
||||
BIFF_BSTR grUpdateLinks;
|
||||
std::wstring grUpdateLinks;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -56,6 +56,7 @@ void BopPop::readFields(CFRecord& record)
|
||||
{
|
||||
unsigned short flags;
|
||||
record >> pst >> fAutoSplit >> split >> iSplitPos >> pcSplitPercent >> pcPie2Size >> pcGap >> numSplitValue >> flags;
|
||||
|
||||
fHasShadow = GETBIT(flags, 0);
|
||||
}
|
||||
|
||||
|
||||
@ -32,12 +32,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include "../Biff_structures/Xnum.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of BopPop record in BIFF8
|
||||
class BopPop: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(BopPop)
|
||||
@ -47,7 +46,6 @@ public:
|
||||
~BopPop();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
@ -63,7 +61,7 @@ public:
|
||||
_INT16 pcSplitPercent;
|
||||
_INT16 pcPie2Size;
|
||||
_INT16 pcGap;
|
||||
BIFF_DOUBLE numSplitValue;
|
||||
Xnum numSplitValue;
|
||||
|
||||
bool fHasShadow;
|
||||
|
||||
|
||||
@ -32,12 +32,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include "../Biff_structures/Xnum.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of BottomMargin record in BIFF8
|
||||
class BottomMargin: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(BottomMargin)
|
||||
@ -54,7 +53,7 @@ public:
|
||||
static const ElementType type = typeBottomMargin;
|
||||
|
||||
//-----------------------------
|
||||
BIFF_DOUBLE num;
|
||||
Xnum num;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -32,14 +32,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include <Logic/Biff_structures/DXFN.h>
|
||||
#include <Logic/Biff_structures/CFParsedFormulaNoCCE.h>
|
||||
#include "../Biff_structures/DXFN.h"
|
||||
#include "../Biff_structures/CFParsedFormulaNoCCE.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of CF record in BIFF8
|
||||
class CF: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(CF)
|
||||
@ -50,7 +48,6 @@ public:
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeCF;
|
||||
@ -69,6 +66,7 @@ public:
|
||||
CFParsedFormulaNoCCE rgce2;
|
||||
|
||||
BaseObjectPtr m_CFEx;
|
||||
BaseObjectPtr m_CF12;
|
||||
|
||||
GlobalWorkbookInfoPtr global_info_;
|
||||
};
|
||||
|
||||
@ -32,18 +32,16 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include <Logic/Biff_structures/FrtRefHeader.h>
|
||||
#include <Logic/Biff_structures/DXFN12.h>
|
||||
#include <Logic/Biff_structures/CFParsedFormulaNoCCE.h>
|
||||
#include <Logic/Biff_structures/CFParsedFormula.h>
|
||||
#include <Logic/Biff_structures/CFExTemplateParams.h>
|
||||
#include "../Biff_structures/FrtRefHeader.h"
|
||||
#include "../Biff_structures/DXFN12.h"
|
||||
#include "../Biff_structures/CFParsedFormulaNoCCE.h"
|
||||
#include "../Biff_structures/CFParsedFormula.h"
|
||||
#include "../Biff_structures/CFExTemplateParams.h"
|
||||
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of CF12 record in BIFF8
|
||||
class CF12: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(CF12)
|
||||
@ -84,6 +82,7 @@ public:
|
||||
int dxfId_;
|
||||
|
||||
BaseObjectPtr m_CFEx;
|
||||
BaseObjectPtr m_CF12_2;
|
||||
};
|
||||
|
||||
typedef boost::shared_ptr<CF12> CF12Ptr;
|
||||
|
||||
@ -32,12 +32,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include "../Biff_structures/Xnum.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of CalcDelta record in BIFF8
|
||||
class CalcDelta: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(CalcDelta)
|
||||
@ -54,7 +53,7 @@ public:
|
||||
static const ElementType type = typeCalcDelta;
|
||||
|
||||
//-----------------------------
|
||||
BIFF_DOUBLE numDelta;
|
||||
Xnum numDelta;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -36,8 +36,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of CalcMode record in BIFF8
|
||||
class CalcMode: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(CalcMode)
|
||||
@ -53,8 +51,7 @@ public:
|
||||
|
||||
static const ElementType type = typeCalcMode;
|
||||
|
||||
//-----------------------------
|
||||
BIFF_BSTR fAutoRecalc;
|
||||
std::wstring fAutoRecalc;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -36,8 +36,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of CalcRefMode record in BIFF8
|
||||
class CalcRefMode: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(CalcRefMode)
|
||||
@ -47,14 +45,12 @@ public:
|
||||
~CalcRefMode();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeCalcRefMode;
|
||||
|
||||
//-----------------------------
|
||||
BIFF_BSTR fRefA1;
|
||||
std::wstring fRefA1;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -36,9 +36,6 @@
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of CondFmt record in BIFF8
|
||||
class CondFmt: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(CondFmt)
|
||||
@ -48,20 +45,18 @@ public:
|
||||
~CondFmt();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeCondFmt;
|
||||
static const ElementType type = typeCondFmt;
|
||||
|
||||
const CellRef getLocation() const;
|
||||
|
||||
//-----------------------------
|
||||
_UINT16 ccf;
|
||||
bool fToughRecalc;
|
||||
_UINT16 nID;
|
||||
SqRefU sqref;
|
||||
BIFF_BSTR refBound;
|
||||
_UINT16 ccf;
|
||||
bool fToughRecalc;
|
||||
_UINT16 nID;
|
||||
SqRefU sqref;
|
||||
std::wstring refBound;
|
||||
};
|
||||
|
||||
typedef boost::shared_ptr<CondFmt> CondFmtPtr;
|
||||
|
||||
@ -32,12 +32,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include "../Biff_structures/Xnum.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of CrtLayout12 record in BIFF8
|
||||
class CrtLayout12: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(CrtLayout12)
|
||||
@ -47,7 +45,6 @@ public:
|
||||
~CrtLayout12();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
@ -62,10 +59,10 @@ public:
|
||||
CrtLayout12Mode wWidthMode;
|
||||
CrtLayout12Mode wHeightMode;
|
||||
|
||||
BIFF_DOUBLE x;
|
||||
BIFF_DOUBLE y;
|
||||
BIFF_DOUBLE dx;
|
||||
BIFF_DOUBLE dy;
|
||||
Xnum x;
|
||||
Xnum y;
|
||||
Xnum dx;
|
||||
Xnum dy;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -35,9 +35,6 @@
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of DataFormat record in BIFF8
|
||||
class DataFormat: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(DataFormat)
|
||||
@ -47,11 +44,10 @@ public:
|
||||
~DataFormat();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeDataFormat;
|
||||
static const ElementType type = typeDataFormat;
|
||||
|
||||
_UINT16 xi;
|
||||
_UINT16 yi;
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
#include "Feat.h"
|
||||
#include <Logic/Biff_structures/FrtHeader.h>
|
||||
#include "../Biff_structures/FrtHeader.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
@ -45,43 +45,48 @@ Feat::~Feat()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr Feat::clone()
|
||||
{
|
||||
return BaseObjectPtr(new Feat(*this));
|
||||
}
|
||||
// ISFPROTECTION = 0x0002, // Specifies the enhanced protection type.
|
||||
// ISFFEC2 = 0x0003, // Specifies the ignored formula errors type.
|
||||
// ISFFACTOID = 0x0004, // Specifies the smart tag type.
|
||||
// ISFLIST = 0x0005, // Specifies the list type.
|
||||
|
||||
void Feat::readFields(CFRecord& record)
|
||||
{
|
||||
FrtHeader frtHeader(rt_Feat);
|
||||
record >> frtHeader;
|
||||
record >> isf;
|
||||
|
||||
record >> frtHeader >> isf;
|
||||
record.skipNunBytes(5); // reserved
|
||||
|
||||
record >> cref >> cbFeatData;
|
||||
record.skipNunBytes(2); // reserved
|
||||
std::wstring sqref_str;
|
||||
|
||||
for (int i = 0; i < cref ; ++i)
|
||||
{
|
||||
Ref8U reff;
|
||||
record >> reff;
|
||||
refs.push_back(BiffStructurePtr(new Ref8U(reff)));
|
||||
sqref_str += std::wstring (reff.toString().c_str()) + ((i == cref - 1) ? L"" : L" ");
|
||||
|
||||
sqref += reff.toString() + ((i == cref - 1) ? L"" : L" ");
|
||||
}
|
||||
sqref = sqref_str;
|
||||
|
||||
switch(isf)
|
||||
{
|
||||
case SharedFeatureType::ISFPROTECTION:
|
||||
record >> protection;
|
||||
case 0x0002://ISFPROTECTION:
|
||||
is_object = BiffStructurePtr(new FeatProtection);
|
||||
break;
|
||||
case SharedFeatureType::ISFFEC2:
|
||||
record >> formula_err;
|
||||
case 0x0003://ISFFEC2:
|
||||
is_object = BiffStructurePtr(new FeatFormulaErr2);
|
||||
break;
|
||||
case SharedFeatureType::ISFFACTOID:
|
||||
record >> smart_tag;
|
||||
case 0x0004://ISFFACTOID:
|
||||
is_object = BiffStructurePtr(new FeatSmartTag);
|
||||
break;
|
||||
}
|
||||
|
||||
if (is_object)
|
||||
is_object->load(record);
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -32,16 +32,14 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecordContinued.h"
|
||||
#include <Logic/Biff_structures/CellRangeRef.h>
|
||||
#include <Logic/Biff_structures/FeatProtection.h>
|
||||
#include <Logic/Biff_structures/FeatFormulaErr2.h>
|
||||
#include <Logic/Biff_structures/FeatSmartTag.h>
|
||||
#include "../Biff_structures/CellRangeRef.h"
|
||||
#include "../Biff_structures/FeatProtection.h"
|
||||
#include "../Biff_structures/FeatFormulaErr2.h"
|
||||
#include "../Biff_structures/FeatSmartTag.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of Feat record in BIFF8
|
||||
class Feat: public BiffRecordContinued
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(Feat)
|
||||
@ -51,23 +49,18 @@ public:
|
||||
~Feat();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeFeat;
|
||||
|
||||
//-----------------------------
|
||||
SharedFeatureType isf;
|
||||
_UINT16 cref;
|
||||
_UINT32 cbFeatData;
|
||||
_UINT16 isf;
|
||||
_UINT16 cref;
|
||||
_UINT32 cbFeatData;
|
||||
BiffStructurePtrVector refs;
|
||||
BIFF_BSTR sqref;
|
||||
|
||||
FeatProtection protection;
|
||||
FeatFormulaErr2 formula_err;
|
||||
FeatSmartTag smart_tag;
|
||||
std::wstring sqref;
|
||||
|
||||
BiffStructurePtr is_object;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -63,10 +63,10 @@ void FeatHdr::readFields(CFRecord& record)
|
||||
{
|
||||
switch(isf)
|
||||
{
|
||||
case SharedFeatureType::ISFPROTECTION:
|
||||
case 0x0002://ISFPROTECTION:
|
||||
record >> protection;
|
||||
break;
|
||||
case SharedFeatureType::ISFFACTOID:
|
||||
case 0x0004://ISFFACTOID:
|
||||
if(is_contained_in_Globals)
|
||||
{
|
||||
record >> prop;
|
||||
|
||||
@ -55,12 +55,13 @@ public:
|
||||
|
||||
static const ElementType type = typeFeatHdr;
|
||||
|
||||
_UINT16 isf;
|
||||
_UINT32 cbHdrData;
|
||||
EnhancedProtection protection;
|
||||
OSHARED::PropertyBagStore prop;
|
||||
|
||||
//-----------------------------
|
||||
bool is_contained_in_Globals;
|
||||
SharedFeatureType isf;
|
||||
_UINT32 cbHdrData;
|
||||
EnhancedProtection protection;
|
||||
OSHARED::PropertyBagStore prop;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -54,6 +54,12 @@ void FeatHdr11::readFields(CFRecord& record)
|
||||
{
|
||||
record >> frt;
|
||||
record >> isf;
|
||||
|
||||
// ISFPROTECTION = 0x0002, // Specifies the enhanced protection type.
|
||||
// ISFFEC2 = 0x0003, // Specifies the ignored formula errors type.
|
||||
// ISFFACTOID = 0x0004, // Specifies the smart tag type.
|
||||
// ISFLIST = 0x0005, // Specifies the list type.
|
||||
|
||||
record.skipNunBytes(1); // reserved1
|
||||
record.skipNunBytes(4); // reserved2
|
||||
record.skipNunBytes(4); // reserved3
|
||||
|
||||
@ -32,13 +32,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include <Logic/Biff_structures/FrtHeader.h>
|
||||
#include "../Biff_structures/FrtHeader.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of FeatHdr11 record in BIFF8
|
||||
class FeatHdr11: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(FeatHdr11)
|
||||
@ -48,18 +46,14 @@ public:
|
||||
~FeatHdr11();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeFeatHdr11;
|
||||
|
||||
|
||||
|
||||
public:
|
||||
FrtHeader frt;
|
||||
SharedFeatureType isf;
|
||||
_UINT32 idListNext;
|
||||
FrtHeader frt;
|
||||
_UINT16 isf;
|
||||
_UINT32 idListNext;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -39,12 +39,10 @@ Feature11::Feature11()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Feature11::~Feature11()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr Feature11::clone()
|
||||
{
|
||||
return BaseObjectPtr(new Feature11(*this));
|
||||
@ -54,25 +52,21 @@ void Feature11::readFields(CFRecord& record)
|
||||
{
|
||||
record >> frtRefHeaderU;
|
||||
record >> isf;
|
||||
|
||||
record.skipNunBytes(1); // reserved1
|
||||
record.skipNunBytes(4); // reserved2
|
||||
|
||||
record >> cref2;
|
||||
record >> cbFeatData;
|
||||
record.skipNunBytes(2); // reserved3
|
||||
|
||||
unsigned short _isf = isf;
|
||||
unsigned short _cref2 = cref2;
|
||||
unsigned int _cbFeatData = cbFeatData;
|
||||
|
||||
std::wstring sqref_str;
|
||||
for (int i = 0; i < cref2 ; ++i)
|
||||
{
|
||||
Ref8U reff;
|
||||
record >> reff;
|
||||
refs2.push_back(BiffStructurePtr(new Ref8U(reff)));
|
||||
sqref_str += std::wstring (reff.toString().c_str()) + ((i == cref2 - 1) ? L"" : L" ");
|
||||
sqref += reff.toString() + ((i == cref2 - 1) ? L"" : L" ");
|
||||
}
|
||||
sqref = sqref_str;
|
||||
|
||||
record >> rgbFeat;
|
||||
}
|
||||
|
||||
@ -32,15 +32,14 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include <Logic/Biff_structures/FrtRefHeaderU.h>
|
||||
#include <Logic/Biff_structures/CellRangeRef.h>
|
||||
#include <Logic/Biff_structures/TableFeatureType.h>
|
||||
|
||||
#include "../Biff_structures/FrtRefHeaderU.h"
|
||||
#include "../Biff_structures/CellRangeRef.h"
|
||||
#include "../Biff_structures/TableFeatureType.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of Feature11 record in BIFF8
|
||||
class Feature11: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(Feature11)
|
||||
@ -50,23 +49,19 @@ public:
|
||||
~Feature11();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeFeature11;
|
||||
static const ElementType type = typeFeature11;
|
||||
|
||||
|
||||
|
||||
public:
|
||||
FrtRefHeaderU frtRefHeaderU;
|
||||
_UINT16 isf;
|
||||
_UINT16 cref2;
|
||||
_UINT32 cbFeatData;
|
||||
BiffStructurePtrVector refs2;
|
||||
BIFF_BSTR sqref;
|
||||
std::wstring sqref;
|
||||
|
||||
TableFeatureType rgbFeat;
|
||||
TableFeatureType rgbFeat;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -39,12 +39,10 @@ Feature12::Feature12()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Feature12::~Feature12()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr Feature12::clone()
|
||||
{
|
||||
return BaseObjectPtr(new Feature12(*this));
|
||||
@ -53,6 +51,7 @@ BaseObjectPtr Feature12::clone()
|
||||
|
||||
void Feature12::readFields(CFRecord& record)
|
||||
{
|
||||
feature11.readFields(record);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -32,12 +32,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecordContinued.h"
|
||||
#include "Feature11.h"
|
||||
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of Feature12 record in BIFF8
|
||||
class Feature12: public BiffRecordContinued
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(Feature12)
|
||||
@ -47,12 +47,12 @@ public:
|
||||
~Feature12();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeFeature12;
|
||||
static const ElementType type = typeFeature12;
|
||||
|
||||
Feature11 feature11;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -32,13 +32,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include <Logic/Biff_structures/BiffString.h>
|
||||
#include "../Biff_structures/BiffString.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of FileSharing record in BIFF8
|
||||
class FileSharing: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(FileSharing)
|
||||
@ -48,16 +46,14 @@ public:
|
||||
~FileSharing();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeFileSharing;
|
||||
|
||||
//-----------------------------
|
||||
Boolean<unsigned short> fReadOnlyRec;
|
||||
unsigned short wResPassNum;
|
||||
BIFF_BSTR wResPass;
|
||||
std::wstring wResPass;
|
||||
_UINT16 iNoResPass;
|
||||
XLUnicodeString stUNUsername;
|
||||
|
||||
|
||||
@ -138,30 +138,13 @@ int Font::serialize_rPr(std::wostream & stream, bool rtl, bool defRPr, std::wstr
|
||||
}
|
||||
else
|
||||
CP_XML_ATTR(L"i", false);
|
||||
//if (bCharSet.value())
|
||||
//{
|
||||
// CP_XML_NODE(L"charset")
|
||||
// {
|
||||
// CP_XML_ATTR(L"val", bCharSet);
|
||||
// }
|
||||
//}
|
||||
|
||||
switch(sss)
|
||||
{
|
||||
case 1: CP_XML_ATTR(L"cap", L"all");break;
|
||||
case 2: CP_XML_ATTR(L"cap", L"small");break;
|
||||
}
|
||||
|
||||
|
||||
//if ((fCondense.value()) && (*fCondense.value()))
|
||||
//{
|
||||
// CP_XML_NODE(L"condense")
|
||||
// {
|
||||
// CP_XML_ATTR(L"val", (int)(*fCondense.value()));
|
||||
// }
|
||||
//}
|
||||
|
||||
//if ((fExtend.value()) && (fExtend))
|
||||
// {
|
||||
// CP_XML_NODE(L"extend")
|
||||
// {
|
||||
// CP_XML_ATTR(L"val", fExtend);
|
||||
// }
|
||||
// }
|
||||
if ( (icv < 0x7fff) || color_ext.enabled )
|
||||
{
|
||||
if (color_ext.enabled )
|
||||
@ -236,66 +219,7 @@ int Font::serialize_rPr(std::wostream & stream, bool rtl, bool defRPr, std::wstr
|
||||
{
|
||||
CP_XML_NODE(namespace_ + L"rtl");
|
||||
}
|
||||
//if ((fOutline.value()) && (fOutline))
|
||||
// {
|
||||
// CP_XML_NODE(L"outline")
|
||||
// {
|
||||
// CP_XML_ATTR(L"val", fOutline);
|
||||
// }
|
||||
// }
|
||||
|
||||
//if (font.scheme)
|
||||
//{
|
||||
// CP_XML_NODE(L"scheme")
|
||||
// {
|
||||
// CP_XML_ATTR(L"val", *font.scheme);
|
||||
// }
|
||||
//}
|
||||
|
||||
//if ((fShadow.value()) && (fShadow))
|
||||
// {
|
||||
// CP_XML_NODE(L"shadow")
|
||||
// {
|
||||
// CP_XML_ATTR(L"val", fShadow);
|
||||
// }
|
||||
// }
|
||||
|
||||
//if ((fStrikeOut.value()) && (fStrikeOut))
|
||||
//{
|
||||
// CP_XML_NODE(L"strike")
|
||||
// {
|
||||
// CP_XML_ATTR(L"val", fStrikeOut);
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
|
||||
// if ((uls.value()) && (*uls.value() > 0))
|
||||
// {
|
||||
// CP_XML_NODE(L"u")
|
||||
// {
|
||||
//switch(uls)
|
||||
//{
|
||||
// case 1: CP_XML_ATTR(L"val", "single");break;
|
||||
// case 2: CP_XML_ATTR(L"val", "double");break;
|
||||
// case 33: CP_XML_ATTR(L"val", "singleAccounting");break;
|
||||
// case 34: CP_XML_ATTR(L"val", "doubleAccounting");break;
|
||||
//}
|
||||
// }
|
||||
// }
|
||||
|
||||
// if ((sss.value()) && (*sss.value() > 0))
|
||||
// {
|
||||
// CP_XML_NODE(L"vertAlign")
|
||||
// {
|
||||
//switch(*sss.value())
|
||||
//{
|
||||
// case 1: CP_XML_ATTR(L"val", L"superscript");break;
|
||||
// case 2: CP_XML_ATTR(L"val", L"subscript");break;
|
||||
//}
|
||||
//
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
@ -36,8 +36,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of HLinkTooltip record in BIFF8
|
||||
class HLinkTooltip: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(HLinkTooltip)
|
||||
@ -47,15 +45,13 @@ public:
|
||||
~HLinkTooltip();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeHLinkTooltip;
|
||||
static const ElementType type = typeHLinkTooltip;
|
||||
|
||||
//-----------------------------
|
||||
BIFF_BSTR wzTooltip;
|
||||
BackwardOnlyParam<std::wstring > ref_;
|
||||
std::wstring wzTooltip;
|
||||
BackwardOnlyParam<std::wstring > ref_;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -80,12 +80,9 @@ int LabelSst::serialize(std::wostream & stream)
|
||||
|
||||
CP_XML_ATTR(L"t", L"s");
|
||||
|
||||
if (isst.value())
|
||||
CP_XML_NODE(L"v")
|
||||
{
|
||||
CP_XML_NODE(L"v")
|
||||
{
|
||||
CP_XML_STREAM() << isst;
|
||||
}
|
||||
CP_XML_STREAM() << isst;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ public:
|
||||
|
||||
CellOffsetResender resender;
|
||||
Cell cell;
|
||||
BIFF_DWORD isst;
|
||||
_UINT32 isst;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -44,8 +44,7 @@ const wchar_t* const AutoFilterDefineNames[] =
|
||||
};
|
||||
|
||||
|
||||
Lbl::Lbl()
|
||||
: rgce(false), fGrp(0)
|
||||
Lbl::Lbl() : rgce(false), fGrp(0)
|
||||
{
|
||||
}
|
||||
|
||||
@ -167,10 +166,6 @@ void Lbl::readFields(CFRecord& record)
|
||||
}
|
||||
}
|
||||
|
||||
const XLUnicodeStringNoCch Lbl::getName() const
|
||||
{
|
||||
return Name_bin;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -39,8 +39,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of Lbl record in BIFF8
|
||||
class Lbl: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(Lbl)
|
||||
@ -51,15 +49,10 @@ public:
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeLbl;
|
||||
|
||||
|
||||
const XLUnicodeStringNoCch getName() const;
|
||||
|
||||
//-----------------------------
|
||||
bool fHidden;
|
||||
bool fFunc;
|
||||
bool fOB;
|
||||
@ -70,11 +63,11 @@ public:
|
||||
bool fPublished;
|
||||
bool fWorkbookParam;
|
||||
|
||||
unsigned char chKey;
|
||||
_UINT16 itab;
|
||||
XLUnicodeStringNoCch Name_bin;
|
||||
BIFF_BSTR Name;
|
||||
NameParsedFormula rgce;
|
||||
unsigned char chKey;
|
||||
_UINT16 itab;
|
||||
XLUnicodeStringNoCch Name_bin;
|
||||
std::wstring Name;
|
||||
NameParsedFormula rgce;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -32,12 +32,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include "../Biff_structures/Xnum.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of LeftMargin record in BIFF8
|
||||
class LeftMargin: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(LeftMargin)
|
||||
@ -50,10 +49,9 @@ public:
|
||||
|
||||
static const ElementType type = typeLeftMargin;
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
//-----------------------------
|
||||
BIFF_DOUBLE num;
|
||||
Xnum num;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -32,6 +32,10 @@
|
||||
|
||||
#include "List12.h"
|
||||
|
||||
#include "../Biff_structures/List12BlockLevel.h"
|
||||
#include "../Biff_structures/List12TableStyleClientInfo.h"
|
||||
#include "../Biff_structures/List12DisplayName.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
@ -39,12 +43,10 @@ List12::List12()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
List12::~List12()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr List12::clone()
|
||||
{
|
||||
return BaseObjectPtr(new List12(*this));
|
||||
@ -56,20 +58,20 @@ void List12::readFields(CFRecord& record)
|
||||
record >> lsd;
|
||||
record >> idList;
|
||||
|
||||
unsigned short _lsd = lsd;
|
||||
|
||||
switch (lsd)
|
||||
{
|
||||
case 0:
|
||||
record >> rgbList12BlockLevel;
|
||||
rgbList12 = BiffStructurePtr(new List12BlockLevel);
|
||||
break;
|
||||
case 1:
|
||||
record >> rgbList12TableStyleClientInfo;
|
||||
rgbList12 = BiffStructurePtr(new List12TableStyleClientInfo);
|
||||
break;
|
||||
case 2:
|
||||
record >> rgbList12DisplayName;
|
||||
rgbList12 = BiffStructurePtr(new List12DisplayName);
|
||||
break;
|
||||
}
|
||||
if (rgbList12)
|
||||
rgbList12->load(record);
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -32,16 +32,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include <Logic/Biff_structures/FrtHeader.h>
|
||||
#include <Logic/Biff_structures/List12BlockLevel.h>
|
||||
#include <Logic/Biff_structures/List12TableStyleClientInfo.h>
|
||||
#include <Logic/Biff_structures/List12DisplayName.h>
|
||||
#include "../Biff_structures/FrtHeader.h"
|
||||
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of List12 record in BIFF8
|
||||
class List12: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(List12)
|
||||
@ -51,19 +47,16 @@ public:
|
||||
~List12();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeList12;
|
||||
static const ElementType type = typeList12;
|
||||
|
||||
FrtHeader frtHeader;
|
||||
_UINT16 lsd;
|
||||
_UINT32 idList;
|
||||
|
||||
List12BlockLevel rgbList12BlockLevel;
|
||||
List12TableStyleClientInfo rgbList12TableStyleClientInfo;
|
||||
List12DisplayName rgbList12DisplayName;
|
||||
BiffStructurePtr rgbList12;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
*/
|
||||
|
||||
#include "MsoDrawing.h"
|
||||
#include "../Biff_structures/ODRAW/OfficeArtRecord.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
@ -78,13 +79,24 @@ void MsoDrawing::readFields()
|
||||
|
||||
void MsoDrawing::readFields(CFRecord& record)
|
||||
{
|
||||
record >> rgChildRec;
|
||||
|
||||
isReading = true;
|
||||
|
||||
if (record.getRdPtr() < record.getDataSize())
|
||||
ODRAW::OfficeArtRecordHeader rh_test;
|
||||
record >> rh_test;
|
||||
record.RollRdPtrBack(8);//sizeof(OfficeArtRecordHeader)
|
||||
|
||||
if (rh_test.recType == 0xF002) //OfficeArtDgContainer
|
||||
{
|
||||
record >> rgChildRec;
|
||||
isReading = true;
|
||||
}
|
||||
else if ((rh_test.recType & 0xF000) == 0xF000)
|
||||
{
|
||||
//074_JKH.OPEN.INFO.PRICE.VO_зПТПДУЛЙЕ ПЛТХЗБ юЕМСВЙОУЛПК ПВМБУФЙ_пбп юЕМСВЙОУЛПЕ БЧЙБРТЕДРТЙСФЙЕ.xls
|
||||
rgChildRec.rh_own.recLen = record.getDataSize();
|
||||
rgChildRec.loadFields(record);
|
||||
isReading = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
int g = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecordSplit.h"
|
||||
#include <Logic/Biff_structures/ODRAW/OfficeArtDgContainer.h>
|
||||
#include "../Biff_structures/ODRAW/OfficeArtDgContainer.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
@ -83,12 +83,9 @@ int Number::serialize(std::wostream & stream)
|
||||
{
|
||||
CP_XML_ATTR(L"s", cell.ixfe - global_info_->cellStyleXfs_count);
|
||||
}
|
||||
if (num.value())
|
||||
CP_XML_NODE(L"v")
|
||||
{
|
||||
CP_XML_NODE(L"v")
|
||||
{
|
||||
CP_XML_STREAM() << STR::double2str(num);
|
||||
}
|
||||
CP_XML_STREAM() << std::to_wstring(num.data.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,14 +32,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include <Logic/Biff_structures/CellOffsetResender.h>
|
||||
#include <Logic/Biff_structures/Cell.h>
|
||||
#include "../Biff_structures/CellOffsetResender.h"
|
||||
#include "../Biff_structures/Cell.h"
|
||||
#include "../Biff_structures/Xnum.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of Number record in BIFF8
|
||||
class Number: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(Number)
|
||||
@ -59,13 +58,11 @@ public:
|
||||
|
||||
const CellRef getLocation() const;
|
||||
|
||||
//-----------------------------
|
||||
GlobalWorkbookInfoPtr global_info_;
|
||||
CellOffsetResender resender;
|
||||
Cell cell;
|
||||
BIFF_DOUBLE num;
|
||||
|
||||
|
||||
Xnum num;
|
||||
//-----------------------------
|
||||
GlobalWorkbookInfoPtr global_info_;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -36,8 +36,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of ObjProtect record in BIFF8
|
||||
class ObjProtect: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(ObjProtect)
|
||||
@ -51,7 +49,7 @@ public:
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeObjProtect;
|
||||
static const ElementType type = typeObjProtect;
|
||||
|
||||
//-----------------------------
|
||||
Boolean<unsigned short> fLockObj;
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
#include "PLV.h"
|
||||
#include <Logic/Biff_structures/FrtHeader.h>
|
||||
#include "../Biff_structures/FrtHeader.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
@ -38,8 +38,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of Pane record in BIFF8
|
||||
class Pane: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(Pane)
|
||||
@ -49,20 +47,18 @@ public:
|
||||
~Pane();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typePane;
|
||||
static const ElementType type = typePane;
|
||||
|
||||
//-----------------------------
|
||||
_UINT16 x;
|
||||
_UINT16 y;
|
||||
_UINT16 rwTop;
|
||||
_UINT16 colLeft;
|
||||
PaneType pnnAcct;
|
||||
|
||||
BIFF_BSTR topLeftCell;
|
||||
std::wstring topLeftCell;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -36,8 +36,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of Password record in BIFF8
|
||||
class Password: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(Password)
|
||||
@ -47,7 +45,6 @@ public:
|
||||
~Password();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
|
||||
@ -36,8 +36,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of Protect record in BIFF8
|
||||
class Protect: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(Protect)
|
||||
|
||||
@ -32,12 +32,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include "../Biff_structures/Xnum.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of RightMargin record in BIFF8
|
||||
class RightMargin: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(RightMargin)
|
||||
@ -48,14 +46,12 @@ public:
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeRightMargin;
|
||||
static const ElementType type = typeRightMargin;
|
||||
|
||||
//-----------------------------
|
||||
BIFF_DOUBLE num;
|
||||
|
||||
Xnum num;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -81,7 +81,7 @@ int SIIndex::serialize(std::wostream & _stream, int idx, const CellRef & in_ref)
|
||||
CP_XML_NODE(L"c:pt")
|
||||
{
|
||||
CP_XML_ATTR(L"idx", idx++);
|
||||
CP_XML_NODE(L"c:v") { CP_XML_STREAM() << number->num; }
|
||||
CP_XML_NODE(L"c:v") { CP_XML_STREAM() << number->num.data.value; }
|
||||
}
|
||||
res = 1;
|
||||
}
|
||||
@ -122,7 +122,7 @@ int SIIndex::serialize(std::wostream & _stream, ChartParsedFormula & in_ref)
|
||||
CP_XML_NODE(L"c:pt")
|
||||
{
|
||||
CP_XML_ATTR(L"idx", idx++);
|
||||
CP_XML_NODE(L"c:v") { CP_XML_STREAM() << number->num; }
|
||||
CP_XML_NODE(L"c:v") { CP_XML_STREAM() << std::to_wstring(number->num.data.value); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ void SXVI::readFields(CFRecord& record)
|
||||
if (cchName > 0 && cchName < 0xFFFF)
|
||||
{
|
||||
stName.setSize(cchName);
|
||||
stName.load(record);
|
||||
record >> stName;
|
||||
|
||||
}
|
||||
}
|
||||
@ -79,6 +79,11 @@ int SXVI::serialize(std::wostream & strm)
|
||||
if (fHideDetail)CP_XML_ATTR(L"sd", 0);
|
||||
if (fFormula) CP_XML_ATTR(L"f", 1);
|
||||
|
||||
if (!stName.value().empty())
|
||||
{
|
||||
CP_XML_ATTR(L"n", stName.value());
|
||||
}
|
||||
|
||||
if (itmType == 0)
|
||||
{
|
||||
CP_XML_ATTR(L"x", iCache);
|
||||
|
||||
@ -44,7 +44,6 @@ ScenarioProtect::~ScenarioProtect()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr ScenarioProtect::clone()
|
||||
{
|
||||
return BaseObjectPtr(new ScenarioProtect(*this));
|
||||
|
||||
@ -36,8 +36,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of ScenarioProtect record in BIFF8
|
||||
class ScenarioProtect: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(ScenarioProtect)
|
||||
@ -48,14 +46,12 @@ public:
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeScenarioProtect;
|
||||
|
||||
//-----------------------------
|
||||
Boolean<unsigned short> fScenProtect;
|
||||
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -84,14 +84,14 @@ int Selection::serialize(std::wostream & stream)
|
||||
// default: CP_XML_ATTR(L"pane", L"topLeft");
|
||||
}
|
||||
|
||||
if (*activeCell.value() != L"A1")
|
||||
CP_XML_ATTR(L"activeCell", *activeCell.value());
|
||||
if (activeCell != L"A1")
|
||||
CP_XML_ATTR(L"activeCell", activeCell);
|
||||
|
||||
if (irefAct != 0)
|
||||
CP_XML_ATTR(L"activeCellId", irefAct);
|
||||
|
||||
if (*sqref.value() != L"A1")
|
||||
CP_XML_ATTR(L"sqref", *sqref.value());
|
||||
if (sqref != L"A1")
|
||||
CP_XML_ATTR(L"sqref", sqref);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
@ -38,8 +38,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of Selection record in BIFF8
|
||||
class Selection: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(Selection)
|
||||
@ -49,7 +47,6 @@ public:
|
||||
~Selection();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
@ -57,15 +54,14 @@ public:
|
||||
|
||||
int serialize(std::wostream & stream);
|
||||
|
||||
//-----------------------------
|
||||
PaneType pnn;
|
||||
|
||||
R_RwU rwAct;
|
||||
ColU colAct;
|
||||
_INT16 irefAct;
|
||||
R_RwU rwAct;
|
||||
ColU colAct;
|
||||
_INT16 irefAct;
|
||||
|
||||
BIFF_BSTR sqref;
|
||||
BIFF_BSTR activeCell;
|
||||
std::wstring sqref;
|
||||
std::wstring activeCell;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -32,12 +32,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include "../Biff_structures/Xnum.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of SerAuxErrBar record in BIFF8
|
||||
class SerAuxErrBar: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(SerAuxErrBar)
|
||||
@ -57,7 +56,7 @@ public:
|
||||
unsigned char sertm;
|
||||
unsigned char ebsrc;
|
||||
unsigned char fTeeTop;
|
||||
BIFF_DOUBLE numValue;
|
||||
Xnum numValue;
|
||||
_UINT16 cnum;
|
||||
|
||||
};
|
||||
|
||||
@ -32,13 +32,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include <Logic/Biff_structures/ChartNumNillable.h>
|
||||
#include "../Biff_structures/ChartNumNillable.h"
|
||||
#include "../Biff_structures/Xnum.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of SerAuxTrend record in BIFF8
|
||||
class SerAuxTrend: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(SerAuxTrend)
|
||||
@ -48,20 +47,19 @@ public:
|
||||
~SerAuxTrend();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSerAuxTrend;
|
||||
|
||||
//-----------------------------
|
||||
unsigned char regt;
|
||||
unsigned char ordUser;
|
||||
ChartNumNillable numIntercept;
|
||||
unsigned char fEquation;
|
||||
unsigned char fRSquared;
|
||||
BIFF_DOUBLE numForecast;
|
||||
BIFF_DOUBLE numBackcast;
|
||||
unsigned char regt;
|
||||
unsigned char ordUser;
|
||||
ChartNumNillable numIntercept;
|
||||
unsigned char fEquation;
|
||||
unsigned char fRSquared;
|
||||
Xnum numForecast;
|
||||
Xnum numBackcast;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -32,12 +32,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include "../Biff_structures/Xnum.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of Setup record in BIFF8
|
||||
class Setup: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(Setup)
|
||||
@ -73,8 +72,8 @@ public:
|
||||
|
||||
_UINT16 iRes;
|
||||
_UINT16 iVRes;
|
||||
BIFF_DOUBLE numHdr;
|
||||
BIFF_DOUBLE numFtr;
|
||||
Xnum numHdr;
|
||||
Xnum numFtr;
|
||||
_UINT16 iCopies;
|
||||
|
||||
};
|
||||
|
||||
@ -58,8 +58,8 @@ public:
|
||||
bool fAltMethod;
|
||||
unsigned char sfp;
|
||||
|
||||
BIFF_DWORD cconditions;
|
||||
BIFF_DWORD idParent;
|
||||
_UINT32 cconditions;
|
||||
_UINT32 idParent;
|
||||
|
||||
BiffStructurePtrVector sortCond12Array;
|
||||
FrtHeader frtHeader;
|
||||
|
||||
@ -37,8 +37,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of Table record in BIFF8
|
||||
class Table: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(Table)
|
||||
@ -54,7 +52,6 @@ public:
|
||||
|
||||
static const ElementType type = typeTable;
|
||||
|
||||
//-----------------------------
|
||||
Ref ref_;
|
||||
|
||||
bool fAlwaysCalc;
|
||||
@ -63,8 +60,8 @@ public:
|
||||
bool fDeleted1;
|
||||
bool fDeleted2;
|
||||
|
||||
BIFF_BSTR r1;
|
||||
BIFF_BSTR r2;
|
||||
std::wstring r1;
|
||||
std::wstring r2;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -31,8 +31,7 @@
|
||||
*/
|
||||
|
||||
#include "Theme.h"
|
||||
#include <fstream>
|
||||
#include <iostream> // endl
|
||||
#include "../../../DesktopEditor/common/File.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
@ -59,13 +58,15 @@ void Theme::readFields(CFRecord& record)
|
||||
{
|
||||
//default theme
|
||||
}
|
||||
else if (dwThemeVersion == 0)
|
||||
//else if (dwThemeVersion == 0)
|
||||
else
|
||||
{
|
||||
nThemeDataSize = record.getDataSize() - record.getRdPtr();
|
||||
pThemeData = boost::shared_array<char>(new char[nThemeDataSize]);
|
||||
|
||||
memcpy(pThemeData.get(), record.getCurData<char>(), nThemeDataSize);
|
||||
record.skipNunBytes(nThemeDataSize);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -32,12 +32,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include "../Biff_structures/Xnum.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of TopMargin record in BIFF8
|
||||
class TopMargin: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(TopMargin)
|
||||
@ -50,10 +49,10 @@ public:
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeTopMargin;
|
||||
static const ElementType type = typeTopMargin;
|
||||
|
||||
//-----------------------------
|
||||
BIFF_DOUBLE num;
|
||||
Xnum num;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
|
||||
#include "TxO.h"
|
||||
|
||||
#include <Logic/Biff_records/Font.h>
|
||||
#include "Font.h"
|
||||
|
||||
#include <utils.h>
|
||||
|
||||
@ -184,9 +184,9 @@ int TxO::serialize_vml (std::wostream & _stream)
|
||||
{
|
||||
iFmt = run->formatRun.ifnt;
|
||||
Font *font = NULL;
|
||||
if ((global_info->m_arFonts) && (iFmt >=0 && iFmt < global_info->m_arFonts->size()))
|
||||
if (iFmt >= 0 && iFmt < global_info->m_arFonts.size())
|
||||
{
|
||||
font = dynamic_cast<Font *>(global_info->m_arFonts->at(iFmt).get());
|
||||
font = dynamic_cast<Font *>(global_info->m_arFonts[iFmt].get());
|
||||
}
|
||||
if (font)
|
||||
{
|
||||
@ -281,12 +281,11 @@ int TxO::serialize (std::wostream & _stream)
|
||||
int TxO::serialize_rPr (std::wostream & _stream, int iFmt, std::wstring namespace_)
|
||||
{
|
||||
if (!global_info) return 0;
|
||||
if (!global_info->m_arFonts) return 0;
|
||||
|
||||
int sz = global_info->m_arFonts->size();
|
||||
int sz = global_info->m_arFonts.size();
|
||||
if (iFmt - 1 >= sz || iFmt < 1) return 0;
|
||||
|
||||
Font * font = dynamic_cast<Font*>(global_info->m_arFonts->at(iFmt-1).get());
|
||||
Font * font = dynamic_cast<Font*>(global_info->m_arFonts[iFmt-1].get());
|
||||
|
||||
if (!font) return 0;
|
||||
|
||||
|
||||
@ -58,10 +58,10 @@ public:
|
||||
_UINT16 tabId;
|
||||
std::wstring guid;
|
||||
|
||||
BIFF_DWORD x;
|
||||
BIFF_DWORD y;
|
||||
BIFF_DWORD dx;
|
||||
BIFF_DWORD dy;
|
||||
_UINT32 x;
|
||||
_UINT32 y;
|
||||
_UINT32 dx;
|
||||
_UINT32 dy;
|
||||
|
||||
_UINT16 wTabRatio;
|
||||
|
||||
|
||||
@ -46,7 +46,6 @@ UserSViewBegin::~UserSViewBegin()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr UserSViewBegin::clone()
|
||||
{
|
||||
return BaseObjectPtr(new UserSViewBegin(*this));
|
||||
|
||||
@ -32,13 +32,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include <Logic/Biff_structures/PaneType.h>
|
||||
#include "../Biff_structures/PaneType.h"
|
||||
#include "../Biff_structures/Xnum.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of UserSViewBegin record in BIFF8
|
||||
class UserSViewBegin: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(UserSViewBegin)
|
||||
@ -56,7 +55,7 @@ public:
|
||||
//-----------------------------
|
||||
std::wstring guid;
|
||||
TabId iTabid;
|
||||
BIFF_DWORD wScale;
|
||||
_UINT32 wScale;
|
||||
Icv icvHdr;
|
||||
PaneType pnnSel;
|
||||
|
||||
@ -88,8 +87,8 @@ public:
|
||||
bool fRuler;
|
||||
|
||||
std::wstring ref8TopLeft;
|
||||
BIFF_DOUBLE operNumX;
|
||||
BIFF_DOUBLE operNumY;
|
||||
Xnum operNumX;
|
||||
Xnum operNumY;
|
||||
|
||||
ForwardOnlyParam<unsigned short> colRPane;
|
||||
ForwardOnlyParam<unsigned short> rwBPane;
|
||||
|
||||
@ -32,12 +32,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include "../Biff_structures/Xnum.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of ValueRange record in BIFF8
|
||||
class ValueRange: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(ValueRange)
|
||||
@ -53,11 +52,11 @@ public:
|
||||
static const ElementType type = typeValueRange;
|
||||
|
||||
//-----------------------------
|
||||
BIFF_DOUBLE numMin;
|
||||
BIFF_DOUBLE numMax;
|
||||
BIFF_DOUBLE numMajor;
|
||||
BIFF_DOUBLE numMinor;
|
||||
BIFF_DOUBLE numCross;
|
||||
Xnum numMin;
|
||||
Xnum numMax;
|
||||
Xnum numMajor;
|
||||
Xnum numMinor;
|
||||
Xnum numCross;
|
||||
|
||||
bool fAutoMin;
|
||||
bool fAutoMax;
|
||||
|
||||
@ -37,8 +37,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of Window2 record in BIFF8
|
||||
class Window2: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(Window2)
|
||||
@ -53,7 +51,6 @@ public:
|
||||
|
||||
static const ElementType type = typeWindow2;
|
||||
|
||||
//-----------------------------
|
||||
bool fDspFmlaRt;
|
||||
bool fDspGridRt;
|
||||
bool fDspRwColRt;
|
||||
@ -76,7 +73,7 @@ public:
|
||||
|
||||
_UINT16 wScaleSLV;
|
||||
_UINT16 wScaleNormal;
|
||||
BIFF_BSTR topLeftCell;
|
||||
std::wstring topLeftCell;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -35,11 +35,10 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
XF::XF(size_t& cell_xf_current_id, size_t& style_xf_current_id)
|
||||
: cell(cell_xf_current_id, style_xf_current_id),
|
||||
style(cell_xf_current_id, style_xf_current_id),
|
||||
ixfParent(0)
|
||||
XF::XF(size_t& cell_xf_current_id, size_t& style_xf_current_id) : cell (cell_xf_current_id, style_xf_current_id),
|
||||
style(cell_xf_current_id, style_xf_current_id)
|
||||
{
|
||||
ixfParent = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -32,15 +32,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include <Logic/Biff_structures/FontIndex.h>
|
||||
#include <Logic/Biff_structures/CellXF.h>
|
||||
#include <Logic/Biff_structures/StyleXF.h>
|
||||
#include "../Biff_structures/FontIndex.h"
|
||||
#include "../Biff_structures/CellXF.h"
|
||||
#include "../Biff_structures/StyleXF.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of XF record in BIFF8
|
||||
class XF: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(XF)
|
||||
|
||||
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* (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 "AF12CellIcon.h"
|
||||
#include <Binary/CFRecord.h>
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
BiffStructurePtr AF12CellIcon::clone()
|
||||
{
|
||||
return BiffStructurePtr(new AF12CellIcon(*this));
|
||||
}
|
||||
|
||||
AF12CellIcon::AF12CellIcon()
|
||||
{
|
||||
}
|
||||
AF12CellIcon::~AF12CellIcon()
|
||||
{
|
||||
}
|
||||
void AF12CellIcon::load(CFRecord& record)
|
||||
{
|
||||
record >> iIconSet >> iIcon;
|
||||
}
|
||||
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -0,0 +1,58 @@
|
||||
/*
|
||||
* (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 "BiffStructure.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
class AF12CellIcon: public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(AF12CellIcon)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
AF12CellIcon();
|
||||
~AF12CellIcon();
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeAF12CellIcon;
|
||||
|
||||
_UINT32 iIconSet;
|
||||
_UINT32 iIcon;
|
||||
};
|
||||
|
||||
typedef boost::shared_ptr<AF12CellIcon> AF12CellIconPtr;
|
||||
|
||||
} // namespace XLS
|
||||
@ -56,7 +56,7 @@ void AF12Criteria::load(CFRecord& record)
|
||||
doper.m_bAutoFilter = false;
|
||||
record >> doper;
|
||||
|
||||
if (doper.vt == BIFF_BYTE(0x06))
|
||||
if (doper.vt == 0x06)
|
||||
{
|
||||
unsigned char _cch = doper.vtValueStr.cch;
|
||||
|
||||
|
||||
@ -31,8 +31,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <Logic/Biff_records/BiffRecord.h>
|
||||
#include <Logic/Biff_structures/BiffString.h>
|
||||
#include "BiffString.h"
|
||||
#include "AFDOper.h"
|
||||
|
||||
namespace XLS
|
||||
@ -49,8 +48,7 @@ public:
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
|
||||
static const ElementType type = typeAF12Criteria;
|
||||
static const ElementType type = typeAF12Criteria;
|
||||
|
||||
AFDOper doper;
|
||||
XLUnicodeStringNoCch str;
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <Logic/Biff_records/BiffRecord.h>
|
||||
#include <Logic/Biff_structures/BiffString.h>
|
||||
#include "BiffString.h"
|
||||
|
||||
#include "AFDOperStr.h"
|
||||
#include "AFDOperRk.h"
|
||||
@ -54,7 +54,6 @@ public:
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
|
||||
static const ElementType type = typeAFDOper;
|
||||
|
||||
unsigned char vt;
|
||||
|
||||
@ -52,7 +52,6 @@ public:
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
|
||||
unsigned char cch;
|
||||
unsigned char fCompare;
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ class CFRecord;
|
||||
|
||||
class ArrayParsedFormula : public ParsedFormula
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(ArrayParsedFormula)
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(ArrayParsedFormula)
|
||||
public:
|
||||
ArrayParsedFormula(const bool is_part_of_a_revision, const CellRef& cell_base_ref);
|
||||
BiffStructurePtr clone();
|
||||
|
||||
@ -78,10 +78,6 @@ typedef unsigned char FillPattern;
|
||||
typedef BiffAttributeSimple<unsigned char> BIFF_BYTE;
|
||||
typedef BiffAttributeSimple<_UINT16> BIFF_WORD;
|
||||
typedef BiffAttributeSimple<_UINT32> BIFF_DWORD;
|
||||
typedef BiffAttributeSimple<_INT32> BIFF_LONG;
|
||||
typedef BiffAttributeSimple<double> BIFF_DOUBLE;
|
||||
typedef BiffAttributeSimple<std::wstring> BIFF_BSTR;
|
||||
|
||||
|
||||
struct PtgAttrSpaceType : public BiffStructure_NoVtbl
|
||||
{
|
||||
@ -259,22 +255,6 @@ public:
|
||||
unsigned char ifmt;
|
||||
};
|
||||
|
||||
|
||||
class SharedFeatureType : public BiffAttributeSimple<_UINT16>
|
||||
{
|
||||
public:
|
||||
|
||||
enum
|
||||
{
|
||||
ISFPROTECTION = 0x0002, // Specifies the enhanced protection type.
|
||||
ISFFEC2 = 0x0003, // Specifies the ignored formula errors type.
|
||||
ISFFACTOID = 0x0004, // Specifies the smart tag type.
|
||||
ISFLIST = 0x0005, // Specifies the list type.
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
struct FFErrorCheck : public BiffStructure_NoVtbl
|
||||
{
|
||||
unsigned int ffecCalcError : 1;
|
||||
|
||||
@ -38,13 +38,12 @@ namespace XLS
|
||||
|
||||
struct FillInfoExt
|
||||
{
|
||||
FillInfoExt() {enabled = false; xclrType = icv = 0; nTintShade = 0; xclrValue = 0;}
|
||||
bool enabled;
|
||||
bool enabled =false;
|
||||
|
||||
unsigned char xclrType;
|
||||
unsigned char icv;
|
||||
short nTintShade;
|
||||
unsigned int xclrValue;
|
||||
unsigned char xclrType = 0;
|
||||
unsigned char icv = 0;
|
||||
short nTintShade = 0;
|
||||
unsigned int xclrValue = 0;
|
||||
};
|
||||
|
||||
struct FillInfo
|
||||
@ -56,9 +55,9 @@ struct FillInfo
|
||||
{
|
||||
}
|
||||
|
||||
unsigned char fls;
|
||||
unsigned char icvFore;
|
||||
unsigned char icvBack;
|
||||
unsigned char fls = 0;
|
||||
unsigned char icvFore = 0;
|
||||
unsigned char icvBack = 0;
|
||||
|
||||
bool operator < (const FillInfo& right) const
|
||||
{
|
||||
@ -84,17 +83,17 @@ struct FillInfo
|
||||
|
||||
struct BorderInfo
|
||||
{
|
||||
unsigned char dgLeft;
|
||||
unsigned char dgRight;
|
||||
unsigned char dgTop;
|
||||
unsigned char dgBottom;
|
||||
unsigned char dgDiag;
|
||||
unsigned char grbitDiag;
|
||||
unsigned char icvLeft;
|
||||
unsigned char icvRight;
|
||||
unsigned char icvTop;
|
||||
unsigned char icvBottom;
|
||||
unsigned char icvDiag;
|
||||
unsigned char dgLeft = 0;
|
||||
unsigned char dgRight = 0;
|
||||
unsigned char dgTop = 0;
|
||||
unsigned char dgBottom = 0;
|
||||
unsigned char dgDiag = 0;
|
||||
unsigned char grbitDiag = 0;
|
||||
unsigned char icvLeft = 0;
|
||||
unsigned char icvRight = 0;
|
||||
unsigned char icvTop = 0;
|
||||
unsigned char icvBottom = 0;
|
||||
unsigned char icvDiag = 0;
|
||||
|
||||
FillInfoExt leftFillInfo_;
|
||||
FillInfoExt rightFillInfo_;
|
||||
|
||||
@ -50,7 +50,6 @@ public:
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
|
||||
unsigned short icf;
|
||||
unsigned char cp;
|
||||
unsigned char icfTemplate;
|
||||
|
||||
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* (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 "CachedDiskHeader.h"
|
||||
#include <Binary/CFRecord.h>
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
BiffStructurePtr CachedDiskHeader::clone()
|
||||
{
|
||||
return BiffStructurePtr(new CachedDiskHeader(*this));
|
||||
}
|
||||
|
||||
void CachedDiskHeader::load(CFRecord& record)
|
||||
{
|
||||
record >> cbdxfHdrDisk;
|
||||
|
||||
if (cbdxfHdrDisk > 0)
|
||||
{
|
||||
rgHdrDisk.size = cbdxfHdrDisk;
|
||||
rgHdrDisk.load(record);
|
||||
}
|
||||
record >> strStyleName;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -0,0 +1,60 @@
|
||||
/*
|
||||
* (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 "BiffString.h"
|
||||
#include "DXFN12List.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
class CFRecord;
|
||||
|
||||
class CachedDiskHeader : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(CachedDiskHeader)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
static const ElementType type = typeCachedDiskHeader;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
_UINT32 cbdxfHdrDisk;
|
||||
DXFN12List rgHdrDisk;
|
||||
XLUnicodeString strStyleName;
|
||||
};
|
||||
|
||||
typedef boost::shared_ptr<CachedDiskHeader> CachedDiskHeaderPtr;
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -38,10 +38,11 @@ namespace XLS
|
||||
{
|
||||
|
||||
|
||||
CellXF::CellXF(size_t& cell_xf_current_id, size_t& style_xf_current_id)
|
||||
: cell_xf_current_id_(cell_xf_current_id), style_xf_current_id_(style_xf_current_id), font_id(0xFFFF)
|
||||
CellXF::CellXF(size_t& cell_xf_current_id, size_t& style_xf_current_id) : cell_xf_current_id_(cell_xf_current_id),
|
||||
style_xf_current_id_(style_xf_current_id)
|
||||
{
|
||||
alc = alcV = 0;
|
||||
font_id = 0xFFFF;
|
||||
}
|
||||
|
||||
|
||||
@ -152,6 +153,91 @@ void CellXF::load(CFRecord& record)
|
||||
}
|
||||
}
|
||||
|
||||
void CellXF::Update(ExtProp* ext_prop)
|
||||
{
|
||||
if (!ext_prop) return;
|
||||
|
||||
switch(ext_prop->extType)
|
||||
{
|
||||
case 0x0004:
|
||||
{
|
||||
fill.foreFillInfo_.enabled = true;
|
||||
fill.foreFillInfo_.icv = ext_prop->extPropData.color.icv;
|
||||
fill.foreFillInfo_.xclrType = ext_prop->extPropData.color.xclrType;
|
||||
fill.foreFillInfo_.nTintShade = ext_prop->extPropData.color.nTintShade;
|
||||
fill.foreFillInfo_.xclrValue = ext_prop->extPropData.color.xclrValue;
|
||||
}break;
|
||||
case 0x0005:
|
||||
{
|
||||
fill.backFillInfo_.enabled = true;
|
||||
fill.backFillInfo_.icv = ext_prop->extPropData.color.icv;
|
||||
fill.backFillInfo_.xclrType = ext_prop->extPropData.color.xclrType;
|
||||
fill.backFillInfo_.nTintShade = ext_prop->extPropData.color.nTintShade;
|
||||
fill.backFillInfo_.xclrValue = ext_prop->extPropData.color.xclrValue;
|
||||
}break;
|
||||
case 0x0007:
|
||||
{
|
||||
border.topFillInfo_.enabled = true;
|
||||
border.topFillInfo_.icv = ext_prop->extPropData.color.icv;
|
||||
border.topFillInfo_.xclrType = ext_prop->extPropData.color.xclrType;
|
||||
border.topFillInfo_.nTintShade = ext_prop->extPropData.color.nTintShade;
|
||||
border.topFillInfo_.xclrValue = ext_prop->extPropData.color.xclrValue;
|
||||
}break;
|
||||
case 0x0008:
|
||||
{
|
||||
border.bottomFillInfo_.enabled = true;
|
||||
border.bottomFillInfo_.icv = ext_prop->extPropData.color.icv;
|
||||
border.bottomFillInfo_.xclrType = ext_prop->extPropData.color.xclrType;
|
||||
border.bottomFillInfo_.nTintShade = ext_prop->extPropData.color.nTintShade;
|
||||
border.bottomFillInfo_.xclrValue = ext_prop->extPropData.color.xclrValue;
|
||||
}break;
|
||||
case 0x0009:
|
||||
{
|
||||
border.leftFillInfo_.enabled = true;
|
||||
border.leftFillInfo_.icv = ext_prop->extPropData.color.icv;
|
||||
border.leftFillInfo_.xclrType = ext_prop->extPropData.color.xclrType;
|
||||
border.leftFillInfo_.nTintShade = ext_prop->extPropData.color.nTintShade;
|
||||
border.leftFillInfo_.xclrValue = ext_prop->extPropData.color.xclrValue;
|
||||
}break;
|
||||
case 0x000A:
|
||||
{
|
||||
border.rightFillInfo_.enabled = true;
|
||||
border.rightFillInfo_.icv = ext_prop->extPropData.color.icv;
|
||||
border.rightFillInfo_.xclrType = ext_prop->extPropData.color.xclrType;
|
||||
border.rightFillInfo_.nTintShade = ext_prop->extPropData.color.nTintShade;
|
||||
border.rightFillInfo_.xclrValue = ext_prop->extPropData.color.xclrValue;
|
||||
}break;
|
||||
//case 0x000B: //diag color
|
||||
//case 0x000C: //diag color
|
||||
case 0x000D:
|
||||
{
|
||||
font_color.enabled = true;
|
||||
font_color.icv = ext_prop->extPropData.color.icv;
|
||||
font_color.xclrType = ext_prop->extPropData.color.xclrType;
|
||||
font_color.nTintShade = ext_prop->extPropData.color.nTintShade;
|
||||
font_color.xclrValue = ext_prop->extPropData.color.xclrValue;
|
||||
}break;
|
||||
//case 0x0006:
|
||||
// extPropData.gradient_fill.toXML(own_tag);
|
||||
// break;
|
||||
case 0x000E:
|
||||
{
|
||||
font_id = ext_prop->extPropData.font_scheme;
|
||||
}break;
|
||||
case 0x000F:
|
||||
{
|
||||
cIndent = ext_prop->extPropData.indent_level;
|
||||
}break;
|
||||
}
|
||||
}
|
||||
void CellXF::Update(XFProps* xfProps)
|
||||
{
|
||||
if (!xfProps) return;
|
||||
//
|
||||
// std::wstringstream strm;
|
||||
// xfProps->serialize_fill(strm);
|
||||
// fill.ext = strm.str();
|
||||
}
|
||||
void CellXF::RegisterFillBorder()
|
||||
{
|
||||
for (size_t i = 0; i < ext_props.size(); i++ )
|
||||
@ -231,6 +317,8 @@ void CellXF::RegisterFillBorder()
|
||||
|
||||
border_x_id = m_GlobalWorkbookInfo->RegisterBorderId(border);
|
||||
fill_x_id = m_GlobalWorkbookInfo->RegisterFillId(fill);
|
||||
|
||||
m_GlobalWorkbookInfo->RegisterFontColorId(font_id, font_color);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -36,6 +36,8 @@
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
class XFProps;
|
||||
class ExtProp;
|
||||
|
||||
class CFRecord;
|
||||
class GlobalWorkbookInfo;
|
||||
@ -74,19 +76,23 @@ public:
|
||||
BorderInfo border;
|
||||
FillInfo fill;
|
||||
|
||||
BiffStructurePtrVector ext_props;
|
||||
|
||||
FillInfoExt font_color;
|
||||
size_t font_id;
|
||||
|
||||
bool fHasXFExt;
|
||||
bool fsxButton;
|
||||
//------------------------------------------------------------------
|
||||
BiffStructurePtrVector ext_props;
|
||||
BiffStructurePtrVector xf_props;
|
||||
|
||||
size_t border_x_id;
|
||||
size_t fill_x_id;
|
||||
|
||||
size_t& cell_xf_current_id_;
|
||||
size_t& style_xf_current_id_;
|
||||
|
||||
void Update(ExtProp* extProp); // xls style
|
||||
void Update(XFProps* xfProps); //xlsx style
|
||||
|
||||
void RegisterFillBorder();
|
||||
};
|
||||
|
||||
@ -47,10 +47,10 @@ void ControlInfo::load(CFRecord& record)
|
||||
unsigned short flags;
|
||||
record >> flags;
|
||||
|
||||
fDefault = GETBIT(flags, 0);
|
||||
fHelp = GETBIT(flags, 1);
|
||||
fCancel = GETBIT(flags, 2);
|
||||
fDismiss = GETBIT(flags, 3);
|
||||
fDefault = GETBIT(flags, 0);
|
||||
fHelp = GETBIT(flags, 1);
|
||||
fCancel = GETBIT(flags, 2);
|
||||
fDismiss = GETBIT(flags, 3);
|
||||
|
||||
record >> accel1;
|
||||
record.skipNunBytes(2); // reserved2
|
||||
|
||||
@ -46,11 +46,12 @@ public:
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
unsigned char fDefault;
|
||||
unsigned char fHelp;
|
||||
unsigned char fCancel;
|
||||
unsigned char fDismiss;
|
||||
_UINT16 accel1;
|
||||
bool fDefault;
|
||||
bool fHelp;
|
||||
bool fCancel;
|
||||
bool fDismiss;
|
||||
|
||||
_UINT16 accel1;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -53,11 +53,10 @@ class DXFN : public BiffStructure
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
static const ElementType type = typeDXFN;
|
||||
static const ElementType type = typeDXFN;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
|
||||
int serialize(std::wostream & stream);
|
||||
|
||||
bool alchNinch;
|
||||
|
||||
@ -44,6 +44,8 @@ BiffStructurePtr DXFN12List::clone()
|
||||
|
||||
DXFN12List::DXFN12List()
|
||||
{
|
||||
bExist = false;
|
||||
size = 0xffffffff;
|
||||
}
|
||||
|
||||
|
||||
@ -53,8 +55,21 @@ DXFN12List::~DXFN12List()
|
||||
|
||||
void DXFN12List::load(CFRecord& record)
|
||||
{
|
||||
record >> dxfn;
|
||||
record >> xfext;
|
||||
size_t pos_record = record.getRdPtr();
|
||||
|
||||
if (size == 0xffffffff) size = record.getDataSize() - pos_record;
|
||||
|
||||
if (size > 0)
|
||||
{
|
||||
bExist = true;
|
||||
record >> dxfn;
|
||||
size -= (record.getRdPtr() - pos_record);
|
||||
}
|
||||
if (size > 0)
|
||||
{
|
||||
record >> xfext;
|
||||
size -= (record.getRdPtr() - pos_record);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user