summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sd/source/ui/view/drviews2.cxx6
-rw-r--r--svtools/source/graphic/grfcache.cxx8
2 files changed, 11 insertions, 3 deletions
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index b603583845fc..bec691d69132 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -926,10 +926,10 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
if( rMarkList.GetMarkCount() == 1 )
{
- SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- if( pObj && dynamic_cast< const SdrGrafObj *>( pObj ) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap )
+ const SdrGrafObj* pObj = dynamic_cast<const SdrGrafObj*>(rMarkList.GetMark(0)->GetMarkedSdrObj());
+ if (pObj && (pObj->GetGraphicType() == GraphicType::Bitmap || pObj->GetGraphicObject().GetGraphic().getPdfData().hasElements()))
{
- GraphicObject aGraphicObject( static_cast<SdrGrafObj*>( pObj )->GetGraphicObject() );
+ GraphicObject aGraphicObject(pObj->GetGraphicObject());
{
GraphicHelper::ExportGraphic( aGraphicObject.GetGraphic(), "" );
}
diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx
index fa3f9bf70a71..43f4d07b28c3 100644
--- a/svtools/source/graphic/grfcache.cxx
+++ b/svtools/source/graphic/grfcache.cxx
@@ -34,6 +34,8 @@
#define MAX_BMP_EXTENT 4096
+using namespace com::sun::star;
+
static const char aHexData[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
class GraphicID
@@ -155,6 +157,7 @@ private:
// SvgData support
SvgDataPtr maSvgData;
+ uno::Sequence<sal_Int8> maPdfData;
bool ImplInit( const GraphicObject& rObj );
void ImplFillSubstitute( Graphic& rSubstitute );
@@ -247,6 +250,8 @@ bool GraphicCacheEntry::ImplInit( const GraphicObject& rObj )
case GraphicType::GdiMetafile:
{
mpMtf = new GDIMetaFile( rGraphic.GetGDIMetaFile() );
+ if (rGraphic.getPdfData().hasElements())
+ maPdfData = rGraphic.getPdfData();
}
break;
@@ -293,6 +298,8 @@ void GraphicCacheEntry::ImplFillSubstitute( Graphic& rSubstitute )
else if( mpMtf )
{
rSubstitute = *mpMtf;
+ if (maPdfData.hasElements())
+ rSubstitute.setPdfData(maPdfData);
}
else
{
@@ -379,6 +386,7 @@ void GraphicCacheEntry::GraphicObjectWasSwappedOut( const GraphicObject& /*rObj*
// #119176# also reset SvgData
maSvgData.reset();
+ maPdfData = uno::Sequence<sal_Int8>();
}
}