[Libreoffice-commits] core.git: toolkit/qa

Michael Stahl mstahl at redhat.com
Fri Jan 5 14:16:20 UTC 2018


 toolkit/qa/cppunit/UnitConversion.cxx |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

New commits:
commit 64f1d7ad58f7281c757411b7e890e220485a09bf
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Jan 4 23:27:08 2018 +0100

    toolkit: disable UnitConversion test for non-default resolution on WNT
    
    Apparently this fails currently for unknown reasons, see report
    by Luke Benes at
    https://lists.freedesktop.org/archives/libreoffice/2017-December/079196.html
    
    Change-Id: Ib4c79fbc6a4353ab51612836f51196bc37a90ae1
    Reviewed-on: https://gerrit.libreoffice.org/47444
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/toolkit/qa/cppunit/UnitConversion.cxx b/toolkit/qa/cppunit/UnitConversion.cxx
index 3178e38ff159..62fe284e8d5a 100644
--- a/toolkit/qa/cppunit/UnitConversion.cxx
+++ b/toolkit/qa/cppunit/UnitConversion.cxx
@@ -28,6 +28,10 @@
 #include <com/sun/star/awt/XWindowPeer.hpp>
 #include <com/sun/star/awt/XWindow.hpp>
 
+#ifdef _WIN32
+#include <windows.h>
+#endif
+
 using namespace ::com::sun::star;
 
 namespace
@@ -96,6 +100,24 @@ void checkSize(uno::Reference<awt::XUnitConversion> const& xConv, awt::Size cons
  */
 void ToolkitTest::testXUnitConversion()
 {
+#ifdef _WIN32
+    HKEY hkey;
+    DWORD type;
+    DWORD data;
+    DWORD size(sizeof(data));
+    LONG ret = ::RegOpenKeyW(HKEY_CURRENT_USER, L"Control Panel\\Desktop", &hkey);
+    if (ret == ERROR_SUCCESS)
+    {
+        ret = ::RegQueryValueExW(hkey, L"LogPixels", nullptr, &type,
+                                 reinterpret_cast<LPBYTE>(&data), &size);
+        if (ret == ERROR_SUCCESS && type == REG_DWORD && data != 96)
+        {
+            std::cerr << "non-default resolution, skipping textXUnitConversion\n";
+            return;
+        }
+    }
+#endif
+
     // create a window
     sal_Int32 x = 100;
     sal_Int32 y = 100;


More information about the Libreoffice-commits mailing list