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>
This commit is contained in:
committed by
Tomaž Vajngerl
parent
51d2e73409
commit
59210b075b
@@ -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++;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 ) );
|
||||
|
||||
|
||||
@@ -2213,7 +2213,7 @@ namespace emfio
|
||||
if (nLeft > nRight || nTop > nBottom)
|
||||
{
|
||||
SAL_WARN("emfio", "broken rectangle");
|
||||
return tools::Rectangle::Justify(Point(nLeft, nTop), Point(nRight, nBottom));
|
||||
return tools::Rectangle::Normalize(Point(nLeft, nTop), Point(nRight, nBottom));
|
||||
}
|
||||
|
||||
return tools::Rectangle(nLeft, nTop, nRight, nBottom);
|
||||
|
||||
@@ -271,7 +271,7 @@ namespace emfio
|
||||
if (aTL.X() > aBR.X() || aTL.Y() > aBR.Y())
|
||||
{
|
||||
SAL_WARN("emfio", "broken rectangle");
|
||||
return tools::Rectangle::Justify(aTL, aBR);
|
||||
return tools::Rectangle::Normalize(aTL, aBR);
|
||||
}
|
||||
return tools::Rectangle( aTL, aBR );
|
||||
}
|
||||
@@ -427,7 +427,7 @@ namespace emfio
|
||||
Point aEnd( ReadYX() );
|
||||
Point aStart( ReadYX() );
|
||||
tools::Rectangle aRect( ReadRectangle() );
|
||||
aRect.Justify();
|
||||
aRect.Normalize();
|
||||
DrawArc( aRect, aStart, aEnd );
|
||||
}
|
||||
break;
|
||||
@@ -437,7 +437,7 @@ namespace emfio
|
||||
Point aEnd( ReadYX() );
|
||||
Point aStart( ReadYX() );
|
||||
tools::Rectangle aRect( ReadRectangle() );
|
||||
aRect.Justify();
|
||||
aRect.Normalize();
|
||||
|
||||
// #i73608# OutputDevice deviates from WMF
|
||||
// semantics. start==end means full ellipse here.
|
||||
@@ -453,7 +453,7 @@ namespace emfio
|
||||
Point aEnd( ReadYX() );
|
||||
Point aStart( ReadYX() );
|
||||
tools::Rectangle aRect( ReadRectangle() );
|
||||
aRect.Justify();
|
||||
aRect.Normalize();
|
||||
DrawChord( aRect, aStart, aEnd );
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -676,7 +676,7 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
|
||||
|
||||
{
|
||||
tools::Rectangle aRect( rObj.GetRect() );
|
||||
aRect.Justify();
|
||||
aRect.Normalize();
|
||||
rObj.SetRect( aRect );
|
||||
}
|
||||
|
||||
|
||||
@@ -1712,7 +1712,7 @@ bool FormulaDlg_Impl::UpdateParaWin(Selection& _rSelection)
|
||||
if (pEd && !m_pTheRefEdit)
|
||||
{
|
||||
_rSelection = pEd->GetSelection();
|
||||
_rSelection.Justify();
|
||||
_rSelection.Normalize();
|
||||
aStrEd = pEd->GetText();
|
||||
m_xEdRef->SetRefString(aStrEd);
|
||||
m_xEdRef->SetSelection( _rSelection );
|
||||
@@ -1720,7 +1720,7 @@ bool FormulaDlg_Impl::UpdateParaWin(Selection& _rSelection)
|
||||
else
|
||||
{
|
||||
_rSelection = m_xEdRef->GetSelection();
|
||||
_rSelection.Justify();
|
||||
_rSelection.Normalize();
|
||||
aStrEd = m_xEdRef->GetText();
|
||||
}
|
||||
return m_pTheRefEdit == nullptr;
|
||||
|
||||
@@ -361,7 +361,7 @@ public:
|
||||
|
||||
bool Contains( tools::Long nIs ) const;
|
||||
|
||||
void Justify();
|
||||
void Normalize();
|
||||
|
||||
Pair const & toPair() const { return *this; }
|
||||
Pair & toPair() { return *this; }
|
||||
@@ -374,7 +374,7 @@ inline bool Range::Contains( tools::Long nIs ) const
|
||||
return ((mnA <= nIs) && (nIs <= mnB ));
|
||||
}
|
||||
|
||||
inline void Range::Justify()
|
||||
inline void Range::Normalize()
|
||||
{
|
||||
if ( mnA > mnB )
|
||||
std::swap(mnA, mnB);
|
||||
@@ -418,7 +418,7 @@ public:
|
||||
|
||||
bool Contains( tools::Long nIs ) const;
|
||||
|
||||
void Justify();
|
||||
void Normalize();
|
||||
|
||||
bool operator !() const { return !Len(); }
|
||||
|
||||
@@ -437,7 +437,7 @@ inline bool Selection::Contains( tools::Long nIs ) const
|
||||
return ((mnA <= nIs) && (nIs < mnB ));
|
||||
}
|
||||
|
||||
inline void Selection::Justify()
|
||||
inline void Selection::Normalize()
|
||||
{
|
||||
if ( mnA > mnB )
|
||||
std::swap(mnA, mnB);
|
||||
@@ -494,7 +494,7 @@ public:
|
||||
/// Constructs a closed interval rectangle
|
||||
constexpr Rectangle( const Point& rLT, const Size& rSize );
|
||||
|
||||
constexpr inline static Rectangle Justify(const Point& rLT, const Point& rRB);
|
||||
constexpr inline static Rectangle Normalize(const Point& rLT, const Point& rRB);
|
||||
|
||||
constexpr tools::Long Left() const { return mnLeft; }
|
||||
constexpr tools::Long Right() const { return IsWidthEmpty() ? mnLeft : mnRight; }
|
||||
@@ -545,7 +545,7 @@ public:
|
||||
inline tools::Rectangle GetUnion( const tools::Rectangle& rRect ) const;
|
||||
inline tools::Rectangle GetIntersection( const tools::Rectangle& rRect ) const;
|
||||
|
||||
void Justify();
|
||||
void Normalize();
|
||||
|
||||
bool Contains( const Point& rPOINT ) const;
|
||||
bool Contains( const tools::Rectangle& rRect ) const;
|
||||
@@ -627,7 +627,7 @@ constexpr inline tools::Rectangle::Rectangle( const Point& rLT, const Size& rSiz
|
||||
, mnBottom(rSize.Height() ? mnTop + (rSize.Height() + (rSize.Height() > 0 ? -1 : 1)) : RECT_EMPTY)
|
||||
{}
|
||||
|
||||
constexpr inline tools::Rectangle tools::Rectangle::Justify(const Point& rLT, const Point& rRB)
|
||||
constexpr inline tools::Rectangle tools::Rectangle::Normalize(const Point& rLT, const Point& rRB)
|
||||
{
|
||||
const std::pair<tools::Long, tools::Long> aLeftRight = std::minmax(rLT.X(), rRB.X());
|
||||
const std::pair<tools::Long, tools::Long> aTopBottom = std::minmax(rLT.Y(), rRB.Y());
|
||||
|
||||
@@ -733,7 +733,7 @@ void lcl_SetLogicRectFromAnchor(SdrObject* pObj, const ScDrawObjData& rAnchor, c
|
||||
|
||||
// Set this as new, full sized logical rectangle
|
||||
tools::Rectangle aNewRectangle(aStartPoint, aEndPoint);
|
||||
aNewRectangle.Justify();
|
||||
aNewRectangle.Normalize();
|
||||
if (!lcl_AreRectanglesApproxEqual(pObj->GetLogicRect(), aNewRectangle))
|
||||
pObj->NbcSetLogicRect(lcl_makeSafeRectangle(aNewRectangle));
|
||||
|
||||
|
||||
@@ -399,7 +399,7 @@ void ScCaptionCreator::Initialize()
|
||||
/* #i98141# SdrPage::GetSize() returns negative width in RTL mode.
|
||||
The call to Rectangle::Adjust() orders left/right coordinate
|
||||
accordingly. */
|
||||
maPageRect.Justify();
|
||||
maPageRect.Normalize();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -338,7 +338,7 @@ tools::Rectangle ScDetectiveFunc::GetDrawRect( SCCOL nCol1, SCROW nRow1, SCCOL n
|
||||
tools::Rectangle aRect(
|
||||
GetDrawPos( ::std::min( nCol1, nCol2 ), ::std::min( nRow1, nRow2 ), DrawPosMode::TopLeft ),
|
||||
GetDrawPos( ::std::max( nCol1, nCol2 ), ::std::max( nRow1, nRow2 ), DrawPosMode::BottomRight ) );
|
||||
aRect.Justify(); // reorder left/right in RTL sheets
|
||||
aRect.Normalize(); // reorder left/right in RTL sheets
|
||||
return aRect;
|
||||
}
|
||||
|
||||
@@ -499,7 +499,7 @@ void ScDetectiveFunc::InsertArrow( SCCOL nCol, SCROW nRow,
|
||||
*pModel,
|
||||
SdrObjKind::Line,
|
||||
basegfx::B2DPolyPolygon(aTempPoly));
|
||||
pArrow->NbcSetLogicRect(tools::Rectangle::Justify(aStartPos,aEndPos)); //TODO: needed ???
|
||||
pArrow->NbcSetLogicRect(tools::Rectangle::Normalize(aStartPos,aEndPos)); //TODO: needed ???
|
||||
pArrow->SetMergedItemSetAndBroadcast(rAttrSet);
|
||||
|
||||
pArrow->SetLayer( SC_LAYER_INTERN );
|
||||
@@ -568,7 +568,7 @@ void ScDetectiveFunc::InsertToOtherTab( SCCOL nStartCol, SCROW nStartRow,
|
||||
*pModel,
|
||||
SdrObjKind::Line,
|
||||
basegfx::B2DPolyPolygon(aTempPoly));
|
||||
pArrow->NbcSetLogicRect(tools::Rectangle::Justify(aStartPos,aEndPos)); //TODO: needed ???
|
||||
pArrow->NbcSetLogicRect(tools::Rectangle::Normalize(aStartPos,aEndPos)); //TODO: needed ???
|
||||
|
||||
pArrow->SetMergedItemSetAndBroadcast(rAttrSet);
|
||||
|
||||
@@ -752,7 +752,7 @@ void ScDetectiveFunc::DeleteBox( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nR
|
||||
if ( auto pSdrRectObj = dynamic_cast< const SdrRectObj* >(pObject) )
|
||||
{
|
||||
aObjRect = pSdrRectObj->GetLogicRect();
|
||||
aObjRect.Justify();
|
||||
aObjRect.Normalize();
|
||||
if ( RectIsPoints( aObjRect, aStartCorner, aEndCorner ) )
|
||||
ppObj[nDelCount++] = pObject;
|
||||
}
|
||||
|
||||
@@ -4272,7 +4272,7 @@ tools::Rectangle XclImpChartDrawing::CalcAnchorRect( const XclObjAnchor& rAnchor
|
||||
static_cast< tools::Long >( static_cast< double >( bDffAnchor ? rAnchor.maFirst.mnRow : rAnchor.mnTY ) / EXC_CHART_TOTALUNITS * maChartRect.GetHeight() + 0.5 ),
|
||||
static_cast< tools::Long >( static_cast< double >( bDffAnchor ? rAnchor.maLast.mnCol : rAnchor.mnRX ) / EXC_CHART_TOTALUNITS * maChartRect.GetWidth() + 0.5 ),
|
||||
static_cast< tools::Long >( static_cast< double >( bDffAnchor ? rAnchor.maLast.mnRow : rAnchor.mnBY ) / EXC_CHART_TOTALUNITS * maChartRect.GetHeight() + 0.5 ) );
|
||||
aRect.Justify();
|
||||
aRect.Normalize();
|
||||
// move shapes into chart area for sheet charts
|
||||
if( mbOwnTab )
|
||||
aRect.Move( maChartRect.Left(), maChartRect.Top() );
|
||||
|
||||
@@ -559,7 +559,7 @@ void ScCondFormatDlg::SetReference(const ScRange& rRef, ScDocument&)
|
||||
if (pEdit != mxEdRange.get())
|
||||
{
|
||||
Selection sel = pEdit->GetSelection();
|
||||
sel.Justify(); // in case of RTL selection
|
||||
sel.Normalize(); // in case of RTL selection
|
||||
sel.Max() = sel.Min() + aRefStr.getLength();
|
||||
pEdit->GetWidget()->replace_selection(aRefStr);
|
||||
pEdit->SetSelection(sel); // to replace it again with next drag event
|
||||
|
||||
@@ -482,7 +482,7 @@ void ScOptSolverDlg::SetReference( const ScRange& rRef, ScDocument& rDocP )
|
||||
{
|
||||
OUString aVal = mpEdActive->GetText();
|
||||
Selection aSel = mpEdActive->GetSelection();
|
||||
aSel.Justify();
|
||||
aSel.Normalize();
|
||||
aVal = aVal.replaceAt( aSel.Min(), aSel.Len(), aStr );
|
||||
Selection aNewSel( aSel.Min(), aSel.Min()+aStr.getLength() );
|
||||
mpEdActive->SetRefString( aVal );
|
||||
|
||||
@@ -88,7 +88,7 @@ void ScSimpleRefDlg::SetReference( const ScRange& rRef, ScDocument& rDocP )
|
||||
{
|
||||
OUString aVal = m_xEdAssign->GetText();
|
||||
Selection aSel = m_xEdAssign->GetSelection();
|
||||
aSel.Justify();
|
||||
aSel.Normalize();
|
||||
aVal = aVal.replaceAt( aSel.Min(), aSel.Len(), aRefStr );
|
||||
Selection aNewSel( aSel.Min(), aSel.Min()+aRefStr.getLength() );
|
||||
m_xEdAssign->SetRefString( aVal );
|
||||
|
||||
@@ -178,7 +178,7 @@ void ScPrintAreasDlg::SetReference( const ScRange& rRef, ScDocument& /* rDoc */
|
||||
aStr = rRef.Format(*pDoc, ScRefFlags::RANGE_ABS, eConv);
|
||||
OUString aVal = m_xEdPrintArea->GetText();
|
||||
Selection aSel = m_xEdPrintArea->GetSelection();
|
||||
aSel.Justify();
|
||||
aSel.Normalize();
|
||||
aVal = aVal.replaceAt( aSel.Min(), aSel.Len(), aStr );
|
||||
Selection aNewSel( aSel.Min(), aSel.Min()+aStr.getLength() );
|
||||
m_xEdPrintArea->SetRefString( aVal );
|
||||
|
||||
@@ -1123,7 +1123,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
|
||||
|
||||
tools::Rectangle aBackground(aStart, aEnd);
|
||||
if (bLokRTL)
|
||||
aBackground.Justify();
|
||||
aBackground.Normalize();
|
||||
|
||||
// Need to draw the background in absolute coords.
|
||||
Point aOrigin = aOriginalMode.GetOrigin();
|
||||
@@ -1219,7 +1219,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
|
||||
// set the correct mapmode
|
||||
tools::Rectangle aBackground(aStart, aEnd);
|
||||
if (bLokRTL)
|
||||
aBackground.Justify();
|
||||
aBackground.Normalize();
|
||||
tools::Rectangle aBGAbs(aBackground);
|
||||
|
||||
if (bIsTiledRendering)
|
||||
|
||||
@@ -1390,8 +1390,8 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, tools::Long nPosX, too
|
||||
|
||||
// justify both rectangles for alignment calculation, use with DrawText etc.
|
||||
|
||||
rParam.maAlignRect.Justify();
|
||||
rParam.maClipRect.Justify();
|
||||
rParam.maAlignRect.Normalize();
|
||||
rParam.maClipRect.Normalize();
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -2846,7 +2846,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
|
||||
}
|
||||
|
||||
aPropOpt.CreateShadowProperties( mXPropSet );
|
||||
maRect.Justify();
|
||||
maRect.Normalize();
|
||||
if ( mnAngle )
|
||||
ImplFlipBoundingBox( aPropOpt );
|
||||
aPropOpt.CreateShapeProperties( mXShape );
|
||||
|
||||
@@ -131,7 +131,7 @@ bool FuZoom::MouseMove(const MouseEvent& rMEvt)
|
||||
{
|
||||
::tools::Rectangle aRect(aBeginPos, aEndPos);
|
||||
aZoomRect = aRect;
|
||||
aZoomRect.Justify();
|
||||
aZoomRect.Normalize();
|
||||
mpViewShell->DrawMarkRect(aZoomRect);
|
||||
bVisible = true;
|
||||
}
|
||||
|
||||
@@ -1390,7 +1390,7 @@ void MultiSelectionModeHandler::UpdateSelection()
|
||||
mnSecondIndex = nIndexUnderMouse;
|
||||
|
||||
Range aRange (mnAnchorIndex, mnSecondIndex);
|
||||
aRange.Justify();
|
||||
aRange.Normalize();
|
||||
|
||||
for (sal_Int32 nIndex=0; nIndex<nPageCount; ++nIndex)
|
||||
{
|
||||
|
||||
@@ -411,7 +411,7 @@ void BrowseBox::ExpandRowSelection( const BrowserMouseEvent& rEvt )
|
||||
if ( bMultiSelection )
|
||||
{
|
||||
Range aJustifiedRange( aSelRange );
|
||||
aJustifiedRange.Justify();
|
||||
aJustifiedRange.Normalize();
|
||||
|
||||
bool bSelectThis = ( bSelect != aJustifiedRange.Contains( rEvt.GetRow() ) );
|
||||
|
||||
|
||||
@@ -1139,7 +1139,7 @@ tools::Rectangle EnhancedCustomShape2d::GetTextRect() const
|
||||
if( aRect.GetWidth() <= 1 || aRect.GetHeight() <= 1 )
|
||||
return aLogicRect;
|
||||
aRect.Move( aLogicRect.Left(), aLogicRect.Top() );
|
||||
aRect.Justify();
|
||||
aRect.Normalize();
|
||||
return aRect;
|
||||
}
|
||||
|
||||
@@ -1989,7 +1989,7 @@ static basegfx::B2DPolygon CreateArc( const tools::Rectangle& rRect, const Point
|
||||
bSwapStartEndAngle ^= 0x11;
|
||||
if ( bSwapStartEndAngle )
|
||||
{
|
||||
aRect.Justify();
|
||||
aRect.Normalize();
|
||||
if ( bSwapStartEndAngle & 1 )
|
||||
{
|
||||
Point aTmp( aStart );
|
||||
@@ -2370,7 +2370,7 @@ void EnhancedCustomShape2d::CreateSubPath(
|
||||
}
|
||||
aNewB2DPolygon.clear();
|
||||
}
|
||||
tools::Rectangle aRect = tools::Rectangle::Justify( GetPoint( seqCoordinates[ rSrcPt ], true, true ), GetPoint( seqCoordinates[ rSrcPt + 1 ], true, true ) );
|
||||
tools::Rectangle aRect = tools::Rectangle::Normalize( GetPoint( seqCoordinates[ rSrcPt ], true, true ), GetPoint( seqCoordinates[ rSrcPt + 1 ], true, true ) );
|
||||
if ( aRect.GetWidth() && aRect.GetHeight() )
|
||||
{
|
||||
Point aStart( GetPoint( seqCoordinates[ static_cast<sal_uInt16>( rSrcPt + nXor ) ], true, true ) );
|
||||
|
||||
@@ -200,7 +200,7 @@ bool ContourWindow::MouseButtonUp(const MouseEvent& rMEvt)
|
||||
aWorkRect.SetRight( aLogPt.X() );
|
||||
aWorkRect.SetBottom( aLogPt.Y() );
|
||||
aWorkRect.Intersection( aGraphRect );
|
||||
aWorkRect.Justify();
|
||||
aWorkRect.Normalize();
|
||||
|
||||
if ( aWorkRect.Left() != aWorkRect.Right() && aWorkRect.Top() != aWorkRect.Bottom() )
|
||||
{
|
||||
|
||||
@@ -686,7 +686,7 @@ bool E3dScene::BegCreate(SdrDragStat& rStat)
|
||||
{
|
||||
rStat.SetOrtho4Possible();
|
||||
tools::Rectangle aRect1(rStat.GetStart(), rStat.GetNow());
|
||||
aRect1.Justify();
|
||||
aRect1.Normalize();
|
||||
rStat.SetActionRect(aRect1);
|
||||
NbcSetSnapRect(aRect1);
|
||||
return true;
|
||||
@@ -696,7 +696,7 @@ bool E3dScene::MovCreate(SdrDragStat& rStat)
|
||||
{
|
||||
tools::Rectangle aRect1;
|
||||
rStat.TakeCreateRect(aRect1);
|
||||
aRect1.Justify();
|
||||
aRect1.Normalize();
|
||||
rStat.SetActionRect(aRect1);
|
||||
NbcSetSnapRect(aRect1);
|
||||
SetBoundRectDirty();
|
||||
@@ -708,7 +708,7 @@ bool E3dScene::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
|
||||
{
|
||||
tools::Rectangle aRect1;
|
||||
rStat.TakeCreateRect(aRect1);
|
||||
aRect1.Justify();
|
||||
aRect1.Normalize();
|
||||
NbcSetSnapRect(aRect1);
|
||||
SetBoundAndSnapRectsDirty();
|
||||
return (eCmd==SdrCreateCmd::ForceEnd || rStat.GetPointCount()>=2);
|
||||
|
||||
@@ -421,7 +421,7 @@ bool SdrMarkView::EndMarkObj()
|
||||
if(maDragStat.IsMinMoved())
|
||||
{
|
||||
tools::Rectangle aRect(maDragStat.GetStart(), maDragStat.GetNow());
|
||||
aRect.Justify();
|
||||
aRect.Normalize();
|
||||
MarkObj(aRect, mpMarkObjOverlay->IsUnmarking());
|
||||
bRetval = true;
|
||||
}
|
||||
@@ -484,7 +484,7 @@ bool SdrMarkView::EndMarkPoints()
|
||||
if(maDragStat.IsMinMoved())
|
||||
{
|
||||
tools::Rectangle aRect(maDragStat.GetStart(), maDragStat.GetNow());
|
||||
aRect.Justify();
|
||||
aRect.Normalize();
|
||||
MarkPoints(&aRect, mpMarkPointsOverlay->IsUnmarking());
|
||||
|
||||
bRetval = true;
|
||||
@@ -546,7 +546,7 @@ void SdrMarkView::EndMarkGluePoints()
|
||||
if(maDragStat.IsMinMoved())
|
||||
{
|
||||
tools::Rectangle aRect(maDragStat.GetStart(),maDragStat.GetNow());
|
||||
aRect.Justify();
|
||||
aRect.Normalize();
|
||||
MarkGluePoints(&aRect, mpMarkGluePointsOverlay->IsUnmarking());
|
||||
}
|
||||
|
||||
@@ -1094,7 +1094,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S
|
||||
tools::Rectangle aNegatedRect(aSelection);
|
||||
aNegatedRect.SetLeft(-aNegatedRect.Left());
|
||||
aNegatedRect.SetRight(-aNegatedRect.Right());
|
||||
aNegatedRect.Justify();
|
||||
aNegatedRect.Normalize();
|
||||
sSelectionText = aNegatedRect.toString() +
|
||||
", " + OString::number(nRotAngle.get());
|
||||
}
|
||||
|
||||
@@ -1923,7 +1923,7 @@ void SdrObjCustomShape::DragResizeCustomShape( const tools::Rectangle& rNewRect
|
||||
bool bOldMirroredY( IsMirroredY() );
|
||||
|
||||
tools::Rectangle aNewRect( rNewRect );
|
||||
aNewRect.Justify();
|
||||
aNewRect.Normalize();
|
||||
|
||||
std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles() );
|
||||
|
||||
|
||||
@@ -1319,7 +1319,7 @@ tools::Rectangle SdrObject::ImpDragCalcRect(const SdrDragStat& rDrag) const
|
||||
}
|
||||
}
|
||||
}
|
||||
aTmpRect.Justify();
|
||||
aTmpRect.Normalize();
|
||||
return aTmpRect;
|
||||
}
|
||||
|
||||
@@ -1380,7 +1380,7 @@ bool SdrObject::BegCreate(SdrDragStat& rStat)
|
||||
{
|
||||
rStat.SetOrtho4Possible();
|
||||
tools::Rectangle aRect1(rStat.GetStart(), rStat.GetNow());
|
||||
aRect1.Justify();
|
||||
aRect1.Normalize();
|
||||
rStat.SetActionRect(aRect1);
|
||||
setOutRectangle(aRect1);
|
||||
return true;
|
||||
@@ -1391,7 +1391,7 @@ bool SdrObject::MovCreate(SdrDragStat& rStat)
|
||||
tools::Rectangle aRectangle;
|
||||
rStat.TakeCreateRect(aRectangle);
|
||||
rStat.SetActionRect(aRectangle);
|
||||
aRectangle.Justify();
|
||||
aRectangle.Normalize();
|
||||
setOutRectangle(aRectangle);
|
||||
return true;
|
||||
}
|
||||
@@ -1400,7 +1400,7 @@ bool SdrObject::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
|
||||
{
|
||||
tools::Rectangle aRectangle;
|
||||
rStat.TakeCreateRect(aRectangle);
|
||||
aRectangle.Justify();
|
||||
aRectangle.Normalize();
|
||||
setOutRectangle(aRectangle);
|
||||
|
||||
return (eCmd==SdrCreateCmd::ForceEnd || rStat.GetPointCount()>=2);
|
||||
@@ -1419,7 +1419,7 @@ basegfx::B2DPolyPolygon SdrObject::TakeCreatePoly(const SdrDragStat& rDrag) cons
|
||||
{
|
||||
tools::Rectangle aRect1;
|
||||
rDrag.TakeCreateRect(aRect1);
|
||||
aRect1.Justify();
|
||||
aRect1.Normalize();
|
||||
|
||||
basegfx::B2DPolyPolygon aRetval;
|
||||
aRetval.append(basegfx::utils::createPolygonFromRect(vcl::unotools::b2DRectangleFromRectangle(aRect1)));
|
||||
@@ -1496,7 +1496,7 @@ tools::Rectangle lclRotateRectangle(tools::Rectangle const& rRectangle, Point co
|
||||
aRectangle.SetBottom(-R.Left() );
|
||||
}
|
||||
aRectangle.Move(rRef.X(),rRef.Y());
|
||||
aRectangle.Justify(); // just in case
|
||||
aRectangle.Normalize(); // just in case
|
||||
return aRectangle;
|
||||
}
|
||||
|
||||
@@ -1525,7 +1525,7 @@ tools::Rectangle lclMirrorRectangle(tools::Rectangle const& rRectangle, Point co
|
||||
aRectangle.SetBottom(-R.Left() );
|
||||
}
|
||||
aRectangle.Move(rRef1.X(),rRef1.Y());
|
||||
aRectangle.Justify(); // just in case
|
||||
aRectangle.Normalize(); // just in case
|
||||
return aRectangle;
|
||||
}
|
||||
|
||||
|
||||
@@ -631,7 +631,7 @@ OUString SdrCircObj::getSpecialDragComment(const SdrDragStat& rDrag) const
|
||||
void ImpCircUser::SetCreateParams(SdrDragStat const & rStat)
|
||||
{
|
||||
rStat.TakeCreateRect(aR);
|
||||
aR.Justify();
|
||||
aR.Normalize();
|
||||
aCenter=aR.Center();
|
||||
nWdt=aR.Right()-aR.Left();
|
||||
nHgt=aR.Bottom()-aR.Top();
|
||||
@@ -694,7 +694,7 @@ bool SdrCircObj::BegCreate(SdrDragStat& rStat)
|
||||
{
|
||||
rStat.SetOrtho4Possible();
|
||||
tools::Rectangle aRect1(rStat.GetStart(), rStat.GetNow());
|
||||
aRect1.Justify();
|
||||
aRect1.Normalize();
|
||||
rStat.SetActionRect(aRect1);
|
||||
maRect = aRect1;
|
||||
ImpSetCreateParams(rStat);
|
||||
|
||||
@@ -697,7 +697,7 @@ void SdrMeasureObj::TakeUnrotatedSnapRect(tools::Rectangle& rRect) const
|
||||
RotatePoint(aTextPos,aPt1b,aMPol.nLineSin,aMPol.nLineCos);
|
||||
aTextSize2.AdjustWidth( 1 ); aTextSize2.AdjustHeight( 1 ); // because of the Rect-Ctor's odd behavior
|
||||
rRect=tools::Rectangle(aTextPos,aTextSize2);
|
||||
rRect.Justify();
|
||||
rRect.Normalize();
|
||||
const_cast<SdrMeasureObj*>(this)->maRect=rRect;
|
||||
|
||||
if (aMPol.nTextAngle != maGeo.nRotationAngle) {
|
||||
|
||||
@@ -1685,7 +1685,7 @@ void SdrPathObj::ImpForceLineAngle()
|
||||
maGeo.RecalcTan();
|
||||
|
||||
// for SdrTextObj, keep aRect up to date
|
||||
maRect = tools::Rectangle::Justify(aPoint0, aPoint1);
|
||||
maRect = tools::Rectangle::Normalize(aPoint0, aPoint1);
|
||||
}
|
||||
|
||||
void SdrPathObj::ImpForceKind()
|
||||
|
||||
@@ -429,7 +429,7 @@ basegfx::B2DPolyPolygon SdrRectObj::TakeCreatePoly(const SdrDragStat& rDrag) con
|
||||
{
|
||||
tools::Rectangle aRect1;
|
||||
rDrag.TakeCreateRect(aRect1);
|
||||
aRect1.Justify();
|
||||
aRect1.Normalize();
|
||||
|
||||
basegfx::B2DPolyPolygon aRetval;
|
||||
aRetval.append(ImpCalcXPoly(aRect1,GetEckenradius()).getB2DPolygon());
|
||||
|
||||
@@ -421,7 +421,7 @@ SdrTextVertAdjust SdrTextObj::GetTextVerticalAdjust(const SfxItemSet& rSet) cons
|
||||
void SdrTextObj::ImpJustifyRect(tools::Rectangle& rRect)
|
||||
{
|
||||
if (!rRect.IsEmpty()) {
|
||||
rRect.Justify();
|
||||
rRect.Normalize();
|
||||
if (rRect.Left()==rRect.Right()) rRect.AdjustRight( 1 );
|
||||
if (rRect.Top()==rRect.Bottom()) rRect.AdjustBottom( 1 );
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ bool SdrTextObj::BegCreate(SdrDragStat& rStat)
|
||||
{
|
||||
rStat.SetOrtho4Possible();
|
||||
tools::Rectangle aRect1(rStat.GetStart(), rStat.GetNow());
|
||||
aRect1.Justify();
|
||||
aRect1.Normalize();
|
||||
rStat.SetActionRect(aRect1);
|
||||
maRect = aRect1;
|
||||
return true;
|
||||
@@ -231,7 +231,7 @@ basegfx::B2DPolyPolygon SdrTextObj::TakeCreatePoly(const SdrDragStat& rDrag) con
|
||||
{
|
||||
tools::Rectangle aRect1;
|
||||
rDrag.TakeCreateRect(aRect1);
|
||||
aRect1.Justify();
|
||||
aRect1.Normalize();
|
||||
|
||||
basegfx::B2DPolyPolygon aRetval;
|
||||
const basegfx::B2DRange aRange = vcl::unotools::b2DRectangleFromRectangle(aRect1);
|
||||
|
||||
@@ -122,7 +122,7 @@ void SdrTextObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract
|
||||
if (maGeo.nRotationAngle==0_deg100 && maGeo.nShearAngle==0_deg100) {
|
||||
ResizeRect(maRect,rRef,xFact,yFact);
|
||||
if (bYMirr) {
|
||||
maRect.Justify();
|
||||
maRect.Normalize();
|
||||
maRect.Move(maRect.Right()-maRect.Left(),maRect.Bottom()-maRect.Top());
|
||||
maGeo.nRotationAngle=18000_deg100;
|
||||
maGeo.RecalcSinCos();
|
||||
|
||||
@@ -58,7 +58,7 @@ void ResizeRect(tools::Rectangle& rRect, const Point& rRef, const Fraction& rxFa
|
||||
rRect.SetTop( rRef.Y() + FRound( (rRect.Top() - rRef.Y()) * double(aYFact) ) );
|
||||
rRect.SetBottom( rRef.Y() + FRound( (rRect.Bottom() - rRef.Y()) * double(aYFact) ) );
|
||||
|
||||
rRect.Justify();
|
||||
rRect.Normalize();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2304,7 +2304,7 @@ bool SdrTableObj::BegCreate(SdrDragStat& rStat)
|
||||
{
|
||||
rStat.SetOrtho4Possible();
|
||||
tools::Rectangle aRect1(rStat.GetStart(), rStat.GetNow());
|
||||
aRect1.Justify();
|
||||
aRect1.Normalize();
|
||||
rStat.SetActionRect(aRect1);
|
||||
maRect = aRect1;
|
||||
return true;
|
||||
@@ -2346,7 +2346,7 @@ basegfx::B2DPolyPolygon SdrTableObj::TakeCreatePoly(const SdrDragStat& rDrag) co
|
||||
{
|
||||
tools::Rectangle aRect1;
|
||||
rDrag.TakeCreateRect(aRect1);
|
||||
aRect1.Justify();
|
||||
aRect1.Normalize();
|
||||
|
||||
basegfx::B2DPolyPolygon aRetval;
|
||||
const basegfx::B2DRange aRange = vcl::unotools::b2DRectangleFromRectangle(aRect1);
|
||||
|
||||
@@ -203,7 +203,7 @@ Point SvResizeHelper::GetTrackPosPixel( const tools::Rectangle & rRect ) const
|
||||
// which handle has been touched
|
||||
Point aPos;
|
||||
tools::Rectangle aRect( rRect );
|
||||
aRect.Justify();
|
||||
aRect.Normalize();
|
||||
// only because of EMPTY_RECT
|
||||
Point aBR = aOuter.BottomRight();
|
||||
Point aTR = aOuter.TopRight();
|
||||
@@ -402,7 +402,7 @@ bool SvResizeHelper::SelectRelease( vcl::Window * pWin, const Point & rPos,
|
||||
if( -1 != nGrab )
|
||||
{
|
||||
rOutPosSize = GetTrackRectPixel( rPos );
|
||||
rOutPosSize.Justify();
|
||||
rOutPosSize.Normalize();
|
||||
nGrab = -1;
|
||||
pWin->ReleaseMouse();
|
||||
pWin->HideTracking();
|
||||
|
||||
@@ -99,10 +99,10 @@ tools::Rectangle& tools::Rectangle::Intersection( const tools::Rectangle& rRect
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Justify rectangle
|
||||
// Normalize rectangle
|
||||
tools::Rectangle aTmpRect( rRect );
|
||||
Justify();
|
||||
aTmpRect.Justify();
|
||||
Normalize();
|
||||
aTmpRect.Normalize();
|
||||
|
||||
// Perform intersection
|
||||
mnLeft = std::max( mnLeft, aTmpRect.mnLeft );
|
||||
@@ -117,7 +117,7 @@ tools::Rectangle& tools::Rectangle::Intersection( const tools::Rectangle& rRect
|
||||
return *this;
|
||||
}
|
||||
|
||||
void tools::Rectangle::Justify()
|
||||
void tools::Rectangle::Normalize()
|
||||
{
|
||||
if ((mnRight < mnLeft) && (!IsWidthEmpty()))
|
||||
{
|
||||
|
||||
@@ -121,7 +121,7 @@ ImplPolygon::ImplPolygon( const tools::Rectangle& rRect, sal_uInt32 nHorzRound,
|
||||
if ( !rRect.IsEmpty() )
|
||||
{
|
||||
tools::Rectangle aRect( rRect );
|
||||
aRect.Justify(); // SJ: i9140
|
||||
aRect.Normalize(); // SJ: i9140
|
||||
|
||||
nHorzRound = std::min( nHorzRound, static_cast<sal_uInt32>(std::abs( aRect.GetWidth() >> 1 )) );
|
||||
nVertRound = std::min( nVertRound, static_cast<sal_uInt32>(std::abs( aRect.GetHeight() >> 1 )) );
|
||||
@@ -1443,9 +1443,9 @@ void Polygon::Clip( const tools::Rectangle& rRect )
|
||||
// Use PolyPolygon::Clip().
|
||||
assert( !HasFlags());
|
||||
|
||||
// #105251# Justify rect before edge filtering
|
||||
// #105251# Normalize rect before edge filtering
|
||||
tools::Rectangle aJustifiedRect( rRect );
|
||||
aJustifiedRect.Justify();
|
||||
aJustifiedRect.Normalize();
|
||||
|
||||
sal_uInt16 nSourceSize = mpImplPolygon->mnPoints;
|
||||
ImplPolygonPointFilter aPolygon( nSourceSize );
|
||||
|
||||
@@ -1278,7 +1278,7 @@ tools::Polygon BitmapEx::GetContour( bool bContourEdgeDetect,
|
||||
if( pWorkRectPixel )
|
||||
aWorkRect.Intersection( *pWorkRectPixel );
|
||||
|
||||
aWorkRect.Justify();
|
||||
aWorkRect.Normalize();
|
||||
|
||||
if( ( aWorkRect.GetWidth() > 4 ) && ( aWorkRect.GetHeight() > 4 ) )
|
||||
{
|
||||
|
||||
@@ -648,7 +648,7 @@ vcl::Region Bitmap::CreateRegion(const Color& rColor, const tools::Rectangle& rR
|
||||
ScopedReadAccess pReadAcc(const_cast<Bitmap&>(*this));
|
||||
|
||||
aRect.Intersection(tools::Rectangle(Point(), GetSizePixel()));
|
||||
aRect.Justify();
|
||||
aRect.Normalize();
|
||||
|
||||
if (pReadAcc)
|
||||
{
|
||||
|
||||
+11
-11
@@ -543,14 +543,14 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const tools::Rectangl
|
||||
vcl::Region aHighlightClipRegion;
|
||||
vcl::Region aNormalClipRegion;
|
||||
Selection aTmpSel(maSelection);
|
||||
aTmpSel.Justify();
|
||||
aTmpSel.Normalize();
|
||||
// selection is highlighted
|
||||
for(sal_Int32 i = 0; i < nLen; ++i)
|
||||
{
|
||||
tools::Rectangle aRect(aPos, Size(10, nTH));
|
||||
aRect.SetLeft( pDX[2 * i] + mnXOffset + ImplGetExtraXOffset() );
|
||||
aRect.SetRight( pDX[2 * i + 1] + mnXOffset + ImplGetExtraXOffset() );
|
||||
aRect.Justify();
|
||||
aRect.Normalize();
|
||||
bool bHighlight = false;
|
||||
if (i >= aTmpSel.Min() && i < aTmpSel.Max())
|
||||
bHighlight = true;
|
||||
@@ -628,7 +628,7 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const tools::Rectangl
|
||||
tools::Rectangle aRect( aPos, Size( 10, nTH ) );
|
||||
aRect.SetLeft( pDX[2 * (nIndex + mpIMEInfos->nPos)] + mnXOffset + ImplGetExtraXOffset() );
|
||||
aRect.SetRight( pDX[2 * (nIndex + mpIMEInfos->nPos) + 1] + mnXOffset + ImplGetExtraXOffset() );
|
||||
aRect.Justify();
|
||||
aRect.Normalize();
|
||||
aClip.Union(aRect);
|
||||
nIndex++;
|
||||
}
|
||||
@@ -685,7 +685,7 @@ void Edit::ImplDelete( const Selection& rSelection, sal_uInt8 nDirection, sal_uI
|
||||
ImplClearLayoutData();
|
||||
|
||||
Selection aSelection( rSelection );
|
||||
aSelection.Justify();
|
||||
aSelection.Normalize();
|
||||
|
||||
if ( !aSelection.Len() )
|
||||
{
|
||||
@@ -789,7 +789,7 @@ bool Edit::ImplTruncateToMaxLen( OUString& rStr, sal_Int32 nSelectionLen ) const
|
||||
void Edit::ImplInsertText( const OUString& rStr, const Selection* pNewSel, bool bIsUserInput )
|
||||
{
|
||||
Selection aSelection( maSelection );
|
||||
aSelection.Justify();
|
||||
aSelection.Normalize();
|
||||
|
||||
OUString aNewText( ImplGetValidString( rStr ) );
|
||||
|
||||
@@ -1306,7 +1306,7 @@ void Edit::ImplPaste( uno::Reference< datatransfer::clipboard::XClipboard > cons
|
||||
aData >>= aText;
|
||||
|
||||
Selection aSelection(maSelection);
|
||||
aSelection.Justify();
|
||||
aSelection.Normalize();
|
||||
if (ImplTruncateToMaxLen(aText, aSelection.Len()))
|
||||
ShowTruncationWarning(GetFrameWeld());
|
||||
|
||||
@@ -1327,7 +1327,7 @@ void Edit::MouseButtonDown( const MouseEvent& rMEvt )
|
||||
|
||||
sal_Int32 nCharPos = ImplGetCharPos( rMEvt.GetPosPixel() );
|
||||
Selection aSelection( maSelection );
|
||||
aSelection.Justify();
|
||||
aSelection.Normalize();
|
||||
|
||||
if ( rMEvt.GetClicks() < 4 )
|
||||
{
|
||||
@@ -2501,7 +2501,7 @@ OUString Edit::GetSelected() const
|
||||
else
|
||||
{
|
||||
Selection aSelection( maSelection );
|
||||
aSelection.Justify();
|
||||
aSelection.Normalize();
|
||||
return OUString( maText.getStr() + aSelection.Min(), aSelection.Len() );
|
||||
}
|
||||
}
|
||||
@@ -2731,7 +2731,7 @@ void Edit::dragGestureRecognized( const css::datatransfer::dnd::DragGestureEvent
|
||||
return;
|
||||
|
||||
Selection aSel( maSelection );
|
||||
aSel.Justify();
|
||||
aSel.Normalize();
|
||||
|
||||
// only if mouse in the selection...
|
||||
Point aMousePos( rDGE.DragOriginX, rDGE.DragOriginY );
|
||||
@@ -2793,7 +2793,7 @@ void Edit::drop( const css::datatransfer::dnd::DropTargetDropEvent& rDTDE )
|
||||
ImplHideDDCursor();
|
||||
|
||||
Selection aSel( maSelection );
|
||||
aSel.Justify();
|
||||
aSel.Normalize();
|
||||
|
||||
if ( aSel.Len() && !mpDDInfo->bStarterOfDD )
|
||||
ImplDelete( aSel, EDIT_DEL_RIGHT, EDIT_DELMODE_SIMPLE );
|
||||
@@ -2871,7 +2871,7 @@ void Edit::dragOver( const css::datatransfer::dnd::DropTargetDragEvent& rDTDE )
|
||||
*/
|
||||
|
||||
Selection aSel( maSelection );
|
||||
aSel.Justify();
|
||||
aSel.Normalize();
|
||||
|
||||
// Don't accept drop in selection or read-only field...
|
||||
if ( IsReadOnly() || aSel.Contains( mpDDInfo->nDropPos ) || ! mpDDInfo->bIsStringSupported )
|
||||
|
||||
@@ -755,7 +755,7 @@ void NumericFormatter::ImplNewFieldValue( sal_Int64 nNewValue )
|
||||
// should be checked and clearly traced (with comment) in order to find out what happens.
|
||||
|
||||
Selection aSelection = GetField()->GetSelection();
|
||||
aSelection.Justify();
|
||||
aSelection.Normalize();
|
||||
OUString aText = GetField()->GetText();
|
||||
// leave it as is if selected until end
|
||||
if ( static_cast<sal_Int32>(aSelection.Max()) == aText.getLength() )
|
||||
|
||||
@@ -555,7 +555,7 @@ static bool ImplPatternProcessKeyInput( IEditImplementation& rEdit, const KeyEve
|
||||
// Use the start of selection as minimum; even a small position is allowed in case that
|
||||
// all was selected by the focus
|
||||
Selection aSel( aOldSel );
|
||||
aSel.Justify();
|
||||
aSel.Normalize();
|
||||
nCursorPos = aSel.Min();
|
||||
aSel.Max() = ImplPatternRightPos( rEdit.GetText(), rEditMask, nFormatFlags, bSameMask, nCursorPos );
|
||||
if ( bShift )
|
||||
@@ -592,7 +592,7 @@ static bool ImplPatternProcessKeyInput( IEditImplementation& rEdit, const KeyEve
|
||||
// Use the start of selection as minimum; even a small position is allowed in case that
|
||||
// all was selected by the focus
|
||||
Selection aSel( aOldSel );
|
||||
aSel.Justify();
|
||||
aSel.Normalize();
|
||||
nCursorPos = static_cast<sal_Int32>(aSel.Min());
|
||||
ImplPatternMaxPos( rEdit.GetText(), rEditMask, nFormatFlags, bSameMask, nCursorPos, nNewPos );
|
||||
aSel.Max() = nNewPos;
|
||||
@@ -609,7 +609,7 @@ static bool ImplPatternProcessKeyInput( IEditImplementation& rEdit, const KeyEve
|
||||
OUStringBuffer aStr( aOldStr );
|
||||
Selection aSel = aOldSel;
|
||||
|
||||
aSel.Justify();
|
||||
aSel.Normalize();
|
||||
nNewPos = static_cast<sal_Int32>(aSel.Min());
|
||||
|
||||
// if selection then delete it
|
||||
@@ -678,7 +678,7 @@ static bool ImplPatternProcessKeyInput( IEditImplementation& rEdit, const KeyEve
|
||||
return false;
|
||||
|
||||
Selection aSel = aOldSel;
|
||||
aSel.Justify();
|
||||
aSel.Normalize();
|
||||
nNewPos = aSel.Min();
|
||||
|
||||
if ( nNewPos < rEditMask.getLength() )
|
||||
@@ -1656,7 +1656,7 @@ void DateField::ImplDateSpinArea( bool bUp )
|
||||
|
||||
Date aDate( GetDate() );
|
||||
Selection aSelection = GetField()->GetSelection();
|
||||
aSelection.Justify();
|
||||
aSelection.Normalize();
|
||||
OUString aText( GetText() );
|
||||
if ( static_cast<sal_Int32>(aSelection.Len()) == aText.getLength() )
|
||||
ImplDateIncrementDay( aDate, bUp );
|
||||
@@ -1878,7 +1878,7 @@ void DateFormatter::ImplNewFieldValue( const Date& rDate )
|
||||
return;
|
||||
|
||||
Selection aSelection = GetField()->GetSelection();
|
||||
aSelection.Justify();
|
||||
aSelection.Normalize();
|
||||
OUString aText = GetField()->GetText();
|
||||
|
||||
// If selected until the end then keep it that way
|
||||
@@ -2742,7 +2742,7 @@ void TimeFormatter::ImplNewFieldValue( const tools::Time& rTime )
|
||||
return;
|
||||
|
||||
Selection aSelection = GetField()->GetSelection();
|
||||
aSelection.Justify();
|
||||
aSelection.Normalize();
|
||||
OUString aText = GetField()->GetText();
|
||||
|
||||
// If selected until the end then keep it that way
|
||||
|
||||
@@ -317,7 +317,7 @@ void Formatter::SetTextFormatted(const OUString& rStr)
|
||||
// calculate the new selection
|
||||
Selection aSel(GetEntrySelection());
|
||||
Selection aNewSel(aSel);
|
||||
aNewSel.Justify();
|
||||
aNewSel.Normalize();
|
||||
sal_Int32 nNewLen = sFormatted.getLength();
|
||||
sal_Int32 nCurrentLen = GetEntryText().getLength();
|
||||
if ((nNewLen > nCurrentLen) && (aNewSel.Max() == nCurrentLen))
|
||||
@@ -416,7 +416,7 @@ void Formatter::ImplSetTextImpl(const OUString& rNew, Selection const * pNewSel)
|
||||
else
|
||||
{
|
||||
Selection aSel(GetEntrySelection());
|
||||
aSel.Justify();
|
||||
aSel.Normalize();
|
||||
|
||||
sal_Int32 nNewLen = rNew.getLength();
|
||||
sal_Int32 nCurrentLen = GetEntryText().getLength();
|
||||
|
||||
@@ -2216,7 +2216,7 @@ tools::Rectangle SvxIconChoiceCtrl_Impl::CalcFocusRect( SvxIconChoiceCtrlEntry*
|
||||
static tools::Rectangle GetHotSpot( const tools::Rectangle& rRect )
|
||||
{
|
||||
tools::Rectangle aResult( rRect );
|
||||
aResult.Justify();
|
||||
aResult.Normalize();
|
||||
Size aSize( rRect.GetSize() );
|
||||
tools::Long nDelta = aSize.Width() / 4;
|
||||
aResult.AdjustLeft(nDelta );
|
||||
@@ -2252,7 +2252,7 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const tools::Rectangle& rRect, bool bAd
|
||||
const size_t nCount = maZOrderList.size();
|
||||
|
||||
tools::Rectangle aRect( rRect );
|
||||
aRect.Justify();
|
||||
aRect.Normalize();
|
||||
bool bCalcOverlap = (bAdd && pOtherRects && !pOtherRects->empty());
|
||||
|
||||
bool bResetClipRegion = false;
|
||||
@@ -2403,7 +2403,7 @@ void SvxIconChoiceCtrl_Impl::AddSelectedRect( SvxIconChoiceCtrlEntry* pEntry1,
|
||||
void SvxIconChoiceCtrl_Impl::AddSelectedRect( const tools::Rectangle& rRect )
|
||||
{
|
||||
tools::Rectangle newRect = rRect;
|
||||
newRect.Justify();
|
||||
newRect.Normalize();
|
||||
aSelectedRectList.push_back( newRect );
|
||||
}
|
||||
|
||||
|
||||
@@ -269,7 +269,7 @@ void ScrollBar::ImplCalc( bool bUpdate )
|
||||
aControlRegion, ControlState::NONE, ImplControlValue(), aBoundingRegion, aTrackRegion ) )
|
||||
maTrackRect = aTrackRegion;
|
||||
else
|
||||
maTrackRect = tools::Rectangle::Justify( maBtn1Rect.TopRight(), maBtn2Rect.BottomLeft() );
|
||||
maTrackRect = tools::Rectangle::Normalize( maBtn1Rect.TopRight(), maBtn2Rect.BottomLeft() );
|
||||
|
||||
// Check if available space is big enough for thumb ( min thumb size = ScrBar width/height )
|
||||
mnThumbPixRange = maTrackRect.Right() - maTrackRect.Left();
|
||||
@@ -306,7 +306,7 @@ void ScrollBar::ImplCalc( bool bUpdate )
|
||||
aControlRegion, ControlState::NONE, ImplControlValue(), aBoundingRegion, aTrackRegion ) )
|
||||
maTrackRect = aTrackRegion;
|
||||
else
|
||||
maTrackRect = tools::Rectangle::Justify( maBtn1Rect.BottomLeft()+Point(0,1), maBtn2Rect.TopRight() );
|
||||
maTrackRect = tools::Rectangle::Normalize( maBtn1Rect.BottomLeft()+Point(0,1), maBtn2Rect.TopRight() );
|
||||
|
||||
// Check if available space is big enough for thumb
|
||||
mnThumbPixRange = maTrackRect.Bottom() - maTrackRect.Top();
|
||||
@@ -1338,7 +1338,7 @@ void ScrollBar::SetRange( const Range& rRange )
|
||||
{
|
||||
// Adapt Range
|
||||
Range aRange = rRange;
|
||||
aRange.Justify();
|
||||
aRange.Normalize();
|
||||
tools::Long nNewMinRange = aRange.Min();
|
||||
tools::Long nNewMaxRange = aRange.Max();
|
||||
|
||||
|
||||
@@ -850,7 +850,7 @@ void Slider::SetRange( const Range& rRange )
|
||||
{
|
||||
// adjust Range
|
||||
Range aRange = rRange;
|
||||
aRange.Justify();
|
||||
aRange.Normalize();
|
||||
tools::Long nNewMinRange = aRange.Min();
|
||||
tools::Long nNewMaxRange = aRange.Max();
|
||||
|
||||
|
||||
@@ -349,7 +349,7 @@ void SpinButton::SetRange( const Range& rRange )
|
||||
{
|
||||
// adjust rage
|
||||
Range aRange = rRange;
|
||||
aRange.Justify();
|
||||
aRange.Normalize();
|
||||
tools::Long nNewMinRange = aRange.Min();
|
||||
tools::Long nNewMaxRange = aRange.Max();
|
||||
|
||||
|
||||
@@ -1355,7 +1355,7 @@ tools::Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference ) const
|
||||
MetaLineAction* pAct = static_cast<MetaLineAction*>(pAction);
|
||||
Point aP1( pAct->GetStartPoint() ), aP2( pAct->GetEndPoint() );
|
||||
tools::Rectangle aRect( aP1, aP2 );
|
||||
aRect.Justify();
|
||||
aRect.Normalize();
|
||||
|
||||
ImplActionBounds( aBound, OutputDevice::LogicToLogic( aRect, aMapVDev->GetMapMode(), GetPrefMapMode() ), aClipStack );
|
||||
}
|
||||
|
||||
@@ -303,7 +303,7 @@ const sal_uInt32 GRADIENT_DEFAULT_STEPCOUNT = 0;
|
||||
void Gradient::AddGradientActions(tools::Rectangle const& rRect, GDIMetaFile& rMetaFile)
|
||||
{
|
||||
tools::Rectangle aRect(rRect);
|
||||
aRect.Justify();
|
||||
aRect.Normalize();
|
||||
|
||||
// do nothing if the rectangle is empty
|
||||
if (aRect.IsEmpty())
|
||||
|
||||
@@ -53,7 +53,7 @@ void ImplScaleRect( tools::Rectangle& rRect, double fScaleX, double fScaleY )
|
||||
ImplScalePoint( aBR, fScaleX, fScaleY );
|
||||
|
||||
rRect = tools::Rectangle( aTL, aBR );
|
||||
rRect.Justify();
|
||||
rRect.Normalize();
|
||||
}
|
||||
|
||||
void ImplScalePoly( tools::Polygon& rPoly, double fScaleX, double fScaleY )
|
||||
|
||||
@@ -102,7 +102,7 @@ void Printer::ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask,
|
||||
Size aDestSz( LogicToPixel( rDestSize ) );
|
||||
tools::Rectangle aSrcRect( rSrcPtPixel, rSrcSizePixel );
|
||||
|
||||
aSrcRect.Justify();
|
||||
aSrcRect.Normalize();
|
||||
|
||||
if( rBmp.IsEmpty() || !aSrcRect.GetWidth() || !aSrcRect.GetHeight() || !aDestSz.Width() || !aDestSz.Height() )
|
||||
return;
|
||||
@@ -695,7 +695,7 @@ void Printer::DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor,
|
||||
Size aDestSz( LogicToPixel( rDestSize ) );
|
||||
tools::Rectangle aSrcRect( rSrcPtPixel, rSrcSizePixel );
|
||||
|
||||
aSrcRect.Justify();
|
||||
aSrcRect.Normalize();
|
||||
|
||||
if( !(!rMask.IsEmpty() && aSrcRect.GetWidth() && aSrcRect.GetHeight() && aDestSz.Width() && aDestSz.Height()) )
|
||||
return;
|
||||
|
||||
@@ -59,7 +59,7 @@ bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize,
|
||||
if( mbInitClipRegion )
|
||||
InitClipRegion();
|
||||
|
||||
aRect.Justify();
|
||||
aRect.Normalize();
|
||||
bDrawn = mpGraphics->DrawEPS( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(),
|
||||
const_cast<sal_uInt8*>(rGfxLink.GetData()), rGfxLink.GetDataSize(), *this );
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ void OutputDevice::DrawGradient( const tools::PolyPolygon& rPolyPoly,
|
||||
|
||||
// convert rectangle to pixels
|
||||
tools::Rectangle aRect( ImplLogicToDevicePixel( aBoundRect ) );
|
||||
aRect.Justify();
|
||||
aRect.Normalize();
|
||||
|
||||
// do nothing if the rectangle is empty
|
||||
if ( !aRect.IsEmpty() )
|
||||
|
||||
@@ -63,7 +63,7 @@ void OutputDevice::DrawRect( const tools::Rectangle& rRect )
|
||||
if ( aRect.IsEmpty() )
|
||||
return;
|
||||
|
||||
aRect.Justify();
|
||||
aRect.Normalize();
|
||||
|
||||
if ( !mpGraphics && !AcquireGraphics() )
|
||||
return;
|
||||
@@ -156,7 +156,7 @@ void OutputDevice::Invert( const tools::Rectangle& rRect, InvertFlags nFlags )
|
||||
|
||||
if ( aRect.IsEmpty() )
|
||||
return;
|
||||
aRect.Justify();
|
||||
aRect.Normalize();
|
||||
|
||||
// we need a graphics
|
||||
if ( !mpGraphics && !AcquireGraphics() )
|
||||
|
||||
@@ -1016,7 +1016,7 @@ tools::Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic
|
||||
{
|
||||
const MetaLineAction& rMetaLineAction = static_cast<const MetaLineAction&>(rAct);
|
||||
aActionBounds = tools::Rectangle( rMetaLineAction.GetStartPoint(), rMetaLineAction.GetEndPoint() );
|
||||
aActionBounds.Justify();
|
||||
aActionBounds.Normalize();
|
||||
const tools::Long nLineWidth(rMetaLineAction.GetLineInfo().GetWidth());
|
||||
if(nLineWidth)
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@ void OutputDevice::DrawWallpaper( const tools::Rectangle& rRect,
|
||||
if ( rWallpaper.GetStyle() != WallpaperStyle::NONE )
|
||||
{
|
||||
tools::Rectangle aRect = LogicToPixel( rRect );
|
||||
aRect.Justify();
|
||||
aRect.Normalize();
|
||||
|
||||
if ( !aRect.IsEmpty() )
|
||||
{
|
||||
@@ -317,7 +317,7 @@ void OutputDevice::DrawBitmapWallpaper( tools::Long nX, tools::Long nY,
|
||||
const tools::Rectangle aColRect( Point( nX, nY ), Size( nWidth, nHeight ) );
|
||||
|
||||
tools::Rectangle aWorkRect( 0, 0, aOutRect.Right(), aPos.Y() - 1 );
|
||||
aWorkRect.Justify();
|
||||
aWorkRect.Normalize();
|
||||
aWorkRect.Intersection( aColRect );
|
||||
if( !aWorkRect.IsEmpty() )
|
||||
{
|
||||
@@ -327,7 +327,7 @@ void OutputDevice::DrawBitmapWallpaper( tools::Long nX, tools::Long nY,
|
||||
}
|
||||
|
||||
aWorkRect = tools::Rectangle( 0, aPos.Y(), aPos.X() - 1, aPos.Y() + aBmpSize.Height() - 1 );
|
||||
aWorkRect.Justify();
|
||||
aWorkRect.Normalize();
|
||||
aWorkRect.Intersection( aColRect );
|
||||
if( !aWorkRect.IsEmpty() )
|
||||
{
|
||||
@@ -338,7 +338,7 @@ void OutputDevice::DrawBitmapWallpaper( tools::Long nX, tools::Long nY,
|
||||
|
||||
aWorkRect = tools::Rectangle( aPos.X() + aBmpSize.Width(), aPos.Y(),
|
||||
aOutRect.Right(), aPos.Y() + aBmpSize.Height() - 1 );
|
||||
aWorkRect.Justify();
|
||||
aWorkRect.Normalize();
|
||||
aWorkRect.Intersection( aColRect );
|
||||
if( !aWorkRect.IsEmpty() )
|
||||
{
|
||||
@@ -349,7 +349,7 @@ void OutputDevice::DrawBitmapWallpaper( tools::Long nX, tools::Long nY,
|
||||
|
||||
aWorkRect = tools::Rectangle( 0, aPos.Y() + aBmpSize.Height(),
|
||||
aOutRect.Right(), aOutRect.Bottom() );
|
||||
aWorkRect.Justify();
|
||||
aWorkRect.Normalize();
|
||||
aWorkRect.Intersection( aColRect );
|
||||
if( !aWorkRect.IsEmpty() )
|
||||
{
|
||||
|
||||
@@ -166,7 +166,7 @@ void Window::InvertTracking( const tools::Rectangle& rRect, ShowTrackFlags nFlag
|
||||
|
||||
if ( aRect.IsEmpty() )
|
||||
return;
|
||||
aRect.Justify();
|
||||
aRect.Normalize();
|
||||
|
||||
SalGraphics* pGraphics;
|
||||
|
||||
|
||||
@@ -2496,7 +2496,7 @@ static void ImplHandleSalSurroundingTextRequest( vcl::Window *pWindow,
|
||||
Selection aSelRange;
|
||||
ImplHandleSurroundingTextRequest( pWindow, pEvt->maText, aSelRange );
|
||||
|
||||
aSelRange.Justify();
|
||||
aSelRange.Normalize();
|
||||
|
||||
if( aSelRange.Min() < 0 )
|
||||
pEvt->mnStart = 0;
|
||||
|
||||
@@ -1551,7 +1551,7 @@ void X11SalFrame::SetPosSize( tools::Long nX, tools::Long nY, tools::Long nWidth
|
||||
|
||||
// relative positioning in X11SalFrame::SetPosSize
|
||||
tools::Rectangle aPosSize( Point( maGeometry.x(), maGeometry.y() ), Size( maGeometry.width(), maGeometry.height() ) );
|
||||
aPosSize.Justify();
|
||||
aPosSize.Normalize();
|
||||
|
||||
if( ! ( nFlags & SAL_FRAME_POSSIZE_X ) )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user