From 215a189e5d35a0423bf26937405993499a8ed987 Mon Sep 17 00:00:00 2001 From: Andrzej Hunt Date: Tue, 22 Sep 2015 14:01:28 +0200 Subject: loplugin:vclwidgets Change-Id: I8edbf71d961067ee565954cbb91ee9e503e3077d --- sc/source/ui/view/viewfunc.cxx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index f04655181e5f..f382f76af572 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -2892,7 +2892,7 @@ void ScViewFunc::NotifyUnitErrorInFormula( const ScAddress& rAddress, ScDocument SfxInfoBarWindow* pInfoBar = pViewFrame->AppendInfoBar( sCellAddress, sTitle ); assert( pInfoBar ); - PushButton* pButtonGotoCell = new PushButton( &pViewFrame->GetWindow(), ScResId(BT_UNITS_EDIT_CELL) ); + VclPtr pButtonGotoCell = VclPtr::Create( &pViewFrame->GetWindow(), ScResId(BT_UNITS_EDIT_CELL) ); pButtonGotoCell->SetClickHdl( LINK( this, ScViewFunc, EditUnitErrorFormulaHandler ) ); pInfoBar->addButton( pButtonGotoCell); } @@ -2979,12 +2979,13 @@ void ScViewFunc::NotifyUnitConversionRecommended( const ScAddress& rCellAddress, assert( pInfoBar ); - UnitConversionPushButton* pButtonConvertCell = new UnitConversionPushButton( &pViewFrame->GetWindow(), - ScResId(BT_UNITS_CONVERT_THIS_CELL), - rCellAddress, - pDoc, - rsHeaderUnit, - rsCellUnit ); + VclPtr pButtonConvertCell = + VclPtr::Create( &pViewFrame->GetWindow(), + ScResId(BT_UNITS_CONVERT_THIS_CELL), + rCellAddress, + pDoc, + rsHeaderUnit, + rsCellUnit ); pButtonConvertCell->SetClickHdl( LINK( this, ScViewFunc, UnitConversionRecommendedHandler ) ); OUString sConvertText = pButtonConvertCell->GetText(); -- cgit