From 78417f42a4b71729f324ca09e341ee24d9d4baaa Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 9 Apr 2013 10:40:16 +0100 Subject: adapt code for select range .ui conversion Change-Id: Ib53b42a340da04276ce005efb22d19fda617e29a --- sc/source/ui/miscdlgs/lbseldlg.cxx | 44 ++++++++++---------------------------- 1 file changed, 11 insertions(+), 33 deletions(-) (limited to 'sc/source/ui/miscdlgs') diff --git a/sc/source/ui/miscdlgs/lbseldlg.cxx b/sc/source/ui/miscdlgs/lbseldlg.cxx index 5d22ce9c32cf..1708b2d44db4 100644 --- a/sc/source/ui/miscdlgs/lbseldlg.cxx +++ b/sc/source/ui/miscdlgs/lbseldlg.cxx @@ -30,43 +30,29 @@ #include "scresid.hxx" #include "miscdlgs.hrc" - //================================================================== -ScSelEntryDlg::ScSelEntryDlg( Window* pParent, - sal_uInt16 nResId, - const String& aTitle, - const String& aLbTitle, - const std::vector &rEntryList ) : - ModalDialog ( pParent, ScResId( nResId ) ), - // - aFlLbTitle ( this, ScResId( FL_ENTRYLIST ) ), - aLb ( this, ScResId( LB_ENTRYLIST ) ), - aBtnOk ( this, ScResId( BTN_OK ) ), - aBtnCancel ( this, ScResId( BTN_CANCEL ) ), - aBtnHelp ( this, ScResId( BTN_HELP ) ) +ScSelEntryDlg::ScSelEntryDlg(Window* pParent, const std::vector &rEntryList) + : ModalDialog(pParent, "SelectRangeDialog", "modules/scalc/ui/selectrange.ui") { - SetText( aTitle ); - aFlLbTitle.SetText( aLbTitle ); - aLb.Clear(); - aLb.SetDoubleClickHdl( LINK( this, ScSelEntryDlg, DblClkHdl ) ); + get(m_pLb, "treeview"); + m_pLb->SetDropDownLineCount(8); + m_pLb->set_width_request(m_pLb->approximate_char_width() * 32); + m_pLb->SetDoubleClickHdl( LINK( this, ScSelEntryDlg, DblClkHdl ) ); std::vector::const_iterator pIter; for ( pIter = rEntryList.begin(); pIter != rEntryList.end(); ++pIter ) - aLb.InsertEntry(*pIter); - - if ( aLb.GetEntryCount() > 0 ) - aLb.SelectEntryPos( 0 ); + m_pLb->InsertEntry(*pIter); - //------------- - FreeResource(); + if ( m_pLb->GetEntryCount() > 0 ) + m_pLb->SelectEntryPos( 0 ); } //------------------------------------------------------------------------ -String ScSelEntryDlg::GetSelectEntry() const +OUString ScSelEntryDlg::GetSelectEntry() const { - return aLb.GetSelectEntry(); + return m_pLb->GetSelectEntry(); } //------------------------------------------------------------------------ @@ -78,12 +64,4 @@ IMPL_LINK_NOARG_INLINE_START(ScSelEntryDlg, DblClkHdl) } IMPL_LINK_NOARG_INLINE_END(ScSelEntryDlg, DblClkHdl) -//------------------------------------------------------------------------ - -ScSelEntryDlg::~ScSelEntryDlg() -{ -} - - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit