Enforce use of accessors on gen.hxx structures

Change-Id: Icd1b2937fdeaba6de1877258731f53ddf996002e
Reviewed-on: https://gerrit.libreoffice.org/936
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
This commit is contained in:
Matteo Casalin 2012-10-28 23:23:53 +01:00 committed by Michael Stahl
parent 5e5c11c664
commit 53ad646f54
41 changed files with 215 additions and 203 deletions

View File

@ -1162,7 +1162,7 @@ void Writer::Impl_writeLine( const Point& rPt1, const Point& rPt2, const Color*
void Writer::Impl_writeRect( const Rectangle& rRect, long nRadX, long nRadY )
{
if( (rRect.nTop == rRect.nBottom) || (rRect.nLeft == rRect.nRight) )
if( (rRect.Top() == rRect.Bottom()) || (rRect.Left() == rRect.Right()) )
{
Color aColor( mpVDev->GetFillColor() );
Impl_writeLine( rRect.TopLeft(), rRect.BottomRight(), &aColor );

View File

@ -252,23 +252,27 @@ void Tag::writeRect( SvStream& rOut, const Rectangle& rRect )
sal_Int32 minX, minY, maxX, maxY;
if( rRect.nLeft < rRect.nRight )
if( rRect.Left() < rRect.Right() )
{
minX = rRect.nLeft; maxX = rRect.nRight;
minX = rRect.Left();
maxX = rRect.Right();
}
else
{
maxX = rRect.nLeft; minX = rRect.nRight;
maxX = rRect.Left();
minX = rRect.Right();
}
if( rRect.nTop < rRect.nBottom )
if( rRect.Top() < rRect.Bottom() )
{
minY = rRect.nTop; maxY = rRect.nBottom;
minY = rRect.Top();
maxY = rRect.Bottom();
}
else
{
maxY = rRect.nTop; minY = rRect.nBottom;
maxY = rRect.Top();
minY = rRect.Bottom();
}
// AS: Figure out the maximum nubmer of bits required to represent any of the
@ -665,7 +669,7 @@ void FillStyle::Impl_addGradient( Tag* pTag ) const
case GradientStyle_FORCE_EQUAL_SIZE: break;
}
m.translate( maBoundRect.nLeft, maBoundRect.nTop );
m.translate( maBoundRect.Left(), maBoundRect.Top() );
pTag->addMatrix( m );

View File

@ -327,8 +327,8 @@ Rectangle PictWriter::MapRectangle( const Rectangle& rRect )
Size aSize = OutputDevice::LogicToLogic( rRect.GetSize(), aSrcMapMode, aTargetMapMode );
Rectangle aRect( aPoint, aSize );
aRect.Justify();
aRect.nBottom++;
aRect.nRight++;
++aRect.Bottom();
++aRect.Right();
return aRect;
}
@ -717,8 +717,8 @@ void PictWriter::WriteOpcode_FontName(const Font & rFont)
void PictWriter::WriteOpcode_ClipRect( const Rectangle& rRect )
{
Rectangle aRect( MapRectangle( rRect ) );
aRect.nBottom++;
aRect.nRight++;
++aRect.Bottom();
++aRect.Right();
*pPict << (sal_uInt16)1 // opcode 1
<< (sal_uInt16)10 // data size
<< (sal_Int16)aRect.Top() << (sal_Int16)aRect.Left()

View File

@ -4232,9 +4232,9 @@ void Test::testGraphicsInGroup()
m_pDoc->ShowRows(0, 100, 0, false);
m_pDoc->SetDrawPageSize(0);
CPPUNIT_ASSERT_MESSAGE("Left and Right should be unchanged",
aOrigRect.nLeft == rNewRect.nLeft && aOrigRect.nRight == rNewRect.nRight);
aOrigRect.Left() == rNewRect.Left() && aOrigRect.Right() == rNewRect.Right());
CPPUNIT_ASSERT_MESSAGE("Height should be minimum allowed height",
(rNewRect.nBottom - rNewRect.nTop) <= 1);
(rNewRect.Bottom() - rNewRect.Top()) <= 1);
m_pDoc->ShowRows(0, 100, 0, true);
m_pDoc->SetDrawPageSize(0);
CPPUNIT_ASSERT_MESSAGE("Should not change when page anchored", aOrigRect == rNewRect);

View File

@ -820,8 +820,8 @@ void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider& rBuProv, sal_Int1
// don't cast awt::Size to Size as on 64-bits they are not the same.
::com::sun::star::awt::Size aSize;
pPropValue[ i ].Value >>= aSize;
aBuGraSize.nA = aSize.Width;
aBuGraSize.nB = aSize.Height;
aBuGraSize.A() = aSize.Width;
aBuGraSize.B() = aSize.Height;
}
}
else if ( aPropName == "StartWith" )

View File

