Add mdxSet bin records

This commit is contained in:
Viktor Andreev
2024-07-12 19:39:03 +06:00
parent 013ab00f06
commit ce69cf40d2
7 changed files with 394 additions and 1 deletions

View File

@ -712,6 +712,8 @@ SOURCES += \
../../../XlsbFormat/Biff12_records/MdxMbrIstr.cpp \
../../../XlsbFormat/Biff12_records/BeginMdxTuple.cpp \
../../../XlsbFormat/Biff12_records/EndMdxTuple.cpp \
../../../XlsbFormat/Biff12_records/BeginMdxSet.cpp \
../../../XlsbFormat/Biff12_records/EndMdxSet.cpp \
### Biff12_structures
../../../XlsbFormat/Biff12_structures/LPByteBuf.cpp \
../../../XlsbFormat/Biff12_structures/IsoPasswordData.cpp \
@ -1094,6 +1096,7 @@ SOURCES += \
../../../XlsbFormat/Biff12_unions/MDXMBRPROP.cpp \
../../../XlsbFormat/Biff12_unions/MDXKPI.cpp \
../../../XlsbFormat/Biff12_unions/MDXTUPLE.cpp \
../../../XlsbFormat/Biff12_unions/MDXSET.cpp \
}
HEADERS += \
../../../XlsbFormat/Biff12_unions/COMMENTS.h \
@ -1780,6 +1783,8 @@ HEADERS += \
../../../XlsbFormat/Biff12_records/MdxMbrIstr.h \
../../../XlsbFormat/Biff12_records/BeginMdxTuple.h \
../../../XlsbFormat/Biff12_records/EndMdxTuple.h \
../../../XlsbFormat/Biff12_records/BeginMdxSet.h \
../../../XlsbFormat/Biff12_records/EndMdxSet.h \
### Biff12_structures
../../../XlsbFormat/Biff12_structures/ACProductVersion.h \
../../../XlsbFormat/Biff12_structures/Blxf.h \
@ -2161,4 +2166,5 @@ HEADERS += \
../../../XlsbFormat/Biff12_unions/MDX.h \
../../../XlsbFormat/Biff12_unions/MDXMBRPROP.h \
../../../XlsbFormat/Biff12_unions/MDXKPI.h \
../../../XlsbFormat/Biff12_unions/MDXTUPLE.h \
../../../XlsbFormat/Biff12_unions/MDXTUPLE.h \
../../../XlsbFormat/Biff12_unions/MDXSET.h \

View File

@ -0,0 +1,61 @@
/*
* (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 "BeginMdxSet.h"
using namespace XLS;
namespace XLSB
{
BeginMdxSet::BeginMdxSet()
{
}
BeginMdxSet::~BeginMdxSet()
{
}
BaseObjectPtr BeginMdxSet::clone()
{
return BaseObjectPtr(new BeginMdxSet(*this));
}
void BeginMdxSet::readFields(XLS::CFRecord& record)
{
record >> istrSetDef >> sso >> cMbrsSortBy;
}
void BeginMdxSet::writeFields(XLS::CFRecord& record)
{
record << istrSetDef << sso << cMbrsSortBy;
}
} // namespace XLSB

View File

@ -0,0 +1,61 @@
/*
* (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
{
enum class SdSetSortOrder: _UINT32 {SSONONE = 0x00000000, SSOASC, SSODESC, SSOALPHAASC, SSOALPHADESC, SSONATURALASC, SSONATURALDESC};
// Logical representation of BrtBeginMdxSet record in BIFF12
class BeginMdxSet: public XLS::BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(BeginMdxSet)
BASE_OBJECT_DEFINE_CLASS_NAME(BeginMdxSet)
public:
BeginMdxSet();
~BeginMdxSet();
XLS::BaseObjectPtr clone();
void readFields(XLS::CFRecord& record) override;
void writeFields(XLS::CFRecord& record) override;
_INT32 istrSetDef;
SdSetSortOrder sso;
_INT32 cMbrsSortBy;
};
} // namespace XLSB

View File

@ -0,0 +1,53 @@
/*
* (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 "EndMdxSet.h"
using namespace XLS;
namespace XLSB
{
EndMdxSet::EndMdxSet()
{
}
EndMdxSet::~EndMdxSet()
{
}
BaseObjectPtr EndMdxSet::clone()
{
return BaseObjectPtr(new EndMdxSet(*this));
}
} // namespace XLSB

View File

@ -0,0 +1,54 @@
/*
* (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 BrtEndMdxSet record in BIFF12
class EndMdxSet: public XLS::BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(EndMdxSet)
BASE_OBJECT_DEFINE_CLASS_NAME(EndMdxSet)
public:
EndMdxSet();
~EndMdxSet();
XLS::BaseObjectPtr clone();
};
} // namespace XLSB

View File

@ -0,0 +1,100 @@
/*
* (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 "MDXSET.h"
#include "../Biff12_records/BeginMdxSet.h"
#include "../Biff12_records/EndMdxSet.h"
#include "../Biff12_records/MdxMbrIstr.h"
using namespace XLS;
namespace XLSB
{
MDXSET::MDXSET()
{
}
MDXSET::~MDXSET()
{
}
BaseObjectPtr MDXSET::clone()
{
return BaseObjectPtr(new MDXSET(*this));
}
//MDXSET = BrtBeginMDXSET COMMENTAUTHORS COMMENTLIST *FRT BrtEndMDXSET
const bool MDXSET::loadContent(BinProcessor& proc)
{
if (proc.optional<BeginMdxSet>())
{
m_BrtBeginMdxSet = elements_.back();
elements_.pop_back();
}
auto count = proc.repeated<MdxMbrIstr>(0, 0);
while(count > 0)
{
MdxMbrIstrs.insert(MdxMbrIstrs.begin(), elements_.back());
elements_.pop_back();
count--;
}
if (proc.optional<EndMdxSet>())
{
m_BrtEndMdxSet = true;
elements_.pop_back();
}
else
m_BrtEndMdxSet = false;
return m_BrtBeginMdxSet && m_BrtEndMdxSet;
}
const bool MDXSET::saveContent(XLS::BinProcessor & proc)
{
if (m_BrtBeginMdxSet != nullptr)
proc.mandatory(*m_BrtBeginMdxSet);
for(auto i:MdxMbrIstrs)
{
proc.mandatory(*i);
}
proc.mandatory<XLSB::EndMdxSet>();
return true;
}
} // namespace XLSB

View File

@ -0,0 +1,58 @@
/*
* (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/CompositeObject.h"
namespace XLSB
{
class MDXSET: public XLS::CompositeObject
{
BASE_OBJECT_DEFINE_CLASS_NAME(MDXSET)
public:
MDXSET();
~MDXSET();
XLS::BaseObjectPtr clone();
const bool loadContent(XLS::BinProcessor& proc) override;
const bool saveContent(XLS::BinProcessor& proc) override;
XLS::BaseObjectPtr m_BrtBeginMdxSet;
std::vector<XLS::BaseObjectPtr> MdxMbrIstrs;
bool m_BrtEndMdxSet;
};
} // namespace XLSB