diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-12-15 21:21:44 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-12-16 08:52:22 +0000 |
commit | f9d106a8ecd58f94e48140f8516bc250c1b5e248 (patch) | |
tree | a1a5d8df3ddea8087dee1043755798c82d74307d /sd | |
parent | b1e38819eaeeb259ede09f8d886d037ae7675f04 (diff) |
likely fix for frequent mpGradientItem->GetName() crash
crash report id: ec5a64d7-b354-457e-92a3-1bd51208e7c7
Change-Id: Ie64993190baa5e3ea9228214bea1ee4d82044c51
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144282
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/sidebar/SlideBackground.cxx | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx index bcd564e7bbc1..11f49dff67eb 100644 --- a/sd/source/ui/sidebar/SlideBackground.cxx +++ b/sd/source/ui/sidebar/SlideBackground.cxx @@ -1023,30 +1023,42 @@ IMPL_LINK_NOARG(SlideBackground, FillStyleModifyHdl, weld::ComboBox&, void) case SOLID: { - const XFillColorItem aItem( OUString(), mpColorItem->GetColorValue() ); - GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_COLOR, SfxCallMode::RECORD, { &aItem }); + if (mpColorItem) + { + const XFillColorItem aItem( OUString(), mpColorItem->GetColorValue() ); + GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_COLOR, SfxCallMode::RECORD, { &aItem }); + } } break; case GRADIENT: { - const XFillGradientItem aItem( mpGradientItem->GetName(), mpGradientItem->GetGradientValue() ); - GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_GRADIENT, SfxCallMode::RECORD, { &aItem }); + if (mpGradientItem) + { + const XFillGradientItem aItem( mpGradientItem->GetName(), mpGradientItem->GetGradientValue() ); + GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_GRADIENT, SfxCallMode::RECORD, { &aItem }); + } } break; case HATCH: { - const XFillHatchItem aItem( mpHatchItem->GetName(), mpHatchItem->GetHatchValue() ); - GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_HATCH, SfxCallMode::RECORD, { &aItem }); + if (mpHatchItem) + { + const XFillHatchItem aItem( mpHatchItem->GetName(), mpHatchItem->GetHatchValue() ); + GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_HATCH, SfxCallMode::RECORD, { &aItem }); + } } break; case BITMAP: case PATTERN: { - const XFillBitmapItem aItem( mpBitmapItem->GetName(), mpBitmapItem->GetGraphicObject() ); - GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_BITMAP, SfxCallMode::RECORD, { &aItem }); + if (mpBitmapItem) + { + const XFillBitmapItem aItem( mpBitmapItem->GetName(), mpBitmapItem->GetGraphicObject() ); + GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_BITMAP, SfxCallMode::RECORD, { &aItem }); + } } break; |