@ -54,8 +54,8 @@ void SdHtmlAttrPreview::Paint( const Rectangle& rRect )
DrawRect(rRect);
SetFillColor();
int nHeight = (aTextRect.nBottom - aTextRect.nTop) >> 2;
aTextRect.nBottom = nHeight + aTextRect.nTop;
int nHeight = (aTextRect.Bottom() - aTextRect.Top()) >> 2;
aTextRect.Bottom() = nHeight + aTextRect.Top();
SetTextColor(m_aTextColor);
DrawText( aTextRect, String(SdResId(STR_HTMLATTR_TEXT)),

View File

@ -436,10 +436,10 @@ void CustomAnimationTriggerEntryItem::Paint( const Point& rPos, SvTreeListBox& r
int nVertBorder = (( aSize.Height() - rDev.GetTextHeight()) >> 1);
int nHorzBorder = rDev.LogicToPixel( Size( 3, 3 ), MAP_APPFONT ).Width();
aOutRect.nLeft += nHorzBorder;
aOutRect.nRight -= nHorzBorder;
aOutRect.nTop += nVertBorder;
aOutRect.nBottom -= nVertBorder;
aOutRect.Left() += nHorzBorder;
aOutRect.Right() -= nHorzBorder;
aOutRect.Top() += nVertBorder;
aOutRect.Bottom() -= nVertBorder;
rDev.DrawText (aOutRect, rDev.GetEllipsisString( maDescription, aOutRect.GetWidth() ) );
rDev.Pop();

View File

@ -395,10 +395,10 @@ void AnnotationManagerImpl::InsertAnnotation()
for( AnnotationVector::iterator iter = aAnnotations.begin(); iter != aAnnotations.end(); ++iter )
{
RealPoint2D aPoint( (*iter)->getPosition() );
aTagRect.nLeft = sal::static_int_cast< long >( aPoint.X * 100.0 );
aTagRect.nTop = sal::static_int_cast< long >( aPoint.Y * 100.0 );
aTagRect.nRight = aTagRect.nLeft + width - 1;
aTagRect.nBottom = aTagRect.nTop + height - 1;
aTagRect.Left() = sal::static_int_cast< long >( aPoint.X * 100.0 );
aTagRect.Top() = sal::static_int_cast< long >( aPoint.Y * 100.0 );
aTagRect.Right() = aTagRect.Left() + width - 1;
aTagRect.Bottom() = aTagRect.Top() + height - 1;
if( aNewRect.IsOver( aTagRect ) )
{

View File

@ -906,10 +906,10 @@ void PresLayoutPreview::Paint( const Rectangle& )
nWidth = long( (double)(nHeight * maPageSize.Width()) / (double)maPageSize.Height() );
}
maOutRect.nLeft += (maOutRect.GetWidth() - nWidth) >> 1;
maOutRect.nRight = maOutRect.nLeft + nWidth - 1;
maOutRect.nTop += (maOutRect.GetHeight() - nHeight) >> 1;
maOutRect.nBottom = maOutRect.nTop + nHeight - 1;
maOutRect.Left() += (maOutRect.GetWidth() - nWidth) >> 1;
maOutRect.Right() = maOutRect.Left() + nWidth - 1;
maOutRect.Top() += (maOutRect.GetHeight() - nHeight) >> 1;
maOutRect.Bottom() = maOutRect.Top() + nHeight - 1;
// draw decoration frame
DecorationView aDecoView( this );

View File

@ -858,8 +858,8 @@ bool SlideshowImpl::startPreview(
Rectangle aContentRect (mpViewShell->GetViewShellBase().getClientRectangle());
if (Application::GetSettings().GetLayoutRTL())
{
aContentRect.nLeft = aContentRect.nRight;
aContentRect.nRight += aContentRect.nRight;
aContentRect.Left() = aContentRect.Right();
aContentRect.Right() += aContentRect.Right();
}
maPresSize = aContentRect.GetSize();
mpShowWindow->SetPosPixel( aContentRect.TopLeft() );

View File

@ -1300,7 +1300,7 @@ uno::Any SAL_CALL SdXImpressDocument::getPropertyValue( const OUString& Property
break;
const Rectangle& aRect = pEmbeddedObj->GetVisArea();
awt::Rectangle aVisArea( aRect.nLeft, aRect.nTop, aRect.getWidth(), aRect.getHeight() );
awt::Rectangle aVisArea( aRect.Left(), aRect.Top(), aRect.getWidth(), aRect.getHeight() );
aAny <<= aVisArea;
}
break;

View File

@ -758,8 +758,8 @@ void FrameView::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < :
if( pValue->Value >>= nTop )
{
Rectangle aVisArea( GetVisArea() );
aVisArea.nBottom += nTop - aVisArea.nTop;
aVisArea.nTop = nTop;
aVisArea.Bottom() += nTop - aVisArea.Top();
aVisArea.Top() = nTop;
SetVisArea( aVisArea );
}
}
@ -769,8 +769,8 @@ void FrameView::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < :
if( pValue->Value >>= nLeft )
{
Rectangle aVisArea( GetVisArea() );
aVisArea.nRight += nLeft - aVisArea.nLeft;
aVisArea.nLeft = nLeft;
aVisArea.Right() += nLeft - aVisArea.Left();
aVisArea.Left() = nLeft;
SetVisArea( aVisArea );
}
}
@ -780,7 +780,7 @@ void FrameView::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < :
if( pValue->Value >>= nWidth )
{
Rectangle aVisArea( GetVisArea() );
aVisArea.nRight = aVisArea.nLeft + nWidth - 1;
aVisArea.Right() = aVisArea.Left() + nWidth - 1;
SetVisArea( aVisArea );
}
}
@ -790,7 +790,7 @@ void FrameView::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < :
if( pValue->Value >>= nHeight )
{
Rectangle aVisArea( GetVisArea() );
aVisArea.nBottom = nHeight + aVisArea.nTop - 1;
aVisArea.Bottom() = nHeight + aVisArea.Top() - 1;
SetVisArea( aVisArea );
}
}

View File

