[Libreoffice-commits] core.git: canvas/source cppcanvas/source cui/source desktop/source drawinglayer/source editeng/source emfio/source filter/source include/editeng include/o3tl include/svl include/svx include/tools include/vcl offapi/com oox/source reportdesign/source sc/source sd/source sfx2/source slideshow/source svl/source svtools/source svx/source sw/source toolkit/source tools/source vcl/backendtest vcl/headless vcl/inc vcl/opengl vcl/qa vcl/qt5 vcl/quartz vcl/skia vcl/source vcl/unx vcl/win vcl/workben
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Wed Oct 21 06:13:55 UTC 2020
canvas/source/cairo/cairo_canvashelper_text.cxx | 2
canvas/source/vcl/canvashelper.cxx | 2
canvas/source/vcl/canvashelper_texturefill.cxx | 2
canvas/source/vcl/impltools.cxx | 2
cppcanvas/source/mtfrenderer/implrenderer.cxx | 2
cppcanvas/source/mtfrenderer/textaction.cxx | 2
cui/source/tabpages/chardlg.cxx | 4
cui/source/tabpages/tpgradnt.cxx | 12 -
cui/source/tabpages/tphatch.cxx | 10 -
cui/source/tabpages/tptrans.cxx | 6
desktop/source/lib/init.cxx | 2
drawinglayer/source/primitive2d/graphicprimitive2d.cxx | 2
drawinglayer/source/primitive2d/textlayoutdevice.cxx | 2
drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx | 7 -
drawinglayer/source/processor2d/vclpixelprocessor2d.cxx | 5
drawinglayer/source/tools/wmfemfhelper.cxx | 8 -
editeng/source/editeng/editdoc.cxx | 2
editeng/source/editeng/editeng.cxx | 4
editeng/source/editeng/impedit.cxx | 2
editeng/source/editeng/impedit.hxx | 4
editeng/source/editeng/impedit3.cxx | 10 -
editeng/source/items/textitem.cxx | 18 +-
editeng/source/outliner/outleeng.cxx | 2
editeng/source/outliner/outleeng.hxx | 2
editeng/source/outliner/outliner.cxx | 6
editeng/source/rtf/rtfitem.cxx | 2
editeng/source/uno/unofdesc.cxx | 4
emfio/source/reader/mtftools.cxx | 7 -
filter/source/graphicfilter/eps/eps.cxx | 10 -
filter/source/graphicfilter/idxf/dxf2mtf.cxx | 2
filter/source/graphicfilter/ios2met/ios2met.cxx | 16 +-
filter/source/msfilter/escherex.cxx | 7 -
filter/source/msfilter/eschesdo.cxx | 2
filter/source/msfilter/msdffimp.cxx | 6
filter/source/pdf/pdfexport.cxx | 4
filter/source/svg/svgwriter.cxx | 8 -
include/editeng/charrotateitem.hxx | 16 +-
include/editeng/editeng.hxx | 5
include/editeng/outliner.hxx | 2
include/o3tl/strong_int.hxx | 5
include/svl/imageitm.hxx | 15 +-
include/svx/xgrad.hxx | 9 -
include/svx/xhatch.hxx | 9 -
include/tools/degree.hxx | 18 ++
include/tools/gen.hxx | 5
include/tools/poly.hxx | 5
include/vcl/GraphicAttributes.hxx | 9 -
include/vcl/GraphicNativeMetadata.hxx | 7 -
include/vcl/GraphicNativeTransform.hxx | 9 -
include/vcl/bitmap.hxx | 3
include/vcl/bitmapex.hxx | 3
include/vcl/cursor.hxx | 4
include/vcl/font.hxx | 5
include/vcl/gdimtf.hxx | 2
include/vcl/gradient.hxx | 5
include/vcl/hatch.hxx | 9 -
include/vcl/outdev.hxx | 6
include/vcl/toolbox.hxx | 5
include/vcl/vcllayout.hxx | 5
offapi/com/sun/star/drawing/Hatch.idl | 1
oox/source/drawingml/fillproperties.cxx | 4
oox/source/export/shapes.cxx | 2
reportdesign/source/ui/misc/UITools.cxx | 4
sc/source/ui/drawfunc/fuins1.cxx | 4
sc/source/ui/view/output.cxx | 4
sc/source/ui/view/output2.cxx | 14 +-
sd/source/core/drawdoc4.cxx | 4
sd/source/filter/eppt/epptso.cxx | 2
sd/source/ui/func/fuinsert.cxx | 4
sd/source/ui/view/drviews9.cxx | 8 -
sd/source/ui/view/outlview.cxx | 2
sfx2/source/sidebar/Tools.cxx | 4
slideshow/source/engine/shapes/shapeimporter.cxx | 2
svl/source/items/imageitm.cxx | 59 ++-------
svtools/source/control/ruler.cxx | 6
svx/source/customshapes/EnhancedCustomShapeFontWork.cxx | 6
svx/source/dialog/dialcontrol.cxx | 2
svx/source/dialog/rubydialog.cxx | 2
svx/source/fmcomp/fmgridif.cxx | 4
svx/source/sdr/primitive2d/sdrattributecreator.cxx | 6
svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx | 2
svx/source/sidebar/area/AreaPropertyPanelBase.cxx | 8 -
svx/source/sidebar/area/AreaTransparencyGradientPopup.cxx | 6
svx/source/svdraw/gradtrns.cxx | 16 +-
svx/source/svdraw/svdattr.cxx | 2
svx/source/svdraw/svdfmtf.cxx | 2
svx/source/svdraw/svdoashp.cxx | 2
svx/source/svdraw/svdograf.cxx | 2
svx/source/svdraw/svdotextdecomposition.cxx | 2
svx/source/svdraw/svdpdf.cxx | 2
svx/source/table/cell.cxx | 4
svx/source/unodraw/XPropertyTable.cxx | 6
svx/source/xoutdev/xattr.cxx | 26 ++--
svx/source/xoutdev/xtabgrdt.cxx | 14 +-
svx/source/xoutdev/xtabhtch.cxx | 8 -
sw/source/core/bastyp/init.cxx | 2
sw/source/core/crsr/viscrs.cxx | 2
sw/source/core/doc/DocumentStylePoolManager.cxx | 2
sw/source/core/graphic/ndgrf.cxx | 2
sw/source/core/inc/drawfont.hxx | 2
sw/source/core/inc/swfont.hxx | 10 -
sw/source/core/layout/paintfrm.cxx | 2
sw/source/core/text/atrstck.cxx | 4
sw/source/core/text/frmpaint.cxx | 4
sw/source/core/text/inftxt.cxx | 16 +-
sw/source/core/text/itrform2.cxx | 12 -
sw/source/core/text/porlin.cxx | 6
sw/source/core/text/pormulti.cxx | 4
sw/source/core/text/porrst.cxx | 4
sw/source/core/text/txtdrop.cxx | 4
sw/source/core/text/txttab.cxx | 4
sw/source/core/txtnode/fntcache.cxx | 10 -
sw/source/core/txtnode/swfont.cxx | 84 ++++++-------
sw/source/filter/ww8/docxattributeoutput.cxx | 4
sw/source/filter/ww8/wrtww8.cxx | 4
sw/source/filter/ww8/ww8par6.cxx | 2
sw/source/uibase/dochdl/swdtflvr.cxx | 4
sw/source/uibase/shells/basesh.cxx | 2
sw/source/uibase/uiview/view2.cxx | 4
sw/source/uibase/uiview/viewstat.cxx | 2
toolkit/source/awt/vclxgraphics.cxx | 2
toolkit/source/helper/vclunohelper.cxx | 4
tools/source/generic/point.cxx | 16 +-
tools/source/generic/poly.cxx | 6
tools/source/generic/poly2.cxx | 6
vcl/backendtest/outputdevice/gradient.cxx | 8 -
vcl/headless/svpgdi.cxx | 4
vcl/inc/fontinstance.hxx | 5
vcl/inc/fontselect.hxx | 3
vcl/inc/impfont.hxx | 2
vcl/inc/impfontmetricdata.hxx | 6
vcl/inc/sallayout.hxx | 5
vcl/inc/toolbox.h | 2
vcl/inc/unx/printergfx.hxx | 6
vcl/opengl/gdiimpl.cxx | 4
vcl/qa/cppunit/GraphicNativeMetadataTest.cxx | 12 -
vcl/qa/cppunit/TypeSerializerTest.cxx | 4
vcl/qa/cppunit/svm/svmtest.cxx | 4
vcl/qt5/Qt5Graphics_Text.cxx | 8 -
vcl/quartz/ctfonts.cxx | 2
vcl/skia/gdiimpl.cxx | 14 +-
vcl/source/bitmap/bitmappaint.cxx | 20 +--
vcl/source/control/fixed.cxx | 2
vcl/source/filter/GraphicNativeTransform.cxx | 15 +-
vcl/source/filter/jpeg/Exif.cxx | 12 -
vcl/source/filter/jpeg/Exif.hxx | 3
vcl/source/filter/jpeg/JpegTransform.cxx | 2
vcl/source/filter/jpeg/JpegTransform.hxx | 4
vcl/source/filter/jpeg/jpeg.h | 2
vcl/source/filter/jpeg/jpegc.cxx | 4
vcl/source/filter/wmf/emfwr.cxx | 2
vcl/source/filter/wmf/wmfwr.cxx | 2
vcl/source/font/PhysicalFontFace.cxx | 2
vcl/source/font/font.cxx | 9 -
vcl/source/font/fontselect.cxx | 10 -
vcl/source/gdi/TypeSerializer.cxx | 4
vcl/source/gdi/bitmapex.cxx | 2
vcl/source/gdi/gdimtf.cxx | 12 -
vcl/source/gdi/gradient.cxx | 12 -
vcl/source/gdi/hatch.cxx | 9 -
vcl/source/gdi/mtfxmldump.cxx | 6
vcl/source/gdi/pdfwriter_impl.cxx | 16 +-
vcl/source/gdi/sallayout.cxx | 6
vcl/source/gdi/svmconverter.cxx | 4
vcl/source/gdi/wall.cxx | 2
vcl/source/graphic/GraphicObject.cxx | 4
vcl/source/graphic/GraphicObject2.cxx | 2
vcl/source/outdev/bitmap.cxx | 2
vcl/source/outdev/font.cxx | 4
vcl/source/outdev/gradient.cxx | 8 -
vcl/source/outdev/hatch.cxx | 26 ++--
vcl/source/outdev/text.cxx | 14 +-
vcl/source/outdev/textline.cxx | 10 -
vcl/source/window/cursor.cxx | 6
vcl/source/window/printdlg.cxx | 2
vcl/source/window/toolbox.cxx | 6
vcl/source/window/toolbox2.cxx | 12 -
vcl/unx/generic/gdi/cairotextrender.cxx | 6
vcl/unx/generic/glyphs/freetype_glyphcache.cxx | 4
vcl/unx/generic/print/common_gfx.cxx | 10 -
vcl/unx/generic/print/text_gfx.cxx | 12 -
vcl/win/gdi/DWriteTextRenderer.cxx | 4
vcl/win/gdi/salfont.cxx | 4
vcl/workben/svptest.cxx | 4
vcl/workben/vcldemo.cxx | 10 -
185 files changed, 626 insertions(+), 600 deletions(-)
New commits:
commit 0fb58a1ff168ae122e9c8993a3136658e3b0e3f0
Author: Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Tue Oct 20 07:27:44 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Oct 21 08:13:05 2020 +0200
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 at collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/canvas/source/cairo/cairo_canvashelper_text.cxx b/canvas/source/cairo/cairo_canvashelper_text.cxx
index 258ba6a3166f..912e3b678ca8 100644
--- a/canvas/source/cairo/cairo_canvashelper_text.cxx
+++ b/canvas/source/cairo/cairo_canvashelper_text.cxx
@@ -100,7 +100,7 @@ namespace cairocanvas
io_rVCLFont.SetFontHeight( ::basegfx::fround(nFontHeight * aScale.getY()) );
}
- io_rVCLFont.SetOrientation( static_cast< short >( ::basegfx::fround(-fmod(nRotate, 2*M_PI)*(1800.0/M_PI)) ) );
+ io_rVCLFont.SetOrientation( Degree10(static_cast< sal_Int16 >( ::basegfx::fround(-fmod(nRotate, 2*M_PI)*(1800.0/M_PI)) )) );
// TODO(F2): Missing functionality in VCL: shearing
o_rPoint.setX( ::basegfx::fround(aTranslate.getX()) );
diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx
index 0e759d4fbe61..e56a273a1fe1 100644
--- a/canvas/source/vcl/canvashelper.cxx
+++ b/canvas/source/vcl/canvashelper.cxx
@@ -773,7 +773,7 @@ namespace vclcanvas
// (3600,0]. Note that the original angle may have
// values outside the [0,2Pi) interval.
const double nAngleInTenthOfDegrees (3600.0 - nRotate * 3600.0 / (2*M_PI));
- aGrfAttr.SetRotation( static_cast< sal_uInt16 >(::basegfx::fround(nAngleInTenthOfDegrees)) );
+ aGrfAttr.SetRotation( Degree10(::basegfx::fround(nAngleInTenthOfDegrees)) );
pGrfObj = std::make_shared<GraphicObject>( aBmpEx );
}
diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx
index 9cb8dd8abd99..81d97138b22c 100644
--- a/canvas/source/vcl/canvashelper_texturefill.cxx
+++ b/canvas/source/vcl/canvashelper_texturefill.cxx
@@ -754,7 +754,7 @@ namespace vclcanvas
// (3600,0]. Note that the original angle may have
// values outside the [0,2Pi) interval.
const double nAngleInTenthOfDegrees (3600.0 - nRotate * 3600.0 / (2*M_PI));
- aGrfAttr.SetRotation( static_cast< sal_uInt16 >(::basegfx::fround(nAngleInTenthOfDegrees)) );
+ aGrfAttr.SetRotation( Degree10(::basegfx::fround(nAngleInTenthOfDegrees)) );
pGrfObj = std::make_shared<GraphicObject>( aBmpEx );
}
diff --git a/canvas/source/vcl/impltools.cxx b/canvas/source/vcl/impltools.cxx
index a76fefcb40c7..800ad3128342 100644
--- a/canvas/source/vcl/impltools.cxx
+++ b/canvas/source/vcl/impltools.cxx
@@ -126,7 +126,7 @@ namespace vclcanvas::tools
io_rVCLFont.SetFontHeight( ::basegfx::fround(nFontHeight * aScale.getY()) );
}
- io_rVCLFont.SetOrientation( static_cast< short >( ::basegfx::fround(-fmod(nRotate, 2*M_PI)*(1800.0/M_PI)) ) );
+ io_rVCLFont.SetOrientation( Degree10( ::basegfx::fround(-fmod(nRotate, 2*M_PI)*(1800.0/M_PI)) ) );
// TODO(F2): Missing functionality in VCL: shearing
o_rPoint.setX( ::basegfx::fround(aTranslate.getX()) );
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index efd276991370..c78b958f31f5 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -574,7 +574,7 @@ namespace cppcanvas::internal
const ::basegfx::B2DVector aOffset(
rGradient.GetOfsX() / 100.0,
rGradient.GetOfsY() / 100.0);
- double fRotation( rGradient.GetAngle() * M_PI / 1800.0 );
+ double fRotation( rGradient.GetAngle().get() * M_PI / 1800.0 );
const double fBorder( rGradient.GetBorder() / 100.0 );
basegfx::B2DHomMatrix aRot90;
diff --git a/cppcanvas/source/mtfrenderer/textaction.cxx b/cppcanvas/source/mtfrenderer/textaction.cxx
index 42621e819455..408b180ecf58 100644
--- a/cppcanvas/source/mtfrenderer/textaction.cxx
+++ b/cppcanvas/source/mtfrenderer/textaction.cxx
@@ -2005,7 +2005,7 @@ namespace cppcanvas::internal
// will be rotated twice)
const vcl::Font aOrigFont( rVDev.GetFont() );
vcl::Font aUnrotatedFont( aOrigFont );
- aUnrotatedFont.SetOrientation(0);
+ aUnrotatedFont.SetOrientation(Degree10(0));
rVDev.SetFont( aUnrotatedFont );
// TODO(F3): Don't understand parameter semantics of
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index a7162eca0817..b7f9b17165fc 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -2830,7 +2830,7 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet )
m_x270degRB->set_active(true);
else
{
- DBG_ASSERT( 0 == rItem.GetValue(), "incorrect value" );
+ DBG_ASSERT( Degree10(0) == rItem.GetValue(), "incorrect value" );
m_x0degRB->set_active(true);
}
m_xFitToLineCB->set_active(rItem.IsFitToLine());
@@ -2977,7 +2977,7 @@ bool SvxCharPositionPage::FillItemSet( SfxItemSet* rSet )
m_x270degRB->get_state_changed_from_saved() ||
m_xFitToLineCB->get_state_changed_from_saved() )
{
- SvxCharRotateItem aItem( 0, m_xFitToLineCB->get_active(), nWhich );
+ SvxCharRotateItem aItem( Degree10(0), m_xFitToLineCB->get_active(), nWhich );
if (m_x90degRB->get_active())
aItem.SetBottomToTop();
else if (m_x270degRB->get_active())
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index 6540dfde1a5e..32deb5ae8fd2 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -193,7 +193,7 @@ bool SvxGradientTabPage::FillItemSet( SfxItemSet* rSet )
pXGradient.reset(new XGradient( m_xLbColorFrom->GetSelectEntryColor(),
m_xLbColorTo->GetSelectEntryColor(),
static_cast<css::awt::GradientStyle>(m_xLbGradientType->get_active()),
- static_cast<long>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10), // should be changed in resource
+ Degree10(static_cast<sal_Int16>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10)), // should be changed in resource
static_cast<sal_uInt16>(m_xMtrCenterX->get_value(FieldUnit::NONE)),
static_cast<sal_uInt16>(m_xMtrCenterY->get_value(FieldUnit::NONE)),
static_cast<sal_uInt16>(m_xMtrBorder->get_value(FieldUnit::NONE)),
@@ -291,7 +291,7 @@ void SvxGradientTabPage::ModifiedHdl_Impl( void const * pControl )
XGradient aXGradient( m_xLbColorFrom->GetSelectEntryColor(),
m_xLbColorTo->GetSelectEntryColor(),
eXGS,
- static_cast<long>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10), // should be changed in resource
+ Degree10(static_cast<sal_Int16>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10)), // should be changed in resource
static_cast<sal_uInt16>(m_xMtrCenterX->get_value(FieldUnit::NONE)),
static_cast<sal_uInt16>(m_xMtrCenterY->get_value(FieldUnit::NONE)),
static_cast<sal_uInt16>(m_xMtrBorder->get_value(FieldUnit::NONE)),
@@ -358,7 +358,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl, weld::Button&, void)
XGradient aXGradient( m_xLbColorFrom->GetSelectEntryColor(),
m_xLbColorTo->GetSelectEntryColor(),
static_cast<css::awt::GradientStyle>(m_xLbGradientType->get_active()),
- static_cast<long>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10), // should be changed in resource
+ Degree10(static_cast<sal_Int16>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10)), // should be changed in resource
static_cast<sal_uInt16>(m_xMtrCenterX->get_value(FieldUnit::NONE)),
static_cast<sal_uInt16>(m_xMtrCenterY->get_value(FieldUnit::NONE)),
static_cast<sal_uInt16>(m_xMtrBorder->get_value(FieldUnit::NONE)),
@@ -398,7 +398,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickModifyHdl_Impl, weld::Button&, void)
XGradient aXGradient( m_xLbColorFrom->GetSelectEntryColor(),
m_xLbColorTo->GetSelectEntryColor(),
static_cast<css::awt::GradientStyle>(m_xLbGradientType->get_active()),
- static_cast<long>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10), // should be changed in resource
+ Degree10(static_cast<sal_Int16>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10)), // should be changed in resource
static_cast<sal_uInt16>(m_xMtrCenterX->get_value(FieldUnit::NONE)),
static_cast<sal_uInt16>(m_xMtrCenterY->get_value(FieldUnit::NONE)),
static_cast<sal_uInt16>(m_xMtrBorder->get_value(FieldUnit::NONE)),
@@ -543,8 +543,8 @@ void SvxGradientTabPage::ChangeGradientHdl_Impl()
m_xLbColorTo->SetNoSelection();
m_xLbColorTo->SelectEntry( pGradient->GetEndColor() );
- m_xMtrAngle->set_value(pGradient->GetAngle() / 10, FieldUnit::NONE); // should be changed in resource
- m_xSliderAngle->set_value(pGradient->GetAngle() / 10);
+ m_xMtrAngle->set_value(pGradient->GetAngle().get() / 10, FieldUnit::NONE); // should be changed in resource
+ m_xSliderAngle->set_value(pGradient->GetAngle().get() / 10);
m_xMtrBorder->set_value(pGradient->GetBorder(), FieldUnit::NONE);
m_xSliderBorder->set_value(pGradient->GetBorder());
m_xMtrCenterX->set_value(pGradient->GetXOffset(), FieldUnit::NONE);
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index b0a6753db997..3be0005ef62a 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -232,7 +232,7 @@ bool SvxHatchTabPage::FillItemSet( SfxItemSet* rSet )
pXHatch.reset(new XHatch( m_xLbLineColor->GetSelectEntryColor(),
static_cast<css::drawing::HatchStyle>(m_xLbLineType->get_active()),
GetCoreValue( *m_xMtrDistance, m_ePoolUnit ),
- static_cast<long>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10) ));
+ Degree10(static_cast<sal_Int16>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10)) ));
}
assert( pXHatch && "XHatch couldn't be created" );
rSet->Put( XFillStyleItem( drawing::FillStyle_HATCH ) );
@@ -332,7 +332,7 @@ void SvxHatchTabPage::ModifiedHdl_Impl( void const * p )
XHatch aXHatch( m_xLbLineColor->GetSelectEntryColor(),
static_cast<css::drawing::HatchStyle>(m_xLbLineType->get_active()),
GetCoreValue( *m_xMtrDistance, m_ePoolUnit ),
- static_cast<long>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10) );
+ Degree10(static_cast<sal_Int16>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10)) );
m_rXFSet.Put( XFillHatchItem( OUString(), aXHatch ) );
@@ -378,7 +378,7 @@ void SvxHatchTabPage::ChangeHatchHdl_Impl()
m_xLbLineColor->SetNoSelection();
m_xLbLineColor->SelectEntry( pHatch->GetColor() );
SetMetricValue( *m_xMtrDistance, pHatch->GetDistance(), m_ePoolUnit );
- long nHatchAngle = pHatch->GetAngle() / 10;
+ long nHatchAngle = pHatch->GetAngle().get() / 10;
m_xMtrAngle->set_value(nHatchAngle, FieldUnit::NONE);
m_xSliderAngle->set_value(nHatchAngle);
@@ -440,7 +440,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl, weld::Button&, void)
XHatch aXHatch( m_xLbLineColor->GetSelectEntryColor(),
static_cast<css::drawing::HatchStyle>(m_xLbLineType->get_active()),
GetCoreValue( *m_xMtrDistance, m_ePoolUnit ),
- static_cast<long>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10) );
+ Degree10(static_cast<sal_Int16>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10)) );
m_pHatchingList->Insert(std::make_unique<XHatchEntry>(aXHatch, aName), nCount);
@@ -469,7 +469,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickModifyHdl_Impl, weld::Button&, void)
XHatch aXHatch( m_xLbLineColor->GetSelectEntryColor(),
static_cast<css::drawing::HatchStyle>(m_xLbLineType->get_active()),
GetCoreValue( *m_xMtrDistance, m_ePoolUnit ),
- static_cast<long>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10) );
+ Degree10(static_cast<sal_Int16>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10)) );
m_pHatchingList->Replace(std::make_unique<XHatchEntry>(aXHatch, aName), nPos);
diff --git a/cui/source/tabpages/tptrans.cxx b/cui/source/tabpages/tptrans.cxx
index ac950ceb3a2e..6aa38b8df941 100644
--- a/cui/source/tabpages/tptrans.cxx
+++ b/cui/source/tabpages/tptrans.cxx
@@ -130,7 +130,7 @@ void SvxTransparenceTabPage::ModifiedTrgrHdl_Impl(const weld::ComboBox* pControl
Color(nStartCol, nStartCol, nStartCol),
Color(nEndCol, nEndCol, nEndCol),
static_cast<css::awt::GradientStyle>(m_xLbTrgrGradientType->get_active()),
- static_cast<sal_uInt16>(m_xMtrTrgrAngle->get_value(FieldUnit::DEGREE)) * 10,
+ Degree10(static_cast<sal_Int16>(m_xMtrTrgrAngle->get_value(FieldUnit::DEGREE)) * 10),
static_cast<sal_uInt16>(m_xMtrTrgrCenterX->get_value(FieldUnit::PERCENT)),
static_cast<sal_uInt16>(m_xMtrTrgrCenterY->get_value(FieldUnit::PERCENT)),
static_cast<sal_uInt16>(m_xMtrTrgrBorder->get_value(FieldUnit::PERCENT)),
@@ -301,7 +301,7 @@ bool SvxTransparenceTabPage::FillItemSet(SfxItemSet* rAttrs)
Color(nStartCol, nStartCol, nStartCol),
Color(nEndCol, nEndCol, nEndCol),
static_cast<css::awt::GradientStyle>(m_xLbTrgrGradientType->get_active()),
- static_cast<sal_uInt16>(m_xMtrTrgrAngle->get_value(FieldUnit::DEGREE)) * 10,
+ Degree10(static_cast<sal_Int16>(m_xMtrTrgrAngle->get_value(FieldUnit::DEGREE)) * 10),
static_cast<sal_uInt16>(m_xMtrTrgrCenterX->get_value(FieldUnit::PERCENT)),
static_cast<sal_uInt16>(m_xMtrTrgrCenterY->get_value(FieldUnit::PERCENT)),
static_cast<sal_uInt16>(m_xMtrTrgrBorder->get_value(FieldUnit::PERCENT)),
@@ -368,7 +368,7 @@ void SvxTransparenceTabPage::Reset(const SfxItemSet* rAttrs)
const XGradient& rGradient = static_cast<const XFillFloatTransparenceItem*>(pGradientItem)->GetGradientValue();
css::awt::GradientStyle eXGS(rGradient.GetGradientStyle());
m_xLbTrgrGradientType->set_active(sal::static_int_cast< sal_Int32 >(eXGS));
- m_xMtrTrgrAngle->set_value(rGradient.GetAngle() / 10, FieldUnit::DEGREE);
+ m_xMtrTrgrAngle->set_value(rGradient.GetAngle().get() / 10, FieldUnit::DEGREE);
m_xMtrTrgrBorder->set_value(rGradient.GetBorder(), FieldUnit::PERCENT);
m_xMtrTrgrCenterX->set_value(rGradient.GetXOffset(), FieldUnit::PERCENT);
m_xMtrTrgrCenterY->set_value(rGradient.GetYOffset(), FieldUnit::PERCENT);
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index a05da99d47a6..34a9893bb134 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -5284,7 +5284,7 @@ unsigned char* doc_renderFontOrientation(SAL_UNUSED_PARAMETER LibreOfficeKitDocu
::tools::Rectangle aRect;
vcl::Font aFont(rFontMetric);
aFont.SetFontSize(Size(0, nDefaultFontSize));
- aFont.SetOrientation(pOrientation);
+ aFont.SetOrientation(Degree10(pOrientation));
aDevice->SetFont(aFont);
aDevice->GetTextBoundRect(aRect, aText);
if (aRect.IsEmpty())
diff --git a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
index f86b1585b13f..9de4b8a80e64 100644
--- a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
@@ -68,7 +68,7 @@ void GraphicPrimitive2D::create2DDecomposition(Primitive2DContainer& rContainer,
GraphicAttr aSuppressGraphicAttr(getGraphicAttr());
aSuppressGraphicAttr.SetCrop(0, 0, 0, 0);
- aSuppressGraphicAttr.SetRotation(0);
+ aSuppressGraphicAttr.SetRotation(Degree10(0));
aSuppressGraphicAttr.SetMirrorFlags(BmpMirrorFlags::NONE);
aSuppressGraphicAttr.SetTransparency(0);
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
index b8ac0bf73c85..e34fe1822fa4 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
@@ -431,7 +431,7 @@ namespace drawinglayer::primitive2d
if(!basegfx::fTools::equalZero(fFontRotation))
{
sal_Int16 aRotate10th(static_cast<sal_Int16>(fFontRotation * (-1800.0/F_PI)));
- aRetval.SetOrientation(aRotate10th % 3600);
+ aRetval.SetOrientation(Degree10(aRotate10th % 3600));
}
return aRetval;
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 70c4f2ab561e..13883b50412f 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -276,7 +276,8 @@ void VclMetafileProcessor2D::impConvertFillGradientAttributeToVCLGradient(
Color(maBColorModifierStack.getModifiedColor(rFiGrAtt.getEndColor())));
}
- o_rVCLGradient.SetAngle(static_cast<sal_uInt16>(rFiGrAtt.getAngle() * (1.0 / F_PI1800)));
+ o_rVCLGradient.SetAngle(
+ Degree10(static_cast<sal_uInt16>(rFiGrAtt.getAngle() * (1.0 / F_PI1800))));
o_rVCLGradient.SetBorder(static_cast<sal_uInt16>(rFiGrAtt.getBorder() * 100.0));
o_rVCLGradient.SetOfsX(static_cast<sal_uInt16>(rFiGrAtt.getOffsetX() * 100.0));
o_rVCLGradient.SetOfsY(static_cast<sal_uInt16>(rFiGrAtt.getOffsetY() * 100.0));
@@ -1860,7 +1861,7 @@ void VclMetafileProcessor2D::processPolyPolygonHatchPrimitive2D(
Hatch(aHatchStyle,
Color(maBColorModifierStack.getModifiedColor(rFillHatchAttribute.getColor())),
basegfx::fround(rFillHatchAttribute.getDistance()),
- basegfx::fround(rFillHatchAttribute.getAngle() / F_PI1800)));
+ Degree10(basegfx::fround(rFillHatchAttribute.getAngle() / F_PI1800))));
impEndSvtGraphicFill(pSvtGraphicFill.get());
}
@@ -2131,7 +2132,7 @@ void VclMetafileProcessor2D::processUnifiedTransparencePrimitive2D(
aVCLGradient.SetStyle(GradientStyle::Linear);
aVCLGradient.SetStartColor(aTransColor);
aVCLGradient.SetEndColor(aTransColor);
- aVCLGradient.SetAngle(0);
+ aVCLGradient.SetAngle(Degree10(0));
aVCLGradient.SetBorder(0);
aVCLGradient.SetOfsX(0);
aVCLGradient.SetOfsY(0);
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index ac1efe4d95b3..1e5a04baf30d 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -840,7 +840,8 @@ void VclPixelProcessor2D::processFillHatchPrimitive2D(
const sal_uInt32 nDistance(basegfx::fround(aDiscreteDistance.getLength()));
const sal_uInt16 nAngle10(
static_cast<sal_uInt16>(basegfx::fround(rFillHatchAttributes.getAngle() / F_PI1800)));
- ::Hatch aVCLHatch(eHatchStyle, Color(rFillHatchAttributes.getColor()), nDistance, nAngle10);
+ ::Hatch aVCLHatch(eHatchStyle, Color(rFillHatchAttributes.getColor()), nDistance,
+ Degree10(nAngle10));
// draw hatch using VCL
mpOutputDevice->DrawHatch(::tools::PolyPolygon(::tools::Polygon(aHatchPolygon)), aVCLHatch);
@@ -1206,7 +1207,7 @@ void VclPixelProcessor2D::processFillGradientPrimitive2D(
Gradient aGradient(eGradientStyle, Color(rFillGradient.getStartColor()),
Color(rFillGradient.getEndColor()));
- aGradient.SetAngle(rFillGradient.getAngle() / F_PI1800);
+ aGradient.SetAngle(Degree10(static_cast<int>(rFillGradient.getAngle() / F_PI1800)));
aGradient.SetBorder(rFillGradient.getBorder() * 100);
aGradient.SetOfsX(rFillGradient.getOffsetX() * 100.0);
aGradient.SetOfsY(rFillGradient.getOffsetY() * 100.0);
diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx
index 7fd3d8c9a2a8..60bf9ea6ae9f 100644
--- a/drawinglayer/source/tools/wmfemfhelper.cxx
+++ b/drawinglayer/source/tools/wmfemfhelper.cxx
@@ -753,7 +753,7 @@ namespace wmfemfhelper
static_cast<double>(rGradient.GetBorder()) * 0.01,
static_cast<double>(rGradient.GetOfsX()) * 0.01,
static_cast<double>(rGradient.GetOfsY()) * 0.01,
- static_cast<double>(rGradient.GetAngle()) * F_PI1800,
+ static_cast<double>(rGradient.GetAngle().get()) * F_PI1800,
aStart,
aEnd,
rGradient.GetSteps());
@@ -788,7 +788,7 @@ namespace wmfemfhelper
return drawinglayer::attribute::FillHatchAttribute(
aHatchStyle,
static_cast<double>(rHatch.GetDistance()),
- static_cast<double>(rHatch.GetAngle()) * F_PI1800,
+ static_cast<double>(rHatch.GetAngle().get()) * F_PI1800,
rHatch.GetColor().getBColor(),
3, // same default as VCL, a minimum of three discrete units (pixels) offset
false);
@@ -1102,7 +1102,7 @@ namespace wmfemfhelper
// add FontRotation (if used)
if(rFont.GetOrientation())
{
- rTextTransform.rotate(-rFont.GetOrientation() * F_PI1800);
+ rTextTransform.rotate(-rFont.GetOrientation().get() * F_PI1800);
}
}
@@ -1265,7 +1265,7 @@ namespace wmfemfhelper
if(rFont.GetOrientation())
{
- aTextTransform.rotate(-rFont.GetOrientation() * F_PI1800);
+ aTextTransform.rotate(-rFont.GetOrientation().get() * F_PI1800);
}
aTextTransform.translate(rTextStartPosition.X(), rTextStartPosition.Y());
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index 454fc460849a..b26142224a1f 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -2038,7 +2038,7 @@ void EditDoc::CreateDefFont( bool bUseStyles )
SfxItemSet aTmpSet( GetItemPool(), svl::Items<EE_PARA_START, EE_CHAR_END>{} );
CreateFont( aDefFont, aTmpSet );
aDefFont.SetVertical( IsVertical() );
- aDefFont.SetOrientation( IsVertical() ? (IsTopToBottom() ? 2700 : 900) : 0 );
+ aDefFont.SetOrientation( Degree10(IsVertical() ? (IsTopToBottom() ? 2700 : 900) : 0) );
for ( sal_Int32 nNode = 0; nNode < Count(); nNode++ )
{
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index 071f78947b2f..91bb8217ec3f 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -200,7 +200,7 @@ void EditEngine::Draw( OutputDevice* pOutDev, const tools::Rectangle& rOutRect )
Draw( pOutDev, rOutRect, Point( 0, 0 ) );
}
-void EditEngine::Draw( OutputDevice* pOutDev, const Point& rStartPos, short nOrientation )
+void EditEngine::Draw( OutputDevice* pOutDev, const Point& rStartPos, Degree10 nOrientation )
{
// Create with 2 points, as with positive points it will end up with
// LONGMAX as Size, Bottom and Right in the range > LONGMAX.
@@ -2462,7 +2462,7 @@ void EditEngine::DrawingTab( const Point& /*rStartPos*/, tools::Long /*nWidth*/,
{
}
-void EditEngine::PaintingFirstLine( sal_Int32, const Point&, tools::Long, const Point&, short, OutputDevice* )
+void EditEngine::PaintingFirstLine( sal_Int32, const Point&, tools::Long, const Point&, Degree10, OutputDevice* )
{
}
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 411a63766020..2c18762e1f9d 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1282,7 +1282,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor )
aCursorSz.setWidth( aOldSz.Height() );
aCursorSz.setHeight( aOldSz.Width() );
GetCursor()->SetPos( aCursorRect.TopRight() );
- GetCursor()->SetOrientation( IsTopToBottom() ? 2700 : 900 );
+ GetCursor()->SetOrientation( Degree10(IsTopToBottom() ? 2700 : 900) );
}
else
// #i32593# Reset correct orientation in horizontal layout
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index a6ebf55c7ccc..9ab6c7fdfe88 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -834,7 +834,7 @@ public:
void FormatFullDoc();
void UpdateViews( EditView* pCurView = nullptr );
void Paint( ImpEditView* pView, const tools::Rectangle& rRect, OutputDevice* pTargetDevice );
- void Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Point aStartPos, bool bStripOnly = false, short nOrientation = 0 );
+ void Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Point aStartPos, bool bStripOnly = false, Degree10 nOrientation = Degree10(0) );
bool MouseButtonUp( const MouseEvent& rMouseEvent, EditView* pView );
bool MouseButtonDown( const MouseEvent& rMouseEvent, EditView* pView );
@@ -1292,7 +1292,7 @@ inline vcl::Cursor* ImpEditView::GetCursor()
void ConvertItem( std::unique_ptr<SfxPoolItem>& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit );
void ConvertAndPutItems( SfxItemSet& rDest, const SfxItemSet& rSource, const MapUnit* pSourceUnit = nullptr, const MapUnit* pDestUnit = nullptr );
AsianCompressionFlags GetCharTypeForCompression( sal_Unicode cChar );
-Point Rotate( const Point& rPoint, short nOrientation, const Point& rOrigin );
+Point Rotate( const Point& rPoint, Degree10 nOrientation, const Point& rOrigin );
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 23d00bb7dc1b..d070ec660786 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -105,9 +105,9 @@ struct TabInfo
}
-Point Rotate( const Point& rPoint, short nOrientation, const Point& rOrigin )
+Point Rotate( const Point& rPoint, Degree10 nOrientation, const Point& rOrigin )
{
- double nRealOrientation = nOrientation*F_PI1800;
+ double nRealOrientation = nOrientation.get() * F_PI1800;
double nCos = cos( nRealOrientation );
double nSin = sin( nRealOrientation );
@@ -158,7 +158,7 @@ static void lcl_DrawRedLines( OutputDevice* pOutDev,
size_t nMaxEnd,
const tools::Long* pDXArray,
WrongList const * pWrongs,
- short nOrientation,
+ Degree10 nOrientation,
const Point& rOrigin,
bool bVertical,
bool bIsRightToLeft )
@@ -2952,7 +2952,7 @@ void ImpEditEngine::RecalcFormatterFontMetrics( FormatterFontMetric& rCurMetrics
}
}
-void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Point aStartPos, bool bStripOnly, short nOrientation )
+void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Point aStartPos, bool bStripOnly, Degree10 nOrientation )
{
if ( !GetUpdateMode() && !bStripOnly )
return;
@@ -2978,7 +2978,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
double nCos = 0.0, nSin = 0.0;
if ( nOrientation )
{
- double nRealOrientation = nOrientation*F_PI1800;
+ double nRealOrientation = nOrientation.get()*F_PI1800;
nCos = cos( nRealOrientation );
nSin = sin( nRealOrientation );
}
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index 8b856d6e7497..e1700df6e254 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -99,7 +99,7 @@ SfxPoolItem* SvxEscapementItem::CreateDefault() {return new SvxEscapementItem(0)
SfxPoolItem* SvxLanguageItem::CreateDefault() {return new SvxLanguageItem(LANGUAGE_GERMAN, 0);}
SfxPoolItem* SvxBlinkItem::CreateDefault() {return new SvxBlinkItem(false, 0);}
SfxPoolItem* SvxEmphasisMarkItem::CreateDefault() {return new SvxEmphasisMarkItem(FontEmphasisMark::NONE, 0);}
-SfxPoolItem* SvxCharRotateItem::CreateDefault() {return new SvxCharRotateItem(0, false, 0);}
+SfxPoolItem* SvxCharRotateItem::CreateDefault() {return new SvxCharRotateItem(Degree10(0), false, 0);}
SfxPoolItem* SvxCharScaleWidthItem::CreateDefault() {return new SvxCharScaleWidthItem(100, 0);}
SfxPoolItem* SvxCharReliefItem::CreateDefault() {return new SvxCharReliefItem(FontRelief::NONE, 0);}
@@ -2153,8 +2153,8 @@ bool SvxTwoLinesItem::GetPresentation( SfxItemPresentation /*ePres*/,
|* class SvxTextRotateItem
*************************************************************************/
-SvxTextRotateItem::SvxTextRotateItem(sal_uInt16 nValue, const sal_uInt16 nW)
- : SfxUInt16Item(nW, nValue)
+SvxTextRotateItem::SvxTextRotateItem(Degree10 nValue, const sal_uInt16 nW)
+ : SfxUInt16Item(nW, nValue.get())
{
}
@@ -2174,7 +2174,7 @@ bool SvxTextRotateItem::GetPresentation(
{
rText = EditResId(RID_SVXITEMS_TEXTROTATE);
rText = rText.replaceFirst("$(ARG1)",
- OUString::number(GetValue() / 10));
+ OUString::number(GetValue().get() / 10));
}
return true;
}
@@ -2206,7 +2206,7 @@ bool SvxTextRotateItem::PutValue(const css::uno::Any& rVal, sal_uInt8 nMemberId)
{
sal_Int16 nVal = 0;
if ((rVal >>= nVal) && (0 == nVal || 900 == nVal || 2700 == nVal))
- SetValue(static_cast<sal_uInt16>(nVal));
+ SetValue(Degree10(nVal));
else
bRet = false;
break;
@@ -2221,7 +2221,7 @@ void SvxTextRotateItem::dumpAsXml(xmlTextWriterPtr pWriter) const
{
xmlTextWriterStartElement(pWriter, BAD_CAST("SvxTextRotateItem"));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
- xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number(GetValue()).getStr()));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number(GetValue().get()).getStr()));
xmlTextWriterEndElement(pWriter);
}
@@ -2230,7 +2230,7 @@ void SvxTextRotateItem::dumpAsXml(xmlTextWriterPtr pWriter) const
|* class SvxCharRotateItem
*************************************************************************/
-SvxCharRotateItem::SvxCharRotateItem( sal_uInt16 nValue,
+SvxCharRotateItem::SvxCharRotateItem( Degree10 nValue,
bool bFitIntoLine,
const sal_uInt16 nW )
: SvxTextRotateItem(nValue, nW), bFitToLine( bFitIntoLine )
@@ -2253,7 +2253,7 @@ bool SvxCharRotateItem::GetPresentation(
{
rText = EditResId( RID_SVXITEMS_CHARROTATE );
rText = rText.replaceFirst( "$(ARG1)",
- OUString::number( GetValue() / 10 ));
+ OUString::number( GetValue().get() / 10 ));
if( IsFitToLine() )
rText += EditResId( RID_SVXITEMS_CHARROTATE_FITLINE );
}
@@ -2311,7 +2311,7 @@ void SvxCharRotateItem::dumpAsXml(xmlTextWriterPtr pWriter) const
{
xmlTextWriterStartElement(pWriter, BAD_CAST("SvxCharRotateItem"));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
- xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number(GetValue()).getStr()));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number(GetValue().get()).getStr()));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("fitToLine"), BAD_CAST(OString::boolean(IsFitToLine()).getStr()));
xmlTextWriterEndElement(pWriter);
}
diff --git a/editeng/source/outliner/outleeng.cxx b/editeng/source/outliner/outleeng.cxx
index 645ecdb7fce2..116fec186fc3 100644
--- a/editeng/source/outliner/outleeng.cxx
+++ b/editeng/source/outliner/outleeng.cxx
@@ -38,7 +38,7 @@ OutlinerEditEng::~OutlinerEditEng()
{
}
-void OutlinerEditEng::PaintingFirstLine( sal_Int32 nPara, const Point& rStartPos, tools::Long /*nBaseLineY*/, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev )
+void OutlinerEditEng::PaintingFirstLine( sal_Int32 nPara, const Point& rStartPos, tools::Long /*nBaseLineY*/, const Point& rOrigin, Degree10 nOrientation, OutputDevice* pOutDev )
{
if( GetControlWord() & EEControlBits::OUTLINER )
{
diff --git a/editeng/source/outliner/outleeng.hxx b/editeng/source/outliner/outleeng.hxx
index 6830460204a0..fa6ae0da381b 100644
--- a/editeng/source/outliner/outleeng.hxx
+++ b/editeng/source/outliner/outleeng.hxx
@@ -37,7 +37,7 @@ public:
OutlinerEditEng( Outliner* pOwner, SfxItemPool* pPool );
virtual ~OutlinerEditEng() override;
- virtual void PaintingFirstLine( sal_Int32 nPara, const Point& rStartPos, tools::Long nBaseLineY, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev ) override;
+ virtual void PaintingFirstLine( sal_Int32 nPara, const Point& rStartPos, tools::Long nBaseLineY, const Point& rOrigin, Degree10 nOrientation, OutputDevice* pOutDev ) override;
virtual void ParagraphInserted( sal_Int32 nNewParagraph ) override;
virtual void ParagraphDeleted( sal_Int32 nDeletedParagraph ) override;
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index 411cc62a2158..73c62414bd53 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -864,7 +864,7 @@ vcl::Font Outliner::ImpCalcBulletFont( sal_Int32 nPara ) const
aBulletFont.SetFontSize( Size( 0, nScaledLineHeight ) );
bool bVertical = IsVertical();
aBulletFont.SetVertical( bVertical );
- aBulletFont.SetOrientation( bVertical ? (IsTopToBottom() ? 2700 : 900) : 0 );
+ aBulletFont.SetOrientation( Degree10(bVertical ? (IsTopToBottom() ? 2700 : 900) : 0) );
Color aColor( COL_AUTO );
if( !pEditEngine->IsFlatMode() && !( pEditEngine->GetControlWord() & EEControlBits::NOCOLORS ) )
@@ -880,7 +880,7 @@ vcl::Font Outliner::ImpCalcBulletFont( sal_Int32 nPara ) const
}
void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
- const Point& rOrigin, short nOrientation, OutputDevice* pOutDev )
+ const Point& rOrigin, Degree10 nOrientation, OutputDevice* pOutDev )
{
bool bDrawBullet = false;
@@ -949,7 +949,7 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
{
// Both TopLeft and bottom left is not quite correct,
// since in EditEngine baseline ...
- double nRealOrientation = nOrientation*F_PI1800;
+ double nRealOrientation = nOrientation.get() * F_PI1800;
double nCos = cos( nRealOrientation );
double nSin = sin( nRealOrientation );
Point aRotatedPos;
diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx
index 790085b4031b..5be9b0a7493e 100644
--- a/editeng/source/rtf/rtfitem.cxx
+++ b/editeng/source/rtf/rtfitem.cxx
@@ -1039,7 +1039,7 @@ ATTR_SETEMPHASIS:
if( aPlainMap.nHorzVert )
{
// RTF knows only 90deg
- pSet->Put( SvxCharRotateItem( 900, 1 == nTokenValue,
+ pSet->Put( SvxCharRotateItem( Degree10(900), 1 == nTokenValue,
aPlainMap.nHorzVert ));
}
break;
diff --git a/editeng/source/uno/unofdesc.cxx b/editeng/source/uno/unofdesc.cxx
index a7042726c41f..0cfd7a710dcf 100644
--- a/editeng/source/uno/unofdesc.cxx
+++ b/editeng/source/uno/unofdesc.cxx
@@ -48,7 +48,7 @@ void SvxUnoFontDescriptor::ConvertToFont( const awt::FontDescriptor& rDesc, vcl:
rFont.SetFamily( static_cast<FontFamily>(rDesc.Family) );
rFont.SetCharSet( static_cast<rtl_TextEncoding>(rDesc.CharSet) );
rFont.SetPitch( static_cast<FontPitch>(rDesc.Pitch) );
- rFont.SetOrientation( static_cast<short>(rDesc.Orientation*10) );
+ rFont.SetOrientation( Degree10(static_cast<sal_Int16>(rDesc.Orientation*10)) );
rFont.SetKerning( rDesc.Kerning ? FontKerning::FontSpecific : FontKerning::NONE );
rFont.SetWeight( vcl::unohelper::ConvertFontWeight(rDesc.Weight) );
rFont.SetItalic( static_cast<FontItalic>(rDesc.Slant) );
@@ -66,7 +66,7 @@ void SvxUnoFontDescriptor::ConvertFromFont( const vcl::Font& rFont, awt::FontDes
rDesc.Family = sal::static_int_cast< sal_Int16 >(rFont.GetFamilyType());
rDesc.CharSet = rFont.GetCharSet();
rDesc.Pitch = sal::static_int_cast< sal_Int16 >(rFont.GetPitch());
- rDesc.Orientation = static_cast< float >(rFont.GetOrientation() / 10);
+ rDesc.Orientation = static_cast< float >(rFont.GetOrientation().get() / 10);
rDesc.Kerning = rFont.IsKerning();
rDesc.Weight = vcl::unohelper::ConvertFontWeight( rFont.GetWeight() );
rDesc.Slant = vcl::unohelper::ConvertFontSlant( rFont.GetItalic() );
diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx
index a903bf99aa99..080521ed0523 100644
--- a/emfio/source/reader/mtftools.cxx
+++ b/emfio/source/reader/mtftools.cxx
@@ -254,7 +254,7 @@ namespace emfio
if( rFont.lfStrikeOut )
aFont.SetStrikeout( STRIKEOUT_SINGLE );
- aFont.SetOrientation( static_cast<short>(rFont.lfEscapement) );
+ aFont.SetOrientation( Degree10(static_cast<sal_Int16>(rFont.lfEscapement)) );
Size aFontSize( Size( rFont.lfWidth, rFont.lfHeight ) );
if ( rFont.lfHeight > 0 )
@@ -504,7 +504,7 @@ namespace emfio
sal_Int32 nResult;
const bool bFail = o3tl::checked_multiply(mnWinExtX, mnWinExtY, nResult);
if (!bFail && nResult < 0)
- rFont.SetOrientation( 3600 - rFont.GetOrientation() );
+ rFont.SetOrientation( Degree10(3600) - rFont.GetOrientation() );
}
tools::Polygon& MtfTools::ImplMap( tools::Polygon& rPolygon )
@@ -1514,8 +1514,7 @@ namespace emfio
fOrientation = 360 - fOrientation;
fOrientation += 90;
fOrientation *= 10;
- fOrientation += aTmp.GetOrientation();
- aTmp.SetOrientation( sal_Int16( fOrientation ) );
+ aTmp.SetOrientation( aTmp.GetOrientation() + Degree10( static_cast<sal_Int16>(fOrientation) ) );
}
}
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index 61502b06c503..e8cca292467c 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -2002,14 +2002,14 @@ void PSWriter::ImplText( const OUString& rUniString, const Point& rPos, const lo
if ( mnTextMode == 0 ) // using glyph outlines
{
vcl::Font aNotRotatedFont( maFont );
- aNotRotatedFont.SetOrientation( 0 );
+ aNotRotatedFont.SetOrientation( Degree10(0) );
ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::BITMASK);
pVirDev->SetMapMode( rVDev.GetMapMode() );
pVirDev->SetFont( aNotRotatedFont );
pVirDev->SetTextAlign( eTextAlign );
- sal_Int16 nRotation = maFont.GetOrientation();
+ Degree10 nRotation = maFont.GetOrientation();
tools::Polygon aPolyDummy( 1 );
Point aPos( rPos );
@@ -2031,7 +2031,7 @@ void PSWriter::ImplText( const OUString& rUniString, const Point& rPos, const lo
ImplWriteLine( "t" );
if ( nRotation )
{
- ImplWriteF( nRotation, 1 );
+ ImplWriteF( nRotation.get(), 1 );
mpPS->WriteCharPtr( "r " );
}
for (auto const& elem : aPolyPolyVec)
@@ -2057,7 +2057,7 @@ void PSWriter::ImplSetAttrForText( const Point& rPoint )
{
Point aPoint( rPoint );
- long nRotation = maFont.GetOrientation();
+ Degree10 nRotation = maFont.GetOrientation();
ImplWriteTextColor(PS_RET);
Size aSize = maFont.GetFontSize();
@@ -2089,7 +2089,7 @@ void PSWriter::ImplSetAttrForText( const Point& rPoint )
if ( nRotation )
{
mpPS->WriteCharPtr( "gs " );
- ImplWriteF( nRotation, 1 );
+ ImplWriteF( nRotation.get(), 1 );
mpPS->WriteCharPtr( "r " );
}
}
diff --git a/filter/source/graphicfilter/idxf/dxf2mtf.cxx b/filter/source/graphicfilter/idxf/dxf2mtf.cxx
index 3d9e6c9ed463..f6fc91ae792d 100644
--- a/filter/source/graphicfilter/idxf/dxf2mtf.cxx
+++ b/filter/source/graphicfilter/idxf/dxf2mtf.cxx
@@ -206,7 +206,7 @@ bool DXF2GDIMetaFile::SetFontAttribute(const DXFBasicEntity & rE, short nAngle,
aFont.SetFamily(FAMILY_SWISS);
aFont.SetFontSize(Size(0,nHeight));
aFont.SetAlignment(ALIGN_BASELINE);
- aFont.SetOrientation(nAngle);
+ aFont.SetOrientation(Degree10(nAngle));
if (aActFont!=aFont) {
aActFont=aFont;
pVirDev->SetFont(aActFont);
diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx
index 7746b579df1d..cdf18abc66e4 100644
--- a/filter/source/graphicfilter/ios2met/ios2met.cxx
+++ b/filter/source/graphicfilter/ios2met/ios2met.cxx
@@ -286,7 +286,7 @@ struct OSAttr
RasterOp eImgMix;
RasterOp eImgBgMix;
sal_Int32 nArcP, nArcQ, nArcR, nArcS;
- short nChrAng;
+ Degree10 nChrAng;
Size aChrCellSize;
sal_uInt32 nChrSet;
Point aCurPos;
@@ -1013,7 +1013,7 @@ void OS2METReader::ReadChrStr(bool bGivenPos, bool bMove, bool bExtra, sal_uInt1
aFont = pF->aFont;
aFont.SetColor(aAttr.aChrCol);
aFont.SetFontSize(Size(0,aAttr.aChrCellSize.Height()));
- if ( aAttr.nChrAng != 0 )
+ if ( aAttr.nChrAng )
aFont.SetOrientation(aAttr.nChrAng);
if (bGivenPos)
@@ -1049,7 +1049,7 @@ void OS2METReader::ReadChrStr(bool bGivenPos, bool bMove, bool bExtra, sal_uInt1
pVirDev->DrawText(aP0,aStr);
aSize = Size( pVirDev->GetTextWidth(aStr), pVirDev->GetTextHeight() );
- if ( aAttr.nChrAng == 0 )
+ if ( !aAttr.nChrAng )
{
aCalcBndRect.Union(tools::Rectangle( Point(aP0.X(),aP0.Y()-aSize.Height()),
Size(aSize.Width(),aSize.Height()*2)));
@@ -2037,11 +2037,11 @@ void OS2METReader::ReadOrder(sal_uInt16 nOrderID, sal_uInt16 nOrderLen)
case GOrdSChAng: {
sal_Int32 nX = ReadCoord(bCoord32);
sal_Int32 nY = ReadCoord(bCoord32);
- if (nX>=0 && nY==0) aAttr.nChrAng=0;
+ if (nX>=0 && nY==0) aAttr.nChrAng=Degree10(0);
else {
- aAttr.nChrAng=static_cast<short>(atan2(static_cast<double>(nY),static_cast<double>(nX))/3.1415926539*1800.0);
- while (aAttr.nChrAng<0) aAttr.nChrAng+=3600;
- aAttr.nChrAng%=3600;
+ aAttr.nChrAng = Degree10(static_cast<short>(atan2(static_cast<double>(nY),static_cast<double>(nX))/3.1415926539*1800.0));
+ while (aAttr.nChrAng < Degree10(0)) aAttr.nChrAng += Degree10(3600);
+ aAttr.nChrAng %= Degree10(3600);
}
break;
}
@@ -2689,7 +2689,7 @@ void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaF
aDefAttr.nArcQ =1;
aDefAttr.nArcR =0;
aDefAttr.nArcS =0;
- aDefAttr.nChrAng =0;
+ aDefAttr.nChrAng =Degree10(0);
aDefAttr.aChrCellSize=Size(12,12);
aDefAttr.nChrSet =0;
aDefAttr.aCurPos =Point(0,0);
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index f9f3f7197f21..ce03064a89c0 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -1452,7 +1452,8 @@ Graphic lclDrawHatch( const drawing::Hatch& rHatch, const Color& rBackColor, boo
pVDev->SetLineColor();
pVDev->SetFillColor(bFillBackground ? rBackColor : COL_TRANSPARENT);
pVDev->DrawRect(rRect);
- pVDev->DrawHatch(tools::PolyPolygon(rRect), Hatch(static_cast<HatchStyle>(rHatch.Style), Color(rHatch.Color), rHatch.Distance, static_cast<sal_uInt16>(rHatch.Angle)));
+ pVDev->DrawHatch(tools::PolyPolygon(rRect), Hatch(static_cast<HatchStyle>(rHatch.Style), Color(rHatch.Color), rHatch.Distance,
+ Degree10(rHatch.Angle)));
aMtf.Stop();
aMtf.WindStart();
aMtf.SetPrefMapMode(MapMode(MapUnit::Map100thMM));
@@ -3926,7 +3927,7 @@ EscherBlibEntry::EscherBlibEntry( sal_uInt32 nPictureOffset, const GraphicObject
.WriteInt32( pGraphicAttr->GetTopCrop() )
.WriteInt32( pGraphicAttr->GetRightCrop() )
.WriteInt32( pGraphicAttr->GetBottomCrop() )
- .WriteUInt16( pGraphicAttr->GetRotation() )
+ .WriteUInt16( pGraphicAttr->GetRotation().get() )
.WriteInt16( pGraphicAttr->GetLuminance() )
.WriteInt16( pGraphicAttr->GetContrast() )
.WriteInt16( pGraphicAttr->GetChannelR() )
@@ -4622,7 +4623,7 @@ sal_uInt32 EscherConnectorListEntry::GetConnectorRule( bool bFirst )
sal_Int32 nAngle = ( EscherPropertyValueHelper::GetPropertyValue( aAny, aPropertySet, "RotateAngle", true ) )
? *o3tl::doAccess<sal_Int32>(aAny) : 0;
if ( nAngle )
- aPoly.Rotate( aRect.TopLeft(), static_cast<sal_uInt16>( ( nAngle + 5 ) / 10 ) );
+ aPoly.Rotate( aRect.TopLeft(), Degree10(static_cast<sal_Int16>( ( nAngle + 5 ) / 10 )) );
nRule = GetClosestPoint( aPoly, aRefPoint );
if (aType == OString( "drawing.Ellipse" ))
diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx
index 5619e1e09fa9..7132b8067e98 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -364,7 +364,7 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
tools::Polygon aPolygon( rRect, aStart, aEnd, ePolyKind );
if( rObj.GetAngle() )
{
- aPolygon.Rotate( rRect.TopLeft(), static_cast<sal_uInt16>( rObj.GetAngle() / 10 ) );
+ aPolygon.Rotate( rRect.TopLeft(), Degree10(static_cast<sal_Int16>( rObj.GetAngle() / 10 )) );
rObj.SetAngle( 0 );
}
mpEscherEx->OpenContainer( ESCHER_SpContainer );
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index bd29942a6931..a32eed5a017d 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -1288,7 +1288,7 @@ static void ApplyRectangularGradientAsBitmap( const SvxMSDffManager& rManager, S
rIn.Seek( nPos );
if ( bRotateWithShape )
{
- aBitmapEx.Rotate( nFix16Angle / 10, rShadeColors[ 0 ].aColor );
+ aBitmapEx.Rotate( Degree10(nFix16Angle / 10), rShadeColors[ 0 ].aColor );
BmpMirrorFlags nMirrorFlags = BmpMirrorFlags::NONE;
if ( rObjData.nSpFlags & ShapeFlag::FlipV )
@@ -2865,7 +2865,7 @@ void DffPropertyReader::ImportGradientColor( SfxItemSet& aSet, sal_uInt32 eMSO_F
}
//Construct gradient item
- XGradient aGrad( aCol2, aCol1, eGrad, nAngle, nFocusX, nFocusY );
+ XGradient aGrad( aCol2, aCol1, eGrad, Degree10(nAngle), nFocusX, nFocusY );
//Intensity has been merged into color. So here just set is as 100
aGrad.SetStartIntens( 100 );
aGrad.SetEndIntens( 100 );
@@ -2878,7 +2878,7 @@ void DffPropertyReader::ImportGradientColor( SfxItemSet& aSet, sal_uInt32 eMSO_F
aCol1 = Color(nStartCol, nStartCol, nStartCol);
aCol2 = Color(nEndCol, nEndCol, nEndCol);
- XGradient aGrad2( aCol2 , aCol1 , eGrad, nAngle, nFocusX, nFocusY );
+ XGradient aGrad2( aCol2 , aCol1 , eGrad, Degree10(nAngle), nFocusX, nFocusY );
aSet.Put( XFillFloatTransparenceItem( OUString(), aGrad2 ) );
}
}
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 6a0794e94f15..7fa83e05bc75 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -1117,7 +1117,7 @@ void PDFExport::ImplWriteWatermark( vcl::PDFWriter& rWriter, const Size& rPageSi
if( rPageSize.Width() < rPageSize.Height() )
{
nTextWidth = rPageSize.Height();
- aFont.SetOrientation( 2700 );
+ aFont.SetOrientation( Degree10(2700) );
}
// adjust font height for text to fit
@@ -1185,7 +1185,7 @@ void PDFExport::ImplWriteTiledWatermark( vcl::PDFWriter& rWriter, const Size& rP
aFont.SetWeight( WEIGHT_NORMAL );
aFont.SetAlignment( ALIGN_BOTTOM );
aFont.SetFontHeight(40);
- aFont.SetOrientation(450);
+ aFont.SetOrientation(Degree10(450));
OutputDevice* pDev = rWriter.GetReferenceDevice();
pDev->SetFont(aFont);
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 7998d56754d0..37c301f2a3bf 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -221,7 +221,7 @@ void SVGAttributeWriter::AddGradientDef( const tools::Rectangle& rObjRect, const
{
SvXMLElementExport aDesc( mrExport, XML_NAMESPACE_NONE, aXMLElemDefs, true, true );
Color aStartColor( rGradient.GetStartColor() ), aEndColor( rGradient.GetEndColor() );
- sal_uInt16 nAngle = rGradient.GetAngle() % 3600;
+ Degree10 nAngle = rGradient.GetAngle() % Degree10(3600);
Point aObjRectCenter( rObjRect.Center() );
tools::Polygon aPoly( rObjRect );
static sal_Int32 nCurGradientId = 1;
@@ -1252,7 +1252,7 @@ void SVGTextWriter::startTextShape()
{
Point aRot( maTextPos );
OUString aTransform = "rotate(" +
- OUString::number( rFont.GetOrientation() * -0.1 ) + " " +
+ OUString::number( rFont.GetOrientation().get() * -0.1 ) + " " +
OUString::number( aRot.X() ) + " " +
OUString::number( aRot.Y() ) + ")";
mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrTransform, aTransform );
@@ -2249,7 +2249,7 @@ void SVGActionWriter::ImplWriteGradientLinear( const tools::PolyPolygon& rPolyPo
rGradient.GetBoundRect( rPolyPoly.GetBoundRect(), aTmpRect, aTmpCenter );
ImplMap( aTmpRect, aRect );
ImplMap( aTmpCenter, aCenter );
- const sal_uInt16 nAngle = rGradient.GetAngle() % 3600;
+ const Degree10 nAngle = rGradient.GetAngle() % Degree10(3600);
tools::Polygon aPoly( 2 );
// Setting x value of a gradient vector to rotation center to
@@ -2601,7 +2601,7 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const OUString& rText,
{
Point aRot( aPos );
OUString aTransform = "rotate(" +
- OUString::number( rFont.GetOrientation() * -0.1 ) + " " +
+ OUString::number( rFont.GetOrientation().get() * -0.1 ) + " " +
OUString::number( aRot.X() ) + " " +
OUString::number( aRot.Y() ) + ")";
mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrTransform, aTransform );
diff --git a/include/editeng/charrotateitem.hxx b/include/editeng/charrotateitem.hxx
index 0ce60bb1a05b..093c84224fe5 100644
--- a/include/editeng/charrotateitem.hxx
+++ b/include/editeng/charrotateitem.hxx
@@ -20,6 +20,7 @@
#define INCLUDED_EDITENG_CHARROTATEITEM_HXX
#include <svl/intitem.hxx>
+#include <tools/degree.hxx>
#include <editeng/editengdllapi.h>
// class SvxTextRotateItem ----------------------------------------------
@@ -34,7 +35,7 @@
class EDITENG_DLLPUBLIC SvxTextRotateItem : public SfxUInt16Item
{
public:
- SvxTextRotateItem(sal_uInt16 nValue, const sal_uInt16 nId);
+ SvxTextRotateItem(Degree10 nValue, const sal_uInt16 nId);
virtual SvxTextRotateItem* Clone(SfxItemPool *pPool = nullptr) const override;
@@ -47,11 +48,14 @@ public:
virtual bool QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId = 0) const override;
virtual bool PutValue(const css::uno::Any& rVal, sal_uInt8 nMemberId) override;
+ Degree10 GetValue() const { return Degree10(SfxUInt16Item::GetValue()); }
+ void SetValue(Degree10 val) { SfxUInt16Item::SetValue(val.get()); }
+
// our currently only degree values
- void SetTopToBottom() { SetValue(2700); }
- void SetBottomToTop() { SetValue(900); }
- bool IsTopToBottom() const { return 2700 == GetValue(); }
- bool IsBottomToTop() const { return 900 == GetValue(); }
+ void SetTopToBottom() { SetValue(Degree10(2700)); }
+ void SetBottomToTop() { SetValue(Degree10(900)); }
+ bool IsTopToBottom() const { return Degree10(2700) == GetValue(); }
+ bool IsBottomToTop() const { return Degree10(900) == GetValue(); }
bool IsVertical() const { return IsTopToBottom() || IsBottomToTop(); }
void dumpAsXml(xmlTextWriterPtr pWriter) const override;
@@ -75,7 +79,7 @@ class EDITENG_DLLPUBLIC SvxCharRotateItem final : public SvxTextRotateItem
public:
static SfxPoolItem* CreateDefault();
- SvxCharRotateItem( sal_uInt16 nValue /*= 0*/,
+ SvxCharRotateItem( Degree10 nValue /*= 0*/,
bool bFitIntoLine /*= false*/,
const sal_uInt16 nId );
diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx
index 3f896f09a23c..871acf2f43b5 100644
--- a/include/editeng/editeng.hxx
+++ b/include/editeng/editeng.hxx
@@ -37,6 +37,7 @@
#include <i18nlangtag/lang.h>
#include <tools/lineend.hxx>
+#include <tools/degree.hxx>
#include <editeng/eedata.hxx>
#include <o3tl/typed_flags_set.hxx>
@@ -373,7 +374,7 @@ public:
void Draw( OutputDevice* pOutDev, const tools::Rectangle& rOutRect );
void Draw( OutputDevice* pOutDev, const tools::Rectangle& rOutRect, const Point& rStartDocPos );
void Draw( OutputDevice* pOutDev, const tools::Rectangle& rOutRect, const Point& rStartDocPos, bool bClip );
- void Draw( OutputDevice* pOutDev, const Point& rStartPos, short nOrientation = 0 );
+ void Draw( OutputDevice* pOutDev, const Point& rStartPos, Degree10 nOrientation = Degree10(0) );
ErrCode Read( SvStream& rInput, const OUString& rBaseURL, EETextFormat, SvKeyValueIterator* pHTTPHeaderAttrs = nullptr );
void Write( SvStream& rOutput, EETextFormat );
@@ -480,7 +481,7 @@ public:
void SetBeginPasteOrDropHdl( const Link<PasteOrDropInfos&,void>& rLink );
void SetEndPasteOrDropHdl( const Link<PasteOrDropInfos&,void>& rLink );
- virtual void PaintingFirstLine( sal_Int32 nPara, const Point& rStartPos, tools::Long nBaseLineY, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev );
+ virtual void PaintingFirstLine( sal_Int32 nPara, const Point& rStartPos, tools::Long nBaseLineY, const Point& rOrigin, Degree10 nOrientation, OutputDevice* pOutDev );
virtual void ParagraphInserted( sal_Int32 nNewParagraph );
virtual void ParagraphDeleted( sal_Int32 nDeletedParagraph );
virtual void ParagraphConnected( sal_Int32 nLeftParagraph, sal_Int32 nRightParagraph );
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index 083cee135e99..3ea2fd9b2631 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -635,7 +635,7 @@ protected:
void InvalidateBullet(sal_Int32 nPara);
void PaintBullet( sal_Int32 nPara, const Point& rStartPos,
- const Point& rOrigin, short nOrientation,
+ const Point& rOrigin, Degree10 nOrientation,
OutputDevice* pOutDev );
// used by OutlinerEditEng. Allows Outliner objects to provide
diff --git a/include/o3tl/strong_int.hxx b/include/o3tl/strong_int.hxx
index 006a36c8900f..3db958212229 100644
--- a/include/o3tl/strong_int.hxx
+++ b/include/o3tl/strong_int.hxx
@@ -112,6 +112,11 @@ public:
strong_int operator--(int) { UNDERLYING_TYPE nOldValue = m_value; --m_value; return strong_int(nOldValue); }
strong_int& operator+=(strong_int const & other) { m_value += other.m_value; return *this; }
strong_int& operator-=(strong_int const & other) { m_value -= other.m_value; return *this; }
+ strong_int& operator%=(strong_int const & other) { m_value %= other.m_value; return *this; }
+ [[nodiscard]]
+ strong_int operator%(strong_int const & other) const { return strong_int(m_value % other.m_value); }
+ [[nodiscard]]
+ strong_int operator-() const { return strong_int(-m_value); }
bool anyOf(strong_int v) const {
return *this == v;
diff --git a/include/svl/imageitm.hxx b/include/svl/imageitm.hxx
index c135216cc482..2340230fb4a4 100644
--- a/include/svl/imageitm.hxx
+++ b/include/svl/imageitm.hxx
@@ -23,11 +23,11 @@
#include <svl/svldllapi.h>
#include <svl/intitem.hxx>
#include <memory>
+#include <tools/degree.hxx>
struct SfxImageItem_Impl;
class SVL_DLLPUBLIC SfxImageItem final : public SfxInt16Item
{
- std::unique_ptr<SfxImageItem_Impl> pImpl;
public:
static SfxPoolItem* CreateDefault();
SfxImageItem( sal_uInt16 nWhich = 0 );
@@ -39,10 +39,15 @@ public:
virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
- void SetRotation( tools::Long nValue );
- tools::Long GetRotation() const;
- void SetMirrored( bool bSet );
- bool IsMirrored() const;
+ void SetRotation( Degree10 nValue ) { mnAngle = nValue; }
+ Degree10 GetRotation() const { return mnAngle; }
+ void SetMirrored( bool bSet ) { mbMirrored = bSet; }
+ bool IsMirrored() const { return mbMirrored; }
+
+private:
+ OUString maURL;
+ Degree10 mnAngle;
+ bool mbMirrored;
};
#endif // _SFX_IMAGEITM_HXX
diff --git a/include/svx/xgrad.hxx b/include/svx/xgrad.hxx
index f8ef9dbe9f98..6e372ec2dbfb 100644
--- a/include/svx/xgrad.hxx
+++ b/include/svx/xgrad.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_SVX_XGRAD_HXX
#include <tools/color.hxx>
+#include <tools/degree.hxx>
#include <svx/svxdllapi.h>
#include <com/sun/star/awt/GradientStyle.hpp>
#include <boost/property_tree/ptree_fwd.hpp>
@@ -32,7 +33,7 @@ class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC XGradient final
css::awt::GradientStyle eStyle;
Color aStartColor;
Color aEndColor;
- long nAngle;
+ Degree10 nAngle;
sal_uInt16 nBorder;
sal_uInt16 nOfsX;
sal_uInt16 nOfsY;
@@ -45,7 +46,7 @@ class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC XGradient final
public:
XGradient();
XGradient( const Color& rStart, const Color& rEnd,
- css::awt::GradientStyle eStyle = css::awt::GradientStyle_LINEAR, long nAngle = 0,
+ css::awt::GradientStyle eStyle = css::awt::GradientStyle_LINEAR, Degree10 nAngle = Degree10(0),
sal_uInt16 nXOfs = 50, sal_uInt16 nYOfs = 50, sal_uInt16 nBorder = 0,
sal_uInt16 nStartIntens = 100, sal_uInt16 nEndIntens = 100,
sal_uInt16 nSteps = 0 );
@@ -55,7 +56,7 @@ public:
void SetGradientStyle(css::awt::GradientStyle eNewStyle) { eStyle = eNewStyle; }
void SetStartColor(const Color& rColor) { aStartColor = rColor; }
void SetEndColor(const Color& rColor) { aEndColor = rColor; }
- void SetAngle(long nNewAngle) { nAngle = nNewAngle; }
+ void SetAngle(Degree10 nNewAngle) { nAngle = nNewAngle; }
void SetBorder(sal_uInt16 nNewBorder) { nBorder = nNewBorder; }
void SetXOffset(sal_uInt16 nNewOffset) { nOfsX = nNewOffset; }
void SetYOffset(sal_uInt16 nNewOffset) { nOfsY = nNewOffset; }
@@ -66,7 +67,7 @@ public:
css::awt::GradientStyle GetGradientStyle() const { return eStyle; }
const Color& GetStartColor() const { return aStartColor; }
const Color& GetEndColor() const { return aEndColor; }
- long GetAngle() const { return nAngle; }
+ Degree10 GetAngle() const { return nAngle; }
sal_uInt16 GetBorder() const { return nBorder; }
sal_uInt16 GetXOffset() const { return nOfsX; }
sal_uInt16 GetYOffset() const { return nOfsY; }
diff --git a/include/svx/xhatch.hxx b/include/svx/xhatch.hxx
index 79b5f624e338..0ef791c64caf 100644
--- a/include/svx/xhatch.hxx
+++ b/include/svx/xhatch.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_SVX_XHATCH_HXX
#include <tools/color.hxx>
+#include <tools/degree.hxx>
#include <svx/svxdllapi.h>
#include <com/sun/star/drawing/HatchStyle.hpp>
@@ -32,24 +33,24 @@ class SVXCORE_DLLPUBLIC XHatch final
css::drawing::HatchStyle eStyle;
Color aColor;
long nDistance;
- long nAngle;
+ Degree10 nAngle;
public:
XHatch() : eStyle(css::drawing::HatchStyle_SINGLE), nDistance(0), nAngle(0) {}
XHatch(const Color& rCol, css::drawing::HatchStyle eStyle = css::drawing::HatchStyle_SINGLE,
- long nDistance = 20, long nAngle = 0);
+ long nDistance = 20, Degree10 nAngle = Degree10(0));
bool operator==(const XHatch& rHatch) const;
void SetHatchStyle(css::drawing::HatchStyle eNewStyle) { eStyle = eNewStyle; }
void SetColor(const Color& rColor) { aColor = rColor; }
void SetDistance(long nNewDistance) { nDistance = nNewDistance; }
- void SetAngle(long nNewAngle) { nAngle = nNewAngle; }
+ void SetAngle(Degree10 nNewAngle) { nAngle = nNewAngle; }
css::drawing::HatchStyle GetHatchStyle() const { return eStyle; }
const Color& GetColor() const { return aColor; }
long GetDistance() const { return nDistance; }
- long GetAngle() const { return nAngle; }
+ Degree10 GetAngle() const { return nAngle; }
};
#endif
diff --git a/include/tools/degree.hxx b/include/tools/degree.hxx
new file mode 100644
index 000000000000..7151abccb228
--- /dev/null
+++ b/include/tools/degree.hxx
@@ -0,0 +1,18 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+#pragma once
+
+#include <sal/types.h>
+#include <o3tl/strong_int.hxx>
+
+/** tenths of a Degree, normally rotation */
+
+typedef o3tl::strong_int<sal_Int16, struct Degree10Tag> Degree10;
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/include/tools/gen.hxx b/include/tools/gen.hxx
index b357d2198de1..1198b8dbaab4 100644
--- a/include/tools/gen.hxx
+++ b/include/tools/gen.hxx
@@ -22,6 +22,7 @@
#include <tools/toolsdllapi.h>
#include <tools/long.hxx>
+#include <tools/degree.hxx>
#include <limits.h>
#include <algorithm>
#include <ostream>
@@ -83,8 +84,8 @@ public:
tools::Long AdjustX( tools::Long nHorzMove ) { nA += nHorzMove; return nA; }
tools::Long AdjustY( tools::Long nVertMove ) { nB += nVertMove; return nB; }
- void RotateAround( tools::Long& rX, tools::Long& rY, short nOrientation ) const;
- void RotateAround( Point&, short nOrientation ) const;
+ void RotateAround( tools::Long& rX, tools::Long& rY, Degree10 nOrientation ) const;
+ void RotateAround( Point&, Degree10 nOrientation ) const;
Point& operator += ( const Point& rPoint );
Point& operator -= ( const Point& rPoint );
diff --git a/include/tools/poly.hxx b/include/tools/poly.hxx
index d9f39fb080f4..de03619eaf31 100644
--- a/include/tools/poly.hxx
+++ b/include/tools/poly.hxx
@@ -21,6 +21,7 @@
#include <tools/toolsdllapi.h>
#include <tools/gen.hxx>
+#include <tools/degree.hxx>
#include <o3tl/typed_flags_set.hxx>
#include <o3tl/cow_wrapper.hxx>
@@ -145,7 +146,7 @@ public:
void Translate( const Point& rTrans );
void Scale( double fScaleX, double fScaleY );
void Rotate( const Point& rCenter, double fSin, double fCos );
- void Rotate( const Point& rCenter, sal_uInt16 nAngle10 );
+ void Rotate( const Point& rCenter, Degree10 nAngle10 );
void Insert( sal_uInt16 nPos, const Point& rPt );
void Insert( sal_uInt16 nPos, const tools::Polygon& rPoly );
@@ -236,7 +237,7 @@ public:
void Translate( const Point& rTrans );
void Scale( double fScaleX, double fScaleY );
void Rotate( const Point& rCenter, double fSin, double fCos );
- void Rotate( const Point& rCenter, sal_uInt16 nAngle10 );
+ void Rotate( const Point& rCenter, Degree10 nAngle10 );
const tools::Polygon& operator[]( sal_uInt16 nPos ) const { return GetObject( nPos ); }
tools::Polygon& operator[]( sal_uInt16 nPos );
diff --git a/include/vcl/GraphicAttributes.hxx b/include/vcl/GraphicAttributes.hxx
index a26f59edc890..5216d2934166 100644
--- a/include/vcl/GraphicAttributes.hxx
+++ b/include/vcl/GraphicAttributes.hxx
@@ -19,6 +19,7 @@
#pragma once
+#include <tools/degree.hxx>
#include <vcl/dllapi.h>
#include <vcl/bitmap.hxx>
@@ -39,7 +40,7 @@ private:
tools::Long mnTopCrop;
tools::Long mnRightCrop;
tools::Long mnBottomCrop;
- sal_uInt16 mnRotate10;
+ Degree10 mnRotate10;
short mnContPercent;
short mnLumPercent;
short mnRPercent;
@@ -74,8 +75,8 @@ public:
tools::Long GetRightCrop() const { return mnRightCrop; }
tools::Long GetBottomCrop() const { return mnBottomCrop; }
- void SetRotation(sal_uInt16 nRotate10) { mnRotate10 = nRotate10; }
- sal_uInt16 GetRotation() const { return mnRotate10; }
+ void SetRotation(Degree10 nRotate10) { mnRotate10 = nRotate10; }
+ Degree10 GetRotation() const { return mnRotate10; }
void SetLuminance(short nLuminancePercent) { mnLumPercent = nLuminancePercent; }
short GetLuminance() const { return mnLumPercent; }
@@ -107,7 +108,7 @@ public:
{
return (mnLeftCrop != 0 || mnTopCrop != 0 || mnRightCrop != 0 || mnBottomCrop != 0);
}
- bool IsRotated() const { return ((mnRotate10 % 3600) != 0); }
+ bool IsRotated() const { return ((mnRotate10 % Degree10(3600)) != Degree10(0)); }
bool IsTransparent() const { return (mcTransparency > 0); }
bool IsAdjusted() const
{
diff --git a/include/vcl/GraphicNativeMetadata.hxx b/include/vcl/GraphicNativeMetadata.hxx
index 3dbd7ff8a7d2..7cc8b663f18a 100644
--- a/include/vcl/GraphicNativeMetadata.hxx
+++ b/include/vcl/GraphicNativeMetadata.hxx
@@ -21,10 +21,11 @@
#include <vcl/graph.hxx>
#include <tools/stream.hxx>
+#include <tools/degree.hxx>
class VCL_DLLPUBLIC GraphicNativeMetadata final
{
- sal_uInt16 mRotation;
+ Degree10 mRotation;
public:
GraphicNativeMetadata();
@@ -33,8 +34,8 @@ public:
bool read(Graphic const& rGraphic);
bool read(SvStream& rStream);
- // counter-clock-wise rotation in permille
- sal_uInt16 getRotation() const { return mRotation; }
+ // counter-clock-wise rotation 10ths of a degree
+ Degree10 getRotation() const { return mRotation; }
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/GraphicNativeTransform.hxx b/include/vcl/GraphicNativeTransform.hxx
index b4d71f2d53d0..3b05ac323232 100644
--- a/include/vcl/GraphicNativeTransform.hxx
+++ b/include/vcl/GraphicNativeTransform.hxx
@@ -20,6 +20,7 @@
#pragma once
#include <rtl/ustring.hxx>
+#include <tools/degree.hxx>
#include <sal/types.h>
#include <vcl/dllapi.h>
@@ -29,15 +30,15 @@ class VCL_DLLPUBLIC GraphicNativeTransform final
{
Graphic& mrGraphic;
- bool rotateBitmapOnly(sal_uInt16 aRotation);
- void rotateJPEG(sal_uInt16 aRotation);
- bool rotateGeneric(sal_uInt16 aRotation, const OUString& aType);
+ bool rotateBitmapOnly(Degree10 aRotation);
+ void rotateJPEG(Degree10 aRotation);
+ bool rotateGeneric(Degree10 aRotation, const OUString& aType);
public:
GraphicNativeTransform(Graphic& rGraphic);
~GraphicNativeTransform();
- void rotate(sal_uInt16 aRotation);
+ void rotate(Degree10 aRotation);
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx
index 932bab285784..74d3a2e11724 100644
--- a/include/vcl/bitmap.hxx
+++ b/include/vcl/bitmap.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_VCL_BITMAP_HXX
#include <tools/solar.h>
+#include <tools/degree.hxx>
#include <vcl/checksum.hxx>
#include <vcl/dllapi.h>
#include <vcl/mapmod.hxx>
@@ -349,7 +350,7 @@ public:
@return true, if the operation was completed successfully.
*/
- bool Rotate( tools::Long nAngle10, const Color& rFillColor );
+ bool Rotate( Degree10 nAngle10, const Color& rFillColor );
/** Create on-off mask from bitmap
diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx
index 7c9eb69383c1..dc9f8a837502 100644
--- a/include/vcl/bitmapex.hxx
+++ b/include/vcl/bitmapex.hxx
@@ -24,6 +24,7 @@
#include <vcl/alpha.hxx>
#include <vcl/Scanline.hxx>
#include <tools/color.hxx>
+#include <tools/degree.hxx>
#include <sal/types.h>
@@ -233,7 +234,7 @@ public:
@return true, if the operation was completed successfully.
*/
bool Rotate(
- tools::Long nAngle10,
+ Degree10 nAngle10,
const Color& rFillColor );
/** Replace all pixel having the search color with the specified color
diff --git a/include/vcl/cursor.hxx b/include/vcl/cursor.hxx
index 3937c0e48c4e..ff66326d90b9 100644
--- a/include/vcl/cursor.hxx
+++ b/include/vcl/cursor.hxx
@@ -50,7 +50,7 @@ private:
VclPtr<vcl::Window> mpWindow; // only for shadow cursor
Size maSize;
Point maPos;
- short mnOrientation;
+ Degree10 mnOrientation;
sal_uInt16 mnStyle;
bool mbVisible;
CursorDirection mnDirection;
@@ -87,7 +87,7 @@ public:
tools::Long GetWidth() const { return maSize.Width(); }
tools::Long GetHeight() const { return maSize.Height(); }
- void SetOrientation( short nOrientation = 0 );
+ void SetOrientation( Degree10 nOrientation = Degree10(0) );
void SetDirection( CursorDirection nDirection = CursorDirection::NONE );
diff --git a/include/vcl/font.hxx b/include/vcl/font.hxx
index 02f4a6d3f264..2d437c5b3da0 100644
--- a/include/vcl/font.hxx
+++ b/include/vcl/font.hxx
@@ -26,6 +26,7 @@
#include <tools/color.hxx>
#include <tools/fontenum.hxx>
#include <tools/long.hxx>
+#include <tools/degree.hxx>
#include <i18nlangtag/lang.h>
#include <vcl/fntstyle.hxx>
#include <o3tl/cow_wrapper.hxx>
@@ -122,8 +123,8 @@ public:
void SetCJKContextLanguage( LanguageType );
LanguageType GetCJKContextLanguage() const;
- void SetOrientation( short nLineOrientation );
- short GetOrientation() const;
+ void SetOrientation( Degree10 nLineOrientation );
+ Degree10 GetOrientation() const;
void SetVertical( bool bVertical );
bool IsVertical() const;
void SetKerning( FontKerning nKerning );
diff --git a/include/vcl/gdimtf.hxx b/include/vcl/gdimtf.hxx
index bb20b618719a..202480faa818 100644
--- a/include/vcl/gdimtf.hxx
+++ b/include/vcl/gdimtf.hxx
@@ -116,7 +116,7 @@ public:
void Move( tools::Long nX, tools::Long nY, tools::Long nDPIX, tools::Long nDPIY );
void Scale( double fScaleX, double fScaleY );
void Scale( const Fraction& rScaleX, const Fraction& rScaleY );
- void Rotate( tools::Long nAngle10 );
+ void Rotate( Degree10 nAngle10 );
void Clip( const tools::Rectangle& );
bool HasTransparentActions() const;
diff --git a/include/vcl/gradient.hxx b/include/vcl/gradient.hxx
index aee89e06b50e..f2336d797703 100644
--- a/include/vcl/gradient.hxx
+++ b/include/vcl/gradient.hxx
@@ -23,6 +23,7 @@
#include <sal/types.h>
#include <vcl/dllapi.h>
#include <tools/color.hxx>
+#include <tools/degree.hxx>
#include <vcl/vclenum.hxx>
#include <o3tl/cow_wrapper.hxx>
@@ -56,8 +57,8 @@ public:
void SetEndColor( const Color& rColor );
const Color& GetEndColor() const;
- void SetAngle( sal_uInt16 nAngle );
- sal_uInt16 GetAngle() const;
+ void SetAngle( Degree10 nAngle );
+ Degree10 GetAngle() const;
void SetBorder( sal_uInt16 nBorder );
sal_uInt16 GetBorder() const;
diff --git a/include/vcl/hatch.hxx b/include/vcl/hatch.hxx
index 92afd57b6126..713f22b95dd1 100644
--- a/include/vcl/hatch.hxx
+++ b/include/vcl/hatch.hxx
@@ -22,6 +22,7 @@
#include <tools/color.hxx>
#include <tools/long.hxx>
+#include <tools/degree.hxx>
#include <vcl/dllapi.h>
#include <vcl/vclenum.hxx>
@@ -35,7 +36,7 @@ struct ImplHatch
Color maColor;
HatchStyle meStyle;
tools::Long mnDistance;
- sal_uInt16 mnAngle;
+ Degree10 mnAngle;
ImplHatch();
@@ -48,7 +49,7 @@ public:
Hatch();
Hatch( const Hatch& rHatch );
- Hatch( HatchStyle eStyle, const Color& rHatchColor, tools::Long nDistance, sal_uInt16 nAngle10 );
+ Hatch( HatchStyle eStyle, const Color& rHatchColor, tools::Long nDistance, Degree10 nAngle10 );
~Hatch();
Hatch& operator=( const Hatch& rHatch );
@@ -63,8 +64,8 @@ public:
void SetDistance( tools::Long nDistance );
tools::Long GetDistance() const { return mpImplHatch->mnDistance; }
- void SetAngle( sal_uInt16 nAngle10 );
- sal_uInt16 GetAngle() const { return mpImplHatch->mnAngle; }
+ void SetAngle( Degree10 nAngle10 );
+ Degree10 GetAngle() const { return mpImplHatch->mnAngle; }
friend SvStream& ReadHatch( SvStream& rIStm, Hatch& rHatch );
friend SvStream& WriteHatch( SvStream& rOStm, const Hatch& rHatch );
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index e1f6b17c47a0..60664ce3de02 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -959,7 +959,7 @@ public:
private:
- SAL_DLLPRIVATE void CalcHatchValues( const tools::Rectangle& rRect, tools::Long nDist, sal_uInt16 nAngle10, Point& rPt1, Point& rPt2, Size& rInc, Point& rEndPt1 );
+ SAL_DLLPRIVATE void CalcHatchValues( const tools::Rectangle& rRect, tools::Long nDist, Degree10 nAngle10, Point& rPt1, Point& rPt2, Size& rInc, Point& rEndPt1 );
SAL_DLLPRIVATE void DrawHatchLine( const tools::Line& rLine, const tools::PolyPolygon& rPolyPoly, Point* pPtBuffer, bool bMtf );
///@}
@@ -1207,9 +1207,9 @@ private:
SAL_DLLPRIVATE void ImplDrawSpecialText( SalLayout& );
SAL_DLLPRIVATE void ImplDrawTextRect( tools::Long nBaseX, tools::Long nBaseY, tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight );
- SAL_DLLPRIVATE static void ImplDrawWavePixel( tools::Long nOriginX, tools::Long nOriginY, tools::Long nCurX, tools::Long nCurY, short nOrientation, SalGraphics* pGraphics, OutputDevice const * pOutDev,
+ SAL_DLLPRIVATE static void ImplDrawWavePixel( tools::Long nOriginX, tools::Long nOriginY, tools::Long nCurX, tools::Long nCurY, Degree10 nOrientation, SalGraphics* pGraphics, OutputDevice const * pOutDev,
bool bDrawPixAsRect, tools::Long nPixWidth, tools::Long nPixHeight );
- SAL_DLLPRIVATE void ImplDrawWaveLine( tools::Long nBaseX, tools::Long nBaseY, tools::Long nStartX, tools::Long nStartY, tools::Long nWidth, tools::Long nHeight, tools::Long nLineWidth, short nOrientation, const Color& rColor );
+ SAL_DLLPRIVATE void ImplDrawWaveLine( tools::Long nBaseX, tools::Long nBaseY, tools::Long nStartX, tools::Long nStartY, tools::Long nWidth, tools::Long nHeight, tools::Long nLineWidth, Degree10 nOrientation, const Color& rColor );
SAL_DLLPRIVATE void ImplDrawWaveTextLine( tools::Long nBaseX, tools::Long nBaseY, tools::Long nX, tools::Long nY, tools::Long nWidth, FontLineStyle eTextLine, Color aColor, bool bIsAbove );
SAL_DLLPRIVATE void ImplDrawStraightTextLine( tools::Long nBaseX, tools::Long nBaseY, tools::Long nX, tools::Long nY, tools::Long nWidth, FontLineStyle eTextLine, Color aColor, bool bIsAbove );
SAL_DLLPRIVATE void ImplDrawStrikeoutLine( tools::Long nBaseX, tools::Long nBaseY, tools::Long nX, tools::Long nY, tools::Long nWidth, FontStrikeout eStrikeout, Color aColor );
diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index 8a5b9d2f502b..8546e3870418 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -26,6 +26,7 @@
#include <vcl/image.hxx>
#include <vcl/keycod.hxx>
#include <o3tl/typed_flags_set.hxx>
+#include <tools/degree.hxx>
#include <limits>
#include <memory>
@@ -114,7 +115,7 @@ private:
tools::Long mnBottomBorder;
tools::Long mnLastResizeDY;
tools::Long mnActivateCount;
- tools::Long mnImagesRotationAngle;
+ Degree10 mnImagesRotationAngle;
sal_uInt16 mnLastFocusItemId;
sal_uInt16 mnOutStyle;
sal_uInt16 mnHighItemId;
@@ -369,7 +370,7 @@ public:
void* GetItemData( sal_uInt16 nItemId ) const;
void SetItemImage( sal_uInt16 nItemId, const Image& rImage );
Image GetItemImage( sal_uInt16 nItemId ) const;
- void SetItemImageAngle( sal_uInt16 nItemId, tools::Long nAngle10 );
+ void SetItemImageAngle( sal_uInt16 nItemId, Degree10 nAngle10 );
void SetItemImageMirrorMode( sal_uInt16 nItemId, bool bMirror );
void SetItemText( sal_uInt16 nItemId, const OUString& rText );
const OUString& GetItemText( sal_uInt16 nItemId ) const;
diff --git a/include/vcl/vcllayout.hxx b/include/vcl/vcllayout.hxx
index ea8da12b7a9d..7d53d12bd40b 100644
--- a/include/vcl/vcllayout.hxx
+++ b/include/vcl/vcllayout.hxx
@@ -22,6 +22,7 @@
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <tools/gen.hxx>
+#include <tools/degree.hxx>
#include <vcl/devicecoordinate.hxx>
#include <vcl/dllapi.h>
@@ -78,7 +79,7 @@ public:
virtual void DrawText( SalGraphics& ) const = 0;
int GetUnitsPerPixel() const { return mnUnitsPerPixel; }
- int GetOrientation() const { return mnOrientation; }
+ Degree10 GetOrientation() const { return mnOrientation; }
// methods using string indexing
virtual sal_Int32 GetTextBreak(DeviceCoordinate nMaxWidth, DeviceCoordinate nCharExtra, int nFactor) const = 0;
@@ -108,7 +109,7 @@ protected:
int mnEndCharPos;
int mnUnitsPerPixel;
- int mnOrientation;
+ Degree10 mnOrientation;
mutable Point maDrawOffset;
Point maDrawBase;
diff --git a/offapi/com/sun/star/drawing/Hatch.idl b/offapi/com/sun/star/drawing/Hatch.idl
index 99c1da0b029f..d7802bdb9379 100644
--- a/offapi/com/sun/star/drawing/Hatch.idl
+++ b/offapi/com/sun/star/drawing/Hatch.idl
@@ -47,6 +47,7 @@ published struct Hatch
long Distance;
/** You can rotate the lines of the hatch with this angle.
+ * Specificied in tenths of a degree.
*/
long Angle;
diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx
index 655e177d94f3..5b68eb3e60ea 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -72,7 +72,7 @@ Reference< XGraphic > lclCheckAndApplyDuotoneTransform(const BlipFillProperties&
return xGraphic;
}
-Reference< XGraphic > lclRotateGraphic(uno::Reference<graphic::XGraphic> const & xGraphic, long nRotation)
+Reference< XGraphic > lclRotateGraphic(uno::Reference<graphic::XGraphic> const & xGraphic, Degree10 nRotation)
{
::Graphic aGraphic(xGraphic);
::Graphic aReturnGraphic;
@@ -771,7 +771,7 @@ void GraphicProperties::pushToPropMap( PropertyMap& rPropMap, const GraphicHelpe
if(rPropMap.hasProperty(PROP_RotateAngle))
{
long nAngle = rPropMap.getProperty(PROP_RotateAngle).get<long>();
- xGraphic = lclRotateGraphic(xGraphic, nAngle/10 );
+ xGraphic = lclRotateGraphic(xGraphic, Degree10(nAngle/10) );
}
rPropMap.setProperty(PROP_FillBitmap, xGraphic);
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 2b1251660cee..00f94294f1fe 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -844,7 +844,7 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape )
// Remove rotation
bool bInvertRotation = bFlipH != bFlipV;
if (nRotation != 0)
- aPolyPolygon.Rotate(Point(0,0), static_cast<sal_uInt16>(bInvertRotation ? nRotation/10 : 3600-nRotation/10));
+ aPolyPolygon.Rotate(Point(0,0), Degree10(static_cast<sal_Int16>(bInvertRotation ? nRotation/10 : 3600-nRotation/10)));
WritePolyPolygon(xShape, aPolyPolygon, false);
}
else if (bCustGeom)
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
index 718354514e91..019d3b5c4746 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -351,7 +351,7 @@ namespace
_rItemSet.Put(SvxEmphasisMarkItem(static_cast<FontEmphasisMark>(_rxReportControlFormat->getCharEmphasis()),ITEMID_EMPHASISMARK));
_rItemSet.Put(SvxCharReliefItem(static_cast<FontRelief>(_rxReportControlFormat->getCharRelief()),ITEMID_CHARRELIEF));
_rItemSet.Put(SvxColorItem(::Color(_rxReportControlFormat->getCharColor()),ITEMID_COLOR));
- _rItemSet.Put(SvxCharRotateItem(_rxReportControlFormat->getCharRotation(),false,ITEMID_CHARROTATE));
+ _rItemSet.Put(SvxCharRotateItem(Degree10(_rxReportControlFormat->getCharRotation()),false,ITEMID_CHARROTATE));
_rItemSet.Put(SvxCharScaleWidthItem(_rxReportControlFormat->getCharScaleWidth(),ITEMID_CHARSCALE_W));
SvxHorJustifyItem aHorJustifyItem(ITEMID_HORJUSTIFY);
@@ -723,7 +723,7 @@ bool openCharDialog( const uno::Reference<report::XReportControlFormat >& _rxRep
new SvxBlinkItem(false,ITEMID_BLINK),
new SvxEmphasisMarkItem(FontEmphasisMark::NONE,ITEMID_EMPHASISMARK),
new SvxTwoLinesItem(true,0,0,ITEMID_TWOLINES),
- new SvxCharRotateItem(0,false,ITEMID_CHARROTATE),
+ new SvxCharRotateItem(Degree10(0),false,ITEMID_CHARROTATE),
new SvxCharScaleWidthItem(100,ITEMID_CHARSCALE_W),
new SvxCharReliefItem(FontRelief::NONE,ITEMID_CHARRELIEF),
new SvxCharHiddenItem(false,ITEMID_CHARHIDDEN),
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();
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 );
diff --git a/sfx2/source/sidebar/Tools.cxx b/sfx2/source/sidebar/Tools.cxx
index eb936c4ff412..382914d8baba 100644
--- a/sfx2/source/sidebar/Tools.cxx
+++ b/sfx2/source/sidebar/Tools.cxx
@@ -67,7 +67,7 @@ css::awt::Gradient Tools::VclToAwtGradient (const Gradient& rVclGradient)
awt::GradientStyle(rVclGradient.GetStyle()),
sal_Int32(rVclGradient.GetStartColor().GetRGBColor()),
sal_Int32(rVclGradient.GetEndColor().GetRGBColor()),
- rVclGradient.GetAngle(),
+ rVclGradient.GetAngle().get(),
rVclGradient.GetBorder(),
rVclGradient.GetOfsX(),
rVclGradient.GetOfsY(),
@@ -83,7 +83,7 @@ Gradient Tools::AwtToVclGradient (const css::awt::Gradient& rAwtGradient)
GradientStyle(rAwtGradient.Style),
Color(rAwtGradient.StartColor),
Color(rAwtGradient.EndColor));
- aVclGradient.SetAngle(rAwtGradient.Angle);
+ aVclGradient.SetAngle(Degree10(rAwtGradient.Angle));
aVclGradient.SetBorder(rAwtGradient.Border);
aVclGradient.SetOfsX(rAwtGradient.XOffset);
aVclGradient.SetOfsY(rAwtGradient.YOffset);
diff --git a/slideshow/source/engine/shapes/shapeimporter.cxx b/slideshow/source/engine/shapes/shapeimporter.cxx
index b1b1b3417269..6d5b668efb00 100644
--- a/slideshow/source/engine/shapes/shapeimporter.cxx
+++ b/slideshow/source/engine/shapes/shapeimporter.cxx
@@ -296,7 +296,7 @@ ShapeSharedPtr ShapeImporter::createShape(
aGraphAttrs.SetChannelB( nBlue );
aGraphAttrs.SetGamma( nGamma );
aGraphAttrs.SetTransparency( static_cast<sal_uInt8>(nTransparency) );
- aGraphAttrs.SetRotation( static_cast<sal_uInt16>(nRotation*10) );
+ aGraphAttrs.SetRotation( Degree10(static_cast<sal_Int16>(nRotation*10)) );
text::GraphicCrop aGraphCrop;
if( getPropertyValue( aGraphCrop, xPropSet, "GraphicCrop" ))
diff --git a/svl/source/items/imageitm.cxx b/svl/source/items/imageitm.cxx
index 0fa250fc043b..7a2d528c1fce 100644
--- a/svl/source/items/imageitm.cxx
+++ b/svl/source/items/imageitm.cxx
@@ -24,27 +24,14 @@
SfxPoolItem* SfxImageItem::CreateDefault() { return new SfxImageItem; }
-struct SfxImageItem_Impl
-{
- OUString aURL;
- tools::Long nAngle;
- bool bMirrored;
- bool operator == ( const SfxImageItem_Impl& rOther ) const
- { return nAngle == rOther.nAngle && bMirrored == rOther.bMirrored; }
-};
-
-
SfxImageItem::SfxImageItem( sal_uInt16 which )
- : SfxInt16Item( which, 0 ),
- pImpl( new SfxImageItem_Impl)
+ : SfxInt16Item( which, 0 ), mnAngle(0), mbMirrored(false)
{
- pImpl->nAngle = 0;
- pImpl->bMirrored = false;
}
SfxImageItem::SfxImageItem( const SfxImageItem& rItem )
: SfxInt16Item( rItem ),
- pImpl( new SfxImageItem_Impl( *rItem.pImpl ) )
+ mnAngle(rItem.mnAngle), mbMirrored(rItem.mbMirrored)
{
}
@@ -59,17 +46,19 @@ SfxImageItem* SfxImageItem::Clone( SfxItemPool* ) const
bool SfxImageItem::operator==( const SfxPoolItem& rItem ) const
{
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list