mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-03-03 01:01:53 +08:00
Compare commits
4 Commits
v4.5.dev.5
...
core-win-3
| Author | SHA1 | Date | |
|---|---|---|---|
| a88ad0c279 | |||
| cf5458c761 | |||
| 9115edbd78 | |||
| 3f18f96171 |
@ -68,12 +68,12 @@ namespace DocFileFormat
|
||||
int cp = m_document->FIB->m_RgLw97.ccpText + m_document->FIB->m_RgLw97.ccpFtn + m_document->FIB->m_RgLw97.ccpHdr;
|
||||
|
||||
size_t count = m_document->AnnotationsReferencePlex->Elements.size();
|
||||
for (unsigned int i = 0; i < count; ++i)
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
{
|
||||
AnnotationReferenceDescriptor* atrdPre10 = static_cast<AnnotationReferenceDescriptor*>(m_document->AnnotationsReferencePlex->Elements[index]);
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:comment", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString( index ));
|
||||
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString( index + 1 ));
|
||||
m_pXmlWriter->WriteAttribute( L"w:author",
|
||||
FormatUtils::XmlEncode(m_document->AnnotationOwners->at( atrdPre10->GetAuthorIndex() ) ));
|
||||
m_pXmlWriter->WriteAttribute( L"w:initials", atrdPre10->GetUserInitials());
|
||||
|
||||
@ -290,17 +290,15 @@ namespace DocFileFormat
|
||||
std::vector<wchar_t>* chpxChars = m_document->GetChars(fcChpxStart, fcChpxEnd, cp);
|
||||
|
||||
//search for bookmarks in the chars
|
||||
std::vector<int> bookmarks = searchBookmarks(chpxChars, cp);
|
||||
|
||||
//if there are bookmarks in this run, split the run into several runs
|
||||
if (!bookmarks.empty())
|
||||
std::vector<int> annot = searchAnnot(chpxChars, cp);
|
||||
if (!annot.empty())
|
||||
{
|
||||
std::list<std::vector<wchar_t>>* runs = splitCharList(chpxChars, &bookmarks);
|
||||
std::list<std::vector<wchar_t>>* runs = splitCharList(chpxChars, &annot);
|
||||
if (runs)
|
||||
{
|
||||
for (std::list<std::vector<wchar_t> >::iterator iter = runs->begin(); iter != runs->end(); ++iter)
|
||||
{
|
||||
if (writeBookmarks(cp))
|
||||
if (writeAnnotations(cp))
|
||||
{
|
||||
cp = writeRun(&(*iter), *cpeIter, cp);
|
||||
}
|
||||
@ -311,7 +309,30 @@ namespace DocFileFormat
|
||||
}
|
||||
else
|
||||
{
|
||||
cp = writeRun(chpxChars, *cpeIter, cp);
|
||||
//search for bookmarks in the chars
|
||||
std::vector<int> bookmarks = searchBookmarks(chpxChars, cp);
|
||||
|
||||
//if there are bookmarks in this run, split the run into several runs
|
||||
if (!bookmarks.empty())
|
||||
{
|
||||
std::list<std::vector<wchar_t>>* runs = splitCharList(chpxChars, &bookmarks);
|
||||
if (runs)
|
||||
{
|
||||
for (std::list<std::vector<wchar_t> >::iterator iter = runs->begin(); iter != runs->end(); ++iter)
|
||||
{
|
||||
if (writeBookmarks(cp))
|
||||
{
|
||||
cp = writeRun(&(*iter), *cpeIter, cp);
|
||||
}
|
||||
}
|
||||
|
||||
RELEASEOBJECT(runs);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cp = writeRun(chpxChars, *cpeIter, cp);
|
||||
}
|
||||
}
|
||||
|
||||
RELEASEOBJECT(chpxChars);
|
||||
@ -948,19 +969,17 @@ namespace DocFileFormat
|
||||
}
|
||||
else if (TextMark::AnnotationReference == code)
|
||||
{
|
||||
if (typeid(*this) != typeid(CommentsMapping))
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:commentReference", true );
|
||||
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString( _commentNr ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true );
|
||||
}
|
||||
else
|
||||
if (typeid(*this) == typeid(CommentsMapping))
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:annotationRef", true );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:commentReference", true );
|
||||
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString( _commentNr ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true );
|
||||
}
|
||||
|
||||
_commentNr++;
|
||||
}
|
||||
else if (!FormatUtils::IsControlSymbol(c) && ((int)c != 0xFFFF))
|
||||
{
|
||||
@ -1042,6 +1061,30 @@ namespace DocFileFormat
|
||||
|
||||
return ret;
|
||||
}
|
||||
// Searches for bookmarks in the list of characters.
|
||||
std::vector<int> DocumentMapping::searchAnnot(std::vector<wchar_t>* chars, int initialCp)
|
||||
{
|
||||
std::vector<int> ret;
|
||||
|
||||
if (m_document->AnnotStartPlex->IsValid())
|
||||
{
|
||||
int cp = initialCp;
|
||||
|
||||
size_t count = chars->size();
|
||||
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
{
|
||||
if ((m_document->AnnotStartPlex->IsCpExists(cp)) || (m_document->AnnotEndPlex->IsCpExists(cp)))
|
||||
{
|
||||
ret.push_back(i);
|
||||
}
|
||||
|
||||
++cp;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
ParagraphPropertyExceptions* DocumentMapping::findValidPapx(int fc)
|
||||
{
|
||||
@ -1540,7 +1583,6 @@ namespace DocFileFormat
|
||||
return cpCellEnd;
|
||||
}
|
||||
|
||||
//
|
||||
bool DocumentMapping::writeBookmarks(int cp)
|
||||
{
|
||||
bool result = true;
|
||||
@ -1561,7 +1603,27 @@ namespace DocFileFormat
|
||||
|
||||
return result;
|
||||
}
|
||||
bool DocumentMapping::writeAnnotations(int cp)
|
||||
{
|
||||
bool result = true;
|
||||
|
||||
for (size_t i = 0; i < m_document->AnnotStartEndCPs.size(); i++)
|
||||
{
|
||||
if (m_document->AnnotStartEndCPs[i].first == cp)
|
||||
{
|
||||
result = writeAnnotationStart(i + 1);
|
||||
_commentNr = i + 1;
|
||||
}
|
||||
|
||||
if (m_document->AnnotStartEndCPs[i].second == cp)
|
||||
{
|
||||
result = writeAnnotationEnd(i + 1);
|
||||
_commentNr = i + 1;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
bool DocumentMapping::writeBookmarkStart(short id)
|
||||
{
|
||||
// write bookmark start
|
||||
@ -1585,8 +1647,6 @@ namespace DocFileFormat
|
||||
|
||||
bool DocumentMapping::writeBookmarkEnd(short id)
|
||||
{
|
||||
// write bookmark end
|
||||
|
||||
WideString* bookmarkName = static_cast<WideString*>( m_document->BookmarkNames->operator [] ( id ) );
|
||||
|
||||
if ( ( bookmarkName != NULL ) && ( *bookmarkName != L"_PictureBullets" ) )
|
||||
@ -1602,7 +1662,27 @@ namespace DocFileFormat
|
||||
|
||||
return false;
|
||||
}
|
||||
bool DocumentMapping::writeAnnotationStart(short id)
|
||||
{
|
||||
XMLTools::XMLElement bookmarkElem(L"w:commentRangeStart");
|
||||
|
||||
bookmarkElem.AppendAttribute(L"w:id", FormatUtils::IntToWideString(id));
|
||||
|
||||
m_pXmlWriter->WriteString(bookmarkElem.GetXMLString());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DocumentMapping::writeAnnotationEnd(short id)
|
||||
{
|
||||
XMLTools::XMLElement bookmarkElem( L"w:commentRangeEnd" );
|
||||
|
||||
bookmarkElem.AppendAttribute( L"w:id", FormatUtils::IntToWideString( id ));
|
||||
|
||||
m_pXmlWriter->WriteString( bookmarkElem.GetXMLString());
|
||||
|
||||
return true;
|
||||
}
|
||||
// Checks if the CHPX is special
|
||||
bool DocumentMapping::isSpecial(CharacterPropertyExceptions* chpx)
|
||||
{
|
||||
|
||||
@ -99,8 +99,9 @@ namespace DocFileFormat
|
||||
void writeTextStart ( const std::wstring& textType, bool preserve_space);
|
||||
void writeTextEnd ( const std::wstring& textType );
|
||||
|
||||
// Searches for bookmarks in the list of characters.
|
||||
std::vector<int> searchBookmarks( std::vector<wchar_t>* chars, int initialCp );
|
||||
std::vector<int> searchAnnot(std::vector<wchar_t>* chars, int initialCp);
|
||||
|
||||
ParagraphPropertyExceptions* findValidPapx( int fc );
|
||||
// Splits a list of characters into several lists
|
||||
std::list<std::vector<wchar_t> >* splitCharList( std::vector<wchar_t>* chars, std::vector<int>* splitIndices );
|
||||
@ -121,6 +122,10 @@ namespace DocFileFormat
|
||||
bool writeBookmarks ( int cp );
|
||||
bool writeBookmarkStart ( short id );
|
||||
bool writeBookmarkEnd ( short id );
|
||||
|
||||
bool writeAnnotations ( int cp );
|
||||
bool writeAnnotationStart( short id );
|
||||
bool writeAnnotationEnd ( short id );
|
||||
// Checks if the CHPX is special
|
||||
bool isSpecial( CharacterPropertyExceptions* chpx );
|
||||
// Finds the SEPX that is valid for the given CP.
|
||||
|
||||
@ -52,7 +52,8 @@ namespace DocFileFormat
|
||||
TextboxIndividualPlex(NULL),AssocNames(NULL), BookmarkAnnotNames(NULL), Captions(NULL), AutoCaptions(NULL), ListPlex(NULL),
|
||||
OfficeDrawingPlex(NULL), OfficeDrawingPlexHeader(NULL), SectionPlex(NULL), BookmarkStartPlex(NULL), BookmarkEndPlex(NULL),
|
||||
AutoTextPlex(NULL), AllPapxFkps(NULL), AllChpxFkps(NULL), AllPapx(NULL), AllPapxVector(NULL), AllSepx(NULL), Styles(NULL), listTable(NULL),
|
||||
AnnotationOwners(NULL), DocProperties(NULL), listFormatOverrideTable(NULL), headerAndFooterTable(NULL), encryptionHeader(NULL)
|
||||
AnnotationOwners(NULL), DocProperties(NULL), listFormatOverrideTable(NULL), headerAndFooterTable(NULL),
|
||||
AnnotStartPlex(NULL), AnnotEndPlex(NULL), encryptionHeader(NULL)
|
||||
{
|
||||
m_pCallFunc = pCallFunc;
|
||||
m_sTempFolder = sTempFolder;
|
||||
@ -275,12 +276,17 @@ namespace DocFileFormat
|
||||
TextboxIndividualPlex = new Plex<FTXBXS> (FTXBXS::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcftxbxTxt, FIB->m_FibWord97.lcbPlcftxbxTxt, bOlderVersion);
|
||||
|
||||
SectionPlex = new Plex<SectionDescriptor> (SectionDescriptor::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfSed, FIB->m_FibWord97.lcbPlcfSed, bOlderVersion);
|
||||
|
||||
BookmarkStartPlex = new Plex<BookmarkFirst> (BookmarkFirst::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfBkf, FIB->m_FibWord97.lcbPlcfBkf, bOlderVersion);
|
||||
BookmarkEndPlex = new Plex<EmptyStructure> (EmptyStructure::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfBkl, FIB->m_FibWord97.lcbPlcfBkl, bOlderVersion);
|
||||
|
||||
TextboxBreakPlex = new Plex<Tbkd> (Tbkd::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfTxbxBkd, FIB->m_FibWord97.lcbPlcfTxbxBkd, bOlderVersion);
|
||||
TextboxBreakPlexHeader = new Plex<Tbkd> (Tbkd::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfTxbxHdrBkd, FIB->m_FibWord97.lcbPlcfTxbxHdrBkd, bOlderVersion);
|
||||
|
||||
AnnotStartPlex = new Plex<BookmarkFirst> (BookmarkFirst::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfAtnBkf, FIB->m_FibWord97.lcbPlcfAtnBkf, bOlderVersion);
|
||||
AnnotEndPlex = new Plex<EmptyStructure> (EmptyStructure::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfAtnBkl, FIB->m_FibWord97.lcbPlcfAtnBkl, bOlderVersion);
|
||||
|
||||
|
||||
for (size_t i = 0; i < BookmarkStartPlex->Elements.size(); ++i)
|
||||
{
|
||||
BookmarkFirst* pBookmark = static_cast<BookmarkFirst*>(BookmarkStartPlex->Elements[i]);
|
||||
@ -289,7 +295,14 @@ namespace DocFileFormat
|
||||
BookmarkStartEndCPs.push_back(std::make_pair(BookmarkStartPlex->CharacterPositions[i], BookmarkEndPlex->CharacterPositions[pBookmark->GetIndex()]));
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < AnnotStartPlex->Elements.size(); ++i)
|
||||
{
|
||||
BookmarkFirst* pBookmark = static_cast<BookmarkFirst*>(AnnotStartPlex->Elements[i]);
|
||||
if (pBookmark)
|
||||
{
|
||||
AnnotStartEndCPs.push_back(std::make_pair(AnnotStartPlex->CharacterPositions[i], AnnotEndPlex->CharacterPositions[pBookmark->GetIndex()]));
|
||||
}
|
||||
}
|
||||
AutoTextPlex = new Plex<EmptyStructure>(EmptyStructure::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfGlsy, FIB->m_FibWord97.lcbPlcfGlsy, bOlderVersion);
|
||||
FieldsPlex = new Plex<FieldCharacter>(FieldCharacter::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfFldMom, FIB->m_FibWord97.lcbPlcfFldMom, bOlderVersion);
|
||||
FootnoteDocumentFieldsPlex = new Plex<FieldCharacter>(FieldCharacter::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfFldFtn, FIB->m_FibWord97.lcbPlcfFldFtn, bOlderVersion);
|
||||
@ -659,6 +672,8 @@ namespace DocFileFormat
|
||||
RELEASEOBJECT(SectionPlex);
|
||||
RELEASEOBJECT(BookmarkStartPlex);
|
||||
RELEASEOBJECT(BookmarkEndPlex);
|
||||
RELEASEOBJECT(AnnotStartPlex);
|
||||
RELEASEOBJECT(AnnotEndPlex);
|
||||
RELEASEOBJECT(AutoTextPlex);
|
||||
RELEASEOBJECT(ListPlex);
|
||||
RELEASEOBJECT(Styles);
|
||||
|
||||
@ -162,7 +162,9 @@ namespace DocFileFormat
|
||||
std::vector<int> * AllPapxVector;// A vector to quick find in AllPapx
|
||||
|
||||
std::map<int, int> PictureBulletsCPsMap;
|
||||
|
||||
std::vector<std::pair<int, int>> BookmarkStartEndCPs;
|
||||
std::vector<std::pair<int, int>> AnnotStartEndCPs;
|
||||
|
||||
FileInformationBlock * FIB;
|
||||
StyleSheet * Styles; // The style sheet of the document
|
||||
@ -204,7 +206,10 @@ namespace DocFileFormat
|
||||
Plex<SectionDescriptor> *SectionPlex; // A Plex containing all section descriptors
|
||||
|
||||
Plex<BookmarkFirst> *BookmarkStartPlex;
|
||||
Plex<EmptyStructure> *BookmarkEndPlex;
|
||||
Plex<EmptyStructure> *BookmarkEndPlex;
|
||||
|
||||
Plex<BookmarkFirst> *AnnotStartPlex;
|
||||
Plex<EmptyStructure> *AnnotEndPlex;
|
||||
|
||||
Plex<ListNumCache> *ListPlex;
|
||||
Plex<FieldCharacter> *FieldsPlex;
|
||||
|
||||
@ -51,12 +51,12 @@
|
||||
#pragma comment(lib, "../../build/bin/icu/win_32/icuuc.lib")
|
||||
#endif
|
||||
|
||||
int _tmain(int argc, _TCHAR* argv[])
|
||||
HRESULT convert_single(std::wstring fileName)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
std::wstring srcFileName = argv[1];
|
||||
std::wstring dstPath = argc > 2 ? argv[2] : srcFileName + L"-my.xlsx";
|
||||
|
||||
std::wstring srcFileName = fileName;
|
||||
std::wstring dstPath = srcFileName + L"-my.xlsx";
|
||||
|
||||
std::wstring outputDir = NSDirectory::GetFolderPath(dstPath);
|
||||
std::wstring dstTempPath = NSDirectory::CreateDirectoryWithUniqueName(outputDir);
|
||||
@ -73,3 +73,26 @@ int _tmain(int argc, _TCHAR* argv[])
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
HRESULT convert_directory(std::wstring pathName)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
std::vector<std::wstring> arFiles = NSDirectory::GetFiles(pathName, false);
|
||||
|
||||
for (size_t i = 0; i < arFiles.size(); i++)
|
||||
{
|
||||
convert_single(arFiles[i]);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
int _tmain(int argc, _TCHAR* argv[])
|
||||
{
|
||||
if (argc < 2) return 1;
|
||||
|
||||
HRESULT hr = convert_single(argv[1]);
|
||||
|
||||
//HRESULT hr = convert_directory(argv[1]);
|
||||
return hr;
|
||||
}
|
||||
@ -66,6 +66,7 @@ static inline void/*std::wstring &*/trim(std::wstring &s)
|
||||
|
||||
AutoFilter::AutoFilter()
|
||||
{
|
||||
wTopN = wJoin = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -86,7 +87,7 @@ void AutoFilter::readFields(CFRecord& record)
|
||||
unsigned short flags;
|
||||
record >> iEntry >> flags;
|
||||
|
||||
wJoin = static_cast<unsigned char>(GETBITS(flags, 0, 1));
|
||||
wJoin = GETBITS(flags, 0, 1);
|
||||
|
||||
fSimple1 = GETBIT(flags, 2);
|
||||
fSimple2 = GETBIT(flags, 3);
|
||||
@ -94,7 +95,7 @@ void AutoFilter::readFields(CFRecord& record)
|
||||
fTop = GETBIT(flags, 5); //top(1) or bottom(0)
|
||||
fPercent = GETBIT(flags, 6);
|
||||
|
||||
wTopN = static_cast<unsigned short>(GETBITS(flags, 7, 15));
|
||||
wTopN = GETBITS(flags, 7, 15);
|
||||
|
||||
unsigned short _iEntry = iEntry;
|
||||
unsigned char _wJoin = wJoin;
|
||||
|
||||
@ -87,7 +87,7 @@ void BOF::readFields(CFRecord& record)
|
||||
fGlJmp = GETBIT(flags, 10);
|
||||
fFontLimit = GETBIT(flags, 13);
|
||||
|
||||
verXLHigh = static_cast<unsigned char>(GETBITS(flags, 14, 17));
|
||||
verXLHigh = GETBITS(flags, 14, 17);
|
||||
|
||||
record >> verLowestBiff;
|
||||
unsigned char flags2;
|
||||
|
||||
@ -36,9 +36,9 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
BookExt::BookExt()
|
||||
: cb(22)
|
||||
BookExt::BookExt() : cb(22)
|
||||
{
|
||||
mdFactoidDisplay = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -62,15 +62,15 @@ void BookExt::readFields(CFRecord& record)
|
||||
|
||||
if (record.loadAnyData(flags))
|
||||
{
|
||||
fDontAutoRecover = GETBIT(flags, 0);
|
||||
fHidePivotList = GETBIT(flags, 1);
|
||||
fFilterPrivacy = GETBIT(flags, 2);
|
||||
fEmbedFactoids = GETBIT(flags, 3);
|
||||
mdFactoidDisplay = static_cast<unsigned char>(GETBITS(flags, 4, 5));
|
||||
fSavedDuringRecovery = GETBIT(flags, 6);
|
||||
fCreatedViaMinimalSave = GETBIT(flags, 7);
|
||||
fOpenedViaDataRecovery = GETBIT(flags, 8);
|
||||
fOpenedViaSafeLoad = GETBIT(flags, 9);
|
||||
fDontAutoRecover = GETBIT(flags, 0);
|
||||
fHidePivotList = GETBIT(flags, 1);
|
||||
fFilterPrivacy = GETBIT(flags, 2);
|
||||
fEmbedFactoids = GETBIT(flags, 3);
|
||||
mdFactoidDisplay = GETBITS(flags, 4, 5);
|
||||
fSavedDuringRecovery = GETBIT(flags, 6);
|
||||
fCreatedViaMinimalSave = GETBIT(flags, 7);
|
||||
fOpenedViaDataRecovery = GETBIT(flags, 8);
|
||||
fOpenedViaSafeLoad = GETBIT(flags, 9);
|
||||
}
|
||||
else return;
|
||||
|
||||
|
||||
@ -37,6 +37,7 @@ namespace XLS
|
||||
|
||||
ColInfo::ColInfo()
|
||||
{
|
||||
iOutLevel = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -38,6 +38,8 @@ namespace XLS
|
||||
DbOrParamQry::DbOrParamQry(int typeRecord_)
|
||||
{
|
||||
typeRecord = typeRecord_;
|
||||
|
||||
param.pbt = query.dbt = 0;
|
||||
}
|
||||
|
||||
DbOrParamQry::~DbOrParamQry()
|
||||
|
||||
@ -71,12 +71,12 @@ void Dv::readFields(CFRecord& record)
|
||||
record >> flags;
|
||||
|
||||
valType = static_cast<_valTypeDv>(GETBITS(flags, 0, 3));
|
||||
errStyle = static_cast<unsigned char>(GETBITS(flags, 4, 6));
|
||||
errStyle = GETBITS(flags, 4, 6);
|
||||
|
||||
fStrLookup = GETBIT(flags, 7);
|
||||
fAllowBlank = GETBIT(flags, 8);
|
||||
fSuppressCombo = GETBIT(flags, 9);
|
||||
mdImeMode = static_cast<unsigned char>(GETBITS(flags, 10, 17));
|
||||
mdImeMode = GETBITS(flags, 10, 17);
|
||||
fShowInputMsg = GETBIT(flags, 18);
|
||||
fShowErrorMsg = GETBIT(flags, 19);
|
||||
typOperator = static_cast<_typOperatorDv>(GETBITS(flags, 20, 23));
|
||||
|
||||
@ -36,7 +36,7 @@ namespace XLS
|
||||
{
|
||||
|
||||
ExternName::ExternName(const unsigned short supporting_link_type)
|
||||
: supbook_cch(supporting_link_type)
|
||||
: supbook_cch(supporting_link_type), cf(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -45,7 +45,7 @@ const wchar_t* const AutoFilterDefineNames[] =
|
||||
|
||||
|
||||
Lbl::Lbl()
|
||||
: rgce(false)
|
||||
: rgce(false), fGrp(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -37,6 +37,7 @@ namespace XLS
|
||||
|
||||
Qsir::Qsir()
|
||||
{
|
||||
wVerBeforeRefreshAlert = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -37,6 +37,7 @@ namespace XLS
|
||||
|
||||
Row::Row()
|
||||
{
|
||||
iOutLevel = ixfe_val = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -39,7 +39,6 @@ SXDtr::SXDtr()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
SXDtr::~SXDtr()
|
||||
{
|
||||
}
|
||||
@ -54,7 +53,7 @@ void SXDtr::readFields(CFRecord& record)
|
||||
record >> yr >> mon >> dom >> hr >> min >> sec;
|
||||
}
|
||||
|
||||
std::wstring SXDtr::get_string_date()
|
||||
std::wstring SXDtr::value()
|
||||
{
|
||||
std::wstringstream s;
|
||||
s << yr << L"-" << (mon < 10 ? L"0" : L"") << mon << L"-" << (dom < 10 ? L"0" : L"") << dom << L"T"
|
||||
@ -63,19 +62,5 @@ std::wstring SXDtr::get_string_date()
|
||||
return s.str();
|
||||
}
|
||||
|
||||
int SXDtr::serialize(std::wostream & strm)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"d")
|
||||
{
|
||||
|
||||
CP_XML_ATTR(L"v", get_string_date());
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -48,8 +48,6 @@ public:
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
int serialize(std::wostream & strm);
|
||||
|
||||
static const ElementType type = typeSXDtr;
|
||||
|
||||
unsigned short yr;
|
||||
@ -59,7 +57,7 @@ public:
|
||||
unsigned char min;
|
||||
unsigned char sec;
|
||||
|
||||
std::wstring get_string_date();
|
||||
std::wstring value();
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -37,6 +37,7 @@ namespace XLS
|
||||
|
||||
SXEx::SXEx()
|
||||
{
|
||||
cWrapPage = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -60,7 +60,7 @@ void SXLI::readFields(CFRecord& record)
|
||||
{
|
||||
break;
|
||||
}
|
||||
SXLIItem item;
|
||||
SXLIItem item = {};
|
||||
|
||||
unsigned short flags;
|
||||
|
||||
|
||||
@ -53,17 +53,5 @@ void SXNum::readFields(CFRecord& record)
|
||||
record >> num;
|
||||
}
|
||||
|
||||
int SXNum::serialize(std::wostream & strm)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"n")
|
||||
{
|
||||
CP_XML_ATTR(L"v", num.data.value);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -49,8 +49,6 @@ public:
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
int serialize(std::wostream & strm);
|
||||
|
||||
static const ElementType type = typeSXNum;
|
||||
|
||||
Xnum num;
|
||||
|
||||
@ -59,18 +59,6 @@ void SXString::readFields(CFRecord& record)
|
||||
record >> segment;
|
||||
}
|
||||
}
|
||||
int SXString::serialize(std::wostream & strm)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"s")
|
||||
{
|
||||
CP_XML_ATTR(L"v", segment.value());
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::wstring SXString::value()
|
||||
{
|
||||
|
||||
@ -51,8 +51,6 @@ public:
|
||||
|
||||
std::wstring value();
|
||||
|
||||
int serialize(std::wostream & strm);
|
||||
|
||||
static const ElementType type = typeSXString;
|
||||
|
||||
unsigned short cch;
|
||||
|
||||
@ -74,12 +74,12 @@ int SXVI::serialize(std::wostream & strm)
|
||||
CP_XML_NODE(L"item")
|
||||
{
|
||||
if (fMissing) CP_XML_ATTR(L"m", 1);
|
||||
if (fHidden) CP_XML_ATTR(L"h", 1);
|
||||
if (fHideDetail)CP_XML_ATTR(L"sd", 1);
|
||||
if (fHideDetail)CP_XML_ATTR(L"sd", 0);
|
||||
if (fFormula) CP_XML_ATTR(L"f", 1);
|
||||
|
||||
if (itmType == 0)
|
||||
{
|
||||
if (fHidden) CP_XML_ATTR(L"h", 1);
|
||||
CP_XML_ATTR(L"x", iCache);
|
||||
}
|
||||
switch(itmType)
|
||||
|
||||
@ -37,7 +37,7 @@ namespace XLS
|
||||
|
||||
Setup::Setup()
|
||||
// the following may appear uninitialized but we have to store them
|
||||
: iPaperSize(0), iScale(255), iRes(0), iVRes(0), iCopies(0), fNoOrient(false), fPortrait(false), iPageStart(1)
|
||||
: iPaperSize(0), iScale(255), iRes(0), iVRes(0), iCopies(0), fNoOrient(false), fPortrait(false), iPageStart(1), iErrors(0)
|
||||
{
|
||||
}
|
||||
|
||||
@ -56,16 +56,17 @@ void Setup::readFields(CFRecord& record)
|
||||
{
|
||||
unsigned short flags;
|
||||
record >> iPaperSize >> iScale >> iPageStart >> iFitWidth >> iFitHeight >> flags;
|
||||
|
||||
fLeftToRight = GETBIT(flags, 0);
|
||||
fPortrait = GETBIT(flags, 1);
|
||||
fNoPls = GETBIT(flags, 2);
|
||||
fNoColor = GETBIT(flags, 3);
|
||||
fDraft = GETBIT(flags, 4);
|
||||
fNotes = GETBIT(flags, 5);
|
||||
fNoOrient = GETBIT(flags, 6);
|
||||
fUsePage = GETBIT(flags, 7);
|
||||
fEndNotes = GETBIT(flags, 9);
|
||||
iErrors = GETBITS(flags, 10, 11);
|
||||
fPortrait = GETBIT(flags, 1);
|
||||
fNoPls = GETBIT(flags, 2);
|
||||
fNoColor = GETBIT(flags, 3);
|
||||
fDraft = GETBIT(flags, 4);
|
||||
fNotes = GETBIT(flags, 5);
|
||||
fNoOrient = GETBIT(flags, 6);
|
||||
fUsePage = GETBIT(flags, 7);
|
||||
fEndNotes = GETBIT(flags, 9);
|
||||
iErrors = GETBITS(flags, 10, 11);
|
||||
|
||||
record >> iRes >> iVRes >> numHdr >> numFtr >> iCopies;
|
||||
}
|
||||
|
||||
@ -38,6 +38,7 @@ namespace XLS
|
||||
|
||||
SheetExt::SheetExt()
|
||||
{
|
||||
icvPlain = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -61,7 +62,7 @@ void SheetExt::readFields(CFRecord& record)
|
||||
_UINT32 flags;
|
||||
record >> flags;
|
||||
|
||||
icvPlain = static_cast<unsigned char>(GETBITS(flags, 0, 6));
|
||||
icvPlain = GETBITS(flags, 0, 6);
|
||||
|
||||
if(0x00000028 == cb)
|
||||
{
|
||||
|
||||
@ -37,6 +37,7 @@ namespace XLS
|
||||
|
||||
Style::Style()
|
||||
{
|
||||
ixfe = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -39,7 +39,6 @@ SxBool::SxBool()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
SxBool::~SxBool()
|
||||
{
|
||||
}
|
||||
@ -56,18 +55,5 @@ void SxBool::readFields(CFRecord& record)
|
||||
|
||||
val = (flags != 0);
|
||||
}
|
||||
int SxBool::serialize(std::wostream & strm)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"b")
|
||||
{
|
||||
|
||||
CP_XML_ATTR(L"v", val);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -48,8 +48,6 @@ public:
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
int serialize(std::wostream & strm);
|
||||
|
||||
static const ElementType type = typeSxBool;
|
||||
|
||||
bool val;
|
||||
|
||||
@ -32,7 +32,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
//#include "../Biff_structures/CellRangeRef.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
@ -37,6 +37,7 @@ namespace XLS
|
||||
|
||||
SxFilt::SxFilt()
|
||||
{
|
||||
isxvd = iDim = cisxvi = grbitSbt = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -52,16 +53,15 @@ BaseObjectPtr SxFilt::clone()
|
||||
|
||||
void SxFilt::readFields(CFRecord& record)
|
||||
{
|
||||
unsigned short flags1;
|
||||
unsigned short flags2;
|
||||
unsigned short flags1, flags2;
|
||||
|
||||
record >> flags1 >> isxvd >> flags2 >> grbitSbt >> cisxvi;
|
||||
record >> flags1 >> flags2 >> grbitSbt >> cisxvi;
|
||||
|
||||
sxaxisRw = GETBIT(flags1, 0);
|
||||
sxaxisCol = GETBIT(flags1, 1);
|
||||
sxaxisPage = GETBIT(flags1, 2);
|
||||
sxaxisData = GETBIT(flags1, 3);
|
||||
iDim = GETBITS(flags1, 4, 15);
|
||||
iDim = GETBITS(flags1, 6, 15);
|
||||
|
||||
isxvd = GETBITS(flags2, 0, 9);
|
||||
fSelected = GETBIT(flags2, 10);
|
||||
|
||||
@ -54,8 +54,10 @@ public:
|
||||
bool sxaxisCol;
|
||||
bool sxaxisPage;
|
||||
bool sxaxisData;
|
||||
unsigned short iDim;
|
||||
unsigned short isxvd;
|
||||
|
||||
char iDim;
|
||||
char isxvd;
|
||||
|
||||
bool fSelected;
|
||||
|
||||
short grbitSbt;
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
class SxItm: public BiffRecordContinued
|
||||
class SxItm: public BiffRecordContinued
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(SxItm)
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(SxItm)
|
||||
|
||||
@ -52,14 +52,5 @@ void SxNil::readFields(CFRecord& record)
|
||||
{
|
||||
}
|
||||
|
||||
int SxNil::serialize(std::wostream & strm)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"m");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -48,8 +48,6 @@ public:
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
int serialize(std::wostream & strm);
|
||||
|
||||
static const ElementType type = typeSxNil;
|
||||
};
|
||||
|
||||
|
||||
@ -37,6 +37,7 @@ namespace XLS
|
||||
|
||||
SxSelect::SxSelect()
|
||||
{
|
||||
cClick = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -62,7 +62,7 @@ void Text::readFields(CFRecord& record)
|
||||
|
||||
if (record.getGlobalWorkbookInfo()->Version < 0x0600)
|
||||
{
|
||||
int orient = GETBITS(flags1, 8, 10);
|
||||
unsigned char orient = GETBITS(flags1, 8, 10);
|
||||
switch(orient)
|
||||
{
|
||||
case 0: trot = 0; break; // Text orientation: not rotated.
|
||||
@ -75,8 +75,8 @@ void Text::readFields(CFRecord& record)
|
||||
{
|
||||
record >> icvText >> flags2 >> trot;
|
||||
//icv -> from Palette
|
||||
dlp = static_cast<unsigned char>(GETBITS(flags2, 0, 3));
|
||||
iReadingOrder = static_cast<unsigned char>(GETBITS(flags2, 14, 15));
|
||||
dlp = GETBITS(flags2, 0, 3);
|
||||
iReadingOrder = GETBITS(flags2, 14, 15);
|
||||
}
|
||||
|
||||
fAutoColor = GETBIT(flags1, 0);
|
||||
|
||||
@ -37,6 +37,7 @@ namespace XLS
|
||||
|
||||
Tick::Tick()
|
||||
{
|
||||
iReadingOrder = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -59,11 +60,11 @@ void Tick::readFields(CFRecord& record)
|
||||
record.skipNunBytes(16); // reserved
|
||||
record >> flags >> icv >> trot;
|
||||
|
||||
fAutoCo = GETBIT(flags, 0);
|
||||
fAutoMode = GETBIT(flags, 1);
|
||||
rot = GETBITS(flags, 2, 4);
|
||||
fAutoRot = GETBIT(flags, 5);
|
||||
iReadingOrder = GETBITS(flags, 14, 15);
|
||||
fAutoCo = GETBIT(flags, 0);
|
||||
fAutoMode = GETBIT(flags, 1);
|
||||
rot = GETBITS(flags, 2, 4);
|
||||
fAutoRot = GETBIT(flags, 5);
|
||||
iReadingOrder = GETBITS(flags, 14, 15);
|
||||
|
||||
_rott = rot;
|
||||
}
|
||||
|
||||
@ -146,8 +146,8 @@ void TxO::readFields(CFRecord& record)
|
||||
}
|
||||
}
|
||||
|
||||
hAlignment = static_cast<unsigned char>(GETBITS(flags, 1, 3));
|
||||
vAlignment = static_cast<unsigned char>(GETBITS(flags, 4, 6)); // reserved2 (2 bits)
|
||||
hAlignment = GETBITS(flags, 1, 3);
|
||||
vAlignment = GETBITS(flags, 4, 6); // reserved2 (2 bits)
|
||||
|
||||
fLockText = GETBIT(flags, 9); // reserved3 (4 bits)
|
||||
fJustLast = GETBIT(flags, 14);
|
||||
|
||||
@ -55,6 +55,8 @@ public:
|
||||
cbRuns = 0;
|
||||
sp_enabled = false;
|
||||
preserve_enabled = false;
|
||||
hAlignment = 0;
|
||||
vAlignment = 0;
|
||||
}
|
||||
~TxO();
|
||||
|
||||
|
||||
@ -37,6 +37,8 @@ namespace XLS
|
||||
|
||||
TxtQry::TxtQry()
|
||||
{
|
||||
iCpidNew = 0;
|
||||
iTextDelm = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -37,7 +37,8 @@ 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)
|
||||
style(cell_xf_current_id, style_xf_current_id),
|
||||
ixfParent(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -41,6 +41,7 @@ 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)
|
||||
{
|
||||
alc = alcV = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -70,7 +71,7 @@ void CellXF::load(CFRecord& record)
|
||||
fShrinkToFit = 0;//GETBIT(flags1, 20);
|
||||
iReadOrder = 0;//static_cast<unsigned char>(GETBITS(flags1, 22, 23));
|
||||
|
||||
char orient = GETBITS(flags1, 8, 10);
|
||||
char orient = static_cast<unsigned char>(GETBITS(flags1, 8, 10));
|
||||
|
||||
switch(orient)
|
||||
{
|
||||
|
||||
@ -44,9 +44,9 @@ OfficeArtCOLORREF::OfficeArtCOLORREF()
|
||||
|
||||
OfficeArtCOLORREF::OfficeArtCOLORREF(const int raw_data)
|
||||
{
|
||||
red = static_cast<unsigned char>(GETBITS(raw_data, 0, 7));
|
||||
green = static_cast<unsigned char>(GETBITS(raw_data, 8, 15));
|
||||
blue = static_cast<unsigned char>(GETBITS(raw_data, 16, 23));
|
||||
red = GETBITS(raw_data, 0, 7);
|
||||
green = GETBITS(raw_data, 8, 15);
|
||||
blue = GETBITS(raw_data, 16, 23);
|
||||
|
||||
fPaletteIndex = GETBIT(raw_data, 24);
|
||||
fPaletteRGB = GETBIT(raw_data, 25);
|
||||
|
||||
@ -31,7 +31,14 @@
|
||||
*/
|
||||
|
||||
#include "PtgSxName.h"
|
||||
#include <Binary/CFRecord.h>
|
||||
|
||||
#include "../Biff_unions/PIVOTCACHE.h"
|
||||
#include "../Biff_unions/FDB.h"
|
||||
#include "../Biff_unions/SXOPER.h"
|
||||
|
||||
#include "../Biff_records/SXFDB.h"
|
||||
#include "../Biff_records/SxName.h"
|
||||
#include "../Biff_records/SXPair.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
@ -51,38 +58,59 @@ void PtgSxName::loadFields(CFRecord& record)
|
||||
|
||||
void PtgSxName::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, bool full_ref)
|
||||
{
|
||||
//RevNamePtr tab_id;
|
||||
//if(!extra_data.empty() && (tab_id = boost::dynamic_pointer_cast<RevName>(extra_data.front())))
|
||||
//{
|
||||
// Log::error("PtgNameX struct for revisions is not assemble.");
|
||||
// ptg_stack.push(L"#REF!");
|
||||
// extra_data.pop();
|
||||
// return;
|
||||
//}
|
||||
|
||||
std::wstring _Name;
|
||||
if(sxIndex > 0 && sxIndex <= global_info->AddinUdfs.size() && !(_Name = global_info->AddinUdfs[sxIndex - 1]).empty())
|
||||
|
||||
if (sxIndex < global_info->arPivotSxNames.size())
|
||||
{
|
||||
SxName *name = dynamic_cast<SxName*>(global_info->arPivotSxNames[sxIndex].name.get());
|
||||
|
||||
if ((name) && (name->ifdb >= 0 && name->ifdb < global_info->arPivotCacheSxNames.size()))
|
||||
{
|
||||
_Name = global_info->arPivotCacheSxNames[name->ifdb];
|
||||
}
|
||||
else if (!global_info->arPivotSxNames[sxIndex].pair.empty())
|
||||
{
|
||||
SXPair *pair = dynamic_cast<SXPair*>(global_info->arPivotSxNames[sxIndex].pair[0].get());
|
||||
if (pair)
|
||||
{
|
||||
std::map<int, BaseObjectPtr>::iterator pFind = global_info->mapPivotCache.find(global_info->idPivotCache);
|
||||
if (pFind != global_info->mapPivotCache.end())
|
||||
{
|
||||
PIVOTCACHE* pivot_cache = dynamic_cast<PIVOTCACHE*>(pFind->second.get());
|
||||
if (pivot_cache)
|
||||
{
|
||||
if (pair->isxvd >= 0 && pair->isxvd < pivot_cache->m_arFDB.size())
|
||||
{
|
||||
FDB* field = dynamic_cast<FDB*>(pivot_cache->m_arFDB[pair->isxvd].get());
|
||||
if (field)
|
||||
{
|
||||
|
||||
SXFDB* field_db= dynamic_cast<SXFDB*>(field->m_SXFDB.get());
|
||||
if (field_db)
|
||||
{
|
||||
_Name = field_db->stFieldName.value();
|
||||
|
||||
if (std::wstring::npos != _Name.find(L" "))
|
||||
{
|
||||
_Name = L"'" + _Name + L"'";
|
||||
}
|
||||
}
|
||||
if (pair->iCache >= 0 && pair->iCache < field->m_arSRCSXOPER.size())
|
||||
{
|
||||
SXOPER* cache = dynamic_cast<SXOPER*>(field->m_arSRCSXOPER[pair->iCache].get());
|
||||
if (cache)
|
||||
{
|
||||
_Name += L"[" + cache->value + L"]";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ptg_stack.push(_Name);
|
||||
}
|
||||
else if(sxIndex > 0 && sxIndex <= global_info->xti_parsed.size())
|
||||
{
|
||||
std::wstring sheet = global_info->xti_parsed[sxIndex-1];
|
||||
|
||||
if (!sheet.empty()) sheet += L"!";
|
||||
|
||||
if (sxIndex > 0 && sxIndex <= global_info->arDefineNames.size())
|
||||
{
|
||||
_Name = global_info->arDefineNames[sxIndex - 1];
|
||||
}
|
||||
|
||||
if (sheet.empty() && _Name.empty() && sxIndex <= global_info->arExternalNames.size() && sxIndex > 0)
|
||||
{
|
||||
_Name = global_info->arExternalNames[sxIndex - 1];
|
||||
}
|
||||
|
||||
ptg_stack.push(sheet + _Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
Log::warning("PtgSxName structure is not assemble.");
|
||||
|
||||
@ -41,9 +41,11 @@ namespace XLS
|
||||
StyleXF::StyleXF(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)
|
||||
{
|
||||
font_id = -1;
|
||||
font_id = -1;
|
||||
border_x_id = -1;
|
||||
fill_x_id = -1;
|
||||
|
||||
fill.fls = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -83,7 +85,7 @@ void StyleXF::load(CFRecord& record)
|
||||
case 3: trot = 270; break; // Text orientation: 90 deg clockwise.
|
||||
}
|
||||
|
||||
fill.fls = static_cast<unsigned char>(GETBITS(flags2, 16, 21));
|
||||
fill.fls = GETBITS(flags2, 16, 21);
|
||||
|
||||
fill.icvFore = GETBITS(flags2, 0, 6);
|
||||
fill.icvBack = GETBITS(flags2, 7, 13);
|
||||
@ -132,7 +134,7 @@ void StyleXF::load(CFRecord& record)
|
||||
border.icvBottom = (0 != border.dgBottom)? static_cast<unsigned char>(GETBITS(flags3, 7, 13)) : 0;
|
||||
border.icvDiag = (0 != border.dgDiag) ? static_cast<unsigned char>(GETBITS(flags3, 14, 20)) : 0;
|
||||
|
||||
fill.fls = static_cast<unsigned char>(GETBITS(flags3, 26, 31));
|
||||
fill.fls = GETBITS(flags3, 26, 31);
|
||||
|
||||
fill.icvFore = GETBITS(flags4, 0, 6);
|
||||
fill.icvBack = GETBITS(flags4, 7, 13);
|
||||
|
||||
@ -92,41 +92,26 @@ int DREF::serialize(std::wostream & strm)
|
||||
}
|
||||
else if(bin)
|
||||
{
|
||||
switch(bin->nBuiltin)
|
||||
CP_XML_ATTR(L"type", L"worksheet");
|
||||
CP_XML_NODE(L"worksheetSource")
|
||||
{
|
||||
|
||||
case 0x0004:/*Database*/
|
||||
case 0x000d:/*_FilterDatabase*/
|
||||
switch(bin->nBuiltin)
|
||||
{
|
||||
CP_XML_ATTR(L"type", L"external");
|
||||
//connectionId in connections(root)
|
||||
}break;
|
||||
case 0x0000:/*Consolidate_Area*/
|
||||
//{
|
||||
// CP_XML_ATTR(L"type", L"consolidation");
|
||||
// CP_XML_NODE(L"consolidation")
|
||||
// {
|
||||
// CP_XML_ATTR(L"name", bin->stFile.value());
|
||||
// }
|
||||
//}break;
|
||||
case 0x0001:/*Auto_Open*/
|
||||
case 0x0002:/*Auto_Close*/
|
||||
case 0x0003:/*Extract*/
|
||||
case 0x0005:/*Criteria*/
|
||||
case 0x0006:/*Print_Area*/
|
||||
case 0x0007:/*Print_Titles*/
|
||||
case 0x0008:/*Recorder*/
|
||||
case 0x0009:/*Data_Form*/
|
||||
case 0x000a:/*Auto_Activate*/
|
||||
case 0x000b:/*Auto_Deactivate*/
|
||||
case 0x000c:/*Sheet_Title*/
|
||||
{
|
||||
CP_XML_ATTR(L"type", L"scenario");
|
||||
CP_XML_NODE(L"worksheetSource")
|
||||
{
|
||||
CP_XML_ATTR(L"name", bin->stFile.value());
|
||||
}
|
||||
}break;
|
||||
case 0x0000: CP_XML_ATTR(L"name", L"_xlnm.Consolidate_Area"); break;
|
||||
case 0x0001: CP_XML_ATTR(L"name", L"_xlnm.Auto_Open"); break;
|
||||
case 0x0002: CP_XML_ATTR(L"name", L"_xlnm.Auto_Close"); break;
|
||||
case 0x0003: CP_XML_ATTR(L"name", L"_xlnm.Extract"); break;
|
||||
case 0x0004: CP_XML_ATTR(L"name", L"_xlnm.Database"); break;
|
||||
case 0x0005: CP_XML_ATTR(L"name", L"_xlnm.Criteria"); break;
|
||||
case 0x0006: CP_XML_ATTR(L"name", L"_xlnm.Print_Area"); break;
|
||||
case 0x0007: CP_XML_ATTR(L"name", L"_xlnm.Print_Titles"); break;
|
||||
case 0x0008: CP_XML_ATTR(L"name", L"_xlnm.Recorder"); break;
|
||||
case 0x0009: CP_XML_ATTR(L"name", L"_xlnm.Data_Form"); break;
|
||||
case 0x000a: CP_XML_ATTR(L"name", L"_xlnm.Auto_Activate"); break;
|
||||
case 0x000b: CP_XML_ATTR(L"name", L"_xlnm.Auto_Deactivate"); break;
|
||||
case 0x000c: CP_XML_ATTR(L"name", L"_xlnm.Sheet_Title"); break;
|
||||
case 0x000d: CP_XML_ATTR(L"name", L"_xlnm._FilterDatabase"); break; //??
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(ref)
|
||||
|
||||
@ -97,6 +97,8 @@ BaseObjectPtr FDB::clone()
|
||||
|
||||
const bool FDB::loadContent(BinProcessor& proc)
|
||||
{
|
||||
global_info = proc.getGlobalWorkbookInfo();
|
||||
|
||||
if(!proc.mandatory<SXFDB>())
|
||||
{
|
||||
return false;
|
||||
@ -179,6 +181,8 @@ int FDB::serialize(std::wostream & strm)
|
||||
SXFDBType* fdb_type = dynamic_cast<SXFDBType*>(m_SXFDBType.get());
|
||||
|
||||
if (!fdb || !fdb_type) return 0;
|
||||
|
||||
global_info->arPivotCacheSxNames.push_back(fdb->stFieldName.value());
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
@ -214,7 +218,9 @@ int FDB::serialize(std::wostream & strm)
|
||||
}
|
||||
if(m_SXFMLA)
|
||||
{
|
||||
//{formula
|
||||
SXFMLA* Formula = dynamic_cast<SXFMLA*>(m_SXFMLA.get());
|
||||
if (Formula)
|
||||
Formula->serialize_attr(CP_GET_XML_NODE());
|
||||
}
|
||||
|
||||
if (m_arSRCSXOPER.empty() == false)
|
||||
|
||||
@ -67,6 +67,7 @@ public:
|
||||
bool bInteger;
|
||||
bool bBool;
|
||||
|
||||
GlobalWorkbookInfoPtr global_info;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -35,10 +35,15 @@
|
||||
#include "SXFORMULA_bu.h"
|
||||
#include "FDB.h"
|
||||
#include "DBB.h"
|
||||
#include "SXOPER.h"
|
||||
#include "PRFILTER.h"
|
||||
#include "PIVOTRULE.h"
|
||||
|
||||
#include "../Biff_records/SXDB.h"
|
||||
#include "../Biff_records/SXDBEx.h"
|
||||
#include "../Biff_records/EOF.h"
|
||||
#include "../Biff_records/SxItm.h"
|
||||
#include "../Biff_records/SxFilt.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
@ -105,6 +110,45 @@ const bool PIVOTCACHE::loadContent(BinProcessor& proc)
|
||||
{
|
||||
elements_.pop_back();
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
for (size_t i = 0; i < m_arSXFORMULA.size(); i++)
|
||||
{
|
||||
SXFORMULA* formula = dynamic_cast<SXFORMULA*>(m_arSXFORMULA[i].get());
|
||||
if (!formula)continue;
|
||||
|
||||
PIVOTRULE* pivot_rule = dynamic_cast<PIVOTRULE*>(formula->m_PIVOTRULE.get());
|
||||
if (!pivot_rule) continue;
|
||||
|
||||
for (size_t j = 0; j < pivot_rule->m_arPRFILTER.size(); j++)
|
||||
{
|
||||
PRFILTER* filter = dynamic_cast<PRFILTER*>(pivot_rule->m_arPRFILTER[j].get());
|
||||
if (!filter) continue;
|
||||
|
||||
SxItm* item = dynamic_cast<SxItm*>(filter->m_SxItm.get());
|
||||
SxFilt* filt = dynamic_cast<SxFilt*>(filter->m_SxFilt.get());
|
||||
|
||||
for (size_t i = 0; (item && filt) && i < item->rgisxvi.size(); i++)
|
||||
{
|
||||
short index_cache = filt->isxvd;
|
||||
short index_item = item->rgisxvi[i];
|
||||
if (index_cache >= 0 && index_cache < m_arFDB.size())
|
||||
{
|
||||
FDB* field = dynamic_cast<FDB*>(m_arFDB[index_cache].get());
|
||||
if (field)
|
||||
{
|
||||
if (index_item >= 0 && index_item < field->m_arSRCSXOPER.size())
|
||||
{
|
||||
SXOPER* cache = dynamic_cast<SXOPER*>(field->m_arSRCSXOPER[index_item].get());
|
||||
if (cache)
|
||||
{
|
||||
cache->bFormula = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -91,12 +91,17 @@ const bool PIVOTCACHEDEFINITION::loadContent(BinProcessor& proc)
|
||||
}
|
||||
int PIVOTCACHEDEFINITION::serialize_definitions(std::wostream & strm)
|
||||
{
|
||||
global_info_->arPivotCacheSxNames.clear();
|
||||
global_info_->arPivotSxNames.clear();
|
||||
|
||||
SXStreamID* streamId = dynamic_cast<SXStreamID*>(m_SXStreamID.get());
|
||||
if (!streamId) return 0;
|
||||
|
||||
std::map<int, BaseObjectPtr>::iterator pFind = global_info_->mapPivotCache.find(streamId->idStm);
|
||||
if (pFind == global_info_->mapPivotCache.end()) return 0;
|
||||
|
||||
global_info_->idPivotCache = streamId->idStm;
|
||||
|
||||
PIVOTCACHE* pivot_cache = dynamic_cast<PIVOTCACHE*>(pFind->second.get());
|
||||
if (!pivot_cache) return 0;
|
||||
|
||||
|
||||
@ -31,8 +31,8 @@
|
||||
*/
|
||||
|
||||
#include "PIVOTRULE.h"
|
||||
#include <Logic/Biff_records/SxRule.h>
|
||||
#include <Logic/Biff_unions/PRFILTER.h>
|
||||
#include "PRFILTER.h"
|
||||
#include "../Biff_records/SxRule.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
@ -49,7 +49,6 @@ BaseObjectPtr PIVOTRULE::clone()
|
||||
return BaseObjectPtr(new PIVOTRULE(*this));
|
||||
}
|
||||
|
||||
|
||||
// PIVOTRULE = SxRule *PRFILTER
|
||||
const bool PIVOTRULE::loadContent(BinProcessor& proc)
|
||||
{
|
||||
|
||||
@ -89,7 +89,8 @@ int PIVOTVD::serialize(std::wostream & strm)
|
||||
if (vd->sxaxis.bRw) CP_XML_ATTR(L"axis", L"axisRow");
|
||||
else if (vd->sxaxis.bCol) CP_XML_ATTR(L"axis", L"axisCol");
|
||||
else if (vd->sxaxis.bPage) CP_XML_ATTR(L"axis", L"axisPage");
|
||||
else if (vd->sxaxis.bData)
|
||||
|
||||
if (vd->sxaxis.bData)
|
||||
{
|
||||
CP_XML_ATTR(L"dataField", 1);
|
||||
}
|
||||
|
||||
@ -31,30 +31,26 @@
|
||||
*/
|
||||
|
||||
#include "PRFILTER.h"
|
||||
#include <Logic/Biff_records/SxFilt.h>
|
||||
#include <Logic/Biff_records/SxItm.h>
|
||||
#include <Logic/Biff_records/Continue.h>
|
||||
#include "../Biff_records/SxFilt.h"
|
||||
#include "../Biff_records/SxItm.h"
|
||||
#include "../Biff_records/Continue.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
PRFILTER::PRFILTER()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
PRFILTER::~PRFILTER()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr PRFILTER::clone()
|
||||
{
|
||||
return BaseObjectPtr(new PRFILTER(*this));
|
||||
}
|
||||
|
||||
|
||||
// PRFILTER = SxFilt [SxItm *Continue]
|
||||
const bool PRFILTER::loadContent(BinProcessor& proc)
|
||||
{
|
||||
@ -62,11 +58,16 @@ const bool PRFILTER::loadContent(BinProcessor& proc)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
m_SxFilt = elements_.back();
|
||||
elements_.pop_back();
|
||||
|
||||
if(proc.optional<SxItm>())
|
||||
{
|
||||
m_SxItm = elements_.back();
|
||||
elements_.pop_back();
|
||||
|
||||
int count = proc.repeated<Continue>(0, 0);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -36,8 +36,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of PRFILTER union of records
|
||||
class PRFILTER: public CompositeObject
|
||||
{
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(PRFILTER)
|
||||
@ -49,7 +47,10 @@ public:
|
||||
|
||||
virtual const bool loadContent(BinProcessor& proc);
|
||||
|
||||
static const ElementType type = typePRFILTER;
|
||||
static const ElementType type = typePRFILTER;
|
||||
|
||||
BaseObjectPtr m_SxFilt;
|
||||
BaseObjectPtr m_SxItm;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -79,7 +79,7 @@ BaseObjectPtr SXFMLA::clone()
|
||||
// SXFMLA = SxFmla *(SxName *SXPair)
|
||||
const bool SXFMLA::loadContent(BinProcessor& proc)
|
||||
{
|
||||
GlobalWorkbookInfoPtr global_info = proc.getGlobalWorkbookInfo();
|
||||
global_info = proc.getGlobalWorkbookInfo();
|
||||
|
||||
if(!proc.mandatory<SxFmla>())
|
||||
{
|
||||
@ -97,7 +97,7 @@ const bool SXFMLA::loadContent(BinProcessor& proc)
|
||||
_sx_name sx_name;
|
||||
sx_name.name = elements_.front(); elements_.pop_front();
|
||||
|
||||
global_info->arPivotSxNames.push_back(sx_name);
|
||||
m_arPivotSxNames.push_back(sx_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -109,7 +109,7 @@ const bool SXFMLA::loadContent(BinProcessor& proc)
|
||||
}
|
||||
else
|
||||
{
|
||||
global_info->arPivotSxNames.back().pair.push_back(elements_.front());
|
||||
m_arPivotSxNames.back().pair.push_back(elements_.front());
|
||||
elements_.pop_front();
|
||||
}
|
||||
}
|
||||
@ -119,5 +119,17 @@ const bool SXFMLA::loadContent(BinProcessor& proc)
|
||||
return true;
|
||||
}
|
||||
|
||||
void SXFMLA::serialize_attr(CP_ATTR_NODE)
|
||||
{
|
||||
if (!m_SxFmla) return;
|
||||
|
||||
SxFmla* sx_fmla = dynamic_cast<SxFmla*>(m_SxFmla.get());
|
||||
|
||||
global_info->arPivotSxNames = m_arPivotSxNames;
|
||||
|
||||
CP_XML_ATTR(L"formula", sx_fmla->fmla.getAssembledFormula());
|
||||
}
|
||||
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -35,6 +35,7 @@
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
class SXFMLA: public CompositeObject
|
||||
{
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(SXFMLA)
|
||||
@ -46,10 +47,15 @@ public:
|
||||
BaseObjectPtr clone();
|
||||
|
||||
virtual const bool loadContent(BinProcessor& proc);
|
||||
|
||||
void serialize_attr(CP_ATTR_NODE);
|
||||
|
||||
static const ElementType type = typeSXFMLA;
|
||||
static const ElementType type = typeSXFMLA;
|
||||
|
||||
BaseObjectPtr m_SxFmla;
|
||||
std::vector<_sx_name> m_arPivotSxNames;
|
||||
//-------------------------------------------------------------------------
|
||||
GlobalWorkbookInfoPtr global_info;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -34,11 +34,15 @@
|
||||
|
||||
#include "SXFMLA_bu.h"
|
||||
#include "PIVOTRULE.h"
|
||||
#include "PRFILTER.h"
|
||||
|
||||
#include "../Biff_records/SXFormula.h"
|
||||
#include "../Biff_records/SxFmla.h"
|
||||
#include "../Biff_records/SxName.h"
|
||||
#include "../Biff_records/SXPair.h"
|
||||
#include "../Biff_records/SxItm.h"
|
||||
#include "../Biff_records/SxFilt.h"
|
||||
#include "../Biff_records/SxRule.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
@ -85,21 +89,52 @@ int SXFORMULA::serialize(std::wostream & strm)
|
||||
SXFMLA* fmla = dynamic_cast<SXFMLA*>(m_SXFMLA.get());
|
||||
if (!fmla) return 0;
|
||||
|
||||
SxFmla* sx_fmla = dynamic_cast<SxFmla*>(fmla->m_SxFmla.get());
|
||||
PIVOTRULE* pivot_rule = dynamic_cast<PIVOTRULE*>(m_PIVOTRULE.get());
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"calculatedItem")
|
||||
{
|
||||
CP_XML_ATTR(L"formula", sx_fmla->fmla.getAssembledFormula());
|
||||
|
||||
//for (size_t j = 0; j < global_info->arPivotSxNames.size(); j++)//???
|
||||
//{
|
||||
// SxName *name = dynamic_cast<SxName*>(global_info->arPivotSxNames[j].m_SxName.get());
|
||||
// CP_XML_NODE(L"pivotArea")
|
||||
// {
|
||||
// }
|
||||
//}
|
||||
fmla->serialize_attr(CP_GET_XML_NODE());
|
||||
|
||||
if (pivot_rule)
|
||||
{
|
||||
SxRule* rule = dynamic_cast<SxRule*>(pivot_rule->m_SxRule.get());
|
||||
|
||||
for (size_t j = 0; j < pivot_rule->m_arPRFILTER.size(); j++)//multi in pivotAreas !!! todooo ???
|
||||
{
|
||||
PRFILTER* filter = dynamic_cast<PRFILTER*>(pivot_rule->m_arPRFILTER[j].get());
|
||||
|
||||
SxItm* item = dynamic_cast<SxItm*>(filter->m_SxItm.get());
|
||||
SxFilt* filt = dynamic_cast<SxFilt*>(filter->m_SxFilt.get());
|
||||
|
||||
CP_XML_NODE(L"pivotArea")
|
||||
{
|
||||
CP_XML_ATTR(L"cacheIndex", 1);//true
|
||||
CP_XML_ATTR(L"outline", 0);
|
||||
CP_XML_ATTR(L"fieldPosition", (int)rule->iDim);
|
||||
|
||||
CP_XML_NODE(L"references")
|
||||
{
|
||||
CP_XML_ATTR(L"count", item->rgisxvi.size());
|
||||
|
||||
for (size_t i = 0; i < item->rgisxvi.size(); i++)
|
||||
{
|
||||
CP_XML_NODE(L"reference")
|
||||
{
|
||||
CP_XML_ATTR(L"field", (int)filt->isxvd);
|
||||
CP_XML_ATTR(L"count", (int)filt->iDim);
|
||||
|
||||
CP_XML_NODE(L"x")
|
||||
{
|
||||
CP_XML_ATTR(L"v", item->rgisxvi[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
@ -43,6 +43,8 @@ namespace XLS
|
||||
|
||||
SXOPER::SXOPER()
|
||||
{
|
||||
bFormula= false;
|
||||
|
||||
bString = false;
|
||||
bDate = false;
|
||||
bNumber = false;
|
||||
@ -66,10 +68,10 @@ const bool SXOPER::loadContent(BinProcessor& proc)
|
||||
if(proc.optional<SxNil>())
|
||||
{
|
||||
bEmpty = true;
|
||||
node = L"m";
|
||||
}
|
||||
else if(proc.optional<SXNum>())
|
||||
{
|
||||
|
||||
SXNum *num = dynamic_cast<SXNum*>(elements_.back().get());
|
||||
if (num)
|
||||
{
|
||||
@ -79,22 +81,36 @@ const bool SXOPER::loadContent(BinProcessor& proc)
|
||||
num->num.data.bytes.Byte4==0);
|
||||
}
|
||||
bNumber = !bInteger;
|
||||
node = L"n";
|
||||
value = std::to_wstring(num->num.data.value);
|
||||
}
|
||||
else if(proc.optional<SxBool>())
|
||||
{
|
||||
bBool = true;
|
||||
SxBool* b = dynamic_cast<SxBool*>(elements_.back().get());
|
||||
bBool = true;
|
||||
node = L"b";
|
||||
value = std::to_wstring(b->val);
|
||||
}
|
||||
else if(proc.optional<SxErr>())
|
||||
{
|
||||
SxErr* err = dynamic_cast<SxErr*>(elements_.back().get());
|
||||
bNumber = true;
|
||||
node = L"e";
|
||||
value = std::to_wstring(err->wbe);
|
||||
}
|
||||
else if(proc.optional<SXString>())
|
||||
{
|
||||
SXString* str = dynamic_cast<SXString*>(elements_.back().get());
|
||||
bString = true;
|
||||
node = L"s";
|
||||
value = str->value();
|
||||
}
|
||||
else if(proc.optional<SXDtr>())
|
||||
{
|
||||
bDate =true;
|
||||
SXDtr* dtr = dynamic_cast<SXDtr*>(elements_.back().get());
|
||||
bDate = true;
|
||||
node = L"d";
|
||||
value = dtr->value();
|
||||
}
|
||||
else
|
||||
return false;
|
||||
@ -102,14 +118,30 @@ const bool SXOPER::loadContent(BinProcessor& proc)
|
||||
m_element = elements_.back();
|
||||
elements_.pop_back();
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
int SXOPER::serialize(std::wostream & strm)
|
||||
{
|
||||
if (!m_element) return 0;
|
||||
if (node.empty()) return 0;
|
||||
|
||||
m_element->serialize(strm);
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(node)
|
||||
{
|
||||
if (!value.empty())
|
||||
{
|
||||
CP_XML_ATTR(L"v", value);
|
||||
}
|
||||
if (bFormula)
|
||||
{
|
||||
CP_XML_ATTR(L"f", 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -53,12 +53,17 @@ public:
|
||||
|
||||
BaseObjectPtr m_element;
|
||||
|
||||
bool bFormula;
|
||||
|
||||
bool bString;
|
||||
bool bDate;
|
||||
bool bNumber;
|
||||
bool bEmpty;
|
||||
bool bInteger;
|
||||
bool bBool;
|
||||
|
||||
std::wstring value;
|
||||
std::wstring node;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -140,8 +140,8 @@ int SXRANGE::serialize(std::wostream & strm)
|
||||
SXDtr* startDate = dynamic_cast<SXDtr*>(m_arSXDtr[0].get());
|
||||
SXDtr* endDate = dynamic_cast<SXDtr*>(m_arSXDtr[1].get());
|
||||
|
||||
CP_XML_ATTR(L"startDate", startDate->get_string_date());
|
||||
CP_XML_ATTR(L"endDate", endDate->get_string_date());
|
||||
CP_XML_ATTR(L"startDate", startDate->value());
|
||||
CP_XML_ATTR(L"endDate", endDate->value());
|
||||
}
|
||||
if (m_arSXNum.size() == 3)
|
||||
{
|
||||
|
||||
@ -35,6 +35,11 @@
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
struct _sxtbl_item
|
||||
{
|
||||
BaseObjectPtr item;
|
||||
std::vector<BaseObjectPtr> strings;
|
||||
};
|
||||
|
||||
class SXTBL: public CompositeObject
|
||||
{
|
||||
@ -47,8 +52,14 @@ public:
|
||||
|
||||
virtual const bool loadContent(BinProcessor& proc);
|
||||
|
||||
int serialize(std::wostream & stream);
|
||||
|
||||
static const ElementType type = typeSXTBL;
|
||||
|
||||
BaseObjectPtr m_SXTbl;
|
||||
std::vector<BaseObjectPtr> m_arDREF;
|
||||
std::vector<BaseObjectPtr> m_arSxTbpg;
|
||||
std::vector<_sxtbl_item> m_arSXTBRGIITM;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -65,6 +65,7 @@ public:
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
proc.repeated<SXString>(0, 0);
|
||||
return true;
|
||||
};
|
||||
@ -80,17 +81,55 @@ BaseObjectPtr SXTBL::clone()
|
||||
// SXTBL = SXTbl *DREF *SxTbpg *(SXTBRGIITM *SXString)
|
||||
const bool SXTBL::loadContent(BinProcessor& proc)
|
||||
{
|
||||
|
||||
if(!proc.mandatory<SXTbl>())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
proc.repeated<DREF>(0, 0);
|
||||
proc.repeated<SxTbpg>(0, 0);
|
||||
proc.repeated<Parenthesis_SXTBL_1>(0, 0);
|
||||
|
||||
m_SXTbl = elements_.back();
|
||||
elements_.pop_back();
|
||||
|
||||
int count =0;
|
||||
|
||||
count = proc.repeated<DREF>(0, 0);
|
||||
while(!elements_.empty())
|
||||
{
|
||||
m_arDREF.push_back(elements_.front());
|
||||
elements_.pop_front();
|
||||
}
|
||||
|
||||
count = proc.repeated<SxTbpg>(0, 0);
|
||||
while(!elements_.empty())
|
||||
{
|
||||
m_arSxTbpg.push_back(elements_.front());
|
||||
elements_.pop_front();
|
||||
}
|
||||
|
||||
count = proc.repeated<Parenthesis_SXTBL_1>(0, 0);
|
||||
while(!elements_.empty())
|
||||
{
|
||||
SXTBRGIITM* item = dynamic_cast<SXTBRGIITM*>(elements_.front().get());
|
||||
|
||||
if (item)
|
||||
{
|
||||
_sxtbl_item it;
|
||||
it.item = elements_.front();
|
||||
m_arSXTBRGIITM.push_back(it);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_arSXTBRGIITM.back().strings.push_back(elements_.front());
|
||||
}
|
||||
elements_.pop_front();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
int SXTBL::serialize(std::wostream & stream)
|
||||
{
|
||||
if (!m_SXTbl) return 0;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -118,6 +118,8 @@ GlobalWorkbookInfo::GlobalWorkbookInfo(const unsigned short code_page, XlsConver
|
||||
|
||||
defaultDigitFontSize = std::pair<float, float>(0, 0);
|
||||
applicationFonts = NULL;
|
||||
|
||||
idPivotCache = 0;
|
||||
}
|
||||
|
||||
GlobalWorkbookInfo::~GlobalWorkbookInfo()
|
||||
|
||||
@ -105,10 +105,14 @@ public:
|
||||
unsigned int last_AXES_id;
|
||||
const static unsigned int initial_AXES_id = 0x2000000;
|
||||
|
||||
short idPivotCache;
|
||||
std::map<int, BaseObjectPtr> mapPivotCache;
|
||||
std::vector<bool> arPivotCacheFields;
|
||||
std::vector<bool> arPivotCacheFieldShortSize;
|
||||
|
||||
std::vector<_sx_name> arPivotSxNames;
|
||||
std::vector<std::wstring> arPivotCacheSxNames;
|
||||
std::vector<std::wstring> arPivotCacheReferences;
|
||||
|
||||
std::map<std::wstring, std::vector<std::wstring>> mapDefineNames;
|
||||
std::vector<std::wstring> arDefineNames;
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user