This commit is contained in:
Elena Subbotina
2025-10-15 12:36:08 +03:00
parent f335a5b024
commit 4899ed4e7f
7 changed files with 124 additions and 9 deletions

View File

@ -2608,12 +2608,16 @@ void XlsConverter::convert(XLS::Obj * obj)
xlsx_context->get_drawing_context().set_object_x_max(obj->sbs.iMax);
xlsx_context->get_drawing_context().set_object_x_inc(obj->sbs.dInc);
xlsx_context->get_drawing_context().set_object_x_page(obj->sbs.dPage);
xlsx_context->get_drawing_context().set_object_3D(!obj->sbs.fNo3d);
xlsx_context->get_drawing_context().set_object_hscroll(obj->sbs.fHoriz);
xlsx_context->get_drawing_context().set_object_dx(obj->sbs.dxScroll);
}
if (obj->list.fExist)
{
xlsx_context->get_drawing_context().set_object_x_sel(obj->list.iSel);
xlsx_context->get_drawing_context().set_object_x_sel_type(obj->list.wListSelType);
xlsx_context->get_drawing_context().set_object_lct(obj->list.lct);
xlsx_context->get_drawing_context().set_object_3D(!obj->list.fNo3d);
if (obj->list.fmla.bFmlaExist)
{
@ -2628,9 +2632,9 @@ void XlsConverter::convert(XLS::Obj * obj)
}
if (obj->checkBox.fExist)
{
//unsigned short fChecked;
//unsigned short accel;
//bool fNo3d;
xlsx_context->get_drawing_context().set_object_checked(obj->checkBox.fChecked);
xlsx_context->get_drawing_context().set_object_3D(!obj->checkBox.fNo3d);
//unsigned short accel;
}
if (obj->radioButton.fExist)
{
@ -2639,10 +2643,10 @@ void XlsConverter::convert(XLS::Obj * obj)
}
if (obj->edit.fExist)
{
//unsigned short ivtEdit;
//Boolean<unsigned short> fMultiLine;
//unsigned short fVScroll;
//unsigned short id;
xlsx_context->get_drawing_context().set_object_multiLine(obj->edit.fMultiLine);
xlsx_context->get_drawing_context().set_object_vscroll(obj->edit.fVScroll);
//unsigned short ivtEdit;
//unsigned short id;
}
bool full_ref = false;
if (obj->cmo.ot > 0x06) full_ref = true;

View File

@ -793,6 +793,48 @@ void xlsx_drawing_context::set_object_drop_lines(int val)
current_drawing_states->back()->object.drop_lines = val;
}
void xlsx_drawing_context::set_object_dx(int val)
{
if (current_drawing_states == NULL) return;
if (current_drawing_states->empty()) return;
current_drawing_states->back()->object.dx = val;
}
void xlsx_drawing_context::set_object_checked(bool val)
{
if (current_drawing_states == NULL) return;
if (current_drawing_states->empty()) return;
current_drawing_states->back()->object.checked = val;
}
void xlsx_drawing_context::set_object_multiLine(bool val)
{
if (current_drawing_states == NULL) return;
if (current_drawing_states->empty()) return;
current_drawing_states->back()->object.multiLine = val;
}
void xlsx_drawing_context::set_object_vscroll(bool val)
{
if (current_drawing_states == NULL) return;
if (current_drawing_states->empty()) return;
current_drawing_states->back()->object.vscroll = val;
}
void xlsx_drawing_context::set_object_hscroll(bool val)
{
if (current_drawing_states == NULL) return;
if (current_drawing_states->empty()) return;
current_drawing_states->back()->object.hscroll = val;
}
void xlsx_drawing_context::set_object_3D(bool val)
{
if (current_drawing_states == NULL) return;
if (current_drawing_states->empty()) return;
current_drawing_states->back()->object._3D = val;
}
void xlsx_drawing_context::end_drawing()
{
if (current_drawing_states == NULL) return;
@ -1303,6 +1345,30 @@ void xlsx_drawing_context::serialize_vml_shape(_drawing_state_ptr & drawing_stat
{
CP_XML_NODE(L"x:DropLines"){CP_XML_CONTENT(*drawing_state->object.drop_lines);}
}
if (drawing_state->object.dx)
{
CP_XML_NODE(L"x:Dx") { CP_XML_CONTENT(*drawing_state->object.dx); }
}
if (drawing_state->object.checked)
{
CP_XML_NODE(L"x:Checked") { CP_XML_CONTENT(*drawing_state->object.checked); }
}
if (drawing_state->object._3D)
{
CP_XML_NODE(L"x:NoThreeD") { CP_XML_CONTENT(*drawing_state->object._3D ? L"False" : L"True"); }
}
if (drawing_state->object.multiLine)
{
CP_XML_NODE(L"x:Multiline") { CP_XML_CONTENT(*drawing_state->object.multiLine ? L"True" : L"False"); }
}
if (drawing_state->object.vscroll)
{
CP_XML_NODE(L"x:VScroll") { CP_XML_CONTENT(*drawing_state->object.vscroll ? L"True" : L"False"); }
}
if (drawing_state->object.hscroll)
{
CP_XML_NODE(L"x:Horiz") { CP_XML_CONTENT(*drawing_state->object.hscroll ? L"True" : L"False"); }
}
}
}
@ -2711,6 +2777,30 @@ void xlsx_drawing_context::serialize_control_props(std::wostream & strm, _drawin
{
CP_XML_ATTR(L"dropLines", *drawing_state->object.drop_lines);
}
if (drawing_state->object.dx)
{
CP_XML_ATTR(L"dx", *drawing_state->object.dx);
}
if (drawing_state->object.checked && (*drawing_state->object.checked))
{
CP_XML_ATTR(L"checked", L"Checked");
}
if (drawing_state->object._3D)
{
CP_XML_ATTR(L"noThreeD", !(*drawing_state->object._3D));
}
if (drawing_state->object.vscroll)
{
CP_XML_ATTR(L"verticalBar", *drawing_state->object.vscroll);
}
if (drawing_state->object.hscroll)
{
CP_XML_ATTR(L"horiz", *drawing_state->object.hscroll);
}
if (drawing_state->object.multiLine)
{
CP_XML_ATTR(L"multiLine", *drawing_state->object.multiLine);
}
}
}
}

