diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2022-06-29 00:06:03 +1000 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2022-07-11 11:06:53 +0200 |
commit | 934985becc567114c3f38a72322056a628aad7c9 (patch) | |
tree | 54530473a4d3a0a5876aff68b3727d51fa4dc88d /tools | |
parent | a19e01812b60580c656cf31619e212803e2ca0fa (diff) |
tools: rename getHeight/Width() to GetOpenHeight/Width()
By default Rectangle uses closed interval, if we really want to use half
open intervals then we should specifically say as such in the name.
Change-Id: Id7a91120ba1a1a4bc330014216b73a692dbf03a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136575
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qa/cppunit/test_rectangle.cxx | 10 | ||||
-rw-r--r-- | tools/source/generic/gen.cxx | 5 |
2 files changed, 9 insertions, 6 deletions
diff --git a/tools/qa/cppunit/test_rectangle.cxx b/tools/qa/cppunit/test_rectangle.cxx index 2b6518d797c4..4cf1b57d8b2b 100644 --- a/tools/qa/cppunit/test_rectangle.cxx +++ b/tools/qa/cppunit/test_rectangle.cxx @@ -32,8 +32,8 @@ void Test::test_rectangle() CPPUNIT_ASSERT_EQUAL(tools::Long(1), aRect.GetWidth()); CPPUNIT_ASSERT_EQUAL(tools::Long(1), aRect.GetHeight()); - CPPUNIT_ASSERT_EQUAL(tools::Long(0), aRect.getWidth()); - CPPUNIT_ASSERT_EQUAL(tools::Long(0), aRect.getHeight()); + CPPUNIT_ASSERT_EQUAL(tools::Long(0), aRect.getOpenWidth()); + CPPUNIT_ASSERT_EQUAL(tools::Long(0), aRect.getOpenHeight()); } { @@ -47,10 +47,10 @@ void Test::test_rectangle() CPPUNIT_ASSERT_EQUAL(tools::Long(1), aRect.GetWidth()); CPPUNIT_ASSERT_EQUAL(tools::Long(1), aRect.GetHeight()); - // getWidth and getHeight return the size that excludes one of the bounds, + // getOpenWidth and getOpenHeight return the size that excludes one of the bounds, // unlike the ctor and GetWidth / GetHeight that operate on inclusive size - CPPUNIT_ASSERT_EQUAL(tools::Long(0), aRect.getWidth()); - CPPUNIT_ASSERT_EQUAL(tools::Long(0), aRect.getHeight()); + CPPUNIT_ASSERT_EQUAL(tools::Long(0), aRect.getOpenWidth()); + CPPUNIT_ASSERT_EQUAL(tools::Long(0), aRect.getOpenHeight()); aRect.SetPosX(12); CPPUNIT_ASSERT_EQUAL(tools::Long(1), aRect.GetHeight()); diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx index 069b7482cfba..fa2878928512 100644 --- a/tools/source/generic/gen.cxx +++ b/tools/source/generic/gen.cxx @@ -174,7 +174,10 @@ OString tools::Rectangle::toString() const // Note that this is not just used for debugging output but the // format is parsed by external code (passed in callbacks to // LibreOfficeKit clients). So don't change. - return OString::number(Left()) + ", " + OString::number(Top()) + ", " + OString::number(getWidth()) + ", " + OString::number(getHeight()); + return OString::number(Left()) + ", " + + OString::number(Top()) + ", " + + OString::number(getOpenWidth()) + ", " + + OString::number(getOpenHeight()); } void tools::Rectangle::expand(tools::Long nExpandBy) |