From 59e969def7488977be8c554d37bebe535c6511cb Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Tue, 17 Aug 2021 07:50:25 +0300 Subject: Fix ctor taking Point and Size, to properly handle regative sizes (alinged to SetSize) Change-Id: I123a584ead91faae0fec4d25938529b2d68e4a3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120559 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- tools/qa/cppunit/test_rectangle.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tools') diff --git a/tools/qa/cppunit/test_rectangle.cxx b/tools/qa/cppunit/test_rectangle.cxx index e4992f3f44f9..29aa6cde94df 100644 --- a/tools/qa/cppunit/test_rectangle.cxx +++ b/tools/qa/cppunit/test_rectangle.cxx @@ -57,6 +57,17 @@ void Test::test_rectangle() aRect.SetPosY(12); CPPUNIT_ASSERT_EQUAL(tools::Long(1), aRect.GetWidth()); } + + { + constexpr tools::Rectangle aRect(Point(), Size(-1, -2)); + static_assert(!aRect.IsEmpty()); + static_assert(aRect.Right() == 0); + static_assert(aRect.Bottom() == -1); + + tools::Rectangle aRect2; + aRect2.SetSize(Size(-1, -2)); + CPPUNIT_ASSERT_EQUAL(aRect, aRect2); + } } CPPUNIT_TEST_SUITE_REGISTRATION(Test); -- cgit 5.3-3.4 LibreOffice 界面翻译代码仓库文档基金会
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndras Timar <atimar@suse.com>2012-06-18 12:22:31 +0200
committerAndras Timar <atimar@suse.com>2012-06-18 14:24:19 +0200
commita2ff2dadeac0081043cea5ef9ea10415c18f7f91 (patch)
tree3f52ae1bc374e1b758f0e696882082fc1381c31f /translations/source/brx/instsetoo_native
parent29cc861133e64acba5bb7dddeca539af86a2ea5b (diff)