summaryrefslogtreecommitdiff
path: root/vcl/qa
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2020-10-20 07:27:44 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-10-21 08:13:05 +0200
commit0fb58a1ff168ae122e9c8993a3136658e3b0e3f0 (patch)
tree908983b02f466e0a49599edc70aaa1baaa240371 /vcl/qa
parentb84afd2188d6993c91081885dc24664bd3f1cc73 (diff)
new tools::Degree10 strong typedef
partly to flush some use of "long" out the codebase, but also to make it obvious which units are being used for angle values. Change-Id: I1dc22494ca42c4677a63f685d5903f2b89886dc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104548 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/qa')
-rw-r--r--vcl/qa/cppunit/GraphicNativeMetadataTest.cxx12
-rw-r--r--vcl/qa/cppunit/TypeSerializerTest.cxx4
-rw-r--r--vcl/qa/cppunit/svm/svmtest.cxx4
3 files changed, 10 insertions, 10 deletions
diff --git a/vcl/qa/cppunit/GraphicNativeMetadataTest.cxx b/vcl/qa/cppunit/GraphicNativeMetadataTest.cxx
index 7e5d1adcba66..42683a1a3f06 100644
--- a/vcl/qa/cppunit/GraphicNativeMetadataTest.cxx
+++ b/vcl/qa/cppunit/GraphicNativeMetadataTest.cxx
@@ -46,7 +46,7 @@ void GraphicNativeMetadataTest::testReadFromGraphic()
{
GraphicNativeMetadata aMetadata;
aMetadata.read(aFileStream);
- CPPUNIT_ASSERT_EQUAL(sal_uInt16(1800), aMetadata.getRotation());
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(1800), aMetadata.getRotation().get());
// just the metadata shouldn't make the graphic available
CPPUNIT_ASSERT_EQUAL(false, aGraphic.isAvailable());
}
@@ -58,7 +58,7 @@ void GraphicNativeMetadataTest::testReadFromGraphic()
GraphicNativeMetadata aMetadata;
aMetadata.read(aFileStream);
- CPPUNIT_ASSERT_EQUAL(sal_uInt16(1800), aMetadata.getRotation());
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(1800), aMetadata.getRotation().get());
}
}
@@ -69,28 +69,28 @@ void GraphicNativeMetadataTest::testExifRotationJpeg()
SvFileStream aFileStream(getFullUrl("Exif1.jpg"), StreamMode::READ);
GraphicNativeMetadata aMetadata;
aMetadata.read(aFileStream);
- CPPUNIT_ASSERT_EQUAL(sal_uInt16(0), aMetadata.getRotation());
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(0), aMetadata.getRotation().get());
}
{
// Rotation 90 degree clock-wise = 270 degree counter-clock-wise
SvFileStream aFileStream(getFullUrl("Exif1_090CW.jpg"), StreamMode::READ);
GraphicNativeMetadata aMetadata;
aMetadata.read(aFileStream);
- CPPUNIT_ASSERT_EQUAL(sal_uInt16(2700), aMetadata.getRotation());
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(2700), aMetadata.getRotation().get());
}
{
// Rotation 180 degree
SvFileStream aFileStream(getFullUrl("Exif1_180.jpg"), StreamMode::READ);
GraphicNativeMetadata aMetadata;
aMetadata.read(aFileStream);
- CPPUNIT_ASSERT_EQUAL(sal_uInt16(1800), aMetadata.getRotation());
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(1800), aMetadata.getRotation().get());
}
{
// Rotation 270 degree clock-wise = 90 degree counter-clock-wise
SvFileStream aFileStream(getFullUrl("Exif1_270CW.jpg"), StreamMode::READ);
GraphicNativeMetadata aMetadata;
aMetadata.read(aFileStream);
- CPPUNIT_ASSERT_EQUAL(sal_uInt16(900), aMetadata.getRotation());
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(900), aMetadata.getRotation().get());
}
}
diff --git a/vcl/qa/cppunit/TypeSerializerTest.cxx b/vcl/qa/cppunit/TypeSerializerTest.cxx
index 30966700a3a3..fd45662bdf20 100644
--- a/vcl/qa/cppunit/TypeSerializerTest.cxx
+++ b/vcl/qa/cppunit/TypeSerializerTest.cxx
@@ -87,7 +87,7 @@ TypeSerializerTest::~TypeSerializerTest()
void TypeSerializerTest::testGradient()
{
Gradient aGradient(GradientStyle::Radial, Color(0xFF, 0x00, 0x00), Color(0x00, 0xFF, 0x00));
- aGradient.SetAngle(900);
+ aGradient.SetAngle(Degree10(900));
aGradient.SetBorder(5);
aGradient.SetOfsX(11);
aGradient.SetOfsY(12);
@@ -105,7 +105,7 @@ void TypeSerializerTest::testGradient()
CPPUNIT_ASSERT_EQUAL(GradientStyle::Radial, aReadGradient.GetStyle());
CPPUNIT_ASSERT_EQUAL(Color(0xFF, 0x00, 0x00), aReadGradient.GetStartColor());
CPPUNIT_ASSERT_EQUAL(Color(0x00, 0xFF, 0x00), aReadGradient.GetEndColor());
- CPPUNIT_ASSERT_EQUAL(sal_uInt16(900), aReadGradient.GetAngle());
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(900), aReadGradient.GetAngle().get());
CPPUNIT_ASSERT_EQUAL(sal_uInt16(5), aReadGradient.GetBorder());
CPPUNIT_ASSERT_EQUAL(sal_uInt16(11), aReadGradient.GetOfsX());
CPPUNIT_ASSERT_EQUAL(sal_uInt16(12), aReadGradient.GetOfsY());
diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx
index 17878c0656e6..f3ed205b4d8f 100644
--- a/vcl/qa/cppunit/svm/svmtest.cxx
+++ b/vcl/qa/cppunit/svm/svmtest.cxx
@@ -1271,7 +1271,7 @@ void SvmTest::testGradient()
aGradient2.SetStyle(GradientStyle::Radial);
aGradient2.SetStartColor(COL_LIGHTRED);
aGradient2.SetEndColor(COL_LIGHTGREEN);
- aGradient2.SetAngle(55);
+ aGradient2.SetAngle(Degree10(55));
aGradient2.SetBorder(10);
aGradient2.SetOfsX(22);
aGradient2.SetOfsY(24);
@@ -1323,7 +1323,7 @@ void SvmTest::testHatch()
tools::PolyPolygon aPolyPolygon(1);
aPolyPolygon.Insert(aPolygon);
- Hatch aHatch(HatchStyle::Single, COL_YELLOW, 15, 900);
+ Hatch aHatch(HatchStyle::Single, COL_YELLOW, 15, Degree10(900));
pVirtualDev->DrawHatch(aPolyPolygon, aHatch);