ONLINE: Exit cell edit mode before add a new sheet

Prevents to move last edited cell to new sheet.

Signed-off-by: Gülşah Köse <gulsah.kose@collabora.com>
Change-Id: If4a4533d81ce244ae50bbdde1fae89da14f6b53a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160758
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
This commit is contained in:
Gülşah Köse
2024-01-03 11:59:46 +01:00
parent a586ce1880
commit e0f710ad29
+5
View File
@@ -485,6 +485,11 @@ void ScDocument::InvalidateStreamOnSave()
bool ScDocument::InsertTab(
SCTAB nPos, const OUString& rName, bool bExternalDocument, bool bUndoDeleteTab )
{
// auto-accept any in-process input to prevent move the cell into next sheet in online.
if (comphelper::LibreOfficeKit::isActive())
if (!SC_MOD()->IsFormulaMode())
SC_MOD()->InputEnterHandler();
SCTAB nTabCount = GetTableCount();
bool bValid = ValidTab(nTabCount);
if ( !bExternalDocument ) // else test rName == "'Doc'!Tab" first