[Libreoffice-commits] core.git: basctl/source cui/source filter/source framework/source include/vcl sc/source sd/source svtools/source svx/source sw/source vcl/source

Caolán McNamara caolanm at redhat.com
Mon Sep 21 12:34:45 PDT 2015


 basctl/source/basicide/basdoc.cxx                      |    5 ++---
 cui/source/options/treeopt.cxx                         |    6 +++---
 cui/source/tabpages/tpbitmap.cxx                       |    8 ++++----
 cui/source/tabpages/tpcolor.cxx                        |    4 ++--
 cui/source/tabpages/tpgradnt.cxx                       |    4 ++--
 cui/source/tabpages/tphatch.cxx                        |    4 ++--
 filter/source/graphicfilter/eos2met/eos2met.cxx        |    3 +--
 framework/source/uielement/fontsizemenucontroller.cxx  |    2 +-
 include/vcl/vclptr.hxx                                 |   13 ++++++++++++-
 sc/source/ui/docshell/docsh4.cxx                       |    2 +-
 sc/source/ui/view/gridwin4.cxx                         |    2 +-
 sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx     |    2 +-
 sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx |    4 ++--
 svtools/source/control/tabbar.cxx                      |   14 +++++++-------
 svtools/source/dialogs/roadmapwizard.cxx               |    2 +-
 svtools/source/toolpanel/toolpaneldrawer.cxx           |    2 +-
 svx/source/dialog/docrecovery.cxx                      |    6 +++---
 sw/source/ui/dbui/customizeaddresslistdialog.cxx       |    4 ++--
 vcl/source/gdi/pdfwriter_impl2.cxx                     |    2 +-
 19 files changed, 49 insertions(+), 40 deletions(-)

New commits:
commit 599fab44ad2ca626f046b9e9e4924110950a897c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Sep 21 13:37:17 2015 +0100

    hide ScopedPtr::reset and add disposeAndClear
    
    Change-Id: I55d6e789abd408b8478a2b9ae141d8899af2c309
    Reviewed-on: https://gerrit.libreoffice.org/18745
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/basctl/source/basicide/basdoc.cxx b/basctl/source/basicide/basdoc.cxx
index 1c878d82..b969c27 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 1495984..e18be0f 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 462e9ab..22fa3d3 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 53c04b0..be9c42b 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 0396464..7bf1bdb 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 cbe5052..d528bd8 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 3556195..a65a4cc 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 3c6d941..ec5cfa8 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 6618ec2..2614886 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 1b74471..a38c85f 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 6faf516..72c6202 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 f385ae5..697b8d4 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 91b7e8e..a2c8e46 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 04a0489..1a9ccee 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 e0d81d5..7354978 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 357849b..bc58461 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 84a8a0e..559f138 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 f1b5db0..0516b8e 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 6a1d1b6..3650b4d 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() );


More information about the Libreoffice-commits mailing list