@ -305,10 +305,10 @@ void ChildrenManagerImpl::CreateListOfVisibleShapes (
aPos = xShape->getPosition();
aSize = xShape->getSize();
aBoundingBox.nLeft = aPos.X;
aBoundingBox.nTop = aPos.Y;
aBoundingBox.nRight = aPos.X + aSize.Width;
aBoundingBox.nBottom = aPos.Y + aSize.Height;
aBoundingBox.Left() = aPos.X;
aBoundingBox.Top() = aPos.Y;
aBoundingBox.Right() = aPos.X + aSize.Width;
aBoundingBox.Bottom() = aPos.Y + aSize.Height;
// Insert shape if it is visible, i.e. its bounding box overlaps
// the visible area.

View File

@ -968,7 +968,7 @@ void HatchingLB::UserDraw( const UserDrawEvent& rUDEvt )
{
// Draw gradient with borderrectangle
const Rectangle& rDrawRect = rUDEvt.GetRect();
Rectangle aRect( rDrawRect.nLeft+1, rDrawRect.nTop+1, rDrawRect.nLeft+33, rDrawRect.nBottom-1 );
Rectangle aRect( rDrawRect.Left()+1, rDrawRect.Top()+1, rDrawRect.Left()+33, rDrawRect.Bottom()-1 );
sal_Int32 nId = rUDEvt.GetItemId();
if( nId >= 0 && nId <= mpList->Count() )
@ -995,7 +995,7 @@ void HatchingLB::UserDraw( const UserDrawEvent& rUDEvt )
pDevice->SetDrawMode( nOldDrawMode );
// Draw name
pDevice->DrawText( Point( aRect.nRight+7, aRect.nTop-1 ), mpList->GetHatch( rUDEvt.GetItemId() )->GetName() );
pDevice->DrawText( Point( aRect.Right()+7, aRect.Top()-1 ), mpList->GetHatch( rUDEvt.GetItemId() )->GetName() );
}
}
}
@ -1087,7 +1087,7 @@ void GradientLB::UserDraw( const UserDrawEvent& rUDEvt )
{
// Draw gradient with borderrectangle
const Rectangle& rDrawRect = rUDEvt.GetRect();
Rectangle aRect( rDrawRect.nLeft+1, rDrawRect.nTop+1, rDrawRect.nLeft+33, rDrawRect.nBottom-1 );
Rectangle aRect( rDrawRect.Left()+1, rDrawRect.Top()+1, rDrawRect.Left()+33, rDrawRect.Bottom()-1 );
sal_Int32 nId = rUDEvt.GetItemId();
if( nId >= 0 && nId <= mpList->Count() )
@ -1127,7 +1127,7 @@ void GradientLB::UserDraw( const UserDrawEvent& rUDEvt )
pDevice->DrawRect( aRect );
// Draw name
pDevice->DrawText( Point( aRect.nRight+7, aRect.nTop-1 ), mpList->GetGradient( rUDEvt.GetItemId() )->GetName() );
pDevice->DrawText( Point( aRect.Right()+7, aRect.Top()-1 ), mpList->GetGradient( rUDEvt.GetItemId() )->GetName() );
}
}
}
@ -1268,20 +1268,20 @@ void BitmapLB::UserDraw( const UserDrawEvent& rUDEvt )
{
// Draw bitmap
const Rectangle& rDrawRect = rUDEvt.GetRect();
Rectangle aRect( rDrawRect.nLeft+1, rDrawRect.nTop+1, rDrawRect.nLeft+33, rDrawRect.nBottom-1 );
Rectangle aRect( rDrawRect.Left()+1, rDrawRect.Top()+1, rDrawRect.Left()+33, rDrawRect.Bottom()-1 );
sal_Int32 nId = rUDEvt.GetItemId();
if( nId >= 0 && nId <= mpList->Count() )
{
Rectangle aClipRect( rDrawRect.nLeft+1, rDrawRect.nTop+1, rDrawRect.nRight-1, rDrawRect.nBottom-1 );
Rectangle aClipRect( rDrawRect.Left()+1, rDrawRect.Top()+1, rDrawRect.Right()-1, rDrawRect.Bottom()-1 );
OutputDevice* pDevice = rUDEvt.GetDevice();
pDevice->SetClipRegion( Region( aClipRect ) );
aBitmap = mpList->GetBitmap( nId )->GetXBitmap().GetBitmap();
long nPosBaseX = aRect.nLeft;
long nPosBaseY = aRect.nTop;
long nPosBaseX = aRect.Left();
long nPosBaseY = aRect.Top();
if( aBitmap.GetSizePixel().Width() > 8 ||
aBitmap.GetSizePixel().Height() > 8 )
@ -1303,7 +1303,7 @@ void BitmapLB::UserDraw( const UserDrawEvent& rUDEvt )
pDevice->SetClipRegion();
// Draw name
pDevice->DrawText( Point( aRect.nRight+7, aRect.nTop-1 ), mpList->GetBitmap( nId )->GetName() );
pDevice->DrawText( Point( aRect.Right()+7, aRect.Top()-1 ), mpList->GetBitmap( nId )->GetName() );
}
}
}

View File

@ -3577,7 +3577,7 @@ bool SdrDragCrop::EndSdrDrag(bool bCopy)
else
aGraphicSize = Application::GetDefaultDevice()->LogicToLogic( aGraphicSize, rGraphicObject.GetPrefMapMode(), aMapMode100thmm);
if( aGraphicSize.nA == 0 || aGraphicSize.nB == 0 )
if( aGraphicSize.A() == 0 || aGraphicSize.B() == 0 )
return false;
const SdrGrafCropItem& rOldCrop = (const SdrGrafCropItem&)pObj->GetMergedItem(SDRATTR_GRAFCROP);
@ -3613,10 +3613,10 @@ bool SdrDragCrop::EndSdrDrag(bool bCopy)
aNewRect = Rectangle(aNewRect.TopLeft() - (aNewRect.BottomRight() - aNewRect.TopLeft()), aNewRect.TopLeft());
}
sal_Int32 nDiffLeft = aNewRect.nLeft - aOldRect.nLeft;
sal_Int32 nDiffTop = aNewRect.nTop - aOldRect.nTop;
sal_Int32 nDiffRight = aNewRect.nRight - aOldRect.nRight;
sal_Int32 nDiffBottom = aNewRect.nBottom - aOldRect.nBottom;
sal_Int32 nDiffLeft = aNewRect.Left() - aOldRect.Left();
sal_Int32 nDiffTop = aNewRect.Top() - aOldRect.Top();
sal_Int32 nDiffRight = aNewRect.Right() - aOldRect.Right();
sal_Int32 nDiffBottom = aNewRect.Bottom() - aOldRect.Bottom();
sal_Int32 nLeftCrop = static_cast<sal_Int32>( rOldCrop.GetLeft() + nDiffLeft * fScaleX );
sal_Int32 nTopCrop = static_cast<sal_Int32>( rOldCrop.GetTop() + nDiffTop * fScaleY );

View File

@ -590,10 +590,10 @@ const Rectangle& Cell::GetCurrentBoundRect() const
void Cell::TakeTextAnchorRect(Rectangle& rAnchorRect) const
{
rAnchorRect.nLeft = maCellRect.nLeft + GetTextLeftDistance();
rAnchorRect.nRight = maCellRect.nRight - GetTextRightDistance();
rAnchorRect.nTop = maCellRect.nTop + GetTextUpperDistance();
rAnchorRect.nBottom = maCellRect.nBottom - GetTextLowerDistance();
rAnchorRect.Left() = maCellRect.Left() + GetTextLeftDistance();
rAnchorRect.Right() = maCellRect.Right() - GetTextRightDistance();
rAnchorRect.Top() = maCellRect.Top() + GetTextUpperDistance();
rAnchorRect.Bottom() = maCellRect.Bottom() - GetTextLowerDistance();
}
// -----------------------------------------------------------------------------

View File

