summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArul <arul71.m@gmail.com>2016-01-21 18:22:51 +0530
committerEike Rathke <erack@redhat.com>2016-02-03 14:08:12 +0000
commit403ca446458268ae04d42f666223974f525e8df8 (patch)
tree01527be75ac2b05b09d244e2250d22d6df119418
parent5008b9a692296ab72e08d397a49d11d02222f83c (diff)
tdf#89140:Calc row paste doesn't keep row height
Change-Id: Ibf9a5674711cf496706c4d3ac9d3133016aea39d Reviewed-on: https://gerrit.libreoffice.org/21665 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/inc/table.hxx2
-rw-r--r--sc/source/core/data/document10.cxx2
-rw-r--r--sc/source/core/data/table7.cxx5
-rw-r--r--sc/source/ui/view/viewfun3.cxx22
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())
{