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 /svx/source | |
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 'svx/source')
-rw-r--r-- | svx/source/accessibility/AccessibleShape.cxx | 4 | ||||
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShape3d.cxx | 8 | ||||
-rw-r--r-- | svx/source/sdr/contact/viewcontactofe3dscene.cxx | 4 | ||||
-rw-r--r-- | svx/source/sdr/properties/defaultproperties.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdedtv1.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdoashp.cxx | 2 | ||||
-rw-r--r-- | svx/source/table/accessiblecell.cxx | 2 | ||||
-rw-r--r-- | svx/source/table/svdotable.cxx | 6 | ||||
-rw-r--r-- | svx/source/table/tablelayouter.cxx | 16 | ||||
-rw-r--r-- | svx/source/tbxctrls/fontworkgallery.cxx | 2 | ||||
-rw-r--r-- | svx/source/unodraw/unoshape.cxx | 2 |
11 files changed, 26 insertions, 26 deletions
diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx index 2caf0841a104..567f65978352 100644 --- a/svx/source/accessibility/AccessibleShape.cxx +++ b/svx/source/accessibility/AccessibleShape.cxx @@ -559,8 +559,8 @@ awt::Rectangle SAL_CALL AccessibleShape::getBounds() aBoundingBox = awt::Rectangle ( aBBox.Left(), aBBox.Top(), - aBBox.getWidth(), - aBBox.getHeight()); + aBBox.getOpenWidth(), + aBBox.getOpenHeight()); } else { diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx b/svx/source/customshapes/EnhancedCustomShape3d.cxx index 00a59ebf5a66..731f8208d2f6 100644 --- a/svx/source/customshapes/EnhancedCustomShape3d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx @@ -571,8 +571,8 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( pScene->NbcSetSnapRect( aSnapRect ); // InitScene replacement - double fW = aBoundRect2d.getWidth(); - double fH = aBoundRect2d.getHeight(); + double fW = aBoundRect2d.getOpenWidth(); + double fH = aBoundRect2d.getOpenHeight(); rCamera.SetAutoAdjustProjection( false ); rCamera.SetViewWindow( -fW / 2, - fH / 2, fW, fH); basegfx::B3DPoint aLookAt( 0.0, 0.0, 0.0 ); @@ -620,8 +620,8 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( GetRotateAngle( rGeometryItem, fXRotate, fYRotate ); drawing::Direction3D aRotationCenterDefault( 0, 0, 0 ); drawing::Direction3D aRotationCenter( GetDirection3D( rGeometryItem, "RotationCenter", aRotationCenterDefault ) ); - aRotationCenter.DirectionX *= aSnapRect.getWidth(); - aRotationCenter.DirectionY *= aSnapRect.getHeight(); + aRotationCenter.DirectionX *= aSnapRect.getOpenWidth(); + aRotationCenter.DirectionY *= aSnapRect.getOpenHeight(); if (pMap) { aRotationCenter.DirectionZ *= *pMap; diff --git a/svx/source/sdr/contact/viewcontactofe3dscene.cxx b/svx/source/sdr/contact/viewcontactofe3dscene.cxx index 6bae552631d5..4040ace8c8f6 100644 --- a/svx/source/sdr/contact/viewcontactofe3dscene.cxx +++ b/svx/source/sdr/contact/viewcontactofe3dscene.cxx @@ -238,8 +238,8 @@ void ViewContactOfE3dScene::createObjectTransformation() // create 2d Object Transformation from relative point in 2d scene to world const tools::Rectangle aRectangle(GetE3dScene().GetSnapRect()); - maObjectTransformation.set(0, 0, aRectangle.getWidth()); - maObjectTransformation.set(1, 1, aRectangle.getHeight()); + maObjectTransformation.set(0, 0, aRectangle.getOpenWidth()); + maObjectTransformation.set(1, 1, aRectangle.getOpenHeight()); maObjectTransformation.set(0, 2, aRectangle.Left()); maObjectTransformation.set(1, 2, aRectangle.Top()); } diff --git a/svx/source/sdr/properties/defaultproperties.cxx b/svx/source/sdr/properties/defaultproperties.cxx index fa52924585c5..2db2e018ed77 100644 --- a/svx/source/sdr/properties/defaultproperties.cxx +++ b/svx/source/sdr/properties/defaultproperties.cxx @@ -163,8 +163,8 @@ namespace sdr::properties { // Shape is filled by a vector graphic: tell it our size as a hint. basegfx::B2DTuple aSizeHint; - aSizeHint.setX(GetSdrObject().GetSnapRect().getWidth()); - aSizeHint.setY(GetSdrObject().GetSnapRect().getHeight()); + aSizeHint.setX(GetSdrObject().GetSnapRect().getOpenWidth()); + aSizeHint.setY(GetSdrObject().GetSnapRect().getOpenHeight()); pVectorData->setSizeHint(aSizeHint); } } diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx index 371584bd891a..bc5d2bb5003c 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -1489,7 +1489,7 @@ SfxItemSet SdrEditView::GetGeoAttrFromMarked() const // multiple objects, range is collected in aRect aTransformation = basegfx::utils::createScaleTranslateB2DHomMatrix( aRect.Left(), aRect.Top(), - aRect.getWidth(), aRect.getHeight()); + aRect.getOpenWidth(), aRect.getOpenHeight()); } else { diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index a21c594157a6..16f5be67f7f3 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -2342,7 +2342,7 @@ bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight(tools::Rectangle& rR, bool // Both 'resize shape to fix text' and multiple columns are enabled. The // first means a dynamic height, the second expects a fixed height. // Resolve this conflict by going with the original height. - nHgt = rR.getHeight(); + nHgt = rR.getOpenHeight(); } } rOutliner.Clear(); diff --git a/svx/source/table/accessiblecell.cxx b/svx/source/table/accessiblecell.cxx index 0cb9072fb04b..1f2678782834 100644 --- a/svx/source/table/accessiblecell.cxx +++ b/svx/source/table/accessiblecell.cxx @@ -307,7 +307,7 @@ css::awt::Rectangle SAL_CALL AccessibleCell::getBounds() awt::Size aParentSize (xParentComponent->getSize()); ::tools::Rectangle aParentBBox (0,0, aParentSize.Width, aParentSize.Height); aBBox = aBBox.GetIntersection (aParentBBox); - aBoundingBox = awt::Rectangle ( aBBox.Left(), aBBox.Top(), aBBox.getWidth(), aBBox.getHeight()); + aBoundingBox = awt::Rectangle ( aBBox.Left(), aBBox.Top(), aBBox.getOpenWidth(), aBBox.getOpenHeight()); } else { diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index 4cfa65900ac1..87f26b31704f 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -1917,8 +1917,8 @@ void SdrTableObj::NbcSetLogicRect(const tools::Rectangle& rRect) { maLogicRect=rRect; ImpJustifyRect(maLogicRect); - const bool bWidth = maLogicRect.getWidth() != maRect.getWidth(); - const bool bHeight = maLogicRect.getHeight() != maRect.getHeight(); + const bool bWidth = maLogicRect.getOpenWidth() != maRect.getOpenWidth(); + const bool bHeight = maLogicRect.getOpenHeight() != maRect.getOpenHeight(); maRect = maLogicRect; if (mpImpl->mbSkipChangeLayout) // Avoid distributing newly available space between existing cells. @@ -1932,7 +1932,7 @@ void SdrTableObj::NbcSetLogicRect(const tools::Rectangle& rRect) void SdrTableObj::AdjustToMaxRect( const tools::Rectangle& rMaxRect, bool /* bShrinkOnly = false */ ) { tools::Rectangle aAdjustRect( rMaxRect ); - aAdjustRect.setHeight( GetLogicRect().getHeight() ); + aAdjustRect.setHeight( GetLogicRect().getOpenHeight() ); SetLogicRect( aAdjustRect ); } diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx index 87bd4436e7f3..6c55b57bb97c 100644 --- a/svx/source/table/tablelayouter.cxx +++ b/svx/source/table/tablelayouter.cxx @@ -647,9 +647,9 @@ void TableLayouter::LayoutTableWidth( tools::Rectangle& rArea, bool bFit ) } // if we have optimal sized rows, distribute what is given (left) - if( !bFit && !aOptimalColumns.empty() && (nCurrentWidth < rArea.getWidth()) ) + if( !bFit && !aOptimalColumns.empty() && (nCurrentWidth < rArea.getOpenWidth()) ) { - sal_Int32 nLeft = rArea.getWidth() - nCurrentWidth; + sal_Int32 nLeft = rArea.getOpenWidth() - nCurrentWidth; sal_Int32 nDistribute = nLeft / aOptimalColumns.size(); auto iter( aOptimalColumns.begin() ); @@ -697,8 +697,8 @@ void TableLayouter::LayoutTableWidth( tools::Rectangle& rArea, bool bFit ) } // now scale if wanted and needed - if( bFit && (nCurrentWidth != rArea.getWidth()) ) - distribute( maColumns, rArea.getWidth() - nCurrentWidth ); + if( bFit && (nCurrentWidth != rArea.getOpenWidth()) ) + distribute( maColumns, rArea.getOpenWidth() - nCurrentWidth ); // last step, update left edges sal_Int32 nNewWidth = 0; @@ -834,9 +834,9 @@ void TableLayouter::LayoutTableHeight( tools::Rectangle& rArea, bool bFit ) } // if we have optimal sized rows, distribute what is given (left) - if( !bFit && !aOptimalRows.empty() && (nCurrentHeight < rArea.getHeight()) ) + if( !bFit && !aOptimalRows.empty() && (nCurrentHeight < rArea.getOpenHeight()) ) { - sal_Int32 nLeft = rArea.getHeight() - nCurrentHeight; + sal_Int32 nLeft = rArea.getOpenHeight() - nCurrentHeight; sal_Int32 nDistribute = nLeft / aOptimalRows.size(); auto iter( aOptimalRows.begin() ); @@ -881,8 +881,8 @@ void TableLayouter::LayoutTableHeight( tools::Rectangle& rArea, bool bFit ) } // now scale if wanted and needed - if( bFit && nCurrentHeight != rArea.getHeight() ) - distribute(maRows, o3tl::saturating_sub<sal_Int32>(rArea.getHeight(), nCurrentHeight)); + if( bFit && nCurrentHeight != rArea.getOpenHeight() ) + distribute(maRows, o3tl::saturating_sub<sal_Int32>(rArea.getOpenHeight(), nCurrentHeight)); // last step, update left edges sal_Int32 nNewHeight = 0; diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx index 802cc1f4fcb8..472bed1ecfc6 100644 --- a/svx/source/tbxctrls/fontworkgallery.cxx +++ b/svx/source/tbxctrls/fontworkgallery.cxx @@ -210,7 +210,7 @@ void FontWorkGalleryDialog::insertSelectedFontwork() aPagePos.setX(convertTwipToMm100(aPagePos.X())); aPagePos.setY(convertTwipToMm100(aPagePos.Y())); - sal_Int32 nLOKViewWidth = 0.8 * convertTwipToMm100(pViewShell->getLOKVisibleArea().getWidth()); + sal_Int32 nLOKViewWidth = 0.8 * convertTwipToMm100(pViewShell->getLOKVisibleArea().getOpenWidth()); if (aFontworkSize.getWidth() > nLOKViewWidth) { double fScale = static_cast<double>(aFontworkSize.getWidth()) / nLOKViewWidth; diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index e618c209d697..2280402dcb76 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -1157,7 +1157,7 @@ awt::Size SAL_CALL SvxShape::getSize() if(HasSdrObject()) { tools::Rectangle aRect( svx_getLogicRectHack(GetSdrObject()) ); - Size aObjSize( aRect.getWidth(), aRect.getHeight() ); + Size aObjSize( aRect.getOpenWidth(), aRect.getOpenHeight() ); ForceMetricTo100th_mm(aObjSize); return css::awt::Size( aObjSize.getWidth(), aObjSize.getHeight() ); } |