diff options
Diffstat (limited to 'svx/source/svdraw/svdedtv2.cxx')
-rw-r--r-- | svx/source/svdraw/svdedtv2.cxx | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx index 8d2fe58b611a..ae7fa5414fec 100644 --- a/svx/source/svdraw/svdedtv2.cxx +++ b/svx/source/svdraw/svdedtv2.cxx @@ -30,6 +30,7 @@ #include <svx/svdoole2.hxx> #include <svx/dialmgr.hxx> #include "svdfmtf.hxx" +#include "svdpdf.hxx" #include <svx/svdetc.hxx> #include <sfx2/basedlgs.hxx> #include <editeng/outlobj.hxx> @@ -2038,22 +2039,35 @@ void SdrEditView::DoImportMarkedMtf(SvdProgressInfo *pProgrInfo) SdrPageView* pPV=pM->GetPageView(); SdrObjList* pOL=pObj->getParentOfSdrObject(); const size_t nInsPos=pObj->GetOrdNum()+1; - SdrGrafObj* pGraf= dynamic_cast<SdrGrafObj*>( pObj ); - SdrOle2Obj* pOle2= dynamic_cast<SdrOle2Obj*>( pObj ); sal_uIntPtr nInsAnz=0; tools::Rectangle aLogicRect; - if (pGraf && (pGraf->HasGDIMetaFile() || pGraf->isEmbeddedVectorGraphicData())) + SdrGrafObj* pGraf = dynamic_cast<SdrGrafObj*>( pObj ); + if (pGraf != nullptr) { - GDIMetaFile aMetaFile(GetMetaFile(pGraf)); - if (aMetaFile.GetActionSize()) + if (pGraf->HasGDIMetaFile() || pGraf->isEmbeddedVectorGraphicData()) + { + GDIMetaFile aMetaFile(GetMetaFile(pGraf)); + if (aMetaFile.GetActionSize()) + { + aLogicRect = pGraf->GetLogicRect(); + ImpSdrGDIMetaFileImport aFilter(*mpModel, pObj->GetLayer(), aLogicRect); + nInsAnz = aFilter.DoImport(aMetaFile, *pOL, nInsPos, pProgrInfo); + } + } + else if (pGraf->isEmbeddedPdfData()) { aLogicRect = pGraf->GetLogicRect(); - ImpSdrGDIMetaFileImport aFilter(*mpModel, pObj->GetLayer(), aLogicRect); - nInsAnz = aFilter.DoImport(aMetaFile, *pOL, nInsPos, pProgrInfo); + ImpSdrPdfImport aFilter(*mpModel, pObj->GetLayer(), aLogicRect, pGraf->getEmbeddedPdfData()); + if (pGraf->getEmbeddedPageNumber() < aFilter.GetPageCount()) + { + nInsAnz = aFilter.DoImport(*pOL, nInsPos, pGraf->getEmbeddedPageNumber(), pProgrInfo); + } + } } + SdrOle2Obj* pOle2 = dynamic_cast<SdrOle2Obj*>(pObj); if (pOle2 != nullptr && pOle2->GetGraphic()) { aLogicRect = pOle2->GetLogicRect(); |