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 /sc | |
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 'sc')
-rw-r--r-- | sc/qa/unit/filters-test.cxx | 12 | ||||
-rw-r--r-- | sc/qa/unit/jumbosheets-test.cxx | 8 | ||||
-rw-r--r-- | sc/qa/unit/subsequent_filters_test.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlexprt.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/view/tabview.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/tabview3.cxx | 4 |
6 files changed, 21 insertions, 21 deletions
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx index 7025fdc52018..9c14df33b862 100644 --- a/sc/qa/unit/filters-test.cxx +++ b/sc/qa/unit/filters-test.cxx @@ -502,19 +502,19 @@ void ScFiltersTest::testCommentSize() CPPUNIT_ASSERT(pCaption); const tools::Rectangle& rOldRect = pCaption->GetLogicRect(); - CPPUNIT_ASSERT_EQUAL(tools::Long(2899), rOldRect.getWidth()); - CPPUNIT_ASSERT_EQUAL(tools::Long(939), rOldRect.getHeight()); + CPPUNIT_ASSERT_EQUAL(tools::Long(2899), rOldRect.getOpenWidth()); + CPPUNIT_ASSERT_EQUAL(tools::Long(939), rOldRect.getOpenHeight()); pNote->SetText(aPos, "first\nsecond\nthird"); const tools::Rectangle& rNewRect = pCaption->GetLogicRect(); - CPPUNIT_ASSERT_EQUAL(rOldRect.getWidth(), rNewRect.getWidth()); - CPPUNIT_ASSERT_EQUAL(tools::Long(1605), rNewRect.getHeight()); + CPPUNIT_ASSERT_EQUAL(rOldRect.getOpenWidth(), rNewRect.getOpenWidth()); + CPPUNIT_ASSERT_EQUAL(tools::Long(1605), rNewRect.getOpenHeight()); rDoc.GetUndoManager()->Undo(); - CPPUNIT_ASSERT_EQUAL(rOldRect.getWidth(), pCaption->GetLogicRect().getWidth()); - CPPUNIT_ASSERT_EQUAL(rOldRect.getHeight(), pCaption->GetLogicRect().getHeight()); + CPPUNIT_ASSERT_EQUAL(rOldRect.getOpenWidth(), pCaption->GetLogicRect().getOpenWidth()); + CPPUNIT_ASSERT_EQUAL(rOldRect.getOpenHeight(), pCaption->GetLogicRect().getOpenHeight()); xDocSh->DoClose(); } diff --git a/sc/qa/unit/jumbosheets-test.cxx b/sc/qa/unit/jumbosheets-test.cxx index f21c27aafbda..e3ae57564499 100644 --- a/sc/qa/unit/jumbosheets-test.cxx +++ b/sc/qa/unit/jumbosheets-test.cxx @@ -255,8 +255,8 @@ void ScJumboSheetsTest::testTdf134553() // Without the fix in place, this test would have failed here CPPUNIT_ASSERT(pOleObj); - CPPUNIT_ASSERT_EQUAL(tools::Long(12741), pOleObj->GetLogicRect().getWidth()); - CPPUNIT_ASSERT_EQUAL(tools::Long(7620), pOleObj->GetLogicRect().getHeight()); + CPPUNIT_ASSERT_EQUAL(tools::Long(12741), pOleObj->GetLogicRect().getOpenWidth()); + CPPUNIT_ASSERT_EQUAL(tools::Long(7620), pOleObj->GetLogicRect().getOpenHeight()); CPPUNIT_ASSERT_EQUAL(tools::Long(4574), pOleObj->GetLogicRect().getX()); CPPUNIT_ASSERT_EQUAL(tools::Long(437), pOleObj->GetLogicRect().getY()); @@ -279,8 +279,8 @@ void ScJumboSheetsTest::testTdf134553() pOleObj = getSingleChartObject(rDoc, 0); CPPUNIT_ASSERT(pOleObj); - CPPUNIT_ASSERT_EQUAL(tools::Long(12741), pOleObj->GetLogicRect().getWidth()); - CPPUNIT_ASSERT_EQUAL(tools::Long(7620), pOleObj->GetLogicRect().getHeight()); + CPPUNIT_ASSERT_EQUAL(tools::Long(12741), pOleObj->GetLogicRect().getOpenWidth()); + CPPUNIT_ASSERT_EQUAL(tools::Long(7620), pOleObj->GetLogicRect().getOpenHeight()); CPPUNIT_ASSERT_EQUAL(tools::Long(5097), pOleObj->GetLogicRect().getX()); // tdf#147458: Without the fix in place, this test would have failed with // - Expected: 1058 diff --git a/sc/qa/unit/subsequent_filters_test.cxx b/sc/qa/unit/subsequent_filters_test.cxx index 0019b50ce192..1dea49286b1a 100644 --- a/sc/qa/unit/subsequent_filters_test.cxx +++ b/sc/qa/unit/subsequent_filters_test.cxx @@ -1916,8 +1916,8 @@ void ScFiltersTest::testChartImportXLS() const SdrOle2Obj* pOleObj = getSingleChartObject(rDoc, 0); CPPUNIT_ASSERT_MESSAGE("Failed to retrieve a chart object from the 2nd sheet.", pOleObj); - CPPUNIT_ASSERT_EQUAL(tools::Long(11137), pOleObj->GetLogicRect().getWidth()); - CPPUNIT_ASSERT(8640L > pOleObj->GetLogicRect().getHeight()); + CPPUNIT_ASSERT_EQUAL(tools::Long(11137), pOleObj->GetLogicRect().getOpenWidth()); + CPPUNIT_ASSERT(8640L > pOleObj->GetLogicRect().getOpenHeight()); xDocSh->DoClose(); } diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 8a781127035a..2babb82a6f84 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -3533,14 +3533,14 @@ void ScXMLExport::WriteShapes(const ScMyCell& rMyCell) aRectFull.SetTop(aStartCellRect.Top() + aSnapStartOffset.Y()); aRectFull.SetBottom(aEndCellRect.Top() + aSnapEndOffset.Y()); aRectReduced = pObjData->getShapeRect(); - if(abs(aRectFull.getWidth() - aRectReduced.getWidth()) > 1 - || abs(aRectFull.getHeight() - aRectReduced.getHeight()) > 1) + if(abs(aRectFull.getOpenWidth() - aRectReduced.getOpenWidth()) > 1 + || abs(aRectFull.getOpenHeight() - aRectReduced.getOpenHeight()) > 1) { bNeedsRestore = true; - Fraction aScaleWidth(aRectFull.getWidth(), aRectReduced.getWidth()); + Fraction aScaleWidth(aRectFull.getOpenWidth(), aRectReduced.getOpenWidth()); if (!aScaleWidth.IsValid()) aScaleWidth = Fraction(1.0); - Fraction aScaleHeight(aRectFull.getHeight(), aRectReduced.getHeight()); + Fraction aScaleHeight(aRectFull.getOpenHeight(), aRectReduced.getOpenHeight()); if (!aScaleHeight.IsValid()) aScaleHeight = Fraction(1.0); pObj->NbcResize(pObj->GetRelativePos(), aScaleWidth, aScaleHeight); @@ -5190,9 +5190,9 @@ void ScXMLExport::GetViewSettings(uno::Sequence<beans::PropertyValue>& rProps) pProps[++i].Name = "VisibleAreaLeft"; pProps[i].Value <<= static_cast<sal_Int32>(aRect.Left()); pProps[++i].Name = "VisibleAreaWidth"; - pProps[i].Value <<= static_cast<sal_Int32>(aRect.getWidth()); + pProps[i].Value <<= static_cast<sal_Int32>(aRect.getOpenWidth()); pProps[++i].Name = "VisibleAreaHeight"; - pProps[i].Value <<= static_cast<sal_Int32>(aRect.getHeight()); + pProps[i].Value <<= static_cast<sal_Int32>(aRect.getOpenHeight()); } } } diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 523044c7531a..4e66be551f8b 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -2594,7 +2594,7 @@ void lcl_ExtendTiledDimension(bool bColumn, const SCCOLROW nEnd, const SCCOLROW tools::Rectangle(0, aOldSize.getHeight(), aNewSize.getWidth(), aNewSize.getHeight()); // Only invalidate if spreadsheet has extended to the right or bottom - if ((bColumn && aNewArea.getWidth()) || (!bColumn && aNewArea.getHeight())) + if ((bColumn && aNewArea.getOpenWidth()) || (!bColumn && aNewArea.getOpenHeight())) { rTabView.UpdateSelectionOverlay(); SfxLokHelper::notifyInvalidation(rViewData.GetViewShell(), &aNewArea); diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index ae960b0a8c1f..7284c160e6a8 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -429,13 +429,13 @@ void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew ) tools::Rectangle aNewRowArea(0, aOldSize.getHeight(), aOldSize.getWidth(), aNewSize.getHeight()); // Only invalidate if spreadsheet extended to the right - if (aNewColArea.getWidth()) + if (aNewColArea.getOpenWidth()) { SfxLokHelper::notifyInvalidation(aViewData.GetViewShell(), &aNewColArea); } // Only invalidate if spreadsheet extended to the bottom - if (aNewRowArea.getHeight()) + if (aNewRowArea.getOpenHeight()) { SfxLokHelper::notifyInvalidation(aViewData.GetViewShell(), &aNewRowArea); } |