diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-08-01 10:27:27 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-08-01 10:31:22 -0400 |
commit | b8b807ae589a0b0daa101a0b00bcbe21aa138e2f (patch) | |
tree | b87e2232d5d78939748bbd5c0da5b464364f481d | |
parent | 1cfa65ccaf73993caa2b6fbae1501232f1d96ae8 (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
-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 6f11ec972dcf..929f6be92c40 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 c7e4040a4621..fd315c0c1de1 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(); |