summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorTibor Nagy <nagy.tibor2@nisz.hu>2022-06-01 18:05:03 +0200
committerLászló Németh <nemeth@numbertext.org>2022-06-24 11:18:24 +0200
commita761a51d9db3a2771ca9fd6ab233c513aa5d8ecf (patch)
tree4cc81d13c0f6532c7899f2d0f7cb1cc8065f0b68 /oox
parentad1ffc62e40c2409b610dfff25a8483b1f2556ad (diff)
tdf#149311 PPTX export: fix internal hyperlink on texts
by converting "Slide [digits]" URLs to slide[digits].xml See also commit 4142d728f003166ebe520bfdaf672505e585b807 "tdf#149314 PPTX import: fix internal hyperlink on texts". Change-Id: I39e095c960b04e728b3e28fa0a657d37d9c71ba1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135250 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/export/drawingml.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 8d16911311ec..fe6635dc23f2 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1984,7 +1984,7 @@ void DrawingML::WriteShapeTransformation( const Reference< XShape >& rXShape, sa
bFlipHWrite, bFlipVWrite, ExportRotateClockwisify(nRotation + nCameraRotation), IsGroupShape( rXShape ));
}
-static OUString lcl_GetTarget(const css::uno::Reference<css::frame::XModel>& xModel, std::u16string_view rURL)
+static OUString lcl_GetTarget(const css::uno::Reference<css::frame::XModel>& xModel, OUString& rURL)
{
Reference<drawing::XDrawPagesSupplier> xDPS(xModel, uno::UNO_QUERY_THROW);
Reference<drawing::XDrawPages> xDrawPages(xDPS->getDrawPages(), uno::UNO_SET_THROW);
@@ -2005,6 +2005,12 @@ static OUString lcl_GetTarget(const css::uno::Reference<css::frame::XModel>& xMo
break;
}
}
+ if (sTarget.isEmpty())
+ {
+ sal_Int32 nSplit = rURL.lastIndexOf(' ');
+ if (nSplit > -1)
+ sTarget = OUString::Concat("slide") + rURL.subView(nSplit + 1) + ".xml";
+ }
return sTarget;
}