From 053da119bb5817651f52e83cd7ece45cfb59d196 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 20 Dec 2019 18:05:35 +0100 Subject: tdf#127022 vcl: fix Windows RTL menu bar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Regression from commit e8d5b8beb5958147235ff955ed38c47b51d860ff (tdf#113714 vcl menu bar window: avoid flicker, 2019-05-20), the problem was that while the original render context has RTL set up correctly, the intermediate virtual device had it disabled all the time. Change-Id: Ic063c4a6c0537891c0bfceb8927edb97cf1c6e86 Reviewed-on: https://gerrit.libreoffice.org/85624 Reviewed-by: Miklos Vajna Tested-by: Jenkins Reviewed-on: https://gerrit.libreoffice.org/85636 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- vcl/qa/cppunit/outdev.cxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'vcl/qa') 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 #include #include +#include #include @@ -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 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(); -- cgit