@ -1040,8 +1040,8 @@ TableHitKind SdrTableObj::CheckTableHit( const Point& rPos, sal_Int32& rnX, sal_
const sal_Int32 nColCount = mpImpl->getColumnCount();
const sal_Int32 nRowCount = mpImpl->getRowCount();
sal_Int32 nX = rPos.X() + nTol - aRect.nLeft;
sal_Int32 nY = rPos.Y() + nTol - aRect.nTop;
sal_Int32 nX = rPos.X() + nTol - aRect.Left();
sal_Int32 nY = rPos.Y() + nTol - aRect.Top();
if( (nX < 0) || (nX > (aRect.GetWidth() + nTol)) || (nY < 0) || (nY > (aRect.GetHeight() + nTol) ) )
return SDRTABLEHIT_NONE;

View File

@ -864,11 +864,11 @@ void TableLayouter::updateCells( Rectangle& rRectangle )
getCellArea( aPos, aCellArea );
Rectangle aCellRect;
aCellRect.nLeft = aCellArea.getMinX();
aCellRect.nRight = aCellArea.getMaxX();
aCellRect.nTop = aCellArea.getMinY();
aCellRect.nBottom = aCellArea.getMaxY();
aCellRect.Move( rRectangle.nLeft, rRectangle.nTop );
aCellRect.Left() = aCellArea.getMinX();
aCellRect.Right() = aCellArea.getMaxX();
aCellRect.Top() = aCellArea.getMinY();
aCellRect.Bottom() = aCellArea.getMaxY();
aCellRect.Move( rRectangle.Left(), rRectangle.Top() );
xCell->setCellRect( aCellRect );
}
}
@ -1115,7 +1115,7 @@ void TableLayouter::DistributeRows( ::Rectangle& rArea, sal_Int32 nFirstRow, sal
if( nHeight < nMinHeight )
{
sal_Int32 nNeededHeight = nRows * nMinHeight;
rArea.nBottom += nNeededHeight - nAllHeight;
rArea.Bottom() += nNeededHeight - nAllHeight;
nHeight = nMinHeight;
nAllHeight = nRows * nMinHeight;
}

View File

@ -296,7 +296,7 @@ void SdrTableRTFParser::FillTable()
}
Rectangle aRect( mrTableObj.GetSnapRect() );
aRect.nRight = aRect.nLeft + nLastEdge;
aRect.Right() = aRect.Left() + nLastEdge;
mrTableObj.NbcSetSnapRect( aRect );
}

View File

@ -2502,14 +2502,14 @@ static inline void lcl_CorrectRectangle(Rectangle & rRect,
const Rectangle & rSource,
const Rectangle & rInGrid)
{
rRect.nLeft = lcl_CorrectCoarseValue(rRect.nLeft, rSource.nLeft,
rInGrid.nLeft, false);
rRect.nTop = lcl_CorrectCoarseValue(rRect.nTop, rSource.nTop,
rInGrid.nTop, false);
rRect.nRight = lcl_CorrectCoarseValue(rRect.nRight, rSource.nRight,
rInGrid.nRight, true);
rRect.nBottom = lcl_CorrectCoarseValue(rRect.nBottom, rSource.nBottom,
rInGrid.nBottom, true);
rRect.Left() = lcl_CorrectCoarseValue(rRect.Left(), rSource.Left(),
rInGrid.Left(), false);
rRect.Top() = lcl_CorrectCoarseValue(rRect.Top(), rSource.Top(),
rInGrid.Top(), false);
rRect.Right() = lcl_CorrectCoarseValue(rRect.Right(), rSource.Right(),
rInGrid.Right(), true);
rRect.Bottom() = lcl_CorrectCoarseValue(rRect.Bottom(), rSource.Bottom(),
rInGrid.Bottom(), true);
}
Rectangle SwAccessibleMap::CoreToPixel( const Rectangle& rRect ) const

View File

@ -229,9 +229,9 @@ void SwRect::SetBottomAndHeight( long nBottom, long nNew )
void SwRect::SetUpperLeftCorner( const Point& rNew )
{ m_Point = rNew; }
void SwRect::SetUpperRightCorner( const Point& rNew )
{ m_Point = Point(rNew.nA - m_Size.getWidth(), rNew.nB); }
{ m_Point = Point(rNew.A() - m_Size.getWidth(), rNew.B()); }
void SwRect::SetLowerLeftCorner( const Point& rNew )
{ m_Point = Point(rNew.nA, rNew.nB - m_Size.getHeight()); }
{ m_Point = Point(rNew.A(), rNew.B() - m_Size.getHeight()); }
#ifdef DBG_UTIL
SvStream &operator<<( SvStream &rStream, const SwRect &rRect )

View File

