diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-11-26 16:43:57 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-11-26 20:12:43 +0100 |
commit | 9bef99518e910db078149bef08e300afc8b4aaf2 (patch) | |
tree | 7ed5c2f7d200d5d2d557ffe4304a997eff5c71eb /oox | |
parent | 7d86a6db7a64219e599abfbd28464e3f93022929 (diff) |
crashtesting: failure to export various docs to xlsx/docx
e.g. ooo74880-2.ods since:
commit 3f70375cf160841b6140f5f1b2b79af3652897f8
Date: Fri Nov 18 12:06:59 2022 +0100
tdf#152069 tdf#108356 PPTX export: fix missing tile properties
bodge a workaround to not crash at least
Change-Id: I23e0fc4e0f7a2c6d0b182945e252470f2338da09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143325
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/drawingml.cxx | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index bf9f246ed751..1da6391412fc 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -1928,12 +1928,15 @@ void DrawingML::WriteXGraphicTile(uno::Reference<beans::XPropertySet> const& rXP Reference<drawing::XDrawPages> xDrawPages(xDPS->getDrawPages(), UNO_SET_THROW); // in this case, the size of the first slide is enough, because all slides are the same size Reference<XDrawPage> xDrawPage(xDrawPages->getByIndex(0), UNO_QUERY); - css::uno::Reference<css::beans::XPropertySet> mXPagePropSet(xDrawPage, UNO_QUERY); - double nPageWidth, nPageHeight; - mXPagePropSet->getPropertyValue("Width") >>= nPageWidth; - mXPagePropSet->getPropertyValue("Height") >>= nPageHeight; - nSizeX = nPageWidth / aOriginalSize.Width() * std::abs(nSizeX); - nSizeY = nPageHeight / aOriginalSize.Height() * std::abs(nSizeY); + css::uno::Reference<css::beans::XPropertySet> xPagePropSet(xDrawPage, UNO_QUERY); + if (xPagePropSet) + { + double nPageWidth, nPageHeight; + xPagePropSet->getPropertyValue("Width") >>= nPageWidth; + xPagePropSet->getPropertyValue("Height") >>= nPageHeight; + nSizeX = nPageWidth / aOriginalSize.Width() * std::abs(nSizeX); + nSizeY = nPageHeight / aOriginalSize.Height() * std::abs(nSizeY); + } } OUString sRectanglePoint; |