solenv/clang-format/excludelist | 2 - vcl/Library_vcl.mk | 2 - vcl/qa/cppunit/outdev.cxx | 59 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 2 deletions(-)
New commits: commit c9517311f4c209f549668867c9b07ffa18246dee Author: Chris Sherlock <chris.sherloc...@gmail.com> AuthorDate: Wed Aug 25 18:49:34 2021 +1000 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Sep 10 18:33:37 2021 +0200 vcl: move outdevstate.cxx to stack.cxx Change-Id: I674be4eb758178468dbba70cb45d68d009952ebc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121024 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist index 0c69494826dd..3bde0f91e13d 100644 --- a/solenv/clang-format/excludelist +++ b/solenv/clang-format/excludelist @@ -15039,7 +15039,7 @@ vcl/source/outdev/map.cxx vcl/source/outdev/mask.cxx vcl/source/outdev/nativecontrols.cxx vcl/source/outdev/outdev.cxx -vcl/source/outdev/outdevstate.cxx +vcl/source/outdev/stack.cxx vcl/source/outdev/pixel.cxx vcl/source/outdev/polygon.cxx vcl/source/outdev/polyline.cxx diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 45f3b543a443..f99e9ae51ac0 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -215,7 +215,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/toolkit/morebtn \ vcl/source/outdev/background \ vcl/source/outdev/outdev \ - vcl/source/outdev/outdevstate \ + vcl/source/outdev/stack \ vcl/source/outdev/clipping \ vcl/source/outdev/fill \ vcl/source/outdev/polygon \ diff --git a/vcl/qa/cppunit/outdev.cxx b/vcl/qa/cppunit/outdev.cxx index ddf3344244bf..fd9f5936f7f8 100644 --- a/vcl/qa/cppunit/outdev.cxx +++ b/vcl/qa/cppunit/outdev.cxx @@ -62,6 +62,7 @@ public: void testDrawMode(); void testLayoutMode(); void testDigitLanguage(); + void testStackFunctions(); void testSystemTextColor(); void testShouldDrawWavePixelAsRect(); void testGetWaveLineSize(); @@ -100,6 +101,7 @@ public: CPPUNIT_TEST(testDrawMode); CPPUNIT_TEST(testLayoutMode); CPPUNIT_TEST(testDigitLanguage); + CPPUNIT_TEST(testStackFunctions); CPPUNIT_TEST(testSystemTextColor); CPPUNIT_TEST(testShouldDrawWavePixelAsRect); CPPUNIT_TEST(testGetWaveLineSize); @@ -869,6 +871,63 @@ void VclOutdevTest::testDigitLanguage() CPPUNIT_ASSERT_EQUAL(LANGUAGE_GERMAN, pTextLanguageAction->GetTextLanguage()); } +void VclOutdevTest::testStackFunctions() +{ + ScopedVclPtrInstance<VirtualDevice> pVDev; + GDIMetaFile aMtf; + aMtf.Record(pVDev.get()); + + pVDev->Push(); + MetaAction* pAction = aMtf.GetAction(0); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Push action", MetaActionType::PUSH, pAction->GetType()); + + pVDev->SetLineColor(COL_RED); + pVDev->SetFillColor(COL_GREEN); + pVDev->SetTextColor(COL_BROWN); + pVDev->SetTextFillColor(COL_BLUE); + pVDev->SetTextLineColor(COL_MAGENTA); + pVDev->SetOverlineColor(COL_YELLOW); + pVDev->SetTextAlign(TextAlign::ALIGN_TOP); + pVDev->SetLayoutMode(ComplexTextLayoutFlags::BiDiRtl); + pVDev->SetDigitLanguage(LANGUAGE_FRENCH); + pVDev->SetRasterOp(RasterOp::N0); + pVDev->SetMapMode(MapMode(MapUnit::MapTwip)); + pVDev->SetRefPoint(Point(10, 10)); + + CPPUNIT_ASSERT_EQUAL_MESSAGE("Text color", COL_BROWN, pVDev->GetTextColor()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Text fill color", COL_BLUE, pVDev->GetTextFillColor()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Text line color", COL_MAGENTA, pVDev->GetTextLineColor()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Text overline color", COL_YELLOW, pVDev->GetOverlineColor()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Layout mode", ComplexTextLayoutFlags::BiDiRtl, + pVDev->GetLayoutMode()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Language", LANGUAGE_FRENCH, pVDev->GetDigitLanguage()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Raster operation", RasterOp::N0, pVDev->GetRasterOp()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Map mode", MapMode(MapUnit::MapTwip), pVDev->GetMapMode()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Ref point", Point(10, 10), pVDev->GetRefPoint()); + + pVDev->Pop(); + pAction = aMtf.GetAction(13); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Pop action", MetaActionType::POP, pAction->GetType()); + + CPPUNIT_ASSERT_EQUAL_MESSAGE("Default line color", COL_BLACK, pVDev->GetLineColor()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Default fill color", COL_WHITE, pVDev->GetFillColor()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Default text color", COL_BLACK, pVDev->GetTextColor()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Default text fill color", Color(ColorTransparency, 0xFFFFFFFF), + pVDev->GetTextFillColor()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Default text line color", Color(ColorTransparency, 0xFFFFFFFF), + pVDev->GetTextLineColor()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Default overline color", Color(ColorTransparency, 0xFFFFFFFF), + pVDev->GetOverlineColor()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Default layout mode", ComplexTextLayoutFlags::Default, + pVDev->GetLayoutMode()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Default language", LANGUAGE_SYSTEM, pVDev->GetDigitLanguage()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Default raster operation", RasterOp::OverPaint, + pVDev->GetRasterOp()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Default map mode", MapMode(MapUnit::MapPixel), + pVDev->GetMapMode()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Default ref point", Point(0, 0), pVDev->GetRefPoint()); +} + void VclOutdevTest::testSystemTextColor() { { diff --git a/vcl/source/outdev/outdevstate.cxx b/vcl/source/outdev/stack.cxx similarity index 100% rename from vcl/source/outdev/outdevstate.cxx rename to vcl/source/outdev/stack.cxx