diff options
author | Noel Grandin <noel@peralex.com> | 2015-06-03 12:02:36 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-06-06 20:26:54 +0000 |
commit | 3f72218069f6f78a3ba21c40f00240d78cbe65c7 (patch) | |
tree | bd0781953ae45d3dcbfa3994641e755f2c5c0f73 /sw/source | |
parent | 87ac0b1e75a880a68ecb748bd4b34ae5a3d2ae98 (diff) |
Apply new VclPtr clang plugin to catch potential problems.
Omit the plugin, and sw's FrameControlsManager for now.
Change-Id: Ifb98a2e6e03a9d099efc1668305b96bd9142ca5f
Reviewed-on: https://gerrit.libreoffice.org/16117
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sw/source')
35 files changed, 53 insertions, 54 deletions
diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx index a18073102e68..2401be789b43 100644 --- a/sw/source/ui/chrdlg/drpcps.cxx +++ b/sw/source/ui/chrdlg/drpcps.cxx @@ -525,7 +525,7 @@ void SwDropCapsPict::_InitPrinter() if (!mpPrinter) { - mpPrinter = new Printer; + mpPrinter = VclPtr<Printer>::Create(); mbDelPrinter = true; } } @@ -621,7 +621,7 @@ SfxTabPage::sfxpg SwDropCapsPage::DeactivatePage(SfxItemSet * _pSet) VclPtr<SfxTabPage> SwDropCapsPage::Create(vcl::Window *pParent, const SfxItemSet *rSet) { - return VclPtr<SfxTabPage>(new SwDropCapsPage(pParent, *rSet), SAL_NO_ACQUIRE); + return VclPtr<SwDropCapsPage>::Create(pParent, *rSet); } bool SwDropCapsPage::FillItemSet(SfxItemSet *rSet) diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx index 26b8a210b31f..ff8f908b5f23 100644 --- a/sw/source/ui/chrdlg/numpara.cxx +++ b/sw/source/ui/chrdlg/numpara.cxx @@ -126,8 +126,7 @@ void SwParagraphNumTabPage::dispose() VclPtr<SfxTabPage> SwParagraphNumTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet ) { - return VclPtr<SfxTabPage>( new SwParagraphNumTabPage(pParent, *rSet), - SAL_NO_ACQUIRE ); + return VclPtr<SwParagraphNumTabPage>::Create(pParent, *rSet); } bool SwParagraphNumTabPage::FillItemSet( SfxItemSet* rSet ) diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx index 7b813250e690..62be945beb74 100644 --- a/sw/source/ui/chrdlg/swuiccoll.cxx +++ b/sw/source/ui/chrdlg/swuiccoll.cxx @@ -155,8 +155,7 @@ SfxTabPage::sfxpg SwCondCollPage::DeactivatePage(SfxItemSet * _pSet) VclPtr<SfxTabPage> SwCondCollPage::Create(vcl::Window *pParent, const SfxItemSet *rSet) { - return VclPtr<SfxTabPage>(new SwCondCollPage(pParent, *rSet), - SAL_NO_ACQUIRE); + return VclPtr<SwCondCollPage>::Create(pParent, *rSet); } bool SwCondCollPage::FillItemSet(SfxItemSet *rSet) diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 758e53bd7301..81a7d49a5643 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -430,8 +430,7 @@ void SwAddPrinterTabPage::SetPreview(bool bPrev) VclPtr<SfxTabPage> SwAddPrinterTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<SfxTabPage>(new SwAddPrinterTabPage( pParent, *rAttrSet ), - SAL_NO_ACQUIRE); + return VclPtr<SwAddPrinterTabPage>::Create( pParent, *rAttrSet ); } bool SwAddPrinterTabPage::FillItemSet( SfxItemSet* rCoreSet ) @@ -667,8 +666,7 @@ void SwStdFontTabPage::dispose() VclPtr<SfxTabPage> SwStdFontTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<SfxTabPage>(new SwStdFontTabPage(pParent, *rAttrSet), - SAL_NO_ACQUIRE); + return VclPtr<SwStdFontTabPage>::Create(pParent, *rAttrSet); } static void lcl_SetColl(SwWrtShell* pWrtShell, sal_uInt16 nType, @@ -1192,8 +1190,7 @@ void SwTableOptionsTabPage::dispose() VclPtr<SfxTabPage> SwTableOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<SfxTabPage>( new SwTableOptionsTabPage(pParent, *rAttrSet ), - SAL_NO_ACQUIRE ); + return VclPtr<SwTableOptionsTabPage>::Create(pParent, *rAttrSet); } bool SwTableOptionsTabPage::FillItemSet( SfxItemSet* ) @@ -1453,7 +1450,7 @@ void SwShdwCrsrOptionsTabPage::dispose() VclPtr<SfxTabPage> SwShdwCrsrOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet ) { - return VclPtr<SfxTabPage>(new SwShdwCrsrOptionsTabPage( pParent, *rSet ), SAL_NO_ACQUIRE); + return VclPtr<SwShdwCrsrOptionsTabPage>::Create( pParent, *rSet ); } void SwShdwCrsrOptionsTabPage::PageCreated( const SfxAllItemSet& aSet ) @@ -1874,7 +1871,7 @@ void SwRedlineOptionsTabPage::dispose() VclPtr<SfxTabPage> SwRedlineOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet) { - return VclPtr<SfxTabPage>( new SwRedlineOptionsTabPage( pParent, *rSet ), SAL_NO_ACQUIRE ); + return VclPtr<SwRedlineOptionsTabPage>::Create( pParent, *rSet ); } bool SwRedlineOptionsTabPage::FillItemSet( SfxItemSet* ) @@ -2388,7 +2385,7 @@ void SwCompareOptionsTabPage::dispose() VclPtr<SfxTabPage> SwCompareOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<SfxTabPage>(new SwCompareOptionsTabPage( pParent, *rAttrSet ), SAL_NO_ACQUIRE); + return VclPtr<SwCompareOptionsTabPage>::Create( pParent, *rAttrSet ); } bool SwCompareOptionsTabPage::FillItemSet( SfxItemSet* ) diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx index 3a9f6b4c76ce..906825a5a755 100644 --- a/sw/source/ui/envelp/envfmt.cxx +++ b/sw/source/ui/envelp/envfmt.cxx @@ -461,7 +461,7 @@ void SwEnvFormatPage::SetMinMax() VclPtr<SfxTabPage> SwEnvFormatPage::Create(vcl::Window* pParent, const SfxItemSet* rSet) { - return VclPtr<SfxTabPage>(new SwEnvFormatPage(pParent, *rSet), SAL_NO_ACQUIRE); + return VclPtr<SwEnvFormatPage>::Create(pParent, *rSet); } void SwEnvFormatPage::ActivatePage(const SfxItemSet& rSet) diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx index be34f66b3bdf..8e20c6adbd1f 100644 --- a/sw/source/ui/envelp/envlop1.cxx +++ b/sw/source/ui/envelp/envlop1.cxx @@ -321,7 +321,7 @@ void SwEnvPage::InitDatabaseBox() VclPtr<SfxTabPage> SwEnvPage::Create(vcl::Window* pParent, const SfxItemSet* rSet) { - return VclPtr<SfxTabPage>(new SwEnvPage(pParent, *rSet), SAL_NO_ACQUIRE); + return VclPtr<SwEnvPage>::Create(pParent, *rSet); } void SwEnvPage::ActivatePage(const SfxItemSet& rSet) diff --git a/sw/source/ui/envelp/envprt.cxx b/sw/source/ui/envelp/envprt.cxx index b256af9cdb2d..8fb8a3917c8c 100644 --- a/sw/source/ui/envelp/envprt.cxx +++ b/sw/source/ui/envelp/envprt.cxx @@ -145,7 +145,7 @@ IMPL_LINK_NOARG_TYPED(SwEnvPrtPage, AlignHdl, ToolBox *, void) VclPtr<SfxTabPage> SwEnvPrtPage::Create(vcl::Window* pParent, const SfxItemSet* rSet) { - return VclPtr<SfxTabPage>(new SwEnvPrtPage(pParent, *rSet), SAL_NO_ACQUIRE); + return VclPtr<SwEnvPrtPage>::Create(pParent, *rSet); } void SwEnvPrtPage::ActivatePage(const SfxItemSet&) diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx index dfffd5dbe369..96c02c28caa3 100644 --- a/sw/source/ui/envelp/label1.cxx +++ b/sw/source/ui/envelp/label1.cxx @@ -488,7 +488,7 @@ void SwLabPage::InitDatabaseBox() VclPtr<SfxTabPage> SwLabPage::Create(vcl::Window* pParent, const SfxItemSet* rSet) { - return VclPtr<SfxTabPage>(new SwLabPage(pParent, *rSet), SAL_NO_ACQUIRE); + return VclPtr<SwLabPage>::Create(pParent, *rSet); } void SwLabPage::ActivatePage(const SfxItemSet& rSet) @@ -633,7 +633,7 @@ void SwVisitingCardPage::dispose() VclPtr<SfxTabPage> SwVisitingCardPage::Create(vcl::Window* pParent, const SfxItemSet* rSet) { - return VclPtr<SfxTabPage>(new SwVisitingCardPage(pParent, *rSet), SAL_NO_ACQUIRE); + return VclPtr<SwVisitingCardPage>::Create(pParent, *rSet); } void SwVisitingCardPage::ActivatePage(const SfxItemSet& rSet) @@ -794,7 +794,7 @@ void SwPrivateDataPage::dispose() VclPtr<SfxTabPage> SwPrivateDataPage::Create(vcl::Window* pParent, const SfxItemSet* rSet) { - return VclPtr<SfxTabPage>(new SwPrivateDataPage(pParent, *rSet), SAL_NO_ACQUIRE); + return VclPtr<SwPrivateDataPage>::Create(pParent, *rSet); } void SwPrivateDataPage::ActivatePage(const SfxItemSet& rSet) @@ -907,7 +907,7 @@ void SwBusinessDataPage::dispose() VclPtr<SfxTabPage> SwBusinessDataPage::Create(vcl::Window* pParent, const SfxItemSet* rSet) { - return VclPtr<SfxTabPage>(new SwBusinessDataPage(pParent, *rSet), SAL_NO_ACQUIRE); + return VclPtr<SwBusinessDataPage>::Create(pParent, *rSet); } void SwBusinessDataPage::ActivatePage(const SfxItemSet& rSet) diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx index e8b3d53c1369..6ed49bc016af 100644 --- a/sw/source/ui/envelp/labfmt.cxx +++ b/sw/source/ui/envelp/labfmt.cxx @@ -488,7 +488,7 @@ void SwLabFormatPage::ChangeMinMax() VclPtr<SfxTabPage> SwLabFormatPage::Create(vcl::Window* pParent, const SfxItemSet* rSet) { - return VclPtr<SfxTabPage>(new SwLabFormatPage(pParent, *rSet), SAL_NO_ACQUIRE); + return VclPtr<SwLabFormatPage>::Create(pParent, *rSet); } void SwLabFormatPage::ActivatePage(const SfxItemSet& rSet) diff --git a/sw/source/ui/envelp/labprt.cxx b/sw/source/ui/envelp/labprt.cxx index ae5970d4f4f6..ae81bbeac08d 100644 --- a/sw/source/ui/envelp/labprt.cxx +++ b/sw/source/ui/envelp/labprt.cxx @@ -86,7 +86,7 @@ IMPL_LINK( SwLabPrtPage, CountHdl, Button *, pButton ) { // Call printer setup if (!pPrinter) - pPrinter = new Printer; + pPrinter = VclPtr<Printer>::Create(); VclPtrInstance< PrinterSetupDialog > pDlg(this); pDlg->SetPrinter(pPrinter); @@ -110,7 +110,7 @@ IMPL_LINK( SwLabPrtPage, CountHdl, Button *, pButton ) VclPtr<SfxTabPage> SwLabPrtPage::Create(vcl::Window* pParent, const SfxItemSet* rSet) { - return VclPtr<SfxTabPage>(new SwLabPrtPage( pParent, *rSet ), SAL_NO_ACQUIRE); + return VclPtr<SwLabPrtPage>::Create( pParent, *rSet ); } void SwLabPrtPage::ActivatePage( const SfxItemSet& rSet ) diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index 43766da0bcb6..903926976f31 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -662,7 +662,7 @@ void SwColumnPage::Reset(const SfxItemSet *rSet) // create TabPage VclPtr<SfxTabPage> SwColumnPage::Create(vcl::Window *pParent, const SfxItemSet *rSet) { - return VclPtr<SfxTabPage>(new SwColumnPage(pParent, *rSet), SAL_NO_ACQUIRE); + return VclPtr<SwColumnPage>::Create(pParent, *rSet); } // stuff attributes into the Set when OK diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index ae47f510baf8..3c06257c5d51 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -861,7 +861,7 @@ void SwFrmPage::setOptimalRelWidth() VclPtr<SfxTabPage> SwFrmPage::Create(vcl::Window *pParent, const SfxItemSet *rSet) { - return VclPtr<SfxTabPage>(new SwFrmPage( pParent, *rSet ), SAL_NO_ACQUIRE); + return VclPtr<SwFrmPage>::Create( pParent, *rSet ); } void SwFrmPage::EnableGraficMode() @@ -2423,7 +2423,7 @@ void SwGrfExtPage::dispose() VclPtr<SfxTabPage> SwGrfExtPage::Create( vcl::Window *pParent, const SfxItemSet *rSet ) { - return VclPtr<SfxTabPage>(new SwGrfExtPage( pParent, *rSet ), SAL_NO_ACQUIRE); + return VclPtr<SwGrfExtPage>::Create( pParent, *rSet ); } void SwGrfExtPage::Reset(const SfxItemSet *rSet) @@ -2850,7 +2850,7 @@ bool SwFrmURLPage::FillItemSet(SfxItemSet *rSet) VclPtr<SfxTabPage> SwFrmURLPage::Create(vcl::Window *pParent, const SfxItemSet *rSet) { - return VclPtr<SfxTabPage>(new SwFrmURLPage( pParent, *rSet ), SAL_NO_ACQUIRE); + return VclPtr<SwFrmURLPage>::Create( pParent, *rSet ); } IMPL_LINK_NOARG(SwFrmURLPage, InsertFileHdl) @@ -2942,7 +2942,7 @@ void SwFrmAddPage::dispose() VclPtr<SfxTabPage> SwFrmAddPage::Create(vcl::Window *pParent, const SfxItemSet *rSet) { - return VclPtr<SfxTabPage>(new SwFrmAddPage(pParent, *rSet), SAL_NO_ACQUIRE); + return VclPtr<SwFrmAddPage>::Create(pParent, *rSet); } void SwFrmAddPage::Reset(const SfxItemSet *rSet ) diff --git a/sw/source/ui/frmdlg/wrap.cxx b/sw/source/ui/frmdlg/wrap.cxx index d9a0cbd01ffa..c3b1373bd340 100644 --- a/sw/source/ui/frmdlg/wrap.cxx +++ b/sw/source/ui/frmdlg/wrap.cxx @@ -157,7 +157,7 @@ void SwWrapTabPage::dispose() VclPtr<SfxTabPage> SwWrapTabPage::Create(vcl::Window *pParent, const SfxItemSet *rSet) { - return VclPtr<SfxTabPage>(new SwWrapTabPage(pParent, *rSet), SAL_NO_ACQUIRE); + return VclPtr<SwWrapTabPage>::Create(pParent, *rSet); } void SwWrapTabPage::Reset(const SfxItemSet *rSet) diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 0324d6fe2f7e..9648c96cf45d 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -3864,7 +3864,7 @@ SwEntryBrowseBox::SwEntryBrowseBox(vcl::Window* pParent, VclBuilderContainer* pB BrowserMode::AUTO_VSCROLL| BrowserMode::HIDECURSOR ) , aCellEdit(VclPtr<Edit>::Create(&GetDataWindow(), 0)) - , aCellCheckBox(new ::svt::CheckBoxControl(&GetDataWindow())) + , aCellCheckBox(VclPtr<::svt::CheckBoxControl>::Create(&GetDataWindow())) , nCurrentRow(0) , bModified(false) { diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx index 5703e6d7b354..797ba4e6d35b 100644 --- a/sw/source/ui/misc/docfnote.cxx +++ b/sw/source/ui/misc/docfnote.cxx @@ -423,7 +423,7 @@ SwFootNoteOptionPage::~SwFootNoteOptionPage() VclPtr<SfxTabPage> SwFootNoteOptionPage::Create(vcl::Window *pParent, const SfxItemSet *rSet ) { - return VclPtr<SfxTabPage>(new SwFootNoteOptionPage( pParent, *rSet ), SAL_NO_ACQUIRE); + return VclPtr<SwFootNoteOptionPage>::Create( pParent, *rSet ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/misc/impfnote.hxx b/sw/source/ui/misc/impfnote.hxx index 8d291d0c6794..c7390af9449d 100644 --- a/sw/source/ui/misc/impfnote.hxx +++ b/sw/source/ui/misc/impfnote.hxx @@ -81,6 +81,7 @@ public: class SwFootNoteOptionPage : public SwEndNoteOptionPage { + friend class VclPtr<SwFootNoteOptionPage>; SwFootNoteOptionPage( vcl::Window *pParent, const SfxItemSet &rSet ); virtual ~SwFootNoteOptionPage(); diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx index 49ac9ab8964a..11698c348e1c 100644 --- a/sw/source/ui/misc/pgfnote.cxx +++ b/sw/source/ui/misc/pgfnote.cxx @@ -153,7 +153,7 @@ void SwFootNotePage::dispose() VclPtr<SfxTabPage> SwFootNotePage::Create(vcl::Window *pParent, const SfxItemSet *rSet) { - return VclPtr<SfxTabPage>(new SwFootNotePage(pParent, *rSet), SAL_NO_ACQUIRE); + return VclPtr<SwFootNotePage>::Create(pParent, *rSet); } void SwFootNotePage::Reset(const SfxItemSet *rSet) diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx index f725eba0734d..ef7823c3b61d 100644 --- a/sw/source/ui/misc/pggrid.cxx +++ b/sw/source/ui/misc/pggrid.cxx @@ -182,7 +182,7 @@ void SwTextGridPage::dispose() VclPtr<SfxTabPage> SwTextGridPage::Create(vcl::Window *pParent, const SfxItemSet *rSet) { - return VclPtr<SfxTabPage>(new SwTextGridPage(pParent, *rSet), SAL_NO_ACQUIRE); + return VclPtr<SwTextGridPage>::Create(pParent, *rSet); } bool SwTextGridPage::FillItemSet(SfxItemSet *rSet) diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx index d27f981bf812..6283bbdccead 100644 --- a/sw/source/ui/table/tabledlg.cxx +++ b/sw/source/ui/table/tabledlg.cxx @@ -1372,7 +1372,7 @@ void SwTextFlowPage::dispose() VclPtr<SfxTabPage> SwTextFlowPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SfxTabPage>(new SwTextFlowPage(pParent, *rAttrSet), SAL_NO_ACQUIRE); + return VclPtr<SwTextFlowPage>::Create(pParent, *rAttrSet); } bool SwTextFlowPage::FillItemSet( SfxItemSet* rSet ) diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx index 1d7cf89f7d28..87123fde207a 100644 --- a/sw/source/ui/table/tautofmt.cxx +++ b/sw/source/ui/table/tautofmt.cxx @@ -356,8 +356,8 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, AddHdl) if( !bFormatInserted ) { - bOk = RET_CANCEL == MessageDialog(this, aStrInvalidFormat, VCL_MESSAGE_ERROR, VCL_BUTTONS_OK_CANCEL) - .Execute(); + bOk = RET_CANCEL == ScopedVclPtr<MessageDialog>::Create(this, aStrInvalidFormat, VCL_MESSAGE_ERROR, VCL_BUTTONS_OK_CANCEL) + ->Execute(); } } else @@ -456,8 +456,8 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, RenameHdl) if( !bFormatRenamed ) { - bOk = RET_CANCEL == MessageDialog(this, aStrInvalidFormat, VCL_MESSAGE_ERROR, VCL_BUTTONS_OK_CANCEL) - .Execute(); + bOk = RET_CANCEL == ScopedVclPtr<MessageDialog>::Create(this, aStrInvalidFormat, VCL_MESSAGE_ERROR, VCL_BUTTONS_OK_CANCEL) + ->Execute(); } } else diff --git a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx index 08050057add8..01dbd79bcc86 100644 --- a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx +++ b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx @@ -391,8 +391,8 @@ The code below would only be part of the solution. if(m_pSpellState->m_xStartRange.is()) { LockFocusNotification( true ); - sal_uInt16 nRet = MessageDialog(GetWindow(), SW_RES(STR_QUERY_SPELL_CONTINUE), - VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO).Execute(); + sal_uInt16 nRet = ScopedVclPtr<MessageDialog>::Create(GetWindow(), SW_RES(STR_QUERY_SPELL_CONTINUE), + VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)->Execute(); if(RET_YES == nRet) { SwUnoInternalPaM aPam(*pWrtShell->GetDoc()); diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx b/sw/source/uibase/docvw/AnnotationWin.cxx index 6c5a5cdea0b9..9ce682af86dd 100644 --- a/sw/source/uibase/docvw/AnnotationWin.cxx +++ b/sw/source/uibase/docvw/AnnotationWin.cxx @@ -221,7 +221,7 @@ VclPtr<MenuButton> SwAnnotationWin::CreateMenuButton() aRewriter.AddRule(UndoArg1,GetAuthor()); aText = aRewriter.Apply(aText); mpButtonPopup->SetItemText(FN_DELETE_NOTE_AUTHOR,aText); - VclPtr<MenuButton> pMenuButton( new AnnotationMenuButton( *this ), SAL_NO_ACQUIRE ); + VclPtrInstance<AnnotationMenuButton> pMenuButton( *this ); pMenuButton->SetPopupMenu( mpButtonPopup ); pMenuButton->Show(); return pMenuButton; diff --git a/sw/source/uibase/inc/optpage.hxx b/sw/source/uibase/inc/optpage.hxx index eb8278469e8d..bcc3650c11bf 100644 --- a/sw/source/uibase/inc/optpage.hxx +++ b/sw/source/uibase/inc/optpage.hxx @@ -130,6 +130,7 @@ public: class SwStdFontTabPage : public SfxTabPage { + friend class VclPtr<SwStdFontTabPage>; VclPtr<FixedText> pLabelFT; VclPtr<ComboBox> pStandardBox; diff --git a/sw/source/uibase/inc/pgfnote.hxx b/sw/source/uibase/inc/pgfnote.hxx index 49f1974b8c3e..223fe3851f7a 100644 --- a/sw/source/uibase/inc/pgfnote.hxx +++ b/sw/source/uibase/inc/pgfnote.hxx @@ -31,6 +31,7 @@ // footnote settings TabPage class SwFootNotePage: public SfxTabPage { + friend class VclPtr<SwFootNotePage>; static const sal_uInt16 aPageRg[]; SwFootNotePage(vcl::Window *pParent, const SfxItemSet &rSet); public: diff --git a/sw/source/uibase/sidebar/PageColumnControl.cxx b/sw/source/uibase/sidebar/PageColumnControl.cxx index 2c37741b69f0..d1a675e29900 100644 --- a/sw/source/uibase/sidebar/PageColumnControl.cxx +++ b/sw/source/uibase/sidebar/PageColumnControl.cxx @@ -37,7 +37,7 @@ PageColumnControl::PageColumnControl( const sal_uInt16 nColumnType, const bool bLandscape ) : svx::sidebar::PopupControl( pParent, SW_RES(RID_POPUP_SWPAGE_COLUMN) ) - , mpColumnValueSet( new svx::sidebar::ValueSetWithTextControl( svx::sidebar::ValueSetWithTextControl::IMAGE_TEXT, this, SW_RES(VS_COLUMN) ) ) + , mpColumnValueSet( VclPtr<svx::sidebar::ValueSetWithTextControl>::Create( svx::sidebar::ValueSetWithTextControl::IMAGE_TEXT, this, SW_RES(VS_COLUMN) ) ) , maMoreButton( VclPtr<PushButton>::Create( this, SW_RES(CB_COLUMN_MORE) ) ) , mnColumnType( nColumnType ) , mrPagePropPanel(rPanel) diff --git a/sw/source/uibase/sidebar/PageMarginControl.cxx b/sw/source/uibase/sidebar/PageMarginControl.cxx index 5a806688e75a..7d5fe569f41d 100644 --- a/sw/source/uibase/sidebar/PageMarginControl.cxx +++ b/sw/source/uibase/sidebar/PageMarginControl.cxx @@ -49,7 +49,7 @@ PageMarginControl::PageMarginControl( const FieldUnit eFUnit, const SfxMapUnit eUnit ) : svx::sidebar::PopupControl( pParent, SW_RES(RID_POPUP_SWPAGE_MARGIN) ) - , mpMarginValueSet( new svx::sidebar::ValueSetWithTextControl( svx::sidebar::ValueSetWithTextControl::IMAGE_TEXT, this, SW_RES(VS_MARGIN) ) ) + , mpMarginValueSet( VclPtr<svx::sidebar::ValueSetWithTextControl>::Create( svx::sidebar::ValueSetWithTextControl::IMAGE_TEXT, this, SW_RES(VS_MARGIN) ) ) , maCustom(VclPtr<FixedText>::Create(this, SW_RES(FT_CUSTOM))) , maLeft(VclPtr<FixedText>::Create(this, SW_RES(FT_LEFT))) , maInner(VclPtr<FixedText>::Create(this, SW_RES(FT_INNER))) diff --git a/sw/source/uibase/sidebar/PageOrientationControl.cxx b/sw/source/uibase/sidebar/PageOrientationControl.cxx index 1c3dc3566cd5..18da73a34ba5 100644 --- a/sw/source/uibase/sidebar/PageOrientationControl.cxx +++ b/sw/source/uibase/sidebar/PageOrientationControl.cxx @@ -33,7 +33,7 @@ PageOrientationControl::PageOrientationControl( PagePropertyPanel& rPanel, const bool bLandscape ) : svx::sidebar::PopupControl( pParent, SW_RES(RID_POPUP_SWPAGE_ORIENTATION) ) - , mpOrientationValueSet( new svx::sidebar::ValueSetWithTextControl( svx::sidebar::ValueSetWithTextControl::IMAGE_TEXT, this, SW_RES(VS_ORIENTATION) ) ) + , mpOrientationValueSet( VclPtr<svx::sidebar::ValueSetWithTextControl>::Create( svx::sidebar::ValueSetWithTextControl::IMAGE_TEXT, this, SW_RES(VS_ORIENTATION) ) ) , mbLandscape( bLandscape ) , mrPagePropPanel(rPanel) { diff --git a/sw/source/uibase/sidebar/PageSizeControl.cxx b/sw/source/uibase/sidebar/PageSizeControl.cxx index 48f1b0a6d6c1..621d18f9bc8c 100644 --- a/sw/source/uibase/sidebar/PageSizeControl.cxx +++ b/sw/source/uibase/sidebar/PageSizeControl.cxx @@ -42,7 +42,7 @@ PageSizeControl::PageSizeControl( const bool bLandscape, const FieldUnit eFUnit ) : svx::sidebar::PopupControl( pParent, SW_RES(RID_POPUP_SWPAGE_SIZE) ) - , mpSizeValueSet( new svx::sidebar::ValueSetWithTextControl( svx::sidebar::ValueSetWithTextControl::TEXT_TEXT, this, SW_RES(VS_SIZE) ) ) + , mpSizeValueSet( VclPtr<svx::sidebar::ValueSetWithTextControl>::Create( svx::sidebar::ValueSetWithTextControl::TEXT_TEXT, this, SW_RES(VS_SIZE) ) ) , maMoreButton( VclPtr<PushButton>::Create( this, SW_RES(CB_SIZE_MORE) ) ) , maWidthHeightField( VclPtr<MetricField>::Create( this, SW_RES(FLD_WIDTH_HEIGHT) ) ) , mePaper( ePaper ) diff --git a/sw/source/uibase/sidebar/StylePresetsPanel.cxx b/sw/source/uibase/sidebar/StylePresetsPanel.cxx index a0c491fe0a84..7a4dbfc2933a 100644 --- a/sw/source/uibase/sidebar/StylePresetsPanel.cxx +++ b/sw/source/uibase/sidebar/StylePresetsPanel.cxx @@ -54,7 +54,7 @@ VclPtr<vcl::Window> StylePresetsPanel::Create (vcl::Window* pParent, if (pBindings == NULL) throw css::lang::IllegalArgumentException("no SfxBindings given to PagePropertyPanel::Create", NULL, 2); - return VclPtr<vcl::Window>(new StylePresetsPanel(pParent, rxFrame, pBindings), SAL_NO_ACQUIRE); + return VclPtr<StylePresetsPanel>::Create(pParent, rxFrame, pBindings); } StylePresetsPanel::StylePresetsPanel(vcl::Window* pParent, diff --git a/sw/source/uibase/sidebar/StylePresetsPanel.hxx b/sw/source/uibase/sidebar/StylePresetsPanel.hxx index 047272ea87ca..5f0b97d8e7f7 100644 --- a/sw/source/uibase/sidebar/StylePresetsPanel.hxx +++ b/sw/source/uibase/sidebar/StylePresetsPanel.hxx @@ -41,6 +41,7 @@ namespace sw { namespace sidebar { class StylePresetsPanel : public PanelLayout, public sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface { + friend class VclPtr<StylePresetsPanel>; public: static VclPtr<vcl::Window> Create(vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame, diff --git a/sw/source/uibase/sidebar/SwPanelFactory.cxx b/sw/source/uibase/sidebar/SwPanelFactory.cxx index 013519661a13..92dd4875d948 100644 --- a/sw/source/uibase/sidebar/SwPanelFactory.cxx +++ b/sw/source/uibase/sidebar/SwPanelFactory.cxx @@ -139,7 +139,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement ( } else if (rsResourceURL.endsWith("/NavigatorPanel")) { - VclPtr<vcl::Window> pPanel( new SwNavigationPI(pBindings, NULL, pParentWindow), SAL_NO_ACQUIRE ); + VclPtrInstance<SwNavigationPI> pPanel(pBindings, nullptr, pParentWindow); xElement = sfx2::sidebar::SidebarPanelBase::Create( rsResourceURL, xFrame, @@ -148,7 +148,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement ( } else if (rsResourceURL.endsWith("/ManageChangesPanel")) { - VclPtr<vcl::Window> pPanel( new SwRedlineAcceptPanel(pParentWindow, xFrame), SAL_NO_ACQUIRE ); + VclPtrInstance<SwRedlineAcceptPanel> pPanel(pParentWindow, xFrame); xElement = sfx2::sidebar::SidebarPanelBase::Create( rsResourceURL, xFrame, diff --git a/sw/source/uibase/sidebar/ThemePanel.cxx b/sw/source/uibase/sidebar/ThemePanel.cxx index bb375020a3eb..c2e7406ce2aa 100644 --- a/sw/source/uibase/sidebar/ThemePanel.cxx +++ b/sw/source/uibase/sidebar/ThemePanel.cxx @@ -477,7 +477,7 @@ VclPtr<vcl::Window> ThemePanel::Create (vcl::Window* pParent, if (pBindings == NULL) throw css::lang::IllegalArgumentException("no SfxBindings given to PagePropertyPanel::Create", NULL, 2); - return VclPtr<vcl::Window>(new ThemePanel(pParent, rxFrame, pBindings), SAL_NO_ACQUIRE); + return VclPtr<ThemePanel>::Create(pParent, rxFrame, pBindings); } ThemePanel::ThemePanel(vcl::Window* pParent, diff --git a/sw/source/uibase/sidebar/ThemePanel.hxx b/sw/source/uibase/sidebar/ThemePanel.hxx index a14ac51de4ae..fa958cc82c5a 100644 --- a/sw/source/uibase/sidebar/ThemePanel.hxx +++ b/sw/source/uibase/sidebar/ThemePanel.hxx @@ -41,6 +41,7 @@ namespace sw { namespace sidebar { class ThemePanel : public PanelLayout, public sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface { + friend class VclPtr<ThemePanel>; public: static VclPtr<vcl::Window> Create(vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame, diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index 63470d10e378..026396312c95 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -711,7 +711,7 @@ void SwPagePreview::Execute( SfxRequest &rReq ) } else - SwPreviewZoomDlg( *pViewWin ).Execute(); + ScopedVclPtrInstance<SwPreviewZoomDlg>( *pViewWin )->Execute(); } break; diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index 051081b5210c..2f19e1faf113 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -426,8 +426,7 @@ void SwNavHelpToolBox::MouseButtonDown(const MouseEvent &rEvt) void SwNavigationPI::CreateNavigationTool(const Rectangle& rRect, bool bSetFocus, vcl::Window *pParent) { Reference< XFrame > xFrame = GetCreateView()->GetViewFrame()->GetFrame().GetFrameInterface(); - SwScrollNaviPopup* pPopup = new - SwScrollNaviPopup(FN_SCROLL_NAVIGATION, xFrame, pParent); + VclPtrInstance<SwScrollNaviPopup> pPopup(FN_SCROLL_NAVIGATION, xFrame, pParent); Rectangle aRect(rRect); Point aT1 = aRect.TopLeft(); |