diff --git a/MsBinaryFile/Common/Vba/VbaReader.cpp b/MsBinaryFile/Common/Vba/VbaReader.cpp index 351267ffb8..6bf886f7dc 100644 --- a/MsBinaryFile/Common/Vba/VbaReader.cpp +++ b/MsBinaryFile/Common/Vba/VbaReader.cpp @@ -333,7 +333,7 @@ std::wstring CVbaReader::convertObject(const std::wstring & name, unsigned int c { site->Object = VBA::ActiveXObjectPtr(OOX::ActiveXObject::Create(site->ClsidCacheIndex ? *site->ClsidCacheIndex : 0)); - if (strmObject->getDataSize() > nextStreamPositionEmbedded) + if (strmObject->getDataSize() > nextStreamPositionEmbedded && site->ObjectStreamSize) { site->Object->Parse(strmObject->getData() + nextStreamPositionEmbedded, *site->ObjectStreamSize); nextStreamPositionEmbedded += *site->ObjectStreamSize; diff --git a/OdfFile/Writer/Converter/XlsxConverter.cpp b/OdfFile/Writer/Converter/XlsxConverter.cpp index 880cb9f6c7..ef96392055 100644 --- a/OdfFile/Writer/Converter/XlsxConverter.cpp +++ b/OdfFile/Writer/Converter/XlsxConverter.cpp @@ -3173,25 +3173,25 @@ void XlsxConverter::convert(OOX::Spreadsheet::CControls *oox_controls, OOX::Spre { { oox_table_position from = {}, to = {}; - - convert(oCellAnchor->m_oFrom.GetPointer(), &from); + + convert(oCellAnchor->m_oFrom.GetPointer(), &from); convert(oCellAnchor->m_oTo.GetPointer(), &to); double x1 = 0, y1 = 0, x2 = 0, y2 = 0; ods_context->current_table()->convert_position(from, x1, y1); - ods_context->current_table()->convert_position(to, x2, y2); - + ods_context->current_table()->convert_position(to, x2, y2); + ods_context->drawing_context()->set_drawings_rect(x1, y1, x2 - x1, y2 - y1); - } + } ods_context->drawing_context()->start_drawing(); ods_context->drawing_context()->start_control(id); - + if (pControl->m_oName.IsInit()) { ods_context->controls_context()->set_name(*pControl->m_oName); ods_context->drawing_context()->set_name(*pControl->m_oName); } -//---------------------- + //---------------------- if (oFormControlPr->m_oText.IsInit()) { ods_context->controls_context()->set_label(*oFormControlPr->m_oText); @@ -3199,13 +3199,13 @@ void XlsxConverter::convert(OOX::Spreadsheet::CControls *oox_controls, OOX::Spre if (oFormControlPr->m_oFillColor.IsInit()) { ods_context->drawing_context()->start_area_properties(true); - ods_context->drawing_context()->set_solid_fill(oFormControlPr->m_oFillColor->ToString()); + ods_context->drawing_context()->set_solid_fill(oFormControlPr->m_oFillColor->ToString()); ods_context->drawing_context()->end_area_properties(); } if (oFormControlPr->m_oBorderColor.IsInit()) { ods_context->drawing_context()->start_line_properties(); - ods_context->drawing_context()->set_line_color(oFormControlPr->m_oBorderColor->ToString()); + ods_context->drawing_context()->set_line_color(oFormControlPr->m_oBorderColor->ToString()); ods_context->drawing_context()->end_line_properties(); } if (oFormControlPr->m_oTextHAlign.IsInit()) @@ -3283,37 +3283,40 @@ void XlsxConverter::convert(OOX::Spreadsheet::CControls *oox_controls, OOX::Spre //nullable_bool m_oPasswordEdit; //nullable m_oItemLst; //--------------------- - if (pControl->m_oControlPr->m_oLinkedCell.IsInit()) + if (pControl->m_oControlPr.IsInit()) { - ods_context->controls_context()->set_linkedCell(*pControl->m_oControlPr->m_oLinkedCell); + if (pControl->m_oControlPr->m_oLinkedCell.IsInit()) + { + ods_context->controls_context()->set_linkedCell(*pControl->m_oControlPr->m_oLinkedCell); + } + if (pControl->m_oControlPr->m_oListFillRange.IsInit()) + { + ods_context->controls_context()->set_listFillRange(*pControl->m_oControlPr->m_oListFillRange); + } + if (pControl->m_oControlPr->m_oMacro.IsInit()) + { + ods_context->controls_context()->set_macro(*pControl->m_oControlPr->m_oMacro); + } + if (pControl->m_oControlPr->m_oDisabled.IsInit()) + { + ods_context->controls_context()->set_disabled(*pControl->m_oControlPr->m_oDisabled); + } + if (pControl->m_oControlPr->m_oPrint.IsInit()) + { + ods_context->controls_context()->set_printable(*pControl->m_oControlPr->m_oPrint); + } + if (pControl->m_oControlPr->m_oLocked.IsInit()) + { + } + //nullable_string m_oAltText; + //nullable_bool m_oAutoFill; + //nullable_bool m_oAutoLine; + //nullable_bool m_oAutoPict; + //nullable_bool m_oDde; + //nullable_bool m_oDefaultSize; + //nullable_string m_oCf; + //nullable_bool m_oRecalcAlways; } - if (pControl->m_oControlPr->m_oListFillRange.IsInit()) - { - ods_context->controls_context()->set_listFillRange(*pControl->m_oControlPr->m_oListFillRange); - } - if (pControl->m_oControlPr->m_oMacro.IsInit()) - { - ods_context->controls_context()->set_macro(*pControl->m_oControlPr->m_oMacro); - } - if (pControl->m_oControlPr->m_oDisabled.IsInit()) - { - ods_context->controls_context()->set_disabled(*pControl->m_oControlPr->m_oDisabled); - } - if (pControl->m_oControlPr->m_oPrint.IsInit()) - { - ods_context->controls_context()->set_printable(*pControl->m_oControlPr->m_oPrint); - } - if (pControl->m_oControlPr->m_oLocked.IsInit()) - { - } - //nullable_string m_oAltText; - //nullable_bool m_oAutoFill; - //nullable_bool m_oAutoLine; - //nullable_bool m_oAutoPict; - //nullable_bool m_oDde; - //nullable_bool m_oDefaultSize; - //nullable_string m_oCf; - //nullable_bool m_oRecalcAlways; //--------------------- ods_context->drawing_context()->end_control(); ods_context->drawing_context()->end_drawing();