[Libreoffice-commits] .: Branch 'libreoffice-3-5-1' - sc/source

Eike Rathke erack at kemper.freedesktop.org
Tue Feb 28 02:59:43 PST 2012


 sc/source/ui/namedlg/namedlg.cxx |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

New commits:
commit da7235196c138eed21065c94e2a855d6c3f217e0
Author: Noel Power <noel.power at novell.com>
Date:   Fri Feb 24 12:27:37 2012 +0000

    fix core when clicking on entries in Manage Names dialog in calc fdo#46568
    
    (cherry picked from commit 22871f1af3be444e747f7adaad5221b9c8b0bebf)
    
    Signed-off-by: Eike Rathke <erack at redhat.com>
    Signed-off-by: Kohei Yoshida <kohei.yoshida at suse.com>
    Signed-off-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx
index 56c50e8..06ad128 100644
--- a/sc/source/ui/namedlg/namedlg.cxx
+++ b/sc/source/ui/namedlg/namedlg.cxx
@@ -269,10 +269,28 @@ void ScNameDlg::SetActive()
 
 void ScNameDlg::UpdateChecks(ScRangeData* pData)
 {
+    // remove handlers, we only want the handlers to process
+    // user input and not when we are syncing the controls  with our internal
+    // model ( also UpdateChecks is called already from some other event
+    // handlers, triggering handlers while already processing a handler can
+    // ( and does in this case ) corrupt the internal data
+
+    maBtnCriteria.SetToggleHdl( Link() );
+    maBtnPrintArea.SetToggleHdl( Link() );
+    maBtnColHeader.SetToggleHdl( Link() );
+    maBtnRowHeader.SetToggleHdl( Link() );
+
     maBtnCriteria .Check( pData->HasType( RT_CRITERIA ) );
     maBtnPrintArea.Check( pData->HasType( RT_PRINTAREA ) );
     maBtnColHeader.Check( pData->HasType( RT_COLHEADER ) );
     maBtnRowHeader.Check( pData->HasType( RT_ROWHEADER ) );
+
+    // Restore handlers so user input is processed again
+    Link aToggleHandler = LINK( this, ScNameDlg, EdModifyHdl );
+    maBtnCriteria.SetToggleHdl( aToggleHandler );
+    maBtnPrintArea.SetToggleHdl( aToggleHandler );
+    maBtnColHeader.SetToggleHdl( aToggleHandler );
+    maBtnRowHeader.SetToggleHdl( aToggleHandler );
 }
 
 bool ScNameDlg::IsNameValid()


More information about the Libreoffice-commits mailing list