diff options
-rw-r--r-- | basctl/source/basicide/baside2b.cxx | 11 | ||||
-rw-r--r-- | basic/source/classes/codecompletecache.cxx | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index b65e6d10dd1b..3e39f1a5b97e 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -468,6 +468,8 @@ void EditorWindow::Command( const CommandEvent& rCEvt ) { pDispatcher->ExecutePopup(); } + if( pCodeCompleteWnd->IsVisible() ) // hide the code complete window + pCodeCompleteWnd->ClearAndHide(); } } } @@ -506,7 +508,6 @@ void EditorWindow::KeyInput( const KeyEvent& rKEvt ) // see if there is an accelerator to be processed first bool bDone = SfxViewShell::Current()->KeyInput( rKEvt ); - if( rKEvt.GetCharCode() == '"' && CodeCompleteOptions::IsAutoCloseQuotesOn() ) {//autoclose double quotes TextSelection aSel = GetEditView()->GetSelection(); @@ -638,16 +639,22 @@ void EditorWindow::KeyInput( const KeyEvent& rKEvt ) } if( aEntryVect.size() > 0 ) { + // calculate position Rectangle aRect = ( (TextEngine*) GetEditEngine() )->PaMtoEditCursor( aSel.GetEnd() , false ); + long nViewYOffset = pEditView->GetStartDocPos().Y(); + Point aPoint = aRect.BottomRight(); + aPoint.Y() = aPoint.Y() - nViewYOffset; aSel.GetStart().GetIndex() += 1; aSel.GetEnd().GetIndex() += 1; pCodeCompleteWnd->ClearListBox(); pCodeCompleteWnd->SetTextSelection(aSel); + //fill the listbox for(unsigned int l = 0; l < aEntryVect.size(); ++l) { pCodeCompleteWnd->InsertEntry( aEntryVect[l] ); } - pCodeCompleteWnd->SetPosPixel( aRect.BottomRight() ); + //show it + pCodeCompleteWnd->SetPosPixel( aPoint ); pCodeCompleteWnd->Show(); pCodeCompleteWnd->ResizeListBox(); pCodeCompleteWnd->SelectFirstEntry(); diff --git a/basic/source/classes/codecompletecache.cxx b/basic/source/classes/codecompletecache.cxx index b174d1e7149d..0c757df4b2c5 100644 --- a/basic/source/classes/codecompletecache.cxx +++ b/basic/source/classes/codecompletecache.cxx @@ -27,7 +27,7 @@ namespace } CodeCompleteOptions::CodeCompleteOptions() -: bIsCodeCompleteOn( false ), +: bIsCodeCompleteOn( true ), bIsProcedureAutoCompleteOn( false ), bIsAutoCloseQuotesOn( false ), bIsAutoCloseParenthesisOn( false ) |