[Libreoffice-commits] core.git: sc/source
Caolán McNamara
caolanm at redhat.com
Wed Oct 5 14:37:36 UTC 2016
sc/source/ui/inc/navipi.hxx | 21 +++------------------
sc/source/ui/navipi/navipi.cxx | 21 +++++----------------
2 files changed, 8 insertions(+), 34 deletions(-)
New commits:
commit 449dcb850de1ee4fb718d659034fc0c8b0b99583
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Oct 5 15:34:50 2016 +0100
don't need a custom class to respond to a new selected listbox entry
Change-Id: I68de5be394af8e9c9dcfa69a7e45d80a501b8b7e
diff --git a/sc/source/ui/inc/navipi.hxx b/sc/source/ui/inc/navipi.hxx
index 0f276d0..7a7d089 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 ef6e00b..410f30f 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)"
More information about the Libreoffice-commits
mailing list