[Libreoffice-commits] core.git: sd/source
Maxim Monastirsky
momonasmon at gmail.com
Thu May 5 13:23:54 UTC 2016
sd/source/ui/sidebar/SlideBackground.cxx | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
New commits:
commit 82350673eae51abe73b8de81af52b736e9ad5b9e
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date: Thu May 5 16:21:36 2016 +0300
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
diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx
index 6a5fbfd..dd8a972 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;
More information about the Libreoffice-commits
mailing list