diff options
-rw-r--r-- | vcl/CppunitTest_vcl_outdev.mk | 1 | ||||
-rw-r--r-- | vcl/qa/cppunit/outdev.cxx | 15 | ||||
-rw-r--r-- | vcl/source/window/bufferdevice.cxx | 1 | ||||
-rw-r--r-- | vcl/source/window/bufferdevice.hxx | 2 |
4 files changed, 18 insertions, 1 deletions
diff --git a/vcl/CppunitTest_vcl_outdev.mk b/vcl/CppunitTest_vcl_outdev.mk index f15d2e26d17d..65fd6b5fa17e 100644 --- a/vcl/CppunitTest_vcl_outdev.mk +++ b/vcl/CppunitTest_vcl_outdev.mk @@ -12,6 +12,7 @@ $(eval $(call gb_CppunitTest_CppunitTest,vcl_outdev)) $(eval $(call gb_CppunitTest_set_include,vcl_outdev,\ $$(INCLUDE) \ -I$(SRCDIR)/vcl/inc \ + -I$(SRCDIR)/vcl/source/window \ )) $(eval $(call gb_CppunitTest_add_exception_objects,vcl_outdev, \ diff --git a/vcl/qa/cppunit/outdev.cxx b/vcl/qa/cppunit/outdev.cxx index 8b2dd7c3a841..2f42412e75aa 100644 --- a/vcl/qa/cppunit/outdev.cxx +++ b/vcl/qa/cppunit/outdev.cxx @@ -16,6 +16,7 @@ #include <vcl/gdimtf.hxx> #include <vcl/metaact.hxx> #include <bitmapwriteaccess.hxx> +#include <bufferdevice.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> @@ -32,6 +33,7 @@ public: void testGetReadableFontColorWindow(); void testDrawTransformedBitmapEx(); void testDrawTransformedBitmapExFlip(); + void testRTL(); CPPUNIT_TEST_SUITE(VclOutdevTest); CPPUNIT_TEST(testVirtualDevice); @@ -42,6 +44,7 @@ public: CPPUNIT_TEST(testGetReadableFontColorWindow); CPPUNIT_TEST(testDrawTransformedBitmapEx); CPPUNIT_TEST(testDrawTransformedBitmapExFlip); + CPPUNIT_TEST(testRTL); CPPUNIT_TEST_SUITE_END(); }; @@ -254,6 +257,18 @@ void VclOutdevTest::testDrawTransformedBitmapExFlip() CPPUNIT_ASSERT_EQUAL_MESSAGE(ss.str(), COL_BLACK, Color(aColor)); } +void VclOutdevTest::testRTL() +{ + ScopedVclPtrInstance<vcl::Window> pWindow(nullptr, WB_APP | WB_STDWORK); + pWindow->EnableRTL(); + vcl::RenderContext& rRenderContext = *pWindow; + vcl::BufferDevice pBuffer(pWindow, rRenderContext); + + // Without the accompanying fix in place, this test would have failed, because the RTL status + // from pWindow was not propagated to pBuffer. + CPPUNIT_ASSERT(pBuffer->IsRTLEnabled()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(VclOutdevTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/vcl/source/window/bufferdevice.cxx b/vcl/source/window/bufferdevice.cxx index d1480588d48f..0092d1ab97e4 100644 --- a/vcl/source/window/bufferdevice.cxx +++ b/vcl/source/window/bufferdevice.cxx @@ -20,6 +20,7 @@ BufferDevice::BufferDevice(const VclPtr<vcl::Window>& pWindow, vcl::RenderContex m_pBuffer->SetTextColor(rRenderContext.GetTextColor()); m_pBuffer->DrawOutDev(Point(0, 0), pWindow->GetOutputSizePixel(), Point(0, 0), pWindow->GetOutputSizePixel(), rRenderContext); + m_pBuffer->EnableRTL(rRenderContext.IsRTLEnabled()); } BufferDevice::~BufferDevice() diff --git a/vcl/source/window/bufferdevice.hxx b/vcl/source/window/bufferdevice.hxx index 26bf28e615fa..5f2471cd26d9 100644 --- a/vcl/source/window/bufferdevice.hxx +++ b/vcl/source/window/bufferdevice.hxx @@ -16,7 +16,7 @@ namespace vcl { /// Buffers drawing on a vcl::RenderContext using a VirtualDevice. -class BufferDevice +class VCL_DLLPUBLIC BufferDevice { ScopedVclPtr<VirtualDevice> m_pBuffer; VclPtr<vcl::Window> m_pWindow; |