diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Continue.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Continue.h index 91921535e6..7b3180362c 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Continue.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/Continue.h @@ -36,9 +36,7 @@ namespace XLS { - -// Logical representation of Continue record in BIFF8 -class Continue: public BiffRecord + class Continue: public BiffRecord { BIFF_RECORD_DEFINE_TYPE_INFO(Continue) BASE_OBJECT_DEFINE_CLASS_NAME(Continue) @@ -47,7 +45,6 @@ public: ~Continue(); BaseObjectPtr clone(); - void readFields(CFRecord& record); diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/PicF.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/PicF.cpp index 2b4a06ed52..bc213a50ec 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/PicF.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/PicF.cpp @@ -35,27 +35,23 @@ namespace XLS { -PicF::PicF() -{ -} + PicF::PicF() {} + PicF::~PicF() {} + BaseObjectPtr PicF::clone() + { + return BaseObjectPtr(new PicF(*this)); + } -PicF::~PicF() -{ -} - - -BaseObjectPtr PicF::clone() -{ - return BaseObjectPtr(new PicF(*this)); -} - - -void PicF::readFields(CFRecord& record) -{ - Log::error("PicF record is not implemented."); - record.skipNunBytes(record.getDataSize() - record.getRdPtr()); -} + void PicF::readFields(CFRecord& record) + { + unsigned short unused, flags; + record >> ptyp >> unused >> flags >> numScale; + + fTopBottom = GETBIT(flags, 9); + fBackFront = GETBIT(flags, 10); + fSide = GETBIT(flags, 11); + } } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/PicF.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/PicF.h index ea4c7763c6..91daffa42b 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/PicF.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/PicF.h @@ -31,13 +31,10 @@ */ #pragma once -#include "BiffRecord.h" +#include "../Biff_structures/Xnum.h" namespace XLS { - - -// Logical representation of PicF record in BIFF8 class PicF: public BiffRecord { BIFF_RECORD_DEFINE_TYPE_INFO(PicF) @@ -45,13 +42,20 @@ class PicF: public BiffRecord public: PicF(); ~PicF(); - BaseObjectPtr clone(); - void readFields(CFRecord& record); - static const ElementType type = typePicF; + static const ElementType type = typePicF; + + unsigned short ptyp; + + bool fTopBottom; + bool fBackFront; + bool fSide; + + Xnum numScale; + }; } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtRGFOPTE.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtRGFOPTE.cpp index 22bb21a2fa..b2bd0b33e9 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtRGFOPTE.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtRGFOPTE.cpp @@ -120,11 +120,17 @@ void OfficeArtRGFOPTE::load(XLS::CFRecord& record) } //-----complex load - for(std::vector::iterator it = rgfopte.begin(), itEnd = rgfopte.end(); it != itEnd; ++it) + for (size_t i = 0; i < rgfopte.size(); ++i) { - if((*it)->fComplex && (*it)->op > 0) + if (!rgfopte[i]) continue; + + if (rgfopte[i]->fComplex) { - (*it)->ReadComplexData(record); + if (rgfopte[i]->op < 0) + { + break; + } + rgfopte[i]->ReadComplexData(record); } } diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/GELFRAME_bu.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/GELFRAME_bu.cpp index 3d725ec6b3..c6dccfe972 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/GELFRAME_bu.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/GELFRAME_bu.cpp @@ -64,26 +64,24 @@ const bool GELFRAME::loadContent(BinProcessor& proc) { global_info = proc.getGlobalWorkbookInfo(); - if(!proc.mandatory()) + int count = proc.repeated(1, 2); + + if (elements_.empty()) return false; + + if (count > 0) { - return false; - } - m_GelFrame = elements_.back(); - elements_.pop_back(); - - if (proc.optional()) - { - GelFrame * base = dynamic_cast(m_GelFrame.get()); - GelFrame * addit = dynamic_cast(elements_.back().get()); + m_GelFrame = elements_.front(); + GelFrame * base = dynamic_cast(m_GelFrame.get()); + GelFrame * addit = count > 1 ? dynamic_cast(elements_.back().get()) : NULL; if (base && addit) { base->concatinate(addit); } - elements_.pop_back(); + elements_.clear(); } - // - int count = proc.repeated(0, 0); + + count = proc.repeated(0, 0); if (proc.optional()) { diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/PICF.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/PICF.h index 03618fb4c7..b59c59bcdf 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/PICF.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/PICF.h @@ -36,8 +36,6 @@ namespace XLS { - -// Logical representation of PICF union of records class PICF: public CompositeObject { BASE_OBJECT_DEFINE_CLASS_NAME(PICF) diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/PICF_bu.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/PICF_bu.cpp index 7eb16a22d5..d90b103018 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/PICF_bu.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_unions/PICF_bu.cpp @@ -37,37 +37,25 @@ namespace XLS { - - -PICF::PICF() -{ -} - - -PICF::~PICF() -{ -} - - -BaseObjectPtr PICF::clone() -{ - return BaseObjectPtr(new PICF(*this)); -} - - -// PICF = Begin PicF End -const bool PICF::loadContent(BinProcessor& proc) -{ - if(!proc.mandatory()) + PICF::PICF() {} + PICF::~PICF() {} + BaseObjectPtr PICF::clone() { - return false; - } elements_.pop_back(); - proc.mandatory(); - m_PicF = elements_.back(); elements_.pop_back(); - proc.mandatory(); elements_.pop_back(); + return BaseObjectPtr(new PICF(*this)); + } - return true; -} + // PICF = Begin PicF End + const bool PICF::loadContent(BinProcessor& proc) + { + if (!proc.mandatory()) + { + return false; + } elements_.pop_back(); + proc.mandatory(); + m_PicF = elements_.back(); elements_.pop_back(); + proc.mandatory(); elements_.pop_back(); + return true; + } } // namespace XLS