summaryrefslogtreecommitdiff
path: root/sc/source/ui/app/inputhdl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/app/inputhdl.cxx')
-rw-r--r--sc/source/ui/app/inputhdl.cxx51
1 files changed, 19 insertions, 32 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 001aa27bb664..09308b8e8ae7 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -804,8 +804,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);
@@ -932,34 +931,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;
@@ -986,7 +957,7 @@ void ScInputHandler::ShowTipCursor()
{
OUString aSelText( aParagraph.copy( 0, aSel.nEndPos ));
- ShowArgumentsTip( aParagraph, aSelText, aSel, true);
+ ShowArgumentsTip( aSelText );
}
}
}
@@ -1087,6 +1058,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 )
{
@@ -1102,6 +1079,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 );
@@ -1112,7 +1099,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 );
}
}
}