diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2017-02-12 01:58:23 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2017-02-13 21:37:48 +0000 |
commit | 36ef9f8d077afe2c605e9d22588dc3f698440d89 (patch) | |
tree | f355d82d3c83a5c3c26be94ce4d1115c73c997b4 /sc/source/ui/undo | |
parent | add pcx fuzzer (diff) | |
download | core-36ef9f8d077afe2c605e9d22588dc3f698440d89.tar.gz core-36ef9f8d077afe2c605e9d22588dc3f698440d89.zip |
tdf#76183: refresh objects' positions on optimal height recalc
Since commit b10833d4db6046f2d32ea44a60cb19a626d80447, it's required
to detect when objects' placement should be adjusted, and call
SetDrawPageSize manually.
Unit test included
Change-Id: I933ba4802b212400cc47ed0fb7e1f8f44049bb81
Reviewed-on: https://gerrit.libreoffice.org/34165
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc/source/ui/undo')
-rw-r--r-- | sc/source/ui/undo/undobase.cxx | 11 | ||||
-rw-r--r-- | sc/source/ui/undo/undoblk.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/undo/undoblk3.cxx | 6 |
3 files changed, 17 insertions, 2 deletions
diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx index c2b4b693ddfc..036cdd96761b 100644 --- a/sc/source/ui/undo/undobase.cxx +++ b/sc/source/ui/undo/undobase.cxx @@ -313,10 +313,14 @@ bool ScBlockUndo::AdjustHeight() aCxt, aBlockRange.aStart.Row(), aBlockRange.aEnd.Row(), aBlockRange.aStart.Tab()); if (bRet) + { + // tdf#76183: recalculate objects' positions + rDoc.SetDrawPageSize(aBlockRange.aStart.Tab()); + pDocShell->PostPaint( 0, aBlockRange.aStart.Row(), aBlockRange.aStart.Tab(), MAXCOL, MAXROW, aBlockRange.aEnd.Tab(), PaintPartFlags::Grid | PaintPartFlags::Left ); - + } return bRet; } @@ -413,9 +417,14 @@ void ScMultiBlockUndo::AdjustHeight() bool bRet = rDoc.SetOptimalHeight(aCxt, r.aStart.Row(), r.aEnd.Row(), r.aStart.Tab()); if (bRet) + { + // tdf#76183: recalculate objects' positions + rDoc.SetDrawPageSize(r.aStart.Tab()); + pDocShell->PostPaint( 0, r.aStart.Row(), r.aStart.Tab(), MAXCOL, MAXROW, r.aEnd.Tab(), PaintPartFlags::Grid | PaintPartFlags::Left); + } } } diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index 39f604afeb98..3bbe625b206c 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -1176,6 +1176,8 @@ void ScUndoDragDrop::PaintArea( ScRange aRange, sal_uInt16 nExtFlags ) const if (rDoc.SetOptimalHeight(aCxt, aRange.aStart.Row(), aRange.aEnd.Row(), aRange.aStart.Tab())) { + // tdf#76183: recalculate objects' positions + rDoc.SetDrawPageSize(aRange.aStart.Tab()); aRange.aStart.SetCol(0); aRange.aEnd.SetCol(MAXCOL); aRange.aEnd.SetRow(MAXROW); diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx index 226e15dcc44a..7a6038bed0ba 100644 --- a/sc/source/ui/undo/undoblk3.cxx +++ b/sc/source/ui/undo/undoblk3.cxx @@ -875,7 +875,7 @@ void ScUndoAutoFormat::Redo() rDoc.SetRowFlags( nRow, nTab, nOld & ~CRFlags::ManualSize ); } - rDoc.SetOptimalHeight(aCxt, nStartY, nEndY, nTab); + bool bChanged = rDoc.SetOptimalHeight(aCxt, nStartY, nEndY, nTab); for (SCCOL nCol=nStartX; nCol<=nEndX; nCol++) if (!rDoc.ColHidden(nCol, nTab)) @@ -886,6 +886,10 @@ void ScUndoAutoFormat::Redo() rDoc.SetColWidth( nCol, nTab, nThisSize ); rDoc.ShowCol( nCol, nTab, true ); } + + // tdf#76183: recalculate objects' positions + if (bChanged) + rDoc.SetDrawPageSize(nTab); } pDocShell->PostPaint( 0, 0, nStartZ, |