diff options
Diffstat (limited to 'vcl/qa/cppunit/outdev.cxx')
-rw-r--r-- | vcl/qa/cppunit/outdev.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/vcl/qa/cppunit/outdev.cxx b/vcl/qa/cppunit/outdev.cxx index 2f42412e75aa..e99a35f67adf 100644 --- a/vcl/qa/cppunit/outdev.cxx +++ b/vcl/qa/cppunit/outdev.cxx @@ -17,6 +17,7 @@ #include <vcl/metaact.hxx> #include <bitmapwriteaccess.hxx> #include <bufferdevice.hxx> +#include <window.h> #include <basegfx/matrix/b2dhommatrix.hxx> @@ -34,6 +35,7 @@ public: void testDrawTransformedBitmapEx(); void testDrawTransformedBitmapExFlip(); void testRTL(); + void testRTLGuard(); CPPUNIT_TEST_SUITE(VclOutdevTest); CPPUNIT_TEST(testVirtualDevice); @@ -45,6 +47,7 @@ public: CPPUNIT_TEST(testDrawTransformedBitmapEx); CPPUNIT_TEST(testDrawTransformedBitmapExFlip); CPPUNIT_TEST(testRTL); + CPPUNIT_TEST(testRTLGuard); CPPUNIT_TEST_SUITE_END(); }; @@ -269,6 +272,18 @@ void VclOutdevTest::testRTL() CPPUNIT_ASSERT(pBuffer->IsRTLEnabled()); } +void VclOutdevTest::testRTLGuard() +{ + ScopedVclPtrInstance<vcl::Window> pWindow(nullptr, WB_APP | WB_STDWORK); + pWindow->EnableRTL(); + pWindow->RequestDoubleBuffering(true); + ImplFrameData* pFrameData = pWindow->ImplGetWindowImpl()->mpFrameData; + vcl::PaintBufferGuard aGuard(pFrameData, pWindow); + // Without the accompanying fix in place, this test would have failed, because the RTL status + // from pWindow was not propagated to aGuard. + CPPUNIT_ASSERT(aGuard.GetRenderContext()->IsRTLEnabled()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(VclOutdevTest); CPPUNIT_PLUGIN_IMPLEMENT(); |