[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - vcl/CppunitTest_vcl_outdev.mk vcl/qa vcl/source

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Mon Dec 23 13:37:12 UTC 2019


 vcl/CppunitTest_vcl_outdev.mk      |    1 +
 vcl/qa/cppunit/outdev.cxx          |   15 +++++++++++++++
 vcl/source/window/bufferdevice.cxx |    1 +
 vcl/source/window/bufferdevice.hxx |    2 +-
 4 files changed, 18 insertions(+), 1 deletion(-)

New commits:
commit 7b9afea6d34ec83de75ddcd5c45188c4cf949b90
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Fri Dec 20 18:05:35 2019 +0100
Commit:     Xisco Faulí <xiscofauli at libreoffice.org>
CommitDate: Mon Dec 23 14:36:31 2019 +0100

    tdf#127022 vcl: fix Windows RTL menu bar
    
    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 <vmiklos at collabora.com>
    Tested-by: Jenkins
    Reviewed-on: https://gerrit.libreoffice.org/85636
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Signed-off-by: Xisco Fauli <xiscofauli at libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/85735

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 455169e39966..e6b4b074868d 100644
--- a/vcl/qa/cppunit/outdev.cxx
+++ b/vcl/qa/cppunit/outdev.cxx
@@ -13,6 +13,7 @@
 #include <vcl/virdev.hxx>
 #include <vcl/bitmapaccess.hxx>
 #include <vcl/wrkwin.hxx>
+#include <bufferdevice.hxx>
 
 #include <tools/stream.hxx>
 #include <vcl/pngwrite.hxx>
@@ -26,10 +27,12 @@ public:
 
     void testVirtualDevice();
     void testUseAfterDispose();
+    void testRTL();
 
     CPPUNIT_TEST_SUITE(VclOutdevTest);
     CPPUNIT_TEST(testVirtualDevice);
     CPPUNIT_TEST(testUseAfterDispose);
+    CPPUNIT_TEST(testRTL);
     CPPUNIT_TEST_SUITE_END();
 };
 
@@ -97,6 +100,18 @@ void VclOutdevTest::testUseAfterDispose()
     pVDev->GetViewTransformation();
 }
 
+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;


More information about the Libreoffice-commits mailing list