[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sc/source

Kohei Yoshida kohei.yoshida at gmail.com
Fri Aug 2 01:50:41 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 e0df4fa62162b023b29a323ed4c70594a8ec47c4
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
    (cherry picked from commit b8b807ae589a0b0daa101a0b00bcbe21aa138e2f)
    Reviewed-on: https://gerrit.libreoffice.org/5227
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/ui/inc/namemgrtable.hxx b/sc/source/ui/inc/namemgrtable.hxx
index 3c806cd..08bd36d 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 b7305fc..304f53b 100644
--- a/sc/source/ui/namedlg/namemgrtable.cxx
+++ b/sc/source/ui/namedlg/namemgrtable.cxx
@@ -61,11 +61,6 @@ ScRangeManagerTable::ScRangeManagerTable( SvxSimpleTableContainer& rParent, boos
     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