Commit 1b91ee57 authored by ElenaSubbotina's avatar ElenaSubbotina

x2t binary - fix convert ole without vml drawing

parent 337c92e5
......@@ -1991,7 +1991,7 @@ void XlsConverter::convert(XLS::Obj * obj)
storageOle->close();
delete storageOle;
}
std::wstring objectId = L"obId" + std::to_wstring(id);
std::wstring objectId = L"objId" + std::to_wstring(id);
xlsx_context->current_sheet().sheet_rels().add(oox::relationship(
objectId, L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject", L"../embeddings/" + file_name));
......
......@@ -537,7 +537,6 @@ void xlsx_drawing_context::end_drawing(_drawing_state_ptr & drawing_state)
}
if ( drawing_state->type == external_items::typeOleObject )
{
drawing_state->hidden = true;
serialize_shape(drawing_state);
}
if ( drawing_state->type == external_items::typeChart )
......
......@@ -189,6 +189,7 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
CP_XML_ATTR(L"xmlns:mc", L"http://schemas.openxmlformats.org/markup-compatibility/2006");
CP_XML_ATTR(L"xmlns:xdr", L"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing");
CP_XML_ATTR(L"xmlns:x14", L"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main");
CP_XML_ATTR(L"mc:Ignorable", L"x14ac");
CP_XML_ATTR(L"xmlns:x14ac", L"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac");
......
......@@ -154,6 +154,7 @@ namespace OOX
smart_ptr<PPTX::Logic::Shape> shape = m_oElement->GetElem().smart_dynamic_cast<PPTX::Logic::Shape>();
if (shape.IsInit())
{
m_nId = shape->nvSpPr.cNvPr.id;
if (shape->nvSpPr.cNvPr.oleSpid.IsInit())
{
//ссылка на объект
......@@ -162,7 +163,7 @@ namespace OOX
}
}
smart_ptr<PPTX::Logic::GraphicFrame> frame = m_oElement->GetElem().smart_dynamic_cast<PPTX::Logic::GraphicFrame>();
if ((frame.IsInit()) && (frame->oleSpid.IsInit()))
if ((frame.IsInit()) && (frame->oleSpid.IsInit()))
{
//ссылка на объект или шейп в vmlDrawing
m_sSpId = frame->oleSpid.get();
......@@ -221,6 +222,7 @@ namespace OOX
//для удобства
nullable<std::wstring> m_sSpId;
nullable<int> m_nId;
};
} //Spreadsheet
} // namespace OOX
......
......@@ -2956,6 +2956,15 @@ namespace BinXlsxRW
if (!pCellAnchor->m_bShapeOle && pCellAnchor->isValid())
{
if(oWorksheet.m_oOleObjects.IsInit() && pCellAnchor->m_nId.IsInit())
{
std::map<int, COleObject*>::const_iterator pFind = oWorksheet.m_oOleObjects->m_mapOleObjects.find(pCellAnchor->m_nId.get());
if (pFind != oWorksheet.m_oOleObjects->m_mapOleObjects.end())
{
pCellAnchor->m_bShapeOle = true;
continue;
}
}
int nCurPos = m_oBcw.WriteItemStart(c_oSerWorksheetsTypes::Drawing);
WriteDrawing(oWorksheet, pDrawing, pCellAnchor, pVmlDrawing);
m_oBcw.WriteItemEnd(nCurPos);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment