diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-10-20 07:27:44 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-21 08:13:05 +0200 |
commit | 0fb58a1ff168ae122e9c8993a3136658e3b0e3f0 (patch) | |
tree | 908983b02f466e0a49599edc70aaa1baaa240371 /sc | |
parent | b84afd2188d6993c91081885dc24664bd3f1cc73 (diff) |
new tools::Degree10 strong typedef
partly to flush some use of "long" out the codebase,
but also to make it obvious which units are being used
for angle values.
Change-Id: I1dc22494ca42c4677a63f685d5903f2b89886dc2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104548
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/drawfunc/fuins1.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/output.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/output2.cxx | 14 |
3 files changed, 11 insertions, 11 deletions
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx index 617532f7e434..4187300e3428 100644 --- a/sc/source/ui/drawfunc/fuins1.cxx +++ b/sc/source/ui/drawfunc/fuins1.cxx @@ -108,8 +108,8 @@ static void lcl_InsertGraphic( const Graphic& rGraphic, GraphicNativeMetadata aMetadata; if ( aMetadata.read(rGraphic1) ) { - const sal_uInt16 aRotation = aMetadata.getRotation(); - if (aRotation != 0) + const Degree10 aRotation = aMetadata.getRotation(); + if (aRotation) { std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(nullptr, VclMessageType::Question,VclButtonsType::YesNo,ScResId(STR_QUERYROTATION))); if (xQueryBox->run() == RET_YES) diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 65e89742b7bc..c44ae0e2c095 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -862,9 +862,9 @@ void drawDataBars(vcl::RenderContext& rRenderContext, const ScDataBarInfo* pOldD aGradient.SetSteps(255); if(pOldDataBarInfo->mnLength < 0) - aGradient.SetAngle(2700); + aGradient.SetAngle(Degree10(2700)); else - aGradient.SetAngle(900); + aGradient.SetAngle(Degree10(900)); rRenderContext.DrawGradient(aPaintRect, aGradient); diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index c25d8abb908f..50fbbd2070c1 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -356,7 +356,7 @@ void ScDrawStringsVars::SetPattern( eAttrHorJust = SvxCellHorJustify::Standard; } - short nRot; + sal_Int16 nRot; switch (eAttrOrient) { case SvxCellOrientation::Standard: @@ -382,7 +382,7 @@ void ScDrawStringsVars::SetPattern( bRotated = false; break; } - aFont.SetOrientation( nRot ); + aFont.SetOrientation( Degree10(nRot) ); // syntax mode @@ -3453,7 +3453,7 @@ void ScOutputData::DrawEditBottomTop(DrawEditParam& rParam) } } - rParam.mpEngine->Draw(mpDev, aLogicStart, 900); + rParam.mpEngine->Draw(mpDev, aLogicStart, Degree10(900)); } rParam.adjustForHyperlinkInPDF(aURLStart, mpDev); @@ -3690,7 +3690,7 @@ void ScOutputData::DrawEditTopBottom(DrawEditParam& rParam) // bMoveClipped handling has been replaced by complete alignment // handling (also extending to the left). - rParam.mpEngine->Draw(mpDev, aLogicStart, 2700); + rParam.mpEngine->Draw(mpDev, aLogicStart, Degree10(2700)); } rParam.adjustForHyperlinkInPDF(aURLStart, mpDev); @@ -4999,10 +4999,10 @@ void ScOutputData::DrawRotated(bool bPixelToLogic) OSL_ENSURE( eOrient == SvxCellOrientation::Standard && nAttrRotate, "DrawRotated: no rotation" ); - tools::Long nOriVal = 0; + sal_Int16 nOriVal = 0; if ( nAttrRotate ) { - // attribute is 1/100, Font 1/10 Grad + // attribute is 1/100, Font 1/10 degrees nOriVal = nAttrRotate / 10; double nAddX = 0.0; @@ -5055,7 +5055,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic) // bSimClip is not used here (because nOriVal is set) - pEngine->Draw( mpDev, aLogicStart, static_cast<short>(nOriVal) ); + pEngine->Draw( mpDev, aLogicStart, Degree10(nOriVal) ); if (bMetaFile) mpDev->Pop(); |