summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sc/source/ui/app/inputhdl.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index b837cb2d089b..dd1f9f61958a 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -2171,10 +2171,11 @@ void ScInputHandler::UpdateParenthesis()
{
// Examine character left to the cursor
sal_Int32 nPos = aSel.nStartPos - 1;
- OUString aFormula = mpEditEngine->GetText(0);
+ OUString aFormula = mpEditEngine->GetText(aSel.nStartPara);
sal_Unicode c = aFormula[nPos];
if ( c == '(' || c == ')' )
{
+ // Note this matches only within one paragraph.
sal_Int32 nOther = lcl_MatchParenthesis( aFormula, nPos );
if ( nOther != -1 )
{
@@ -2190,9 +2191,9 @@ void ScInputHandler::UpdateParenthesis()
mpEditEngine->RemoveCharAttribs( i, EE_CHAR_WEIGHT );
}
- ESelection aSelThis( 0,nPos, 0,nPos+1 );
+ ESelection aSelThis( aSel.nStartPara, nPos, aSel.nStartPara, nPos+1);
mpEditEngine->QuickSetAttribs( aSet, aSelThis );
- ESelection aSelOther( 0,nOther, 0,nOther+1 );
+ ESelection aSelOther( aSel.nStartPara, nOther, aSel.nStartPara, nOther+1);
mpEditEngine->QuickSetAttribs( aSet, aSelOther );
// Dummy InsertText for Update and Paint (selection is empty)