diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-08-01 10:27:27 -0400 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-08-02 08:50:21 +0000 |
commit | e0df4fa62162b023b29a323ed4c70594a8ec47c4 (patch) | |
tree | 464e00802c7ccd02d110ff338af505a92dd8e496 | |
parent | a444c621b8eea094c37018880ca847bcd28fd703 (diff) |
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@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sc/source/ui/inc/namemgrtable.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/namedlg/namemgrtable.cxx | 19 |
2 files changed, 15 insertions, 5 deletions
diff --git a/sc/source/ui/inc/namemgrtable.hxx b/sc/source/ui/inc/namemgrtable.hxx index 3c806cd960fb..08bd36d26399 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 b7305fc16b08..304f53bd7f63 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(); |