From 91fe6b97952aa6f7cef58327fd085a17db38ad95 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 11:44:47 +0200 Subject: Merging upstream version 4:24.2.2. Signed-off-by: Daniel Baumann --- svx/source/svdraw/svdxcgv.cxx | 63 ++++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 30 deletions(-) (limited to 'svx/source/svdraw/svdxcgv.cxx') diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx index 050a997077..5d16cbae25 100644 --- a/svx/source/svdraw/svdxcgv.cxx +++ b/svx/source/svdraw/svdxcgv.cxx @@ -599,42 +599,45 @@ Graphic SdrExchangeView::GetObjGraphic(const SdrObject& rSdrObject, bool bSVG) { Graphic aRet; - // try to get a graphic from the object first - const SdrGrafObj* pSdrGrafObj(dynamic_cast< const SdrGrafObj* >(&rSdrObject)); - const SdrOle2Obj* pSdrOle2Obj(dynamic_cast< const SdrOle2Obj* >(&rSdrObject)); - - if(pSdrGrafObj) + if (!rSdrObject.HasText()) { - if(pSdrGrafObj->isEmbeddedVectorGraphicData()) + // try to get a graphic from the object first + const SdrGrafObj* pSdrGrafObj(dynamic_cast(&rSdrObject)); + const SdrOle2Obj* pSdrOle2Obj(dynamic_cast(&rSdrObject)); + + if (pSdrGrafObj) { - // get Metafile for Svg content - aRet = pSdrGrafObj->getMetafileFromEmbeddedVectorGraphicData(); + if (pSdrGrafObj->isEmbeddedVectorGraphicData()) + { + // get Metafile for Svg content + aRet = pSdrGrafObj->getMetafileFromEmbeddedVectorGraphicData(); + } + else + { + // Make behaviour coherent with metafile + // recording below (which of course also takes + // view-transformed objects) + aRet = pSdrGrafObj->GetTransformedGraphic(); + } } - else + else if (pSdrOle2Obj) { - // Make behaviour coherent with metafile - // recording below (which of course also takes - // view-transformed objects) - aRet = pSdrGrafObj->GetTransformedGraphic(); - } - } - else if(pSdrOle2Obj) - { - if(pSdrOle2Obj->GetGraphic()) - { - aRet = *pSdrOle2Obj->GetGraphic(); + if (pSdrOle2Obj->GetGraphic()) + { + aRet = *pSdrOle2Obj->GetGraphic(); + } } - } - else - { - // Support extracting a snapshot from video media, if possible. - const SdrMediaObj* pSdrMediaObj = dynamic_cast(&rSdrObject); - if (pSdrMediaObj) + else { - const css::uno::Reference& xGraphic - = pSdrMediaObj->getSnapshot(); - if (xGraphic.is()) - aRet = Graphic(xGraphic); + // Support extracting a snapshot from video media, if possible. + const SdrMediaObj* pSdrMediaObj = dynamic_cast(&rSdrObject); + if (pSdrMediaObj) + { + const css::uno::Reference& xGraphic + = pSdrMediaObj->getSnapshot(); + if (xGraphic.is()) + aRet = Graphic(xGraphic); + } } } -- cgit v1.2.3