From 9bef99518e910db078149bef08e300afc8b4aaf2 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 26 Nov 2022 16:43:57 +0000 Subject: crashtesting: failure to export various docs to xlsx/docx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- oox/source/export/drawingml.cxx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'oox') 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 const& rXP Reference 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(xDrawPages->getByIndex(0), UNO_QUERY); - css::uno::Reference 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 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; -- cgit