diff options
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/tbxctrls/fillctrl.cxx | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx index 99cc2401235e..7a6cf136d99d 100644 --- a/svx/source/tbxctrls/fillctrl.cxx +++ b/svx/source/tbxctrls/fillctrl.cxx @@ -686,11 +686,13 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillTypeHdl, weld::ComboBox&, void) mpLbFillAttr->show(); mpToolBoxColor->hide(); mpLbFillAttr->set_sensitive(false); - - // #i122676# need to call a single SID_ATTR_FILL_STYLE change - SfxViewFrame::Current()->GetDispatcher()->ExecuteList( - SID_ATTR_FILL_STYLE, SfxCallMode::RECORD, - { &aXFillStyleItem }); + if (pSh) + { + // #i122676# need to call a single SID_ATTR_FILL_STYLE change + pSh->GetDispatcher()->ExecuteList( + SID_ATTR_FILL_STYLE, SfxCallMode::RECORD, + { &aXFillStyleItem }); + } break; } case drawing::FillStyle_SOLID: @@ -699,11 +701,13 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillTypeHdl, weld::ComboBox&, void) mpToolBoxColor->show(); const ::Color aColor = mpColorItem->GetColorValue(); const XFillColorItem aXFillColorItem( "", aColor ); - - // #i122676# change FillStyle and Color in one call - SfxViewFrame::Current()->GetDispatcher()->ExecuteList( - SID_ATTR_FILL_COLOR, SfxCallMode::RECORD, - { &aXFillColorItem, &aXFillStyleItem }); + if (pSh) + { + // #i122676# change FillStyle and Color in one call + pSh->GetDispatcher()->ExecuteList( + SID_ATTR_FILL_COLOR, SfxCallMode::RECORD, + { &aXFillColorItem, &aXFillStyleItem }); + } break; } case drawing::FillStyle_GRADIENT: @@ -730,7 +734,7 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillTypeHdl, weld::ComboBox&, void) const XFillGradientItem aXFillGradientItem(mpLbFillAttr->get_text(mnLastPosGradient), aGradient); // #i122676# change FillStyle and Gradient in one call - SfxViewFrame::Current()->GetDispatcher()->ExecuteList( + pSh->GetDispatcher()->ExecuteList( SID_ATTR_FILL_GRADIENT, SfxCallMode::RECORD, { &aXFillGradientItem, &aXFillStyleItem }); mpLbFillAttr->set_active(mnLastPosGradient); @@ -767,7 +771,7 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillTypeHdl, weld::ComboBox&, void) const XFillHatchItem aXFillHatchItem(mpLbFillAttr->get_active_text(), aHatch); // #i122676# change FillStyle and Hatch in one call - SfxViewFrame::Current()->GetDispatcher()->ExecuteList( + pSh->GetDispatcher()->ExecuteList( SID_ATTR_FILL_HATCH, SfxCallMode::RECORD, { &aXFillHatchItem, &aXFillStyleItem }); mpLbFillAttr->set_active(mnLastPosHatch); @@ -804,7 +808,7 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillTypeHdl, weld::ComboBox&, void) const XFillBitmapItem aXFillBitmapItem(mpLbFillAttr->get_active_text(), pXBitmapEntry->GetGraphicObject()); // #i122676# change FillStyle and Bitmap in one call - SfxViewFrame::Current()->GetDispatcher()->ExecuteList( + pSh->GetDispatcher()->ExecuteList( SID_ATTR_FILL_BITMAP, SfxCallMode::RECORD, { &aXFillBitmapItem, &aXFillStyleItem }); mpLbFillAttr->set_active(mnLastPosBitmap); @@ -838,10 +842,10 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillAttrHdl, weld::ComboBox&, void) { case drawing::FillStyle_SOLID: { - if(bFillStyleChange) + if (bFillStyleChange && pSh) { // #i122676# Single FillStyle change call needed here - SfxViewFrame::Current()->GetDispatcher()->ExecuteList( + pSh->GetDispatcher()->ExecuteList( SID_ATTR_FILL_STYLE, SfxCallMode::RECORD, { &aXFillStyleItem }); } @@ -866,7 +870,7 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillAttrHdl, weld::ComboBox&, void) const XFillGradientItem aXFillGradientItem(mpLbFillAttr->get_active_text(), aGradient); // #i122676# Change FillStyle and Gradient in one call - SfxViewFrame::Current()->GetDispatcher()->ExecuteList( + pSh->GetDispatcher()->ExecuteList( SID_ATTR_FILL_GRADIENT, SfxCallMode::RECORD, bFillStyleChange ? std::initializer_list<SfxPoolItem const*>{ &aXFillGradientItem, &aXFillStyleItem } @@ -899,7 +903,7 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillAttrHdl, weld::ComboBox&, void) const XFillHatchItem aXFillHatchItem( mpLbFillAttr->get_active_text(), aHatch); // #i122676# Change FillStyle and Hatch in one call - SfxViewFrame::Current()->GetDispatcher()->ExecuteList( + pSh->GetDispatcher()->ExecuteList( SID_ATTR_FILL_HATCH, SfxCallMode::RECORD, bFillStyleChange ? std::initializer_list<SfxPoolItem const*>{ &aXFillHatchItem, &aXFillStyleItem } @@ -932,7 +936,7 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillAttrHdl, weld::ComboBox&, void) const XFillBitmapItem aXFillBitmapItem(mpLbFillAttr->get_active_text(), pXBitmapEntry->GetGraphicObject()); // #i122676# Change FillStyle and Bitmap in one call - SfxViewFrame::Current()->GetDispatcher()->ExecuteList( + pSh->GetDispatcher()->ExecuteList( SID_ATTR_FILL_BITMAP, SfxCallMode::RECORD, bFillStyleChange ? std::initializer_list<SfxPoolItem const*>{ &aXFillBitmapItem, &aXFillStyleItem } |