Kaydet (Commit) 0185e65b authored tarafından Armin Le Grand's avatar Armin Le Grand

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/53171Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarArmin Le Grand <Armin.Le.Grand@cib.de>
üst 40180e56
...@@ -657,13 +657,22 @@ void ScOutputData::SetCellRotations() ...@@ -657,13 +657,22 @@ void ScOutputData::SetCellRotations()
// Needed for CellInfo internal decisions (bg fill, ...) // Needed for CellInfo internal decisions (bg fill, ...)
pInfo->nRotateDir = nDir; pInfo->nRotateDir = nDir;
// add rotation info to Array information // create target coordinates
const long nAttrRotate(pPattern->GetRotateVal(pCondSet)); const SCCOL nTargetX(nX - nVisX1 + 1);
const SvxRotateMode eRotMode(pPattern->GetItem(ATTR_ROTATE_MODE, pCondSet).GetValue()); const SCROW nTargetY(nY - nVisY1 + 1);
const double fOrient((bLayoutRTL ? -1.0 : 1.0) * nAttrRotate * F_PI18000); // 1/100th degrees -> [0..2PI]
svx::frame::Array& rArray = mrTabInfo.maArray;
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);
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment