summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-06-16 19:57:15 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-06-16 20:18:51 +0100
commite06905df15ff03c6d3c84f61bd67860a91416c2d (patch)
tree972b334ec2736347b830e31942433704b0719d71
parent2d4a931208acd0060bfaa00a9444e6e0ceb7e83c (diff)
Resolves: tdf#81806 crash on certain table paste+undo+page cycles
Undo of a delete always leaves a pam that points to the start of the undone area and a mark to the end of the undone area, even if that area is empty. (In the normal where there is a selection this can be seen by selecting something, deleting it, and undoing and the newly undeleted stuff is again selected) The table overwrite/paste thing looks to see if a mark is set and goes off to "do something very complex" if its set. So if after each undo cycle, you physically click at the point where the cursor is flashing (which clears the mark) and then paste, undo, *click*, paste you get a wonderfully stable experience. It seems reasonable to me to "do the simple thing" if there is no mark, or if the mark and point are the same, i.e. there is nothing actually selected by the PaM. Change-Id: Ib451090f3863fde41209cc1fc9cfa0c747d0be58
-rw-r--r--sw/source/core/frmedt/fecopy.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index 612f63194718..d6dac4460037 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -667,6 +667,11 @@ namespace {
typedef boost::shared_ptr<SwPaM> PaMPtr;
typedef boost::shared_ptr<SwPosition> PositionPtr;
typedef std::pair< PaMPtr, PositionPtr > Insertion;
+
+ bool PamHasSelection(const SwPaM& rPaM)
+ {
+ return rPaM.HasMark() && *rPaM.GetPoint() != *rPaM.GetMark();
+ }
}
bool SwFEShell::Paste( SwDoc* pClpDoc, bool bIncludingPageFrames )
@@ -839,7 +844,7 @@ bool SwFEShell::Paste( SwDoc* pClpDoc, bool bIncludingPageFrames )
ParkTableCrsr();
bParkTableCrsr = true;
}
- else if( !rPaM.HasMark() && rPaM.GetNext() == &rPaM &&
+ else if( !PamHasSelection(rPaM) && rPaM.GetNext() == &rPaM &&
( !pSrcNd->GetTable().IsTableComplex() ||
pDestNd->GetTable().IsNewModel() ) )
{