From f285682b5fd818e0b12649c39f600e6423401751 Mon Sep 17 00:00:00 2001 From: Tünde Tóth Date: Thu, 9 Mar 2023 16:01:03 +0100 Subject: tdf#145147 DOCX import: fix hyperlink in group shape MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hyperlink inserted to shape lost, if the shape was inside a group shape. Test: ungroup the grouped shape and move the mouse over the shapes, or use Edit Hyperlink... in their context menu. Change-Id: I45d816f18a1e1bc1c442943b31c9e0ae7de199e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148552 Reviewed-by: László Németh Tested-by: László Németh (cherry picked from commit b5a0fa42adf68b33970da93c2b04f935f72cffde) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149608 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- oox/source/drawingml/shape.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'oox') diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 113c55a1770a..48acc4efa945 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -406,6 +406,18 @@ void Shape::addShape( ? *getTextBody()->getTextProperties().moInsets[3] : 0)); } + + // tdf#145147 Set the Hyperlink property to the child wps shape. + if (getShapeProperties().hasProperty(PROP_URL)) try + { + uno::Any aAny = getShapeProperties().getProperty(PROP_URL); + OUString sUrl = aAny.get(); + if (!sUrl.isEmpty()) + xChildWPSProperties->setPropertyValue(UNO_NAME_HYPERLINK, aAny); + } + catch (const Exception&) + { + } } if( meFrameType == FRAMETYPE_DIAGRAM ) -- cgit