[Libreoffice-commits] core.git: Branch 'feature/gsoc-basic-ide-completion-and-other-bits' - basctl/source
Gergo Mocsi
gmocsi91 at gmail.com
Thu Jun 27 11:32:17 PDT 2013
basctl/source/basicide/baside2.hxx | 1 +
basctl/source/basicide/baside2b.cxx | 11 ++++++++---
2 files changed, 9 insertions(+), 3 deletions(-)
New commits:
commit 3168fe1be0b45ea418f97430004fedf695f85a15
Author: Gergo Mocsi <gmocsi91 at gmail.com>
Date: Thu Jun 27 20:23:48 2013 +0200
GSOC work week4, CodeCompleteListBox appearance fix
This patch allows the pop-up CodeCompleteListBox to appear under the cursor.
It's size is fixed:150x150.
Also, I've fixed a bug in extracting the current variable name.
Change-Id: Id98cb1c29be72af07a25aac3d51561f072bf103e
diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx
index 774995d..179a223 100644
--- a/basctl/source/basicide/baside2.hxx
+++ b/basctl/source/basicide/baside2.hxx
@@ -42,6 +42,7 @@ class SvxSearchItem;
#include <svl/lstner.hxx>
#include <svtools/colorcfg.hxx>
#include "vcl/lstbox.hxx"
+#include "vcl/scrbar.hxx"
#include <sfx2/progress.hxx>
#include <unotools/options.hxx>
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 5d9daf2..1804888 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -502,7 +502,8 @@ void EditorWindow::KeyInput( const KeyEvent& rKEvt )
sal_uLong nLine = aSel.GetStart().GetPara();
OUString aLine( pEditEngine->GetText( nLine ) ); // the line being modified
- OUString aStr = (aLine.lastIndexOf(" ") == -1 ? aLine.replaceFirst(".","") : aLine.copy(aLine.lastIndexOf(" ")).replaceFirst(".",""));
+ OUString aStr = aLine.copy( std::max(aLine.lastIndexOf(" "), aLine.lastIndexOf("\t"))+1 );
+
for( unsigned int j = 0; j < aCodeCompleteCache.size(); ++j)
{
if( aCodeCompleteCache[j].sVarName == aStr )
@@ -516,13 +517,17 @@ void EditorWindow::KeyInput( const KeyEvent& rKEvt )
{
Sequence< Reference< reflection::XIdlMethod > > aMethods = xClass->getMethods();
aListBox->Clear();
+
+ Rectangle aRect = ( (TextEngine*) GetEditEngine() )->PaMtoEditCursor(aSel.GetEnd() , false);
+ aListBox->SetPosPixel( aRect.TopLeft() );
+ aListBox->SetSizePixel( Size(150,150) );
+
for(sal_Int32 i = 0; i < aMethods.getLength(); ++i)
{
aListBox->InsertEntry( OUString(aMethods[i]->getName()) );
SAL_WARN("method information", aMethods[i]->getName());
}
- aListBox->EnableAutoSize(true);
- aListBox->Show();
+
aListBox->GetFocus();
aListBox->ToggleDropDown();
}
More information about the Libreoffice-commits
mailing list