diff options
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/extras/anchor.cxx | 4 | ||||
-rw-r--r-- | sc/qa/unit/filters-test.cxx | 10 | ||||
-rw-r--r-- | sc/qa/unit/subsequent_filters-test.cxx | 2 | ||||
-rw-r--r-- | sc/qa/unit/ucalc.cxx | 44 |
4 files changed, 30 insertions, 30 deletions
diff --git a/sc/qa/extras/anchor.cxx b/sc/qa/extras/anchor.cxx index 4f5594eb2126..93ff96adf278 100644 --- a/sc/qa/extras/anchor.cxx +++ b/sc/qa/extras/anchor.cxx @@ -165,12 +165,12 @@ void ScAnchorTest::testTdf76183() SdrPage *pPage = pDrawLayer->GetPage(0); // Add a circle somewhere below first row. - const Rectangle aOrigRect = Rectangle(1000, 1000, 1200, 1200); + const tools::Rectangle aOrigRect = tools::Rectangle(1000, 1000, 1200, 1200); SdrCircObj* pObj = new SdrCircObj(OBJ_CIRC, aOrigRect); pPage->InsertObject(pObj); // Anchor to cell ScDrawLayer::SetCellAnchoredFromPosition(*pObj, rDoc, 0); - const Rectangle& rNewRect = pObj->GetLogicRect(); + const tools::Rectangle& rNewRect = pObj->GetLogicRect(); // Set word wrap to true rDoc.ApplyAttr(0, 0, 0, SfxBoolItem(ATTR_LINEBREAK, true)); diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx index 4354cc41d041..556d2bed6e3b 100644 --- a/sc/qa/unit/filters-test.cxx +++ b/sc/qa/unit/filters-test.cxx @@ -422,7 +422,7 @@ void ScFiltersTest::testSheetNamesXLSX() xDocSh->DoClose(); } -void impl_testLegacyCellAnchoredRotatedShape( ScDocument& rDoc, Rectangle& aRect, ScDrawObjData& aAnchor, long TOLERANCE = 30 /* 30 hmm */ ) +void impl_testLegacyCellAnchoredRotatedShape( ScDocument& rDoc, tools::Rectangle& aRect, ScDrawObjData& aAnchor, long TOLERANCE = 30 /* 30 hmm */ ) { ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer(); CPPUNIT_ASSERT_MESSAGE("No drawing layer.", pDrawLayer); @@ -431,7 +431,7 @@ void impl_testLegacyCellAnchoredRotatedShape( ScDocument& rDoc, Rectangle& aRect CPPUNIT_ASSERT_EQUAL( static_cast<size_t>(1), pPage->GetObjCount() ); SdrObject* pObj = pPage->GetObj(0); - const Rectangle& aSnap = pObj->GetSnapRect(); + const tools::Rectangle& aSnap = pObj->GetSnapRect(); printf("expected height %ld actual %ld\n", aRect.GetHeight(), aSnap.GetHeight() ); CPPUNIT_ASSERT_EQUAL( true, testEqualsWithTolerance( aRect.GetHeight(), aSnap.GetHeight(), TOLERANCE ) ); printf("expected width %ld actual %ld\n", aRect.GetWidth(), aSnap.GetWidth() ); @@ -463,7 +463,7 @@ void ScFiltersTest::testLegacyCellAnchoredRotatedShape() ScDocument& rDoc = xDocSh->GetDocument(); // ensure the imported legacy rotated shape is in the expected position - Rectangle aRect( 6000, -2000, 8000, 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; @@ -493,7 +493,7 @@ void ScFiltersTest::testLegacyCellAnchoredRotatedShape() // ( 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 - Rectangle aRect( 6000, -2000, 7430, 4000 ); + tools::Rectangle aRect( 6000, -2000, 7430, 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; @@ -516,7 +516,7 @@ void ScFiltersTest::testLegacyCellAnchoredRotatedShape() ScDocument& rDoc = xDocSh->GetDocument(); // ensure the imported legacy rotated shape is in the expected position - Rectangle aRect( 6000, 3000, 8000, 9000 ); + tools::Rectangle aRect( 6000, 3000, 8000, 9000 ); // ensure the imported (and converted) anchor (note we internally now store the anchor in // terms of the rotated shape) more or less contains the correct info diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 56bbcb6d3f36..f838659d81ee 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -3757,7 +3757,7 @@ void ScFiltersTest::testBnc762542() SdrObject* pObj = pPage->GetObj(i); CPPUNIT_ASSERT_MESSAGE("Failed to get drawing object.", pObj); - Rectangle aRect(pObj->GetCurrentBoundRect()); + tools::Rectangle aRect(pObj->GetCurrentBoundRect()); CPPUNIT_ASSERT_MESSAGE("Drawing object shouldn't be rotated.", aRect.GetWidth() > aRect.GetHeight()); } diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 0dcd60215edc..68b83625acb2 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -2707,12 +2707,12 @@ void Test::testGraphicsInGroup() { //Add a square - Rectangle aOrigRect(2,2,100,100); + tools::Rectangle aOrigRect(2,2,100,100); SdrRectObj *pObj = new SdrRectObj(aOrigRect); pPage->InsertObject(pObj); - const Rectangle &rNewRect = pObj->GetLogicRect(); + const tools::Rectangle &rNewRect = pObj->GetLogicRect(); CPPUNIT_ASSERT_EQUAL_MESSAGE("must have equal position and size", - static_cast<const Rectangle &>(aOrigRect), rNewRect); + static_cast<const tools::Rectangle &>(aOrigRect), rNewRect); ScDrawLayer::SetPageAnchored(*pObj); @@ -2720,15 +2720,15 @@ void Test::testGraphicsInGroup() m_pDoc->ShowRows(0, 100, 0, false); m_pDoc->SetDrawPageSize(0); CPPUNIT_ASSERT_EQUAL_MESSAGE("Should not change when page anchored", - static_cast<const Rectangle &>(aOrigRect), rNewRect); + static_cast<const tools::Rectangle &>(aOrigRect), rNewRect); m_pDoc->ShowRows(0, 100, 0, true); m_pDoc->SetDrawPageSize(0); CPPUNIT_ASSERT_EQUAL_MESSAGE("Should not change when page anchored", - static_cast<const Rectangle &>(aOrigRect), rNewRect); + static_cast<const tools::Rectangle &>(aOrigRect), rNewRect); ScDrawLayer::SetCellAnchoredFromPosition(*pObj, *m_pDoc, 0); CPPUNIT_ASSERT_EQUAL_MESSAGE("That shouldn't change size or positioning", - static_cast<const Rectangle &>(aOrigRect), rNewRect); + static_cast<const tools::Rectangle &>(aOrigRect), rNewRect); m_pDoc->ShowRows(0, 100, 0, false); m_pDoc->SetDrawPageSize(0); @@ -2739,21 +2739,21 @@ void Test::testGraphicsInGroup() m_pDoc->ShowRows(0, 100, 0, true); m_pDoc->SetDrawPageSize(0); CPPUNIT_ASSERT_EQUAL_MESSAGE("Should not change when page anchored", - static_cast<const Rectangle &>(aOrigRect), rNewRect); + static_cast<const tools::Rectangle &>(aOrigRect), rNewRect); } { // Add a circle. - Rectangle aOrigRect = Rectangle(10,10,210,210); // 200 x 200 + tools::Rectangle aOrigRect = tools::Rectangle(10,10,210,210); // 200 x 200 SdrCircObj* pObj = new SdrCircObj(OBJ_CIRC, aOrigRect); pPage->InsertObject(pObj); - const Rectangle& rNewRect = pObj->GetLogicRect(); + const tools::Rectangle& rNewRect = pObj->GetLogicRect(); CPPUNIT_ASSERT_EQUAL_MESSAGE("Position and size of the circle shouldn't change when inserted into the page.", - static_cast<const Rectangle &>(aOrigRect), rNewRect); + static_cast<const tools::Rectangle &>(aOrigRect), rNewRect); ScDrawLayer::SetCellAnchoredFromPosition(*pObj, *m_pDoc, 0); CPPUNIT_ASSERT_EQUAL_MESSAGE("Size changed when cell anchored. Not good.", - static_cast<const Rectangle &>(aOrigRect), rNewRect); + static_cast<const tools::Rectangle &>(aOrigRect), rNewRect); // Insert 2 rows at the top. This should push the circle object down. m_pDoc->InsertRow(0, 0, MAXCOL, 0, 0, 2); @@ -2767,33 +2767,33 @@ void Test::testGraphicsInGroup() m_pDoc->DeleteRow(0, 0, MAXCOL, 0, 0, 2); m_pDoc->SetDrawPageSize(0); CPPUNIT_ASSERT_EQUAL_MESSAGE("Failed to move back to its original position.", - static_cast<const Rectangle &>(aOrigRect), rNewRect); + static_cast<const tools::Rectangle &>(aOrigRect), rNewRect); } { // Add a line. basegfx::B2DPolygon aTempPoly; Point aStartPos(10,300), aEndPos(110,200); // bottom-left to top-right. - Rectangle aOrigRect(10,200,110,300); // 100 x 100 + tools::Rectangle aOrigRect(10,200,110,300); // 100 x 100 aTempPoly.append(basegfx::B2DPoint(aStartPos.X(), aStartPos.Y())); aTempPoly.append(basegfx::B2DPoint(aEndPos.X(), aEndPos.Y())); SdrPathObj* pObj = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aTempPoly)); pObj->NbcSetLogicRect(aOrigRect); pPage->InsertObject(pObj); - const Rectangle& rNewRect = pObj->GetLogicRect(); + const tools::Rectangle& rNewRect = pObj->GetLogicRect(); CPPUNIT_ASSERT_EQUAL_MESSAGE("Size differ.", - static_cast<const Rectangle &>(aOrigRect), rNewRect); + static_cast<const tools::Rectangle &>(aOrigRect), rNewRect); ScDrawLayer::SetCellAnchoredFromPosition(*pObj, *m_pDoc, 0); CPPUNIT_ASSERT_EQUAL_MESSAGE("Size changed when cell-anchored. Not good.", - static_cast<const Rectangle &>(aOrigRect), rNewRect); + static_cast<const tools::Rectangle &>(aOrigRect), rNewRect); // Insert 2 rows at the top and delete them immediately. m_pDoc->InsertRow(0, 0, MAXCOL, 0, 0, 2); m_pDoc->DeleteRow(0, 0, MAXCOL, 0, 0, 2); m_pDoc->SetDrawPageSize(0); CPPUNIT_ASSERT_EQUAL_MESSAGE("Size of a line object changed after row insertion and removal.", - static_cast<const Rectangle &>(aOrigRect), rNewRect); + static_cast<const tools::Rectangle &>(aOrigRect), rNewRect); sal_Int32 n = pObj->GetPointCount(); CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be exactly 2 points in a line object.", static_cast<sal_Int32>(2), n); @@ -2817,7 +2817,7 @@ void Test::testGraphicsOnSheetMove() CPPUNIT_ASSERT_MESSAGE("No page instance for the 1st sheet.", pPage); // Insert an object. - Rectangle aObjRect(2,2,100,100); + tools::Rectangle aObjRect(2,2,100,100); SdrObject* pObj = new SdrRectObj(aObjRect); pPage->InsertObject(pObj); ScDrawLayer::SetCellAnchoredFromPosition(*pObj, *m_pDoc, 0); @@ -5647,9 +5647,9 @@ void Test::testAnchoredRotatedShape() m_pDoc->SetColWidth( nCol, 0, sc::HMMToTwips( 1000 ) ); { //Add a rect - Rectangle aRect( 4000, 5000, 10000, 7000 ); + tools::Rectangle aRect( 4000, 5000, 10000, 7000 ); - Rectangle aRotRect( 6000, 3000, 8000, 9000 ); + tools::Rectangle aRotRect( 6000, 3000, 8000, 9000 ); SdrRectObj *pObj = new SdrRectObj(aRect); pPage->InsertObject(pObj); Point aRef1(pObj->GetSnapRect().Center()); @@ -5660,7 +5660,7 @@ void Test::testAnchoredRotatedShape() ScDrawLayer::SetCellAnchoredFromPosition(*pObj, *m_pDoc, 0); - Rectangle aSnap = pObj->GetSnapRect(); + tools::Rectangle aSnap = pObj->GetSnapRect(); CPPUNIT_ASSERT_EQUAL( true, testEqualsWithTolerance( aRotRect.GetHeight(), aSnap.GetHeight(), TOLERANCE ) ); CPPUNIT_ASSERT_EQUAL( true, testEqualsWithTolerance( aRotRect.GetWidth(), aSnap.GetWidth(), TOLERANCE ) ); CPPUNIT_ASSERT_EQUAL( true, testEqualsWithTolerance( aRotRect.Left(), aSnap.Left(), TOLERANCE ) ); @@ -6427,7 +6427,7 @@ void Test::testUndoDataAnchor() CPPUNIT_ASSERT_MESSAGE("No page instance for the 1st sheet.", pPage); // Insert an object. - Rectangle aObjRect(2,1000,100,1100); + tools::Rectangle aObjRect(2,1000,100,1100); SdrObject* pObj = new SdrRectObj(aObjRect); pPage->InsertObject(pObj); ScDrawLayer::SetCellAnchoredFromPosition(*pObj, *m_pDoc, 0); |