[Libreoffice-commits] core.git: Branch 'feature/gsoc-basic-ide-completion-and-other-bits' - basctl/source basic/source
Gergo Mocsi
gmocsi91 at gmail.com
Mon Jul 29 09:48:56 PDT 2013
basctl/source/basicide/baside2b.cxx | 11 +++++++++--
basic/source/classes/codecompletecache.cxx | 2 +-
2 files changed, 10 insertions(+), 3 deletions(-)
New commits:
commit 27487350a0ac29f8b8997277d1e602d24e178ece
Author: Gergo Mocsi <gmocsi91 at gmail.com>
Date: Mon Jul 29 18:41:27 2013 +0200
GSOC work, listbox appearance fix
Fixed the listbox appearance even the source file is scrolled.
When scrolling, and the listbox is visible, it gets hidden.
I've set the Code Completition to defaultly true, to make testing easier.
Change-Id: If571a4f1d38751b35fd43ab3c1f13daccd9dd375
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index a3a8f10..f0f6ae8 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -462,6 +462,8 @@ void EditorWindow::Command( const CommandEvent& rCEvt )
( rCEvt.GetCommand() == COMMAND_AUTOSCROLL ) )
{
HandleScrollCommand( rCEvt, rModulWindow.GetHScrollBar(), &rModulWindow.GetEditVScrollBar() );
+ if( pCodeCompleteWnd->IsVisible() ) // hide the code complete window
+ pCodeCompleteWnd->ClearAndHide();
}
}
}
@@ -500,7 +502,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();
@@ -632,16 +633,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 b174d1e..0c757df 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 )
More information about the Libreoffice-commits
mailing list