[Libreoffice-commits] core.git: basctl/source

Stephan Bergmann sbergman at redhat.com
Fri Jan 6 08:38:47 UTC 2017


 basctl/source/basicide/baside2b.cxx |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 1426eb8a9a8cc150f2330135f28384e5193c6c2b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Jan 6 09:38:06 2017 +0100

    Clean up a usage of OUStringBuffer
    
    Change-Id: I05205763502fb20e056cc80f50a37b93232e5743

diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 0468e12..035d9b0 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -2620,7 +2620,7 @@ TextView* CodeCompleteListBox::GetParentEditView()
 
 void CodeCompleteListBox::InsertSelectedEntry()
 {
-    if( !aFuncBuffer.toString().isEmpty() )
+    if( !aFuncBuffer.isEmpty() )
     {
         // if the user typed in something: remove, and insert
         GetParentEditView()->SetSelection( pCodeCompleteWindow->pParent->GetLastHighlightPortionTextSelection() );
@@ -2725,7 +2725,7 @@ void CodeCompleteListBox::KeyInput( const KeyEvent& rKeyEvt )
                 HideAndRestoreFocus();
                 break;
             case KEY_BACKSPACE: case KEY_DELETE:
-                if( !aFuncBuffer.toString().isEmpty() )
+                if( !aFuncBuffer.isEmpty() )
                 {
                     //if there was something inserted by tab: add it to aFuncBuffer
                     TextSelection aSel( GetParentEditView()->GetSelection() );
@@ -2736,10 +2736,9 @@ void CodeCompleteListBox::KeyInput( const KeyEvent& rKeyEvt )
 
                     if( !aTabInsertedStr.isEmpty() && aTabInsertedStr != aFuncBuffer.toString() )
                     {
-                        aFuncBuffer.setLength(0);
-                        aFuncBuffer = aFuncBuffer.append(aTabInsertedStr);
+                        aFuncBuffer = aTabInsertedStr;
                     }
-                    aFuncBuffer = aFuncBuffer.remove(aFuncBuffer.getLength()-1, 1);
+                    aFuncBuffer.remove(aFuncBuffer.getLength()-1, 1);
                     SetMatchingEntries();
                 }
                 else


More information about the Libreoffice-commits mailing list