[Libreoffice-commits] .: sc/source

Noel Power noelp at kemper.freedesktop.org
Fri Feb 24 04:34:18 PST 2012


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

New commits:
commit 22871f1af3be444e747f7adaad5221b9c8b0bebf
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

diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx
index b2a7de6..7baccb5 100644
--- a/sc/source/ui/namedlg/namedlg.cxx
+++ b/sc/source/ui/namedlg/namedlg.cxx
@@ -263,10 +263,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