diff options
author | Tor Lillqvist <tml@collabora.com> | 2021-02-10 11:58:52 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2021-02-10 14:30:04 +0100 |
commit | 75d8a5450dfbc3bd509341126554cd1e9ecf5638 (patch) | |
tree | 615f609baceb75ff3fb9fccf6634f88614b5a599 /sc | |
parent | d6a35250140d9b698a3ded4972025ae385021eab (diff) |
Don't shrink row height when deleting cell contents interactively either
Follow-up to e763e13873adfe3c6abfa4c2dfd3ac3847e2d494. Such shrinking
of row height, typically by a few silly pixels, just causes
unnecessary invalidation thrash in a collaborative editing context.
Change-Id: I5651ce994ba4bf82c83d7d4ef1bb8ed5bab0a66d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110696
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/ucalc_sharedformula.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/docfunc.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/inc/docfunc.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/viewfunc.cxx | 10 |
4 files changed, 11 insertions, 7 deletions
diff --git a/sc/qa/unit/ucalc_sharedformula.cxx b/sc/qa/unit/ucalc_sharedformula.cxx index 40e1b3b6bf35..20d111b3e2cd 100644 --- a/sc/qa/unit/ucalc_sharedformula.cxx +++ b/sc/qa/unit/ucalc_sharedformula.cxx @@ -2451,7 +2451,7 @@ void Test::testSharedFormulaDeleteTopCell() // Delete cell A1. ScMarkData aMark(m_pDoc->GetSheetLimits()); aMark.SelectOneTable(0); - getDocShell().GetDocFunc().DeleteCell( ScAddress(0,0,0), aMark, InsertDeleteFlags::CONTENTS, false); + getDocShell().GetDocFunc().DeleteCell( ScAddress(0,0,0), aMark, InsertDeleteFlags::CONTENTS, false, /*bApi=*/ true); // Check it's gone. CPPUNIT_ASSERT(!m_pDoc->GetFormulaCell( ScAddress(0,0,0))); diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 2949e92390f1..951048e43869 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -660,7 +660,7 @@ bool ScDocFunc::DeleteContents( } bool ScDocFunc::DeleteCell( - const ScAddress& rPos, const ScMarkData& rMark, InsertDeleteFlags nFlags, bool bRecord ) + const ScAddress& rPos, const ScMarkData& rMark, InsertDeleteFlags nFlags, bool bRecord, bool bApi ) { ScDocShellModificator aModificator(rDocShell); @@ -716,7 +716,7 @@ bool ScDocFunc::DeleteCell( nFlags, pDataSpans, false, bDrawUndo); } - if (!AdjustRowHeight(rPos, true, true)) + if (!AdjustRowHeight(rPos, true, bApi)) rDocShell.PostPaint( rPos.Col(), rPos.Row(), rPos.Tab(), rPos.Col(), rPos.Row(), rPos.Tab(), PaintPartFlags::Grid, nExtFlags); diff --git a/sc/source/ui/inc/docfunc.hxx b/sc/source/ui/inc/docfunc.hxx index 51dcf25ccd1c..96475d4b30d3 100644 --- a/sc/source/ui/inc/docfunc.hxx +++ b/sc/source/ui/inc/docfunc.hxx @@ -92,7 +92,7 @@ public: const ScMarkData& rMark, InsertDeleteFlags nFlags, bool bRecord, bool bApi ); bool DeleteCell( - const ScAddress& rPos, const ScMarkData& rMark, InsertDeleteFlags nFlags, bool bRecord ); + const ScAddress& rPos, const ScMarkData& rMark, InsertDeleteFlags nFlags, bool bRecord, bool bApi ); bool TransliterateText( const ScMarkData& rMark, TransliterationFlags nType, bool bApi ); diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index a8c5a1add0c9..29ed15854e04 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ /* * This file is part of the LibreOffice project. * @@ -1981,10 +1981,14 @@ void ScViewFunc::DeleteContents( InsertDeleteFlags nFlags ) HideAllCursors(); // for if summary is cancelled ScDocFunc& rDocFunc = pDocSh->GetDocFunc(); + + // Can we really be sure that we can pass the bApi parameter as false to DeleteCell() and + // DeleteContents() here? (Meaning that this is interactive use.) Is this never invoked from + // scripting and whatnot? if (bSimple) - rDocFunc.DeleteCell(aMarkRange.aStart, aFuncMark, nFlags, bRecord); + rDocFunc.DeleteCell(aMarkRange.aStart, aFuncMark, nFlags, bRecord, /*bApi=*/ false); else - rDocFunc.DeleteContents(aFuncMark, nFlags, bRecord, false); + rDocFunc.DeleteContents(aFuncMark, nFlags, bRecord, /*bApi=*/ false); pDocSh->UpdateOle(GetViewData()); |