mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-11 07:23:34 +08:00
fix bug #66123
This commit is contained in:
@ -761,7 +761,7 @@ void XlsConverter::convert(XLS::GlobalsSubstream* globals)
|
||||
|
||||
for (size_t i = 0 ; i < globals->m_arHFPictureDrawing.size(); i++)
|
||||
{
|
||||
convert((ODRAW::OfficeArtDgContainer*)globals->m_arHFPictureDrawing[i].get());
|
||||
convert((ODRAW::OfficeArtDggContainer*)globals->m_arHFPictureDrawing[i].get());
|
||||
}
|
||||
globals->serialize_protection(xlsx_context->workbook_protection());
|
||||
|
||||
@ -1428,14 +1428,21 @@ void XlsConverter::convert(ODRAW::OfficeArtSpgrContainer * spgr)
|
||||
|
||||
for (size_t i = 0; i < spgr->child_records.size(); i++)
|
||||
{
|
||||
int type_object = 2;//rect
|
||||
|
||||
if (xlsx_context->get_drawing_context().start_drawing(type_object))
|
||||
ODRAW::OfficeArtSpContainer* SpContainer = dynamic_cast<ODRAW::OfficeArtSpContainer*>(spgr->child_records[i].get());
|
||||
if (SpContainer)
|
||||
{
|
||||
xlsx_context->get_drawing_context().set_mode_HF(true);
|
||||
convert(spgr->child_records[i].get());
|
||||
ODRAW::OfficeArtFSP* fsp = dynamic_cast<ODRAW::OfficeArtFSP*>(SpContainer->m_OfficeArtFSP.get());
|
||||
if ((fsp) && (fsp->fHaveSpt))
|
||||
{
|
||||
int type_object = 2;//rect
|
||||
if (xlsx_context->get_drawing_context().start_drawing(type_object))
|
||||
{
|
||||
xlsx_context->get_drawing_context().set_mode_HF(true);
|
||||
convert(spgr->child_records[i].get());
|
||||
|
||||
xlsx_context->get_drawing_context().end_drawing();
|
||||
xlsx_context->get_drawing_context().end_drawing();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1534,6 +1541,12 @@ void XlsConverter::convert(ODRAW::OfficeArtRecord * art)
|
||||
|
||||
convert(dg->m_OfficeArtSpgrContainer.get());
|
||||
}break;
|
||||
case XLS::typeOfficeArtDggContainer:
|
||||
{
|
||||
ODRAW::OfficeArtDggContainer* dg = dynamic_cast<ODRAW::OfficeArtDggContainer*>(art);
|
||||
|
||||
convert(dg->m_OfficeArtBStoreContainer.get());
|
||||
}break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@ -2959,7 +2959,7 @@ void xlsx_drawing_context::set_picture_crop_right (double val)
|
||||
}
|
||||
void xlsx_drawing_context::set_picture_name(const std::wstring & str)
|
||||
{
|
||||
//....
|
||||
current_drawing_states->back()->fill.name = str;
|
||||
}
|
||||
void xlsx_drawing_context::set_picture_grayscale(bool val)
|
||||
{
|
||||
|
||||
@ -289,6 +289,8 @@ public:
|
||||
_CP_OPT(bool) grayscale;
|
||||
_CP_OPT(int) biLevel;
|
||||
|
||||
std::wstring name;
|
||||
|
||||
std::vector<std::pair<double, _color>> colorsPosition;
|
||||
}fill;
|
||||
|
||||
|
||||
@ -47,6 +47,7 @@ table_state::table_state(xlsx_conversion_context & Context) : drawing_context_(C
|
||||
|
||||
table_state_ptr & xlsx_sheet_context::state()
|
||||
{
|
||||
if (tables_state_.empty()) return table_state_ptr();
|
||||
return tables_state_.back();
|
||||
}
|
||||
|
||||
@ -114,38 +115,56 @@ void xlsx_sheet_context::end_table()
|
||||
|
||||
xlsx_drawing_context & xlsx_sheet_context::get_drawing_context()
|
||||
{
|
||||
return state()->drawing_context_;
|
||||
if (state())
|
||||
return state()->drawing_context_;
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
xlsx_comments_context & xlsx_sheet_context::get_comments_context()
|
||||
{
|
||||
return state()->comments_context_;
|
||||
if (state())
|
||||
return state()->comments_context_;
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
std::wstring xlsx_sheet_context::add_hyperlink(std::wstring const & ref, std::wstring const & target, std::wstring const & display, bool bExternal)
|
||||
{
|
||||
return state()->hyperlinks_.add( ref, target, display, bExternal);
|
||||
if (state())
|
||||
return state()->hyperlinks_.add( ref, target, display, bExternal);
|
||||
}
|
||||
void xlsx_sheet_context::dump_rels_hyperlinks(rels & Rels)
|
||||
{
|
||||
state()->hyperlinks_.dump_rels(Rels);
|
||||
if (state())
|
||||
state()->hyperlinks_.dump_rels(Rels);
|
||||
}
|
||||
void xlsx_sheet_context::serialize_hyperlinks(std::wostream & _Wostream)
|
||||
{
|
||||
state()->hyperlinks_.serialize(_Wostream);
|
||||
if (state())
|
||||
state()->hyperlinks_.serialize(_Wostream);
|
||||
}
|
||||
void xlsx_sheet_context::dump_rels_drawing(rels & Rels)
|
||||
{
|
||||
xlsx_drawings_rels_ptr drawing_rels = state()->drawing_context_.get_sheet_rels();
|
||||
|
||||
drawing_rels->dump_rels(Rels);
|
||||
if (state())
|
||||
{
|
||||
xlsx_drawings_rels_ptr drawing_rels = state()->drawing_context_.get_sheet_rels();
|
||||
|
||||
drawing_rels->dump_rels(Rels);
|
||||
}
|
||||
}
|
||||
void xlsx_sheet_context::serialize_ole_objects(std::wostream & strm)
|
||||
{
|
||||
state()->drawing_context_.serialize_objects(strm);
|
||||
if (state())
|
||||
state()->drawing_context_.serialize_objects(strm);
|
||||
}
|
||||
void xlsx_sheet_context::serialize_controls(std::wostream & strm)
|
||||
{
|
||||
state()->drawing_context_.serialize_controls(strm);
|
||||
if (state())
|
||||
state()->drawing_context_.serialize_controls(strm);
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,8 +54,8 @@ public:
|
||||
|
||||
static OfficeArtRecordPtr loadAnyArtRecord(XLS::CFRecord& record);
|
||||
|
||||
OfficeArtClientAnchorType anchor_type_;
|
||||
std::vector<OfficeArtRecordPtr> child_records;
|
||||
OfficeArtClientAnchorType anchor_type_;
|
||||
std::vector<OfficeArtRecordPtr> child_records;
|
||||
|
||||
private:
|
||||
OfficeArtRecordPtr CreateOfficeArt(unsigned short type);
|
||||
|
||||
@ -86,9 +86,14 @@ void OfficeArtDgContainer::loadFields(XLS::CFRecord& record)
|
||||
|
||||
for (size_t i = 0 ; i < child_records.size(); i++)
|
||||
{
|
||||
//Log::warning("ArtRecord : " + STR::int2str(child_records[i]->rh_own.recType, 16));
|
||||
|
||||
switch(child_records[i]->rh_own.recType)
|
||||
{
|
||||
case ODRAW::OfficeArtRecord::DgContainer:
|
||||
case ODRAW::OfficeArtRecord::DggContainer:
|
||||
{
|
||||
}break;
|
||||
case ODRAW::OfficeArtRecord::DgContainer:
|
||||
{
|
||||
OfficeArtDgContainer * dg = dynamic_cast<OfficeArtDgContainer *>(child_records[i].get());
|
||||
if (dg)
|
||||
@ -107,22 +112,22 @@ void OfficeArtDgContainer::loadFields(XLS::CFRecord& record)
|
||||
}
|
||||
child_records.erase(child_records.begin() + i, child_records.begin() + i + 1); i--;
|
||||
}break;
|
||||
case ODRAW::OfficeArtRecord::FDG:
|
||||
case ODRAW::OfficeArtRecord::FDG:
|
||||
{
|
||||
m_OfficeArtFDG = child_records[i];
|
||||
child_records.erase(child_records.begin() + i, child_records.begin() + i + 1); i--;
|
||||
}break;
|
||||
case ODRAW::OfficeArtRecord::FRITContainer:
|
||||
case ODRAW::OfficeArtRecord::FRITContainer:
|
||||
{
|
||||
m_OfficeArtFRITContainer = child_records[i];
|
||||
child_records.erase(child_records.begin() + i, child_records.begin() + i + 1); i--;
|
||||
}break;
|
||||
case ODRAW::OfficeArtRecord::SpgrContainer:
|
||||
case ODRAW::OfficeArtRecord::SpgrContainer:
|
||||
{
|
||||
m_OfficeArtSpgrContainer = child_records[i];
|
||||
child_records.erase(child_records.begin() + i, child_records.begin() + i + 1); i--;
|
||||
}break;
|
||||
case ODRAW::OfficeArtRecord::SpContainer:
|
||||
case ODRAW::OfficeArtRecord::SpContainer:
|
||||
{
|
||||
m_OfficeArtSpContainer.push_back(child_records[i]);
|
||||
child_records.erase(child_records.begin() + i,child_records.begin() + i + 1); i--;
|
||||
@ -132,8 +137,8 @@ void OfficeArtDgContainer::loadFields(XLS::CFRecord& record)
|
||||
// m_OfficeArtSpgrContainerFileBlock = OfficeArtContainerPtr(art_container);
|
||||
// child_records.erase(child_records.begin() + i,child_records.begin() + i + 1);
|
||||
// }break;
|
||||
default:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ public:
|
||||
static const bool CheckIfContainerStartFound(XLS::CFRecord& record);
|
||||
static const bool CheckIfContainerSizeOK(XLS::CFRecord& record);
|
||||
|
||||
static const XLS::ElementType type = XLS::typeOfficeArtDgContainer;
|
||||
static const XLS::ElementType type = XLS::typeOfficeArtDgContainer;
|
||||
|
||||
void loadFields(XLS::CFRecord& record);
|
||||
|
||||
|
||||
@ -71,31 +71,42 @@ void OfficeArtSolverContainer::loadFields(XLS::CFRecord& record)
|
||||
void OfficeArtDggContainer::loadFields(XLS::CFRecord& record)
|
||||
{
|
||||
OfficeArtContainer::loadFields(record);
|
||||
|
||||
for (size_t i = 0 ; i < child_records.size(); i++)
|
||||
|
||||
for (size_t i = 0; i < child_records.size(); i++)
|
||||
{
|
||||
switch(child_records[i]->rh_own.recType)
|
||||
switch (child_records[i]->rh_own.recType)
|
||||
{
|
||||
case ODRAW::OfficeArtRecord::DggContainer:
|
||||
{
|
||||
OfficeArtDggContainer* dggContainer = dynamic_cast<OfficeArtDggContainer*>(child_records[i].get());
|
||||
if (dggContainer)
|
||||
{
|
||||
if (!m_OfficeArtBStoreContainer) m_OfficeArtBStoreContainer = dggContainer->m_OfficeArtBStoreContainer;
|
||||
if (!m_OfficeArtColorMRUContainer) m_OfficeArtColorMRUContainer = dggContainer->m_OfficeArtColorMRUContainer;
|
||||
if (!m_OfficeArtSplitMenuColorContainer) m_OfficeArtSplitMenuColorContainer = dggContainer->m_OfficeArtSplitMenuColorContainer;
|
||||
if (!m_OfficeArtFDGGBlock) m_OfficeArtFDGGBlock = dggContainer->m_OfficeArtFDGGBlock;
|
||||
}
|
||||
}break;
|
||||
case ODRAW::OfficeArtRecord::BStoreContainer:
|
||||
{
|
||||
m_OfficeArtBStoreContainer = child_records[i];
|
||||
child_records.erase(child_records.begin() + i,child_records.begin() + i + 1); i--;
|
||||
}break;
|
||||
{
|
||||
m_OfficeArtBStoreContainer = child_records[i];
|
||||
child_records.erase(child_records.begin() + i, child_records.begin() + i + 1); i--;
|
||||
}break;
|
||||
case ODRAW::OfficeArtRecord::ColorMRUContainer:
|
||||
{
|
||||
m_OfficeArtColorMRUContainer = child_records[i];
|
||||
child_records.erase(child_records.begin() + i,child_records.begin() + i + 1); i--;
|
||||
}break;
|
||||
{
|
||||
m_OfficeArtColorMRUContainer = child_records[i];
|
||||
child_records.erase(child_records.begin() + i, child_records.begin() + i + 1); i--;
|
||||
}break;
|
||||
case ODRAW::OfficeArtRecord::SplitMenuColorContainer:
|
||||
{
|
||||
m_OfficeArtSplitMenuColorContainer = child_records[i];
|
||||
child_records.erase(child_records.begin() + i,child_records.begin() + i + 1); i--;
|
||||
}break;
|
||||
{
|
||||
m_OfficeArtSplitMenuColorContainer = child_records[i];
|
||||
child_records.erase(child_records.begin() + i, child_records.begin() + i + 1); i--;
|
||||
}break;
|
||||
case ODRAW::OfficeArtRecord::FDGGBlock:
|
||||
{
|
||||
m_OfficeArtFDGGBlock = child_records[i];
|
||||
child_records.erase(child_records.begin() + i,child_records.begin() + i + 1); i--;
|
||||
}break;
|
||||
{
|
||||
m_OfficeArtFDGGBlock = child_records[i];
|
||||
child_records.erase(child_records.begin() + i, child_records.begin() + i + 1); i--;
|
||||
}break;
|
||||
//case ODRAW::OfficeArtRecord::SpgrContainerFileBlock:
|
||||
// {
|
||||
// m_OfficeArtSpgrContainerFileBlock = OfficeArtContainerPtr(art_container);
|
||||
|
||||
@ -43,14 +43,18 @@ public:
|
||||
OfficeArtDggContainer(const OfficeArtClientAnchorType anchor_type) : OfficeArtContainer(0x0F, DggContainer, anchor_type) {}
|
||||
XLS::BiffStructurePtr clone() { return XLS::BiffStructurePtr(new OfficeArtDggContainer(*this)); }
|
||||
|
||||
static const XLS::ElementType type = XLS::typeOfficeArtDggContainer;
|
||||
|
||||
void loadFields(XLS::CFRecord& record);
|
||||
|
||||
OfficeArtRecordPtr m_OfficeArtBStoreContainer;
|
||||
OfficeArtRecordPtr m_OfficeArtColorMRUContainer;
|
||||
OfficeArtRecordPtr m_OfficeArtSplitMenuColorContainer;
|
||||
OfficeArtRecordPtr m_OfficeArtFDGGBlock;
|
||||
|
||||
//+ OfficeArtFOPT + OfficeArtTertiaryFOPT
|
||||
};
|
||||
typedef boost::shared_ptr<OfficeArtDggContainer> OfficeArtDggContainerPtr;
|
||||
|
||||
class OfficeArtSpgrContainer : public OfficeArtContainer
|
||||
{
|
||||
@ -61,9 +65,9 @@ public:
|
||||
|
||||
void loadFields(XLS::CFRecord& record);
|
||||
|
||||
static const XLS::ElementType type = XLS::typeOfficeArtSpgrContainer;
|
||||
static const XLS::ElementType type = XLS::typeOfficeArtSpgrContainer;
|
||||
|
||||
std::vector<OfficeArtContainerPtr> m_OfficeArtSpgrContainerFileBlock;
|
||||
std::vector<OfficeArtContainerPtr> m_OfficeArtSpgrContainerFileBlock;
|
||||
};
|
||||
|
||||
class OfficeArtSolverContainer : public OfficeArtRecord
|
||||
|
||||
@ -48,7 +48,7 @@ public:
|
||||
GlobalWorkbookInfoPtr global_info_;
|
||||
size_t ws_index_;
|
||||
|
||||
std::vector<BiffStructurePtr> m_arHFPictureDrawing;
|
||||
std::vector<BiffStructurePtr> m_arHFPictureDrawing; // тут OfficeArtDgContainer - описания шейпов ...
|
||||
|
||||
BaseObjectPtr m_PAGESETUP;
|
||||
BaseObjectPtr m_PROTECTION;
|
||||
|
||||
@ -105,7 +105,7 @@
|
||||
//#include "Biff_records/XCT.h"
|
||||
//#include "Biff_records/CRN.h"
|
||||
|
||||
#include "Biff_structures/ODRAW/OfficeArtDgContainer.h"
|
||||
#include "Biff_structures/ODRAW/SimpleOfficeArtContainers.h"
|
||||
|
||||
namespace XLS
|
||||
{;
|
||||
@ -657,7 +657,7 @@ void GlobalsSubstream::LoadHFPicture()
|
||||
hf = dynamic_cast<HFPicture*>(m_arHFPicture[j].get());
|
||||
record.appendRawData(hf->recordDrawingGroup);
|
||||
}
|
||||
ODRAW::OfficeArtDgContainerPtr rgDrawing = ODRAW::OfficeArtDgContainerPtr(new ODRAW::OfficeArtDgContainer(ODRAW::OfficeArtRecord::CA_HF));
|
||||
ODRAW::OfficeArtDggContainerPtr rgDrawing = ODRAW::OfficeArtDggContainerPtr(new ODRAW::OfficeArtDggContainer(ODRAW::OfficeArtRecord::CA_HF));
|
||||
rgDrawing->loadFields(record);
|
||||
m_arHFPictureDrawing.push_back(rgDrawing);
|
||||
current_size_hf = 0;
|
||||
@ -674,7 +674,15 @@ void GlobalsSubstream::LoadHFPicture()
|
||||
HFPicture* hf = dynamic_cast<HFPicture*>(m_arHFPicture[j].get());
|
||||
record.appendRawData(hf->recordDrawingGroup);
|
||||
}
|
||||
ODRAW::OfficeArtDgContainerPtr rgDrawing = ODRAW::OfficeArtDgContainerPtr(new ODRAW::OfficeArtDgContainer(ODRAW::OfficeArtRecord::CA_HF));
|
||||
ODRAW::OfficeArtRecordHeader rh_test;
|
||||
record >> rh_test;
|
||||
record.RollRdPtrBack(8);//sizeof(OfficeArtRecordHeader)
|
||||
|
||||
if ((rh_test.recType & 0xF000) != 0xF000)
|
||||
{
|
||||
return;
|
||||
}
|
||||
ODRAW::OfficeArtDggContainerPtr rgDrawing = ODRAW::OfficeArtDggContainerPtr(new ODRAW::OfficeArtDggContainer(ODRAW::OfficeArtRecord::CA_HF));
|
||||
rgDrawing->loadFields(record);
|
||||
m_arHFPictureDrawing.push_back(rgDrawing);
|
||||
}
|
||||
|
||||
@ -88,7 +88,7 @@ public:
|
||||
//std::vector<BaseObjectPtr> m_arPIVOTCACHEDEFINITION; -> GlobalWorkbookInfo
|
||||
std::vector<BaseObjectPtr> m_arDConn;
|
||||
|
||||
std::vector<BiffStructurePtr> m_arHFPictureDrawing;
|
||||
std::vector<BiffStructurePtr> m_arHFPictureDrawing; // тут OfficeArtDggContainer - картинки ...
|
||||
|
||||
unsigned short code_page_;
|
||||
GlobalWorkbookInfoPtr global_info_;
|
||||
|
||||
@ -717,6 +717,7 @@ enum ElementType
|
||||
typeOfficeArtRecord = 3000,
|
||||
typeOfficeArtBStoreContainerFileBlock,
|
||||
typeOfficeArtDgContainer,
|
||||
typeOfficeArtDggContainer,
|
||||
typeOfficeArtCOLORREF,
|
||||
typeOfficeArtFOPTE,
|
||||
typeOfficeArtFRIT,
|
||||
|
||||
Reference in New Issue
Block a user