From 1cb01c477cf1e84f6e1b2ca1771a9af53d81dc59 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 15 Oct 2013 13:23:28 +0100 Subject: Resolves: fdo#47958 shrink cut/paste more and rework a bit I'm concerned that the scoping of the dtor will cause events to happen in different order to the original. So rework the require explicit Notify calls rather than implicit dtor calls instead of going about the place putting in scoping brackets Change-Id: I7f3ac4ef3c073da74a9cc49888a59dec12805b0f --- sc/source/ui/view/viewfun3.cxx | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'sc/source/ui/view/viewfun3.cxx') diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index 6698164fca99..5f4dac21e73e 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -1703,23 +1703,24 @@ void ScViewFunc::PostPasteFromClip(const ScRangeList& rPasteRanges, const ScMark SelectionChanged(); + ScModelObj* pModelObj = HelperNotifyChanges::getMustPropagateChangesModel(*pDocSh); + if (!pModelObj) + return; + ScRangeList aChangeRanges; - HelperNotifyChanges aHelperNotifyChanges(&aChangeRanges, "cell-change"); - if (aHelperNotifyChanges.getMustPropagateChanges()) + for (size_t i = 0, n = rPasteRanges.size(); i < n; ++i) { - for (size_t i = 0, n = rPasteRanges.size(); i < n; ++i) + const ScRange& r = *rPasteRanges[i]; + ScMarkData::const_iterator itr = rMark.begin(), itrEnd = rMark.end(); + for (; itr != itrEnd; ++itr) { - const ScRange& r = *rPasteRanges[i]; - ScMarkData::const_iterator itr = rMark.begin(), itrEnd = rMark.end(); - for (; itr != itrEnd; ++itr) - { - ScRange aChangeRange(r); - aChangeRange.aStart.SetTab(*itr); - aChangeRange.aEnd.SetTab(*itr); - aChangeRanges.Append(aChangeRange); - } + ScRange aChangeRange(r); + aChangeRange.aStart.SetTab(*itr); + aChangeRange.aEnd.SetTab(*itr); + aChangeRanges.Append(aChangeRange); } } + HelperNotifyChanges::Notify(*pModelObj, aChangeRanges); } -- cgit