diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-06-12 17:21:12 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-09-09 19:15:34 +0200 |
commit | 6167a3ca9c2a88814933b83f6ced75444983ae4a (patch) | |
tree | f0cc39e147788c7ac2591bd13b48b690f43adaaf | |
parent | 6e5b05302081b3cd5d046671ce5b1d340c880b30 (diff) |
tdf#150770: crashtesting: assert seen on loading forum-mso-en-2633.pptx
probably since:
commit 855a56fea4561135a63cb729d7a625a950b210e7
Date: Fri May 13 08:12:17 2022 +0200
tdf#148965 PPTX import: fix internal hyperlinks on shapes
Change-Id: I920cbbb5544cbe9d76f37b3d524c9ccebd426132
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135682
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 48de2ac37366d5671aabc64364660311431d3235)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139570
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
(cherry picked from commit 80551374ae7b5c010dac6bbdf36b3cf1897f952f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139573
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r-- | oox/source/ppt/presentationfragmenthandler.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index b0a7b7ec0fd3..ac1e32e533ec 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -112,15 +112,17 @@ static void lcl_setBookmark(uno::Reference<drawing::XShape>& rShape, std::vector<SlidePersistPtr>& rSlidePersist) { OUString aBookmark; - sal_Int32 nPageNumber; static const OUStringLiteral sSlideName = u"#page"; uno::Reference<beans::XPropertySet> xPropSet(rShape, uno::UNO_QUERY); xPropSet->getPropertyValue("Bookmark") >>= aBookmark; - nPageNumber = o3tl::toInt32(aBookmark.subView(sSlideName.getLength())); - Reference<XDrawPage> xDrawPage(rSlidePersist[nPageNumber - 1]->getPage()); - Reference<container::XNamed> xNamed(xDrawPage, UNO_QUERY_THROW); - aBookmark = xNamed->getName(); - xPropSet->setPropertyValue("Bookmark", Any(aBookmark)); + if (aBookmark.startsWith(sSlideName)) + { + sal_Int32 nPageNumber = o3tl::toInt32(aBookmark.subView(sSlideName.getLength())); + Reference<XDrawPage> xDrawPage(rSlidePersist[nPageNumber - 1]->getPage()); + Reference<container::XNamed> xNamed(xDrawPage, UNO_QUERY_THROW); + aBookmark = xNamed->getName(); + xPropSet->setPropertyValue("Bookmark", Any(aBookmark)); + } } static void ResolveShapeBookmark(std::vector<SlidePersistPtr>& rSlidePersist) |