[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
Eike Rathke
erack at redhat.com
Mon Jun 8 13:29:58 PDT 2015
sc/source/core/data/document.cxx | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)
New commits:
commit 5db9892115826c3c88a66f3b8a482a74d63faf24
Author: Eike Rathke <erack at redhat.com>
Date: Mon Jun 8 20:35:48 2015 +0200
destroy and reconstruct listeners only if content is affected
Pasting formula content that created a formula group always constructed
group listeners, then destroyed those listeners again and reconstructed
the same listeners, because ScDocument::DeleteArea() is called with
IDF_OBJECTS again if nothing is excluded from paste. Do the listener
stuff only if one or more of the IDF_CONTENTS bits are set.
Change-Id: I8c6b7f7bb3402590f2b1f3259ee730f26a906cdf
(cherry picked from commit 97fea63ddf21f48ebb3950952b7d5c6c5f648de4)
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index c445d63..57a8393 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -1786,28 +1786,36 @@ void ScDocument::DeleteArea(
PutInOrder( nCol1, nCol2 );
PutInOrder( nRow1, nRow2 );
- // Record the positions of top and/or bottom formula groups that intersect
- // the area borders.
std::vector<ScAddress> aGroupPos;
- sc::EndListeningContext aCxt(*this);
- ScRange aRange(nCol1, nRow1, 0, nCol2, nRow2, 0);
- for (size_t i = 0; i < maTabs.size(); ++i)
+ // Destroy and reconstruct listeners only if content is affected.
+ bool bDelContent = ((nDelFlag & ~IDF_CONTENTS) != nDelFlag);
+ if (bDelContent)
{
- aRange.aStart.SetTab(i);
- aRange.aEnd.SetTab(i);
+ // Record the positions of top and/or bottom formula groups that intersect
+ // the area borders.
+ sc::EndListeningContext aCxt(*this);
+ ScRange aRange(nCol1, nRow1, 0, nCol2, nRow2, 0);
+ for (size_t i = 0; i < maTabs.size(); ++i)
+ {
+ aRange.aStart.SetTab(i);
+ aRange.aEnd.SetTab(i);
- EndListeningIntersectedGroups(aCxt, aRange, &aGroupPos);
+ EndListeningIntersectedGroups(aCxt, aRange, &aGroupPos);
+ }
+ aCxt.purgeEmptyBroadcasters();
}
- aCxt.purgeEmptyBroadcasters();
for (SCTAB i = 0; i < static_cast<SCTAB>(maTabs.size()); i++)
if (maTabs[i])
if ( rMark.GetTableSelect(i) || bIsUndo )
maTabs[i]->DeleteArea(nCol1, nRow1, nCol2, nRow2, nDelFlag, bBroadcast, pBroadcastSpans);
- // Re-start listeners on those top bottom groups that have been split.
- SetNeedsListeningGroups(aGroupPos);
- StartNeededListeners();
+ if (bDelContent)
+ {
+ // Re-start listeners on those top bottom groups that have been split.
+ SetNeedsListeningGroups(aGroupPos);
+ StartNeededListeners();
+ }
}
void ScDocument::DeleteAreaTab(SCCOL nCol1, SCROW nRow1,
More information about the Libreoffice-commits
mailing list