sc/inc/table.hxx | 2 +- sc/source/core/data/document10.cxx | 2 +- sc/source/core/data/table7.cxx | 5 ++++- sc/source/ui/view/viewfun3.cxx | 22 ++++++++++++++++------ 4 files changed, 22 insertions(+), 9 deletions(-)
New commits: commit 403ca446458268ae04d42f666223974f525e8df8 Author: Arul <arul7...@gmail.com> Date: Thu Jan 21 18:22:51 2016 +0530 tdf#89140:Calc row paste doesn't keep row height Change-Id: Ibf9a5674711cf496706c4d3ac9d3133016aea39d Reviewed-on: https://gerrit.libreoffice.org/21665 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Eike Rathke <er...@redhat.com> diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index d2672fe..0e84a70 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 dddd8b0..a2f13920 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 f940ee5..6c0cefa 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 1e6a216..77b0fad 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()) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits