diff options
author | Jan Holesovsky <kendy@suse.cz> | 2013-01-17 10:40:06 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2013-01-17 17:11:09 +0100 |
commit | 301efb8ec61966c93c4445920c5720c0d8d8cae5 (patch) | |
tree | 751be4fd541918c058d4fb5ef02367e94ecea8c7 /vcl | |
parent | 654e275fc673b28ac264f10282a4cd3a9f61a45d (diff) |
Personas: Fix one more potential crash.
Change-Id: Ib7aca26c34aa8484e8c71873805ca8e8812526a7
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/control/ctrl.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx index debdc4fab382..4da8279add86 100644 --- a/vcl/source/control/ctrl.cxx +++ b/vcl/source/control/ctrl.cxx @@ -429,16 +429,17 @@ void Control::DataChanged( const DataChangedEvent& rDCEvt) (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) { - AllSettings aSettings = GetSettings(); - StyleSettings aStyleSettings = aSettings.GetStyleSettings(); - sal_uLong nOldOptions = rDCEvt.GetOldSettings()->GetStyleSettings().GetOptions(); - sal_uLong nNewOptions = aStyleSettings.GetOptions(); + const AllSettings* pOldSettings = rDCEvt.GetOldSettings(); - if ( !(nNewOptions & STYLE_OPTION_MONO) && ( nOldOptions & STYLE_OPTION_MONO ) ) + AllSettings aSettings = GetSettings(); + StyleSettings aStyleSettings = aSettings.GetStyleSettings(); + sal_uLong nNewOptions = aStyleSettings.GetOptions(); + + if ( pOldSettings && !(nNewOptions & STYLE_OPTION_MONO) && ( pOldSettings->GetStyleSettings().GetOptions() & STYLE_OPTION_MONO ) ) { nNewOptions |= STYLE_OPTION_MONO; aStyleSettings.SetOptions( nNewOptions ); - aStyleSettings.SetMonoColor( rDCEvt.GetOldSettings()->GetStyleSettings().GetMonoColor() ); + aStyleSettings.SetMonoColor( pOldSettings->GetStyleSettings().GetMonoColor() ); aSettings.SetStyleSettings( aStyleSettings ); SetSettings( aSettings ); } |