diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2016-05-05 16:21:36 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2016-05-05 16:23:00 +0300 |
commit | 82350673eae51abe73b8de81af52b736e9ad5b9e (patch) | |
tree | 34a9db01e639e82dac42f703ef7497fa3e9c9682 /sd | |
parent | a8a099a92d51f897ddce7c2ca959a98cd9e7b1b1 (diff) |
Don't crash when switching to slide sorter
... and also check dynamic_cast's. The panel still doesn't
work in slide sorter mode, but at least won't crash.
Change-Id: I878577b282ca5637ffeacdb804ce44c3d57a2a21
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/sidebar/SlideBackground.cxx | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx index 6a5fbfdf69f4..dd8a972faa0c 100644 --- a/sd/source/ui/sidebar/SlideBackground.cxx +++ b/sd/source/ui/sidebar/SlideBackground.cxx @@ -400,20 +400,22 @@ void SlideBackground::NotifyItemUpdate( case SID_DISPLAY_MASTER_BACKGROUND: { - const SfxBoolItem* aBoolItem = dynamic_cast< const SfxBoolItem* >(pState); - if(aBoolItem->GetValue()) - mpDspMasterBackground->SetState(TRISTATE_TRUE); - else - mpDspMasterBackground->SetState(TRISTATE_FALSE); + if(eState >= SfxItemState::DEFAULT) + { + const SfxBoolItem* aBoolItem = dynamic_cast< const SfxBoolItem* >(pState); + if(aBoolItem) + mpDspMasterBackground->Check(aBoolItem->GetValue()); + } } break; case SID_DISPLAY_MASTER_OBJECTS: { - const SfxBoolItem* aBoolItem = dynamic_cast< const SfxBoolItem* >(pState); - if(aBoolItem->GetValue()) - mpDspMasterObjects->SetState(TRISTATE_TRUE); - else - mpDspMasterObjects->SetState(TRISTATE_FALSE); + if(eState >= SfxItemState::DEFAULT) + { + const SfxBoolItem* aBoolItem = dynamic_cast< const SfxBoolItem* >(pState); + if(aBoolItem) + mpDspMasterObjects->Check(aBoolItem->GetValue()); + } } break; |