From 712d603ff2803410cf7511cd0f58e7742c50114b Mon Sep 17 00:00:00 2001 From: Viktor Andreev Date: Mon, 8 Jul 2024 01:24:16 +0600 Subject: [PATCH] Add metadata conversion structures --- .../XlsbFormat/FileTypes_SpreadsheetBin.h | 4 + .../Linux/XlsbFormatLib/XlsbFormatLib.pro | 6 + .../Biff12_records/BeginEsmdtinfo.cpp | 65 +++++++++++ .../Biff12_records/BeginEsmdtinfo.h | 59 ++++++++++ OOXML/XlsbFormat/Biff12_unions/ESMDTINFO.cpp | 107 ++++++++++++++++++ OOXML/XlsbFormat/Biff12_unions/ESMDTINFO.h | 62 ++++++++++ OOXML/XlsbFormat/MetadataStream.cpp | 93 +++++++++++++++ OOXML/XlsbFormat/MetadataStream.h | 75 ++++++++++++ OOXML/XlsxFormat/Workbook/Metadata.cpp | 27 ++++- OOXML/XlsxFormat/Workbook/Metadata.h | 2 +- 10 files changed, 498 insertions(+), 2 deletions(-) create mode 100644 OOXML/XlsbFormat/Biff12_records/BeginEsmdtinfo.cpp create mode 100644 OOXML/XlsbFormat/Biff12_records/BeginEsmdtinfo.h create mode 100644 OOXML/XlsbFormat/Biff12_unions/ESMDTINFO.cpp create mode 100644 OOXML/XlsbFormat/Biff12_unions/ESMDTINFO.h create mode 100644 OOXML/XlsbFormat/MetadataStream.cpp create mode 100644 OOXML/XlsbFormat/MetadataStream.h diff --git a/OOXML/Binary/XlsbFormat/FileTypes_SpreadsheetBin.h b/OOXML/Binary/XlsbFormat/FileTypes_SpreadsheetBin.h index f52d79a2ec..369c064bfd 100644 --- a/OOXML/Binary/XlsbFormat/FileTypes_SpreadsheetBin.h +++ b/OOXML/Binary/XlsbFormat/FileTypes_SpreadsheetBin.h @@ -112,6 +112,10 @@ namespace OOX L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheRecords", L"pivotCache/pivotCacheRecords", true, true); + const FileType MetadataBin (L"", L"metadata.bin", + L"application/vnd.ms-excel.sheetMetadata", + L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/metadata"); + } // namespace FileTypes } } // namespace OOX diff --git a/OOXML/Projects/Linux/XlsbFormatLib/XlsbFormatLib.pro b/OOXML/Projects/Linux/XlsbFormatLib/XlsbFormatLib.pro index 34b74d7c10..2dee9a2155 100644 --- a/OOXML/Projects/Linux/XlsbFormatLib/XlsbFormatLib.pro +++ b/OOXML/Projects/Linux/XlsbFormatLib/XlsbFormatLib.pro @@ -51,6 +51,7 @@ SOURCES += \ ../../../XlsbFormat/PivotCacheRecordsStream.cpp \ ../../../XlsbFormat/PivotTableStream.cpp \ ../../../XlsbFormat/PivotCacheDefStream.cpp \ + ../../../XlsbFormat/MetadataStream.cpp \ ### Biff12_records ../../../XlsbFormat/Biff12_records/BeginBook.cpp \ ../../../XlsbFormat/Biff12_records/FRTBegin.cpp \ @@ -683,6 +684,7 @@ SOURCES += \ ../../../XlsbFormat/Biff12_records/EndPivotCacheIDs.cpp \ ../../../XlsbFormat/Biff12_records/BeginPivotCacheID.cpp \ ../../../XlsbFormat/Biff12_records/EndPivotCacheID.cpp \ + ../../../XlsbFormat/Biff12_records/BeginEsmdtinfo.cpp \ ### Biff12_structures ../../../XlsbFormat/Biff12_structures/LPByteBuf.cpp \ ../../../XlsbFormat/Biff12_structures/IsoPasswordData.cpp \ @@ -1051,6 +1053,7 @@ SOURCES += \ ../../../XlsbFormat/Biff12_unions/PCDH15_bu.cpp \ ../../../XlsbFormat/Biff12_unions/PIVOTCACHEIDS.cpp \ ../../../XlsbFormat/Biff12_unions/PIVOTCACHEID.cpp \ + ../../../XlsbFormat/Biff12_unions/ESMDTINFO.cpp \ } HEADERS += \ ../../../XlsbFormat/Biff12_unions/COMMENTS.h \ @@ -1069,6 +1072,7 @@ HEADERS += \ ../../../XlsbFormat/PivotCacheRecordsStream.h \ ../../../XlsbFormat/PivotTableStream.h \ ../../../XlsbFormat/PivotCacheDefStream.h \ + ../../../XlsbFormat/MetadataStream.h \ ../../../XlsbFormat/Xlsb.h \ ../../../XlsbFormat/XlsbElementsType.h \ ### Biff12_records @@ -1708,6 +1712,7 @@ HEADERS += \ ../../../XlsbFormat/Biff12_records/EndPivotCacheIDs.h \ ../../../XlsbFormat/Biff12_records/BeginPivotCacheID.h \ ../../../XlsbFormat/Biff12_records/EndPivotCacheID.h \ + ../../../XlsbFormat/Biff12_records/BeginEsmdtinfo.h \ ### Biff12_structures ../../../XlsbFormat/Biff12_structures/ACProductVersion.h \ ../../../XlsbFormat/Biff12_structures/Blxf.h \ @@ -2076,3 +2081,4 @@ HEADERS += \ ../../../XlsbFormat/Biff12_unions/PCDH15.h \ ../../../XlsbFormat/Biff12_unions/PIVOTCACHEIDS.h \ ../../../XlsbFormat/Biff12_unions/PIVOTCACHEID.h \ + ../../../XlsbFormat/Biff12_unions/ESMDTINFO.h \ \ No newline at end of file diff --git a/OOXML/XlsbFormat/Biff12_records/BeginEsmdtinfo.cpp b/OOXML/XlsbFormat/Biff12_records/BeginEsmdtinfo.cpp new file mode 100644 index 0000000000..977d97266f --- /dev/null +++ b/OOXML/XlsbFormat/Biff12_records/BeginEsmdtinfo.cpp @@ -0,0 +1,65 @@ +/* + * (c) Copyright Ascensio System SIA 2010-2021 + * + * This program is a free software product. You can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License (AGPL) + * version 3 as published by the Free Software Foundation. In accordance with + * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect + * that Ascensio System SIA expressly excludes the warranty of non-infringement + * of any third-party rights. + * + * This program is distributed WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For + * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html + * + * You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish + * street, Riga, Latvia, EU, LV-1050. + * + * The interactive user interfaces in modified source and object code versions + * of the Program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU AGPL version 3. + * + * Pursuant to Section 7(b) of the License you must retain the original Product + * logo when distributing the program. Pursuant to Section 7(e) we decline to + * grant you any rights under trademark law for use of our trademarks. + * + * All the Product's GUI elements, including illustrations and icon sets, as + * well as technical writing content are licensed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International. See the License + * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode + * + */ + +#include "BeginEsmdtinfo.h" + +using namespace XLS; + +namespace XLSB +{ + + BeginEsmdtinfo::BeginEsmdtinfo() + { + } + + BeginEsmdtinfo::~BeginEsmdtinfo() + { + } + + BaseObjectPtr BeginEsmdtinfo::clone() + { + return BaseObjectPtr(new BeginEsmdtinfo(*this)); + } + + void BeginEsmdtinfo::readFields(XLS::CFRecord& record) + { + record >> cMdtinfo; + } + + void BeginEsmdtinfo::writeFields(XLS::CFRecord& record) + { + record << cMdtinfo; + } + + +} // namespace XLSB + diff --git a/OOXML/XlsbFormat/Biff12_records/BeginEsmdtinfo.h b/OOXML/XlsbFormat/Biff12_records/BeginEsmdtinfo.h new file mode 100644 index 0000000000..1db27d5fd5 --- /dev/null +++ b/OOXML/XlsbFormat/Biff12_records/BeginEsmdtinfo.h @@ -0,0 +1,59 @@ +/* + * (c) Copyright Ascensio System SIA 2010-2024 + * + * This program is a free software product. You can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License (AGPL) + * version 3 as published by the Free Software Foundation. In accordance with + * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect + * that Ascensio System SIA expressly excludes the warranty of non-infringement + * of any third-party rights. + * + * This program is distributed WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For + * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html + * + * You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish + * street, Riga, Latvia, EU, LV-1050. + * + * The interactive user interfaces in modified source and object code versions + * of the Program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU AGPL version 3. + * + * Pursuant to Section 7(b) of the License you must retain the original Product + * logo when distributing the program. Pursuant to Section 7(e) we decline to + * grant you any rights under trademark law for use of our trademarks. + * + * All the Product's GUI elements, including illustrations and icon sets, as + * well as technical writing content are licensed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International. See the License + * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode + * + */ +#pragma once + +#include "../../../MsBinaryFile/XlsFile/Format/Logic/Biff_records/BiffRecord.h" +#include "../../XlsxFormat/WritingElement.h" + +namespace XLSB +{ + // Logical representation of BrtBeginEsmdtinfo record in BIFF12 + class BeginEsmdtinfo: public XLS::BiffRecord + { + BIFF_RECORD_DEFINE_TYPE_INFO(BeginEsmdtinfo) + BASE_OBJECT_DEFINE_CLASS_NAME(BeginEsmdtinfo) + public: + BeginEsmdtinfo(); + ~BeginEsmdtinfo(); + + XLS::BaseObjectPtr clone(); + + void readFields(XLS::CFRecord& record) override; + void writeFields(XLS::CFRecord& record) override; + + _INT32 cMdtinfo; + + //static const XLS::ElementType type = XLS::typeBeginEsmdtinfo; + }; + +} // namespace XLSB + diff --git a/OOXML/XlsbFormat/Biff12_unions/ESMDTINFO.cpp b/OOXML/XlsbFormat/Biff12_unions/ESMDTINFO.cpp new file mode 100644 index 0000000000..bd788e60c2 --- /dev/null +++ b/OOXML/XlsbFormat/Biff12_unions/ESMDTINFO.cpp @@ -0,0 +1,107 @@ +/* + * (c) Copyright Ascensio System SIA 2010-2021 + * + * This program is a free software product. You can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License (AGPL) + * version 3 as published by the Free Software Foundation. In accordance with + * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect + * that Ascensio System SIA expressly excludes the warranty of non-infringement + * of any third-party rights. + * + * This program is distributed WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For + * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html + * + * You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish + * street, Riga, Latvia, EU, LV-1050. + * + * The interactive user interfaces in modified source and object code versions + * of the Program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU AGPL version 3. + * + * Pursuant to Section 7(b) of the License you must retain the original Product + * logo when distributing the program. Pursuant to Section 7(e) we decline to + * grant you any rights under trademark law for use of our trademarks. + * + * All the Product's GUI elements, including illustrations and icon sets, as + * well as technical writing content are licensed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International. See the License + * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode + * + */ + +#include "ESMDTINFO.h" +#include "../Biff12_records/BeginESMDTINFO.h" + +using namespace XLS; + +namespace XLSB +{ + + ESMDTINFO::ESMDTINFO() + { + } + + ESMDTINFO::~ESMDTINFO() + { + } + + BaseObjectPtr ESMDTINFO::clone() + { + return BaseObjectPtr(new ESMDTINFO(*this)); + } + + //ESMDTINFO = BrtBeginESMDTINFO COMMENTAUTHORS COMMENTLIST *FRT BrtEndESMDTINFO + const bool ESMDTINFO::loadContent(BinProcessor& proc) + { + /*if (proc.optional()) + { + m_bBrtBeginESMDTINFO = true; + elements_.pop_back(); + } + else + m_bBrtBeginESMDTINFO = false; + + if (proc.optional()) + { + m_COMMENTAUTHORS = elements_.back(); + elements_.pop_back(); + } + if (proc.optional()) + { + m_COMMENTLIST = elements_.back(); + elements_.pop_back(); + } + int count = proc.repeated(0, 0); + + while(count > 0) + { + //m_arFRT.insert(m_arFRT.begin(), elements_.back()); + elements_.pop_back(); + count--; + } + if (proc.optional()) + { + m_bBrtEndESMDTINFO = true; + elements_.pop_back(); + } + else + m_bBrtEndESMDTINFO = false;*/ + + return true; + } + + const bool ESMDTINFO::saveContent(XLS::BinProcessor & proc) + { + if (m_BrtBeginESMDTINFO != nullptr) + proc.mandatory(*m_BrtBeginESMDTINFO); + + if (m_COMMENTLIST != nullptr) + proc.mandatory(*m_COMMENTLIST); + + + return true; + } + +} // namespace XLSB + diff --git a/OOXML/XlsbFormat/Biff12_unions/ESMDTINFO.h b/OOXML/XlsbFormat/Biff12_unions/ESMDTINFO.h new file mode 100644 index 0000000000..f70463a9b6 --- /dev/null +++ b/OOXML/XlsbFormat/Biff12_unions/ESMDTINFO.h @@ -0,0 +1,62 @@ +/* + * (c) Copyright Ascensio System SIA 2010-2021 + * + * This program is a free software product. You can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License (AGPL) + * version 3 as published by the Free Software Foundation. In accordance with + * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect + * that Ascensio System SIA expressly excludes the warranty of non-infringement + * of any third-party rights. + * + * This program is distributed WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For + * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html + * + * You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish + * street, Riga, Latvia, EU, LV-1050. + * + * The interactive user interfaces in modified source and object code versions + * of the Program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU AGPL version 3. + * + * Pursuant to Section 7(b) of the License you must retain the original Product + * logo when distributing the program. Pursuant to Section 7(e) we decline to + * grant you any rights under trademark law for use of our trademarks. + * + * All the Product's GUI elements, including illustrations and icon sets, as + * well as technical writing content are licensed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International. See the License + * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode + * + */ +#pragma once + +#include "../../../MsBinaryFile/XlsFile/Format/Logic/CompositeObject.h" + + + +namespace XLSB +{ + + class ESMDTINFO: public XLS::CompositeObject + { + BASE_OBJECT_DEFINE_CLASS_NAME(ESMDTINFO) + public: + ESMDTINFO(); + ~ESMDTINFO(); + + XLS::BaseObjectPtr clone(); + + const bool loadContent(XLS::BinProcessor& proc) override; + const bool saveContent(XLS::BinProcessor& proc) override; + + XLS::BaseObjectPtr m_BrtBeginESMDTINFO; + XLS::BaseObjectPtr m_COMMENTAUTHORS; + XLS::BaseObjectPtr m_COMMENTLIST; + //std::vector m_arFRT; + bool m_bBrtEndESMDTINFO; + + }; + +} // namespace XLSB + diff --git a/OOXML/XlsbFormat/MetadataStream.cpp b/OOXML/XlsbFormat/MetadataStream.cpp new file mode 100644 index 0000000000..3c800a5414 --- /dev/null +++ b/OOXML/XlsbFormat/MetadataStream.cpp @@ -0,0 +1,93 @@ +/* + * (c) Copyright Ascensio System SIA 2010-2024 + * + * This program is a free software product. You can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License (AGPL) + * version 3 as published by the Free Software Foundation. In accordance with + * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect + * that Ascensio System SIA expressly excludes the warranty of non-infringement + * of any third-party rights. + * + * This program is distributed WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For + * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html + * + * You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish + * street, Riga, Latvia, EU, LV-1050. + * + * The interactive user interfaces in modified source and object code versions + * of the Program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU AGPL version 3. + * + * Pursuant to Section 7(b) of the License you must retain the original Product + * logo when distributing the program. Pursuant to Section 7(e) we decline to + * grant you any rights under trademark law for use of our trademarks. + * + * All the Product's GUI elements, including illustrations and icon sets, as + * well as technical writing content are licensed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International. See the License + * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode + * + */ +#include "MetadataStream.h" + +#include "Biff12_records/CommonRecords.h" +#include "Biff12_unions/ESMDTINFO.h" + +using namespace XLS; + +namespace XLSB +{ + +MetadataStream::MetadataStream() +{ +} + +MetadataStream::~MetadataStream() +{ +} + + +BaseObjectPtr MetadataStream::clone() +{ + return BaseObjectPtr(new MetadataStream(*this)); +} + +const bool MetadataStream::loadContent(BinProcessor& proc) +{ + /*while (true) + { + CFRecordType::TypeId type = proc.getNextRecordType(); + + if (type == rt_NONE) break; + + switch(type) + { + case rt_BeginComments: + { + if (proc.optional()) + { + m_COMMENTS = elements_.back(); + elements_.pop_back(); + } + }break; + + default://skip + { + proc.SkipRecord(); + }break; + } + } +*/ + return true; +} + +const bool MetadataStream::saveContent(XLS::BinProcessor & proc) +{ + if (m_ESMDTINFO != nullptr) + proc.mandatory(*m_ESMDTINFO); + + return true; +} + +} // namespace XLSB diff --git a/OOXML/XlsbFormat/MetadataStream.h b/OOXML/XlsbFormat/MetadataStream.h new file mode 100644 index 0000000000..f21c14b324 --- /dev/null +++ b/OOXML/XlsbFormat/MetadataStream.h @@ -0,0 +1,75 @@ +/* + * (c) Copyright Ascensio System SIA 2010-2024 + * + * This program is a free software product. You can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License (AGPL) + * version 3 as published by the Free Software Foundation. In accordance with + * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect + * that Ascensio System SIA expressly excludes the warranty of non-infringement + * of any third-party rights. + * + * This program is distributed WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For + * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html + * + * You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish + * street, Riga, Latvia, EU, LV-1050. + * + * The interactive user interfaces in modified source and object code versions + * of the Program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU AGPL version 3. + * + * Pursuant to Section 7(b) of the License you must retain the original Product + * logo when distributing the program. Pursuant to Section 7(e) we decline to + * grant you any rights under trademark law for use of our trademarks. + * + * All the Product's GUI elements, including illustrations and icon sets, as + * well as technical writing content are licensed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International. See the License + * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode + * + */ + +#pragma once + +#include "../../DesktopEditor/common/Types.h" +#include "../Base/Base.h" +#include "../XlsxFormat/WritingElement.h" +#include +#include +#include +#include "../../MsBinaryFile/XlsFile/Format/Logic/CompositeObject.h" + +namespace XLSB +{ + + class MetadataStream; + typedef boost::shared_ptr MetadataStreamPtr; + + class MetadataStream: public XLS::CompositeObject + { + BASE_OBJECT_DEFINE_CLASS_NAME(MetadataStream) + public: + MetadataStream(); + ~MetadataStream(); + + XLS::BaseObjectPtr clone(); + + const bool loadContent(XLS::BinProcessor& proc) override; + const bool saveContent(XLS::BinProcessor& proc) override; + + + bool m_bBeginMetadata; + XLS::BaseObjectPtr m_ESMDTINFO; + XLS::BaseObjectPtr m_ESSTR; + XLS::BaseObjectPtr m_ESMDX; + std::vector m_ESFMDs; + std::vector m_ESMBDs; + XLS::BaseObjectPtr m_FRTMetadata; + bool m_bEndMetadata; + + + + }; + +} diff --git a/OOXML/XlsxFormat/Workbook/Metadata.cpp b/OOXML/XlsxFormat/Workbook/Metadata.cpp index 74cf59e79c..6b007e57ce 100644 --- a/OOXML/XlsxFormat/Workbook/Metadata.cpp +++ b/OOXML/XlsxFormat/Workbook/Metadata.cpp @@ -31,6 +31,8 @@ */ #include "Metadata.h" +#include "../../XlsbFormat/Xlsb.h" + #include "../FileTypes_Spreadsheet.h" #include "../../Common/SimpleTypes_Shared.h" @@ -42,6 +44,8 @@ #include "../../Binary/Presentation/XmlWriter.h" #include "../../Binary/Presentation/BinaryFileReaderWriter.h" +#include "../../Binary/XlsbFormat/FileTypes_SpreadsheetBin.h" + namespace OOX { namespace Spreadsheet @@ -948,6 +952,11 @@ xmlns:xda=\"http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray\ } const OOX::FileType CMetadataFile::type() const { + CXlsb* xlsb = dynamic_cast(File::m_pMainDocument); + if ((xlsb) && (xlsb->m_bWriteToXlsb)) + { + return OOX::SpreadsheetBin::FileTypes::MetadataBin; + } return OOX::Spreadsheet::FileTypes::Metadata; } const CPath CMetadataFile::DefaultDirectory() const @@ -956,7 +965,17 @@ xmlns:xda=\"http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray\ } const CPath CMetadataFile::DefaultFileName() const { - return type().DefaultFileName(); + CXlsb* xlsb = dynamic_cast(File::m_pMainDocument); + if ((xlsb) && (xlsb->m_bWriteToXlsb)) + { + CPath name = type().DefaultFileName(); + name.SetExtention(L"bin"); + return name; + } + else + { + return type().DefaultFileName(); + } } const CPath& CMetadataFile::GetReadPath() { @@ -976,6 +995,12 @@ xmlns:xda=\"http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray\ m_oMetadata = oReader; } + XLS::BaseObjectPtr CMetadataFile::WriteBin() const + { + XLS::BaseObjectPtr objectPtr; + + return objectPtr; + } void CMetadataFile::write(const CPath& oPath, const CPath& oDirectory, CContentTypes& oContent) const { if (false == m_oMetadata.IsInit()) return; diff --git a/OOXML/XlsxFormat/Workbook/Metadata.h b/OOXML/XlsxFormat/Workbook/Metadata.h index f0b17ae8c5..339869d78f 100644 --- a/OOXML/XlsxFormat/Workbook/Metadata.h +++ b/OOXML/XlsxFormat/Workbook/Metadata.h @@ -443,7 +443,7 @@ namespace OOX virtual ~CMetadataFile(); //void readBin(const CPath& oPath); - //XLS::BaseObjectPtr WriteBin() const; + XLS::BaseObjectPtr WriteBin() const; virtual void read(const CPath& oPath); virtual void read(const CPath& oRootPath, const CPath& oPath);