vcl: make Region ctors explicit to prevent overloading desasters

Change-Id: Id36d125b4940418833bec31a4710d6cd545629e0
This commit is contained in:
Michael Stahl 2013-03-13 22:28:52 +01:00
parent 913f175b32
commit 38d3e115c1
38 changed files with 74 additions and 61 deletions

View File

@ -88,7 +88,7 @@ namespace vclcanvas
// wouldn't save much render time, and b) will clutter // wouldn't save much render time, and b) will clutter
// scrolled sprite content outside this area) // scrolled sprite content outside this area)
rOutDev.EnableMapMode( sal_False ); rOutDev.EnableMapMode( sal_False );
rOutDev.SetClipRegion( rRequestedArea ); rOutDev.SetClipRegion(Region(rRequestedArea));
// repaint affected sprite directly to output device (at // repaint affected sprite directly to output device (at
// the actual screen output position) // the actual screen output position)

View File

@ -1007,7 +1007,7 @@ void DataBrowser::PaintCell(
// clipping // clipping
if( aPos.X() < rRect.Right() || aPos.X() + TxtSize.Width() > rRect.Right() || if( aPos.X() < rRect.Right() || aPos.X() + TxtSize.Width() > rRect.Right() ||
aPos.Y() < rRect.Top() || aPos.Y() + TxtSize.Height() > rRect.Bottom()) aPos.Y() < rRect.Top() || aPos.Y() + TxtSize.Height() > rRect.Bottom())
rDev.SetClipRegion( rRect ); rDev.SetClipRegion(Region(rRect));
// allow for a disabled control ... // allow for a disabled control ...
sal_Bool bEnabled = IsEnabled(); sal_Bool bEnabled = IsEnabled();

View File

@ -429,7 +429,7 @@ void AboutDialog::MoveControl(Control& rControl, sal_Int32 X, sal_Int32 Y)
void AboutDialog::Paint( const Rectangle& rRect ) void AboutDialog::Paint( const Rectangle& rRect )
{ {
SetClipRegion( rRect ); SetClipRegion(Region(rRect));
Point aPos ( rRect.GetWidth() - aBackgroundBitmap.GetSizePixel().Width(), rRect.GetHeight() - aBackgroundBitmap.GetSizePixel().Height() ); Point aPos ( rRect.GetWidth() - aBackgroundBitmap.GetSizePixel().Width(), rRect.GetHeight() - aBackgroundBitmap.GetSizePixel().Height() );
DrawBitmapEx( aPos, aBackgroundBitmap ); DrawBitmapEx( aPos, aBackgroundBitmap );
} }

View File

@ -294,7 +294,7 @@ namespace offapp
if (m_aSeekRow != m_aSettings.end()) if (m_aSeekRow != m_aSettings.end())
{ {
rDev.SetClipRegion(rRect); rDev.SetClipRegion(Region(rRect));
sal_uInt16 nStyle = TEXT_DRAW_CLIP; sal_uInt16 nStyle = TEXT_DRAW_CLIP;
if (!IsEnabled()) if (!IsEnabled())

View File

@ -370,7 +370,9 @@ namespace dbaui
if( aPos.X() < rRect.Right() || aPos.X() + aTextSize.Width() > rRect.Right() || if( aPos.X() < rRect.Right() || aPos.X() + aTextSize.Width() > rRect.Right() ||
aPos.Y() < rRect.Top() || aPos.Y() + aTextSize.Height() > rRect.Bottom() ) aPos.Y() < rRect.Top() || aPos.Y() + aTextSize.Height() > rRect.Bottom() )
rDev.SetClipRegion( rRect ); {
rDev.SetClipRegion(Region(rRect));
}
rDev.DrawText( aPos, aText ); rDev.DrawText( aPos, aText );

View File

@ -435,7 +435,9 @@ void OTableGrantControl::PaintCell( OutputDevice& rDev, const Rectangle& rRect,
if( aPos.X() < rRect.Right() || aPos.X() + nWidth > rRect.Right() || if( aPos.X() < rRect.Right() || aPos.X() + nWidth > rRect.Right() ||
aPos.Y() < rRect.Top() || aPos.Y() + nHeight > rRect.Bottom() ) aPos.Y() < rRect.Top() || aPos.Y() + nHeight > rRect.Bottom() )
rDev.SetClipRegion( rRect ); {
rDev.SetClipRegion(Region(rRect));
}
rDev.DrawText( aPos, aText ); rDev.DrawText( aPos, aText );
} }

View File

@ -155,7 +155,7 @@ DBG_NAME(IndexFieldsControl)
// clipping // clipping
if (aPos.X() < _rRect.Right() || aPos.X() + TxtSize.Width() > _rRect.Right() || if (aPos.X() < _rRect.Right() || aPos.X() + TxtSize.Width() > _rRect.Right() ||
aPos.Y() < _rRect.Top() || aPos.Y() + TxtSize.Height() > _rRect.Bottom()) aPos.Y() < _rRect.Top() || aPos.Y() + TxtSize.Height() > _rRect.Bottom())
_rDev.SetClipRegion( _rRect ); _rDev.SetClipRegion(Region(_rRect));
// allow for a disabled control ... // allow for a disabled control ...
sal_Bool bEnabled = IsEnabled(); sal_Bool bEnabled = IsEnabled();

View File

@ -1245,7 +1245,7 @@ sal_Bool OSelectionBrowseBox::SeekRow(long nRow)
void OSelectionBrowseBox::PaintCell(OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColumnId) const void OSelectionBrowseBox::PaintCell(OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColumnId) const
{ {
DBG_CHKTHIS(OSelectionBrowseBox,NULL); DBG_CHKTHIS(OSelectionBrowseBox,NULL);
rDev.SetClipRegion( rRect ); rDev.SetClipRegion(Region(rRect));
OTableFieldDescRef pEntry = NULL; OTableFieldDescRef pEntry = NULL;
sal_uInt16 nPos = GetColumnPos(nColumnId); sal_uInt16 nPos = GetColumnPos(nColumnId);

View File

@ -376,7 +376,7 @@ void OTableEditorCtrl::PaintCell(OutputDevice& rDev, const Rectangle& rRect,
const String aText( GetCellText( m_nCurrentPos, nColumnId )); const String aText( GetCellText( m_nCurrentPos, nColumnId ));
rDev.Push( PUSH_CLIPREGION ); rDev.Push( PUSH_CLIPREGION );
rDev.SetClipRegion( rRect ); rDev.SetClipRegion(Region(rRect));
rDev.DrawText( rRect, aText, TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER ); rDev.DrawText( rRect, aText, TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER );
rDev.Pop(); rDev.Pop();
} }

View File

@ -387,7 +387,7 @@ void GridWindow::drawNew()
{ {
if( m_nValues && m_pXValues && m_pNewYValues ) if( m_nValues && m_pXValues && m_pNewYValues )
{ {
SetClipRegion( m_aGridArea ); SetClipRegion(Region(m_aGridArea));
SetLineColor( Color( COL_YELLOW ) ); SetLineColor( Color( COL_YELLOW ) );
for( int i = 0; i < m_nValues-1; i++ ) for( int i = 0; i < m_nValues-1; i++ )
{ {

View File

@ -573,7 +573,7 @@ void OFieldExpressionControl::PaintCell( OutputDevice& rDev, const Rectangle& rR
if( aPos.X() < rRect.Right() || aPos.X() + aTextSize.Width() > rRect.Right() || if( aPos.X() < rRect.Right() || aPos.X() + aTextSize.Width() > rRect.Right() ||
aPos.Y() < rRect.Top() || aPos.Y() + aTextSize.Height() > rRect.Bottom() ) aPos.Y() < rRect.Top() || aPos.Y() + aTextSize.Height() > rRect.Bottom() )
rDev.SetClipRegion( rRect ); rDev.SetClipRegion(Region(rRect));
rDev.DrawText( aPos, aText ); rDev.DrawText( aPos, aText );

View File

@ -4573,7 +4573,7 @@ void ScGridWindow::UpdateFormulas()
PolyPolygon aChangedPoly( aOutputData.GetChangedArea() ); // logic (PixelToLogic) PolyPolygon aChangedPoly( aOutputData.GetChangedArea() ); // logic (PixelToLogic)
if ( aChangedPoly.Count() ) if ( aChangedPoly.Count() )
{ {
Invalidate( aChangedPoly ); Invalidate(Region(aChangedPoly));
} }
CheckNeedsRepaint(); // #i90362# used to be called via Draw() - still needed here CheckNeedsRepaint(); // #i90362# used to be called via Draw() - still needed here

View File

@ -156,8 +156,8 @@ static void lcl_DrawOneFrame( OutputDevice* pDev, const Rectangle& rInnerPixel,
} }
long nClipStartX = bLayoutRTL ? aOuter.Left() + nBWidth : aInner.Left(); long nClipStartX = bLayoutRTL ? aOuter.Left() + nBWidth : aInner.Left();
long nClipEndX = bLayoutRTL ? aInner.Right() : aOuter.Right() - nBWidth; long nClipEndX = bLayoutRTL ? aInner.Right() : aOuter.Right() - nBWidth;
pDev->SetClipRegion( Rectangle( nClipStartX, nButtonY + nVer/2, pDev->SetClipRegion( Region(Rectangle( nClipStartX, nButtonY + nVer/2,
nClipEndX, nButtonY + nVer/2 + aTextSize.Height() ) ); nClipEndX, nButtonY + nVer/2 + aTextSize.Height())) );
} }
pDev->DrawText( Point( nTextStart, nButtonY + nVer/2 ), rTitle ); pDev->DrawText( Point( nTextStart, nButtonY + nVer/2 ), rTitle );
@ -1252,7 +1252,7 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCCOL nX2, ScTableInfo& rTabInfo, Out
Rectangle aRect = GetListValButtonRect( aListValPos ); Rectangle aRect = GetListValButtonRect( aListValPos );
aComboButton.SetPosPixel( aRect.TopLeft() ); aComboButton.SetPosPixel( aRect.TopLeft() );
aComboButton.SetSizePixel( aRect.GetSize() ); aComboButton.SetSizePixel( aRect.GetSize() );
pContentDev->SetClipRegion( aRect ); pContentDev->SetClipRegion(Region(aRect));
aComboButton.Draw( false, false ); aComboButton.Draw( false, false );
pContentDev->SetClipRegion(); // always called from Draw() without clip region pContentDev->SetClipRegion(); // always called from Draw() without clip region
aComboButton.SetPosPixel( aOldPos ); // restore old state aComboButton.SetPosPixel( aOldPos ); // restore old state

View File

@ -512,9 +512,9 @@ void ScOutlineWindow::DataChanged( const DataChangedEvent& rDCEvt )
void ScOutlineWindow::SetEntryAreaClipRegion() void ScOutlineWindow::SetEntryAreaClipRegion()
{ {
SetClipRegion( Rectangle( SetClipRegion( Region(Rectangle(
GetPoint( 0, mnMainFirstPos ), GetPoint( 0, mnMainFirstPos ),
GetPoint( GetOutputSizeLevel() - 1, mnMainLastPos ) ) ); GetPoint( GetOutputSizeLevel() - 1, mnMainLastPos ))));
} }
void ScOutlineWindow::DrawLineRel( void ScOutlineWindow::DrawLineRel(

View File

@ -1596,7 +1596,8 @@ void ScPrintFunc::PrintArea( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
if( aTableParam.bCellContent ) if( aTableParam.bCellContent )
aOutputData.DrawBackground(); aOutputData.DrawBackground();
pDev->SetClipRegion( Rectangle( aPos, Size( aOutputData.GetScrW(), aOutputData.GetScrH() ) ) ); pDev->SetClipRegion(Region(Rectangle(
aPos, Size(aOutputData.GetScrW(), aOutputData.GetScrH()))));
pDev->SetClipRegion(); pDev->SetClipRegion();
if( aTableParam.bCellContent ) if( aTableParam.bCellContent )
@ -1773,7 +1774,7 @@ void ScPrintFunc::PrintHF( long nPageNo, sal_Bool bHeader, long nStartY,
// Clipping fuer Text // Clipping fuer Text
pDev->SetClipRegion( Rectangle( aStart, aPaperSize ) ); pDev->SetClipRegion(Region(Rectangle(aStart, aPaperSize)));
// links // links

View File

@ -264,7 +264,7 @@ Bitmap DrawDocShell::GetPagePreviewBitmap(SdPage* pPage, sal_uInt16 nMaxEdgePixe
pView->SetActiveLayer( pFrameView->GetActiveLayer() ); pView->SetActiveLayer( pFrameView->GetActiveLayer() );
} }
pView->CompleteRedraw( &aVDev, Rectangle( aNullPt, aSize ) ); pView->CompleteRedraw( &aVDev, Region(Rectangle(aNullPt, aSize)) );
// IsRedrawReady() always gives sal_True while ( !pView->IsRedrawReady() ) {} // IsRedrawReady() always gives sal_True while ( !pView->IsRedrawReady() ) {}
delete pView; delete pView;

View File

@ -327,7 +327,8 @@ namespace {
if (pView!=NULL && bPrintMarkedOnly) if (pView!=NULL && bPrintMarkedOnly)
pView->DrawMarkedObj(rPrinter); pView->DrawMarkedObj(rPrinter);
else else
rPrintView.CompleteRedraw(&rPrinter, Rectangle(Point(0,0), rPage.GetSize())); rPrintView.CompleteRedraw(&rPrinter,
Region(Rectangle(Point(0,0), rPage.GetSize())));
rPrinter.SetMapMode(aOriginalMapMode); rPrinter.SetMapMode(aOriginalMapMode);

View File

@ -64,7 +64,7 @@ void ClientView::InvalidateOneWin(::Window& rWin)
void ClientView::InvalidateOneWin(::Window& rWin, const Rectangle& rRect) void ClientView::InvalidateOneWin(::Window& rWin, const Rectangle& rRect)
{ {
CompleteRedraw(&rWin, rRect); CompleteRedraw(&rWin, Region(rRect));
} }
void ClientView::CompleteRedraw(OutputDevice* pOutDev, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector ) void ClientView::CompleteRedraw(OutputDevice* pOutDev, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector )

View File

@ -363,7 +363,7 @@ namespace svt
Point aPos( rRect.TopLeft() ); Point aPos( rRect.TopLeft() );
if ( ( aImageSize.Width() > rRect.GetWidth() ) || ( aImageSize.Height() > rRect.GetHeight() ) ) if ( ( aImageSize.Width() > rRect.GetWidth() ) || ( aImageSize.Height() > rRect.GetHeight() ) )
rDev.SetClipRegion(rRect); rDev.SetClipRegion(Region(rRect));
if ( aImageSize.Width() < rRect.GetWidth() ) if ( aImageSize.Width() < rRect.GetWidth() )
aPos.X() += ( rRect.GetWidth() - aImageSize.Width() ) / 2; aPos.X() += ( rRect.GetWidth() - aImageSize.Width() ) / 2;

View File

@ -690,7 +690,7 @@ void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect )
sal_Bool bResetClipRegion = sal_False; sal_Bool bResetClipRegion = sal_False;
if( !pView->IsClipRegion() ) if( !pView->IsClipRegion() )
{ {
Rectangle aOutputArea( GetOutputRect() ); Region const aOutputArea( GetOutputRect() );
bResetClipRegion = sal_True; bResetClipRegion = sal_True;
pView->SetClipRegion( aOutputArea ); pView->SetClipRegion( aOutputArea );
} }
@ -740,7 +740,7 @@ void SvxIconChoiceCtrl_Impl::RepaintEntries( sal_uInt16 nEntryFlagsMask )
if( !pView->IsClipRegion() ) if( !pView->IsClipRegion() )
{ {
bResetClipRegion = sal_True; bResetClipRegion = sal_True;
pView->SetClipRegion( aOutRect ); pView->SetClipRegion(Region(aOutRect));
} }
for( size_t nCur = 0; nCur < nCount; nCur++ ) for( size_t nCur = 0; nCur < nCount; nCur++ )
{ {
@ -1832,7 +1832,7 @@ void SvxIconChoiceCtrl_Impl::PaintEntry( SvxIconChoiceCtrlEntry* pEntry, const P
Rectangle aOutputArea( GetOutputRect() ); Rectangle aOutputArea( GetOutputRect() );
if( aOutputArea.IsOver(aTextRect) || aOutputArea.IsOver(aBmpRect) ) if( aOutputArea.IsOver(aTextRect) || aOutputArea.IsOver(aBmpRect) )
{ {
pView->SetClipRegion( aOutputArea ); pView->SetClipRegion(Region(aOutputArea));
bResetClipRegion = sal_True; bResetClipRegion = sal_True;
} }
} }
@ -2764,7 +2764,7 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, bool bAdd,
if( !pView->IsClipRegion() ) if( !pView->IsClipRegion() )
{ {
bResetClipRegion = sal_True; bResetClipRegion = sal_True;
pView->SetClipRegion( GetOutputRect() ); pView->SetClipRegion(Region(GetOutputRect()));
} }
for( size_t nPos = 0; nPos < nCount; nPos++ ) for( size_t nPos = 0; nPos < nCount; nPos++ )

View File

@ -554,7 +554,7 @@ bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
} }
else else
{ {
pOut->IntersectClipRegion( aClipPolyPoly ); pOut->IntersectClipRegion(Region(aClipPolyPoly));
} }
} }
} }
@ -693,7 +693,7 @@ sal_Bool GraphicObject::StartAnimation( OutputDevice* pOut, const Point& rPt, co
if( bRectClip ) if( bRectClip )
pOut->IntersectClipRegion( aClipPolyPoly.GetBoundRect() ); pOut->IntersectClipRegion( aClipPolyPoly.GetBoundRect() );
else else
pOut->IntersectClipRegion( aClipPolyPoly ); pOut->IntersectClipRegion(Region(aClipPolyPoly));
} }
} }

View File

@ -471,7 +471,10 @@ namespace svt
:m_rDevice( i_rImpl.m_rTabBar ) :m_rDevice( i_rImpl.m_rTabBar )
{ {
m_rDevice.Push( PUSH_CLIPREGION ); m_rDevice.Push( PUSH_CLIPREGION );
m_rDevice.SetClipRegion( i_rImpl.m_aNormalizer.getTransformed( i_rImpl.m_aGeometry.getItemsRect(), i_rImpl.m_eTabAlignment ) ); m_rDevice.SetClipRegion(Region(
i_rImpl.m_aNormalizer.getTransformed(
i_rImpl.m_aGeometry.getItemsRect(),
i_rImpl.m_eTabAlignment )));
} }
~ClipItemRegion() ~ClipItemRegion()
@ -1042,7 +1045,7 @@ namespace svt
// background // background
const Rectangle aNormalizedPaintArea( m_pImpl->m_aNormalizer.getNormalized( i_rRect, m_pImpl->m_eTabAlignment ) ); const Rectangle aNormalizedPaintArea( m_pImpl->m_aNormalizer.getNormalized( i_rRect, m_pImpl->m_eTabAlignment ) );
m_pImpl->m_aRenderDevice.Push( PUSH_CLIPREGION ); m_pImpl->m_aRenderDevice.Push( PUSH_CLIPREGION );
m_pImpl->m_aRenderDevice.SetClipRegion( aNormalizedPaintArea ); m_pImpl->m_aRenderDevice.SetClipRegion(Region(aNormalizedPaintArea));
m_pImpl->m_pRenderer->renderBackground(); m_pImpl->m_pRenderer->renderBackground();
m_pImpl->m_aRenderDevice.Pop(); m_pImpl->m_aRenderDevice.Pop();
m_pImpl->CopyFromRenderDevice( aNormalizedPaintArea ); m_pImpl->CopyFromRenderDevice( aNormalizedPaintArea );

View File

@ -715,7 +715,7 @@ inline Polygon lclCreatePolygon( const PointVec& rPoints )
} }
/** Returns a polygon constructed from the five passed points. */ /** Returns a polygon constructed from the five passed points. */
Polygon lclCreatePolygon( const Point& rP1, const Point& rP2, const Point& rP3, const Point& rP4, const Point& rP5 ) Region lclCreatePolygon( const Point& rP1, const Point& rP2, const Point& rP3, const Point& rP4, const Point& rP5 )
{ {
PointVec aPoints; PointVec aPoints;
aPoints.reserve( 5 ); aPoints.reserve( 5 );
@ -724,7 +724,7 @@ Polygon lclCreatePolygon( const Point& rP1, const Point& rP2, const Point& rP3,
aPoints.push_back( rP3 ); aPoints.push_back( rP3 );
aPoints.push_back( rP4 ); aPoints.push_back( rP4 );
aPoints.push_back( rP5 ); aPoints.push_back( rP5 );
return lclCreatePolygon( aPoints ); return Region(lclCreatePolygon(aPoints));
} }
/** Sets the color of the passed frame style to the output device. /** Sets the color of the passed frame style to the output device.

View File

@ -568,7 +568,9 @@ sal_Bool SgaObjectSvDraw::DrawCentered( OutputDevice* pOut, const FmFormModel& r
pOut->Push(); pOut->Push();
pOut->SetMapMode( aMap ); pOut->SetMapMode( aMap );
aView.ShowSdrPage( const_cast< FmFormPage* >( pPage )); aView.ShowSdrPage( const_cast< FmFormPage* >( pPage ));
aView.CompleteRedraw( pOut, Rectangle( pOut->PixelToLogic( Point() ), pOut->GetOutputSize() ) ); aView.CompleteRedraw( pOut,
Region(Rectangle(pOut->PixelToLogic(Point()),
pOut->GetOutputSize())));
pOut->Pop(); pOut->Pop();
bRet = sal_True; bRet = sal_True;

View File

@ -363,7 +363,7 @@ void _SdrItemBrowserControl::PaintField(OutputDevice& rDev, const Rectangle& rRe
rDev.DrawText(rRect.TopLeft(),pEntry->aName); rDev.DrawText(rRect.TopLeft(),pEntry->aName);
} }
} else { } else {
rDev.SetClipRegion(aR); rDev.SetClipRegion(Region(aR));
rDev.DrawText(aR.TopLeft(),GetCellText(nAktPaintRow,nColumnId)); rDev.DrawText(aR.TopLeft(),GetCellText(nAktPaintRow,nColumnId));
rDev.SetClipRegion(); rDev.SetClipRegion();
} }

View File

@ -279,7 +279,7 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
FindFlyFrm()->GetContour( aPoly, sal_True ) FindFlyFrm()->GetContour( aPoly, sal_True )
) )
{ {
pOut->SetClipRegion( aPoly ); pOut->SetClipRegion(Region(aPoly));
bClip = false; bClip = false;
} }

View File

@ -2370,7 +2370,7 @@ void SwTabFrmPainter::PaintLines( OutputDevice& rDev, const SwRect& rRect ) cons
Size aSize( rRect.SSize() ); Size aSize( rRect.SSize() );
// Hack! Necessary, because the layout is not pixel aligned! // Hack! Necessary, because the layout is not pixel aligned!
aSize.Width() += nPixelSzW; aSize.Height() += nPixelSzH; aSize.Width() += nPixelSzW; aSize.Height() += nPixelSzH;
rDev.SetClipRegion( Rectangle( rRect.Pos(), aSize ) ); rDev.SetClipRegion(Region(Rectangle(rRect.Pos(), aSize)));
// The following stuff if necessary to have the new table borders fit // The following stuff if necessary to have the new table borders fit
// into a ::SwAlignRect adjusted world. // into a ::SwAlignRect adjusted world.
@ -4010,7 +4010,7 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
ViewShell *pSh = getRootFrm()->GetCurrShell(); ViewShell *pSh = getRootFrm()->GetCurrShell();
if ( !pOut->GetConnectMetaFile() || !pSh || !pSh->GetWin() ) if ( !pOut->GetConnectMetaFile() || !pSh || !pSh->GetWin() )
{ {
pOut->SetClipRegion( aPoly ); pOut->SetClipRegion(Region(aPoly));
} }
for ( sal_uInt16 i = 0; i < aRegion.size(); ++i ) for ( sal_uInt16 i = 0; i < aRegion.size(); ++i )
PaintBackground( aRegion[i], pPage, rAttrs, sal_False, sal_True ); PaintBackground( aRegion[i], pPage, rAttrs, sal_False, sal_True );

View File

@ -158,7 +158,7 @@ void SwLabPreview::Paint(const Rectangle &)
DrawLine(Point(lX0, lY0 + lOutlineH - 1), Point(lX0 + lOutlineW - 1, lY0 + lOutlineH - 1)); // Down DrawLine(Point(lX0, lY0 + lOutlineH - 1), Point(lX0 + lOutlineW - 1, lY0 + lOutlineH - 1)); // Down
// Labels // Labels
SetClipRegion (Rectangle(Point(lX0, lY0), Size(lOutlineW, lOutlineH))); SetClipRegion(Region(Rectangle(Point(lX0, lY0), Size(lOutlineW, lOutlineH))));
SetFillColor( COL_LIGHTGRAYBLUE ); SetFillColor( COL_LIGHTGRAYBLUE );
for (sal_uInt16 nRow = 0; nRow < Min((sal_uInt16) 2, (sal_uInt16) aItem.nRows); nRow++) for (sal_uInt16 nRow = 0; nRow < Min((sal_uInt16) 2, (sal_uInt16) aItem.nRows); nRow++)
for (sal_uInt16 nCol = 0; nCol < Min((sal_uInt16) 2, (sal_uInt16) aItem.nCols); nCol++) for (sal_uInt16 nCol = 0; nCol < Min((sal_uInt16) 2, (sal_uInt16) aItem.nCols); nCol++)

View File

@ -79,12 +79,12 @@ public: // public within vcl
#endif #endif
public: public:
Region(); explicit Region();
Region( RegionType eType ); explicit Region( RegionType eType );
Region( const Rectangle& rRect ); explicit Region( const Rectangle& rRect );
Region( const Polygon& rPolygon ); explicit Region( const Polygon& rPolygon );
Region( const PolyPolygon& rPolyPoly ); explicit Region( const PolyPolygon& rPolyPoly );
Region( const basegfx::B2DPolyPolygon& ); explicit Region( const basegfx::B2DPolyPolygon& );
Region( const Region& rRegion ); Region( const Region& rRegion );
~Region(); ~Region();

View File

@ -505,13 +505,13 @@ long SpinButton::PreNotify( NotifyEvent& rNEvt )
Region aRgn( GetActiveClipRegion() ); Region aRgn( GetActiveClipRegion() );
if( pLastRect ) if( pLastRect )
{ {
SetClipRegion( *pLastRect ); SetClipRegion(Region(*pLastRect));
Paint( *pLastRect ); Paint( *pLastRect );
SetClipRegion( aRgn ); SetClipRegion( aRgn );
} }
if( pRect ) if( pRect )
{ {
SetClipRegion( *pRect ); SetClipRegion(Region(*pRect));
Paint( *pRect ); Paint( *pRect );
SetClipRegion( aRgn ); SetClipRegion( aRgn );
} }

View File

@ -117,7 +117,7 @@ sal_Bool ImplDrawNativeSpinfield( Window *pWin, const SpinbuttonValue& rSpinbutt
bNativeOK = pBorder->DrawNativeControl( CTRL_SPINBOX, PART_ENTIRE_CONTROL, aRgn, CTRL_STATE_ENABLED, bNativeOK = pBorder->DrawNativeControl( CTRL_SPINBOX, PART_ENTIRE_CONTROL, aRgn, CTRL_STATE_ENABLED,
rSpinbuttonValue, rtl::OUString() ); rSpinbuttonValue, rtl::OUString() );
pBorder->SetClipRegion( oldRgn ); pBorder->SetClipRegion(Region(oldRgn));
} }
} }
return bNativeOK; return bNativeOK;
@ -925,13 +925,13 @@ long SpinField::PreNotify( NotifyEvent& rNEvt )
Region aRgn( GetActiveClipRegion() ); Region aRgn( GetActiveClipRegion() );
if( pLastRect ) if( pLastRect )
{ {
SetClipRegion( *pLastRect ); SetClipRegion(Region(*pLastRect));
Paint( *pLastRect ); Paint( *pLastRect );
SetClipRegion( aRgn ); SetClipRegion( aRgn );
} }
if( pRect ) if( pRect )
{ {
SetClipRegion( *pRect ); SetClipRegion(Region(*pRect));
Paint( *pRect ); Paint( *pRect );
SetClipRegion( aRgn ); SetClipRegion( aRgn );
} }

View File

@ -585,14 +585,14 @@ void DrawSlideCirc(sal_Int16 cx, sal_Int16 cy, sal_Int16 rx, sal_Int16 ry, ObjAr
b=Int1+sal_Int16((sal_Int32)(Int2-Int1)*(sal_Int32)(i-y1) /(sal_Int32)(y2-y1+1)); b=Int1+sal_Int16((sal_Int32)(Int2-Int1)*(sal_Int32)(i-y1) /(sal_Int32)(y2-y1+1));
if (b!=b0) { if (b!=b0) {
SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut); SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut);
rOut.SetClipRegion(Rectangle(x1,i0,x2,i-1)); rOut.SetClipRegion(Region(Rectangle(x1,i0,x2,i-1)));
rOut.DrawEllipse(Rectangle(x1,y1,x2,y2)); rOut.DrawEllipse(Rectangle(x1,y1,x2,y2));
i0=i; b0=b; i0=i; b0=b;
} }
i++; i++;
} }
SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut); SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut);
rOut.SetClipRegion(Rectangle(x1,i0,x2,y2)); rOut.SetClipRegion(Region(Rectangle(x1,i0,x2,y2)));
rOut.DrawEllipse(Rectangle(x1,y1,x2,y2)); rOut.DrawEllipse(Rectangle(x1,y1,x2,y2));
rOut.SetClipRegion(ClipMerk); rOut.SetClipRegion(ClipMerk);
} break; } break;
@ -604,14 +604,14 @@ void DrawSlideCirc(sal_Int16 cx, sal_Int16 cy, sal_Int16 rx, sal_Int16 ry, ObjAr
b=Int1+sal_Int16((sal_Int32)(Int2-Int1)*(sal_Int32)(i-x1) /(sal_Int32)(x2-x1+1)); b=Int1+sal_Int16((sal_Int32)(Int2-Int1)*(sal_Int32)(i-x1) /(sal_Int32)(x2-x1+1));
if (b!=b0) { if (b!=b0) {
SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut); SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)b0,rOut);
rOut.SetClipRegion(Rectangle(i0,y1,i-1,y2)); rOut.SetClipRegion(Region(Rectangle(i0,y1,i-1,y2)));
rOut.DrawEllipse(Rectangle(x1,y1,x2,y2)); rOut.DrawEllipse(Rectangle(x1,y1,x2,y2));
i0=i; b0=b; i0=i; b0=b;
} }
i++; i++;
} }
SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut); SgfAreaColorIntens(F.FMuster,(sal_uInt8)Col1,(sal_uInt8)Col2,(sal_uInt8)Int2,rOut);
rOut.SetClipRegion(Rectangle(i0,y1,x2,y2)); rOut.SetClipRegion(Region(Rectangle(i0,y1,x2,y2)));
rOut.DrawEllipse(Rectangle(x1,y1,x2,y2)); rOut.DrawEllipse(Rectangle(x1,y1,x2,y2));
rOut.SetClipRegion(ClipMerk); rOut.SetClipRegion(ClipMerk);
} break; } break;

View File

@ -1403,7 +1403,9 @@ void GDIMetaFile::Rotate( long nAngle10 )
case( META_ISECTRECTCLIPREGION_ACTION ): case( META_ISECTRECTCLIPREGION_ACTION ):
{ {
MetaISectRectClipRegionAction* pAct = (MetaISectRectClipRegionAction*) pAction; MetaISectRectClipRegionAction* pAct = (MetaISectRectClipRegionAction*) pAction;
aMtf.AddAction( new MetaISectRegionClipRegionAction( ImplGetRotatedPolygon( pAct->GetRect(), aRotAnchor, aRotOffset, fSin, fCos ) ) ); aMtf.AddAction( new MetaISectRegionClipRegionAction(Region(
ImplGetRotatedPolygon( pAct->GetRect(), aRotAnchor,
aRotOffset, fSin, fCos )) ) );
} }
break; break;

View File

@ -800,7 +800,7 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly,
if( OUTDEV_PRINTER == meOutDevType ) if( OUTDEV_PRINTER == meOutDevType )
{ {
Push( PUSH_CLIPREGION ); Push( PUSH_CLIPREGION );
IntersectClipRegion( rPolyPoly ); IntersectClipRegion(Region(rPolyPoly));
DrawGradient( aRect, rGradient ); DrawGradient( aRect, rGradient );
Pop(); Pop();
} }

View File

@ -348,7 +348,7 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
} }
Push( PUSH_CLIPREGION | PUSH_LINECOLOR ); Push( PUSH_CLIPREGION | PUSH_LINECOLOR );
IntersectClipRegion( rPolyPoly ); IntersectClipRegion(Region(rPolyPoly));
SetLineColor( GetFillColor() ); SetLineColor( GetFillColor() );
const sal_Bool bOldMap = mbMap; const sal_Bool bOldMap = mbMap;
EnableMapMode( sal_False ); EnableMapMode( sal_False );

View File

@ -295,7 +295,7 @@ sal_Bool OutputDevice::DrawNativeControl( ControlType nType,
Region aTestRegion( GetActiveClipRegion() ); Region aTestRegion( GetActiveClipRegion() );
aTestRegion.Intersect( rControlRegion ); aTestRegion.Intersect( rControlRegion );
if( aTestRegion == rControlRegion ) if (aTestRegion == Region(rControlRegion))
nState |= CTRL_CACHING_ALLOWED; // control is not clipped, caching allowed nState |= CTRL_CACHING_ALLOWED; // control is not clipped, caching allowed
sal_Bool bRet = mpGraphics->DrawNativeControl(nType, nPart, screenRegion, nState, *aScreenCtrlValue, aCaption, this ); sal_Bool bRet = mpGraphics->DrawNativeControl(nType, nPart, screenRegion, nState, *aScreenCtrlValue, aCaption, this );

View File

@ -2322,7 +2322,7 @@ sal_Bool Region::IsInside( const Rectangle& rRect ) const
return sal_False; return sal_False;
// create region from rectangle and intersect own region // create region from rectangle and intersect own region
Region aRegion = rRect; Region aRegion(rRect);
aRegion.Exclude( *this ); aRegion.Exclude( *this );
// rectangle is inside if exclusion is empty // rectangle is inside if exclusion is empty
@ -2341,7 +2341,7 @@ sal_Bool Region::IsOver( const Rectangle& rRect ) const
// Can we optimize this ??? - is used in StarDraw for brushes pointers // Can we optimize this ??? - is used in StarDraw for brushes pointers
// Why we have no IsOver for Regions ??? // Why we have no IsOver for Regions ???
// create region from rectangle and intersect own region // create region from rectangle and intersect own region
Region aRegion = rRect; Region aRegion(rRect);
aRegion.Intersect( *this ); aRegion.Intersect( *this );
// rectangle is over if include is not empty // rectangle is over if include is not empty

View File

@ -4038,7 +4038,7 @@ Region MenuFloatingWindow::ImplCalcClipRegion( sal_Bool bIncludeLogo ) const
if ( pMenu && pMenu->pLogo && !bIncludeLogo ) if ( pMenu && pMenu->pLogo && !bIncludeLogo )
aRect.Left() += pMenu->pLogo->aBitmap.GetSizePixel().Width(); aRect.Left() += pMenu->pLogo->aBitmap.GetSizePixel().Width();
Region aRegion = aRect; Region aRegion(aRect);
if ( pMenu && pMenu->pLogo && bIncludeLogo && nScrollerHeight ) if ( pMenu && pMenu->pLogo && bIncludeLogo && nScrollerHeight )
aRegion.Union( Rectangle( Point(), Size( pMenu->pLogo->aBitmap.GetSizePixel().Width(), aOutSz.Height() ) ) ); aRegion.Union( Rectangle( Point(), Size( pMenu->pLogo->aBitmap.GetSizePixel().Width(), aOutSz.Height() ) ) );