diff options
author | Eike Rathke <erack@redhat.com> | 2022-01-22 18:20:08 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2022-01-25 16:30:28 +0100 |
commit | 5cc40c5b89c8d651e9d38d2b6d388399c3fe8664 (patch) | |
tree | 8b1e4244e14faebd5ee66d16f0026c48a071618b | |
parent | 4eccf0c4bd3e7c48352417745d7f00b9c2ff44da (diff) |
ScInputHandler::UpdateFormulaMode() also for multi-line formulas
Additionally sprinkle some
TODO: MLFORMULA
comments on places where multi-line formulas should be supported
as well but code currently only works for one paragraph.
Change-Id: If2630a6493910984e0abb81ff2ed42ed51394681
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128787
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
(cherry picked from commit 8204d322379cbc054fb834911d88fb0fe3b040c6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128822
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
-rw-r--r-- | sc/source/ui/app/inputhdl.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/view/editsh.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/view/viewfunc.cxx | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 8b4d8bde90b3..d844401a8807 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -1287,6 +1287,7 @@ void ScInputHandler::ShowTipCursor() HideTipBelow(); EditView* pActiveView = pTopView ? pTopView : pTableView; + /* TODO: MLFORMULA: this should work also with multi-line formulas. */ if ( !(bFormulaMode && pActiveView && pFormulaDataPara && mpEditEngine->GetParagraphCount() == 1) ) return; @@ -1534,7 +1535,7 @@ void ScInputHandler::UseFormulaData() { EditView* pActiveView = pTopView ? pTopView : pTableView; - // Formulas may only have 1 paragraph + /* TODO: MLFORMULA: this should work also with multi-line formulas. */ if ( !(pActiveView && pFormulaData && mpEditEngine->GetParagraphCount() == 1) ) return; @@ -2765,7 +2766,7 @@ void ScInputHandler::UpdateFormulaMode() { SfxApplication* pSfxApp = SfxGetpApp(); - bool bIsFormula = !bProtected && mpEditEngine->GetParagraphCount() == 1; + bool bIsFormula = !bProtected; if (bIsFormula) { const OUString& rText = mpEditEngine->GetText(0); diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index c7e7dabd1ee5..ba0abdc433c4 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -526,6 +526,7 @@ void ScEditShell::Execute( SfxRequest& rReq ) case SID_TOGGLE_REL: { + /* TODO: MLFORMULA: this should work also with multi-line formulas. */ if (pEngine->GetParagraphCount() == 1) { OUString aText = pEngine->GetText(); diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index af151534c018..247fdeda5a70 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -661,7 +661,7 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab, // formulas have to be recognized even if they're formatted // (but common attributes are still collected) - if ( !bSimple && aEngine.GetParagraphCount() == 1 ) + if (!bSimple) { OUString aParStr(aEngine.GetText( 0 )); if ( aParStr[0] == '=' ) |