diff options
-rw-r--r-- | sc/inc/table.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/document10.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/table7.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun3.cxx | 22 |
4 files changed, 22 insertions, 9 deletions
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index d2672fe3ff36..0e84a70b6f62 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -428,7 +428,7 @@ public: sc::CopyFromClipContext& rCxt, const ScTable& rClipTab, sc::ColumnSpanSet& rBroadcastSpans ); void CopyOneCellFromClip( - sc::CopyFromClipContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ); + sc::CopyFromClipContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCROW nSrcRow, ScTable* pSrcTab ); void CopyFromClip( sc::CopyFromClipContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx index dddd8b0d27b9..a2f139206836 100644 --- a/sc/source/core/data/document10.cxx +++ b/sc/source/core/data/document10.cxx @@ -117,7 +117,7 @@ bool ScDocument::CopyOneCellFromClip( SCTAB nTabEnd = rCxt.getTabEnd(); for (SCTAB i = rCxt.getTabStart(); i <= nTabEnd && i < static_cast<SCTAB>(maTabs.size()); ++i) { - maTabs[i]->CopyOneCellFromClip(rCxt, nCol1, nRow1, nCol2, nRow2); + maTabs[i]->CopyOneCellFromClip(rCxt, nCol1, nRow1, nCol2, nRow2, aClipRange.aStart.Row(), pSrcTab); if (rCxt.getInsertFlag() & InsertDeleteFlags::ATTRIB) for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow) { diff --git a/sc/source/core/data/table7.cxx b/sc/source/core/data/table7.cxx index f940ee5c332e..6c0cefab50f0 100644 --- a/sc/source/core/data/table7.cxx +++ b/sc/source/core/data/table7.cxx @@ -52,7 +52,7 @@ void ScTable::DeleteBeforeCopyFromClip( } void ScTable::CopyOneCellFromClip( - sc::CopyFromClipContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ) + sc::CopyFromClipContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCROW nSrcRow, ScTable* pSrcTab ) { ScRange aSrcRange = rCxt.getClipDoc()->GetClipParam().getWholeRange(); SCCOL nSrcColSize = aSrcRange.aEnd.Col() - aSrcRange.aStart.Col() + 1; @@ -64,6 +64,9 @@ void ScTable::CopyOneCellFromClip( assert(nColOffset >= 0); aCol[nCol].CopyOneCellFromClip(rCxt, nRow1, nRow2, nColOffset); } + + if (nCol1 == 0 && nCol2 == MAXCOL && mpRowHeights) + mpRowHeights->setValue(nRow1, nRow2, pSrcTab->GetOriginalHeight(nSrcRow)); } void ScTable::SetValues( SCCOL nCol, SCROW nRow, const std::vector<double>& rVals ) diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index 1e6a21622863..77b0fad9e999 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -1505,11 +1505,12 @@ bool ScViewFunc::PasteMultiRangesFromClip( return false; } + bool bRowInfo = ( aMarkedRange.aStart.Col()==0 && aMarkedRange.aEnd.Col()==MAXCOL ); ::std::unique_ptr<ScDocument> pUndoDoc; if (pDoc->IsUndoEnabled()) { pUndoDoc.reset(new ScDocument(SCDOCMODE_UNDO)); - pUndoDoc->InitUndoSelected(pDoc, aMark); + pUndoDoc->InitUndoSelected(pDoc, aMark, false, bRowInfo); pDoc->CopyToDocument(aMarkedRange, nUndoFlags, false, pUndoDoc.get(), &aMark); } @@ -1549,10 +1550,15 @@ bool ScViewFunc::PasteMultiRangesFromClip( true, false, false, true); } - ScRange aTmp = aMarkedRange; - aTmp.aStart.SetTab(nTab1); - aTmp.aEnd.SetTab(nTab1); - pDocSh->PostPaint(aTmp, PAINT_GRID); + if (bRowInfo) + pDocSh->PostPaint(aMarkedRange.aStart.Col(), aMarkedRange.aStart.Row(), nTab1, MAXCOL, MAXROW, nTab1, PAINT_GRID|PAINT_LEFT); + else + { + ScRange aTmp = aMarkedRange; + aTmp.aStart.SetTab(nTab1); + aTmp.aEnd.SetTab(nTab1); + pDocSh->PostPaint(aTmp, PAINT_GRID); + } if (pDoc->IsUndoEnabled()) { @@ -1712,7 +1718,11 @@ bool ScViewFunc::PasteFromClipToMultiRanges( // Refresh the range that includes all pasted ranges. We only need to // refresh the current sheet. - pDocSh->PostPaint(aRanges, PAINT_GRID); + sal_uInt16 nPaint = PAINT_GRID; + bool bRowInfo = (aSrcRange.aStart.Col()==0 && aSrcRange.aEnd.Col()==MAXCOL); + if (bRowInfo) + nPaint |= PAINT_LEFT; + pDocSh->PostPaint(aRanges, nPaint); if (pDoc->IsUndoEnabled()) { |