summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de>2018-04-19 18:56:55 +0200
committerAndras Timar <andras.timar@collabora.com>2018-06-01 20:46:25 +0200
commita973dd377e096f17f6c4a3d21ebc16ad4af03b57 (patch)
treed600a09df0e7ebbb668fddde6b26798b0afd365d /sc
parentbdc36e33cb2ab3b9c2a75a78e25c8c0e878b69cf (diff)
tdf#115582 Correct coordinate usage for sc's ::Array
In ScOutputData::SetCellRotations() eventually existing CellRotations are added to the svx::frame::Array data that gets created for repaint. This used the wrong coordinate calculation, thus in some cases the repaint of rotated Cells failed. Change-Id: Ib5df8576e8c9404d717d5dcc5662aa04b82cf959 Reviewed-on: https://gerrit.libreoffice.org/53171 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de> (cherry picked from commit 0185e65bcd73dbad2205a39369e1e06b33a2ca51) Reviewed-on: https://gerrit.libreoffice.org/54922 (cherry picked from commit 08e45e11a0e74cdb4a17ec29df9d03ad03b7f7c0)
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/output.cxx21
1 files changed, 15 insertions, 6 deletions
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 5093f947eebf..29738f46ee57 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -658,13 +658,22 @@ void ScOutputData::SetCellRotations()
// Needed for CellInfo internal decisions (bg fill, ...)
pInfo->nRotateDir = nDir;
- // add rotation info to Array information
- const long nAttrRotate(pPattern->GetRotateVal(pCondSet));
- const SvxRotateMode eRotMode(pPattern->GetItem(ATTR_ROTATE_MODE, pCondSet).GetValue());
- const double fOrient((bLayoutRTL ? -1.0 : 1.0) * nAttrRotate * F_PI18000); // 1/100th degrees -> [0..2PI]
- svx::frame::Array& rArray = mrTabInfo.maArray;
+ // create target coordinates
+ const SCCOL nTargetX(nX - nVisX1 + 1);
+ const SCROW nTargetY(nY - nVisY1 + 1);
- rArray.SetCellRotation(nX+1, nY+1, eRotMode, fOrient);
+ // Check for values - below in SetCellRotation these will
+ // be converted to size_t and thus may not be negative
+ if(nTargetX >= 0 && nTargetY >= 0)
+ {
+ // add rotation info to Array information
+ const long nAttrRotate(pPattern->GetRotateVal(pCondSet));
+ const SvxRotateMode eRotMode(pPattern->GetItem(ATTR_ROTATE_MODE, pCondSet).GetValue());
+ const double fOrient((bLayoutRTL ? -1.0 : 1.0) * nAttrRotate * F_PI18000); // 1/100th degrees -> [0..2PI]
+ svx::frame::Array& rArray = mrTabInfo.maArray;
+
+ rArray.SetCellRotation(nTargetX, nTargetY, eRotMode, fOrient);
+ }
}
}
}