summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-06-12 17:21:12 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-06-13 06:54:39 +0200
commit48de2ac37366d5671aabc64364660311431d3235 (patch)
tree5641386dcd71d08bfc9fec851cf6c6e9f24c1c16 /oox
parent67a661800e32bb371a0a23ba498915c4508772bd (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.cxx14
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)