diff options
author | Noel Grandin <noel@peralex.com> | 2015-03-19 13:54:12 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-10 12:10:43 +0100 |
commit | 820576af4fd6441a752742b43d804e9837839925 (patch) | |
tree | 205b0a04d1bd5063ad3005b9679c1facea2ca2c8 /svtools/source | |
parent | bf739995fc97ed61a586e949a868ac67fc3b7d95 (diff) |
start wrapping OutputDevice in VclPtr
Change-Id: If3ecbb0599b50d50ce6b3997ca7892200c332ffe
Diffstat (limited to 'svtools/source')
-rw-r--r-- | svtools/source/contnr/imivctl.hxx | 8 | ||||
-rw-r--r-- | svtools/source/contnr/imivctl1.cxx | 16 | ||||
-rw-r--r-- | svtools/source/control/ctrlbox.cxx | 29 | ||||
-rw-r--r-- | svtools/source/control/ctrltool.cxx | 2 | ||||
-rw-r--r-- | svtools/source/control/ruler.cxx | 98 | ||||
-rw-r--r-- | svtools/source/control/valueset.cxx | 74 | ||||
-rw-r--r-- | svtools/source/dialogs/prnsetup.cxx | 11 | ||||
-rw-r--r-- | svtools/source/graphic/grfmgr2.cxx | 16 | ||||
-rw-r--r-- | svtools/source/graphic/provider.cxx | 16 | ||||
-rw-r--r-- | svtools/source/inc/renderer.hxx | 2 | ||||
-rw-r--r-- | svtools/source/misc/sampletext.cxx | 14 | ||||
-rw-r--r-- | svtools/source/table/gridtablerenderer.cxx | 8 | ||||
-rw-r--r-- | svtools/source/toolpanel/paneltabbar.cxx | 24 | ||||
-rw-r--r-- | svtools/source/toolpanel/toolpaneldrawer.hxx | 2 |
14 files changed, 159 insertions, 161 deletions
diff --git a/svtools/source/contnr/imivctl.hxx b/svtools/source/contnr/imivctl.hxx index c17497f5acb8..e5a8445b98c7 100644 --- a/svtools/source/contnr/imivctl.hxx +++ b/svtools/source/contnr/imivctl.hxx @@ -200,10 +200,10 @@ class SvxIconChoiceCtrl_Impl SvxIconChoiceCtrlEntry* pPrevDropTarget; SvxIconChoiceCtrlEntry* pHdlEntry; SvxIconChoiceCtrlEntry* pDDRefEntry; - VirtualDevice* pDDDev; - VirtualDevice* pDDBufDev; - VirtualDevice* pDDTempDev; - VirtualDevice* pEntryPaintDev; + VclPtr<VirtualDevice> pDDDev; + VclPtr<VirtualDevice> pDDBufDev; + VclPtr<VirtualDevice> pDDTempDev; + VclPtr<VirtualDevice> pEntryPaintDev; SvxIconChoiceCtrlEntry* pAnchor; // for selection LocalFocus aFocus; // Data for focusrect ::svt::AccessibleFactoryAccess aAccFactory; diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index 021757701065..2216348cb599 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -164,10 +164,10 @@ SvxIconChoiceCtrl_Impl::~SvxIconChoiceCtrl_Impl() delete pZOrderList; delete pImpCursor; delete pGridMap; - delete pDDDev; - delete pDDBufDev; - delete pDDTempDev; - delete pEntryPaintDev; + pDDDev.disposeAndClear(); + pDDBufDev.disposeAndClear(); + pDDTempDev.disposeAndClear(); + pEntryPaintDev.disposeAndClear(); ClearSelectedRectList(); ClearColumnList(); aVerSBar.disposeAndClear(); @@ -261,10 +261,10 @@ IMPL_LINK_NOARG(SvxIconChoiceCtrl_Impl, EndScrollHdl) void SvxIconChoiceCtrl_Impl::FontModified() { StopEditTimer(); - DELETEZ(pDDDev); - DELETEZ(pDDBufDev); - DELETEZ(pDDTempDev); - DELETEZ(pEntryPaintDev); + pDDDev.disposeAndClear(); + pDDBufDev.disposeAndClear(); + pDDTempDev.disposeAndClear(); + pEntryPaintDev.disposeAndClear(); SetDefaultTextSize(); ShowCursor( false ); ShowCursor( true ); diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 0c49ef8a338b..2b95a5e7d586 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -670,8 +670,8 @@ void LineListBox::ImpGetLine( long nLine1, long nLine2, long nDistance, } // Linien malen - aSize = aVirDev.PixelToLogic( aSize ); - long nPix = aVirDev.PixelToLogic( Size( 0, 1 ) ).Height(); + aSize = aVirDev->PixelToLogic( aSize ); + long nPix = aVirDev->PixelToLogic( Size( 0, 1 ) ).Height(); sal_uInt32 n1 = nLine1; sal_uInt32 n2 = nLine2; long nDist = nDistance; @@ -690,24 +690,24 @@ void LineListBox::ImpGetLine( long nLine1, long nLine2, long nDistance, // negative width should not be drawn if ( aSize.Width() > 0 ) { - Size aVirSize = aVirDev.LogicToPixel( aSize ); - if ( aVirDev.GetOutputSizePixel() != aVirSize ) - aVirDev.SetOutputSizePixel( aVirSize ); - aVirDev.SetFillColor( aColorDist ); - aVirDev.DrawRect( Rectangle( Point(), aSize ) ); + Size aVirSize = aVirDev->LogicToPixel( aSize ); + if ( aVirDev->GetOutputSizePixel() != aVirSize ) + aVirDev->SetOutputSizePixel( aVirSize ); + aVirDev->SetFillColor( aColorDist ); + aVirDev->DrawRect( Rectangle( Point(), aSize ) ); - aVirDev.SetFillColor( aColor1 ); + aVirDev->SetFillColor( aColor1 ); double y1 = double( n1 ) / 2; - svtools::DrawLine( aVirDev, basegfx::B2DPoint( 0, y1 ), basegfx::B2DPoint( aSize.Width( ), y1 ), n1, nStyle ); + svtools::DrawLine( *aVirDev.get(), basegfx::B2DPoint( 0, y1 ), basegfx::B2DPoint( aSize.Width( ), y1 ), n1, nStyle ); if ( n2 ) { double y2 = n1 + nDist + double( n2 ) / 2; - aVirDev.SetFillColor( aColor2 ); - svtools::DrawLine( aVirDev, basegfx::B2DPoint( 0, y2 ), basegfx::B2DPoint( aSize.Width(), y2 ), n2, table::BorderLineStyle::SOLID ); + aVirDev->SetFillColor( aColor2 ); + svtools::DrawLine( *aVirDev.get(), basegfx::B2DPoint( 0, y2 ), basegfx::B2DPoint( aSize.Width(), y2 ), n2, table::BorderLineStyle::SOLID ); } - rBmp = aVirDev.GetBitmap( Point(), Size( aSize.Width(), n1+nDist+n2 ) ); + rBmp = aVirDev->GetBitmap( Point(), Size( aSize.Width(), n1+nDist+n2 ) ); } } @@ -719,8 +719,8 @@ void LineListBox::ImplInit() eUnit = FUNIT_POINT; eSourceUnit = FUNIT_POINT; - aVirDev.SetLineColor(); - aVirDev.SetMapMode( MapMode( MAP_TWIP ) ); + aVirDev->SetLineColor(); + aVirDev->SetMapMode( MapMode( MAP_TWIP ) ); UpdatePaintLineColor(); } @@ -729,6 +729,7 @@ LineListBox::LineListBox( vcl::Window* pParent, WinBits nWinStyle ) : ListBox( pParent, nWinStyle ), m_nWidth( 5 ), m_sNone( ), + aVirDev( new VirtualDevice ), aColor( COL_BLACK ), maPaintCol( COL_BLACK ) { diff --git a/svtools/source/control/ctrltool.cxx b/svtools/source/control/ctrltool.cxx index 7babd84d5fbf..bc2af3a7aa3b 100644 --- a/svtools/source/control/ctrltool.cxx +++ b/svtools/source/control/ctrltool.cxx @@ -73,7 +73,7 @@ class ImplFontListFontInfo : public vcl::FontInfo friend class FontList; private: - OutputDevice* mpDevice; + VclPtr<OutputDevice> mpDevice; ImplFontListFontInfo* mpNext; public: diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx index 230d10e0f743..5e45e596f831 100644 --- a/svtools/source/control/ruler.cxx +++ b/svtools/source/control/ruler.cxx @@ -290,7 +290,7 @@ void Ruler::ImplInit( WinBits nWinBits ) Ruler::Ruler( vcl::Window* pParent, WinBits nWinStyle ) : Window( pParent, nWinStyle & WB_3DLOOK ), - maVirDev( *this ), + maVirDev( new VirtualDevice(*this) ), maMapMode( MAP_100TH_MM ), mpSaveData(new ImplRulerData), mpData(NULL), @@ -362,9 +362,9 @@ void Ruler::ImplVDrawLine( long nX1, long nY1, long nX2, long nY2 ) } if ( mnWinStyle & WB_HORZ ) - maVirDev.DrawLine( Point( nX1, nY1 ), Point( nX2, nY2 ) ); + maVirDev->DrawLine( Point( nX1, nY1 ), Point( nX2, nY2 ) ); else - maVirDev.DrawLine( Point( nY1, nX1 ), Point( nY2, nX2 ) ); + maVirDev->DrawLine( Point( nY1, nX1 ), Point( nY2, nX2 ) ); } void Ruler::ImplVDrawRect( long nX1, long nY1, long nX2, long nY2 ) @@ -384,15 +384,15 @@ void Ruler::ImplVDrawRect( long nX1, long nY1, long nX2, long nY2 ) } if ( mnWinStyle & WB_HORZ ) - maVirDev.DrawRect( Rectangle( nX1, nY1, nX2, nY2 ) ); + maVirDev->DrawRect( Rectangle( nX1, nY1, nX2, nY2 ) ); else - maVirDev.DrawRect( Rectangle( nY1, nX1, nY2, nX2 ) ); + maVirDev->DrawRect( Rectangle( nY1, nX1, nY2, nX2 ) ); } void Ruler::ImplVDrawText( long nX, long nY, const OUString& rText, long nMin, long nMax ) { Rectangle aRect; - maVirDev.GetTextBoundRect( aRect, rText ); + maVirDev->GetTextBoundRect( aRect, rText ); long nShiftX = ( aRect.GetWidth() / 2 ) + aRect.Left(); long nShiftY = ( aRect.GetHeight() / 2 ) + aRect.Top(); @@ -400,9 +400,9 @@ void Ruler::ImplVDrawText( long nX, long nY, const OUString& rText, long nMin, l if ( (nX > -RULER_CLIP) && (nX < mnVirWidth + RULER_CLIP) && ( nX < nMax - nShiftX ) && ( nX > nMin + nShiftX ) ) { if ( mnWinStyle & WB_HORZ ) - maVirDev.DrawText( Point( nX - nShiftX, nY - nShiftY ), rText ); + maVirDev->DrawText( Point( nX - nShiftX, nY - nShiftY ), rText ); else - maVirDev.DrawText( Point( nY - nShiftX, nX - nShiftY ), rText ); + maVirDev->DrawText( Point( nY - nShiftX, nX - nShiftY ), rText ); } } @@ -490,7 +490,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nTop, long nB double nAcceptanceDelta = 0.0001; - Size aPixSize = maVirDev.LogicToPixel( Size( nTick4, nTick4 ), maMapMode ); + Size aPixSize = maVirDev->LogicToPixel( Size( nTick4, nTick4 ), maMapMode ); if ( mnUnitIndex == RULER_UNIT_CHAR ) { @@ -522,11 +522,11 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nTop, long nB aFont.SetOrientation( 2700 ); else aFont.SetOrientation( 900 ); - maVirDev.SetFont( aFont ); + maVirDev->SetFont( aFont ); nTickWidth = aPixSize.Height(); } - long nMaxWidth = maVirDev.PixelToLogic( Size( mpData->nPageWidth, 0 ), maMapMode ).Width(); + long nMaxWidth = maVirDev->PixelToLogic( Size( mpData->nPageWidth, 0 ), maMapMode ).Width(); if ( nMaxWidth < 0 ) nMaxWidth = -nMaxWidth; @@ -570,7 +570,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nTop, long nB } nTick4 = nOrgTick4 * nMulti; - aPixSize = maVirDev.LogicToPixel( Size( nTick4, nTick4 ), maMapMode ); + aPixSize = maVirDev->LogicToPixel( Size( nTick4, nTick4 ), maMapMode ); if ( mnWinStyle & WB_HORZ ) nTickWidth = aPixSize.Width(); else @@ -580,7 +580,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nTop, long nB } else { - maVirDev.SetLineColor( GetSettings().GetStyleSettings().GetShadowColor() ); + maVirDev->SetLineColor( GetSettings().GetStyleSettings().GetShadowColor() ); } if ( !bNoTicks ) @@ -597,11 +597,11 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nTop, long nB Size nTickGapSize; - nTickGapSize = maVirDev.LogicToPixel( Size( nTickCount, nTickCount ), maMapMode ); + nTickGapSize = maVirDev->LogicToPixel( Size( nTickCount, nTickCount ), maMapMode ); long nTickGap1 = mnWinStyle & WB_HORZ ? nTickGapSize.Width() : nTickGapSize.Height(); - nTickGapSize = maVirDev.LogicToPixel( Size( nTick2, nTick2 ), maMapMode ); + nTickGapSize = maVirDev->LogicToPixel( Size( nTick2, nTick2 ), maMapMode ); long nTickGap2 = mnWinStyle & WB_HORZ ? nTickGapSize.Width() : nTickGapSize.Height(); - nTickGapSize = maVirDev.LogicToPixel( Size( nTick3, nTick3 ), maMapMode ); + nTickGapSize = maVirDev->LogicToPixel( Size( nTick3, nTick3 ), maMapMode ); long nTickGap3 = mnWinStyle & WB_HORZ ? nTickGapSize.Width() : nTickGapSize.Height(); while ( ((nStart - n) >= nMin) || ((nStart + n) <= nMax) ) @@ -621,7 +621,7 @@ void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nTop, long nB } else { - aPixSize = maVirDev.LogicToPixel( Size( nTick, nTick ), maMapMode ); + aPixSize = maVirDev->LogicToPixel( Size( nTick, nTick ), maMapMode ); if ( mnWinStyle & WB_HORZ ) n = aPixSize.Width(); @@ -721,20 +721,20 @@ void Ruler::ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom { if ( (n2-n1) > 3 ) { - maVirDev.SetLineColor(); - maVirDev.SetFillColor( rStyleSettings.GetFaceColor() ); + maVirDev->SetLineColor(); + maVirDev->SetFillColor( rStyleSettings.GetFaceColor() ); ImplVDrawRect( n1, nVirTop, n2, nVirBottom ); - maVirDev.SetLineColor( rStyleSettings.GetLightColor() ); + maVirDev->SetLineColor( rStyleSettings.GetLightColor() ); ImplVDrawLine( n1 + 1, nVirTop, n1 + 1, nVirBottom ); ImplVDrawLine( n1, nVirTop, n2, nVirTop ); - maVirDev.SetLineColor( rStyleSettings.GetShadowColor() ); + maVirDev->SetLineColor( rStyleSettings.GetShadowColor() ); ImplVDrawLine( n1, nVirTop, n1, nVirBottom ); ImplVDrawLine( n1, nVirBottom, n2, nVirBottom ); ImplVDrawLine( n2 - 1, nVirTop, n2 - 1, nVirBottom ); - maVirDev.SetLineColor( rStyleSettings.GetDarkShadowColor() ); + maVirDev->SetLineColor( rStyleSettings.GetDarkShadowColor() ); ImplVDrawLine( n2, nVirTop, n2, nVirBottom ); if ( mpData->pBorders[i].nStyle & RULER_BORDER_VARIABLE ) @@ -747,7 +747,7 @@ void Ruler::ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom long nTemp4 = nTemp2 + RULER_VAR_SIZE - 1; long nTempY = nTemp2; - maVirDev.SetLineColor( rStyleSettings.GetLightColor() ); + maVirDev->SetLineColor( rStyleSettings.GetLightColor() ); while ( nTempY <= nTemp4 ) { ImplVDrawLine( nTemp1, nTempY, nTemp3, nTempY ); @@ -755,7 +755,7 @@ void Ruler::ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom } nTempY = nTemp2 + 1; - maVirDev.SetLineColor( rStyleSettings.GetShadowColor() ); + maVirDev->SetLineColor( rStyleSettings.GetShadowColor() ); while ( nTempY <= nTemp4 ) { ImplVDrawLine( nTemp1, nTempY, nTemp3, nTempY ); @@ -768,10 +768,10 @@ void Ruler::ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom { if ( n2-n1 > RULER_VAR_SIZE+10 ) { - maVirDev.SetLineColor( rStyleSettings.GetShadowColor() ); + maVirDev->SetLineColor( rStyleSettings.GetShadowColor() ); ImplVDrawLine( n1 + 4, nVirTop + 3, n1 + 4, nVirBottom - 3 ); ImplVDrawLine( n2 - 5, nVirTop + 3, n2 - 5, nVirBottom - 3 ); - maVirDev.SetLineColor( rStyleSettings.GetLightColor() ); + maVirDev->SetLineColor( rStyleSettings.GetLightColor() ); ImplVDrawLine( n1 + 5, nVirTop + 3, n1 + 5, nVirBottom - 3 ); ImplVDrawLine( n2 - 4, nVirTop + 3, n2 - 4, nVirBottom - 3 ); } @@ -780,7 +780,7 @@ void Ruler::ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom else { n = n1 + ((n2 - n1) / 2); - maVirDev.SetLineColor( rStyleSettings.GetShadowColor() ); + maVirDev->SetLineColor( rStyleSettings.GetShadowColor() ); if ( mpData->pBorders[i].nStyle & RULER_BORDER_SNAP ) ImplVDrawLine( n, nVirTop, n, nVirBottom ); @@ -790,8 +790,8 @@ void Ruler::ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom { ImplVDrawLine( n - 1, nVirTop, n - 1, nVirBottom ); ImplVDrawLine( n + 1, nVirTop, n + 1, nVirBottom ); - maVirDev.SetLineColor(); - maVirDev.SetFillColor( rStyleSettings.GetWindowColor() ); + maVirDev->SetLineColor(); + maVirDev->SetFillColor( rStyleSettings.GetWindowColor() ); ImplVDrawRect( n, nVirTop, n, nVirBottom ); } } @@ -806,9 +806,9 @@ void Ruler::ImplDrawIndent( const Polygon& rPoly, sal_uInt16 nStyle, bool bIsHit if ( nStyle & RULER_STYLE_INVISIBLE ) return; - maVirDev.SetLineColor( rStyleSettings.GetDarkShadowColor() ); - maVirDev.SetFillColor( bIsHit ? rStyleSettings.GetDarkShadowColor() : rStyleSettings.GetWorkspaceColor() ); - maVirDev.DrawPolygon( rPoly ); + maVirDev->SetLineColor( rStyleSettings.GetDarkShadowColor() ); + maVirDev->SetFillColor( bIsHit ? rStyleSettings.GetDarkShadowColor() : rStyleSettings.GetWorkspaceColor() ); + maVirDev->DrawPolygon( rPoly ); } void Ruler::ImplDrawIndents( long nMin, long nMax, long nVirTop, long nVirBottom ) @@ -835,7 +835,7 @@ void Ruler::ImplDrawIndents( long nMin, long nMax, long nVirTop, long nVirBottom if (nIndentStyle == RULER_INDENT_BORDER) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); - maVirDev.SetLineColor( rStyleSettings.GetShadowColor() ); + maVirDev->SetLineColor( rStyleSettings.GetShadowColor() ); ImplVDrawLine( n, nVirTop + 1, n, nVirBottom - 1 ); } else if ( nIndentStyle == RULER_INDENT_BOTTOM ) @@ -1039,7 +1039,7 @@ void Ruler::ImplDrawTabs( long nMin, long nMax, long nVirTop, long nVirBottom ) aPosition += +mpData->nNullVirOff; long nTopBottom = (GetStyle() & WB_RIGHT_ALIGNED) ? nVirTop : nVirBottom; if (nMin <= aPosition && aPosition <= nMax) - ImplDrawTab( &maVirDev, Point( aPosition, nTopBottom ), mpData->pTabs[i].nStyle ); + ImplDrawTab( maVirDev.get(), Point( aPosition, nTopBottom ), mpData->pTabs[i].nStyle ); } } @@ -1094,16 +1094,16 @@ void Ruler::ImplInitSettings( bool bFont, bool bForeground, bool bBackground ) SetBackground( aColor ); } - maVirDev.SetSettings( GetSettings() ); - maVirDev.SetBackground( GetBackground() ); + maVirDev->SetSettings( GetSettings() ); + maVirDev->SetBackground( GetBackground() ); vcl::Font aFont = GetFont(); if ( mnWinStyle & WB_VERT ) aFont.SetOrientation( 900 ); - maVirDev.SetFont( aFont ); - maVirDev.SetTextColor( GetTextColor() ); - maVirDev.SetTextFillColor( GetTextFillColor() ); + maVirDev->SetFont( aFont ); + maVirDev->SetTextColor( GetTextColor() ); + maVirDev->SetTextFillColor( GetTextFillColor() ); } void Ruler::ImplCalc() @@ -1201,10 +1201,10 @@ void Ruler::ImplFormat() aVirDevSize.Height() = mnVirWidth; aVirDevSize.Width() = mnVirHeight; } - if ( aVirDevSize != maVirDev.GetOutputSizePixel() ) - maVirDev.SetOutputSizePixel( aVirDevSize, true ); + if ( aVirDevSize != maVirDev->GetOutputSizePixel() ) + maVirDev->SetOutputSizePixel( aVirDevSize, true ); else - maVirDev.Erase(); + maVirDev->Erase(); // calculate margins if ( !(mpData->nMargin1Style & RULER_STYLE_INVISIBLE) ) @@ -1245,7 +1245,7 @@ void Ruler::ImplFormat() } // top/bottom border - maVirDev.SetLineColor( rStyleSettings.GetShadowColor() ); + maVirDev->SetLineColor( rStyleSettings.GetShadowColor() ); ImplVDrawLine( nVirLeft, nVirTop + 1, nM1, nVirTop + 1 ); //top left line ImplVDrawLine( nM2, nVirTop + 1, nP2 - 1, nVirTop + 1 ); //top right line @@ -1253,18 +1253,18 @@ void Ruler::ImplFormat() nVirBottom--; // draw margin1, margin2 and in-between - maVirDev.SetLineColor(); - maVirDev.SetFillColor( rStyleSettings.GetDialogColor() ); + maVirDev->SetLineColor(); + maVirDev->SetFillColor( rStyleSettings.GetDialogColor() ); if ( nM1 > nVirLeft ) ImplVDrawRect( nP1, nVirTop+1, nM1, nVirBottom ); //left gray rectangle if ( nM2 < nP2 ) ImplVDrawRect( nM2, nVirTop+1, nP2, nVirBottom ); //right gray rectangle if ( nM2-nM1 > 0 ) { - maVirDev.SetFillColor( rStyleSettings.GetWindowColor() ); + maVirDev->SetFillColor( rStyleSettings.GetWindowColor() ); ImplVDrawRect( nM1 + 1, nVirTop, nM2 - 1, nVirBottom ); //center rectangle } - maVirDev.SetLineColor( rStyleSettings.GetShadowColor() ); + maVirDev->SetLineColor( rStyleSettings.GetShadowColor() ); if ( nM1 > nVirLeft ) { ImplVDrawLine( nM1, nVirTop + 1, nM1, nVirBottom ); //right line of the left rectangle @@ -1375,7 +1375,7 @@ void Ruler::ImplDraw() { // output the ruler to the virtual device Point aOffPos; - Size aVirDevSize = maVirDev.GetOutputSizePixel(); + Size aVirDevSize = maVirDev->GetOutputSizePixel(); if ( mnWinStyle & WB_HORZ ) { @@ -1390,7 +1390,7 @@ void Ruler::ImplDraw() aOffPos.X() = RULER_OFF; aOffPos.Y() = mnVirOff; } - DrawOutDev( aOffPos, aVirDevSize, Point(), aVirDevSize, maVirDev ); + DrawOutDev( aOffPos, aVirDevSize, Point(), aVirDevSize, *maVirDev.get() ); // redraw positionlines ImplInvertLines( true ); diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index 2d0cb078df28..98a0b95a495e 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -89,14 +89,14 @@ void ValueSet::ImplInit() mbHasVisibleItems = false; // #106446#, #106601# force mirroring of virtual device - maVirDev.EnableRTL( GetParent()->IsRTLEnabled() ); + maVirDev->EnableRTL( GetParent()->IsRTLEnabled() ); ImplInitSettings( true, true, true ); } ValueSet::ValueSet( vcl::Window* pParent, WinBits nWinStyle, bool bDisableTransientChildren ) : Control( pParent, nWinStyle ), - maVirDev( *this ), + maVirDev( new VirtualDevice(*this) ), maColor( COL_TRANSPARENT ) { ImplInit(); @@ -116,7 +116,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeValueSet(vcl::Window * ValueSet::ValueSet( vcl::Window* pParent, const ResId& rResId, bool bDisableTransientChildren ) : Control( pParent, rResId ), - maVirDev( *this ), + maVirDev( new VirtualDevice(*this) ), maColor( COL_TRANSPARENT ) { ImplInit(); @@ -239,7 +239,7 @@ void ValueSet::ImplFormatItem( ValueSetItem* pItem, Rectangle aRect ) } else { - DecorationView aView( &maVirDev ); + DecorationView aView( maVirDev.get() ); aRect = aView.DrawFrame( aRect, mnFrameStyle ); } } @@ -253,11 +253,11 @@ void ValueSet::ImplFormatItem( ValueSetItem* pItem, Rectangle aRect ) if ( pItem == mpNoneItem.get() ) { - maVirDev.SetFont( GetFont() ); - maVirDev.SetTextColor( ( nStyle & WB_MENUSTYLEVALUESET ) ? rStyleSettings.GetMenuTextColor() : rStyleSettings.GetWindowTextColor() ); - maVirDev.SetTextFillColor(); - maVirDev.SetFillColor( ( nStyle & WB_MENUSTYLEVALUESET ) ? rStyleSettings.GetMenuColor() : rStyleSettings.GetWindowColor() ); - maVirDev.DrawRect( aRect ); + maVirDev->SetFont( GetFont() ); + maVirDev->SetTextColor( ( nStyle & WB_MENUSTYLEVALUESET ) ? rStyleSettings.GetMenuTextColor() : rStyleSettings.GetWindowTextColor() ); + maVirDev->SetTextFillColor(); + maVirDev->SetFillColor( ( nStyle & WB_MENUSTYLEVALUESET ) ? rStyleSettings.GetMenuColor() : rStyleSettings.GetWindowColor() ); + maVirDev->DrawRect( aRect ); Point aTxtPos( aRect.Left() + 2, aRect.Top() ); long nTxtWidth = GetTextWidth( pItem->maText ); if ( nStyle & WB_RADIOSEL ) @@ -267,33 +267,33 @@ void ValueSet::ImplFormatItem( ValueSetItem* pItem, Rectangle aRect ) } if ( (aTxtPos.X()+nTxtWidth) > aRect.Right() ) { - maVirDev.SetClipRegion( vcl::Region( aRect ) ); - maVirDev.DrawText( aTxtPos, pItem->maText ); - maVirDev.SetClipRegion(); + maVirDev->SetClipRegion( vcl::Region( aRect ) ); + maVirDev->DrawText( aTxtPos, pItem->maText ); + maVirDev->SetClipRegion(); } else - maVirDev.DrawText( aTxtPos, pItem->maText ); + maVirDev->DrawText( aTxtPos, pItem->maText ); } else if ( pItem->meType == VALUESETITEM_COLOR ) { - maVirDev.SetFillColor( pItem->maColor ); - maVirDev.DrawRect( aRect ); + maVirDev->SetFillColor( pItem->maColor ); + maVirDev->DrawRect( aRect ); } else { if ( IsColor() ) - maVirDev.SetFillColor( maColor ); + maVirDev->SetFillColor( maColor ); else if ( nStyle & WB_MENUSTYLEVALUESET ) - maVirDev.SetFillColor( rStyleSettings.GetMenuColor() ); + maVirDev->SetFillColor( rStyleSettings.GetMenuColor() ); else if ( IsEnabled() ) - maVirDev.SetFillColor( rStyleSettings.GetWindowColor() ); + maVirDev->SetFillColor( rStyleSettings.GetWindowColor() ); else - maVirDev.SetFillColor( rStyleSettings.GetFaceColor() ); - maVirDev.DrawRect( aRect ); + maVirDev->SetFillColor( rStyleSettings.GetFaceColor() ); + maVirDev->DrawRect( aRect ); if ( pItem->meType == VALUESETITEM_USERDRAW ) { - UserDrawEvent aUDEvt( &maVirDev, aRect, pItem->mnId ); + UserDrawEvent aUDEvt( maVirDev.get(), aRect, pItem->mnId ); UserDraw( aUDEvt ); } else @@ -311,12 +311,12 @@ void ValueSet::ImplFormatItem( ValueSetItem* pItem, Rectangle aRect ) if ( aImageSize.Width() > aRectSize.Width() || aImageSize.Height() > aRectSize.Height() ) { - maVirDev.SetClipRegion( vcl::Region( aRect ) ); - maVirDev.DrawImage( aPos, pItem->maImage, nImageStyle); - maVirDev.SetClipRegion(); + maVirDev->SetClipRegion( vcl::Region( aRect ) ); + maVirDev->DrawImage( aPos, pItem->maImage, nImageStyle); + maVirDev->SetClipRegion(); } else - maVirDev.DrawImage( aPos, pItem->maImage, nImageStyle ); + maVirDev->DrawImage( aPos, pItem->maImage, nImageStyle ); } } @@ -331,7 +331,7 @@ void ValueSet::ImplFormatItem( ValueSetItem* pItem, Rectangle aRect ) if(!aBlendFrame.IsEmpty()) { - maVirDev.DrawBitmapEx(aRect.TopLeft(), aBlendFrame); + maVirDev->DrawBitmapEx(aRect.TopLeft(), aBlendFrame); } } } @@ -490,9 +490,9 @@ void ValueSet::Format() } // Init VirDev - maVirDev.SetSettings( GetSettings() ); - maVirDev.SetBackground( GetBackground() ); - maVirDev.SetOutputSizePixel( aWinSize, true ); + maVirDev->SetSettings( GetSettings() ); + maVirDev->SetBackground( GetBackground() ); + maVirDev->SetOutputSizePixel( aWinSize, true ); // nothing is changed in case of too small items if ( (mnItemWidth <= 0) || @@ -565,7 +565,7 @@ void ValueSet::Format() } // calculate and draw items - maVirDev.SetLineColor(); + maVirDev->SetLineColor(); long x = nStartX; long y = nStartY; @@ -907,7 +907,7 @@ void ValueSet::ImplHideSelect( sal_uInt16 nItemId ) HideFocus(); const Point aPos = aRect.TopLeft(); const Size aSize = aRect.GetSize(); - DrawOutDev( aPos, aSize, aPos, aSize, maVirDev ); + DrawOutDev( aPos, aSize, aPos, aSize, *maVirDev.get() ); } void ValueSet::ImplHighlightItem( sal_uInt16 nItemId, bool bIsSelection ) @@ -937,7 +937,7 @@ void ValueSet::ImplDraw() HideFocus(); Point aDefPos; - Size aSize = maVirDev.GetOutputSizePixel(); + Size aSize = maVirDev->GetOutputSizePixel(); if ( mxScrollBar.get() && mxScrollBar->IsVisible() ) { @@ -946,17 +946,17 @@ void ValueSet::ImplDraw() Point aTempPos( 0, aScrPos.Y() ); Size aTempSize( aSize.Width(), aScrPos.Y() ); - DrawOutDev( aDefPos, aTempSize, aDefPos, aTempSize, maVirDev ); + DrawOutDev( aDefPos, aTempSize, aDefPos, aTempSize, *maVirDev.get() ); aTempSize.Width() = aScrPos.X() - 1; aTempSize.Height() = aScrSize.Height(); - DrawOutDev( aTempPos, aTempSize, aTempPos, aTempSize, maVirDev ); + DrawOutDev( aTempPos, aTempSize, aTempPos, aTempSize, *maVirDev.get() ); aTempPos.Y() = aScrPos.Y() + aScrSize.Height(); aTempSize.Width() = aSize.Width(); aTempSize.Height() = aSize.Height() - aTempPos.Y(); - DrawOutDev( aTempPos, aTempSize, aTempPos, aTempSize, maVirDev ); + DrawOutDev( aTempPos, aTempSize, aTempPos, aTempSize, *maVirDev.get() ); } else - DrawOutDev( aDefPos, aSize, aDefPos, aSize, maVirDev ); + DrawOutDev( aDefPos, aSize, aDefPos, aSize, *maVirDev.get() ); // draw parting line to the Namefield if ( GetStyle() & WB_NAMEFIELD ) @@ -1422,7 +1422,7 @@ void ValueSet::Paint( const Rectangle& ) const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); SetLineColor(); SetFillColor( rStyleSettings.GetFaceColor() ); - long nOffY = maVirDev.GetOutputSizePixel().Height(); + long nOffY = maVirDev->GetOutputSizePixel().Height(); Size aWinSize = GetOutputSizePixel(); DrawRect( Rectangle( Point( 0, nOffY ), Point( aWinSize.Width(), aWinSize.Height() ) ) ); } diff --git a/svtools/source/dialogs/prnsetup.cxx b/svtools/source/dialogs/prnsetup.cxx index 42b78542ca87..d6f35ef39fdd 100644 --- a/svtools/source/dialogs/prnsetup.cxx +++ b/svtools/source/dialogs/prnsetup.cxx @@ -73,7 +73,7 @@ Printer* ImplPrnDlgListBoxSelect( ListBox* pBox, PushButton* pPropBtn, if ( (pTempPrinter->GetName() != pInfo->GetPrinterName()) || (pTempPrinter->GetDriverName() != pInfo->GetDriver()) ) { - delete pTempPrinter; + VclPtr<Printer>(pTempPrinter).disposeAndClear(); pTempPrinter = new Printer( *pInfo ); } } @@ -101,8 +101,7 @@ Printer* ImplPrnDlgUpdatePrinter( Printer* pPrinter, Printer* pTempPrinter ) if ( ! Printer::GetQueueInfo( aPrnName, false ) ) { - if ( pTempPrinter ) - delete pTempPrinter; + VclPtr<Printer>(pTempPrinter).disposeAndClear(); pTempPrinter = new Printer; } @@ -251,8 +250,6 @@ PrinterSetupDialog::~PrinterSetupDialog() void PrinterSetupDialog::dispose() { ImplFreePrnDlgListBox(m_pLbName, false); - delete mpTempPrinter; - mpTempPrinter = NULL; m_pLbName.clear(); m_pBtnProperties.clear(); m_pBtnOptions.clear(); @@ -260,11 +257,11 @@ void PrinterSetupDialog::dispose() m_pFiType.clear(); m_pFiLocation.clear(); m_pFiComment.clear(); + mpTempPrinter.disposeAndClear(); + mpPrinter.clear(); ModalDialog::dispose(); } - - void PrinterSetupDialog::SetOptionsHdl( const Link& rLink ) { m_pBtnOptions->SetClickHdl( rLink ); diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx index a8daae01f1b0..eb7819814dd8 100644 --- a/svtools/source/graphic/grfmgr2.cxx +++ b/svtools/source/graphic/grfmgr2.cxx @@ -1894,19 +1894,19 @@ bool GraphicObject::ImplDrawTiled( OutputDevice* pOut, const Rectangle& rArea, c // First combine very small bitmaps into a larger tile - VirtualDevice aVDev; + ScopedVclPtr<VirtualDevice> aVDev = new VirtualDevice; const int nNumTilesInCacheX( (nTileCacheSize1D + rSizePixel.Width()-1) / rSizePixel.Width() ); const int nNumTilesInCacheY( (nTileCacheSize1D + rSizePixel.Height()-1) / rSizePixel.Height() ); - aVDev.SetOutputSizePixel( Size( nNumTilesInCacheX*rSizePixel.Width(), + aVDev->SetOutputSizePixel( Size( nNumTilesInCacheX*rSizePixel.Width(), nNumTilesInCacheY*rSizePixel.Height() ) ); - aVDev.SetMapMode( aMapMode ); + aVDev->SetMapMode( aMapMode ); // draw bitmap content - if( ImplRenderTempTile( aVDev, SubdivisionExponent, nNumTilesInCacheX, + if( ImplRenderTempTile( *aVDev.get(), SubdivisionExponent, nNumTilesInCacheX, nNumTilesInCacheY, rSizePixel, pAttr, nFlags ) ) { - BitmapEx aTileBitmap( aVDev.GetBitmap( Point(0,0), aVDev.GetOutputSize() ) ); + BitmapEx aTileBitmap( aVDev->GetBitmap( Point(0,0), aVDev->GetOutputSize() ) ); // draw alpha content, if any if( IsTransparent() ) @@ -1918,16 +1918,16 @@ bool GraphicObject::ImplDrawTiled( OutputDevice* pOut, const Rectangle& rArea, c else aAlphaGraphic.SetGraphic( GetGraphic().GetBitmapEx().GetMask() ); - if( aAlphaGraphic.ImplRenderTempTile( aVDev, SubdivisionExponent, nNumTilesInCacheX, + if( aAlphaGraphic.ImplRenderTempTile( *aVDev.get(), SubdivisionExponent, nNumTilesInCacheX, nNumTilesInCacheY, rSizePixel, pAttr, nFlags ) ) { // Combine bitmap and alpha/mask if( GetGraphic().IsAlpha() ) aTileBitmap = BitmapEx( aTileBitmap.GetBitmap(), - AlphaMask( aVDev.GetBitmap( Point(0,0), aVDev.GetOutputSize() ) ) ); + AlphaMask( aVDev->GetBitmap( Point(0,0), aVDev->GetOutputSize() ) ) ); else aTileBitmap = BitmapEx( aTileBitmap.GetBitmap(), - aVDev.GetBitmap( Point(0,0), aVDev.GetOutputSize() ).CreateMask( Color(COL_WHITE) ) ); + aVDev->GetBitmap( Point(0,0), aVDev->GetOutputSize() ).CreateMask( Color(COL_WHITE) ) ); } } diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx index 1229ba122c4c..52e21499cc9d 100644 --- a/svtools/source/graphic/provider.cxx +++ b/svtools/source/graphic/provider.cxx @@ -634,7 +634,7 @@ void ImplApplyFilterData( ::Graphic& rGraphic, uno::Sequence< beans::PropertyVal } else if ( ( rGraphic.GetType() == GRAPHIC_GDIMETAFILE ) && nImageResolution ) { - VirtualDevice aDummyVDev; + ScopedVclPtr<VirtualDevice> aDummyVDev = new VirtualDevice; GDIMetaFile aMtf( rGraphic.GetGDIMetaFile() ); Size aMtfSize( OutputDevice::LogicToLogic( aMtf.GetPrefSize(), aMtf.GetPrefMapMode(), MAP_100TH_MM ) ); if ( aMtfSize.Width() && aMtfSize.Height() ) @@ -642,8 +642,8 @@ void ImplApplyFilterData( ::Graphic& rGraphic, uno::Sequence< beans::PropertyVal MapMode aNewMapMode( MAP_100TH_MM ); aNewMapMode.SetScaleX( static_cast< double >( aLogicalSize.Width ) / static_cast< double >( aMtfSize.Width() ) ); aNewMapMode.SetScaleY( static_cast< double >( aLogicalSize.Height ) / static_cast< double >( aMtfSize.Height() ) ); - aDummyVDev.EnableOutput( false ); - aDummyVDev.SetMapMode( aNewMapMode ); + aDummyVDev->EnableOutput( false ); + aDummyVDev->SetMapMode( aNewMapMode ); for( size_t i = 0, nObjCount = aMtf.GetActionSize(); i < nObjCount; i++ ) { @@ -653,18 +653,18 @@ void ImplApplyFilterData( ::Graphic& rGraphic, uno::Sequence< beans::PropertyVal // only optimizing common bitmap actions: case( META_MAPMODE_ACTION ): { - const_cast< MetaAction* >( pAction )->Execute( &aDummyVDev ); + const_cast< MetaAction* >( pAction )->Execute( aDummyVDev.get() ); break; } case( META_PUSH_ACTION ): { const MetaPushAction* pA = static_cast<const MetaPushAction*>(pAction); - aDummyVDev.Push( pA->GetFlags() ); + aDummyVDev->Push( pA->GetFlags() ); break; } case( META_POP_ACTION ): { - aDummyVDev.Pop(); + aDummyVDev->Pop(); break; } case( META_BMPSCALE_ACTION ): @@ -688,8 +688,8 @@ void ImplApplyFilterData( ::Graphic& rGraphic, uno::Sequence< beans::PropertyVal aSize = pScaleAction->GetSize(); } ::Graphic aGraphic( aBmpEx ); - const Size aSize100thmm( aDummyVDev.LogicToPixel( aSize ) ); - Size aSize100thmm2( aDummyVDev.PixelToLogic( aSize100thmm, MAP_100TH_MM ) ); + const Size aSize100thmm( aDummyVDev->LogicToPixel( aSize ) ); + Size aSize100thmm2( aDummyVDev->PixelToLogic( aSize100thmm, MAP_100TH_MM ) ); ImplApplyBitmapResolution( aGraphic, nImageResolution, aGraphic.GetSizePixel(), awt::Size( aSize100thmm2.Width(), aSize100thmm2.Height() ) ); diff --git a/svtools/source/inc/renderer.hxx b/svtools/source/inc/renderer.hxx index b50088d2e737..ca3417b640f4 100644 --- a/svtools/source/inc/renderer.hxx +++ b/svtools/source/inc/renderer.hxx @@ -70,7 +70,7 @@ private: ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > mxDevice; - OutputDevice* mpOutDev; + VclPtr<OutputDevice> mpOutDev; Rectangle maDestRect; ::com::sun::star::uno::Any maRenderData; }; diff --git a/svtools/source/misc/sampletext.cxx b/svtools/source/misc/sampletext.cxx index 40f5d7d45121..a1cb7a83d111 100644 --- a/svtools/source/misc/sampletext.cxx +++ b/svtools/source/misc/sampletext.cxx @@ -1623,12 +1623,12 @@ OUString makeRepresentativeTextForFont(sal_Int16 nScriptType, const vcl::Font &r { OUString sRet(makeRepresentativeTextForLanguage(rFont.GetLanguage())); - VirtualDevice aDevice; - if (sRet.isEmpty() || (-1 != aDevice.HasGlyphs(rFont, sRet))) + ScopedVclPtr<VirtualDevice> aDevice = new VirtualDevice; + if (sRet.isEmpty() || (-1 != aDevice->HasGlyphs(rFont, sRet))) { - aDevice.SetFont(rFont); + aDevice->SetFont(rFont); vcl::FontCapabilities aFontCapabilities; - if (aDevice.GetFontCapabilities(aFontCapabilities)) + if (aDevice->GetFontCapabilities(aFontCapabilities)) { #if OSL_DEBUG_LEVEL > 2 lcl_dump_unicode_coverage(aFontCapabilities.maUnicodeRange); @@ -1655,7 +1655,7 @@ OUString makeRepresentativeTextForFont(sal_Int16 nScriptType, const vcl::Font &r UScriptCode eScript = getScript(aFontCapabilities); if (nScriptType == com::sun::star::i18n::ScriptType::ASIAN) - eScript = attemptToDisambiguateHan(eScript, aDevice); + eScript = attemptToDisambiguateHan(eScript, *aDevice.get()); sRet = makeRepresentativeTextForScript(eScript); } @@ -1665,10 +1665,10 @@ OUString makeRepresentativeTextForFont(sal_Int16 nScriptType, const vcl::Font &r if (nScriptType == com::sun::star::i18n::ScriptType::COMPLEX) { sRet = makeRepresentativeTextForScript(USCRIPT_HEBREW); - if (-1 != aDevice.HasGlyphs(rFont, sRet)) + if (-1 != aDevice->HasGlyphs(rFont, sRet)) { sRet = makeMinimalTextForScript(USCRIPT_HEBREW); - if (-1 != aDevice.HasGlyphs(rFont, sRet)) + if (-1 != aDevice->HasGlyphs(rFont, sRet)) sRet = makeRepresentativeTextForScript(USCRIPT_ARABIC); } } diff --git a/svtools/source/table/gridtablerenderer.cxx b/svtools/source/table/gridtablerenderer.cxx index e350a2237c12..4f4ad26a4415 100644 --- a/svtools/source/table/gridtablerenderer.cxx +++ b/svtools/source/table/gridtablerenderer.cxx @@ -86,17 +86,17 @@ namespace svt { namespace table Point const aBitmapPos( 0, 0 ); Size const aBitmapSize( nSortIndicatorWidth, nSortIndicatorHeight ); - VirtualDevice aDevice( i_device, 0, 0 ); - aDevice.SetOutputSizePixel( aBitmapSize ); + ScopedVclPtr<VirtualDevice> aDevice = new VirtualDevice( i_device, 0, 0 ); + aDevice->SetOutputSizePixel( aBitmapSize ); - DecorationView aDecoView( &aDevice ); + DecorationView aDecoView( aDevice.get() ); aDecoView.DrawSymbol( Rectangle( aBitmapPos, aBitmapSize ), i_sortAscending ? SymbolType::SPIN_UP : SymbolType::SPIN_DOWN, i_style.GetActiveColor() ); - rBitmap = aDevice.GetBitmapEx( aBitmapPos, aBitmapSize ); + rBitmap = aDevice->GetBitmapEx( aBitmapPos, aBitmapSize ); m_lastHeaderHeight = i_headerHeight; m_lastArrowColor = i_style.GetActiveColor(); } diff --git a/svtools/source/toolpanel/paneltabbar.cxx b/svtools/source/toolpanel/paneltabbar.cxx index 1cb90ccf4973..467793a8b61a 100644 --- a/svtools/source/toolpanel/paneltabbar.cxx +++ b/svtools/source/toolpanel/paneltabbar.cxx @@ -415,7 +415,7 @@ namespace svt TabAlignment m_eTabAlignment; IToolPanelDeck& m_rPanelDeck; - VirtualDevice m_aRenderDevice; + ScopedVclPtr<VirtualDevice> m_aRenderDevice; PTabBarRenderer m_pRenderer; ::boost::optional< size_t > m_aHoveredItem; @@ -499,7 +499,7 @@ namespace svt ,m_aNormalizer() ,m_eTabAlignment( i_eAlignment ) ,m_rPanelDeck( i_rPanelDeck ) - ,m_aRenderDevice( i_rTabBar ) + ,m_aRenderDevice( new VirtualDevice(i_rTabBar) ) ,m_pRenderer() ,m_aHoveredItem() ,m_aFocusedItem() @@ -511,19 +511,19 @@ namespace svt ,m_nScrollPosition( 0 ) { #ifdef WNT - if ( m_aRenderDevice.IsNativeControlSupported( CTRL_TAB_ITEM, PART_ENTIRE_CONTROL ) ) + if ( m_aRenderDevice->IsNativeControlSupported( CTRL_TAB_ITEM, PART_ENTIRE_CONTROL ) ) // this mode requires the NWF framework to be able to render those items onto a virtual // device. For some frameworks (some GTK themes, in particular), this is known to fail. // So, be on the safe side for the moment. m_pRenderer.reset( new NWFTabItemRenderer( m_aRenderDevice ) ); else #endif - if ( m_aRenderDevice.IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) ) - m_pRenderer.reset( new NWFToolboxItemRenderer( m_aRenderDevice ) ); + if ( m_aRenderDevice->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) ) + m_pRenderer.reset( new NWFToolboxItemRenderer( *m_aRenderDevice.get() ) ); else - m_pRenderer.reset( new VCLItemRenderer( m_aRenderDevice ) ); + m_pRenderer.reset( new VCLItemRenderer( *m_aRenderDevice.get() ) ); - m_aRenderDevice.SetLineColor(); + m_aRenderDevice->SetLineColor(); m_rPanelDeck.AddListener( *this ); @@ -710,7 +710,7 @@ namespace svt void PanelTabBar_Impl::CopyFromRenderDevice( const Rectangle& i_rLogicalRect ) const { - BitmapEx aBitmap( m_aRenderDevice.GetBitmapEx( + BitmapEx aBitmap( m_aRenderDevice->GetBitmapEx( i_rLogicalRect.TopLeft(), Size( i_rLogicalRect.GetSize().Width(), @@ -833,7 +833,7 @@ namespace svt const Size aLogicalOutputSize( m_aNormalizer.getReferenceSize() ); // forward actual output size to our render device - m_aRenderDevice.SetOutputSizePixel( aLogicalOutputSize ); + m_aRenderDevice->SetOutputSizePixel( aLogicalOutputSize ); // re-calculate the size of the scroll buttons and of the items m_aGeometry.relayout( aLogicalOutputSize, m_aItems ); @@ -1050,10 +1050,10 @@ namespace svt // background const Rectangle aNormalizedPaintArea( m_pImpl->m_aNormalizer.getNormalized( i_rRect, m_pImpl->m_eTabAlignment ) ); - m_pImpl->m_aRenderDevice.Push( PushFlags::CLIPREGION ); - m_pImpl->m_aRenderDevice.SetClipRegion(vcl::Region(aNormalizedPaintArea)); + m_pImpl->m_aRenderDevice->Push( PushFlags::CLIPREGION ); + m_pImpl->m_aRenderDevice->SetClipRegion(vcl::Region(aNormalizedPaintArea)); m_pImpl->m_pRenderer->renderBackground(); - m_pImpl->m_aRenderDevice.Pop(); + m_pImpl->m_aRenderDevice->Pop(); m_pImpl->CopyFromRenderDevice( aNormalizedPaintArea ); // ensure the items really paint into their own playground only diff --git a/svtools/source/toolpanel/toolpaneldrawer.hxx b/svtools/source/toolpanel/toolpaneldrawer.hxx index 1f66263d0dea..b13a12e34629 100644 --- a/svtools/source/toolpanel/toolpaneldrawer.hxx +++ b/svtools/source/toolpanel/toolpaneldrawer.hxx @@ -97,7 +97,7 @@ namespace svt using Window::Paint; private: - ::std::unique_ptr< VirtualDevice > m_pPaintDevice; + ScopedVclPtr< VirtualDevice > m_pPaintDevice; VclPtr<DrawerVisualization> m_aVisualization; bool m_bFocused; bool m_bExpanded; |