summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-03-19 14:45:20 +0000
committerMichael Meeks <michael.meeks@collabora.com>2015-04-10 12:15:05 +0100
commiteac22a0630bcf3780142f64a022fa432e13bb7e1 (patch)
tree303b3dd00dea373d12198ed3c07b02679e7b8718
parent057347dad41f7df3222cc483fdff83fa631606bb (diff)
Fix OutputDevice members / stack allocation: chart, canvas, cui.
Change-Id: Ieb6f58222ffc3e03c1d599752a6f02600e1bee1f
-rw-r--r--canvas/source/cairo/cairo_textlayout.cxx10
-rw-r--r--canvas/source/opengl/ogl_canvashelper.cxx12
-rw-r--r--canvas/source/vcl/canvasfont.cxx6
-rw-r--r--canvas/source/vcl/canvashelper_texturefill.cxx14
-rw-r--r--canvas/source/vcl/textlayout.cxx26
-rw-r--r--chart2/source/controller/drawinglayer/ViewElementListProvider.cxx6
-rw-r--r--chart2/source/view/main/3DChartObjects.cxx16
-rw-r--r--chart2/source/view/main/DummyXShape.cxx16
-rw-r--r--chart2/source/view/main/OpenGLRender.cxx16
-rw-r--r--cui/source/customize/cfg.cxx32
-rw-r--r--cui/source/tabpages/tpline.cxx6
11 files changed, 80 insertions, 80 deletions
diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx
index f5a197846e72..dd428a17af09 100644
--- a/canvas/source/cairo/cairo_textlayout.cxx
+++ b/canvas/source/cairo/cairo_textlayout.cxx
@@ -179,14 +179,14 @@ namespace cairocanvas
if( !pOutDev )
return geometry::RealRectangle2D();
- VirtualDevice aVDev( *pOutDev );
- aVDev.SetFont( mpFont->getVCLFont() );
+ ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice( *pOutDev ) );
+ pVDev->SetFont( mpFont->getVCLFont() );
// need metrics for Y offset, the XCanvas always renders
// relative to baseline
- const ::FontMetric& aMetric( aVDev.GetFontMetric() );
+ const ::FontMetric& aMetric( pVDev->GetFontMetric() );
- setupLayoutMode( aVDev, mnTextDirection );
+ setupLayoutMode( *pVDev.get(), mnTextDirection );
const sal_Int32 nAboveBaseline( -aMetric.GetIntLeading() - aMetric.GetAscent() );
const sal_Int32 nBelowBaseline( aMetric.GetDescent() );
@@ -200,7 +200,7 @@ namespace cairocanvas
else
{
return geometry::RealRectangle2D( 0, nAboveBaseline,
- aVDev.GetTextWidth(
+ pVDev->GetTextWidth(
maText.Text,
::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
::canvas::tools::numeric_cast<sal_uInt16>(maText.Length) ),
diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx
index f6d641f8bb2b..6a75c8f9144c 100644
--- a/canvas/source/opengl/ogl_canvashelper.cxx
+++ b/canvas/source/opengl/ogl_canvashelper.cxx
@@ -725,8 +725,8 @@ namespace oglcanvas
if( mpDevice )
{
- VirtualDevice aVDev;
- aVDev.EnableOutput(false);
+ ScopedVclPtr<VirtualDevice> pVDev(new VirtualDevice());
+ pVDev->EnableOutput(false);
CanvasFont* pFont=dynamic_cast<CanvasFont*>(xLayoutetText->getFont().get());
const rendering::StringContext& rTxt=xLayoutetText->getText();
@@ -749,7 +749,7 @@ namespace oglcanvas
// adjust to stretched font
if(!::rtl::math::approxEqual(rFontMatrix.m00, rFontMatrix.m11))
{
- const Size aSize = aVDev.GetFontMetric( aFont ).GetSize();
+ const Size aSize = pVDev->GetFontMetric( aFont ).GetSize();
const double fDividend( rFontMatrix.m10 + rFontMatrix.m11 );
double fStretch = (rFontMatrix.m00 + rFontMatrix.m01);
@@ -762,7 +762,7 @@ namespace oglcanvas
}
// set font
- aVDev.SetFont(aFont);
+ pVDev->SetFont(aFont);
mpRecordedActions->push_back( Action() );
Action& rAct=mpRecordedActions->back();
@@ -780,7 +780,7 @@ namespace oglcanvas
pDXArray[i] = basegfx::fround( aLogicalAdvancements[i] );
// get the glyphs
- aVDev.GetTextOutlines(rAct.maPolyPolys,
+ pVDev->GetTextOutlines(rAct.maPolyPolys,
rTxt.Text,
0,
rTxt.StartPosition,
@@ -792,7 +792,7 @@ namespace oglcanvas
else
{
// get the glyphs
- aVDev.GetTextOutlines(rAct.maPolyPolys,
+ pVDev->GetTextOutlines(rAct.maPolyPolys,
rTxt.Text,
0,
rTxt.StartPosition,
diff --git a/canvas/source/vcl/canvasfont.cxx b/canvas/source/vcl/canvasfont.cxx
index a7e6f48b9306..8930748af984 100644
--- a/canvas/source/vcl/canvasfont.cxx
+++ b/canvas/source/vcl/canvasfont.cxx
@@ -121,9 +121,9 @@ namespace vclcanvas
SolarMutexGuard aGuard;
OutputDevice& rOutDev = mpOutDevProvider->getOutDev();
- VirtualDevice aVDev( rOutDev );
- aVDev.SetFont(getVCLFont());
- const ::FontMetric& aMetric( aVDev.GetFontMetric() );
+ ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice( rOutDev ) );
+ pVDev->SetFont(getVCLFont());
+ const ::FontMetric& aMetric( pVDev->GetFontMetric() );
return rendering::FontMetrics(
aMetric.GetAscent(),
diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx
index f57e49812acc..ea7889042465 100644
--- a/canvas/source/vcl/canvashelper_texturefill.cxx
+++ b/canvas/source/vcl/canvashelper_texturefill.cxx
@@ -1026,8 +1026,8 @@ namespace vclcanvas
// cannot do direct XOR, but have to
// prepare the filled polygon within a
// VDev
- VirtualDevice aVDev( rOutDev );
- aVDev.SetOutputSizePixel( aPolygonDeviceRect.GetSize() );
+ ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice( rOutDev ) );
+ pVDev->SetOutputSizePixel( aPolygonDeviceRect.GetSize() );
// shift output to origin of VDev
const ::Point aOutPos( aPt - aPolygonDeviceRect.TopLeft() );
@@ -1036,8 +1036,8 @@ namespace vclcanvas
const vcl::Region aPolyClipRegion( aPolyPoly );
- aVDev.SetClipRegion( aPolyClipRegion );
- textureFill( aVDev,
+ pVDev->SetClipRegion( aPolyClipRegion );
+ textureFill( *pVDev.get(),
*pGrfObj,
aOutPos,
aIntegerNextTileX,
@@ -1051,12 +1051,12 @@ namespace vclcanvas
// target position.
const ::Point aEmptyPoint;
Bitmap aContentBmp(
- aVDev.GetBitmap( aEmptyPoint,
- aVDev.GetOutputSizePixel() ) );
+ pVDev->GetBitmap( aEmptyPoint,
+ pVDev->GetOutputSizePixel() ) );
sal_uInt8 nCol( static_cast< sal_uInt8 >(
::basegfx::fround( 255.0*( 1.0 - textures[0].Alpha ) ) ) );
- AlphaMask aAlpha( aVDev.GetOutputSizePixel(),
+ AlphaMask aAlpha( pVDev->GetOutputSizePixel(),
&nCol );
BitmapEx aOutputBmpEx( aContentBmp, aAlpha );
diff --git a/canvas/source/vcl/textlayout.cxx b/canvas/source/vcl/textlayout.cxx
index d64f7dfa7fb7..c3efe7745053 100644
--- a/canvas/source/vcl/textlayout.cxx
+++ b/canvas/source/vcl/textlayout.cxx
@@ -104,10 +104,10 @@ namespace vclcanvas
SolarMutexGuard aGuard;
OutputDevice& rOutDev = mpOutDevProvider->getOutDev();
- VirtualDevice aVDev( rOutDev );
- aVDev.SetFont( mpFont->getVCLFont() );
+ ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice( rOutDev ) );
+ pVDev->SetFont( mpFont->getVCLFont() );
- setupLayoutMode( aVDev, mnTextDirection );
+ setupLayoutMode( *pVDev.get(), mnTextDirection );
const rendering::ViewState aViewState(
geometry::AffineMatrix2D(1,0,0, 0,1,0),
@@ -124,7 +124,7 @@ namespace vclcanvas
uno::Sequence< uno::Reference< rendering::XPolyPolygon2D> > aOutlineSequence;
::basegfx::B2DPolyPolygonVector aOutlines;
- if (aVDev.GetTextOutlines(
+ if (pVDev->GetTextOutlines(
aOutlines,
maText.Text,
maText.StartPosition,
@@ -157,10 +157,10 @@ namespace vclcanvas
OutputDevice& rOutDev = mpOutDevProvider->getOutDev();
- VirtualDevice aVDev( rOutDev );
- aVDev.SetFont( mpFont->getVCLFont() );
+ ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice( rOutDev ) );
+ pVDev->SetFont( mpFont->getVCLFont() );
- setupLayoutMode( aVDev, mnTextDirection );
+ setupLayoutMode( *pVDev.get(), mnTextDirection );
const rendering::ViewState aViewState(
geometry::AffineMatrix2D(1,0,0, 0,1,0),
@@ -177,7 +177,7 @@ namespace vclcanvas
MetricVector aMetricVector;
uno::Sequence<geometry::RealRectangle2D> aBoundingBoxes;
- if (aVDev.GetGlyphBoundRects(
+ if (pVDev->GetGlyphBoundRects(
Point(0,0),
maText.Text,
::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
@@ -237,14 +237,14 @@ namespace vclcanvas
OutputDevice& rOutDev = mpOutDevProvider->getOutDev();
- VirtualDevice aVDev( rOutDev );
- aVDev.SetFont( mpFont->getVCLFont() );
+ ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice( rOutDev ) );
+ pVDev->SetFont( mpFont->getVCLFont() );
// need metrics for Y offset, the XCanvas always renders
// relative to baseline
- const ::FontMetric& aMetric( aVDev.GetFontMetric() );
+ const ::FontMetric& aMetric( pVDev->GetFontMetric() );
- setupLayoutMode( aVDev, mnTextDirection );
+ setupLayoutMode( *pVDev.get(), mnTextDirection );
const sal_Int32 nAboveBaseline( /*-aMetric.GetIntLeading()*/ - aMetric.GetAscent() );
const sal_Int32 nBelowBaseline( aMetric.GetDescent() );
@@ -258,7 +258,7 @@ namespace vclcanvas
else
{
return geometry::RealRectangle2D( 0, nAboveBaseline,
- aVDev.GetTextWidth(
+ pVDev->GetTextWidth(
maText.Text,
::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
::canvas::tools::numeric_cast<sal_uInt16>(maText.Length) ),
diff --git a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
index f304034e85c6..e8e7a38df7a9 100644
--- a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
+++ b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
@@ -143,14 +143,14 @@ Graphic ViewElementListProvider::GetSymbolGraphic( sal_Int32 nStandardSymbol, co
nStandardSymbol %= pSymbolList->GetObjCount();
SdrObject* pObj = pSymbolList->GetObj(nStandardSymbol);
- VirtualDevice aVDev;
- aVDev.SetMapMode(MapMode(MAP_100TH_MM));
+ ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ pVDev->SetMapMode(MapMode(MAP_100TH_MM));
SdrModel* pModel = new SdrModel();
pModel->GetItemPool().FreezeIdRanges();
SdrPage* pPage = new SdrPage( *pModel, false );
pPage->SetSize(Size(1000,1000));
pModel->InsertPage( pPage, 0 );
- SdrView* pView = new SdrView( pModel, &aVDev );
+ SdrView* pView = new SdrView( pModel, pVDev );
pView->hideMarkHandles();
SdrPageView* pPageView = pView->ShowSdrPage(pPage);
diff --git a/chart2/source/view/main/3DChartObjects.cxx b/chart2/source/view/main/3DChartObjects.cxx
index 7bf6966ee258..55d04cde114e 100644
--- a/chart2/source/view/main/3DChartObjects.cxx
+++ b/chart2/source/view/main/3DChartObjects.cxx
@@ -76,26 +76,26 @@ const TextCacheItem& TextCache::getText(OUString const & rText, bool bIs3dText)
if(itr != maTextCache.end())
return *itr->second;
- VirtualDevice aDevice(*Application::GetDefaultDevice(), 0, 0);
+ ScopedVclPtr<VirtualDevice> pDevice(new VirtualDevice(*Application::GetDefaultDevice(), 0, 0));
vcl::Font aFont;
if(bIs3dText)
aFont = vcl::Font("Brillante St",Size(0,0));
else
- aFont = aDevice.GetFont();
+ aFont = pDevice->GetFont();
aFont.SetSize(Size(0, 96));
static bool bOldRender = getenv("OLDRENDER");
if (bOldRender)
aFont.SetColor(COL_BLACK);
else
aFont.SetColor(COL_GREEN); // RGB_COLORDATA(0xf0, 0xf0, 0xf0));
- aDevice.SetFont(aFont);
- aDevice.Erase();
+ pDevice->SetFont(aFont);
+ pDevice->Erase();
- aDevice.SetOutputSize(Size(aDevice.GetTextWidth(rText), aDevice.GetTextHeight()));
- aDevice.SetBackground(Wallpaper(COL_TRANSPARENT));
- aDevice.DrawText(Point(0,0), rText);
+ pDevice->SetOutputSize(Size(pDevice->GetTextWidth(rText), pDevice->GetTextHeight()));
+ pDevice->SetBackground(Wallpaper(COL_TRANSPARENT));
+ pDevice->DrawText(Point(0,0), rText);
- BitmapEx aText(aDevice.GetBitmapEx(Point(0,0), aDevice.GetOutputSize()));
+ BitmapEx aText(pDevice->GetBitmapEx(Point(0,0), pDevice->GetOutputSize()));
// TextCacheItem *pItem = new TextCacheItem(OpenGLHelper::ConvertBitmapExToRGBABuffer(aText), aText.GetSizePixel());
Bitmap aBitmap (aText.GetBitmap());
BitmapReadAccess *pAcc = aBitmap.AcquireReadAccess();
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index b6f6237aa3c8..6701de177a8f 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -836,19 +836,19 @@ DummyText::DummyText(const OUString& rText, const tNameSequence& rNames,
{
vcl::Font aFont;
std::for_each(maProperties.begin(), maProperties.end(), FontAttribSetter(aFont));
- VirtualDevice aDevice(*Application::GetDefaultDevice(), 0, 0);
- aDevice.Erase();
+ ScopedVclPtr<VirtualDevice> pDevice(new VirtualDevice(*Application::GetDefaultDevice(), 0, 0));
+ pDevice->Erase();
Rectangle aRect;
- aDevice.SetFont(aFont);
- aDevice.GetTextBoundRect(aRect, rText);
+ pDevice->SetFont(aFont);
+ pDevice->GetTextBoundRect(aRect, rText);
int screenWidth = (aRect.BottomRight().X());
int screenHeight = (aRect.BottomRight().Y());
- aDevice.SetOutputSizePixel(Size(screenWidth * 3, screenHeight));
- aDevice.SetBackground(Wallpaper(COL_TRANSPARENT));
- aDevice.DrawText(Point(0, 0), rText);
+ pDevice->SetOutputSizePixel(Size(screenWidth * 3, screenHeight));
+ pDevice->SetBackground(Wallpaper(COL_TRANSPARENT));
+ pDevice->DrawText(Point(0, 0), rText);
bmpWidth = aRect.Right() - aRect.Left();
bmpHeight = aRect.Bottom() - aRect.Top();
- maBitmap = BitmapEx(aDevice.GetBitmapEx(aRect.TopLeft(), Size(bmpWidth, bmpHeight)));
+ maBitmap = BitmapEx(pDevice->GetBitmapEx(aRect.TopLeft(), Size(bmpWidth, bmpHeight)));
rCache.insertBitmap(aKey, maBitmap);
}
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 19f6f933a677..0dbecc1af829 100644
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -625,19 +625,19 @@ int OpenGLRender::RenderRectangleShape(bool bBorder, bool bFill)
int OpenGLRender::CreateTextTexture(::rtl::OUString const &textValue, vcl::Font aFont, long , awt::Point aPos, awt::Size aSize, long rotation)
{
- VirtualDevice aDevice(*Application::GetDefaultDevice(), 0, 0);
- aDevice.Erase();
+ ScopedVclPtr<VirtualDevice> pDevice(new VirtualDevice(*Application::GetDefaultDevice(), 0, 0));
+ pDevice->Erase();
Rectangle aRect;
- aDevice.SetFont(aFont);
- aDevice.GetTextBoundRect(aRect, textValue);
+ pDevice->SetFont(aFont);
+ pDevice->GetTextBoundRect(aRect, textValue);
int screenWidth = (aRect.BottomRight().X() + 3) & ~3;
int screenHeight = (aRect.BottomRight().Y() + 3) & ~3;
- aDevice.SetOutputSizePixel(Size(screenWidth * 3, screenHeight));
- aDevice.SetBackground(Wallpaper(COL_TRANSPARENT));
- aDevice.DrawText(Point(0, 0), textValue);
+ pDevice->SetOutputSizePixel(Size(screenWidth * 3, screenHeight));
+ pDevice->SetBackground(Wallpaper(COL_TRANSPARENT));
+ pDevice->DrawText(Point(0, 0), textValue);
int bmpWidth = (aRect.Right() - aRect.Left() + 3) & ~3;
int bmpHeight = (aRect.Bottom() - aRect.Top() + 3) & ~3;
- BitmapEx aBitmap = BitmapEx(aDevice.GetBitmapEx(aRect.TopLeft(), Size(bmpWidth, bmpHeight)));
+ BitmapEx aBitmap = BitmapEx(pDevice->GetBitmapEx(aRect.TopLeft(), Size(bmpWidth, bmpHeight)));
sal_Int32 nXPos = aPos.X;
sal_Int32 nYPos = aPos.Y;
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index de47eaa2744b..6d2ff70cd74a 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -4593,28 +4593,28 @@ void SvxToolbarEntriesListBox::BuildCheckBoxButtonImages( SvLBoxButtonData* pDat
// in all color modes, like high contrast.
const AllSettings& rSettings = Application::GetSettings();
- VirtualDevice aDev;
+ ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
Size aSize( 26, 20 );
- aDev.SetOutputSizePixel( aSize );
+ pVDev->SetOutputSizePixel( aSize );
- Image aImage = GetSizedImage( aDev, aSize,
+ Image aImage = GetSizedImage( *pVDev.get(), aSize,
CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_DEFAULT ));
// Fill button data struct with new images
pData->SetImage(SvBmp::UNCHECKED, aImage);
- pData->SetImage(SvBmp::CHECKED, GetSizedImage( aDev, aSize, CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_CHECKED )) );
- pData->SetImage(SvBmp::HICHECKED, GetSizedImage( aDev, aSize, CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_CHECKED | BUTTON_DRAW_PRESSED )) );
- pData->SetImage(SvBmp::HIUNCHECKED, GetSizedImage( aDev, aSize, CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_DEFAULT | BUTTON_DRAW_PRESSED)) );
- pData->SetImage(SvBmp::TRISTATE, GetSizedImage( aDev, aSize, Image() ) ); // Use tristate bitmaps to have no checkbox for separator entries
- pData->SetImage(SvBmp::HITRISTATE, GetSizedImage( aDev, aSize, Image() ) );
+ pData->SetImage(SvBmp::CHECKED, GetSizedImage( *pVDev.get(), aSize, CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_CHECKED )) );
+ pData->SetImage(SvBmp::HICHECKED, GetSizedImage( *pVDev.get(), aSize, CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_CHECKED | BUTTON_DRAW_PRESSED )) );
+ pData->SetImage(SvBmp::HIUNCHECKED, GetSizedImage( *pVDev.get(), aSize, CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_DEFAULT | BUTTON_DRAW_PRESSED)) );
+ pData->SetImage(SvBmp::TRISTATE, GetSizedImage( *pVDev.get(), aSize, Image() ) ); // Use tristate bitmaps to have no checkbox for separator entries
+ pData->SetImage(SvBmp::HITRISTATE, GetSizedImage( *pVDev.get(), aSize, Image() ) );
// Get image size
m_aCheckBoxImageSizePixel = aImage.GetSizePixel();
}
Image SvxToolbarEntriesListBox::GetSizedImage(
- VirtualDevice& aDev, const Size& aNewSize, const Image& aImage )
+ VirtualDevice& rVDev, const Size& aNewSize, const Image& aImage )
{
// Create new checkbox images for treelistbox. They must have a
// decent width to have a clear column for the visibility checkbox.
@@ -4628,18 +4628,18 @@ Image SvxToolbarEntriesListBox::GetSizedImage(
sal_uInt16 nPosX = std::max( (sal_uInt16) (((( aNewSize.Width() - 2 ) - aImage.GetSizePixel().Width() ) / 2 ) - 1), (sal_uInt16) 0 );
sal_uInt16 nPosY = std::max( (sal_uInt16) (((( aNewSize.Height() - 2 ) - aImage.GetSizePixel().Height() ) / 2 ) + 1), (sal_uInt16) 0 );
Point aPos( nPosX > 0 ? nPosX : 0, nPosY > 0 ? nPosY : 0 );
- aDev.SetFillColor( aFillColor );
- aDev.SetLineColor( aFillColor );
- aDev.DrawRect( Rectangle( Point(), aNewSize ));
- aDev.DrawImage( aPos, aImage );
+ rVDev.SetFillColor( aFillColor );
+ rVDev.SetLineColor( aFillColor );
+ rVDev.DrawRect( Rectangle( Point(), aNewSize ));
+ rVDev.DrawImage( aPos, aImage );
// Draw separator line 2 pixels left from the right border
Color aLineColor = GetDisplayBackground().GetColor().IsDark() ? Color( COL_WHITE ) : Color( COL_BLACK );
- aDev.SetLineColor( aLineColor );
- aDev.DrawLine( Point( aNewSize.Width()-3, 0 ), Point( aNewSize.Width()-3, aNewSize.Height()-1 ));
+ rVDev.SetLineColor( aLineColor );
+ rVDev.DrawLine( Point( aNewSize.Width()-3, 0 ), Point( aNewSize.Width()-3, aNewSize.Height()-1 ));
// Create new image that uses the fillcolor as transparent
- return Image( aDev.GetBitmap( Point(), aNewSize ), aFillColor );
+ return Image( rVDev.GetBitmap( Point(), aNewSize ), aFillColor );
}
void SvxToolbarEntriesListBox::DataChanged( const DataChangedEvent& rDCEvt )
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index 26e5c4422911..a57242982ca6 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -1155,8 +1155,8 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
}
else if(nSymType >= 0)
{
- VirtualDevice aVDev;
- aVDev.SetMapMode(MapMode(MAP_100TH_MM));
+ ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ pVDev->SetMapMode(MapMode(MAP_100TH_MM));
boost::scoped_ptr<SdrModel> pModel(new SdrModel);
pModel->GetItemPool().FreezeIdRanges();
@@ -1164,7 +1164,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
pPage->SetSize(Size(1000,1000));
pModel->InsertPage( pPage, 0 );
{
- boost::scoped_ptr<SdrView> pView(new SdrView( pModel.get(), &aVDev ));
+ boost::scoped_ptr<SdrView> pView(new SdrView( pModel.get(), pVDev ));
pView->hideMarkHandles();
pView->ShowSdrPage(pPage);
SdrObject *pObj=NULL;