View File

@ -355,9 +355,15 @@ public:
_CP_OPT(int) x_sel;
_CP_OPT(int) x_sel_type;
_CP_OPT(int) lct ;
_CP_OPT(int) dx;
std::wstring fmlaRange;
_CP_OPT(int) drop_style;
_CP_OPT(int) drop_lines;
_CP_OPT(bool) checked;
_CP_OPT(bool) _3D;
_CP_OPT(bool) vscroll;
_CP_OPT(bool) hscroll;
_CP_OPT(bool) multiLine;
}object;
//for group
std::vector<_drawing_state_ptr> drawing_states;
@ -521,6 +527,12 @@ public:
void set_object_fmlaRange (const std::wstring & fmla);
void set_object_drop_style (int val);
void set_object_drop_lines (int val);
void set_object_dx (int dx);
void set_object_checked (bool val);
void set_object_multiLine (bool val);
void set_object_vscroll (bool val);
void set_object_hscroll (bool val);
void set_object_3D (bool val);
//---------------------------------------------------------------------------------------------
void set_custom_rect (_rect & rect);
void set_custom_verticles (std::vector<ODRAW::MSOPOINT> & points);

View File

@ -42,10 +42,12 @@ BiffStructurePtr FtCblsData::clone()
void FtCblsData::load(CFRecord& record)
{
//ft(2 bytes) : Reserved.MUST be 0x0012.
//cb(2 bytes) : Reserved.MUST be 0x0008.
unsigned short ft, cb;
record >> ft >> cb;
if ( ft != 0x000a && cb != 0x000c)
if ( ft != 0x0012 && cb != 0x0008)
{
record.RollRdPtrBack(4);
return;

View File

@ -42,6 +42,8 @@ BiffStructurePtr FtEdoData::clone()
void FtEdoData::load(CFRecord& record)
{
//ft(2 bytes) : Reserved.MUST be 0x0010.
//cb(2 bytes) : Reserved.MUST be 0x0008.
unsigned short ft, cb;
record >> ft >> cb;

View File

@ -42,6 +42,8 @@ BiffStructurePtr FtGboData::clone()
void FtGboData::load(CFRecord& record)
{
//ft(2 bytes) : Reserved.MUST be 0x000F.
//cb(2 bytes) : Reserved.MUST be 0x0006
unsigned short ft, cb;
record >> ft >> cb;

View File

@ -43,10 +43,13 @@ BiffStructurePtr FtRboData::clone()
void FtRboData::load(CFRecord& record)
{
//ft(2 bytes) : Reserved.MUST be 0x0011.
//cb(2 bytes) : Reserved.MUST be 0x0004.
unsigned short ft, cb;
record >> ft >> cb;
if ( ft != 0x000b && cb != 0x0006)
if ( ft != 0x00011 && cb != 0x0004)
{
record.RollRdPtrBack(4);
return;