@ -6343,15 +6343,6 @@ void SwLayoutFrm::RefreshLaySubsidiary( const SwPageFrm *pPage,
|*************************************************************************/
//Paints the desired line and pays attention to not overpaint any flys.
typedef long Size::* SizePtr;
typedef long Point::* PointPtr;
PointPtr pX = &Point::nA;
PointPtr pY = &Point::nB;
SizePtr pWidth = &Size::nA;
SizePtr pHeight = &Size::nB;
// OD 18.11.2002 #99672# - new parameter <_pSubsLines>
static void lcl_RefreshLine( const SwLayoutFrm *pLay,
const SwPageFrm *pPage,
@ -6363,14 +6354,19 @@ static void lcl_RefreshLine( const SwLayoutFrm *pLay,
//In which direction do we loop? Can only be horizontal or vertical.
OSL_ENSURE( ((rP1.X() == rP2.X()) || (rP1.Y() == rP2.Y())),
"Sloped subsidiary lines are not allowed." );
const PointPtr pDirPt = rP1.X() == rP2.X() ? pY : pX;
const PointPtr pOthPt = pDirPt == pX ? pY : pX;
const SizePtr pDirSz = pDirPt == pX ? pWidth : pHeight;
const SizePtr pOthSz = pDirSz == pWidth ? pHeight : pWidth;
Point aP1( rP1 ),
aP2( rP2 );
while ( aP1.*pDirPt < aP2.*pDirPt )
const bool bHori = rP1.Y() == rP2.Y();
// use pointers to member function in order to unify flow
typedef long& (Point:: *pmfPt)();
const pmfPt pmfPtX = &Point::X;
const pmfPt pmfPtY = &Point::Y;
const pmfPt pDirPt = bHori ? pmfPtX : pmfPtY;
Point aP1( rP1 );
Point aP2( rP2 );
while ( (aP1.*pDirPt)() < (aP2.*pDirPt)() )
{
//If the starting point lies in a fly, it is directly set behind the
//fly.
@ -6421,24 +6417,28 @@ static void lcl_RefreshLine( const SwLayoutFrm *pLay,
}
//Is the Obj placed on the line
const long nP1OthPt = !bHori ? rP1.X() : rP1.Y();
const Rectangle &rBound = pObj->GetCurrentBoundRect();
const Point aDrPt( rBound.TopLeft() );
const long nDrOthPt = !bHori ? aDrPt.X() : aDrPt.Y();
const Size aDrSz( rBound.GetSize() );
if ( rP1.*pOthPt >= aDrPt.*pOthPt &&
rP1.*pOthPt <= (aDrPt.*pOthPt + aDrSz.*pOthSz) )
{
if ( aP1.*pDirPt >= aDrPt.*pDirPt &&
aP1.*pDirPt <= (aDrPt.*pDirPt + aDrSz.*pDirSz) )
aP1.*pDirPt = aDrPt.*pDirPt + aDrSz.*pDirSz;
const long nDrOthSz = !bHori ? aDrSz.Width() : aDrSz.Height();
if ( aP2.*pDirPt >= aDrPt.*pDirPt &&
aP1.*pDirPt < (aDrPt.*pDirPt - 1) )
aP2.*pDirPt = aDrPt.*pDirPt - 1;
if ( nP1OthPt >= nDrOthPt && nP1OthPt <= nDrOthPt + nDrOthSz )
{
const long nDrDirPt = bHori ? aDrPt.X() : aDrPt.Y();
const long nDrDirSz = bHori ? aDrSz.Width() : aDrSz.Height();
if ( (aP1.*pDirPt)() >= nDrDirPt && (aP1.*pDirPt)() <= nDrDirPt + nDrDirSz )
(aP1.*pDirPt)() = nDrDirPt + nDrDirSz;
if ( (aP2.*pDirPt)() >= nDrDirPt && (aP1.*pDirPt)() < (nDrDirPt - 1) )
(aP2.*pDirPt)() = nDrDirPt - 1;
}
aIter.Next();
}
if ( aP1.*pDirPt < aP2.*pDirPt )
if ( (aP1.*pDirPt)() < (aP2.*pDirPt)() )
{
SwRect aRect( aP1, aP2 );
// OD 18.11.2002 #99672# - use parameter <_pSubsLines> instead of
@ -6447,7 +6447,7 @@ static void lcl_RefreshLine( const SwLayoutFrm *pLay,
0, nSubColor );
}
aP1 = aP2;
aP1.*pDirPt += 1;
(aP1.*pDirPt)() += 1;
aP2 = rP2;
}
}

View File

@ -89,14 +89,13 @@ static void lcl_GetPos(SwView* pView,
const Size aDocSz( rSh.GetDocSize() );
const long lBorder = bBorder ? DOCUMENTBORDER : DOCUMENTBORDER * 2;
sal_Bool bHori = pScrollbar->IsHoriScroll();
const bool bHori = pScrollbar->IsHoriScroll();
const long lPos = pScrollbar->GetThumbPos() + (bBorder ? DOCUMENTBORDER : 0);
long Point:: *pPt = bHori ? &Point::nA : &Point::nB;
long Size:: *pSz = bHori ? &Size::nA : &Size::nB;
long lDelta = lPos - rSh.VisArea().Pos().*pPt;
const long lSize = aDocSz.*pSz + lBorder;
long lDelta = lPos - (bHori ? rSh.VisArea().Pos().X() : rSh.VisArea().Pos().Y());
const long lSize = (bHori ? aDocSz.A() : aDocSz.B()) + lBorder;
// sollte rechts oder unten zuviel Wiese sein, dann muss
// diese von der VisArea herausgerechnet werden!
long nTmp = pView->GetVisArea().Right()+lDelta;
@ -106,9 +105,12 @@ static void lcl_GetPos(SwView* pView,
if ( !bHori && nTmp > lSize )
lDelta -= nTmp - lSize;
rPos.*pPt += lDelta;
if ( bBorder && rPos.*pPt < DOCUMENTBORDER )
rPos.*pPt = DOCUMENTBORDER;
// use a reference to access/moodify the correct coordinate
// returned by accessors to non-const object
long & rCoord = bHori ? rPos.X() : rPos.Y();
rCoord += lDelta;
if ( bBorder && rCoord < DOCUMENTBORDER )
rCoord = DOCUMENTBORDER;
}
/*--------------------------------------------------------------------

View File

@ -31,9 +31,6 @@ class SvStream;
class SAL_WARN_UNUSED Pair
{
public:
long nA;
long nB;
Pair();
Pair( long nA, long nB );
@ -48,6 +45,10 @@ public:
TOOLS_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStream, Pair& rPair );
TOOLS_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStream, const Pair& rPair );
protected:
long nA;
long nB;
};
inline Pair::Pair()
@ -329,11 +330,6 @@ inline void Selection::Justify()
class TOOLS_DLLPUBLIC SAL_WARN_UNUSED Rectangle
{
public:
long nLeft;
long nTop;
long nRight;
long nBottom;
Rectangle();
Rectangle( const Point& rLT, const Point& rRB );
Rectangle( long nLeft, long nTop,
@ -404,6 +400,12 @@ public:
void setY( long n ) { nBottom += n-nTop; nTop = n; }
void setWidth( long n ) { nRight = nLeft + n; }
void setHeight( long n ) { nBottom = nTop + n; }
private:
long nLeft;
long nTop;
long nRight;
long nBottom;
};
inline Rectangle::Rectangle()

View File

@ -33,7 +33,7 @@ public:
inline Vector2D() : mfX( 0.0 ), mfY( 0.0 ) {}
inline Vector2D( double fX, double fY ) : mfX( fX ), mfY( fY ) {}
inline Vector2D( const Vector2D& rVec ) : mfX( rVec.mfX ), mfY( rVec.mfY ) {}
inline Vector2D( const Pair& rPair ) : mfX( rPair.nA ), mfY( rPair.nB ) {};
inline Vector2D( const Pair& rPair ) : mfX( rPair.A() ), mfY( rPair.B() ) {};
inline ~Vector2D() {}
inline const double& X() const { return mfX; }
@ -79,13 +79,13 @@ public:
inline sal_Bool operator!=( const Vector2D& rVec ) const { return !( *this == rVec ); }
inline Vector2D& operator=( const Vector2D& rVec ) { mfX = rVec.mfX, mfY = rVec.mfY; return *this; }
inline Vector2D& operator=( const Pair& rPair ) { mfX = rPair.nA, mfY = rPair.nB; return *this; }
inline Vector2D& operator-=( const Pair& rPair ) { mfX -= rPair.nA, mfY -= rPair.nB; return *this; }
inline Vector2D& operator+=( const Pair& rPair ) { mfX += rPair.nA, mfY += rPair.nB; return *this; }
inline Vector2D& operator*=( const Pair& rPair ) { mfX *= rPair.nA, mfY *= rPair.nB; return *this; }
inline Vector2D& operator/=( const Pair& rPair ) { mfX /= rPair.nA, mfY /= rPair.nB; return *this; }
inline Vector2D& operator=( const Pair& rPair ) { mfX = rPair.A(), mfY = rPair.B(); return *this; }
inline Vector2D& operator-=( const Pair& rPair ) { mfX -= rPair.A(), mfY -= rPair.B(); return *this; }
inline Vector2D& operator+=( const Pair& rPair ) { mfX += rPair.A(), mfY += rPair.B(); return *this; }
inline Vector2D& operator*=( const Pair& rPair ) { mfX *= rPair.A(), mfY *= rPair.B(); return *this; }
inline Vector2D& operator/=( const Pair& rPair ) { mfX /= rPair.A(), mfY /= rPair.B(); return *this; }
inline sal_Bool operator==( const Pair& rPair ) const { return( mfX == rPair.nA && mfY == rPair.nB ); }
inline sal_Bool operator==( const Pair& rPair ) const { return( mfX == rPair.A() && mfY == rPair.B() ); }
inline sal_Bool operator!=( const Pair& rPair ) const { return !( *this == rPair ); }
inline sal_Bool IsPositive( Vector2D& rVec ) const { return( ( mfX * rVec.mfY - mfY * rVec.mfX ) >= 0.0 ); }

View File

@ -1442,10 +1442,10 @@ void AquaSalFrame::GetWorkArea( Rectangle& rRect )
pScreen = [NSScreen mainScreen];
NSRect aRect = [pScreen visibleFrame];
CocoaToVCL( aRect );
rRect.nLeft = static_cast<long>(aRect.origin.x);
rRect.nTop = static_cast<long>(aRect.origin.y);
rRect.nRight = static_cast<long>(aRect.origin.x + aRect.size.width - 1);
rRect.nBottom = static_cast<long>(aRect.origin.y + aRect.size.height - 1);
rRect.Left() = static_cast<long>(aRect.origin.x);
rRect.Top() = static_cast<long>(aRect.origin.y);
rRect.Right() = static_cast<long>(aRect.origin.x + aRect.size.width - 1);
rRect.Bottom() = static_cast<long>(aRect.origin.y + aRect.size.height - 1);
}
SalPointerState AquaSalFrame::GetPointerState()

View File

@ -370,7 +370,7 @@ bool AquaSalMenu::ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rR
removeUnusedItemsRunner( pCopyMenu );
// create frame rect
NSRect displayPopupFrame = NSMakeRect( rRect.nLeft+(offset-1), rRect.nTop+(offset+1), popupFrame.size.width, 0 );
NSRect displayPopupFrame = NSMakeRect( rRect.Left()+(offset-1), rRect.Top()+(offset+1), popupFrame.size.width, 0 );
pParentAquaSalFrame->VCLToCocoa(displayPopupFrame, false);
// do the same strange semantics as vcl popup windows to arrive at a frame geometry

View File

@ -860,10 +860,10 @@ void IosSalFrame::GetWorkArea( Rectangle& rRect )
pScreen = [UIScreen mainScreen];
CGRect aRect = [pScreen applicationFrame];
CocoaTouchToVCL( aRect );
rRect.nLeft = static_cast<long>(aRect.origin.x);
rRect.nTop = static_cast<long>(aRect.origin.y);
rRect.nRight = static_cast<long>(aRect.origin.x + aRect.size.width - 1);
rRect.nBottom = static_cast<long>(aRect.origin.y + aRect.size.height - 1);
rRect.Left() = static_cast<long>(aRect.origin.x);
rRect.Top() = static_cast<long>(aRect.origin.y);
rRect.Right() = static_cast<long>(aRect.origin.x + aRect.size.width - 1);
rRect.Bottom() = static_cast<long>(aRect.origin.y + aRect.size.height - 1);
}
SalPointerState IosSalFrame::GetPointerState()

View File

@ -829,7 +829,7 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, sal_uLong nDrawF
sal_uInt16 nTextStyle = ImplGetTextStyle( nDrawFlags );
sal_uInt16 nStyle;
if( aInRect.nRight < aInRect.nLeft || aInRect.nBottom < aInRect.nTop )
if( aInRect.Right() < aInRect.Left() || aInRect.Bottom() < aInRect.Top() )
aInRect.SetEmpty();
pDev->Push( PUSH_CLIPREGION );

View File

@ -166,10 +166,10 @@ void ImageControl::Paint( const Rectangle& /*rRect*/ )
pWin->SetFillColor();
pWin->SetLineColor( bFlat ? COL_WHITE : COL_BLACK );
pWin->DrawRect( aRect );
aRect.nLeft++;
aRect.nRight--;
aRect.nTop++;
aRect.nBottom--;
++aRect.Left();
--aRect.Right();
++aRect.Top();
--aRect.Bottom();
pWin->SetLineColor( bFlat ? COL_BLACK : COL_WHITE );
pWin->DrawRect( aRect );
pWin->SetLineColor( oldLineCol );

View File

@ -1553,9 +1553,9 @@ long TabControl::PreNotify( NotifyEvent& rNEvt )
// as used by gtk
// TODO: query for the correct sizes
Rectangle aRect(*pLastRect);
aRect.nLeft-=2;
aRect.nRight+=2;
aRect.nTop-=3;
aRect.Left()-=2;
aRect.Right()+=2;
aRect.Top()-=3;
aClipRgn.Union( aRect );
}
if( pRect )
@ -1564,9 +1564,9 @@ long TabControl::PreNotify( NotifyEvent& rNEvt )
// as used by gtk
// TODO: query for the correct sizes
Rectangle aRect(*pRect);
aRect.nLeft-=2;
aRect.nRight+=2;
aRect.nTop-=3;
aRect.Left()-=2;
aRect.Right()+=2;
aRect.Top()-=3;
aClipRgn.Union( aRect );
}
if( !aClipRgn.IsEmpty() )

