diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-04-08 14:34:13 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-04-08 14:41:01 -0400 |
commit | ffaaf35206b8f049bb9e9ffd7a85c8ebd758a21c (patch) | |
tree | 41a0c1db4bfb0852ef7120e27caefea4ed7a4c43 /sc/source/ui/namedlg | |
parent | 874a9b46cb54e4c05e262e5d7490790a08ea0c55 (diff) |
fdo#71729: Fill the range edit boxes after the table is fully initialized.
Otherwise the range formula expression would not be available yet.
Change-Id: If9c5040366f9038e8094fd5448ca5e4ee2e73edd
Diffstat (limited to 'sc/source/ui/namedlg')
-rw-r--r-- | sc/source/ui/namedlg/namedlg.cxx | 15 | ||||
-rw-r--r-- | sc/source/ui/namedlg/namemgrtable.cxx | 14 |
2 files changed, 19 insertions, 10 deletions
diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx index 89ab3196985e..ebddc78ec6b0 100644 --- a/sc/source/ui/namedlg/namedlg.cxx +++ b/sc/source/ui/namedlg/namedlg.cxx @@ -118,6 +118,7 @@ void ScNameDlg::Init() pCtrl->set_height_request(pCtrl->GetTextHeight()*12); m_pRangeManagerTable = new ScRangeManagerTable(*pCtrl, maRangeMap, maCursorPos); + m_pRangeManagerTable->setInitListener(this); m_pRangeManagerTable->SetSelectHdl( LINK( this, ScNameDlg, SelectionChangedHdl_Impl ) ); m_pRangeManagerTable->SetDeselectHdl( LINK( this, ScNameDlg, SelectionChangedHdl_Impl ) ); @@ -145,13 +146,7 @@ void ScNameDlg::Init() m_pLbScope->InsertEntry(aTabName); } - if (m_pRangeManagerTable->GetSelectionCount()) - { - SelectionChanged(); - } - CheckForEmptyTable(); - } bool ScNameDlg::IsRefInputMode() const @@ -184,6 +179,12 @@ bool ScNameDlg::Close() return DoClose( ScNameDlgWrapper::GetChildWindowId() ); } +void ScNameDlg::tableInitialized() +{ + if (m_pRangeManagerTable->GetSelectionCount()) + SelectionChanged(); +} + void ScNameDlg::CheckForEmptyTable() { if (!m_pRangeManagerTable->GetEntryCount()) @@ -415,8 +416,6 @@ void ScNameDlg::NameModified() void ScNameDlg::SelectionChanged() { - - //don't update if we have just modified due to user input if (!mbNeedUpdate) { diff --git a/sc/source/ui/namedlg/namemgrtable.cxx b/sc/source/ui/namedlg/namemgrtable.cxx index f4a0a7a68edc..89f72e7ad01a 100644 --- a/sc/source/ui/namedlg/namemgrtable.cxx +++ b/sc/source/ui/namedlg/namemgrtable.cxx @@ -33,11 +33,14 @@ static OUString createEntryString(const ScRangeNameLine& rLine) return aRet; } +ScRangeManagerTable::InitListener::~InitListener() {} + ScRangeManagerTable::ScRangeManagerTable( SvSimpleTableContainer& rParent, boost::ptr_map<OUString, ScRangeName>& rRangeMap, const ScAddress& rPos ): SvSimpleTable( rParent, WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP ), maGlobalString( ScGlobal::GetRscString(STR_GLOBAL_SCOPE)), mrRangeMap( rRangeMap ), - maPos( rPos ) + maPos( rPos ), + mpInitListener(NULL) { static long aStaticTabs[] = {3, 0, 0, 0 }; SetTabs( &aStaticTabs[0], MAP_PIXEL ); @@ -80,6 +83,9 @@ void ScRangeManagerTable::StateChanged( StateChangedType nStateChange ) SetCurEntry(GetEntryOnPos(0)); CheckForFormulaString(); } + + if (mpInitListener) + mpInitListener->tableInitialized(); } } @@ -103,6 +109,11 @@ ScRangeManagerTable::~ScRangeManagerTable() Clear(); } +void ScRangeManagerTable::setInitListener( InitListener* pListener ) +{ + mpInitListener = pListener; +} + void ScRangeManagerTable::addEntry(const ScRangeNameLine& rLine, bool bSetCurEntry) { SvTreeListEntry* pEntry = InsertEntryToColumn( createEntryString(rLine), TREELIST_APPEND, 0xffff); @@ -175,7 +186,6 @@ void ScRangeManagerTable::CheckForFormulaString() SetEntryText(aFormulaString, pEntry, 1); maCalculatedFormulaEntries.insert( std::pair<SvTreeListEntry*, bool>(pEntry, true) ); } - } } |