[Libreoffice-commits] core.git: sc/source

Kohei Yoshida kohei.yoshida at gmail.com
Thu Aug 1 07:30:32 PDT 2013


 sc/source/ui/inc/namemgrtable.hxx     |    1 +
 sc/source/ui/namedlg/namemgrtable.cxx |   19 ++++++++++++++-----
 2 files changed, 15 insertions(+), 5 deletions(-)

New commits:
commit b8b807ae589a0b0daa101a0b00bcbe21aa138e2f
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Thu Aug 1 10:27:27 2013 -0400

    fdo#67621: Delay populating the ranges until the dialog is shown.
    
    Otherwise the table widget won't have any idea which rows are displayed,
    and end up not populating the ranges.
    
    This is caused by the switch to the .ui dialog, which delays calculation
    of the dialog size until late. But the code that populates the ranges was
    execuated when the widget was instantiated, at which time the widget didn't
    have its size assigned.
    
    Change-Id: I22943b41b21b58cc67e872dff13ad3c25eee8438

diff --git a/sc/source/ui/inc/namemgrtable.hxx b/sc/source/ui/inc/namemgrtable.hxx
index 6f11ec9..929f6be 100644
--- a/sc/source/ui/inc/namemgrtable.hxx
+++ b/sc/source/ui/inc/namemgrtable.hxx
@@ -55,6 +55,7 @@ public:
     virtual ~ScRangeManagerTable();
 
     virtual void Resize();
+    virtual void StateChanged( StateChangedType nStateChange );
 
     void addEntry( const ScRangeNameLine& rLine, bool bSetCurEntry = true );
     void DeleteSelectedEntries();
diff --git a/sc/source/ui/namedlg/namemgrtable.cxx b/sc/source/ui/namedlg/namemgrtable.cxx
index c7e4040..fd315c0 100644
--- a/sc/source/ui/namedlg/namemgrtable.cxx
+++ b/sc/source/ui/namedlg/namemgrtable.cxx
@@ -61,11 +61,6 @@ ScRangeManagerTable::ScRangeManagerTable( SvSimpleTableContainer& rParent, boost
     Init();
     ShowTable();
     SetSelectionMode(MULTIPLE_SELECTION);
-    if (GetEntryCount())
-    {
-        SetCurEntry(GetEntryOnPos(0));
-        CheckForFormulaString();
-    }
     SetScrolledHdl( LINK( this, ScRangeManagerTable, ScrollHdl ) );
     void* pNull = NULL;
     HeaderEndDragHdl(pNull);
@@ -78,6 +73,20 @@ void ScRangeManagerTable::Resize()
         setColWidths();
 }
 
+void ScRangeManagerTable::StateChanged( StateChangedType nStateChange )
+{
+    SvSimpleTable::StateChanged(nStateChange);
+
+    if (nStateChange == STATE_CHANGE_INITSHOW)
+    {
+        if (GetEntryCount())
+        {
+            SetCurEntry(GetEntryOnPos(0));
+            CheckForFormulaString();
+        }
+    }
+}
+
 void ScRangeManagerTable::setColWidths()
 {
     HeaderBar &rHeaderBar = GetTheHeaderBar();


More information about the Libreoffice-commits mailing list