diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2021-09-17 21:49:21 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2021-09-20 12:10:44 +0200 |
commit | b22d4785310eac35696df771803dfba0871a50ac (patch) | |
tree | 56e394a3c38a2e1f17530fbc18dd8e6b3c5d5098 /sw/qa/extras/layout | |
parent | 3e2370260f2b79c43b4f8a86b123861aa95d3ef2 (diff) |
clean up ambiguous confusing rectangle APIs like IsInside()
Reading 'rectA.IsInside( rectB )' kind of suggests that the code
checks whether 'rectA is inside rectB', but it's actually the other
way around. Rename IsInside() -> Contains(), IsOver() -> Overlaps(),
which should make it clear which way the logic goes.
Change-Id: I9347450fe7dc34c96df6d636a4e3e660de1801ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122271
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/qa/extras/layout')
-rw-r--r-- | sw/qa/extras/layout/layout.cxx | 8 | ||||
-rw-r--r-- | sw/qa/extras/layout/layout2.cxx | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 11d4f2ed378c..6c7e71df3ef2 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -522,7 +522,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf136613) CPPUNIT_ASSERT(!rRect.IsEmpty()); //...if it is on the page. This will fail if not. - CPPUNIT_ASSERT_MESSAGE("The pictures are outside the page!", rPageRect.IsInside(rRect)); + CPPUNIT_ASSERT_MESSAGE("The pictures are outside the page!", rPageRect.Contains(rRect)); } } @@ -2750,7 +2750,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testBtlrCell) { std::stringstream ss; ss << "selection rectangle " << rRect << " is not inside cell rectangle " << aCellRect; - CPPUNIT_ASSERT_MESSAGE(ss.str(), aCellRect.IsInside(rRect)); + CPPUNIT_ASSERT_MESSAGE(ss.str(), aCellRect.Contains(rRect)); } // Make sure that the correct rectangle gets repainted on scroll. @@ -3181,7 +3181,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testShapeAllowOverlapWrap) SwAnchoredObject* pSecond = rObjs[1]; // Without the accompanying fix in place, this test would have failed: AllowOverlap=no had // priority over Surround=through (which is bad for Word compat). - CPPUNIT_ASSERT(pSecond->GetObjRect().IsOver(pFirst->GetObjRect())); + CPPUNIT_ASSERT(pSecond->GetObjRect().Overlaps(pFirst->GetObjRect())); } CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf124600) @@ -3513,7 +3513,7 @@ static SwRect lcl_getVisibleFlyObjRect(SwWrtShell* pWrtShell) pDrawObj = (*pDrawObjs)[0]; CPPUNIT_ASSERT_EQUAL(OUString("Rahmen123"), pDrawObj->GetFrameFormat().GetName()); SwRect aFlyRect = pDrawObj->GetObjRect(); - CPPUNIT_ASSERT(pPage->getFrameArea().IsInside(aFlyRect)); + CPPUNIT_ASSERT(pPage->getFrameArea().Contains(aFlyRect)); return aFlyRect; } diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx index dad0d84ff135..91cb32016942 100644 --- a/sw/qa/extras/layout/layout2.cxx +++ b/sw/qa/extras/layout/layout2.cxx @@ -273,7 +273,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testtdf138951) const bool bIsAnchTheSame = *pShFrm->GetAnchor().GetContentAnchor() == *pShFrm->GetAnchor().GetContentAnchor(); CPPUNIT_ASSERT_MESSAGE("The anchor is different for the textbox and shape!", bIsAnchTheSame); - CPPUNIT_ASSERT_MESSAGE("The textbox has fallen apart!", aShpRect.IsInside(aTxtFrmRect)); + CPPUNIT_ASSERT_MESSAGE("The textbox has fallen apart!", aShpRect.Contains(aTxtFrmRect)); // Without the fix the anchor differs, and the frame outside of the shape } |