summaryrefslogtreecommitdiff
path: root/svx/source/styles
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2022-01-10 14:36:02 +0100
committerMiklos Vajna <vmiklos@collabora.com>2022-01-10 17:38:56 +0100
commit952b3b227e02ae4eedce3138fcb39613bf12486d (patch)
tree9c02c068a0007b77821ed8f9cb6d7eb2d2d65153 /svx/source/styles
parent56ded398c9c72810f20b9da0aa98097739423180 (diff)
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 <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'svx/source/styles')
-rw-r--r--svx/source/styles/ColorSets.cxx6
1 files changed, 6 insertions, 0 deletions
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<text::XTextRange> xShape(pObject->getUnoShape(), uno::UNO_QUERY);
+ if (!xShape.is())
+ {
+ // E.g. group shapes have no text.
+ return;
+ }
+
uno::Reference<container::XEnumerationAccess> xText(xShape->getText(), uno::UNO_QUERY);
uno::Reference<container::XEnumeration> xParagraphs = xText->createEnumeration();
while (xParagraphs->hasMoreElements())