summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svdedtv2.cxx
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2018-04-07 15:22:06 -0400
committerJan Holesovsky <kendy@collabora.com>2018-06-07 10:45:19 +0200
commitddb881e2cc9d8f5d17ccb133d2e8a1b6203d04c3 (patch)
tree830ce2fe9fa0f3fa615c7654fcdcfb10e963fb26 /svx/source/svdraw/svdedtv2.cxx
parenteb02d79c19405a39aac0af472116a1b99beb2cc6 (diff)
svx: support breaking PDFs imported as images
Change-Id: I990c2b3c3055fbffddedc407c34beb5824277b38
Diffstat (limited to 'svx/source/svdraw/svdedtv2.cxx')
-rw-r--r--svx/source/svdraw/svdedtv2.cxx28
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();