[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - sc/source

Winfried Donkers winfrieddonkers at libreoffice.org
Mon Jul 13 07:34:00 PDT 2015


 sc/source/ui/app/inputhdl.cxx |   51 +++++++++++++++---------------------------
 sc/source/ui/inc/inputhdl.hxx |    3 --
 2 files changed, 20 insertions(+), 34 deletions(-)

New commits:
commit 865afb6ed25891129efb6907595c892e417a191a
Author: Winfried Donkers <winfrieddonkers at libreoffice.org>
Date:   Thu Jun 25 17:26:20 2015 +0200

    tdf#89031 remove agressiveness from Calc function suggestions
    
    Change-Id: I7751a038f8482addc0e45c0461666bbd1c959d12
    Reviewed-on: https://gerrit.libreoffice.org/16478
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>
    (cherry picked from commit f3d748937a177cbbc0033bcf54d0d0fd57a1b409)
    Reviewed-on: https://gerrit.libreoffice.org/17009
    Reviewed-on: https://gerrit.libreoffice.org/17013

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index c44257b..3b7dddb 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -799,8 +799,7 @@ void ScInputHandler::HideTipBelow()
     aManualTip.clear();
 }
 
-void ScInputHandler::ShowArgumentsTip( const OUString& rParagraph, OUString& rSelText, const ESelection& rSel,
-        bool bTryFirstSel )
+void ScInputHandler::ShowArgumentsTip( OUString& rSelText )
 {
     ScDocShell* pDocSh = pActiveViewSh->GetViewData().GetDocShell();
     const sal_Unicode cSep = ScCompiler::GetNativeSymbolChar(ocSep);
@@ -927,34 +926,6 @@ void ScInputHandler::ShowArgumentsTip( const OUString& rParagraph, OUString& rSe
                 }
             }
         }
-        else if (bTryFirstSel)
-        {
-            sal_Int32 nPosition = 0;
-            OUString aText = pEngine->GetWord( 0, rSel.nEndPos-1 );
-            /* XXX: dubious, what is this condition supposed to exactly match? */
-            if (rSel.nEndPos <= aText.getLength() && aText[ rSel.nEndPos-1 ] == '=')
-            {
-                break;
-            }
-            OUString aNew;
-            nPosition = aText.getLength()+1;
-            ScTypedCaseStrSet::const_iterator it =
-                findText(*pFormulaDataPara, pFormulaDataPara->end(), aText, aNew, false);
-            if (it != pFormulaDataPara->end())
-            {
-                if( nPosition < rParagraph.getLength() && rParagraph[ nPosition ] =='(' )
-                {
-                    ShowTipBelow( aNew );
-                    bFound = true;
-                }
-                else
-                    break;
-            }
-            else
-            {
-                break;
-            }
-        }
         else
         {
             break;
@@ -981,7 +952,7 @@ void ScInputHandler::ShowTipCursor()
         {
             OUString aSelText( aParagraph.copy( 0, aSel.nEndPos ));
 
-            ShowArgumentsTip( aParagraph, aSelText, aSel, true);
+            ShowArgumentsTip( aSelText );
         }
     }
 }
@@ -1077,6 +1048,12 @@ void ScInputHandler::UseFormulaData()
         if ( aSel.nEndPos > aParagraph.getLength() )
             return;
 
+        if ( aParagraph.getLength() > aSel.nEndPos &&
+             ( ScGlobal::pCharClass->isLetterNumeric( aParagraph, aSel.nEndPos ) ||
+               aParagraph[ aSel.nEndPos ] == '_' ||
+               aParagraph[ aSel.nEndPos ] == '.'   ) )
+            return;
+
         //  Is the cursor at the end of a word?
         if ( aSel.nEndPos > 0 )
         {
@@ -1092,6 +1069,16 @@ void ScInputHandler::UseFormulaData()
                 miAutoPosFormula = findText(*pFormulaData, miAutoPosFormula, aText, aNew, false);
                 if (miAutoPosFormula != pFormulaData->end())
                 {
+                    // check if partial function name is not Between quotes
+                    bool bBetweenQuotes = false;
+                    for ( int n = 0; n < aSelText.getLength(); n++ )
+                    {
+                        if ( aSelText[ n ] == '"' )
+                            bBetweenQuotes = !bBetweenQuotes;
+                    }
+                    if ( bBetweenQuotes )
+                        return;  // we're between quotes
+
                     if (aNew[aNew.getLength()-1] == cParenthesesReplacement)
                         aNew = aNew.copy( 0, aNew.getLength()-1) + "()";
                     ShowTip( aNew );
@@ -1102,7 +1089,7 @@ void ScInputHandler::UseFormulaData()
 
             // function name is complete:
             // show tip below the cell with function name and arguments of function
-            ShowArgumentsTip( aParagraph, aSelText, aSel, false);
+            ShowArgumentsTip( aSelText );
         }
     }
 }
diff --git a/sc/source/ui/inc/inputhdl.hxx b/sc/source/ui/inc/inputhdl.hxx
index 65ea47c..b03be18 100644
--- a/sc/source/ui/inc/inputhdl.hxx
+++ b/sc/source/ui/inc/inputhdl.hxx
@@ -156,8 +156,7 @@ private:
     bool            CursorAtClosingPar();
     void            SkipClosingPar();
     bool            GetFuncName( OUString& aStart, OUString& aResult );  // fdo75264
-    void            ShowArgumentsTip( const OUString& rParagraph, OUString& rSelText, const ESelection& rSel,
-                                      bool bTryFirstSel );
+    void            ShowArgumentsTip( OUString& rSelText );
     DECL_LINK( ModifyHdl, void* );
     DECL_LINK( ShowHideTipVisibleParentListener, VclWindowEvent* );
     DECL_LINK( ShowHideTipVisibleSecParentListener, VclWindowEvent* );


More information about the Libreoffice-commits mailing list