diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-10-05 15:34:50 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-10-05 15:34:50 +0100 |
commit | 449dcb850de1ee4fb718d659034fc0c8b0b99583 (patch) | |
tree | c736ba05701266b203564ed3f7e11024b611283a /sc | |
parent | 43b13e9b73e425683977473ab171e1e140dba6cc (diff) |
don't need a custom class to respond to a new selected listbox entry
Change-Id: I68de5be394af8e9c9dcfa69a7e45d80a501b8b7e
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/inc/navipi.hxx | 21 | ||||
-rw-r--r-- | sc/source/ui/navipi/navipi.cxx | 21 |
2 files changed, 8 insertions, 34 deletions
diff --git a/sc/source/ui/inc/navipi.hxx b/sc/source/ui/inc/navipi.hxx index 0f276d089274..7a7d08957239 100644 --- a/sc/source/ui/inc/navipi.hxx +++ b/sc/source/ui/inc/navipi.hxx @@ -165,21 +165,6 @@ private: void ExecuteRow(); }; -// class ScDocListBox - -class ScDocListBox : public ListBox -{ -public: - ScDocListBox( ScNavigatorDlg* pParent, const ResId& rResId ); - virtual ~ScDocListBox() override; - -protected: - virtual void Select() override; - -private: - ScNavigatorDlg& rDlg; -}; - // class CommandToolBox class CommandToolBox : public ToolBox @@ -212,7 +197,6 @@ friend class ScNavigatorControllerItem; friend class ScNavigatorDialogWrapper; friend class ColumnEdit; friend class RowEdit; -friend class ScDocListBox; friend class CommandToolBox; friend class ScContentTree; @@ -227,7 +211,7 @@ private: VclPtr<CommandToolBox> aTbxCmd; VclPtr<ScContentTree> aLbEntries; VclPtr<ScScenarioWindow> aWndScenarios; - VclPtr<ScDocListBox> aLbDocuments; + VclPtr<ListBox> aLbDocuments; Idle aContentIdle; @@ -257,7 +241,8 @@ private: ScNavigatorControllerItem** ppBoundItems; - DECL_LINK( TimeHdl, Idle*, void ); + DECL_LINK(TimeHdl, Idle*, void); + DECL_LINK(DocumentSelectHdl, ListBox&, void); void DoResize(); diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx index ef6e00bd46c2..410f30fd9811 100644 --- a/sc/source/ui/navipi/navipi.cxx +++ b/sc/source/ui/navipi/navipi.cxx @@ -290,24 +290,12 @@ void RowEdit::ExecuteRow() rDlg.SetCurrentCell( nCol-1, nRow-1 ); } -// class ScDocListBox - -ScDocListBox::ScDocListBox( ScNavigatorDlg* pParent, const ResId& rResId ) - : ListBox ( pParent, rResId ), - rDlg ( *pParent ) -{ -} - -ScDocListBox::~ScDocListBox() -{ -} - -void ScDocListBox::Select() +IMPL_LINK(ScNavigatorDlg, DocumentSelectHdl, ListBox&, rListBox, void) { ScNavigatorDlg::ReleaseFocus(); - OUString aDocName = GetSelectEntry(); - rDlg.aLbEntries->SelectDoc( aDocName ); + OUString aDocName = rListBox.GetSelectEntry(); + aLbEntries->SelectDoc(aDocName); } // class CommandToolBox @@ -557,7 +545,7 @@ ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, vcl aTbxCmd ( VclPtr<CommandToolBox>::Create( this, ScResId( TBX_CMD ) ) ), aLbEntries ( VclPtr<ScContentTree>::Create( this, ScResId( LB_ENTRIES ) ) ), aWndScenarios( VclPtr<ScScenarioWindow>::Create( this,ScResId( STR_QHLP_SCEN_LISTBOX), ScResId(STR_QHLP_SCEN_COMMENT)) ), - aLbDocuments( VclPtr<ScDocListBox>::Create( this, ScResId( LB_DOCUMENTS ) ) ), + aLbDocuments( VclPtr<ListBox>::Create( this, ScResId( LB_DOCUMENTS ) ) ), aStrDragMode ( ScResId( STR_DRAGMODE ) ), aStrDisplay ( ScResId( STR_DISPLAY ) ), aStrActiveWin( ScResId( STR_ACTIVEWIN ) ), @@ -579,6 +567,7 @@ ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, vcl // eListMode is set from outside, Root further below aLbDocuments->SetDropDownLineCount(9); + aLbDocuments->SetSelectHdl(LINK(this, ScNavigatorDlg, DocumentSelectHdl)); aStrActive = " (" + OUString( ScResId( STR_ACTIVE ) ) + ")"; // " (active)" |