diff options
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/filters-test.cxx | 16 | ||||
-rw-r--r-- | sc/qa/unit/scshapetest.cxx | 2 | ||||
-rw-r--r-- | sc/qa/unit/ucalc.cxx | 10 |
3 files changed, 12 insertions, 16 deletions
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx index 8cf4795ca91d..3c6e6c7d9bbb 100644 --- a/sc/qa/unit/filters-test.cxx +++ b/sc/qa/unit/filters-test.cxx @@ -555,11 +555,8 @@ void ScFiltersTest::testLegacyCellAnchoredRotatedShape() ScDocShellRef xDocSh = loadDoc("legacycellanchoredrotatedhiddenshape.", FORMAT_ODS, true); ScDocument& rDoc = xDocSh->GetDocument(); // ensure the imported legacy rotated shape is in the expected position - // when a shape is fully hidden reloading seems to result is in some errors, usually - // ( same but different error happens pre-patch ) - we should do better here, I regard it - // as a pre-existing bug though (#FIXME) - //Rectangle aRect( 6000, -2000, 8000, 4000 ); // proper dimensions - tools::Rectangle aRect( 6000, -2000, 7430, 4000 ); + tools::Rectangle aRect( 6000, -2000, 8000, 4000 ); + // ensure the imported (and converted) anchor (note we internally now store the anchor in // terms of the rotated shape) is more or less contains the correct info ScDrawObjData aAnchor; @@ -569,10 +566,11 @@ void ScFiltersTest::testLegacyCellAnchoredRotatedShape() aAnchor.maEnd.SetCol( 7 ); rDoc.ShowRows(0, 9, 0, true); // show relevant rows rDoc.SetDrawPageSize(0); // trigger recalcpos - - // apply hefty (1 mm) tolerance here, as some opensuse tinderbox - // failing - impl_testLegacyCellAnchoredRotatedShape( rDoc, aRect, aAnchor, 100 ); + impl_testLegacyCellAnchoredRotatedShape( rDoc, aRect, aAnchor); + // test save and reload + xDocSh = saveAndReload( &(*xDocSh), FORMAT_ODS); + ScDocument& rDoc2 = xDocSh->GetDocument(); + impl_testLegacyCellAnchoredRotatedShape( rDoc2, aRect, aAnchor ); xDocSh->DoClose(); } diff --git a/sc/qa/unit/scshapetest.cxx b/sc/qa/unit/scshapetest.cxx index 5236f124cbc3..5efad446a70f 100644 --- a/sc/qa/unit/scshapetest.cxx +++ b/sc/qa/unit/scshapetest.cxx @@ -146,7 +146,7 @@ void ScShapeTest::testCustomShapeCellAnchoredRotatedShape() CPPUNIT_ASSERT(pObj); // Check Position and Size - tools::Rectangle aRect(2406, 754, 5774, 3692); // expected snap rect + tools::Rectangle aRect(2400, 751, 5772, 3693); // expected snap rect rDoc.SetDrawPageSize(0); // trigger recalcpos const tools::Rectangle& rShapeRect(pObj->GetSnapRect()); const OUString sPosSizeErrors(lcl_compareRectWithTolerance(aRect, rShapeRect, 1)); diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 78e27555e7b8..f5da5620744c 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -2797,17 +2797,15 @@ void Test::testGraphicsInGroup() m_pDoc->ShowRows(0, 100, 0, false); m_pDoc->SetDrawPageSize(0); - const tools::Long TOLERANCE = 30; //30 hmm + CPPUNIT_ASSERT_EQUAL_MESSAGE("Hiding should not change the logic rectangle", + const_cast<const tools::Rectangle &>(aOrigRect), rNewRect); + CPPUNIT_ASSERT_MESSAGE("Hiding should make invisible", !pObj->IsVisible()); - CPPUNIT_ASSERT_MESSAGE("Left and Right should be unchanged", - testEqualsWithTolerance(aOrigRect.Left(), rNewRect.Left(), TOLERANCE) && - testEqualsWithTolerance(aOrigRect.Right(), rNewRect.Right(), TOLERANCE)); - CPPUNIT_ASSERT_MESSAGE("Height should be minimum allowed height", - (rNewRect.Bottom() - rNewRect.Top()) <= 1); m_pDoc->ShowRows(0, 100, 0, true); m_pDoc->SetDrawPageSize(0); CPPUNIT_ASSERT_EQUAL_MESSAGE("Should not change when cell anchored", const_cast<const tools::Rectangle &>(aOrigRect), rNewRect); + CPPUNIT_ASSERT_MESSAGE("Show should make visible", pObj->IsVisible()); } { |