View File

@ -530,14 +530,14 @@ void OutputDevice::ImplReMirror( Point &rPoint ) const
}
void OutputDevice::ImplReMirror( Rectangle &rRect ) const
{
long nWidth = rRect.nRight - rRect.nLeft;
long nWidth = rRect.Right() - rRect.Left();
//long lc_x = rRect.nLeft - mnOutOffX; // normalize
//lc_x = mnOutWidth - nWidth - 1 - lc_x; // mirror
//rRect.nLeft = lc_x + mnOutOffX; // re-normalize
rRect.nLeft = mnOutOffX + mnOutWidth - nWidth - 1 - rRect.nLeft + mnOutOffX;
rRect.nRight = rRect.nLeft + nWidth;
rRect.Left() = mnOutOffX + mnOutWidth - nWidth - 1 - rRect.Left() + mnOutOffX;
rRect.Right() = rRect.Left() + nWidth;
}
void OutputDevice::ImplReMirror( Region &rRegion ) const
{

View File

@ -4178,10 +4178,10 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
pLayout->DrawBase() = Point( nBaseX+mnTextOffX, nBaseY+mnTextOffY );
Rectangle aPixelRect;
aPixelRect.nLeft = nBaseX+mnTextOffX;
aPixelRect.nRight = aPixelRect.nLeft+nWidth;
aPixelRect.nBottom = nBaseY+mpFontEntry->maMetric.mnDescent;
aPixelRect.nTop = nBaseY-mpFontEntry->maMetric.mnAscent;
aPixelRect.Left() = nBaseX+mnTextOffX;
aPixelRect.Right() = aPixelRect.Left()+nWidth;
aPixelRect.Bottom() = nBaseY+mpFontEntry->maMetric.mnDescent;
aPixelRect.Top() = nBaseY-mpFontEntry->maMetric.mnAscent;
if (mpFontEntry->mnOrientation)
{

View File

@ -8645,10 +8645,10 @@ void PDFWriterImpl::drawStrikeoutChar( const Point& rPos, long nWidth, FontStrik
push( PUSH_CLIPREGION );
FontMetric aRefDevFontMetric = m_pReferenceDevice->GetFontMetric();
Rectangle aRect;
aRect.nLeft = rPos.X();
aRect.nRight = aRect.nLeft+nWidth;
aRect.nBottom = rPos.Y()+aRefDevFontMetric.GetDescent();
aRect.nTop = rPos.Y()-aRefDevFontMetric.GetAscent();
aRect.Left() = rPos.X();
aRect.Right() = aRect.Left()+nWidth;
aRect.Bottom() = rPos.Y()+aRefDevFontMetric.GetDescent();
aRect.Top() = rPos.Y()-aRefDevFontMetric.GetAscent();
ImplFontEntry* pFontEntry = m_pReferenceDevice->mpFontEntry;
if (pFontEntry->mnOrientation)

View File

@ -134,10 +134,10 @@ static void ImplDrawBrdWinSymbolButton( OutputDevice* pDev,
sal_True, sal_False );
}
aTempRect = rRect;
aTempRect.nLeft+=3;
aTempRect.nRight-=4;
aTempRect.nTop+=3;
aTempRect.nBottom-=4;
aTempRect.Left()+=3;
aTempRect.Right()-=4;
aTempRect.Top()+=3;
aTempRect.Bottom()-=4;
}
else
{
@ -1690,8 +1690,10 @@ void ImplStdBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* p
pDev->SetLineColor( aFrameColor );
pDev->SetFillColor();
pDev->DrawRect( aInRect );
aInRect.nLeft++; aInRect.nRight--;
aInRect.nTop++; aInRect.nBottom--;
++aInRect.Left();
--aInRect.Right();
++aInRect.Top();
--aInRect.Bottom();
// restore
if ( pData->mnTitleType == BORDERWINDOW_TITLE_POPUP )

View File

@ -190,9 +190,9 @@ IMPL_LINK_NOARG(ImplDockFloatWin2, DockingHdl)
sal_Int32 nLeft, nTop, nRight, nBottom;
GetBorder( nLeft, nTop, nRight, nBottom );
// limit borderrect to the caption part only and without the resizing borders
aBorderRect.nBottom = aBorderRect.nTop + nTop;
aBorderRect.nLeft += nLeft;
aBorderRect.nRight -= nRight;
aBorderRect.Bottom() = aBorderRect.Top() + nTop;
aBorderRect.Left() += nLeft;
aBorderRect.Right() -= nRight;
PointerState aBorderState = pBorder->GetPointerState();
if( aBorderRect.IsInside( aBorderState.maPos ) )
@ -675,10 +675,10 @@ void ImplPopupFloatWin::DrawGrip()
// draw background
Rectangle aRect( GetDragRect() );
aRect.nTop += POPUP_DRAGBORDER;
aRect.nBottom -= POPUP_DRAGBORDER;
aRect.nLeft+=3;
aRect.nRight-=3;
aRect.Top() += POPUP_DRAGBORDER;
aRect.Bottom() -= POPUP_DRAGBORDER;
aRect.Left()+=3;
aRect.Right()-=3;
if( mbHighlight )
{
@ -701,16 +701,18 @@ void ImplPopupFloatWin::DrawGrip()
aLineInfo.SetDashLen( 12 );
aLineInfo.SetDashCount( 1 );
aRect.nLeft+=2; aRect.nRight-=2;
aRect.Left()+=2;
aRect.Right()-=2;
aRect.nTop+=2;
aRect.nBottom = aRect.nTop;
aRect.Top()+=2;
aRect.Bottom() = aRect.Top();
SetLineColor( GetSettings().GetStyleSettings().GetDarkShadowColor() );
DrawLine( aRect.TopLeft(), aRect.TopRight(), aLineInfo );
if( !mbHighlight )
{
aRect.nTop++; aRect.nBottom++;
++aRect.Top();
++aRect.Bottom();
SetLineColor( GetSettings().GetStyleSettings().GetLightColor() );
DrawLine( aRect.TopLeft(), aRect.TopRight(), aLineInfo );
}
@ -718,8 +720,8 @@ void ImplPopupFloatWin::DrawGrip()
#else
// draw several grip lines
SetFillColor( GetSettings().GetStyleSettings().GetShadowColor() );
aRect.nTop++;
aRect.nBottom = aRect.nTop;
aRect.Top()++;
aRect.Bottom() = aRect.Top();
int width = POPUP_DRAGWIDTH;
while( width >= aRect.getWidth() )
@ -727,15 +729,15 @@ void ImplPopupFloatWin::DrawGrip()
if( width <= 0 )
width = aRect.getWidth();
//aRect.nLeft = aRect.nLeft + (aRect.getWidth() - width) / 2;
aRect.nLeft = (aRect.nLeft + aRect.nRight - width) / 2;
aRect.nRight = aRect.nLeft + width;
aRect.Left() = (aRect.Left() + aRect.Right() - width) / 2;
aRect.Right() = aRect.Left() + width;
int i=0;
while( i< POPUP_DRAGGRIP )
{
DrawRect( aRect );
aRect.nTop+=2;
aRect.nBottom+=2;
aRect.Top()+=2;
aRect.Bottom()+=2;
i+=2;
}
#endif

View File

@ -1973,9 +1973,9 @@ void SplitWindow::ImplDrawGrip( const Rectangle& rRect, sal_Bool bHorz, sal_Bool
if( bHorz )
{
int width = (int) (0.5 * rRect.getWidth() + 0.5);
int i = rRect.nLeft + (rRect.getWidth() - width) / 2;
int i = rRect.Left() + (rRect.getWidth() - width) / 2;
width += i;
const int y = rRect.nTop + 1;
const int y = rRect.Top() + 1;
ImplDrawFadeArrow( Point( i-8, y), bHorz, bLeft );
while( i <= width )
{
@ -1996,9 +1996,9 @@ void SplitWindow::ImplDrawGrip( const Rectangle& rRect, sal_Bool bHorz, sal_Bool
else
{
int height = (int) (0.5 * rRect.getHeight() + 0.5);
int i = rRect.nTop + (rRect.getHeight() - height) / 2;
int i = rRect.Top() + (rRect.getHeight() - height) / 2;
height += i;
const int x = rRect.nLeft + 1;
const int x = rRect.Left() + 1;
ImplDrawFadeArrow( Point( x, i-8), bHorz, bLeft );
while( i <= height )
{

View File

@ -718,15 +718,15 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
if( abs(g.nX-aState.mnX) < 2 && abs(g.nY-aState.mnY) < 5 )
{
long displacement = g.nTopDecoration ? g.nTopDecoration : 20;
if( (unsigned long) (aState.mnX + displacement + aState.mnWidth + g.nRightDecoration) > (unsigned long) aDesktop.nRight ||
(unsigned long) (aState.mnY + displacement + aState.mnHeight + g.nBottomDecoration) > (unsigned long) aDesktop.nBottom )
if( (unsigned long) (aState.mnX + displacement + aState.mnWidth + g.nRightDecoration) > (unsigned long) aDesktop.Right() ||
(unsigned long) (aState.mnY + displacement + aState.mnHeight + g.nBottomDecoration) > (unsigned long) aDesktop.Bottom() )
{
// displacing would leave screen
aState.mnX = g.nLeftDecoration ? g.nLeftDecoration : 10; // should result in (0,0)
aState.mnY = displacement;
if( bWrapped ||
(unsigned long) (aState.mnX + displacement + aState.mnWidth + g.nRightDecoration) > (unsigned long) aDesktop.nRight ||
(unsigned long) (aState.mnY + displacement + aState.mnHeight + g.nBottomDecoration) > (unsigned long) aDesktop.nBottom )
(unsigned long) (aState.mnX + displacement + aState.mnWidth + g.nRightDecoration) > (unsigned long) aDesktop.Right() ||
(unsigned long) (aState.mnY + displacement + aState.mnHeight + g.nBottomDecoration) > (unsigned long) aDesktop.Bottom() )
break; // further displacement not possible -> break
// avoid endless testing
bWrapped = sal_True;

View File

@ -7101,7 +7101,7 @@ void Window::setPosSizePixel( long nX, long nY,
// --- RTL --- (re-mirror at parent window)
Rectangle aRect( Point ( nX, nY ), Size( nWidth, nHeight ) );
GetParent()->ImplReMirror( aRect );
nX = aRect.nLeft;
nX = aRect.Left();
}
}
if( !(nFlags & WINDOW_POSSIZE_X) && bHasValidSize && pWindow->mpWindowImpl->mpFrame->maGeometry.nWidth )
@ -9103,10 +9103,10 @@ void Window::DrawSelectionBackground( const Rectangle& rRect,
Rectangle aRect( rRect );
if( bDrawExtBorderOnly )
{
aRect.nLeft -= 1;
aRect.nTop -= 1;
aRect.nRight += 1;
aRect.nBottom += 1;
--aRect.Left();
--aRect.Top();
++aRect.Right();
++aRect.Bottom();
}
Color oldFillCol = GetFillColor();
Color oldLineCol = GetLineColor();

View File

@ -1691,10 +1691,10 @@ void WinSalFrame::GetWorkArea( Rectangle &rRect )
{
RECT aRect;
ImplSalGetWorkArea( mhWnd, &aRect, NULL );
rRect.nLeft = aRect.left;
rRect.nRight = aRect.right-1;
rRect.nTop = aRect.top;
rRect.nBottom = aRect.bottom-1;
rRect.Left() = aRect.left;
rRect.Right() = aRect.right-1;
rRect.Top() = aRect.top;
rRect.Bottom() = aRect.bottom-1;
}
// -----------------------------------------------------------------------

View File

@ -152,9 +152,9 @@ void MyWin::Paint( const Rectangle& rRect )
DrawRect( r );
for(int i=0; i<aSz.Height(); i+=15)
DrawLine( Point(r.nLeft, r.nTop+i), Point(r.nRight, r.nBottom-i) );
DrawLine( Point(r.Left(), r.Top()+i), Point(r.Right(), r.Bottom()-i) );
for(int i=0; i<aSz.Width(); i+=15)
DrawLine( Point(r.nLeft+i, r.nBottom), Point(r.nRight-i, r.nTop) );
DrawLine( Point(r.Left()+i, r.Bottom()), Point(r.Right()-i, r.Top()) );
SetTextColor( Color( COL_WHITE ) );
Font aFont( String( RTL_CONSTASCII_USTRINGPARAM( "Times" ) ), Size( 0, 25 ) );