summaryrefslogtreecommitdiff
path: root/vcl/qa/cppunit
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-01-02 18:02:41 +0100
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2020-01-06 15:55:39 +0100
commit9aa7da21e428111cbc708107c4efd75df4ea1fa2 (patch)
tree17523572d16455725be6e4de42ef2f1af64024a3 /vcl/qa/cppunit
parent4ddf3d035f8db1271df23b1e219a7c4a135297a3 (diff)
tdf#129662 vcl: rtl: fix scrollbar in dropdowns
Regression from commit d4714b0fdb81e6e561ae526cc517ecc9a40a603e (tdf#101978 vcl combobox/listbox floating window: avoid flicker, 2019-06-17). High-level vcl double-buffering never set up RTL status of the virtual device correctly, but now that double-buffering is used at more places, this got noticed. (cherry picked from commit b0fa356eed82a0452e6bcb915f179f5e2d02943a) Conflicts: vcl/source/window/cursor.cxx Change-Id: Iba378cef3a693b0712389fab519f38ee222577d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86158 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'vcl/qa/cppunit')
-rw-r--r--vcl/qa/cppunit/outdev.cxx15
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();