oox/source/export/drawingml.cxx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
New commits: commit 9bef99518e910db078149bef08e300afc8b4aaf2 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sat Nov 26 16:43:57 2022 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sat Nov 26 20:12:43 2022 +0100 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 <caol...@redhat.com> 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;