diff --git a/OOXML/DocxFormat/Drawing/DrawingExt.cpp b/OOXML/DocxFormat/Drawing/DrawingExt.cpp index e80a98d692..d87a848bbe 100644 --- a/OOXML/DocxFormat/Drawing/DrawingExt.cpp +++ b/OOXML/DocxFormat/Drawing/DrawingExt.cpp @@ -48,6 +48,7 @@ #include "../../XlsxFormat/Worksheets/WorksheetChildOther.h" #include "../../XlsxFormat/Timelines/Timeline.h" #include "../../XlsxFormat/Workbook/Metadata.h" +#include "../../XlsxFormat/Workbook/Workbook.h" #include "../Comments.h" @@ -231,6 +232,7 @@ namespace OOX *m_sUri == L"{9260A510-F301-46a8-8635-F512D64BE5F5}" || *m_sUri == L"{3e2802c4-a4d2-4d8b-9148-e3be6c30e623}" || *m_sUri == L"{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}" || + *m_sUri == L"{876F7934-8845-4945-9796-88D515C7AA90}" || *m_sUri == L"http://schemas.microsoft.com/office/drawing/2008/diagram")) { int nCurDepth = oReader.GetDepth(); @@ -383,6 +385,10 @@ namespace OOX { m_oRichValueBlock = oReader; } + else if (sName == L"pivotCaches") + { + m_oWorkbookPivotCaches = oReader; + } } } else @@ -737,6 +743,12 @@ namespace OOX { ptr->m_SLICERCACHEIDS = i->m_oSlicerCaches->toBin(); } + else if(i->m_sUri == L"{876F7934-8845-4945-9796-88D515C7AA90}") + { + if(i->m_oWorkbookPivotCaches.IsInit()) + ptr->m_SLICERCACHESPIVOTCACHEIDS = i->m_oWorkbookPivotCaches->toBin14(); + } + } return objectPtr; } diff --git a/OOXML/DocxFormat/Drawing/DrawingExt.h b/OOXML/DocxFormat/Drawing/DrawingExt.h index 3539b5bb1e..1d98eee14b 100644 --- a/OOXML/DocxFormat/Drawing/DrawingExt.h +++ b/OOXML/DocxFormat/Drawing/DrawingExt.h @@ -62,6 +62,7 @@ namespace OOX class CTimelineStyles; class CDynamicArrayProperties; class CRichValueBlock; + class CWorkbookPivotCaches; } namespace Drawing @@ -155,6 +156,7 @@ namespace OOX nullable m_oTimelineStyles; nullable m_oPivotCacheDefinitionExt; + nullable m_oWorkbookPivotCaches; std::vector m_oSlicerCachePivotTables; nullable m_oTableSlicerCache; diff --git a/OOXML/XlsxFormat/Workbook/Workbook.cpp b/OOXML/XlsxFormat/Workbook/Workbook.cpp index 88097c55db..12392b7060 100644 --- a/OOXML/XlsxFormat/Workbook/Workbook.cpp +++ b/OOXML/XlsxFormat/Workbook/Workbook.cpp @@ -43,12 +43,15 @@ #include "../../XlsbFormat/Biff12_unions/EXTERNALS.h" #include "../../XlsbFormat/Biff12_unions/PIVOTCACHEIDS.h" #include "../../XlsbFormat/Biff12_unions/PIVOTCACHEID.h" +#include "../../XlsbFormat/Biff12_unions/SLICERCACHESPIVOTCACHEIDS.h" +#include "../../XlsbFormat/Biff12_unions/SLICERCACHESPIVOTCACHEID.h" #include "../../XlsbFormat/Biff12_records/FileVersion.h" #include "../../XlsbFormat/Biff12_records/BeginPivotCacheID.h" #include "../../XlsbFormat/Biff12_unions/SUP.h" #include "../../XlsbFormat/Biff12_records/SupSelf.h" #include "../../XlsbFormat/Biff12_records/CommonRecords.h" #include "../../XlsbFormat/Biff12_records/BundleSh.h" +#include "../../XlsbFormat/Biff12_records/BeginSlicerCachesPivotCacheID.h" #include "../../../MsBinaryFile/XlsFile/Format/Logic/GlobalWorkbookInfo.h" @@ -111,6 +114,22 @@ namespace OOX ptr1->irstcacheRelID.value.setSize(0xFFFFFFFF); return objectPtr; } + XLS::BaseObjectPtr CWorkbookPivotCache::toBin14() + { + auto ptr(new XLSB::SLICERCACHESPIVOTCACHEID); + XLS::BaseObjectPtr objectPtr(ptr); + auto ptr1(new XLSB::BeginSlicerCachesPivotCacheID); + ptr->m_BrtBeginSlicerCachesPivotCacheID = XLS::BaseObjectPtr{ptr1}; + + if(m_oRid.IsInit()) + { + ptr1->FRTheader.relID.relId = m_oRid->GetValue(); + ptr1->FRTheader.fRelID = true; + } + else + ptr1->FRTheader.relID.relId.setSize(0xFFFFFFFF); + return objectPtr; + } EElementType CWorkbookPivotCache::getType() const { return et_x_WorkbookPivotCache; @@ -202,6 +221,16 @@ namespace OOX return objectPtr; } + XLS::BaseObjectPtr CWorkbookPivotCaches::toBin14() + { + auto ptr(new XLSB::SLICERCACHESPIVOTCACHEIDS); + XLS::BaseObjectPtr objectPtr(ptr); + + for(auto i:m_arrItems) + ptr->m_arSLICERCACHESPIVOTCACHEID.push_back(i->toBin14()); + + return objectPtr; + } EElementType CWorkbookPivotCaches::getType() const { return et_x_WorkbookPivotCaches; diff --git a/OOXML/XlsxFormat/Workbook/Workbook.h b/OOXML/XlsxFormat/Workbook/Workbook.h index a5046deada..2b6dd41f21 100644 --- a/OOXML/XlsxFormat/Workbook/Workbook.h +++ b/OOXML/XlsxFormat/Workbook/Workbook.h @@ -82,6 +82,7 @@ namespace OOX virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); XLS::BaseObjectPtr toBin(); + XLS::BaseObjectPtr toBin14(); void fromBin(XLS::BaseObjectPtr& obj); virtual EElementType getType() const; @@ -108,6 +109,7 @@ namespace OOX virtual void fromXML(XmlUtils::CXmlLiteReader& oReader); XLS::BaseObjectPtr toBin(); + XLS::BaseObjectPtr toBin14(); void fromBin(XLS::BaseObjectPtr& obj); virtual EElementType getType() const; };