/* * Copyright (C) Ascensio System SIA, 2009-2026 * * This program is a free software product. You can redistribute it and/or * modify it under the terms of the GNU Affero General Public License (AGPL) * version 3 as published by the Free Software Foundation, together with the * additional terms provided in the LICENSE file. * * This program is distributed WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For * details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html * * You can contact Ascensio System SIA by email at info@onlyoffice.com * or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga, * LV-1050, Latvia, European Union. * * The interactive user interfaces in modified versions of the Program * are required to display Appropriate Legal Notices in accordance with * Section 5 of the GNU AGPL version 3. * * No trademark rights are granted under this License. * * All non-code elements of the Product, including illustrations, * icon sets, and technical writing content, are licensed under the * Creative Commons Attribution-ShareAlike 4.0 International License: * https://creativecommons.org/licenses/by-sa/4.0/legalcode * * This license applies only to such non-code elements and does not * modify or replace the licensing terms applicable to the Program's * source code, which remains licensed under the GNU Affero General * Public License v3. * * SPDX-License-Identifier: AGPL-3.0-only */ #include "PivotTableStream.h" #include "Biff12_records/CommonRecords.h" #include "Biff12_unions/ACUID.h" #include "Biff12_records/BeginSXView.h" #include "Biff12_unions/SXLOCATION.h" #include "Biff12_unions/SXVDS.h" #include "Biff12_unions/ISXVDRWS.h" #include "Biff12_unions/SXLIRWS.h" #include "Biff12_unions/ISXVDCOLS.h" #include "Biff12_unions/SXLICOLS.h" #include "Biff12_unions/SXPIS.h" #include "Biff12_unions/SXDIS.h" #include "Biff12_unions/SXFORMATS.h" #include "Biff12_unions/SXCONDFMTS.h" #include "Biff12_unions/SXCRTFORMATS.h" #include "Biff12_unions/SXTHS.h" #include "Biff12_records/TableStyleClient.h" #include "Biff12_unions/SXFILTERS.h" #include "Biff12_unions/ISXTHRWS.h" #include "Biff12_unions/ISXTHCOLS.h" #include "Biff12_unions/FRTSXVIEW.h" #include "Biff12_records/EndSXView.h" using namespace XLS; namespace XLSB {; PivotTableStream::PivotTableStream() { } PivotTableStream::~PivotTableStream() { } BaseObjectPtr PivotTableStream::clone() { return BaseObjectPtr(new PivotTableStream(*this)); } const bool PivotTableStream::loadContent(BinProcessor& proc) { while (true) { CFRecordType::TypeId type = proc.getNextRecordType(); if (type == rt_NONE) break; switch(type) { case rt_ACBegin: { if (proc.optional()) { //m_ACUID = elements_.back(); elements_.pop_back(); } }break; case rt_BeginSXView: { if (proc.optional()) { m_BrtBeginSXView = elements_.back(); elements_.pop_back(); } }break; case rt_BeginSXLocation: { if (proc.optional()) { m_SXLOCATION = elements_.back(); elements_.pop_back(); } }break; case rt_BeginSXVDs: { if (proc.optional()) { m_SXVDS = elements_.back(); elements_.pop_back(); } }break; case rt_BeginISXVDRws: { if (proc.optional()) { m_ISXVDRWS = elements_.back(); elements_.pop_back(); } }break; case rt_BeginSXLIRws: { if (proc.optional()) { m_SXLIRWS = elements_.back(); elements_.pop_back(); } }break; case rt_BeginISXVDCols: { if (proc.optional()) { m_ISXVDCOLS = elements_.back(); elements_.pop_back(); } }break; case rt_BeginSXLICols: { if (proc.optional()) { m_SXLICOLS = elements_.back(); elements_.pop_back(); } }break; case rt_BeginSXPIs: { if (proc.optional()) { m_SXPIS = elements_.back(); elements_.pop_back(); } }break; case rt_BeginSXDIs: { if (proc.optional()) { m_SXDIS = elements_.back(); elements_.pop_back(); } }break; case rt_BeginSXFormats: { if (proc.optional()) { m_SXFORMATS = elements_.back(); elements_.pop_back(); } }break; case rt_BeginSXCondFmts: { if (proc.optional()) { m_SXCONDFMTS = elements_.back(); elements_.pop_back(); } }break; case rt_BeginSXCrtFormats: { if (proc.optional()) { m_SXCRTFORMATS = elements_.back(); elements_.pop_back(); } }break; case rt_BeginSXTHs: { if (proc.optional()) { m_SXTHS = elements_.back(); elements_.pop_back(); } }break; case rt_TableStyleClient: { if (proc.optional()) { m_BrtTableStyleClient = elements_.back(); elements_.pop_back(); } }break; case rt_BeginSXFilters: { if (proc.optional()) { m_SXFILTERS = elements_.back(); elements_.pop_back(); } }break; case rt_BeginISXTHRws: { if (proc.optional()) { m_ISXTHRWS = elements_.back(); elements_.pop_back(); } }break; case rt_BeginISXTHCols: { if (proc.optional()) { m_ISXTHCOLS = elements_.back(); elements_.pop_back(); } }break; case rt_FRTBegin: { if (proc.optional()) { m_FRTSXVIEW = elements_.back(); elements_.pop_back(); } }break; case rt_EndSXView: { if (proc.optional()) { m_bBrtEndSXView = true; elements_.pop_back(); } else m_bBrtEndSXView = false; }break; default://skip { proc.SkipRecord(); }break; } } return true; } const bool PivotTableStream::saveContent(XLS::BinProcessor & proc) { if (m_BrtBeginSXView != nullptr) proc.mandatory(*m_BrtBeginSXView); if(m_SXLOCATION != nullptr) proc.mandatory(*m_SXLOCATION); if(m_SXVDS != nullptr) proc.mandatory(*m_SXVDS); if(m_ISXVDRWS != nullptr) proc.mandatory(*m_ISXVDRWS); if(m_SXLIRWS != nullptr) proc.mandatory(*m_SXLIRWS); if(m_ISXVDCOLS != nullptr) proc.mandatory(*m_ISXVDCOLS); if(m_SXLICOLS != nullptr) proc.mandatory(*m_SXLICOLS); if(m_SXPIS != nullptr) proc.mandatory(*m_SXPIS); if(m_SXDIS != nullptr) proc.mandatory(*m_SXDIS); if(m_SXFORMATS != nullptr) proc.mandatory(*m_SXFORMATS); if(m_SXCONDFMTS != nullptr) proc.mandatory(*m_SXCONDFMTS); if(m_SXCRTFORMATS != nullptr) proc.mandatory(*m_SXCRTFORMATS); if(m_SXTHS != nullptr) proc.mandatory(*m_SXTHS); if (m_BrtTableStyleClient != nullptr) proc.mandatory(*m_BrtTableStyleClient); if(m_SXFILTERS != nullptr) proc.mandatory(*m_SXFILTERS); if(m_ISXTHRWS != nullptr) proc.mandatory(*m_ISXTHRWS); if(m_ISXTHCOLS != nullptr) proc.mandatory(*m_ISXTHCOLS); if (m_FRTSXVIEW != nullptr) proc.mandatory(*m_FRTSXVIEW); proc.mandatory(); return true; } } // namespace XLSB