diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-06-12 17:21:12 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-06-13 06:54:39 +0200 |
commit | 48de2ac37366d5671aabc64364660311431d3235 (patch) | |
tree | 5641386dcd71d08bfc9fec851cf6c6e9f24c1c16 /oox | |
parent | 67a661800e32bb371a0a23ba498915c4508772bd (diff) |
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>
Diffstat (limited to 'oox')
-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 c9deec076edc..43b7f105a1c4 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -110,15 +110,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) |