diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2015-11-07 18:45:31 +1000 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-11-10 10:54:18 +0000 |
commit | f4a4bbce92fe753678b218c265f7180c306ddf73 (patch) | |
tree | 9b3fdf67b515a412baaebb7c3a96f7a99028e5ec /vcl/qa | |
parent | a415a66f1af0944cac631bfd6b75c3d569e6f1df (diff) |
tdf#95650: Replace wrong assertion with condition
When UniscribeLayout::LayoutText(ImplLayoutArgs & rArgs) is run with
BiDiRtl flag, and some skipped VisualItems was reversed in lines 908-927,
it's possible that they will arrive in reverse order to the code adjusting
mnSubStringMin, so this assertion may fire.
This situation is not erroneous, so simply replacing the assert with "if".
Change-Id: Icb244502dd00b4c08a2c5192369ee66d743b0dcc
Reviewed-on: https://gerrit.libreoffice.org/19835
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'vcl/qa')
-rw-r--r-- | vcl/qa/cppunit/complextext.cxx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/vcl/qa/cppunit/complextext.cxx b/vcl/qa/cppunit/complextext.cxx index a7c4e034ce68..31717ccdd12e 100644 --- a/vcl/qa/cppunit/complextext.cxx +++ b/vcl/qa/cppunit/complextext.cxx @@ -22,9 +22,15 @@ public: /// Play with font measuring etc. void testArabic(); +#if defined(WNT) + void testTdf95650(); // Windows-only issue +#endif CPPUNIT_TEST_SUITE(VclComplexTextTest); CPPUNIT_TEST(testArabic); +#if defined(WNT) + CPPUNIT_TEST(testTdf95650); +#endif CPPUNIT_TEST_SUITE_END(); }; @@ -77,6 +83,26 @@ void VclComplexTextTest::testArabic() #endif } +#if defined(WNT) +void VclComplexTextTest::testTdf95650() +{ + const sal_Unicode pTxt[] = { + 0x0131, 0x0302, 0x0504, 0x4E44, 0x3031, 0x3030, 0x3531, 0x2D30, + 0x3037, 0x0706, 0x0908, 0x0B0A, 0x0D0C, 0x0F0E, 0x072E, 0x100A, + 0x0D11, 0x1312, 0x0105, 0x020A, 0x0512, 0x1403, 0x030C, 0x1528, + 0x2931, 0x632E, 0x7074, 0x0D20, 0x0E0A, 0x100A, 0xF00D, 0x0D20, + 0x030A, 0x0C0B, 0x20E0, 0x0A0D + }; + OUString aTxt(pTxt, SAL_N_ELEMENTS(pTxt) - 1); + VclPtr<vcl::Window> pWin = VclPtr<WorkWindow>::Create(static_cast<vcl::Window *>(nullptr)); + CPPUNIT_ASSERT(pWin); + + OutputDevice *pOutDev = static_cast< OutputDevice * >(pWin.get()); + // Check that the following executes without failing assertion + pOutDev->ImplLayout(aTxt, 9, 1, Point(), 0, 0, SalLayoutFlags::BiDiRtl, nullptr); +} +#endif + CPPUNIT_TEST_SUITE_REGISTRATION(VclComplexTextTest); CPPUNIT_PLUGIN_IMPLEMENT(); |