diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-05-04 21:46:31 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-05-05 08:05:16 +0200 |
commit | 13894996601daf10d133f4a71eb0b26794d782bc (patch) | |
tree | 0040f2c81ffd7984373ba27234cea24fbbc3d916 /starmath/qa | |
parent | d83b1383ffbe98502c196cccae4bcb2eb3978f6a (diff) |
handle empty Rectangle better in starmath
which required fixing a unit test to call Prepare, otherwise the nodes
are not ready for layout
Change-Id: I763c1b05d4dfafa73ebaee55d080876848de94f6
Reviewed-on: https://gerrit.libreoffice.org/71800
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'starmath/qa')
-rw-r--r-- | starmath/qa/cppunit/test_node.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/starmath/qa/cppunit/test_node.cxx b/starmath/qa/cppunit/test_node.cxx index a4c7df456399..7ee441ec1941 100644 --- a/starmath/qa/cppunit/test_node.cxx +++ b/starmath/qa/cppunit/test_node.cxx @@ -72,17 +72,21 @@ void NodeTest::testTdf47813() #undef MATRIX ScopedVclPtrInstance<VirtualDevice> pOutputDevice; SmFormat aFmt; + pNodeA->Prepare(aFmt, *mxDocShell, 0); pNodeA->Arrange(*pOutputDevice, aFmt); + pNodeC->Prepare(aFmt, *mxDocShell, 0); pNodeC->Arrange(*pOutputDevice, aFmt); + pNodeL->Prepare(aFmt, *mxDocShell, 0); pNodeL->Arrange(*pOutputDevice, aFmt); + pNodeR->Prepare(aFmt, *mxDocShell, 0); pNodeR->Arrange(*pOutputDevice, aFmt); long nWidthA = pNodeA->GetRect().GetWidth(); long nWidthC = pNodeC->GetRect().GetWidth(); long nWidthL = pNodeL->GetRect().GetWidth(); long nWidthR = pNodeR->GetRect().GetWidth(); CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, nWidthC/static_cast<double>(nWidthA), 0.01); - CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, nWidthL/static_cast<double>(nWidthA), 0.01); - CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, nWidthR/static_cast<double>(nWidthA), 0.01); + CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, nWidthL/static_cast<double>(nWidthA), 0.02); + CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, nWidthR/static_cast<double>(nWidthA), 0.02); } void NodeTest::testTdf52225() |