summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-09-21 13:37:17 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-09-21 19:34:16 +0000
commit599fab44ad2ca626f046b9e9e4924110950a897c (patch)
tree4304f1e7f0ab68f88b105f5779b8ec619e176c12
parentda4c217ac49ff05e352c0e6e46a46a4e9a0b78cc (diff)
hide ScopedPtr::reset and add disposeAndClear
Change-Id: I55d6e789abd408b8478a2b9ae141d8899af2c309 Reviewed-on: https://gerrit.libreoffice.org/18745 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--basctl/source/basicide/basdoc.cxx5
-rw-r--r--cui/source/options/treeopt.cxx6
-rw-r--r--cui/source/tabpages/tpbitmap.cxx8
-rw-r--r--cui/source/tabpages/tpcolor.cxx4
-rw-r--r--cui/source/tabpages/tpgradnt.cxx4
-rw-r--r--cui/source/tabpages/tphatch.cxx4
-rw-r--r--filter/source/graphicfilter/eos2met/eos2met.cxx3
-rw-r--r--framework/source/uielement/fontsizemenucontroller.cxx2
-rw-r--r--include/vcl/vclptr.hxx13
-rw-r--r--sc/source/ui/docshell/docsh4.cxx2
-rw-r--r--sc/source/ui/view/gridwin4.cxx2
-rw-r--r--sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx2
-rw-r--r--sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx4
-rw-r--r--svtools/source/control/tabbar.cxx14
-rw-r--r--svtools/source/dialogs/roadmapwizard.cxx2
-rw-r--r--svtools/source/toolpanel/toolpaneldrawer.cxx2
-rw-r--r--svx/source/dialog/docrecovery.cxx6
-rw-r--r--sw/source/ui/dbui/customizeaddresslistdialog.cxx4
-rw-r--r--vcl/source/gdi/pdfwriter_impl2.cxx2
19 files changed, 49 insertions, 40 deletions
diff --git a/basctl/source/basicide/basdoc.cxx b/basctl/source/basicide/basdoc.cxx
index 1c878d826cc4..b969c27e382f 100644
--- a/basctl/source/basicide/basdoc.cxx
+++ b/basctl/source/basicide/basdoc.cxx
@@ -58,7 +58,7 @@ DocShell::~DocShell()
SfxPrinter* DocShell::GetPrinter( bool bCreate )
{
if ( !pPrinter && bCreate )
- pPrinter.reset(VclPtr<SfxPrinter>::Create(new SfxItemSet(
+ pPrinter.disposeAndReset(VclPtr<SfxPrinter>::Create(new SfxItemSet(
GetPool(), SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN
)));
@@ -69,8 +69,7 @@ void DocShell::SetPrinter( SfxPrinter* pPr )
{
if (pPr != pPrinter.get())
{
- pPrinter.disposeAndClear();
- pPrinter.reset(pPr);
+ pPrinter.disposeAndReset(pPr);
}
}
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 1495984f4ea8..e18be0f9cdbe 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -1045,17 +1045,17 @@ void OfaTreeOptionsDialog::SelectHdl_Impl()
if(pPageInfo->m_nPageId == RID_SVXPAGE_COLOR)
{
- pPageInfo->m_pPage.reset( ::CreateGeneralTabPage(
+ pPageInfo->m_pPage.disposeAndReset( ::CreateGeneralTabPage(
pPageInfo->m_nPageId, pTabBox, *pColorPageItemSet ) );
mpColorPage = static_cast<SvxColorTabPage*>(pPageInfo->m_pPage.get());
mpColorPage->SetupForViewFrame( SfxViewFrame::Current() );
}
else
{
- pPageInfo->m_pPage.reset( ::CreateGeneralTabPage(pPageInfo->m_nPageId, pTabBox, *pGroupInfo->m_pInItemSet ) );
+ pPageInfo->m_pPage.disposeAndReset( ::CreateGeneralTabPage(pPageInfo->m_nPageId, pTabBox, *pGroupInfo->m_pInItemSet ) );
if(!pPageInfo->m_pPage && pGroupInfo->m_pModule)
- pPageInfo->m_pPage.reset( pGroupInfo->m_pModule->CreateTabPage(pPageInfo->m_nPageId, pTabBox, *pGroupInfo->m_pInItemSet) );
+ pPageInfo->m_pPage.disposeAndReset( pGroupInfo->m_pModule->CreateTabPage(pPageInfo->m_nPageId, pTabBox, *pGroupInfo->m_pInItemSet) );
}
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index 462e9abf9fff..22fa3d32056e 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -528,7 +528,7 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickAddHdl_Impl, Button*, void)
if( !pWarnBox )
{
- pWarnBox.reset(VclPtr<MessageDialog>::Create( GetParentDialog()
+ pWarnBox.disposeAndReset(VclPtr<MessageDialog>::Create( GetParentDialog()
,"DuplicateNameDialog"
,"cui/ui/queryduplicatedialog.ui"));
}
@@ -538,7 +538,7 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickAddHdl_Impl, Button*, void)
}
pDlg.reset();
- pWarnBox.reset();
+ pWarnBox.disposeAndClear();
if( !nError )
{
@@ -636,7 +636,7 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickImportHdl_Impl, Button*, void)
if( !pWarnBox )
{
- pWarnBox.reset(VclPtr<MessageDialog>::Create( GetParentDialog()
+ pWarnBox.disposeAndReset(VclPtr<MessageDialog>::Create( GetParentDialog()
,"DuplicateNameDialog"
,"cui/ui/queryduplicatedialog.ui"));
}
@@ -646,7 +646,7 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickImportHdl_Impl, Button*, void)
}
pDlg.reset();
- pWarnBox.reset();
+ pWarnBox.disposeAndClear();
if( !nError )
{
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 53c04b00966d..be9c42beba58 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -736,7 +736,7 @@ IMPL_LINK_NOARG_TYPED(SvxColorTabPage, ClickAddHdl_Impl, Button*, void)
if( !pWarnBox )
{
- pWarnBox.reset(VclPtr<MessageDialog>::Create( GetParentDialog()
+ pWarnBox.disposeAndReset(VclPtr<MessageDialog>::Create( GetParentDialog()
,"DuplicateNameDialog"
,"cui/ui/queryduplicatedialog.ui"));
}
@@ -746,7 +746,7 @@ IMPL_LINK_NOARG_TYPED(SvxColorTabPage, ClickAddHdl_Impl, Button*, void)
}
pDlg.reset();
- pWarnBox.reset();
+ pWarnBox.disposeAndClear();
if (!nError)
{
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index 0396464d6fca..7bf1bdb2dc7a 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -476,7 +476,7 @@ IMPL_LINK_NOARG_TYPED(SvxGradientTabPage, ClickAddHdl_Impl, Button*, void)
if( !pWarnBox )
{
- pWarnBox.reset(VclPtr<MessageDialog>::Create( GetParentDialog()
+ pWarnBox.disposeAndReset(VclPtr<MessageDialog>::Create( GetParentDialog()
,"DuplicateNameDialog"
,"cui/ui/queryduplicatedialog.ui"));
}
@@ -485,7 +485,7 @@ IMPL_LINK_NOARG_TYPED(SvxGradientTabPage, ClickAddHdl_Impl, Button*, void)
break;
}
pDlg.reset();
- pWarnBox.reset();
+ pWarnBox.disposeAndClear();
if( !nError )
{
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index cbe50521cd09..d528bd85dc93 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -518,7 +518,7 @@ IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ClickAddHdl_Impl, Button*, void)
if( !pWarnBox )
{
- pWarnBox.reset(VclPtr<MessageDialog>::Create( GetParentDialog()
+ pWarnBox.disposeAndReset(VclPtr<MessageDialog>::Create( GetParentDialog()
,"DuplicateNameDialog"
,"cui/ui/queryduplicatedialog.ui"));
}
@@ -527,7 +527,7 @@ IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ClickAddHdl_Impl, Button*, void)
break;
}
pDlg.reset();
- pWarnBox.reset();
+ pWarnBox.disposeAndClear();
if( !nError )
{
diff --git a/filter/source/graphicfilter/eos2met/eos2met.cxx b/filter/source/graphicfilter/eos2met/eos2met.cxx
index 35561956899b..a65a4cc79011 100644
--- a/filter/source/graphicfilter/eos2met/eos2met.cxx
+++ b/filter/source/graphicfilter/eos2met/eos2met.cxx
@@ -261,8 +261,7 @@ public:
pCompDev = reinterpret_cast< OutputDevice* >( Application::GetAppWindow() );
if( !pCompDev )
{
- apDummyVDev.disposeAndClear();
- apDummyVDev.reset( VclPtr<VirtualDevice>::Create() );
+ apDummyVDev.disposeAndReset(VclPtr<VirtualDevice>::Create());
pCompDev = apDummyVDev.get();
}
}
diff --git a/framework/source/uielement/fontsizemenucontroller.cxx b/framework/source/uielement/fontsizemenucontroller.cxx
index 3c6d941b301c..ec5cfa8a12f7 100644
--- a/framework/source/uielement/fontsizemenucontroller.cxx
+++ b/framework/source/uielement/fontsizemenucontroller.cxx
@@ -144,7 +144,7 @@ void FontSizeMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r
aPrinterName = retrievePrinterName( m_xFrame );
if ( !aPrinterName.isEmpty() )
{
- pInfoPrinter.reset(VclPtr<Printer>::Create( aPrinterName ));
+ pInfoPrinter.disposeAndReset(VclPtr<Printer>::Create( aPrinterName ));
if ( pInfoPrinter && pInfoPrinter->GetDevFontCount() > 0 )
pFontList.reset(new FontList( pInfoPrinter.get() ));
}
diff --git a/include/vcl/vclptr.hxx b/include/vcl/vclptr.hxx
index 6618ec20ae87..2614886e9723 100644
--- a/include/vcl/vclptr.hxx
+++ b/include/vcl/vclptr.hxx
@@ -313,10 +313,18 @@ public:
/**
Assignment that releases the last reference.
*/
- inline ScopedVclPtr<reference_type>& operator= (reference_type * pBody)
+ inline void disposeAndReset(reference_type *pBody)
{
VclPtr<reference_type>::disposeAndClear();
VclPtr<reference_type>::set(pBody);
+ }
+
+ /**
+ Assignment that releases the last reference.
+ */
+ inline ScopedVclPtr<reference_type>& operator= (reference_type * pBody)
+ {
+ disposeAndReset(pBody);
return *this;
}
@@ -347,6 +355,9 @@ private:
ScopedVclPtr (const ScopedVclPtr<reference_type> &) SAL_DELETED_FUNCTION;
// And certainly we don't want a default assignment operator.
ScopedVclPtr<reference_type>& operator= (const ScopedVclPtr<reference_type> &) SAL_DELETED_FUNCTION;
+ // And disallow reset as that doesn't call disposeAndClear on the original reference
+ void reset() SAL_DELETED_FUNCTION;
+ void reset(reference_type *pBody) SAL_DELETED_FUNCTION;
protected:
inline ScopedVclPtr (reference_type * pBody, __sal_NoAcquire)
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 1b74471c2cdc..a38c85f6f406 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1153,7 +1153,7 @@ bool ScDocShell::ExecuteChangeProtectionDialog( vcl::Window* _pParent, bool bJus
pDlg->ShowExtras( SfxShowExtras::CONFIRM );
if ( pDlg->Execute() == RET_OK )
aPassword = pDlg->GetPassword();
- pDlg.reset();
+ pDlg.disposeAndClear();
if (!aPassword.isEmpty())
{
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 6faf516234ff..72c6202e32e2 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -496,7 +496,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
// #i45033# For OLE inplace editing with different zoom factors,
// use a virtual device with 1/100th mm as text formatting reference
- xFmtVirtDev.reset( VclPtr<VirtualDevice>::Create() );
+ xFmtVirtDev.disposeAndReset( VclPtr<VirtualDevice>::Create() );
xFmtVirtDev->SetMapMode( MAP_100TH_MM );
aOutputData.SetFmtDevice( xFmtVirtDev.get() );
diff --git a/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx b/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx
index f385ae549ff0..697b8d478b46 100644
--- a/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx
+++ b/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx
@@ -388,7 +388,7 @@ void Layer::Initialize (sd::Window *pTargetWindow)
#else
if ( ! mpLayerDevice)
{
- mpLayerDevice.reset(VclPtr<VirtualDevice>::Create(*pTargetWindow));
+ mpLayerDevice.disposeAndReset(VclPtr<VirtualDevice>::Create(*pTargetWindow));
mpLayerDevice->SetOutputSizePixel(pTargetWindow->GetSizePixel());
}
#endif
diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
index 91b7e8ef3346..a2c8e4643eba 100644
--- a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
+++ b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
@@ -162,9 +162,9 @@ Bitmap PageObjectPainter::CreateMarkedPreview (
{
ScopedVclPtr<VirtualDevice> pDevice;
if (pReferenceDevice != NULL)
- pDevice.reset(VclPtr<VirtualDevice>::Create(*pReferenceDevice));
+ pDevice.disposeAndReset(VclPtr<VirtualDevice>::Create(*pReferenceDevice));
else
- pDevice.reset(VclPtr<VirtualDevice>::Create());
+ pDevice.disposeAndReset(VclPtr<VirtualDevice>::Create());
pDevice->SetOutputSizePixel(rSize);
pDevice->DrawBitmap(Point(0,0), rSize, rPreview);
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index 04a048915ec4..1a9cceeb732e 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -809,7 +809,7 @@ void TabBar::ImplInitControls()
{
if (!mpImpl->mpSizer)
{
- mpImpl->mpSizer.reset(VclPtr<ImplTabSizer>::Create( this, mnWinStyle & (WB_DRAG | WB_3DLOOK)));
+ mpImpl->mpSizer.disposeAndReset(VclPtr<ImplTabSizer>::Create( this, mnWinStyle & (WB_DRAG | WB_3DLOOK)));
}
mpImpl->mpSizer->Show();
}
@@ -821,7 +821,7 @@ void TabBar::ImplInitControls()
if ((mnWinStyle & WB_INSERTTAB) && !mpImpl->mpAddButton)
{
Link<Button*,void> aLink = LINK(this, TabBar, ImplAddClickHandler);
- mpImpl->mpAddButton.reset(VclPtr<ImplTabButton>::Create(this, WB_REPEAT));
+ mpImpl->mpAddButton.disposeAndReset(VclPtr<ImplTabButton>::Create(this, WB_REPEAT));
mpImpl->mpAddButton->SetClickHdl(aLink);
mpImpl->mpAddButton->SetSymbol(SymbolType::PLUS);
mpImpl->mpAddButton->Show();
@@ -833,7 +833,7 @@ void TabBar::ImplInitControls()
{
if (!mpImpl->mpPrevButton)
{
- mpImpl->mpPrevButton.reset(VclPtr<ImplTabButton>::Create(this, WB_REPEAT));
+ mpImpl->mpPrevButton.disposeAndReset(VclPtr<ImplTabButton>::Create(this, WB_REPEAT));
mpImpl->mpPrevButton->SetClickHdl(aLink);
}
mpImpl->mpPrevButton->SetSymbol(mbMirrored ? SymbolType::NEXT : SymbolType::PREV);
@@ -841,7 +841,7 @@ void TabBar::ImplInitControls()
if (!mpImpl->mpNextButton)
{
- mpImpl->mpNextButton.reset(VclPtr<ImplTabButton>::Create(this, WB_REPEAT));
+ mpImpl->mpNextButton.disposeAndReset(VclPtr<ImplTabButton>::Create(this, WB_REPEAT));
mpImpl->mpNextButton->SetClickHdl(aLink);
}
mpImpl->mpNextButton->SetSymbol(mbMirrored ? SymbolType::PREV : SymbolType::NEXT);
@@ -857,7 +857,7 @@ void TabBar::ImplInitControls()
{
if (!mpImpl->mpFirstButton)
{
- mpImpl->mpFirstButton.reset(VclPtr<ImplTabButton>::Create(this));
+ mpImpl->mpFirstButton.disposeAndReset(VclPtr<ImplTabButton>::Create(this));
mpImpl->mpFirstButton->SetClickHdl(aLink);
}
mpImpl->mpFirstButton->SetSymbol(mbMirrored ? SymbolType::LAST : SymbolType::FIRST);
@@ -865,7 +865,7 @@ void TabBar::ImplInitControls()
if (!mpImpl->mpLastButton)
{
- mpImpl->mpLastButton.reset(VclPtr<ImplTabButton>::Create(this));
+ mpImpl->mpLastButton.disposeAndReset(VclPtr<ImplTabButton>::Create(this));
mpImpl->mpLastButton->SetClickHdl(aLink);
}
mpImpl->mpLastButton->SetSymbol(mbMirrored ? SymbolType::FIRST : SymbolType::LAST);
@@ -2130,7 +2130,7 @@ bool TabBar::StartEditMode(sal_uInt16 nPageId)
ImplFormat();
Update();
- mpImpl->mpEdit.reset(VclPtr<TabBarEdit>::Create(this, WB_CENTER));
+ mpImpl->mpEdit.disposeAndReset(VclPtr<TabBarEdit>::Create(this, WB_CENTER));
Rectangle aRect = GetPageRect( mnEditId );
long nX = aRect.Left();
long nWidth = aRect.GetWidth();
diff --git a/svtools/source/dialogs/roadmapwizard.cxx b/svtools/source/dialogs/roadmapwizard.cxx
index e0d81d540cca..7354978b64fa 100644
--- a/svtools/source/dialogs/roadmapwizard.cxx
+++ b/svtools/source/dialogs/roadmapwizard.cxx
@@ -130,7 +130,7 @@ namespace svt
SetLeftAlignedButtonCount( 1 );
SetEmptyViewMargin();
- m_pImpl->pRoadmap.reset( VclPtr<ORoadmap>::Create( this, WB_TABSTOP ) );
+ m_pImpl->pRoadmap.disposeAndReset( VclPtr<ORoadmap>::Create( this, WB_TABSTOP ) );
m_pImpl->pRoadmap->SetText( SVT_RESSTR( STR_WIZDLG_ROADMAP_TITLE ) );
m_pImpl->pRoadmap->SetPosPixel( Point( 0, 0 ) );
m_pImpl->pRoadmap->SetItemSelectHdl( LINK( this, RoadmapWizard, OnRoadmapItemSelected ) );
diff --git a/svtools/source/toolpanel/toolpaneldrawer.cxx b/svtools/source/toolpanel/toolpaneldrawer.cxx
index 357849bda502..bc58461b5d4a 100644
--- a/svtools/source/toolpanel/toolpaneldrawer.cxx
+++ b/svtools/source/toolpanel/toolpaneldrawer.cxx
@@ -264,7 +264,7 @@ namespace svt
if ( !( i_rEvent.GetFlags() & AllSettingsFlags::STYLE ) )
break;
SetSettings( Application::GetSettings() );
- m_pPaintDevice.reset( VclPtr<VirtualDevice>::Create( *this ) );
+ m_pPaintDevice.disposeAndReset( VclPtr<VirtualDevice>::Create( *this ) );
// fall through.
diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx
index 84a8a0ef91ce..559f1385c890 100644
--- a/svx/source/dialog/docrecovery.cxx
+++ b/svx/source/dialog/docrecovery.cxx
@@ -682,7 +682,7 @@ IMPL_LINK_NOARG_TYPED(SaveDialog, OKButtonHdl, Button*, void)
// start crash-save with progress
ScopedVclPtrInstance< SaveProgressDialog > pProgress(this, m_pCore);
short nResult = pProgress->Execute();
- pProgress.reset();
+ pProgress.disposeAndClear();
// if "CANCEL" => return "CANCEL"
// if "OK" => "AUTOLUNCH" always !
@@ -993,7 +993,7 @@ short RecoveryDialog::execute()
nRet = pBrokenRecoveryDialog->Execute();
sSaveDir = pBrokenRecoveryDialog->getSaveDirURL();
}
- pBrokenRecoveryDialog.reset();
+ pBrokenRecoveryDialog.disposeAndClear();
switch(nRet)
{
@@ -1065,7 +1065,7 @@ short RecoveryDialog::execute()
nRet = pBrokenRecoveryDialog->Execute();
sSaveDir = pBrokenRecoveryDialog->getSaveDirURL();
}
- pBrokenRecoveryDialog.reset();
+ pBrokenRecoveryDialog.disposeAndClear();
// Possible states:
// a) nRet == DLG_RET_UNKNOWN
diff --git a/sw/source/ui/dbui/customizeaddresslistdialog.cxx b/sw/source/ui/dbui/customizeaddresslistdialog.cxx
index f1b5db0636e2..0516b8e6404e 100644
--- a/sw/source/ui/dbui/customizeaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/customizeaddresslistdialog.cxx
@@ -90,9 +90,9 @@ IMPL_LINK_TYPED(SwCustomizeAddressListDialog, AddRenameHdl_Impl, Button*, pButto
ScopedVclPtr<SwAddRenameEntryDialog> pDlg;
if (bRename)
- pDlg.reset(VclPtr<SwRenameEntryDialog>::Create(pButton, m_pNewData->aDBColumnHeaders));
+ pDlg.disposeAndReset(VclPtr<SwRenameEntryDialog>::Create(pButton, m_pNewData->aDBColumnHeaders));
else
- pDlg.reset(VclPtr<SwAddEntryDialog>::Create(pButton, m_pNewData->aDBColumnHeaders));
+ pDlg.disposeAndReset(VclPtr<SwAddEntryDialog>::Create(pButton, m_pNewData->aDBColumnHeaders));
if(bRename)
{
OUString aTemp = m_pFieldsLB->GetEntry(nPos);
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index 6a1d1b62c025..3650b4d807fe 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -247,7 +247,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa
ScopedVclPtr<VirtualDevice> xPrivateDevice;
if( ! pDummyVDev )
{
- xPrivateDevice.reset(VclPtr<VirtualDevice>::Create());
+ xPrivateDevice.disposeAndReset(VclPtr<VirtualDevice>::Create());
pDummyVDev = xPrivateDevice.get();
pDummyVDev->EnableOutput( false );
pDummyVDev->SetMapMode( i_rMtf.GetPrefMapMode() );