summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorTibor Nagy <nagy.tibor2@nisz.hu>2021-09-22 13:25:00 +0200
committerLászló Németh <nemeth@numbertext.org>2021-09-27 17:04:13 +0200
commit6e200689eb309cdbe1e4f08311a400835de19bfb (patch)
tree262bfca86312a2ee0c0a0ea064961cd0a9e89b32 /oox
parent82798029b1d89be07fb21eed081906460ba1cd08 (diff)
tdf#141704 PPTX import: fix hyperlinks on images added via placeholder
Note: see "Interaction..." in the local menu of the image of the first slide for manual checking of the fix. See commit 9bb91441b46d677860530d8bf9597c96561a1b0a "tdf#141704 PPTX import: fix hyperlinks on images" Change-Id: Iba372c095f76b263575d261a7a0fc98eda449bce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122429 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/ppt/pptgraphicshapecontext.cxx3
-rw-r--r--oox/source/ppt/pptshape.cxx6
2 files changed, 6 insertions, 3 deletions
diff --git a/oox/source/ppt/pptgraphicshapecontext.cxx b/oox/source/ppt/pptgraphicshapecontext.cxx
index 296263762897..254f44809c85 100644
--- a/oox/source/ppt/pptgraphicshapecontext.cxx
+++ b/oox/source/ppt/pptgraphicshapecontext.cxx
@@ -27,6 +27,7 @@
#include <oox/helper/attributelist.hxx>
#include <oox/token/namespaces.hxx>
#include <oox/token/tokens.hxx>
+#include <oox/token/properties.hxx>
using namespace oox::core;
using namespace ::com::sun::star;
@@ -152,6 +153,8 @@ ContextHandlerRef PPTGraphicShapeContext::onCreateContext( sal_Int32 aElementTok
case XML_pic :
bUseText = false;
}
+ pPlaceholder->getShapeProperties().setAnyProperty(
+ PROP_URL, mpShapePtr->getShapeProperties().getProperty(PROP_URL));
mpShapePtr->applyShapeReference( *pPlaceholder, bUseText );
PPTShape* pPPTShape = dynamic_cast< PPTShape* >( pPlaceholder.get() );
if ( pPPTShape )
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index 757aab1bb3e0..bbc7d2585fd8 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -539,7 +539,9 @@ void PPTShape::addShape(
syncDiagramFontHeights();
}
- if (getShapeProperties().hasProperty(PROP_URL))
+ OUString sURL;
+ getShapeProperties().getProperty(PROP_URL) >>= sURL;
+ if (!sURL.isEmpty())
{
Reference<XEventsSupplier> xEventsSupplier(xShape, UNO_QUERY);
if (!xEventsSupplier.is())
@@ -549,7 +551,6 @@ void PPTShape::addShape(
if (!xEvents.is())
return;
- OUString sURL;
OUString sAPIEventName;
sal_Int32 nPropertyCount = 2;
css::presentation::ClickAction meClickAction;
@@ -563,7 +564,6 @@ void PPTShape::addShape(
{ "#action?jump=endshow", ClickAction_STOPPRESENTATION },
};
- getShapeProperties().getProperty(PROP_URL) >>= sURL;
std::map<OUString, css::presentation::ClickAction>::const_iterator aIt
= ActionMap.find(sURL);
aIt != ActionMap.end() ? meClickAction = aIt->second