Commit ccc4d751 authored by ElenaSubbotina's avatar ElenaSubbotina

Merge remote-tracking branch 'origin/hotfix/v4.4.2' into develop

parents 7852b7fb a020d3db
......@@ -250,12 +250,26 @@ namespace PPTX
}
else if (L"oleObj" == strName)
{
olePic = oNode.ReadNode(L"p:pic");
olePic = oNode.ReadNode(L"p:pic"); //нормальный вариант объекта
if (olePic.IsInit())
{
olePic->fromXMLOle(oNode);
result = true;
}
else
{
olePic.Init(); //старый вариант описания объекта через spid в VmlDrawing
olePic->spPr.xfrm;
Logic::PrstGeom* geom = new Logic::PrstGeom();
geom->prst = L"rect";
olePic->spPr.Geometry.m_geometry.reset(geom);
olePic->fromXMLOle(oNode);
result = true;
}
if (olePic->spPr.xfrm.IsInit() == false)
olePic->spPr.xfrm = xfrm;
}
else if (L"AlternateContent" == strName)
{
......
......@@ -619,6 +619,45 @@ namespace PPTX
if(oleObject.IsInit())
{
pWriter->StartRecord(SPTREE_TYPE_OLE);
if (oleObject->m_sShapeId.IsInit() && (!blipFill.blip->embed.IsInit() && blipFill.blip->oleFilepathImage.empty()) &&
parentFileIs<PPTX::Slide>() && parentFileAs<PPTX::Slide>().Vml.IsInit())
{
OOX::CVmlDrawing *pVml = parentFileAs<PPTX::Slide>().Vml.operator->();
std::map<std::wstring, OOX::CVmlDrawing::_vml_shape>::iterator pPair = pVml->m_mapShapes.find(*oleObject->m_sShapeId);
if (pVml->m_mapShapes.end() != pPair)
{
pPair->second.bUsed = true;
OOX::Vml::CShape* pShape = dynamic_cast<OOX::Vml::CShape*>(pPair->second.pElement);
for(size_t j = 0; (pShape) && (j < pShape->m_arrItems.size()); ++j)
{
OOX::WritingElement* pChildElemShape = pShape->m_arrItems[j];
if(OOX::et_v_imagedata == pChildElemShape->getType())
{
OOX::Vml::CImageData* pImageData = static_cast<OOX::Vml::CImageData*>(pChildElemShape);
std::wstring sIdImageFileCache;
if (pImageData->m_oRelId.IsInit()) sIdImageFileCache = pImageData->m_oRelId->GetValue();
else if (pImageData->m_rId.IsInit()) sIdImageFileCache = pImageData->m_rId->GetValue();
if (!sIdImageFileCache.empty())
{
//ищем физический файл ( rId относительно vml_drawing)
smart_ptr<OOX::File> pFile = pVml->Find(sIdImageFileCache);
if (pFile.IsInit() && ( OOX::FileTypes::Image == pFile->type()))
{
OOX::Image* pImageFileCache = static_cast<OOX::Image*>(pFile.operator->());
blipFill.blip->oleFilepathImage = pImageFileCache->filename().GetPath();
}
}
}
}
}
}
}
else if (nvPicPr.nvPr.media.is_init())
{
......@@ -630,10 +669,17 @@ namespace PPTX
blipFill.blip->mediaFilepath = mediaFile->filename().GetPath();
}
if (nvPicPr.nvPr.media.is<MediaFile>())
{
if (nvPicPr.nvPr.media.as<MediaFile>().name == L"audioFile")
pWriter->StartRecord(SPTREE_TYPE_AUDIO);
else if (nvPicPr.nvPr.media.as<MediaFile>().name == L"videoFile")
pWriter->StartRecord(SPTREE_TYPE_VIDEO);
}
else if (nvPicPr.nvPr.media.is<WavAudioFile>() || nvPicPr.nvPr.media.is<AudioCD>())
{
pWriter->StartRecord(SPTREE_TYPE_AUDIO);
}
else
pWriter->StartRecord(SPTREE_TYPE_PIC);
}
......@@ -1338,6 +1384,7 @@ namespace PPTX
blipFill.blip.Init();
blipFill.blip->oleRid = oleObject->m_oId->get();
}
node.ReadAttributeBase(L"spid", oleObject->m_sShapeId);
}
} // namespace Logic
} // namespace PPTX
......@@ -259,7 +259,7 @@ namespace PPTX
void toXmlWriterVML(NSBinPptxRW::CXmlWriter* pWriter, smart_ptr<PPTX::Theme>& oTheme, smart_ptr<PPTX::Logic::ClrMap>& oClrMap, bool in_group = false);
//----------------------------------------------------------------------
NvPicPr nvPicPr;
BlipFill blipFill;
mutable BlipFill blipFill;
SpPr spPr;
nullable<ShapeStyle> style;
//internal
......
......@@ -750,7 +750,7 @@ class pConnectionSitesDir : public OfficeArtFOPTE
virtual void ReadComplexData(XLS::CFRecord& record);
IMsoArray<ODRAW::FixedPoint> complex;
IMsoArray<OSHARED::FixedPoint> complex;
};
class pInscribe : public OfficeArtFOPTE
......
......@@ -2423,7 +2423,7 @@ void xlsx_drawing_context::set_custom_connection(std::vector<ODRAW::MSOPOINT>& p
current_drawing_states->back()->custom_connection = points;
}
void xlsx_drawing_context::set_custom_connectionDir(std::vector<ODRAW::FixedPoint>& points)
void xlsx_drawing_context::set_custom_connectionDir(std::vector<OSHARED::FixedPoint>& points)
{
if (current_drawing_states == NULL) return;
if (current_drawing_states->empty()) return;
......
......@@ -182,7 +182,7 @@ public:
std::vector<ODRAW::MSOPOINT> custom_verticles;
std::vector<ODRAW::ADJH> custom_adjustHandles;
std::vector<ODRAW::MSOPOINT> custom_connection;
std::vector<ODRAW::FixedPoint> custom_connectionDir;
std::vector<OSHARED::FixedPoint>custom_connectionDir;
std::vector<ODRAW::MSORECT> custom_inscribe;
_rect custom_rect;
......@@ -413,7 +413,7 @@ public:
void set_custom_adjustValues(std::vector<_CP_OPT(int)> & values);
void set_custom_path (int type_path);
void set_custom_connection (std::vector<ODRAW::MSOPOINT> & points);
void set_custom_connectionDir(std::vector<ODRAW::FixedPoint>& points);
void set_custom_connectionDir(std::vector<OSHARED::FixedPoint>& points);
void set_custom_inscribe (std::vector<ODRAW::MSORECT> & rects);
void set_custom_x_limo (int val);
void set_custom_y_limo (int val);
......
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