summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/output.cxx
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2020-12-22 15:42:08 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-01-02 15:26:38 +0100
commit11e52fe2979b0947814a49b9c17ec373795cbf8e (patch)
tree48268579f052b7fdfcc2c334fffe8c91d29cb234 /sc/source/ui/view/output.cxx
parent610ceb05025c9c7a9a34dddcb0dac506b8eab441 (diff)
introduce Degree100 strong_int type
Change-Id: I78f837a1340be0ca5c49097f543a481b7b43a632 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108367 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/view/output.cxx')
-rw-r--r--sc/source/ui/view/output.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index d46c996a4bd1..1da5dff9a3f8 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -650,9 +650,9 @@ void ScOutputData::SetCellRotations()
if(nTargetX >= 0 && nTargetY >= 0)
{
// add rotation info to Array information
- const tools::Long nAttrRotate(pPattern->GetRotateVal(pCondSet));
+ const Degree100 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]
+ const double fOrient((bLayoutRTL ? -1.0 : 1.0) * toRadians(nAttrRotate)); // 1/100th degrees -> [0..2PI]
svx::frame::Array& rArray = mrTabInfo.maArray;
rArray.SetCellRotation(nTargetX, nTargetY, eRotMode, fOrient);
@@ -671,7 +671,7 @@ static ScRotateDir lcl_GetRotateDir( const ScDocument* pDoc, SCCOL nCol, SCROW n
ScRotateDir nRet = ScRotateDir::NONE;
- tools::Long nAttrRotate = pPattern->GetRotateVal( pCondSet );
+ Degree100 nAttrRotate = pPattern->GetRotateVal( pCondSet );
if ( nAttrRotate )
{
SvxRotateMode eRotMode =
@@ -683,7 +683,7 @@ static ScRotateDir lcl_GetRotateDir( const ScDocument* pDoc, SCCOL nCol, SCROW n
nRet = ScRotateDir::Center;
else if ( eRotMode == SVX_ROTATE_MODE_TOP || eRotMode == SVX_ROTATE_MODE_BOTTOM )
{
- tools::Long nRot180 = nAttrRotate % 18000; // 1/100 degree
+ tools::Long nRot180 = nAttrRotate.get() % 18000; // 1/100 degree
if ( nRot180 == 9000 )
nRet = ScRotateDir::Center;
else if ( ( eRotMode == SVX_ROTATE_MODE_TOP && nRot180 < 9000 ) ||
@@ -1549,7 +1549,7 @@ void ScOutputData::DrawRotatedFrame(vcl::RenderContext& rRenderContext)
//! LastPattern etc.
- tools::Long nAttrRotate = pPattern->GetRotateVal( pCondSet );
+ Degree100 nAttrRotate = pPattern->GetRotateVal( pCondSet );
SvxRotateMode eRotMode =
pPattern->GetItem(ATTR_ROTATE_MODE, pCondSet).GetValue();
@@ -1578,7 +1578,7 @@ void ScOutputData::DrawRotatedFrame(vcl::RenderContext& rRenderContext)
// inclusion of the sign here hasn't been decided yet
// (if not, the extension of the non-rotated background must also be changed)
- double nRealOrient = nLayoutSign * nAttrRotate * F_PI18000; // 1/100th degrees
+ double nRealOrient = nLayoutSign * toRadians(nAttrRotate); // 1/100th degrees
double nCos = cos(nRealOrient);
double nSin = sin(nRealOrient);
//! restrict !!!