mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-24 10:54:12 +08:00
Compare commits
24 Commits
v4.5.dev.2
...
v4.5.dev.5
| Author | SHA1 | Date | |
|---|---|---|---|
| 3ff5233ea4 | |||
| 4c7ab6e616 | |||
| a88ad0c279 | |||
| cf5458c761 | |||
| 9115edbd78 | |||
| 3f18f96171 | |||
| 8a75916944 | |||
| da45eb4f33 | |||
| 59d75ed148 | |||
| ccc4d751d0 | |||
| a020d3dbf9 | |||
| 7852b7fbe8 | |||
| a64fd8792d | |||
| 32448298a3 | |||
| b3384f1466 | |||
| 93274395a9 | |||
| 2726e14445 | |||
| 75e32a1562 | |||
| 8c2637b89c | |||
| ef389872df | |||
| 6fc611fdfc | |||
| a975cb8261 | |||
| afcf6b079e | |||
| 3ed2224f93 |
@ -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;
|
||||
|
||||
@ -87,9 +87,10 @@ public:
|
||||
std::wstring convert_conditional_formula(std::wstring const & expr);
|
||||
|
||||
// Лист1!$A$1 -> $Лист1.$A$1
|
||||
std::wstring convert_named_ref(std::wstring const & expr);
|
||||
std::wstring convert_named_ref (std::wstring const & expr);
|
||||
std::wstring convert_named_formula(std::wstring const & expr);
|
||||
|
||||
std::wstring find_base_cell(std::wstring const & expr);
|
||||
std::wstring get_base_cell_formula(std::wstring const & expr);
|
||||
|
||||
//Sheet2!C3:C19 -> Sheet2.C3:Sheet2.C19
|
||||
std::wstring convert_chart_distance(std::wstring const & expr);
|
||||
|
||||
@ -57,6 +57,7 @@ namespace formulasconvert {
|
||||
static std::wstring replace_named_ref_formater1(boost::wsmatch const & what);
|
||||
static std::wstring replace_cell_range_formater(boost::wsmatch const & what);
|
||||
|
||||
void replace_named_formula(std::wstring & expr, bool w = true);
|
||||
void replace_named_ref(std::wstring & expr, bool w = true);
|
||||
bool find_first_ref(std::wstring const & expr, std::wstring & table, std::wstring & ref);
|
||||
bool find_first_last_ref(std::wstring const & expr, std::wstring & table, std::wstring & ref_first,std::wstring & ref_last);
|
||||
@ -263,15 +264,12 @@ namespace formulasconvert {
|
||||
return what[2].str();
|
||||
else if (what[3].matched)
|
||||
return what[3].str();
|
||||
//else if (what[4].matched)
|
||||
// return what[4].str();
|
||||
else
|
||||
return L"";
|
||||
}
|
||||
|
||||
// TODO
|
||||
// заменить точки с запятой во всех вхождениях кроме находящихся в кавычках --*и в фигурных скобках*--
|
||||
// TODO: проверить как сохраняются кавычки в строке
|
||||
void odf2oox_converter::Impl::replace_semicolons(std::wstring& expr)
|
||||
{
|
||||
const std::wstring res = boost::regex_replace(
|
||||
|
||||
@ -43,6 +43,7 @@ namespace formulasconvert {
|
||||
class oox2odf_converter::Impl
|
||||
{
|
||||
public:
|
||||
|
||||
std::wstring convert(const std::wstring& expr);
|
||||
std::wstring convert_formula(const std::wstring& expr);
|
||||
std::wstring convert_conditional_formula(const std::wstring& expr);
|
||||
@ -59,93 +60,17 @@ public:
|
||||
static std::wstring replace_arguments(boost::wsmatch const & what);
|
||||
static std::wstring convert_scobci(boost::wsmatch const & what);
|
||||
|
||||
std::wstring replace_arguments1(std::wstring & workstr);
|
||||
|
||||
void replace_named_ref(std::wstring & expr);
|
||||
void replace_named_formula(std::wstring & expr);
|
||||
|
||||
std::wstring find_base_cell(const std::wstring & expr);
|
||||
static bool isFindBaseCell_;
|
||||
|
||||
// bool find_first_ref(std::wstring const & expr, std::wstring & table, std::wstring & ref);
|
||||
//bool find_first_last_ref(std::wstring const & expr, std::wstring & table, std::wstring & ref_first,std::wstring & ref_last);
|
||||
static std::wstring base_cell_formula_;
|
||||
};
|
||||
////Table!.$A$1:$A2 -> ref $A$1 -> ref $A$2
|
||||
//bool oox2odf_converter::Impl::find_first_last_ref(std::wstring const & expr, std::wstring & table,std::wstring & ref_first,std::wstring & ref_last)
|
||||
//{
|
||||
// std::vector< std::wstring > splitted;
|
||||
//
|
||||
// boost::algorithm::split(splitted, expr, boost::algorithm::is_any_of(L".:"), boost::algorithm::token_compress_on);
|
||||
//
|
||||
// if (splitted.size()>2)
|
||||
// {
|
||||
// table = splitted[0];
|
||||
// ref_first = splitted[1];
|
||||
// ref_last = splitted[2];
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
//}
|
||||
// // =[.A1]+[.B1] -> table = ""; ref = "A1"
|
||||
// // of:=['Sheet2 A'.B2] -> table= "Sheet2 A"; ref = "B2"
|
||||
//
|
||||
//bool oox2odf_converter::Impl::find_first_ref(std::wstring const & expr, std::wstring & table, std::wstring & ref)
|
||||
//{
|
||||
// boost::wregex re(L"\\[(?:\\$)?([^\\.]+?){0,1}\\.([a-zA-Z\\$]+\\d+)(?::\\.([a-zA-Z]+\\d+)){0,1}\\]");
|
||||
// boost::wsmatch result;
|
||||
// bool b = boost::regex_search(expr, result, re);
|
||||
//
|
||||
// size_t sz = result.size();
|
||||
// if (sz == 4 && !result[1].matched)
|
||||
// {
|
||||
// table = L"";
|
||||
// ref = result[2].str();
|
||||
// return true;
|
||||
// }
|
||||
// else if (sz == 4 && result[1].matched)
|
||||
// {
|
||||
// table = result[1].str();
|
||||
// XmlUtils::replace_all( table, L"$", L"");
|
||||
// XmlUtils::replace_all( table, L"'", L"");
|
||||
// ref = result[2].str();
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
//}
|
||||
//
|
||||
//namespace
|
||||
//{
|
||||
//
|
||||
//std::wstring replace_cell_range_formater(boost::wsmatch const & what)
|
||||
//{
|
||||
// const size_t sz = what.size();
|
||||
// if (sz == 4 && !what[1].matched)
|
||||
// {
|
||||
// const std::wstring c1 = what[2].str();
|
||||
// const std::wstring c2 = what[3].str();
|
||||
// const std::wstring s = c1 + (c2.empty() ? L"" : (L":" + c2) );
|
||||
// return s;
|
||||
// }
|
||||
// else if (sz == 4 && what[1].matched)
|
||||
// {
|
||||
// std::wstring sheet1 = what[1].str();
|
||||
// XmlUtils::replace_all( sheet1, L"$", L"");
|
||||
//
|
||||
// const std::wstring c1 = what[2].str();
|
||||
// const std::wstring c2 = what[3].str();
|
||||
// const std::wstring s = sheet1 + L"!" + c1 + (c2.empty() ? L"" : (L":" + c2) );
|
||||
// return s;
|
||||
// }
|
||||
// return L"";
|
||||
//}
|
||||
//
|
||||
//}
|
||||
//
|
||||
|
||||
// заменяем формат адресации ячеек НАОБОРОТ
|
||||
// [.A1] -> A1
|
||||
// [.A1:.B5] -> A1:B5
|
||||
// [Sheet2.A1:B5] -> Sheet2!A1:B5
|
||||
// [Sheet2.A1] -> Sheet2!A1
|
||||
// [$'Sheet2 A'.$B2] -> 'Sheet2 A'!$B2
|
||||
bool oox2odf_converter::Impl::isFindBaseCell_ = false;
|
||||
std::wstring oox2odf_converter::Impl::base_cell_formula_ = L"";
|
||||
|
||||
void oox2odf_converter::Impl::replace_cells_range(std::wstring& expr)
|
||||
{
|
||||
boost::wregex re(L"([:$!])+");
|
||||
@ -155,8 +80,10 @@ void oox2odf_converter::Impl::replace_cells_range(std::wstring& expr)
|
||||
|
||||
if (b)
|
||||
{
|
||||
boost::wregex re1(L"(\\$?\\w+\\!)?([a-zA-Z$]+\\d{1,})\\:?([a-zA-Z$]+\\d{1,})?");
|
||||
// $ Sheet2 ! $ A1 : $ B5
|
||||
boost::wregex re1(L"(\\$?\\w+\\!)?([a-zA-Z$]*\\d*)\\:?([a-zA-Z$]*\\d*)?");
|
||||
// $ Sheet2 ! $ A1 : $ B5
|
||||
// $ Sheet2 ! $ A : $ A
|
||||
// $ Sheet2 ! $ 1 : $ 1
|
||||
std::wstring workstr = expr;
|
||||
|
||||
std::wstring res = boost::regex_replace(
|
||||
@ -178,19 +105,28 @@ std::wstring oox2odf_converter::Impl::replace_cells_range_formater1(boost::wsmat
|
||||
{
|
||||
const size_t sz = what.size();
|
||||
|
||||
if (sz>3)
|
||||
if (sz > 3)
|
||||
{
|
||||
std::wstring sheet1 = what[1].matched ? what[1].str() : L"";
|
||||
XmlUtils::replace_all( sheet1, L"!", L"");
|
||||
std::wstring s;
|
||||
std::wstring sheet = what[1].matched ? what[1].str() : L"";
|
||||
|
||||
std::wstring c1 = what[2].str();
|
||||
std::wstring c2 = what[3].str();
|
||||
int res=0;
|
||||
if (sheet1.length() > 0 && (res = c1.find(L"$")) >=0) sheet1 = L"$" + sheet1;
|
||||
|
||||
if (!c1.empty() || !c2.empty() || !sheet.empty())
|
||||
{
|
||||
XmlUtils::replace_all( sheet, L"!", L"");
|
||||
|
||||
const std::wstring s = std::wstring(L"[") + sheet1 + L"." +
|
||||
c1 +
|
||||
(c2.empty() ? L"" : (L":" + sheet1 + L"." + c2) ) + std::wstring(L"]");
|
||||
if (isFindBaseCell_ && base_cell_formula_.empty() && !sheet.empty())
|
||||
{
|
||||
base_cell_formula_ = sheet + L".$A$1";
|
||||
}
|
||||
if (!sheet.empty() && (std::wstring::npos != c1.find(L"$"))) sheet = L"$" + sheet;
|
||||
|
||||
s = std::wstring(L"[") + sheet + L"." +
|
||||
c1 +
|
||||
(c2.empty() ? L"" : (L":" + sheet + L"." + c2) ) + std::wstring(L"]");
|
||||
}
|
||||
return s;
|
||||
}
|
||||
else
|
||||
@ -209,7 +145,7 @@ std::wstring oox2odf_converter::Impl::replace_cells_range_formater2(boost::wsmat
|
||||
{
|
||||
const size_t sz = what.size();
|
||||
|
||||
if (sz>2)
|
||||
if (sz > 2)
|
||||
{
|
||||
const std::wstring c1 = what[1].str();
|
||||
const std::wstring c2 = what[2].str();
|
||||
@ -222,39 +158,22 @@ std::wstring oox2odf_converter::Impl::replace_cells_range_formater2(boost::wsmat
|
||||
return L"";
|
||||
|
||||
}
|
||||
|
||||
//namespace {
|
||||
//
|
||||
//std::wstring replace_named_ref_formater(boost::wsmatch const & what)
|
||||
//{
|
||||
// const size_t sz = what.size();
|
||||
//
|
||||
// if (sz == 4 && !what[1].matched)
|
||||
// {
|
||||
// const std::wstring c1 = what[2].str();
|
||||
// const std::wstring c2 = what[3].str();
|
||||
// const std::wstring s = c1 + (c2.empty() ? L"" : (L":" + c2) );
|
||||
// return s;
|
||||
// }
|
||||
// else if (sz == 4 && what[1].matched)
|
||||
// {
|
||||
// std::wstring sheet1 = what[1].str();
|
||||
// XmlUtils::replace_all( sheet1, L"$", L"");
|
||||
//
|
||||
// const std::wstring c1 = what[2].str();
|
||||
// const std::wstring c2 = what[3].str();
|
||||
// const std::wstring s = sheet1 + L"!" + c1 + (c2.empty() ? L"" : (L":" + c2) );
|
||||
// return s;
|
||||
// }
|
||||
// return L"";
|
||||
//}
|
||||
//
|
||||
//}
|
||||
|
||||
void oox2odf_converter::Impl::replace_named_formula(std::wstring & expr)
|
||||
{
|
||||
base_cell_formula_.clear();
|
||||
|
||||
isFindBaseCell_ = true;
|
||||
expr = convert_formula(expr);
|
||||
isFindBaseCell_ = false;
|
||||
}
|
||||
|
||||
// Лист1!$A$1 -> $Лист1.$A$1
|
||||
|
||||
void oox2odf_converter::Impl::replace_named_ref(std::wstring & expr)
|
||||
{
|
||||
base_cell_formula_.clear();
|
||||
|
||||
isFindBaseCell_ = true;
|
||||
std::wstring workstr = expr, out;
|
||||
|
||||
replace_vertical(workstr);
|
||||
@ -264,8 +183,10 @@ void oox2odf_converter::Impl::replace_named_ref(std::wstring & expr)
|
||||
|
||||
boost::algorithm::split(distance,workstr, boost::algorithm::is_any_of(L";"), boost::algorithm::token_compress_on);
|
||||
|
||||
BOOST_FOREACH(std::wstring &d, distance)
|
||||
for (size_t i = 0; i < distance.size(); i++)
|
||||
{
|
||||
std::wstring &d = distance[i];
|
||||
|
||||
XmlUtils::replace_all( d, L"(", L"SCOBCAIN");
|
||||
XmlUtils::replace_all( d, L")", L"SCOBCAOUT");
|
||||
XmlUtils::replace_all( d, L" ", L"PROBEL");
|
||||
@ -283,21 +204,9 @@ void oox2odf_converter::Impl::replace_named_ref(std::wstring & expr)
|
||||
out = out + d + std::wstring(L";");
|
||||
}
|
||||
|
||||
if (out.length()>0) expr = out.substr(0,out.length()-1);
|
||||
if (!out.empty()) expr = out.substr(0, out.length() - 1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
std::wstring oox2odf_converter::Impl::find_base_cell(const std::wstring & expr)
|
||||
{
|
||||
std::vector< std::wstring > splitted;
|
||||
boost::algorithm::split(splitted, expr, boost::algorithm::is_any_of(L"!"), boost::algorithm::token_compress_on);
|
||||
|
||||
if (splitted.size()>1)
|
||||
{
|
||||
return splitted[0] + L".$A$1";
|
||||
}
|
||||
else return L"";
|
||||
isFindBaseCell_ = false;
|
||||
}
|
||||
|
||||
|
||||
@ -440,32 +349,6 @@ std::wstring replace_(boost::wsmatch const & what)
|
||||
|
||||
return L"";
|
||||
}
|
||||
std::wstring oox2odf_converter::Impl::replace_arguments1(std::wstring & workstr1)
|
||||
{
|
||||
std::wstring out;
|
||||
|
||||
std::wstring workstr = workstr1;
|
||||
|
||||
replace_vertical(workstr);
|
||||
replace_semicolons(workstr);
|
||||
|
||||
std::vector<std::wstring> distance;
|
||||
|
||||
boost::algorithm::split(distance,workstr, boost::algorithm::is_any_of(L";"), boost::algorithm::token_compress_on);
|
||||
|
||||
BOOST_FOREACH(std::wstring &d, distance)
|
||||
{
|
||||
|
||||
replace_cells_range(d);
|
||||
|
||||
out = out + d + std::wstring(L";");
|
||||
}
|
||||
|
||||
if (out.length()>0) out = out.substr(0,out.length()-1);
|
||||
|
||||
|
||||
return out ;
|
||||
}
|
||||
std::wstring oox2odf_converter::Impl::convert_scobci(boost::wsmatch const & what)
|
||||
{
|
||||
if (what[1].matched)
|
||||
@ -506,33 +389,31 @@ std::wstring oox2odf_converter::Impl::replace_arguments(boost::wsmatch const &
|
||||
|
||||
int sz = what.size();
|
||||
|
||||
std::wstring c1= what[1].str();
|
||||
std::wstring c2= what[2].str();
|
||||
std::wstring c3= what[3].str();
|
||||
|
||||
if (what[1].matched)
|
||||
{
|
||||
std::wstring workstr = what[1].str();
|
||||
replace_vertical(workstr);
|
||||
replace_semicolons(workstr);
|
||||
|
||||
out = what[1].str();
|
||||
}
|
||||
else if (what[2].matched)
|
||||
{
|
||||
out = what[2].str();
|
||||
}
|
||||
if (!out.empty())
|
||||
{
|
||||
std::vector<std::wstring> distance;
|
||||
|
||||
boost::algorithm::split(distance,workstr, boost::algorithm::is_any_of(L";"), boost::algorithm::token_compress_on);
|
||||
boost::algorithm::split(distance, out, boost::algorithm::is_any_of(L";"), boost::algorithm::token_compress_on);
|
||||
|
||||
BOOST_FOREACH(std::wstring &d, distance)
|
||||
{
|
||||
|
||||
replace_cells_range(d);
|
||||
out = L"";
|
||||
for (size_t i = 0; i < distance.size(); i++)
|
||||
{
|
||||
replace_cells_range(distance[i]);
|
||||
|
||||
out = out + d + std::wstring(L";");
|
||||
out = out + distance[i] + std::wstring(L";");
|
||||
}
|
||||
|
||||
if (out.length()>0) out = out.substr(0,out.length()-1);
|
||||
if (!out.empty()) out = out.substr(0, out.length() - 1);
|
||||
|
||||
}
|
||||
else if (what[2].matched)
|
||||
out = what[2].str();
|
||||
else if (what[3].matched)
|
||||
out = what[3].str();
|
||||
return out ;
|
||||
@ -560,7 +441,7 @@ std::wstring oox2odf_converter::Impl::convert_formula(const std::wstring & expr)
|
||||
|
||||
std::wstring res = boost::regex_replace(
|
||||
res1,
|
||||
boost::wregex(L"(?:(?=[()])(.*?)(?=[)]))"),
|
||||
boost::wregex(L"(?!([a-zA-Z]+\\d*\\())(([a-zA-Z]+\\!)?\\$?[a-zA-Z]*\\$?\\d*(\\:\\$?[a-zA-Z]*\\$?\\d*){0,1})"),
|
||||
&oox2odf_converter::Impl::replace_arguments, boost::match_default | boost::format_all);
|
||||
|
||||
if (res1 == res)
|
||||
@ -572,10 +453,6 @@ std::wstring oox2odf_converter::Impl::convert_formula(const std::wstring & expr)
|
||||
boost::wregex(L"(\\$?\\w+\\!)?([a-zA-Z$]+\\d{1,})\\:?([a-zA-Z$]+\\d{1,})?"),
|
||||
&replace_cells_range_formater1,
|
||||
boost::match_default | boost::format_all);
|
||||
|
||||
|
||||
replace_vertical(res);
|
||||
replace_semicolons(res);
|
||||
}
|
||||
|
||||
XmlUtils::replace_all( res, L"SCOBCAIN", L"(");
|
||||
@ -584,12 +461,16 @@ std::wstring oox2odf_converter::Impl::convert_formula(const std::wstring & expr)
|
||||
XmlUtils::replace_all( res, L"KVADRATIN", L"[");
|
||||
XmlUtils::replace_all( res, L"KVADRATOUT", L"]");
|
||||
|
||||
XmlUtils::replace_all( res, L"PROBEL", L" ");
|
||||
|
||||
XmlUtils::replace_all( res, L"APOSTROF", L"'");
|
||||
|
||||
XmlUtils::replace_all( res, L"KAVYCHKA", L"\"");
|
||||
|
||||
replace_vertical(res);
|
||||
replace_semicolons(res);
|
||||
|
||||
XmlUtils::replace_all( res, L"PROBEL", L" ");
|
||||
|
||||
return std::wstring(L"of:=") + res;
|
||||
|
||||
}
|
||||
@ -600,12 +481,12 @@ std::wstring oox2odf_converter::Impl::convert_conditional_formula(const std::wst
|
||||
std::wstring res1 = boost::regex_replace(
|
||||
workstr,
|
||||
boost::wregex(L"('.*?')|(\".*?\")"),
|
||||
&oox2odf_converter::Impl::convert_scobci,boost::match_default | boost::format_all);
|
||||
&oox2odf_converter::Impl::convert_scobci, boost::match_default | boost::format_all);
|
||||
|
||||
std::wstring res = boost::regex_replace(
|
||||
res1,
|
||||
boost::wregex(L"(?:(?=[()])(.*?)(?=[)]))"),
|
||||
&oox2odf_converter::Impl::replace_arguments,boost::match_default | boost::format_all);
|
||||
&oox2odf_converter::Impl::replace_arguments, boost::match_default | boost::format_all);
|
||||
|
||||
if (res1 == res)
|
||||
{
|
||||
@ -614,20 +495,21 @@ std::wstring oox2odf_converter::Impl::convert_conditional_formula(const std::wst
|
||||
&replace_cells_range_formater1,
|
||||
boost::match_default | boost::format_all);
|
||||
|
||||
replace_vertical(res);
|
||||
replace_semicolons(res);
|
||||
}
|
||||
|
||||
XmlUtils::replace_all( res, L"SCOBCAIN", L"(");
|
||||
XmlUtils::replace_all( res, L"SCOBCAOUT", L")");
|
||||
|
||||
XmlUtils::replace_all( res, L"PROBEL", L" ");
|
||||
|
||||
XmlUtils::replace_all( res, L"APOSTROF", L"'");
|
||||
|
||||
XmlUtils::replace_all( res, L"KAVYCHKA", L"\"");
|
||||
|
||||
return res;
|
||||
replace_vertical(res);
|
||||
replace_semicolons(res);
|
||||
|
||||
XmlUtils::replace_all( res, L"PROBEL", L" ");
|
||||
|
||||
return res;
|
||||
|
||||
}
|
||||
//Sheet2!C3:C19,Sheet2!L27:L34
|
||||
@ -726,9 +608,15 @@ std::wstring oox2odf_converter::convert_named_ref(const std::wstring& expr)
|
||||
impl_->replace_named_ref(workstr);
|
||||
return workstr;
|
||||
}
|
||||
std::wstring oox2odf_converter::find_base_cell(const std::wstring& expr)
|
||||
std::wstring oox2odf_converter::convert_named_formula(const std::wstring& expr)
|
||||
{
|
||||
return impl_->find_base_cell(expr);
|
||||
std::wstring workstr = expr;
|
||||
impl_->replace_named_formula(workstr);
|
||||
return workstr;
|
||||
}
|
||||
std::wstring oox2odf_converter::get_base_cell_formula(const std::wstring& expr)
|
||||
{
|
||||
return impl_->base_cell_formula_;
|
||||
}
|
||||
|
||||
|
||||
@ -840,14 +728,6 @@ int oox2odf_converter::get_count_value_points(std::wstring expr)
|
||||
return count;
|
||||
}
|
||||
|
||||
//bool oox2odf_converter::find_first_ref(std::wstring const & expr, std::wstring & table, std::wstring & ref)
|
||||
//{
|
||||
// return impl_->find_first_ref(expr, table, ref);
|
||||
//}
|
||||
//bool oox2odf_converter::find_first_last_ref(std::wstring const & expr, std::wstring & table, std::wstring & ref_first,std::wstring & ref_last)
|
||||
//{
|
||||
// return impl_->find_first_last_ref(expr, table, ref_first,ref_last);
|
||||
//}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -189,14 +189,14 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
|
||||
CP_XML_STREAM() << impl_->hyperlinks_.str();
|
||||
}
|
||||
}
|
||||
|
||||
CP_XML_STREAM() << impl_->drawing_.str();
|
||||
|
||||
if (!impl_->page_props_.str().empty())
|
||||
{
|
||||
CP_XML_STREAM() << impl_->page_props_.str();
|
||||
}//props выше legacyDrawing !!
|
||||
|
||||
CP_XML_STREAM() << impl_->drawing_.str();
|
||||
|
||||
if (impl_->commentsId_.length()>0)
|
||||
{
|
||||
CP_XML_NODE(L"legacyDrawing")
|
||||
|
||||
@ -138,7 +138,8 @@ void ods_table_context::add_defined_range(const std::wstring & name, const std::
|
||||
std::wstring odf_range = formulas_converter.convert_named_ref(cell_range);//todo - разделить конвертацию диапазонов/рэнжей на c [] и без
|
||||
XmlUtils::replace_all( odf_range, L"[", L"");
|
||||
XmlUtils::replace_all( odf_range, L"]", L"");
|
||||
std::wstring odf_base_cell = formulas_converter.find_base_cell(cell_range);
|
||||
|
||||
std::wstring odf_base_cell = formulas_converter.get_base_cell_formula(cell_range);
|
||||
|
||||
named_range->table_name_ = name;
|
||||
named_range->table_cell_range_address_ = odf_range;
|
||||
@ -181,8 +182,8 @@ void ods_table_context::add_defined_expression(const std::wstring & name, const
|
||||
|
||||
formulasconvert::oox2odf_converter formulas_converter;
|
||||
|
||||
std::wstring odf_value = formulas_converter.convert_named_ref(value);
|
||||
std::wstring odf_base_cell = formulas_converter.find_base_cell(value);
|
||||
std::wstring odf_value = formulas_converter.convert_named_formula(value);
|
||||
std::wstring odf_base_cell = formulas_converter.get_base_cell_formula(value);
|
||||
|
||||
named_expression->table_name_ = name;
|
||||
named_expression->table_expression_ = odf_value;
|
||||
@ -215,10 +216,9 @@ void ods_table_context::add_defined_expression(const std::wstring & name, const
|
||||
table_defined_expressions_.root->add_child_element(elm);
|
||||
}
|
||||
|
||||
if (odf_base_cell.length() > 0)
|
||||
if (!odf_base_cell.empty())
|
||||
named_expression->table_base_cell_address_ = odf_base_cell;
|
||||
|
||||
|
||||
table_defined_expressions_.elements.push_back(elm);
|
||||
}
|
||||
|
||||
|
||||
@ -601,12 +601,14 @@ void CPPTUserInfo::LoadNotes(DWORD dwNoteID, CSlide* pNotes)
|
||||
|
||||
CSlideInfo* pNotesWrapper = &m_arNotesWrapper.back();
|
||||
|
||||
int indexUser = pRecordSlide->m_IndexUser;
|
||||
int indexUser = pRecordSlide->m_IndexUser;
|
||||
|
||||
if (m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures.empty())
|
||||
pNotesWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[0]->m_arOffsetPictures;
|
||||
else
|
||||
pNotesWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures;
|
||||
|
||||
pNotesWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures;
|
||||
pNotesWrapper->m_mapFilePictures = &m_pDocumentInfo->m_mapStoreImageFile;
|
||||
|
||||
//грузим placeholder
|
||||
pNotesWrapper->m_arTextPlaceHolders = pRecordSlide->m_oPersist.m_arTextAttrs;
|
||||
|
||||
std::vector<CRecordNotesAtom*> oArrayNotesAtoms;
|
||||
@ -627,6 +629,9 @@ void CPPTUserInfo::LoadNotes(DWORD dwNoteID, CSlide* pNotes)
|
||||
//????? у заметок нет слайда !!!
|
||||
}
|
||||
//-----------------------------------------------------
|
||||
size_t index = pPairSlide->second->m_Index;
|
||||
if (index >= m_arSlides.size())
|
||||
return;
|
||||
CSlide* pSlide = m_arSlides[pPairSlide->second->m_Index];
|
||||
|
||||
pNotes->m_lSlideID = pPairSlide->second->m_Index;
|
||||
@ -796,12 +801,14 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
|
||||
|
||||
CSlideInfo* pSlideWrapper = &m_arSlideWrapper.back();
|
||||
|
||||
int indexUser = pRecordSlide->m_IndexUser;
|
||||
int indexUser = pRecordSlide->m_IndexUser;
|
||||
|
||||
pSlideWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures;
|
||||
if (m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures.empty())
|
||||
pSlideWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[0]->m_arOffsetPictures;
|
||||
else
|
||||
pSlideWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures;
|
||||
|
||||
pSlideWrapper->m_mapFilePictures = &m_pDocumentInfo->m_mapStoreImageFile;
|
||||
|
||||
// вот, грузим placeholder
|
||||
pSlideWrapper->m_arTextPlaceHolders = pRecordSlide->m_oPersist.m_arTextAttrs;
|
||||
|
||||
// записываем шрифты
|
||||
@ -1402,7 +1409,11 @@ void CPPTUserInfo::LoadMainMaster(DWORD dwMasterID, const LONG& lOriginWidth, co
|
||||
indexUser = pPairMaster1->second->m_IndexUser;
|
||||
pMasterWrapper->m_arTextPlaceHolders = pPairMaster1->second->m_oPersist.m_arTextAttrs;
|
||||
}
|
||||
pMasterWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures;
|
||||
if (m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures.empty() == false)
|
||||
pMasterWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[indexUser]->m_arOffsetPictures;
|
||||
else
|
||||
pMasterWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[0]->m_arOffsetPictures;
|
||||
|
||||
pMasterWrapper->m_mapFilePictures = &m_pDocumentInfo->m_mapStoreImageFile;
|
||||
|
||||
// читаем настройки текстовых стилей -----------------------------------------------
|
||||
@ -1784,11 +1795,13 @@ void CPPTUserInfo::LoadNoMainMaster(DWORD dwMasterID, const LONG& lOriginWidth,
|
||||
|
||||
CSlideInfo* pMasterWrapper = &m_arMasterWrapper[m_arMasterWrapper.size() - 1];
|
||||
|
||||
// вот, грузим placeholder
|
||||
pMasterWrapper->m_arTextPlaceHolders = pCurMaster->m_oPersist.m_arTextAttrs;
|
||||
|
||||
pMasterWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[pCurMaster->m_IndexUser]->m_arOffsetPictures;
|
||||
pMasterWrapper->m_arTextPlaceHolders = pCurMaster->m_oPersist.m_arTextAttrs;
|
||||
pMasterWrapper->m_mapFilePictures = &m_pDocumentInfo->m_mapStoreImageFile;
|
||||
|
||||
if (m_pDocumentInfo->m_arUsers[pCurMaster->m_IndexUser]->m_arOffsetPictures.empty() == false)
|
||||
pMasterWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[pCurMaster->m_IndexUser]->m_arOffsetPictures;
|
||||
else
|
||||
pMasterWrapper->m_parEmptyPictures = &m_pDocumentInfo->m_arUsers[0]->m_arOffsetPictures;
|
||||
|
||||
std::map<DWORD, LONG>::iterator pPairTheme = m_mapMasterToTheme.find(dwID);
|
||||
|
||||
|
||||
@ -232,10 +232,12 @@ void CPPTFileReader::ReadPictures()
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (pStream->isEOF())
|
||||
break;
|
||||
//if (pStream->isEOF()) случаются неверно записанные стримы
|
||||
// break;
|
||||
|
||||
int pos = pStream->getStreamPointer();
|
||||
if (pos >= pStream->getStreamSize())
|
||||
break;
|
||||
|
||||
SRecordHeader oHeader;
|
||||
if (pDecryptor)
|
||||
@ -256,6 +258,9 @@ void CPPTFileReader::ReadPictures()
|
||||
else
|
||||
oHeader.ReadFromStream(pStream->stream_);
|
||||
|
||||
if (oHeader.RecType == 0 && oHeader.RecLen == 0 )
|
||||
break;// окончание стрима забито нулями (выравнивание)
|
||||
|
||||
CRecordOfficeArtBlip art_blip;
|
||||
art_blip.m_strTmpDirectory = m_strTmpDirectory;
|
||||
art_blip.m_oDocumentInfo = &m_oDocumentInfo;
|
||||
|
||||
@ -250,12 +250,26 @@ namespace PPTX
|
||||
}
|
||||
else if (L"oleObj" == strName)
|
||||
{
|
||||
olePic = oNode.ReadNode(L"p:pic");
|
||||
olePic = oNode.ReadNode(L"p:pic"); //нормальный вариант объекта
|
||||
if (olePic.IsInit())
|
||||
{
|
||||
olePic->fromXMLOle(oNode);
|
||||
result = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
olePic.Init(); //старый вариант описания объекта через spid в VmlDrawing
|
||||
olePic->spPr.xfrm;
|
||||
|
||||
Logic::PrstGeom* geom = new Logic::PrstGeom();
|
||||
geom->prst = L"rect";
|
||||
olePic->spPr.Geometry.m_geometry.reset(geom);
|
||||
|
||||
olePic->fromXMLOle(oNode);
|
||||
result = true;
|
||||
}
|
||||
if (olePic->spPr.xfrm.IsInit() == false)
|
||||
olePic->spPr.xfrm = xfrm;
|
||||
}
|
||||
else if (L"AlternateContent" == strName)
|
||||
{
|
||||
|
||||
@ -619,6 +619,45 @@ namespace PPTX
|
||||
if(oleObject.IsInit())
|
||||
{
|
||||
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 = parentFileAs<PPTX::Slide>().Vml.operator->();
|
||||
|
||||
std::map<std::wstring, OOX::CVmlDrawing::_vml_shape>::iterator pPair = pVml->m_mapShapes.find(*oleObject->m_sShapeId);
|
||||
if (pVml->m_mapShapes.end() != pPair)
|
||||
{
|
||||
pPair->second.bUsed = true;
|
||||
OOX::Vml::CShape* pShape = dynamic_cast<OOX::Vml::CShape*>(pPair->second.pElement);
|
||||
for(size_t j = 0; (pShape) && (j < pShape->m_arrItems.size()); ++j)
|
||||
{
|
||||
OOX::WritingElement* pChildElemShape = pShape->m_arrItems[j];
|
||||
if(OOX::et_v_imagedata == pChildElemShape->getType())
|
||||
{
|
||||
OOX::Vml::CImageData* pImageData = static_cast<OOX::Vml::CImageData*>(pChildElemShape);
|
||||
|
||||
std::wstring sIdImageFileCache;
|
||||
|
||||
if (pImageData->m_oRelId.IsInit()) sIdImageFileCache = pImageData->m_oRelId->GetValue();
|
||||
else if (pImageData->m_rId.IsInit()) sIdImageFileCache = pImageData->m_rId->GetValue();
|
||||
|
||||
if (!sIdImageFileCache.empty())
|
||||
{
|
||||
//ищем физический файл ( rId относительно vml_drawing)
|
||||
smart_ptr<OOX::File> pFile = pVml->Find(sIdImageFileCache);
|
||||
|
||||
if (pFile.IsInit() && ( OOX::FileTypes::Image == pFile->type()))
|
||||
{
|
||||
OOX::Image* pImageFileCache = static_cast<OOX::Image*>(pFile.operator->());
|
||||
|
||||
blipFill.blip->oleFilepathImage = pImageFileCache->filename().GetPath();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (nvPicPr.nvPr.media.is_init())
|
||||
{
|
||||
@ -630,10 +669,17 @@ namespace PPTX
|
||||
blipFill.blip->mediaFilepath = mediaFile->filename().GetPath();
|
||||
}
|
||||
|
||||
if (nvPicPr.nvPr.media.as<MediaFile>().name == L"audioFile")
|
||||
if (nvPicPr.nvPr.media.is<MediaFile>())
|
||||
{
|
||||
if (nvPicPr.nvPr.media.as<MediaFile>().name == L"audioFile")
|
||||
pWriter->StartRecord(SPTREE_TYPE_AUDIO);
|
||||
else if (nvPicPr.nvPr.media.as<MediaFile>().name == L"videoFile")
|
||||
pWriter->StartRecord(SPTREE_TYPE_VIDEO);
|
||||
}
|
||||
else if (nvPicPr.nvPr.media.is<WavAudioFile>() || nvPicPr.nvPr.media.is<AudioCD>())
|
||||
{
|
||||
pWriter->StartRecord(SPTREE_TYPE_AUDIO);
|
||||
else if (nvPicPr.nvPr.media.as<MediaFile>().name == L"videoFile")
|
||||
pWriter->StartRecord(SPTREE_TYPE_VIDEO);
|
||||
}
|
||||
else
|
||||
pWriter->StartRecord(SPTREE_TYPE_PIC);
|
||||
}
|
||||
@ -1338,6 +1384,7 @@ namespace PPTX
|
||||
blipFill.blip.Init();
|
||||
blipFill.blip->oleRid = oleObject->m_oId->get();
|
||||
}
|
||||
node.ReadAttributeBase(L"spid", oleObject->m_sShapeId);
|
||||
}
|
||||
} // namespace Logic
|
||||
} // namespace PPTX
|
||||
|
||||
@ -259,7 +259,7 @@ namespace PPTX
|
||||
void toXmlWriterVML(NSBinPptxRW::CXmlWriter* pWriter, smart_ptr<PPTX::Theme>& oTheme, smart_ptr<PPTX::Logic::ClrMap>& oClrMap, bool in_group = false);
|
||||
//----------------------------------------------------------------------
|
||||
NvPicPr nvPicPr;
|
||||
BlipFill blipFill;
|
||||
mutable BlipFill blipFill;
|
||||
SpPr spPr;
|
||||
nullable<ShapeStyle> style;
|
||||
//internal
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -35,10 +35,12 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
DbOrParamQry::DbOrParamQry()
|
||||
DbOrParamQry::DbOrParamQry(int typeRecord_)
|
||||
{
|
||||
}
|
||||
typeRecord = typeRecord_;
|
||||
|
||||
param.pbt = query.dbt = 0;
|
||||
}
|
||||
|
||||
DbOrParamQry::~DbOrParamQry()
|
||||
{
|
||||
@ -52,10 +54,32 @@ BaseObjectPtr DbOrParamQry::clone()
|
||||
|
||||
void DbOrParamQry::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### DbOrParamQry record is not implemented")
|
||||
Log::error("DbOrParamQry record is not implemented.");
|
||||
size_t size = record.getDataSize() - record.getRdPtr();
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
if (typeRecord == 1)
|
||||
{
|
||||
unsigned short flags;
|
||||
|
||||
record >> param.wTypeSql >> flags >> param.grbit >> param.fVal;
|
||||
|
||||
param.pbt = GETBITS(flags, 0, 1);
|
||||
param.fNonDefaultName = GETBIT(flags, 2);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned short flags;
|
||||
|
||||
record >> flags >> query.cparams >> query.cstQuery >> query.cstWebPost >> query.cstSQLSav >> query.cstOdbcConn;
|
||||
|
||||
query.dbt = GETBITS(flags, 0, 2);
|
||||
query.fOdbcConn = GETBIT(flags, 3);
|
||||
query.fSql = GETBIT(flags, 4);
|
||||
query.fSqlSav = GETBIT(flags, 5);
|
||||
query.fWeb = GETBIT(flags, 6);
|
||||
query.fSavePwd = GETBIT(flags, 7);
|
||||
query.fTablesOnlyHTML = GETBIT(flags, 8);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -36,24 +36,48 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of DbOrParamQry record in BIFF8
|
||||
class DbOrParamQry: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(DbOrParamQry)
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(DbOrParamQry)
|
||||
public:
|
||||
DbOrParamQry();
|
||||
DbOrParamQry(int typeRecord = 2);
|
||||
~DbOrParamQry();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeDbOrParamQry;
|
||||
static const ElementType type = typeDbOrParamQry;
|
||||
|
||||
int typeRecord;
|
||||
|
||||
//PARAMQRY_Fixed - 8 bytes + variable
|
||||
struct
|
||||
{
|
||||
unsigned short wTypeSql;
|
||||
unsigned char pbt;
|
||||
bool fNonDefaultName;
|
||||
unsigned short grbit;
|
||||
unsigned short fVal;
|
||||
}param;
|
||||
|
||||
//---------------------------------------
|
||||
struct
|
||||
{
|
||||
unsigned char dbt;
|
||||
bool fOdbcConn;
|
||||
bool fSql;
|
||||
bool fSqlSav;
|
||||
bool fWeb;
|
||||
bool fSavePwd;
|
||||
bool fTablesOnlyHTML;
|
||||
short cparams;
|
||||
short cstQuery;
|
||||
short cstWebPost;
|
||||
short cstSQLSav;
|
||||
short cstOdbcConn;
|
||||
}query;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -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,12 +39,10 @@ SXDI::SXDI()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
SXDI::~SXDI()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr SXDI::clone()
|
||||
{
|
||||
return BaseObjectPtr(new SXDI(*this));
|
||||
@ -61,5 +59,22 @@ void SXDI::readFields(CFRecord& record)
|
||||
}
|
||||
}
|
||||
|
||||
int SXDI::serialize(std::wostream & strm)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"dataField")
|
||||
{
|
||||
if (stName.value().empty() == false)
|
||||
CP_XML_ATTR(L"name", stName.value());
|
||||
|
||||
CP_XML_ATTR(L"fld", isxvdData);
|
||||
CP_XML_ATTR(L"baseField", df);
|
||||
CP_XML_ATTR(L"baseItem", isxvi);
|
||||
CP_XML_ATTR(L"numFmtId", ifmt);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -49,6 +49,8 @@ public:
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
int serialize(std::wostream & strm);
|
||||
|
||||
static const ElementType type = typeSXDI;
|
||||
|
||||
short isxvdData;
|
||||
|
||||
@ -39,7 +39,6 @@ SXDtr::SXDtr()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
SXDtr::~SXDtr()
|
||||
{
|
||||
}
|
||||
@ -53,21 +52,14 @@ void SXDtr::readFields(CFRecord& record)
|
||||
{
|
||||
record >> yr >> mon >> dom >> hr >> min >> sec;
|
||||
}
|
||||
|
||||
int SXDtr::serialize(std::wostream & strm)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"d")
|
||||
{
|
||||
std::wstringstream s;
|
||||
s << yr << L"-" << mon << L"-" << dom << L"T" << hr << L":" << min << L":" << sec;
|
||||
|
||||
CP_XML_ATTR(L"v", s.str());
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
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"
|
||||
<< (hr < 10 ? L"0" : L"") << hr << L":" << (min < 10 ? L"0" : L"") << min << L":" << (sec < 10 ? L"0" : L"") << sec;
|
||||
|
||||
return s.str();
|
||||
}
|
||||
|
||||
} // 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,6 +57,8 @@ public:
|
||||
unsigned char min;
|
||||
unsigned char sec;
|
||||
|
||||
std::wstring value();
|
||||
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -37,6 +37,7 @@ namespace XLS
|
||||
|
||||
SXEx::SXEx()
|
||||
{
|
||||
cWrapPage = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -70,11 +70,10 @@ void SXFDB::readFields(CFRecord& record)
|
||||
fCantGetUniqueItems = GETBIT(flags, 14);
|
||||
fCalculatedField = GETBIT(flags, 15);
|
||||
|
||||
if (fAllAtoms)
|
||||
{
|
||||
GlobalWorkbookInfoPtr global_info = record.getGlobalWorkbookInfo();
|
||||
global_info->arCacheFieldShortSize.push_back(fShortIitms);
|
||||
}
|
||||
GlobalWorkbookInfoPtr global_info = record.getGlobalWorkbookInfo();
|
||||
|
||||
global_info->arPivotCacheFieldShortSize.push_back(fShortIitms);
|
||||
global_info->arPivotCacheFields.push_back(fAllAtoms);
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -35,8 +35,9 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
SXLI::SXLI()
|
||||
SXLI::SXLI(int count_)
|
||||
{
|
||||
count = count_;
|
||||
}
|
||||
|
||||
|
||||
@ -50,18 +51,16 @@ BaseObjectPtr SXLI::clone()
|
||||
}
|
||||
|
||||
void SXLI::readFields(CFRecord& record)
|
||||
{// 0 or 2 records SXLIItem
|
||||
int size_item = (record.getDataSize() - record.getRdPtr()) / 2;
|
||||
|
||||
if (size_item < 8)
|
||||
{
|
||||
while(true)
|
||||
{
|
||||
//??
|
||||
return;
|
||||
}
|
||||
int size_item = record.getDataSize() - record.getRdPtr();
|
||||
|
||||
for (int k = 0; k < 2; k++)
|
||||
{
|
||||
SXLIItem item;
|
||||
if (size_item < 8)
|
||||
{
|
||||
break;
|
||||
}
|
||||
SXLIItem item = {};
|
||||
|
||||
unsigned short flags;
|
||||
|
||||
@ -74,13 +73,24 @@ void SXLI::readFields(CFRecord& record)
|
||||
item.fGrand = GETBIT(flags, 11);
|
||||
item.fMultiDataOnAxis = GETBIT(flags, 12);
|
||||
|
||||
int count = (size_item - 8) / 2;
|
||||
if (item.fGrand)
|
||||
item.isxviMac = 1;
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
if (item.cSic > item.isxviMac)
|
||||
item.cSic = item.isxviMac;
|
||||
|
||||
if (item.fSbt && item.itmType < 0x000D)
|
||||
item.isxviMac++;
|
||||
|
||||
for (short i = 0; i < count/*item.isxviMac*/; i++)
|
||||
{
|
||||
short val; record >> val;
|
||||
item.rgisxvi.push_back(val);
|
||||
if (val >= 0x0000 && val <= 0x7EF4)
|
||||
{
|
||||
item.rgisxvi.push_back(val);
|
||||
}
|
||||
}
|
||||
|
||||
m_arItems.push_back(item);
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ class SXLI: public BiffRecordContinued
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(SXLI)
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(SXLI)
|
||||
public:
|
||||
SXLI();
|
||||
SXLI(int count_);
|
||||
~SXLI();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
@ -65,6 +65,7 @@ public:
|
||||
static const ElementType type = typeSXLI;
|
||||
|
||||
std::vector<SXLIItem> m_arItems;
|
||||
int count;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
#include "SXString.h"
|
||||
|
||||
#include "../../../../../Common/DocxFormat/Source/XML/Utils.h"
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
@ -39,12 +39,10 @@ SXString::SXString()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
SXString::~SXString()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr SXString::clone()
|
||||
{
|
||||
return BaseObjectPtr(new SXString(*this));
|
||||
@ -61,17 +59,15 @@ void SXString::readFields(CFRecord& record)
|
||||
record >> segment;
|
||||
}
|
||||
}
|
||||
int SXString::serialize(std::wostream & strm)
|
||||
|
||||
std::wstring SXString::value()
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"s")
|
||||
{
|
||||
CP_XML_ATTR(L"v", segment.value());
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
std::wstring s = segment.value();
|
||||
XmlUtils::replace_all(s, L"\x0d", L"_x000d_");
|
||||
XmlUtils::replace_all(s, L"\x0a", L"_x000a_");
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ public:
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
int serialize(std::wostream & strm);
|
||||
std::wstring value();
|
||||
|
||||
static const ElementType type = typeSXString;
|
||||
|
||||
|
||||
@ -73,19 +73,15 @@ int SXVI::serialize(std::wostream & strm)
|
||||
{
|
||||
CP_XML_NODE(L"item")
|
||||
{
|
||||
if (fMissing) CP_XML_ATTR(L"m", 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);
|
||||
}
|
||||
if (fMissing)
|
||||
CP_XML_ATTR(L"m", 1);
|
||||
if (fHidden)
|
||||
CP_XML_ATTR(L"h", 1);
|
||||
if (fHideDetail)
|
||||
CP_XML_ATTR(L"h", 1);
|
||||
if (fFormula)
|
||||
CP_XML_ATTR(L"f", 1);
|
||||
|
||||
switch(itmType)
|
||||
{
|
||||
case 0x0001: CP_XML_ATTR(L"t", L"default"); break;
|
||||
|
||||
@ -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,6 +55,5 @@ void SxBool::readFields(CFRecord& record)
|
||||
|
||||
val = (flags != 0);
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -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,18 +53,18 @@ BaseObjectPtr SxFilt::clone()
|
||||
|
||||
void SxFilt::readFields(CFRecord& record)
|
||||
{
|
||||
unsigned short flags1;
|
||||
unsigned char 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);
|
||||
|
||||
fSelected = GETBIT(flags2, 0);
|
||||
isxvd = GETBITS(flags2, 0, 9);
|
||||
fSelected = GETBIT(flags2, 10);
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -54,11 +54,13 @@ public:
|
||||
bool sxaxisCol;
|
||||
bool sxaxisPage;
|
||||
bool sxaxisData;
|
||||
unsigned short iDim;
|
||||
unsigned short isxvd;
|
||||
|
||||
char iDim;
|
||||
char isxvd;
|
||||
|
||||
bool fSelected;
|
||||
|
||||
unsigned short grbitSbt;
|
||||
short grbitSbt;
|
||||
unsigned short cisxvi;
|
||||
};
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -750,7 +750,7 @@ class pConnectionSitesDir : public OfficeArtFOPTE
|
||||
|
||||
virtual void ReadComplexData(XLS::CFRecord& record);
|
||||
|
||||
IMsoArray<ODRAW::FixedPoint> complex;
|
||||
IMsoArray<OSHARED::FixedPoint> complex;
|
||||
};
|
||||
|
||||
class pInscribe : public OfficeArtFOPTE
|
||||
|
||||
@ -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
|
||||
{
|
||||
@ -45,13 +52,72 @@ BiffStructurePtr PtgSxName::clone()
|
||||
void PtgSxName::loadFields(CFRecord& record)
|
||||
{
|
||||
record >> sxIndex;
|
||||
|
||||
global_info = record.getGlobalWorkbookInfo();
|
||||
}
|
||||
|
||||
void PtgSxName::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, bool full_ref)
|
||||
{
|
||||
Log::info("PtgSxName structure is not assemble.");
|
||||
std::wstring _Name;
|
||||
|
||||
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
|
||||
{
|
||||
Log::warning("PtgSxName structure is not assemble.");
|
||||
|
||||
ptg_stack.push(L""); // This would let us to continue without an error
|
||||
}
|
||||
|
||||
ptg_stack.push(L"#REF!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -44,14 +44,13 @@ class PtgSxName: public OperandPtg
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
|
||||
virtual void loadFields(CFRecord& record);
|
||||
|
||||
virtual void loadFields(CFRecord& record);
|
||||
|
||||
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, bool full_ref = false);
|
||||
|
||||
private:
|
||||
_UINT32 sxIndex;
|
||||
private:
|
||||
GlobalWorkbookInfoPtr global_info;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -55,10 +55,13 @@ BiffStructurePtr XFExtNoFRT::clone()
|
||||
|
||||
void XFExtNoFRT::load(CFRecord& record)
|
||||
{
|
||||
if (record.isEOF()) return;
|
||||
|
||||
record.skipNunBytes(6); // reserved
|
||||
unsigned short cexts;
|
||||
record >> cexts;
|
||||
for(unsigned short i = 0; i < cexts; ++i)
|
||||
|
||||
for(unsigned short i = 0; !record.isEOF() && i < cexts; ++i)
|
||||
{
|
||||
ExtProp prop;
|
||||
record >> prop;
|
||||
|
||||
@ -57,7 +57,7 @@ public:
|
||||
unsigned char Byte4;
|
||||
unsigned short type;
|
||||
unsigned short fExprO;
|
||||
};
|
||||
}bytes;
|
||||
double value;
|
||||
} data;
|
||||
};
|
||||
|
||||
@ -40,7 +40,11 @@ namespace XLS
|
||||
|
||||
DBB::DBB()
|
||||
{
|
||||
fShortIitms = false;
|
||||
bString = false;
|
||||
bDate = false;
|
||||
bNumber = false;
|
||||
bEmpty = false;
|
||||
bBool = false;
|
||||
}
|
||||
|
||||
DBB::~DBB()
|
||||
@ -64,6 +68,13 @@ const bool DBB::loadContent(BinProcessor& proc)
|
||||
while(count--)
|
||||
{
|
||||
m_arSXOPER.push_back(elements_.front()); elements_.pop_front();
|
||||
SXOPER* operatr = dynamic_cast<SXOPER*>(m_arSXOPER.back().get());
|
||||
|
||||
bString |= operatr->bString;
|
||||
bDate |= operatr->bDate;
|
||||
bNumber |= operatr->bNumber;
|
||||
bEmpty |= operatr->bEmpty;
|
||||
bBool |= operatr->bBool;
|
||||
}
|
||||
|
||||
if (!m_SXDBB && m_arSXOPER.empty())
|
||||
@ -81,34 +92,34 @@ int DBB::serialize(std::wostream & strm)
|
||||
{
|
||||
CP_XML_NODE(L"r")
|
||||
{
|
||||
if (m_arSXOPER.empty() == false)
|
||||
int indexOPER = 0;
|
||||
size_t posBlob = 0;
|
||||
|
||||
for (size_t i = 0; i < arPivotCacheFields.size(); i++)
|
||||
{
|
||||
for (size_t i = 0; i < m_arSXOPER.size(); i++)
|
||||
if(arPivotCacheFields[i] == false)
|
||||
{
|
||||
m_arSXOPER[i]->serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (fShortIitms == false)
|
||||
{
|
||||
for (size_t i = 0; i < dbb->size; i++)
|
||||
{
|
||||
CP_XML_NODE(L"x")
|
||||
{
|
||||
CP_XML_ATTR(L"v", dbb->blob[i]);
|
||||
}
|
||||
}
|
||||
m_arSXOPER[indexOPER++]->serialize(CP_XML_STREAM());
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned short * values = (unsigned short *)dbb->blob.get();
|
||||
for (size_t i = 0; i < dbb->size / 2; i++)
|
||||
if (arPivotCacheFieldShortSize[i])//fShortIitms
|
||||
{
|
||||
unsigned short * values = (unsigned short *)(dbb->blob.get() + posBlob);
|
||||
CP_XML_NODE(L"x")
|
||||
{
|
||||
CP_XML_ATTR(L"v", values[i]);
|
||||
CP_XML_ATTR(L"v", *values);
|
||||
}
|
||||
posBlob+=2;
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned char * values = (unsigned char *)(dbb->blob.get() + posBlob);
|
||||
CP_XML_NODE(L"x")
|
||||
{
|
||||
CP_XML_ATTR(L"v", *values);
|
||||
}
|
||||
posBlob++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,7 +55,14 @@ public:
|
||||
std::vector<BaseObjectPtr> m_arSXOPER;
|
||||
|
||||
//---------------------------------------------------
|
||||
bool fShortIitms;
|
||||
std::vector<bool> arPivotCacheFields;
|
||||
std::vector<bool> arPivotCacheFieldShortSize;
|
||||
|
||||
bool bString;
|
||||
bool bDate;
|
||||
bool bNumber;
|
||||
bool bEmpty;
|
||||
bool bBool;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -63,7 +63,8 @@ public:
|
||||
{
|
||||
return false;
|
||||
}
|
||||
proc.mandatory<DbOrParamQry>();
|
||||
DbOrParamQry param(1);
|
||||
proc.mandatory(param);
|
||||
return true;
|
||||
};
|
||||
};
|
||||
@ -80,11 +81,14 @@ public:
|
||||
|
||||
const bool loadContent(BinProcessor& proc)
|
||||
{
|
||||
if(!proc.mandatory<DbOrParamQry>())
|
||||
DbOrParamQry param(1);
|
||||
if(!proc.mandatory(param))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
proc.repeated<Parenthesis_DBQUERY_3>(0, 0);
|
||||
|
||||
int count = proc.repeated<Parenthesis_DBQUERY_3>(0, 0);
|
||||
|
||||
return true;
|
||||
};
|
||||
};
|
||||
@ -105,8 +109,11 @@ public:
|
||||
{
|
||||
return false;
|
||||
}
|
||||
proc.repeated<SXString>(0, 0);
|
||||
|
||||
int count = proc.repeated<SXString>(0, 0);
|
||||
|
||||
proc.optional<Parenthesis_DBQUERY_2>();
|
||||
|
||||
return true;
|
||||
};
|
||||
};
|
||||
@ -117,20 +124,126 @@ BaseObjectPtr DBQUERY::clone()
|
||||
return BaseObjectPtr(new DBQUERY(*this));
|
||||
}
|
||||
|
||||
|
||||
// DBQUERY = DbOrParamQry [1*SXString [DbOrParamQry *(SXString DbOrParamQry)]] *SXString
|
||||
const bool DBQUERY::loadContent(BinProcessor& proc)
|
||||
{
|
||||
global_info = proc.getGlobalWorkbookInfo();
|
||||
|
||||
if(!proc.mandatory<DbOrParamQry>())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
proc.optional<Parenthesis_DBQUERY_1>();
|
||||
proc.repeated<SXString>(0, 0);
|
||||
m_DbQry = elements_.front(); elements_.pop_front();
|
||||
|
||||
proc.optional<Parenthesis_DBQUERY_1>();
|
||||
|
||||
while(!elements_.empty())
|
||||
{
|
||||
SXString* str = dynamic_cast<SXString*>(elements_.front().get());
|
||||
if (!str)
|
||||
{
|
||||
m_DbParam = elements_.front(); elements_.pop_front();
|
||||
break;
|
||||
}
|
||||
m_arSXString.push_back(str->value());
|
||||
elements_.pop_front();
|
||||
}
|
||||
|
||||
while(!elements_.empty())
|
||||
{
|
||||
SXString* str = dynamic_cast<SXString*>(elements_.front().get());
|
||||
if (str)
|
||||
{
|
||||
_DbParam a;
|
||||
a.string = str->value();
|
||||
m_arParams.push_back(a);
|
||||
}
|
||||
else
|
||||
{
|
||||
DbOrParamQry* param = dynamic_cast<DbOrParamQry*>(elements_.front().get());
|
||||
if (param)
|
||||
{
|
||||
m_arParams.back().param = elements_.front();
|
||||
}
|
||||
|
||||
}
|
||||
elements_.pop_front();
|
||||
}
|
||||
int count = proc.repeated<SXString>(0, 0);
|
||||
while(!elements_.empty())
|
||||
{
|
||||
SXString* str = dynamic_cast<SXString*>(elements_.front().get());
|
||||
if (str)
|
||||
{
|
||||
m_arSXString.push_back(str->value());
|
||||
}
|
||||
elements_.pop_front();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
int DBQUERY::serialize(std::wostream & strm)
|
||||
{
|
||||
connectionId = ++global_info->connectionId;
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"cacheSource")
|
||||
{
|
||||
CP_XML_ATTR(L"type", L"external");
|
||||
CP_XML_ATTR(L"connectionId", connectionId); //connectionId in connections(root)
|
||||
}
|
||||
}
|
||||
serialize_connection(global_info->connections_stream);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int DBQUERY::serialize_connection(std::wostream & strm)
|
||||
{
|
||||
DbOrParamQry* queryOrParam = dynamic_cast<DbOrParamQry*>(m_DbQry.get());
|
||||
if (!queryOrParam) return 0;
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"connection")
|
||||
{
|
||||
CP_XML_ATTR(L"id", 1); //connectionId in connections(root)
|
||||
CP_XML_ATTR(L"name", L"Connection");
|
||||
|
||||
CP_XML_ATTR(L"type", queryOrParam->query.dbt);
|
||||
//switch(queryOrParam->query.dbt)
|
||||
//{
|
||||
// case 0x1: CP_XML_ATTR(L"type", 1); break;
|
||||
// case 0x2:
|
||||
// case 0x3:
|
||||
// case 0x4:
|
||||
// case 0x5:
|
||||
// case 0x6:
|
||||
// case 0x7:
|
||||
//}
|
||||
|
||||
if (queryOrParam->query.fSavePwd) CP_XML_ATTR(L"savePassword", 1);
|
||||
if (queryOrParam->query.fSavePwd) CP_XML_ATTR(L"refreshedVersion", 1);
|
||||
|
||||
int index = 0;
|
||||
CP_XML_NODE(L"dbPr")
|
||||
{
|
||||
if (index < m_arSXString.size())
|
||||
{
|
||||
CP_XML_ATTR(L"command", m_arSXString[index]);
|
||||
}
|
||||
index++;
|
||||
|
||||
if (index < m_arSXString.size())
|
||||
{
|
||||
CP_XML_ATTR(L"connection", m_arSXString[index]);
|
||||
}
|
||||
index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -35,9 +35,12 @@
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
struct _DbParam
|
||||
{
|
||||
std::wstring string;
|
||||
BaseObjectPtr param;
|
||||
};
|
||||
|
||||
|
||||
// Logical representation of DBQUERY union of records
|
||||
class DBQUERY: public CompositeObject
|
||||
{
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(DBQUERY)
|
||||
@ -49,6 +52,18 @@ public:
|
||||
|
||||
virtual const bool loadContent(BinProcessor& proc);
|
||||
|
||||
int serialize(std::wostream & stream);
|
||||
int serialize_connection(std::wostream & strm);
|
||||
|
||||
BaseObjectPtr m_DbQry;
|
||||
|
||||
BaseObjectPtr m_DbParam;
|
||||
std::vector<_DbParam> m_arParams;
|
||||
|
||||
std::vector<std::wstring> m_arSXString;
|
||||
//------------------------------------------------------
|
||||
GlobalWorkbookInfoPtr global_info;
|
||||
int connectionId;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -36,8 +36,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of DBQUERYEXT union of records
|
||||
class DBQUERYEXT: public CompositeObject
|
||||
{
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(DBQUERYEXT)
|
||||
@ -49,6 +47,11 @@ public:
|
||||
|
||||
virtual const bool loadContent(BinProcessor& proc);
|
||||
|
||||
BaseObjectPtr m_TxtQry;
|
||||
BaseObjectPtr m_DBQueryExt;
|
||||
BaseObjectPtr m_ExtString;
|
||||
std::vector<BaseObjectPtr> m_arExtString;
|
||||
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -31,10 +31,11 @@
|
||||
*/
|
||||
|
||||
#include "DBQUERYEXT.h"
|
||||
#include <Logic/Biff_records/DBQueryExt.h>
|
||||
#include <Logic/Biff_records/ExtString.h>
|
||||
#include <Logic/Biff_records/OleDbConn.h>
|
||||
#include <Logic/Biff_records/TxtQry.h>
|
||||
|
||||
#include "../Biff_records/DBQueryExt.h"
|
||||
#include "../Biff_records/ExtString.h"
|
||||
#include "../Biff_records/OleDbConn.h"
|
||||
#include "../Biff_records/TxtQry.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
@ -84,11 +85,30 @@ const bool DBQUERYEXT::loadContent(BinProcessor& proc)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
proc.optional<ExtString>();
|
||||
proc.repeated<Parenthesis_DBQUERYEXT_1>(0, 4);
|
||||
m_DBQueryExt = elements_.back();
|
||||
elements_.pop_back();
|
||||
|
||||
if (proc.optional<ExtString>())
|
||||
{
|
||||
m_ExtString = elements_.back();
|
||||
elements_.pop_back();
|
||||
}
|
||||
int count = proc.repeated<Parenthesis_DBQUERYEXT_1>(0, 4);
|
||||
|
||||
//....
|
||||
|
||||
if(proc.optional<TxtQry>())
|
||||
{
|
||||
proc.repeated<ExtString>(0, 0);
|
||||
m_TxtQry = elements_.back();
|
||||
elements_.pop_back();
|
||||
|
||||
int count = proc.repeated<ExtString>(0, 0);
|
||||
|
||||
while(count--)
|
||||
{
|
||||
m_arExtString.insert(m_arExtString.begin(), elements_.back());
|
||||
elements_.pop_back();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@ -92,9 +92,36 @@ int DREF::serialize(std::wostream & strm)
|
||||
}
|
||||
else if(bin)
|
||||
{
|
||||
CP_XML_ATTR(L"type", L"worksheet");
|
||||
CP_XML_NODE(L"worksheetSource")
|
||||
{
|
||||
switch(bin->nBuiltin)
|
||||
{
|
||||
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)
|
||||
{
|
||||
CP_XML_ATTR(L"type", L"worksheet");
|
||||
CP_XML_NODE(L"worksheetSource")
|
||||
{
|
||||
CP_XML_ATTR(L"ref", ref->ref.toString());
|
||||
CP_XML_ATTR(L"sheet", ref->stFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,14 +74,18 @@ private:
|
||||
|
||||
FDB::FDB()
|
||||
{
|
||||
bString = false;
|
||||
bDate = false;
|
||||
bNumber = false;
|
||||
bEmpty = false;
|
||||
bInteger = false;
|
||||
bBool = false;
|
||||
}
|
||||
|
||||
|
||||
FDB::~FDB()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr FDB::clone()
|
||||
{
|
||||
return BaseObjectPtr(new FDB(*this));
|
||||
@ -93,6 +97,8 @@ BaseObjectPtr FDB::clone()
|
||||
|
||||
const bool FDB::loadContent(BinProcessor& proc)
|
||||
{
|
||||
global_info = proc.getGlobalWorkbookInfo();
|
||||
|
||||
if(!proc.mandatory<SXFDB>())
|
||||
{
|
||||
return false;
|
||||
@ -123,10 +129,15 @@ const bool FDB::loadContent(BinProcessor& proc)
|
||||
|
||||
while(count > 0)
|
||||
{
|
||||
SXOPER * oper = dynamic_cast<SXOPER*> (elements_.front().get());
|
||||
if (oper)
|
||||
SXOPER * operatr = dynamic_cast<SXOPER*> (elements_.front().get());
|
||||
if (operatr)
|
||||
{
|
||||
m_arGRPSXOPER.push_back(elements_.front());
|
||||
|
||||
//bString |= operatr->bString;
|
||||
//bDate |= operatr->bDate;
|
||||
//bNumber |= operatr->bNumber;
|
||||
//bEmpty |= operatr->bEmpty;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -150,6 +161,15 @@ const bool FDB::loadContent(BinProcessor& proc)
|
||||
while(count--)
|
||||
{
|
||||
m_arSRCSXOPER.push_back(elements_.front()); elements_.pop_front();
|
||||
|
||||
SXOPER* operatr = dynamic_cast<SXOPER*> (m_arSRCSXOPER.back().get());
|
||||
|
||||
bString |= operatr->bString;
|
||||
bDate |= operatr->bDate;
|
||||
bNumber |= operatr->bNumber;
|
||||
bEmpty |= operatr->bEmpty;
|
||||
bInteger|= operatr->bInteger;
|
||||
bBool |= operatr->bBool;
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -161,13 +181,24 @@ 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)
|
||||
{
|
||||
CP_XML_NODE(L"cacheField")
|
||||
{
|
||||
CP_XML_ATTR(L"name", fdb->stFieldName.value());
|
||||
CP_XML_ATTR(L"numFmtId", fdb_type->wTypeSql);
|
||||
|
||||
if (fdb_type->wTypeSql > 0)
|
||||
{
|
||||
CP_XML_ATTR(L"numFmtId", fdb_type->wTypeSql);
|
||||
//CP_XML_ATTR(L"sqlType", fdb_type->wTypeSql); //in db
|
||||
}
|
||||
if (m_arSRCSXOPER.empty() && m_arGRPSXOPER.empty() == false)
|
||||
{
|
||||
CP_XML_ATTR(L"databaseField", 0);
|
||||
}
|
||||
|
||||
switch(fdb_type->wTypeSql)//format code
|
||||
{
|
||||
@ -187,34 +218,72 @@ 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());
|
||||
}
|
||||
//caption, databaseFields, ..
|
||||
|
||||
if (m_arSRCSXOPER.empty() == false)
|
||||
{
|
||||
CP_XML_NODE(L"sharedItems")
|
||||
{
|
||||
//CP_XML_ATTR(L"containsSemiMixedTypes", 0);
|
||||
CP_XML_ATTR(L"containsNonDate", fdb->fNonDates);
|
||||
CP_XML_ATTR(L"containsDate", fdb->fDateInField);
|
||||
CP_XML_ATTR(L"containsNumber", fdb->fNumField);
|
||||
CP_XML_ATTR(L"containsBlank", fdb->fTextEtcField);
|
||||
//CP_XML_ATTR(L"containsString", 0);
|
||||
//использовать поля присутствия из xls низя - они частенько записаны неверно!!
|
||||
//if (!fdb->fNonDates) CP_XML_ATTR(L"containsNonDate", fdb->fNonDates);
|
||||
//if (fdb->fDateInField) CP_XML_ATTR(L"containsDate", fdb->fDateInField);
|
||||
//if (fdb->fNumField) CP_XML_ATTR(L"containsNumber", fdb->fNumField);
|
||||
////CP_XML_ATTR(L"containsBlank", fdb->fTextEtcField);
|
||||
|
||||
//if (m_arSRCSXOPER.empty())
|
||||
//{
|
||||
// if (!fdb->fTextEtcField)
|
||||
// {
|
||||
// CP_XML_ATTR(L"containsString", 0);
|
||||
// }
|
||||
// else if (fdb->fNumField || fdb->fDateInField)
|
||||
// {
|
||||
// CP_XML_ATTR(L"containsBlank", 1);
|
||||
// CP_XML_ATTR(L"containsString", 0);
|
||||
// }
|
||||
//}
|
||||
if (bInteger)
|
||||
{
|
||||
if (bNumber) bInteger = false;
|
||||
else bNumber = true;
|
||||
}
|
||||
if ((bDate & bNumber) || (bNumber & bString))
|
||||
{
|
||||
CP_XML_ATTR(L"containsSemiMixedTypes", 1);
|
||||
}
|
||||
else if ( bDate & bString)
|
||||
{
|
||||
CP_XML_ATTR(L"containsMixedTypes", 1);
|
||||
}
|
||||
else if (!bEmpty && !bString && !bBool)
|
||||
{
|
||||
CP_XML_ATTR(L"containsSemiMixedTypes", 0);
|
||||
}
|
||||
if (bNumber) CP_XML_ATTR(L"containsNumber", 1);
|
||||
if (bDate) CP_XML_ATTR(L"containsDate", 1);
|
||||
if (bEmpty) CP_XML_ATTR(L"containsBlank", 1);
|
||||
if (bInteger) CP_XML_ATTR(L"containsInteger", 1);
|
||||
|
||||
if (!bString && (bInteger || bDate || bNumber || bEmpty))
|
||||
CP_XML_ATTR(L"containsString", 0);
|
||||
|
||||
if (fdb->fnumMinMaxValid)
|
||||
{
|
||||
if (fdb->fDateInField)
|
||||
{
|
||||
CP_XML_ATTR(L"minDate", 0); // "2007-11-18T00:00:00"
|
||||
CP_XML_ATTR(L"maxDate", 0); // "2007-12-25T00:00:00"
|
||||
}
|
||||
else if (fdb->fNumField)
|
||||
{
|
||||
CP_XML_ATTR(L"minValue", 0);
|
||||
CP_XML_ATTR(L"maxValue", 0);
|
||||
}
|
||||
//if (fdb->fDateInField)
|
||||
//{
|
||||
// CP_XML_ATTR(L"minDate", 0); // "2007-11-18T00:00:00"
|
||||
// CP_XML_ATTR(L"maxDate", 0); // "2007-12-25T00:00:00"
|
||||
//}
|
||||
//else if (fdb->fNumField)
|
||||
//{
|
||||
// CP_XML_ATTR(L"minValue", 0);
|
||||
// CP_XML_ATTR(L"maxValue", 0);
|
||||
//}
|
||||
}
|
||||
CP_XML_ATTR(L"count", fdb->catm);
|
||||
CP_XML_ATTR(L"count", m_arSRCSXOPER.size());
|
||||
|
||||
for (size_t i = 0; i < m_arSRCSXOPER.size(); i++)
|
||||
{
|
||||
|
||||
@ -59,6 +59,15 @@ public:
|
||||
std::vector<BaseObjectPtr> m_arGRPSXOPER;
|
||||
BaseObjectPtr m_SXRANGE;
|
||||
std::vector<BaseObjectPtr> m_arSxIsxoper;
|
||||
|
||||
bool bString;
|
||||
bool bDate;
|
||||
bool bNumber;
|
||||
bool bEmpty;
|
||||
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
|
||||
{
|
||||
@ -62,6 +67,9 @@ const bool PIVOTCACHE::loadContent(BinProcessor& proc)
|
||||
{
|
||||
GlobalWorkbookInfoPtr global_info = proc.getGlobalWorkbookInfo();
|
||||
|
||||
global_info->arPivotCacheFieldShortSize.clear();
|
||||
global_info->arPivotCacheFields.clear();
|
||||
|
||||
if(!proc.mandatory<SXDB>())
|
||||
{
|
||||
return false;
|
||||
@ -95,19 +103,52 @@ const bool PIVOTCACHE::loadContent(BinProcessor& proc)
|
||||
|
||||
DBB* dbb = dynamic_cast<DBB*>(m_arDBB.back().get());
|
||||
|
||||
if (global_info->arCacheFieldShortSize.size() >= m_arDBB.size())
|
||||
{
|
||||
dbb->fShortIitms = global_info->arCacheFieldShortSize[m_arDBB.size() - 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
//???? группы??
|
||||
}
|
||||
dbb->arPivotCacheFieldShortSize = global_info->arPivotCacheFieldShortSize;
|
||||
dbb->arPivotCacheFields = global_info->arPivotCacheFields;
|
||||
}
|
||||
if (proc.optional<EOF_T>())
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
@ -55,6 +55,8 @@ public:
|
||||
std::vector<BaseObjectPtr> m_arFDB;
|
||||
std::vector<BaseObjectPtr> m_arDBB;
|
||||
|
||||
std::vector<bool> m_arAllAtoms;
|
||||
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -116,6 +121,7 @@ int PIVOTCACHEDEFINITION::serialize_definitions(std::wostream & strm)
|
||||
{
|
||||
CP_XML_ATTR(L"r:id", L"rId1" );
|
||||
}
|
||||
CP_XML_ATTR(L"enableRefresh", 1);
|
||||
CP_XML_ATTR(L"refreshedBy", db->rgb.value());
|
||||
CP_XML_ATTR(L"refreshedDate", db_ex->numDate.data.value);
|
||||
CP_XML_ATTR(L"recordCount", db->crdbUsed);
|
||||
@ -138,7 +144,18 @@ int PIVOTCACHEDEFINITION::serialize_definitions(std::wostream & strm)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pivot_cache->m_arSXFORMULA.empty() == false)
|
||||
{
|
||||
CP_XML_NODE(L"calculatedItems")
|
||||
{
|
||||
CP_XML_ATTR(L"count", pivot_cache->m_arSXFORMULA.size());
|
||||
|
||||
for (size_t i = 0; i < pivot_cache->m_arSXFORMULA.size(); i++)
|
||||
{
|
||||
pivot_cache->m_arSXFORMULA[i]->serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
@ -66,6 +66,8 @@ const bool PIVOTCORE::loadContent(BinProcessor& proc)
|
||||
m_SxView = elements_.back();
|
||||
elements_.pop_back();
|
||||
|
||||
SxView* sxView = dynamic_cast<SxView*>(m_SxView.get());
|
||||
|
||||
int count = 0;
|
||||
|
||||
count = proc.repeated<PIVOTVD>(0, 0);
|
||||
@ -90,12 +92,21 @@ const bool PIVOTCORE::loadContent(BinProcessor& proc)
|
||||
{
|
||||
m_arSXDI.push_back(elements_.front()); elements_.pop_front();
|
||||
}
|
||||
|
||||
count = proc.repeated<PIVOTLI>(0, 0);
|
||||
while(count--)
|
||||
PIVOTLI rwLines(sxView->cDimRw);
|
||||
if (proc.optional(rwLines))
|
||||
{
|
||||
m_arPIVOTLI.push_back(elements_.front()); elements_.pop_front();
|
||||
}
|
||||
PIVOTLI colLines(sxView->cDimCol);
|
||||
if (proc.optional(colLines))
|
||||
{
|
||||
m_arPIVOTLI.push_back(elements_.front()); elements_.pop_front();
|
||||
}
|
||||
//count = proc.repeated<PIVOTLI>(0, 0);
|
||||
//while(count--)
|
||||
//{
|
||||
// m_arPIVOTLI.push_back(elements_.front()); elements_.pop_front();
|
||||
//}
|
||||
|
||||
if (proc.mandatory<PIVOTEX>())
|
||||
{
|
||||
|
||||
@ -31,40 +31,89 @@
|
||||
*/
|
||||
|
||||
#include "PIVOTLI.h"
|
||||
#include <Logic/Biff_records/SXLI.h>
|
||||
#include <Logic/Biff_records/Continue.h>
|
||||
|
||||
#include "../Biff_records/SXLI.h"
|
||||
#include "../Biff_records/Continue.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
PIVOTLI::PIVOTLI()
|
||||
PIVOTLI::PIVOTLI(int count_lines_)
|
||||
{
|
||||
count_lines = count_lines_;
|
||||
}
|
||||
|
||||
|
||||
PIVOTLI::~PIVOTLI()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr PIVOTLI::clone()
|
||||
{
|
||||
return BaseObjectPtr(new PIVOTLI(*this));
|
||||
}
|
||||
|
||||
|
||||
// PIVOTLI = SXLI *Continue
|
||||
const bool PIVOTLI::loadContent(BinProcessor& proc)
|
||||
{
|
||||
if(!proc.mandatory<SXLI>())
|
||||
SXLI sx_line(count_lines);
|
||||
|
||||
if(!proc.mandatory(sx_line))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
m_SXLI = elements_.back();
|
||||
elements_.pop_back();
|
||||
|
||||
proc.repeated<Continue>(0, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int PIVOTLI::serialize(std::wostream & strm)
|
||||
{
|
||||
SXLI* line_items = dynamic_cast<SXLI*>(m_SXLI.get());
|
||||
if (!line_items) return 0;
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
for (size_t i = 0; i < line_items->m_arItems.size(); i++)
|
||||
{
|
||||
CP_XML_NODE(L"i")
|
||||
{
|
||||
switch(line_items->m_arItems[i].itmType)
|
||||
{
|
||||
case 0x0001: CP_XML_ATTR(L"t", L"default"); break;
|
||||
case 0x0002: CP_XML_ATTR(L"t", L"sum"); break;
|
||||
case 0x0003: CP_XML_ATTR(L"t", L"countA"); break;
|
||||
case 0x0004: CP_XML_ATTR(L"t", L"count"); break;
|
||||
case 0x0005: CP_XML_ATTR(L"t", L"avg"); break;
|
||||
case 0x0006: CP_XML_ATTR(L"t", L"max"); break;
|
||||
case 0x0007: CP_XML_ATTR(L"t", L"min"); break;
|
||||
case 0x0008: CP_XML_ATTR(L"t", L"product"); break;
|
||||
case 0x0009: CP_XML_ATTR(L"t", L"stdDev"); break;
|
||||
case 0x000A: CP_XML_ATTR(L"t", L"stdDevP"); break;
|
||||
case 0x000B: CP_XML_ATTR(L"t", L"var"); break;
|
||||
case 0x000C: CP_XML_ATTR(L"t", L"varP"); break;
|
||||
case 0x000D: CP_XML_ATTR(L"t", L"grand"); break;
|
||||
case 0x000E: CP_XML_ATTR(L"t", L"blank"); break;
|
||||
}
|
||||
|
||||
if (line_items->m_arItems[i].cSic > 0 && line_items->m_arItems[i].itmType == 0)//??
|
||||
{
|
||||
CP_XML_ATTR(L"r", line_items->m_arItems[i].cSic);
|
||||
}
|
||||
|
||||
for (size_t j = line_items->m_arItems[i].cSic; j < line_items->m_arItems[i].rgisxvi.size(); j++)
|
||||
{
|
||||
CP_XML_NODE(L"x")
|
||||
{
|
||||
CP_XML_ATTR(L"v", line_items->m_arItems[i].rgisxvi[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -36,20 +36,24 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of PIVOTLI union of records
|
||||
class PIVOTLI: public CompositeObject
|
||||
{
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(PIVOTLI)
|
||||
public:
|
||||
PIVOTLI();
|
||||
PIVOTLI(int count_lines_);
|
||||
~PIVOTLI();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
virtual const bool loadContent(BinProcessor& proc);
|
||||
|
||||
static const ElementType type = typePIVOTLI;
|
||||
int serialize(std::wostream & strm);
|
||||
|
||||
static const ElementType type = typePIVOTLI;
|
||||
|
||||
BaseObjectPtr m_SXLI;
|
||||
|
||||
int count_lines;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -31,13 +31,12 @@
|
||||
*/
|
||||
|
||||
#include "PIVOTPI.h"
|
||||
#include <Logic/Biff_records/SXPI.h>
|
||||
#include <Logic/Biff_records/Continue.h>
|
||||
#include "../Biff_records/SXPI.h"
|
||||
#include "../Biff_records/Continue.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
PIVOTPI::PIVOTPI()
|
||||
{
|
||||
}
|
||||
@ -53,7 +52,6 @@ BaseObjectPtr PIVOTPI::clone()
|
||||
return BaseObjectPtr(new PIVOTPI(*this));
|
||||
}
|
||||
|
||||
|
||||
// PIVOTPI = SXPI *Continue
|
||||
const bool PIVOTPI::loadContent(BinProcessor& proc)
|
||||
{
|
||||
@ -69,5 +67,22 @@ const bool PIVOTPI::loadContent(BinProcessor& proc)
|
||||
return true;
|
||||
}
|
||||
|
||||
int PIVOTPI::serialize(std::wostream & strm)
|
||||
{
|
||||
SXPI* page_items = dynamic_cast<SXPI*>(m_SXPI.get());
|
||||
if (!page_items) return 0;
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
for (size_t i = 0; i < page_items->m_arItems.size(); i++)
|
||||
{
|
||||
CP_XML_NODE(L"pageField")
|
||||
{
|
||||
CP_XML_ATTR(L"fld", page_items->m_arItems[i].isxvd);
|
||||
CP_XML_ATTR(L"hier",0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -47,6 +47,8 @@ public:
|
||||
|
||||
virtual const bool loadContent(BinProcessor& proc);
|
||||
|
||||
int serialize(std::wostream & strm);
|
||||
|
||||
static const ElementType type = typePIVOTPI;
|
||||
|
||||
BaseObjectPtr m_SXPI;
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -80,20 +80,74 @@ int PIVOTVD::serialize(std::wostream & strm)
|
||||
Sxvd* vd = dynamic_cast<Sxvd*>(m_Sxvd.get());
|
||||
SXVDEx* vd_ex = dynamic_cast<SXVDEx*>(m_SXVDEx.get());
|
||||
|
||||
if (!vd || !vd_ex) return 0;
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"pivotField")
|
||||
{
|
||||
//CP_XML_ATTR(L"axis", );
|
||||
//CP_XML_ATTR(L"compact", );
|
||||
//CP_XML_ATTR(L"outline", );
|
||||
//CP_XML_ATTR(L"subtotalTop", );
|
||||
//CP_XML_ATTR(L"showAll", );
|
||||
//CP_XML_ATTR(L"includeNewItemsInFilter", );
|
||||
//CP_XML_ATTR(L"sortType", );
|
||||
//CP_XML_ATTR(L"rankBy", );
|
||||
//CP_XML_ATTR(L"axis", );
|
||||
if (vd->sxaxis.bRw) CP_XML_ATTR(L"axis", L"axisRow");
|
||||
else if (vd->sxaxis.bCol) CP_XML_ATTR(L"axis", L"axisCol");
|
||||
else if (vd->sxaxis.bPage) CP_XML_ATTR(L"axis", L"axisPage");
|
||||
|
||||
if (vd->sxaxis.bData)
|
||||
{
|
||||
CP_XML_ATTR(L"dataField", 1);
|
||||
}
|
||||
|
||||
CP_XML_ATTR(L"compact", 0);
|
||||
|
||||
if (vd_ex->ifmt > 0)
|
||||
{
|
||||
CP_XML_ATTR(L"numFmtId", vd_ex->ifmt);
|
||||
}
|
||||
|
||||
if (vd->stName.value().empty() == false)
|
||||
CP_XML_ATTR(L"name", vd->stName.value());
|
||||
|
||||
if (vd->fCounta) CP_XML_ATTR(L"countASubtotal", 1);
|
||||
if (vd->fCount) CP_XML_ATTR(L"countSubtotal", 1);
|
||||
if (vd->fSum) CP_XML_ATTR(L"sumSubtotal", 1);
|
||||
if (vd->fAverage) CP_XML_ATTR(L"avgSubtotal", 1);
|
||||
if (vd->fMax) CP_XML_ATTR(L"maxSubtotal", 1);
|
||||
if (vd->fMin) CP_XML_ATTR(L"minSubtotal", 1);
|
||||
if (vd->fProduct) CP_XML_ATTR(L"productSubtotal", 1);
|
||||
if (vd->fStdev) CP_XML_ATTR(L"stdSubtotal", 1);
|
||||
if (vd->fStdevp) CP_XML_ATTR(L"stdDevSubtotal", 1);
|
||||
if (vd->fVariance) CP_XML_ATTR(L"varSubtotal", 1);
|
||||
if (vd->fVariancep) CP_XML_ATTR(L"varPSubtotal", 1);
|
||||
|
||||
CP_XML_ATTR(L"outline", vd_ex->fOutline);
|
||||
CP_XML_ATTR(L"subtotalTop", vd_ex->fSubtotalAtTop);
|
||||
CP_XML_ATTR(L"showAll", vd_ex->fShowAllItems);
|
||||
|
||||
if (vd_ex->fNotDragToData) CP_XML_ATTR(L"dragToData", 0);
|
||||
if (!vd_ex->fDragToRow) CP_XML_ATTR(L"dragToRow", 0);
|
||||
if (!vd_ex->fDragToColumn) CP_XML_ATTR(L"dragToCol", 0);
|
||||
if (!vd_ex->fDragToPage) CP_XML_ATTR(L"dragToPage", 0);
|
||||
|
||||
if (vd_ex->fHideNewItems) CP_XML_ATTR(L"hideNewItems", 1);
|
||||
if (vd_ex->fInsertBlankRow) CP_XML_ATTR(L"insertBlankRow", 1);
|
||||
if (vd_ex->fPageBreaksBetweenItems) CP_XML_ATTR(L"insertPageBreak", 1);
|
||||
if (!vd_ex->fTopAutoShow) CP_XML_ATTR(L"topAutoShow", 0);
|
||||
//if (!vd_ex->fDragToHide) CP_XML_ATTR(L"dragOff", 0); //??
|
||||
if (vd_ex->fServerBased) CP_XML_ATTR(L"serverField", 1);
|
||||
|
||||
//CP_XML_ATTR(L"", vd_ex->fCalculatedField);
|
||||
CP_XML_ATTR(L"includeNewItemsInFilter", 1);
|
||||
|
||||
//CP_XML_ATTR(L"nonAutoSortDefault", !vd_ex->fAutoSort);
|
||||
if (vd_ex->fAutoSort)
|
||||
{
|
||||
// vd_ex->isxdiAutoSort
|
||||
|
||||
if (vd_ex->fAscendSort) CP_XML_ATTR(L"sortType", L"ascending");
|
||||
}
|
||||
if (vd_ex->isxdiAutoShow >= 0)
|
||||
{
|
||||
CP_XML_ATTR(L"rankBy", vd_ex->isxdiAutoShow);
|
||||
}
|
||||
if (!vd->fDefault) CP_XML_ATTR(L"defaultSubtotal", 0);
|
||||
if (!m_arSXVI.empty())
|
||||
{
|
||||
CP_XML_NODE(L"items")
|
||||
|
||||
@ -107,7 +107,10 @@ int PIVOTVIEW::serialize(std::wostream & strm)
|
||||
CP_XML_ATTR(L"applyPatternFormats", view->fAtrPat);
|
||||
CP_XML_ATTR(L"applyAlignmentFormats", view->fAtrAlc);
|
||||
CP_XML_ATTR(L"applyWidthHeightFormats", view->fAtrProc);
|
||||
CP_XML_ATTR(L"dataCaption", view->stData.value());
|
||||
if (!view->stData.value().empty())
|
||||
{
|
||||
CP_XML_ATTR(L"dataCaption", view->stData.value());
|
||||
}
|
||||
//updatedVersion="2"
|
||||
//asteriskTotals="1"
|
||||
//showMemberPropertyTips="0"
|
||||
@ -134,7 +137,7 @@ int PIVOTVIEW::serialize(std::wostream & strm)
|
||||
core->m_arPIVOTVD[i]->serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
if (core->m_arPIVOTIVD.size() == 2)//0 or 2
|
||||
if (core->m_arPIVOTIVD.size() >= 1)
|
||||
{
|
||||
CP_XML_NODE(L"rowFields")
|
||||
{
|
||||
@ -144,14 +147,15 @@ int PIVOTVIEW::serialize(std::wostream & strm)
|
||||
ivd->serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"rowItems")
|
||||
if (core->m_arPIVOTLI.size() >= 1)//0 or 2
|
||||
{
|
||||
CP_XML_ATTR(L"count", view->cRw);
|
||||
//for (size_t i = 0; i < m_arPIVOTLI.size(); i++)
|
||||
//{
|
||||
// PIVOTLI* line = dynamic_cast<PIVOTLI*>(m_arPIVOTLI[i].get());
|
||||
// m_arPIVOTIVD[i]->serialize(CP_XML_STREAM());
|
||||
//}
|
||||
CP_XML_NODE(L"rowItems")
|
||||
{
|
||||
CP_XML_ATTR(L"count", view->cRw);
|
||||
|
||||
PIVOTLI* line = dynamic_cast<PIVOTLI*>(core->m_arPIVOTLI[0].get());
|
||||
line->serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
if (core->m_arPIVOTIVD.size() == 2)//0 or 2
|
||||
{
|
||||
@ -163,13 +167,15 @@ int PIVOTVIEW::serialize(std::wostream & strm)
|
||||
ivd->serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"colItems")
|
||||
if (core->m_arPIVOTLI.size() == 2)//0 or 2
|
||||
{
|
||||
CP_XML_ATTR(L"count", view->cCol);
|
||||
//for (size_t i = 0; i < m_arPIVOTLI.size(); i++)
|
||||
//{
|
||||
// m_arPIVOTIVD[i]->serialize(CP_XML_STREAM());
|
||||
//}
|
||||
CP_XML_NODE(L"colItems")
|
||||
{
|
||||
CP_XML_ATTR(L"count", view->cCol);
|
||||
|
||||
PIVOTLI* line = dynamic_cast<PIVOTLI*>(core->m_arPIVOTLI[1].get());
|
||||
line->serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
if (core->m_PIVOTPI)
|
||||
{
|
||||
|
||||
@ -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
|
||||
|
||||
@ -38,6 +38,28 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
// (SxName *SXPair)
|
||||
class Parenthesis_SXFMLA: public ABNFParenthesis
|
||||
{
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(Parenthesis_SXFMLA)
|
||||
public:
|
||||
BaseObjectPtr clone()
|
||||
{
|
||||
return BaseObjectPtr(new Parenthesis_SXFMLA(*this));
|
||||
}
|
||||
|
||||
const bool loadContent(BinProcessor& proc)
|
||||
{
|
||||
if(!proc.mandatory<SxName>())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int count = proc.repeated<SXPair>(0, 0);
|
||||
|
||||
return true;
|
||||
};
|
||||
};
|
||||
|
||||
SXFMLA::SXFMLA()
|
||||
{
|
||||
@ -57,6 +79,8 @@ BaseObjectPtr SXFMLA::clone()
|
||||
// SXFMLA = SxFmla *(SxName *SXPair)
|
||||
const bool SXFMLA::loadContent(BinProcessor& proc)
|
||||
{
|
||||
global_info = proc.getGlobalWorkbookInfo();
|
||||
|
||||
if(!proc.mandatory<SxFmla>())
|
||||
{
|
||||
return false;
|
||||
@ -64,8 +88,48 @@ const bool SXFMLA::loadContent(BinProcessor& proc)
|
||||
m_SxFmla = elements_.back();
|
||||
elements_.pop_back();
|
||||
|
||||
int count = proc.repeated<Parenthesis_SXFMLA>(0, 0);
|
||||
|
||||
while(!elements_.empty())
|
||||
{
|
||||
if (dynamic_cast<SxName*>(elements_.front().get()))
|
||||
{
|
||||
_sx_name sx_name;
|
||||
sx_name.name = elements_.front(); elements_.pop_front();
|
||||
|
||||
m_arPivotSxNames.push_back(sx_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
while(!elements_.empty())
|
||||
{
|
||||
if (dynamic_cast<SxName*>(elements_.front().get()))
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_arPivotSxNames.back().pair.push_back(elements_.front());
|
||||
elements_.pop_front();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
|
||||
@ -40,16 +40,22 @@ class SXFMLA: public CompositeObject
|
||||
{
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(SXFMLA)
|
||||
public:
|
||||
|
||||
SXFMLA();
|
||||
~SXFMLA();
|
||||
|
||||
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;
|
||||
BaseObjectPtr m_SxFmla;
|
||||
std::vector<_sx_name> m_arPivotSxNames;
|
||||
//-------------------------------------------------------------------------
|
||||
GlobalWorkbookInfoPtr global_info;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -34,7 +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
|
||||
{
|
||||
@ -56,6 +64,8 @@ BaseObjectPtr SXFORMULA::clone()
|
||||
// SXFORMULA = SXFMLA PIVOTRULE SXFormula
|
||||
const bool SXFORMULA::loadContent(BinProcessor& proc)
|
||||
{
|
||||
global_info = proc.getGlobalWorkbookInfo();
|
||||
|
||||
if(!proc.mandatory<SXFMLA>())
|
||||
{
|
||||
return false;
|
||||
@ -74,6 +84,60 @@ const bool SXFORMULA::loadContent(BinProcessor& proc)
|
||||
elements_.pop_back();
|
||||
} return true;
|
||||
}
|
||||
int SXFORMULA::serialize(std::wostream & strm)
|
||||
{
|
||||
SXFMLA* fmla = dynamic_cast<SXFMLA*>(m_SXFMLA.get());
|
||||
if (!fmla) return 0;
|
||||
|
||||
PIVOTRULE* pivot_rule = dynamic_cast<PIVOTRULE*>(m_PIVOTRULE.get());
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"calculatedItem")
|
||||
{
|
||||
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;
|
||||
}
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -47,11 +47,15 @@ public:
|
||||
|
||||
virtual const bool loadContent(BinProcessor& proc);
|
||||
|
||||
int serialize(std::wostream & stream);
|
||||
|
||||
static const ElementType type = typeSXFORMULA;
|
||||
|
||||
BaseObjectPtr m_SXFMLA;
|
||||
BaseObjectPtr m_PIVOTRULE;
|
||||
BaseObjectPtr m_SXFormula;
|
||||
|
||||
GlobalWorkbookInfoPtr global_info;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -43,6 +43,14 @@ namespace XLS
|
||||
|
||||
SXOPER::SXOPER()
|
||||
{
|
||||
bFormula= false;
|
||||
|
||||
bString = false;
|
||||
bDate = false;
|
||||
bNumber = false;
|
||||
bEmpty = false;
|
||||
bInteger= false;
|
||||
bBool = false;
|
||||
}
|
||||
|
||||
SXOPER::~SXOPER()
|
||||
@ -59,21 +67,50 @@ 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)
|
||||
{
|
||||
bInteger = (num->num.data.bytes.Byte1==num->num.data.bytes.Byte2 &&
|
||||
num->num.data.bytes.Byte2==num->num.data.bytes.Byte3 &&
|
||||
num->num.data.bytes.Byte3==num->num.data.bytes.Byte4 &&
|
||||
num->num.data.bytes.Byte4==0);
|
||||
}
|
||||
bNumber = !bInteger;
|
||||
node = L"n";
|
||||
value = std::to_wstring(num->num.data.value);
|
||||
}
|
||||
else if(proc.optional<SxBool>())
|
||||
{
|
||||
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>())
|
||||
{
|
||||
SXDtr* dtr = dynamic_cast<SXDtr*>(elements_.back().get());
|
||||
bDate = true;
|
||||
node = L"d";
|
||||
value = dtr->value();
|
||||
}
|
||||
else
|
||||
return false;
|
||||
@ -81,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
|
||||
|
||||
|
||||
@ -52,6 +52,18 @@ public:
|
||||
static const ElementType type = typeSXOPER;
|
||||
|
||||
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,12 +140,8 @@ int SXRANGE::serialize(std::wostream & strm)
|
||||
SXDtr* startDate = dynamic_cast<SXDtr*>(m_arSXDtr[0].get());
|
||||
SXDtr* endDate = dynamic_cast<SXDtr*>(m_arSXDtr[1].get());
|
||||
|
||||
std::wstringstream s_start, s_end;
|
||||
s_start << startDate->yr << L"-" << startDate->mon << L"-" << startDate->dom << L"T" << startDate->hr << L":" << startDate->min << L":" << startDate->sec;
|
||||
s_end << endDate->yr << L"-" << endDate->mon << L"-" << endDate->dom << L"T" << endDate->hr << L":" << endDate->min << L":" << endDate->sec;
|
||||
|
||||
CP_XML_ATTR(L"startDate", s_start.str());
|
||||
CP_XML_ATTR(L"endDate", s_end.str());
|
||||
CP_XML_ATTR(L"startDate", startDate->value());
|
||||
CP_XML_ATTR(L"endDate", endDate->value());
|
||||
}
|
||||
if (m_arSXNum.size() == 3)
|
||||
{
|
||||
|
||||
@ -54,7 +54,6 @@ BaseObjectPtr SXSRC::clone()
|
||||
return BaseObjectPtr(new SXSRC(*this));
|
||||
}
|
||||
|
||||
|
||||
// SXSRC = DREF / SXTBL / DBQUERY
|
||||
const bool SXSRC::loadContent(BinProcessor& proc)
|
||||
{
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -31,11 +31,12 @@
|
||||
*/
|
||||
|
||||
#include "XFS.h"
|
||||
#include <Logic/Biff_records/XF.h>
|
||||
#include <Logic/Biff_records/XFCRC.h>
|
||||
#include <Logic/Biff_records/XFExt.h>
|
||||
|
||||
#include <Logic/Biff_structures/ExtProp.h>
|
||||
#include "../Biff_records/XF.h"
|
||||
#include "../Biff_records/XFCRC.h"
|
||||
#include "../Biff_records/XFExt.h"
|
||||
|
||||
#include "../Biff_structures/ExtProp.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
@ -114,8 +114,12 @@ GlobalWorkbookInfo::GlobalWorkbookInfo(const unsigned short code_page, XlsConver
|
||||
cellStyleXfs_count = 0;
|
||||
cellStyleDxfs_count = 0;
|
||||
|
||||
connectionId = 0;
|
||||
|
||||
defaultDigitFontSize = std::pair<float, float>(0, 0);
|
||||
applicationFonts = NULL;
|
||||
|
||||
idPivotCache = 0;
|
||||
}
|
||||
|
||||
GlobalWorkbookInfo::~GlobalWorkbookInfo()
|
||||
|
||||
@ -60,6 +60,13 @@ static const std::wstring DefaultPalette[] = {
|
||||
L"00003366", L"00339966", L"00003300", L"00333300", L"00993300", L"00993366", L"00333399", L"00333333"
|
||||
};
|
||||
|
||||
|
||||
struct _sx_name
|
||||
{
|
||||
BaseObjectPtr name;
|
||||
std::vector<BaseObjectPtr> pair;
|
||||
};
|
||||
|
||||
class GlobalWorkbookInfo
|
||||
{
|
||||
public:
|
||||
@ -75,7 +82,6 @@ public:
|
||||
|
||||
unsigned int GenerateAXESId();
|
||||
|
||||
|
||||
unsigned short CodePage;
|
||||
CRYPT::DecryptorPtr decryptor;
|
||||
std::wstring password;
|
||||
@ -99,8 +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> arCacheFieldShortSize;
|
||||
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;
|
||||
@ -134,6 +146,9 @@ public:
|
||||
int cellStyleDxfs_count;
|
||||
|
||||
std::wstringstream users_Dxfs_stream;
|
||||
std::wstringstream connections_stream;
|
||||
|
||||
int connectionId;
|
||||
|
||||
XlsConverter *xls_converter;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user