jsdialog: formulabar: dont send huge paragraph id when not found

Change-Id: Ia5586023f639815e54628bfad1a8df11c295c741
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136848
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Gökay ŞATIR <gokaysatir@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137450
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
This commit is contained in:
Szymon Kłos 2022-07-06 18:08:16 +02:00
parent c2a5269377
commit a66c2f5511

View file

@ -4241,6 +4241,14 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* pState,
{
EditView* pActiveView = pTopView ? pTopView : pTableView;
ESelection aSel = pActiveView ? pActiveView->GetSelection() : ESelection();
// if we switched content completly - don't send huge numbers
if (aSel.nStartPara == EE_PARA_NOT_FOUND)
aSel.nStartPara = 0;
if (aSel.nEndPara == EE_PARA_NOT_FOUND)
aSel.nEndPara = 0;
ScInputHandler::LOKSendFormulabarUpdate(pActiveViewSh, aString, aSel);
// TODO: deprecated?
pActiveViewSh->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_FORMULA, aString.toUtf8().getStr());