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 /sd | |
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 'sd')
-rw-r--r-- | sd/source/core/drawdoc4.cxx | 4 | ||||
-rw-r--r-- | sd/source/filter/eppt/epptso.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/func/fuinsert.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/drviews9.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/view/outlview.cxx | 2 |
5 files changed, 10 insertions, 10 deletions
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx index f23ae2024a9e..db487a74471a 100644 --- a/sd/source/core/drawdoc4.cxx +++ b/sd/source/core/drawdoc4.cxx @@ -396,7 +396,7 @@ void SdDrawDocument::CreateLayoutTemplates() pISet = &pSheet->GetItemSet(); pISet->Put(XFillStyleItem(drawing::FillStyle_GRADIENT)); // fill with gradient aGradient.SetGradientStyle( ::awt::GradientStyle_RECT); // square type - aGradient.SetAngle( 0 ); // 0° angle + aGradient.SetAngle( Degree10(0) ); // 0° angle aGradient.SetStartColor( Color(0xcccccc) ); // white aGradient.SetEndColor( COL_WHITE ); // light gray 3 aFillGradient.SetName( aShapesName ); @@ -416,7 +416,7 @@ void SdDrawDocument::CreateLayoutTemplates() pISet = &pSheet->GetItemSet(); aGradient.SetGradientStyle( ::awt::GradientStyle_LINEAR ); - aGradient.SetAngle( 300 ); + aGradient.SetAngle( Degree10(300) ); aGradient.SetStartColor( COL_WHITE ); // white aGradient.SetEndColor( Color(0xcccccc) ); // light gray 3 aFillGradient.SetName( aName ); diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index 8f767df2e581..f775e1fbd063 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -1872,7 +1872,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a bool bNeedText = true; if ( mnAngle ) { - aPolygon.Rotate( aRect.TopLeft(), static_cast<sal_uInt16>( mnAngle / 10 ) ); + aPolygon.Rotate( aRect.TopLeft(), Degree10(static_cast<sal_Int16>( mnAngle / 10 )) ); if ( ImplGetText() ) { // #i119551# PPT does not support groups of polygons and text (MS patch KB2289187) diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx index be254381b54f..ce0d45082b3f 100644 --- a/sd/source/ui/func/fuinsert.cxx +++ b/sd/source/ui/func/fuinsert.cxx @@ -145,8 +145,8 @@ void FuInsertGraphic::DoExecute( SfxRequest& rReq ) GraphicNativeMetadata aMetadata; if ( aMetadata.read(aGraphic) ) { - 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,SdResId(STR_QUERYROTATION))); if (xQueryBox->run() == RET_YES) diff --git a/sd/source/ui/view/drviews9.cxx b/sd/source/ui/view/drviews9.cxx index 9fc1ddfa47e0..baeda924d957 100644 --- a/sd/source/ui/view/drviews9.cxx +++ b/sd/source/ui/view/drviews9.cxx @@ -545,7 +545,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) XGradient aGradient(pEntry->GetGradient()); aGradient.SetGradientStyle (static_cast<css::awt::GradientStyle>(pStyle->GetValue ())); - aGradient.SetAngle (pAngle->GetValue () * 10); + aGradient.SetAngle (Degree10(pAngle->GetValue () * 10)); aGradient.SetBorder (static_cast<short>(pBorder->GetValue ())); aGradient.SetXOffset (static_cast<short>(pCenterX->GetValue ())); aGradient.SetYOffset (static_cast<short>(pCenterY->GetValue ())); @@ -566,7 +566,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) { Color aBlack (0, 0, 0); XGradient aGradient (aBlack, aBlack, static_cast<css::awt::GradientStyle>(pStyle->GetValue ()), - pAngle->GetValue () * 10, static_cast<short>(pCenterX->GetValue ()), + Degree10(pAngle->GetValue () * 10), static_cast<short>(pCenterX->GetValue ()), static_cast<short>(pCenterY->GetValue ()), static_cast<short>(pBorder->GetValue ()), static_cast<short>(pStart->GetValue ()), static_cast<short>(pEnd->GetValue ())); @@ -623,7 +623,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) aHatch.SetHatchStyle (static_cast<css::drawing::HatchStyle>(pStyle->GetValue ())); aHatch.SetDistance (pDistance->GetValue ()); - aHatch.SetAngle (pAngle->GetValue () * 10); + aHatch.SetAngle (Degree10(pAngle->GetValue () * 10)); XFillStyleItem aStyleItem(drawing::FillStyle_HATCH); aStyleItem.SetWhich(XATTR_FILLSTYLE); @@ -638,7 +638,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq) if (i >= nCounts) { XHatch aHatch (Color(0), static_cast<css::drawing::HatchStyle>(pStyle->GetValue ()), pDistance->GetValue (), - pAngle->GetValue () * 10); + Degree10(pAngle->GetValue () * 10)); pHatchList->Insert(std::make_unique<XHatchEntry>(aHatch, pName->GetValue())); XFillStyleItem aStyleItem(drawing::FillStyle_HATCH); diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index 544dca087d9e..11a7d332da8b 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -1588,7 +1588,7 @@ IMPL_LINK(OutlineView, PaintingFirstLineHdl, PaintFirstLineInfo*, pInfo, void) vcl::Font aNewFont( OutputDevice::GetDefaultFont( DefaultFontType::SANS_UNICODE, eLang, GetDefaultFontFlags::NONE ) ); aNewFont.SetFontSize( aFontSz ); aNewFont.SetVertical( bVertical ); - aNewFont.SetOrientation( bVertical ? 2700 : 0 ); + aNewFont.SetOrientation( Degree10(bVertical ? 2700 : 0) ); aNewFont.SetColor( COL_AUTO ); pInfo->mpOutDev->SetFont( aNewFont ); OUString aPageText = OUString::number( nPage ); |