vcl/source/control/ctrl.cxx |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

New commits:
commit 718802ca9c5fc01c34e1e4f4ee57ffae0ea30b7b
Author: Jan Holesovsky <[email protected]>
Date:   Thu Jan 17 10:40:06 2013 +0100

    Personas: Fix one more potential crash.
    
    Change-Id: Ib7aca26c34aa8484e8c71873805ca8e8812526a7
    Reviewed-on: https://gerrit.libreoffice.org/1739
    Reviewed-by: Noel Power <[email protected]>
    Tested-by: Noel Power <[email protected]>

diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx
index e89e5c9..bfa45d4 100644
--- a/vcl/source/control/ctrl.cxx
+++ b/vcl/source/control/ctrl.cxx
@@ -444,16 +444,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 );
         }
_______________________________________________
Libreoffice-commits mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to