dbaccess/source/ui/app/AppDetailView.cxx | 22 ------------ dbaccess/source/ui/app/AppDetailView.hxx | 4 -- include/vcl/treelistbox.hxx | 8 ---- vcl/source/treelist/treelistbox.cxx | 54 ++++++++----------------------- 4 files changed, 14 insertions(+), 74 deletions(-)
New commits: commit 4e5c785b1564f7e4444a426a1523ff7fc88f93d6 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Aug 6 17:03:08 2020 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Aug 7 10:05:53 2020 +0200 IMnemonicEntryList interface of SvTreeListBox is unused Change-Id: I56a97d0ef82353aaf3c2ab482c1d782b5dfc8000 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100263 Tested-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx index e1abcff56746..59658012ca3a 100644 --- a/dbaccess/source/ui/app/AppDetailView.cxx +++ b/dbaccess/source/ui/app/AppDetailView.cxx @@ -120,28 +120,6 @@ void OCreationList::PreparePaint(vcl::RenderContext& rRenderContext, SvTreeListE rEntry.SetBackColor(aEntryBackground.GetColor()); } -void OCreationList::SelectSearchEntry( const void* _pEntry ) -{ - SvTreeListEntry* pEntry = const_cast< SvTreeListEntry* >( static_cast< const SvTreeListEntry* >( _pEntry ) ); - OSL_ENSURE( pEntry, "OCreationList::SelectSearchEntry: invalid entry!" ); - - if ( pEntry ) - setCurrentEntryInvalidate( pEntry ); - - if ( !HasChildPathFocus() ) - GrabFocus(); -} - -void OCreationList::ExecuteSearchEntry( const void* _pEntry ) const -{ - SvTreeListEntry* pEntry = const_cast< SvTreeListEntry* >( static_cast< const SvTreeListEntry* >( _pEntry ) ); - OSL_ENSURE( pEntry, "OCreationList::ExecuteSearchEntry: invalid entry!" ); - OSL_ENSURE( pEntry == GetCurEntry(), "OCreationList::ExecuteSearchEntry: SelectSearchEntry should have been called before!" ); - - if ( pEntry ) - onSelected( pEntry ); -} - tools::Rectangle OCreationList::GetFocusRect(const SvTreeListEntry* _pEntry, long _nLine) { tools::Rectangle aRect = SvTreeListBox::GetFocusRect( _pEntry, _nLine ); diff --git a/dbaccess/source/ui/app/AppDetailView.hxx b/dbaccess/source/ui/app/AppDetailView.hxx index 97ad813142f8..942b5ad75616 100644 --- a/dbaccess/source/ui/app/AppDetailView.hxx +++ b/dbaccess/source/ui/app/AppDetailView.hxx @@ -74,10 +74,6 @@ namespace dbaui virtual tools::Rectangle GetFocusRect(const SvTreeListEntry* _pEntry, long _nLine) override; virtual void ModelHasCleared() override; - // IMnemonicEntryList - virtual void SelectSearchEntry( const void* _pEntry ) override; - virtual void ExecuteSearchEntry( const void* _pEntry ) const override; - private: void onSelected( SvTreeListEntry const * _pEntry ) const; /** sets a new current entry, and invalidates the old and the new one, if necessary diff --git a/include/vcl/treelistbox.hxx b/include/vcl/treelistbox.hxx index b3d4ffb05dac..6e6ba94ccf0e 100644 --- a/include/vcl/treelistbox.hxx +++ b/include/vcl/treelistbox.hxx @@ -27,7 +27,6 @@ #include <vector> #include <vcl/ctrl.hxx> -#include <vcl/mnemonicengine.hxx> #include <vcl/quickselectionengine.hxx> #include <vcl/image.hxx> #include <tools/gen.hxx> @@ -180,7 +179,6 @@ class VCL_DLLPUBLIC SvTreeListBox ,public SvListView ,public DropTargetHelper ,public DragSourceHelper - ,public vcl::IMnemonicEntryList ,public vcl::ISearchableStringList { friend class SvImpLBox; @@ -315,12 +313,6 @@ protected: void OnCurrentEntryChanged(); - // IMnemonicEntryList - virtual const void* FirstSearchEntry( OUString& _rEntryText ) const override; - virtual const void* NextSearchEntry( const void* _pCurrentSearchEntry, OUString& _rEntryText ) const override; - virtual void SelectSearchEntry( const void* _pEntry ) override; - virtual void ExecuteSearchEntry( const void* _pEntry ) const override; - // ISearchableStringList virtual vcl::StringEntryIdentifier CurrentEntry( OUString& _out_entryText ) const override; virtual vcl::StringEntryIdentifier NextEntry( vcl::StringEntryIdentifier _currentEntry, OUString& _out_entryText ) const override; diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx index af55a6ff1133..cd0729c23350 100644 --- a/vcl/source/treelist/treelistbox.cxx +++ b/vcl/source/treelist/treelistbox.cxx @@ -930,26 +930,27 @@ void SvTreeListBox::EndEditing( bool bCancel ) nImpFlags &= ~SvTreeListBoxFlags::IN_EDT; } - -const void* SvTreeListBox::FirstSearchEntry( OUString& _rEntryText ) const +vcl::StringEntryIdentifier SvTreeListBox::CurrentEntry( OUString& _out_entryText ) const { - SvTreeListEntry* pEntry = GetCurEntry(); - if ( pEntry ) - pEntry = const_cast< SvTreeListEntry* >( static_cast< const SvTreeListEntry* >( NextSearchEntry( pEntry, _rEntryText ) ) ); - else + // always accept the current entry if there is one + SvTreeListEntry* pEntry( GetCurEntry() ); + if (pEntry) { - pEntry = FirstSelected(); - if ( !pEntry ) - pEntry = First(); + _out_entryText = GetEntryText(pEntry); + return pEntry; } + pEntry = FirstSelected(); + if ( !pEntry ) + pEntry = First(); + if ( pEntry ) - _rEntryText = GetEntryText( pEntry ); + _out_entryText = GetEntryText( pEntry ); return pEntry; } -const void* SvTreeListBox::NextSearchEntry( const void* _pCurrentSearchEntry, OUString& _rEntryText ) const +vcl::StringEntryIdentifier SvTreeListBox::NextEntry(vcl::StringEntryIdentifier _pCurrentSearchEntry, OUString& _out_entryText) const { SvTreeListEntry* pEntry = const_cast< SvTreeListEntry* >( static_cast< const SvTreeListEntry* >( _pCurrentSearchEntry ) ); @@ -974,12 +975,12 @@ const void* SvTreeListBox::NextSearchEntry( const void* _pCurrentSearchEntry, OU pEntry = First(); if ( pEntry ) - _rEntryText = GetEntryText( pEntry ); + _out_entryText = GetEntryText( pEntry ); return pEntry; } -void SvTreeListBox::SelectSearchEntry( const void* _pEntry ) +void SvTreeListBox::SelectEntry(vcl::StringEntryIdentifier _pEntry) { SvTreeListEntry* pEntry = const_cast< SvTreeListEntry* >( static_cast< const SvTreeListEntry* >( _pEntry ) ); DBG_ASSERT( pEntry, "SvTreeListBox::SelectSearchEntry: invalid entry!" ); @@ -991,33 +992,6 @@ void SvTreeListBox::SelectSearchEntry( const void* _pEntry ) Select( pEntry ); } -void SvTreeListBox::ExecuteSearchEntry( const void* /*_pEntry*/ ) const -{ - // nothing to do here, we have no "execution" -} - -vcl::StringEntryIdentifier SvTreeListBox::CurrentEntry( OUString& _out_entryText ) const -{ - // always accept the current entry if there is one - SvTreeListEntry* pCurrentEntry( GetCurEntry() ); - if ( pCurrentEntry ) - { - _out_entryText = GetEntryText( pCurrentEntry ); - return pCurrentEntry; - } - return FirstSearchEntry( _out_entryText ); -} - -vcl::StringEntryIdentifier SvTreeListBox::NextEntry( vcl::StringEntryIdentifier _currentEntry, OUString& _out_entryText ) const -{ - return NextSearchEntry( _currentEntry, _out_entryText ); -} - -void SvTreeListBox::SelectEntry( vcl::StringEntryIdentifier _entry ) -{ - SelectSearchEntry( _entry ); -} - bool SvTreeListBox::HandleKeyInput( const KeyEvent& _rKEvt ) { if ( _rKEvt.GetKeyCode().IsMod1() ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits