From 952b3b227e02ae4eedce3138fcb39613bf12486d Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 10 Jan 2022 14:36:02 +0100 Subject: sd theme: fix applying new colors after theme change for group shapes UpdateSdrObject() is called for both group and non-group shapes, so don't assume that they always have text, otherwise we would crash. Change-Id: I3672673176f0cb462a8b8d61a68466f541e9ce06 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128248 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- svx/source/styles/ColorSets.cxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'svx/source/styles') diff --git a/svx/source/styles/ColorSets.cxx b/svx/source/styles/ColorSets.cxx index c77e6ccf2d76..97c79b58bcc6 100644 --- a/svx/source/styles/ColorSets.cxx +++ b/svx/source/styles/ColorSets.cxx @@ -74,6 +74,12 @@ void UpdateSdrObject(svx::Theme* pTheme, SdrObject* pObject) } uno::Reference xShape(pObject->getUnoShape(), uno::UNO_QUERY); + if (!xShape.is()) + { + // E.g. group shapes have no text. + return; + } + uno::Reference xText(xShape->getText(), uno::UNO_QUERY); uno::Reference xParagraphs = xText->createEnumeration(); while (xParagraphs->hasMoreElements()) -- cgit