diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index a0b9c00dd24d..490b2ce2698d 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -2563,6 +2563,11 @@ void Chart2ImportTest::testStockChartShiftedCategoryPosition() void Chart2ImportTest::testTdf133376() { + // FIXME: the DPI check should be removed when either (1) the test is fixed to work with + // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin. + if (!IsDefaultDPI()) + return; + load("/chart2/qa/extras/data/xlsx/", "tdf133376.xlsx"); Reference xChartDoc(getChartDocFromSheet(0, mxComponent), UNO_QUERY_THROW); diff --git a/chart2/qa/extras/xshape/chart2xshape.cxx b/chart2/qa/extras/xshape/chart2xshape.cxx index 68dcc1e7e030..a1a0032effc3 100644 --- a/chart2/qa/extras/xshape/chart2xshape.cxx +++ b/chart2/qa/extras/xshape/chart2xshape.cxx @@ -14,8 +14,6 @@ #include #include -#include -#include #include @@ -117,8 +115,7 @@ void Chart2XShapeTest::testPieChartLabels1() { // FIXME: the DPI check should be removed when either (1) the test is fixed to work with // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin. - if (Application::GetDefaultDevice()->GetDPIX() != 96 - || Application::GetDefaultDevice()->GetDPIY() != 96) + if (!IsDefaultDPI()) return; // inside placement for the best fit case @@ -130,8 +127,7 @@ void Chart2XShapeTest::testPieChartLabels2() { // FIXME: the DPI check should be removed when either (1) the test is fixed to work with // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin. - if (Application::GetDefaultDevice()->GetDPIX() != 96 - || Application::GetDefaultDevice()->GetDPIY() != 96) + if (!IsDefaultDPI()) return; // text wrap: wrap all text labels except one @@ -143,8 +139,7 @@ void Chart2XShapeTest::testPieChartLabels3() { // FIXME: the DPI check should be removed when either (1) the test is fixed to work with // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin. - if (Application::GetDefaultDevice()->GetDPIX() != 96 - || Application::GetDefaultDevice()->GetDPIY() != 96) + if (!IsDefaultDPI()) return; // text wrap: wrap no text label except one @@ -156,8 +151,7 @@ void Chart2XShapeTest::testPieChartLabels4() { // FIXME: the DPI check should be removed when either (1) the test is fixed to work with // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin. - if (Application::GetDefaultDevice()->GetDPIX() != 96 - || Application::GetDefaultDevice()->GetDPIY() != 96) + if (!IsDefaultDPI()) return; // data value and percent value are centered horizontally diff --git a/include/test/bootstrapfixture.hxx b/include/test/bootstrapfixture.hxx index 052e3a8e229d..3a0cc1da7119 100644 --- a/include/test/bootstrapfixture.hxx +++ b/include/test/bootstrapfixture.hxx @@ -48,6 +48,12 @@ class OOO_DLLPUBLIC_TEST BootstrapFixture : public BootstrapFixtureBase protected: css::uno::Reference mxComponentContext; + // A convenience function to be used to conditionally exclude tests not behaving properly + // on UI scaling other than 1:1. Using this should be considered a temporary workaround, + // until a proper fix is implemented that either considers the DPI properly in the test, or + // makes the invariants that test uses independent of DPI. + static bool IsDefaultDPI(); + public: DECL_STATIC_LINK(BootstrapFixture, ImplInitFilterHdl, ConvertData&, bool); diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 23a2c27faa48..8bc5ff722b8b 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -2882,8 +2882,7 @@ void ScFiltersTest::testMiscRowHeights() { // FIXME: the DPI check should be removed when either (1) the test is fixed to work with // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin. - if (Application::GetDefaultDevice()->GetDPIX() != 96 - || Application::GetDefaultDevice()->GetDPIY() != 96) + if (!IsDefaultDPI()) return; static const TestParam::RowData DfltRowData[] = @@ -2926,8 +2925,7 @@ void ScFiltersTest::testOptimalHeightReset() { // FIXME: the DPI check should be removed when either (1) the test is fixed to work with // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin. - if (Application::GetDefaultDevice()->GetDPIX() != 96 - || Application::GetDefaultDevice()->GetDPIY() != 96) + if (!IsDefaultDPI()) return; ScDocShellRef xDocSh = loadDoc("multilineoptimal.", FORMAT_ODS, true); diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx index 4d6b54a8f879..d05ae03d39e9 100644 --- a/test/source/bootstrapfixture.cxx +++ b/test/source/bootstrapfixture.cxx @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -237,4 +238,10 @@ IMPL_STATIC_LINK( return GraphicFilter::GetGraphicFilter().GetFilterCallback().Call( rData ); } +bool test::BootstrapFixture::IsDefaultDPI() +{ + return (Application::GetDefaultDevice()->GetDPIX() == 96 + && Application::GetDefaultDevice()->GetDPIY() == 96); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */