summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorTibor Nagy <nagy.tibor2@nisz.hu>2021-07-07 10:10:21 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-08-20 09:44:37 +0200
commit0b327b69ef78a7565625dabbe8dcf0140884fe26 (patch)
treee54e9e6102eee45a19a8ebc34983be7ef547c257 /oox
parent852454a487aefc17523804dc93892f34047365a0 (diff)
tdf#142648 PPTX: import long slide names to avoid broken link export
PPTX import renames the slides using their short title text. Apply this for the titles with 64 or more characters, too, abbreviating the title text instead of using the default slide name "page1", "page2" etc., because the default slide names result broken hyperlinks during the PPTX export. To test the fix manually, create a new hyperlink using text selection and Insert Hyperlink (Ctrl-K), clicking on Target in Document button on the Document pane, and selecting a slide name. Note: the problem still exists for the duplicated or newly inserted slides, which get default slide names. Change-Id: Iec1fab5a2ee862353766ed7e13b1501b3a325d0e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118548 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120750 Tested-by: Jenkins
Diffstat (limited to 'oox')
-rw-r--r--oox/source/ppt/pptshape.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index 563454aaaf66..b72e6d854fc6 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -346,9 +346,10 @@ void PPTShape::addShape(
Reference<drawing::XDrawPagesSupplier> xDPS(rFilterBase.getModel(), uno::UNO_QUERY_THROW);
Reference<drawing::XDrawPages> xDrawPages(xDPS->getDrawPages(), uno::UNO_SET_THROW);
sal_uInt32 nMaxPages = xDrawPages->getCount();
- bool bUseTitleAsSlideName = !aTitleText.isEmpty() &&
- // just a magic value, but we don't want to set slide names which are too long
- aTitleText.getLength() < 64;
+ // just a magic value but we don't want to drop out slide names which are too long
+ if (aTitleText.getLength() > 63)
+ aTitleText = aTitleText.copy(0, 63);
+ bool bUseTitleAsSlideName = !aTitleText.isEmpty();
// check duplicated title name
if (bUseTitleAsSlideName)
{