diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2022-07-23 23:48:24 +1000 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2022-08-24 10:55:15 +0200 |
commit | 59210b075b79e4fc58f86542d9947d6ed0073abd (patch) | |
tree | af9f6c1a8d5de2d2ccde0e8671f9b320775a5f98 /editeng | |
parent | 51d2e734099e5c5c56393ef9f08007a7df441794 (diff) |
tools: rename Rectangle::Justify() to Rectangle::Normalize()
Jusify() normalizes the rectangle so both the Width and Height are
positive, without changing the location of the rectangle. It ensures
that the x and y coordinates will be moved to the top left of the
rectangle.
The name is strange, so renaming Justify() to Normalize().
Change-Id: Idbf163e65e52a798e38f785b8961b8042cf0cf2a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137379
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editview.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 4 | ||||
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index 320fd52eab8c..4096e0e18bf8 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -708,7 +708,7 @@ void EditView::MoveParagraphs( tools::Long nDiff ) { ESelection aSel = GetSelection(); Range aRange( aSel.nStartPara, aSel.nEndPara ); - aRange.Justify(); + aRange.Normalize(); tools::Long nDest = ( nDiff > 0 ? aRange.Max() : aRange.Min() ) + nDiff; if ( nDiff > 0 ) nDest++; diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index d8afb55d46bc..ffa8913b0c75 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -2133,7 +2133,7 @@ void ImpEditEngine::ImpRemoveChars( const EditPaM& rPaM, sal_Int32 nChars ) EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_Int32 nNewPos ) { - aOldPositions.Justify(); + aOldPositions.Normalize(); bool bValidAction = ( static_cast<tools::Long>(nNewPos) < aOldPositions.Min() ) || ( static_cast<tools::Long>(nNewPos) > aOldPositions.Max() ); OSL_ENSURE( bValidAction, "Move in itself?" ); OSL_ENSURE( aOldPositions.Max() <= static_cast<tools::Long>(GetParaPortions().Count()), "totally over it: MoveParagraphs" ); @@ -3245,7 +3245,7 @@ void ImpEditEngine::IterateLineAreas(const IterateLinesAreasFunc& f, IterFlag eO aInfo.nColumn = nColumn; aInfo.pLine = &rLine; aInfo.nLine = nLine; - aInfo.aArea = tools::Rectangle::Justify(aLineStart, aOtherCorner); + aInfo.aArea = tools::Rectangle::Normalize(aLineStart, aOtherCorner); eResult = f(aInfo); if (eResult == CallbackResult::Stop) return; diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 5ff196f02040..b33b8c5f1554 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -505,7 +505,7 @@ void ImpEditEngine::FormatDoc() tools::Long nDiff = nNewHeight - nCurTextHeight; if ( nDiff ) { - aInvalidRect.Union(tools::Rectangle::Justify( + aInvalidRect.Union(tools::Rectangle::Normalize( { 0, nNewHeight }, { getWidthDirectionAware(aPaperSize), nCurTextHeight })); aStatus.GetStatusWord() |= !IsEffectivelyVertical() ? EditStatusFlags::TextHeightChanged : EditStatusFlags::TEXTWIDTHCHANGED; } @@ -3260,7 +3260,7 @@ Point ImpEditEngine::MoveToNextLine( adjustXDirectionAware(aOtherCorner, getWidthDirectionAware(aPaperSize)); adjustYDirectionAware(aOtherCorner, nCurTextHeight); tools::Long nNeeded - = getYOverflowDirectionAware(rMovePos, tools::Rectangle::Justify(aOrigin, aOtherCorner)); + = getYOverflowDirectionAware(rMovePos, tools::Rectangle::Normalize(aOrigin, aOtherCorner)); if (pnHeightNeededToNotWrap) *pnHeightNeededToNotWrap = nNeeded; if (nNeeded && rColumn < mnColumns) @@ -4190,7 +4190,7 @@ EditSelection ImpEditEngine::MoveParagraphs( Range aOldPositions, sal_Int32 nNew DBG_ASSERT( GetParaPortions().Count() != 0, "No paragraphs found: MoveParagraphs" ); if ( GetParaPortions().Count() == 0 ) return EditSelection(); - aOldPositions.Justify(); + aOldPositions.Normalize(); EditSelection aSel( ImpMoveParagraphs( aOldPositions, nNewPos ) ); |