summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLászló Németh <laszlo.nemeth@collabora.com>2015-03-13 22:05:56 +0100
committerLászló Németh <laszlo.nemeth@collabora.com>2015-03-13 22:32:49 +0100
commit7600a2942ce2b9dac66836105bed6620d55abec2 (patch)
tree51f43751606995c7d16fca0924b8438bd7139e73
parente3a85e449ffc4bf98943279d3ffe3dcda007dc24 (diff)
fdo#37156 insert table copy as nested table in non-starting cell position
Inserted table content overwrote full cell content, when it was inserted in the middle of a multi-paragraph table cell. Now overwriting depends from the cursor position within the cell: if the cursor is not at the beginning of the first paragraph of the cell, Writer inserts the copied table content as a nested table, instead of overwriting the cell (or also the other cells of the destination). Change-Id: I1f993cfa65cf5936da245b39108162c15b3ff571
-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 dee853a8212e..c4e2a350ac94 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -818,7 +818,12 @@ bool SwFEShell::Paste( SwDoc* pClpDoc, bool bIncludingPageFrames )
{
if( pSrcNd &&
- 0 != ( pDestNd = GetDoc()->IsIdxInTbl( rPaM.GetPoint()->nNode )))
+ 0 != ( pDestNd = GetDoc()->IsIdxInTbl( rPaM.GetPoint()->nNode )) &&
+ // are we at the beginning of the cell? (if not, we will insert a nested table)
+ // first paragraph of the cell?
+ rPaM.GetNode().GetIndex() == rPaM.GetNode().FindTableBoxStartNode()->GetIndex()+1 &&
+ // beginning of the paragraph?
+ !rPaM.GetPoint()->nContent.GetIndex())
{
SwPosition aDestPos( *rPaM.GetPoint() );