From 8477bbf8d6867e656b8132f0ddd682d08590a547 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 13 May 2020 16:57:07 +0100 Subject: weld ListBoxControl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I5a8c7d68e4c147eb938b0217dc6368c832e465c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94154 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- dbaccess/source/ui/tabledesign/TEditControl.cxx | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'dbaccess/source/ui/tabledesign') diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index 76300c5d21eb..a17cf27bdf76 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -209,7 +209,6 @@ void OTableEditorCtrl::InitCellController() // Cell type pTypeCell = VclPtr::Create( &GetDataWindow() ); - pTypeCell->SetDropDownLineCount( 15 ); // Cell description pDescrCell = VclPtr::Create( &GetDataWindow(), WB_LEFT ); @@ -241,7 +240,7 @@ void OTableEditorCtrl::ClearModified() pNameCell->ClearModifyFlag(); pDescrCell->ClearModifyFlag(); pHelpTextCell->ClearModifyFlag(); - pTypeCell->SaveValue(); + pTypeCell->get_widget().save_value(); } OTableEditorCtrl::~OTableEditorCtrl() @@ -367,14 +366,15 @@ void OTableEditorCtrl::InitController(CellControllerRef&, long nRow, sal_uInt16 aInitString = pActFieldDescr->getTypeInfo()->aUIName; // Set the ComboBox contents - pTypeCell->Clear(); + weld::ComboBox& rTypeList = pTypeCell->get_widget(); + rTypeList.clear(); if( !pActFieldDescr ) break; const OTypeInfoMap& rTypeInfo = GetView()->getController().getTypeInfo(); for (auto const& elem : rTypeInfo) - pTypeCell->InsertEntry( elem.second->aUIName ); - pTypeCell->SelectEntry( aInitString ); + rTypeList.append_text(elem.second->aUIName); + rTypeList.set_active_text(aInitString); } break; @@ -681,8 +681,8 @@ void OTableEditorCtrl::CellModified( long nRow, sal_uInt16 nColId ) void OTableEditorCtrl::resetType() { - sal_Int32 nPos = pTypeCell->GetSelectedEntryPos(); - if(nPos != LISTBOX_ENTRY_NOTFOUND) + sal_Int32 nPos = pTypeCell->get_widget().get_active(); + if(nPos != -1) SwitchType( GetView()->getController().getTypeInfo(nPos) ); else SwitchType(TOTypeInfoSP()); @@ -1564,9 +1564,10 @@ void OTableEditorCtrl::SwitchType( const TOTypeInfoSP& _pType ) pRow->SetFieldType( _pType, true ); if ( _pType.get() ) { - const sal_Int32 nCurrentlySelected = pTypeCell->GetSelectedEntryPos(); + weld::ComboBox& rTypeList = pTypeCell->get_widget(); + const sal_Int32 nCurrentlySelected = rTypeList.get_active(); - if ( ( LISTBOX_ENTRY_NOTFOUND == nCurrentlySelected ) + if ( ( nCurrentlySelected == -1 ) || ( GetView()->getController().getTypeInfo( nCurrentlySelected ) != _pType ) ) { @@ -1578,8 +1579,8 @@ void OTableEditorCtrl::SwitchType( const TOTypeInfoSP& _pType ) break; ++nEntryPos; } - if (nEntryPos < pTypeCell->GetEntryCount()) - pTypeCell->SelectEntryPos( nEntryPos ); + if (nEntryPos < rTypeList.get_count()) + rTypeList.set_active(nEntryPos); } } -- cgit