From d5aa9c3b23f6c9b5ff0b6af11ff6d6827c5f24bd Mon Sep 17 00:00:00 2001 From: Gergo Mocsi Date: Thu, 25 Jul 2013 16:15:27 +0200 Subject: GSOC work, disable QuickSelectionEngine+ListBox navigation modification Added a function to disable QuickSelectionEngine in ListBox, beacuse it's not needed. ListBox navigation changed: it is not hiding/showing entries, instead of it, jumps to the longest match without filtering. Arrow behavior remains the same. Change-Id: I8982c280f20929c74f9630cbaa95010820d2e234 --- basctl/source/basicide/baside2.hxx | 4 ---- basctl/source/basicide/baside2b.cxx | 16 ++++++++++------ basctl/source/basicide/codecompleteoptionsdlg.cxx | 5 +++-- 3 files changed, 13 insertions(+), 12 deletions(-) (limited to 'basctl') diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx index 8737091ce614..42904b2478a9 100644 --- a/basctl/source/basicide/baside2.hxx +++ b/basctl/source/basicide/baside2.hxx @@ -476,10 +476,6 @@ class CodeCompleteListBox: public ListBox { friend class CodeCompleteWindow; private: - std::vector< OUString > aEntryVect; - /* vector to hold all entries for showing/hiding - * when typing a letter/word - * */ OUStringBuffer aFuncBuffer; /* a buffer to build up function name when typing * a function name, used for showing/hiding listbox values diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index 28ed40d957ed..8ae1d5ba7d97 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -2431,6 +2431,10 @@ long CodeCompleteListBox::PreNotify( NotifyEvent& rNEvt ) pCodeCompleteWindow->pParent->GetEditView()->DeleteSelected(); SetVisibleEntries(); } + else + { + pCodeCompleteWindow->ClearAndHide(); + } return 0; case KEY_RETURN: InsertSelectedEntry(); @@ -2443,12 +2447,13 @@ long CodeCompleteListBox::PreNotify( NotifyEvent& rNEvt ) void CodeCompleteListBox::SetVisibleEntries() { - Clear(); - for( unsigned int j=0; j < aEntryVect.size(); ++j ) + for(sal_uInt16 i=0; i< GetEntryCount(); ++i) { - if( aEntryVect[j].startsWithIgnoreAsciiCase(aFuncBuffer.toString()) ) + OUString sEntry = (OUString) GetEntry(i); + if( sEntry.startsWithIgnoreAsciiCase( aFuncBuffer.toString() ) ) { - InsertEntry(aEntryVect[j]); + SelectEntry(sEntry); + break; } } } @@ -2467,18 +2472,17 @@ void CodeCompleteWindow::InitListBox() pListBox->SetSizePixel( Size(150,150) ); //default, this will adopt the line length pListBox->Show(); pListBox->GrabFocus(); + pListBox->EnableQuickSelection( false ); } void CodeCompleteWindow::InsertEntry( const OUString& aStr ) { pListBox->InsertEntry( aStr ); - pListBox->aEntryVect.push_back( aStr ); } void CodeCompleteWindow::ClearListBox() { pListBox->Clear(); - pListBox->aEntryVect.clear(); pListBox->aFuncBuffer.makeStringAndClear(); } diff --git a/basctl/source/basicide/codecompleteoptionsdlg.cxx b/basctl/source/basicide/codecompleteoptionsdlg.cxx index 96d1ca732f73..6dcde740f214 100644 --- a/basctl/source/basicide/codecompleteoptionsdlg.cxx +++ b/basctl/source/basicide/codecompleteoptionsdlg.cxx @@ -41,8 +41,9 @@ CodeCompleteOptionsDlg::CodeCompleteOptionsDlg( Window* pWindow ) pCancelBtn->SetClickHdl( LINK( this, CodeCompleteOptionsDlg, CancelHdl ) ); pCodeCompleteChk->Check( CodeCompleteOptions::IsCodeCompleteOn() ); - pAutocloseProcChk->Check( CodeCompleteOptions::IsProcedureAutoCompleteOn() ); + //pAutocloseProcChk->Check( CodeCompleteOptions::IsProcedureAutoCompleteOn() ); + pAutocloseProcChk->Enable( false ); pAutocloseBracesChk->Enable( false ); pAutocloseQuotesChk->Enable( false ); } @@ -54,7 +55,7 @@ CodeCompleteOptionsDlg::~CodeCompleteOptionsDlg() IMPL_LINK_NOARG(CodeCompleteOptionsDlg, OkHdl) { CodeCompleteOptions::SetCodeCompleteOn( pCodeCompleteChk->IsChecked() ); - CodeCompleteOptions::SetProcedureAutoCompleteOn( pCodeCompleteChk->IsChecked() ); + //CodeCompleteOptions::SetProcedureAutoCompleteOn( pCodeCompleteChk->IsChecked() ); Close(); return 0; } -- cgit