summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-06-03 12:02:36 +0200
committerMichael Meeks <michael.meeks@collabora.com>2015-06-06 21:35:55 +0100
commit4ce537563a763f8822928e8140e639a554fbd7d3 (patch)
treeb2d0b533091e795954e573c129430f75abf6bd10 /sd
parentadcd23cfde8e92da4a755c4914679a3f0a82c224 (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 'sd')
-rw-r--r--sd/source/ui/dlg/sddlgfact.cxx16
-rw-r--r--sd/source/ui/sidebar/AllMasterPagesSelector.cxx6
-rw-r--r--sd/source/ui/sidebar/AllMasterPagesSelector.hxx1
-rw-r--r--sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx6
-rw-r--r--sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx1
-rw-r--r--sd/source/ui/sidebar/PanelFactory.cxx10
-rw-r--r--sd/source/ui/sidebar/RecentMasterPagesSelector.cxx6
-rw-r--r--sd/source/ui/sidebar/RecentMasterPagesSelector.hxx1
8 files changed, 22 insertions, 25 deletions
diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx
index ead579c831b8..2da799145ff3 100644
--- a/sd/source/ui/dlg/sddlgfact.cxx
+++ b/sd/source/ui/dlg/sddlgfact.cxx
@@ -378,7 +378,7 @@ VclAbstractDialog * SdAbstractDialogFactory_Impl::CreateBreakDlg(
sal_uLong nSumActionCount,
sal_uLong nObjCount )
{
- return new SdVclAbstractDialog_Impl( new ::sd::BreakDlg( pWindow, pDrView, pShell, nSumActionCount, nObjCount ) );
+ return new SdVclAbstractDialog_Impl( VclPtr<::sd::BreakDlg>::Create( pWindow, pDrView, pShell, nSumActionCount, nObjCount ) );
}
AbstractCopyDlg * SdAbstractDialogFactory_Impl::CreateCopyDlg(
@@ -386,7 +386,7 @@ AbstractCopyDlg * SdAbstractDialogFactory_Impl::CreateCopyDlg(
const rtl::Reference<XColorList> &pColTab,
::sd::View* pView )
{
- return new AbstractCopyDlg_Impl( new ::sd::CopyDlg( pWindow, rInAttrs, pColTab, pView ) );
+ return new AbstractCopyDlg_Impl( VclPtr<::sd::CopyDlg>::Create( pWindow, rInAttrs, pColTab, pView ) );
}
AbstractSdCustomShowDlg * SdAbstractDialogFactory_Impl::CreateSdCustomShowDlg( vcl::Window* pWindow, SdDrawDocument& rDrawDoc )
@@ -436,12 +436,12 @@ AbstractSdInsertPagesObjsDlg * SdAbstractDialogFactory_Impl::CreateSdInsertPages
AbstractMorphDlg * SdAbstractDialogFactory_Impl::CreateMorphDlg( vcl::Window* pParent, const SdrObject* pObj1, const SdrObject* pObj2)
{
- return new AbstractMorphDlg_Impl( new ::sd::MorphDlg( pParent, pObj1, pObj2 ) );
+ return new AbstractMorphDlg_Impl( VclPtr<::sd::MorphDlg>::Create( pParent, pObj1, pObj2 ) );
}
SfxAbstractTabDialog * SdAbstractDialogFactory_Impl::CreateSdOutlineBulletTabDlg( vcl::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView )
{
- return new AbstractBulletDialog_Impl( new ::sd::OutlineBulletDlg( pParent, pAttr, pView ) );
+ return new AbstractBulletDialog_Impl( VclPtr<::sd::OutlineBulletDlg>::Create( pParent, pAttr, pView ) );
}
SfxAbstractTabDialog * SdAbstractDialogFactory_Impl::CreateSdParagraphTabDlg( vcl::Window* pParent, const SfxItemSet* pAttr )
@@ -457,7 +457,7 @@ AbstractSdStartPresDlg * SdAbstractDialogFactory_Impl::CreateSdStartPresentatio
VclAbstractDialog * SdAbstractDialogFactory_Impl::CreateRemoteDialog( vcl::Window* pWindow )
{
- return new SdVclAbstractDialog_Impl( new ::sd::RemoteDialog( pWindow ) );
+ return new SdVclAbstractDialog_Impl( VclPtr<::sd::RemoteDialog>::Create( pWindow ) );
}
SfxAbstractTabDialog * SdAbstractDialogFactory_Impl::CreateSdPresLayoutTemplateDlg( SfxObjectShell* pDocSh, vcl::Window* pParent, const SdResId& DlgId, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool )
@@ -514,18 +514,18 @@ CreateTabPage SdAbstractDialogFactory_Impl::GetSdOptionsSnapTabPageCreatorFunc()
VclAbstractDialog* SdAbstractDialogFactory_Impl::CreateMasterLayoutDialog( vcl::Window* pParent,
SdDrawDocument* pDoc, SdPage* pCurrentPage )
{
- return new SdVclAbstractDialog_Impl( new ::sd::MasterLayoutDialog( pParent, pDoc, pCurrentPage ));
+ return new SdVclAbstractDialog_Impl( VclPtr<::sd::MasterLayoutDialog>::Create( pParent, pDoc, pCurrentPage ));
}
AbstractHeaderFooterDialog* SdAbstractDialogFactory_Impl::CreateHeaderFooterDialog( sd::ViewShell* pViewShell,
vcl::Window* pParent, SdDrawDocument* pDoc, SdPage* pCurrentPage )
{
- return new AbstractHeaderFooterDialog_Impl( new ::sd::HeaderFooterDialog( pViewShell, pParent, pDoc, pCurrentPage ));
+ return new AbstractHeaderFooterDialog_Impl( VclPtr<::sd::HeaderFooterDialog>::Create( pViewShell, pParent, pDoc, pCurrentPage ));
}
VclAbstractDialog * SdAbstractDialogFactory_Impl::CreateSdPhotoAlbumDialog( vcl::Window* pWindow, SdDrawDocument* pDoc )
{
- return new SdVclAbstractDialog_Impl( new ::sd::SdPhotoAlbumDialog( pWindow, pDoc ) );
+ return new SdVclAbstractDialog_Impl( VclPtr<::sd::SdPhotoAlbumDialog>::Create( pWindow, pDoc ) );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/sidebar/AllMasterPagesSelector.cxx b/sd/source/ui/sidebar/AllMasterPagesSelector.cxx
index 1ab67e2a63ef..e700df1443ed 100644
--- a/sd/source/ui/sidebar/AllMasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/AllMasterPagesSelector.cxx
@@ -88,14 +88,12 @@ VclPtr<vcl::Window> AllMasterPagesSelector::Create (
::boost::shared_ptr<MasterPageContainer> pContainer (new MasterPageContainer());
- VclPtr<MasterPagesSelector> pSelector(
- new AllMasterPagesSelector (
+ VclPtrInstance<AllMasterPagesSelector> pSelector(
pParent,
*pDocument,
rViewShellBase,
pContainer,
- rxSidebar),
- SAL_NO_ACQUIRE);
+ rxSidebar);
pSelector->LateInit();
pSelector->SetHelpId(HID_SD_TASK_PANE_PREVIEW_ALL);
diff --git a/sd/source/ui/sidebar/AllMasterPagesSelector.hxx b/sd/source/ui/sidebar/AllMasterPagesSelector.hxx
index 58c958517bd6..e63e00c5b76c 100644
--- a/sd/source/ui/sidebar/AllMasterPagesSelector.hxx
+++ b/sd/source/ui/sidebar/AllMasterPagesSelector.hxx
@@ -36,6 +36,7 @@ namespace sd { namespace sidebar {
class AllMasterPagesSelector
: public MasterPagesSelector
{
+ friend class VclPtrInstance<AllMasterPagesSelector>;
public:
static VclPtr<vcl::Window> Create (
vcl::Window* pParent,
diff --git a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx
index c9009629c24d..c7729447d130 100644
--- a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx
@@ -53,14 +53,12 @@ VclPtr<vcl::Window> CurrentMasterPagesSelector::Create (
::boost::shared_ptr<MasterPageContainer> pContainer (new MasterPageContainer());
- VclPtr<MasterPagesSelector> pSelector(
- new CurrentMasterPagesSelector (
+ VclPtrInstance<CurrentMasterPagesSelector> pSelector(
pParent,
*pDocument,
rViewShellBase,
pContainer,
- rxSidebar),
- SAL_NO_ACQUIRE);
+ rxSidebar);
pSelector->LateInit();
pSelector->SetHelpId( HID_SD_TASK_PANE_PREVIEW_CURRENT );
diff --git a/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx b/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx
index 9443b991654c..b587a3f52aec 100644
--- a/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx
+++ b/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx
@@ -34,6 +34,7 @@ class CurrentMasterPagesSelector
: public MasterPagesSelector,
public SfxListener
{
+ friend class VclPtrInstance<CurrentMasterPagesSelector>;
public:
static VclPtr<vcl::Window> Create (
vcl::Window* pParent,
diff --git a/sd/source/ui/sidebar/PanelFactory.cxx b/sd/source/ui/sidebar/PanelFactory.cxx
index 73013aa037a5..3adab6c29a0c 100644
--- a/sd/source/ui/sidebar/PanelFactory.cxx
+++ b/sd/source/ui/sidebar/PanelFactory.cxx
@@ -125,9 +125,9 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
#define EndsWith(s,t) s.endsWithAsciiL(t,strlen(t))
if (EndsWith(rsUIElementResourceURL, gsResourceNameCustomAnimations))
- pControl = VclPtr<vcl::Window>(new CustomAnimationPanel(pParentWindow, *pBase, xFrame), SAL_NO_ACQUIRE);
+ pControl = VclPtr<CustomAnimationPanel>::Create(pParentWindow, *pBase, xFrame);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameLayouts))
- pControl = VclPtr<vcl::Window>(new LayoutMenu(pParentWindow, *pBase, xSidebar), SAL_NO_ACQUIRE);
+ pControl = VclPtr<LayoutMenu>::Create(pParentWindow, *pBase, xSidebar);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameAllMasterPages))
pControl = AllMasterPagesSelector::Create(pParentWindow, *pBase, xSidebar);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameRecentMasterPages))
@@ -135,11 +135,11 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
else if (EndsWith(rsUIElementResourceURL, gsResourceNameUsedMasterPages))
pControl = CurrentMasterPagesSelector::Create(pParentWindow, *pBase, xSidebar);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameSlideTransitions))
- pControl = VclPtr<vcl::Window>(new SlideTransitionPanel(pParentWindow, *pBase, xFrame), SAL_NO_ACQUIRE);
+ pControl = VclPtr<SlideTransitionPanel>::Create(pParentWindow, *pBase, xFrame);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameTableDesign))
- pControl = VclPtr<vcl::Window>(new TableDesignPanel(pParentWindow, *pBase), SAL_NO_ACQUIRE);
+ pControl = VclPtr<TableDesignPanel>::Create(pParentWindow, *pBase);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameNavigator))
- pControl = VclPtr<vcl::Window>(new NavigatorWrapper(pParentWindow, *pBase, pBindings), SAL_NO_ACQUIRE);
+ pControl = VclPtr<NavigatorWrapper>::Create(pParentWindow, *pBase, pBindings);
#undef EndsWith
if (!pControl)
diff --git a/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx b/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
index b31e139e22d6..00c7db8ee27f 100644
--- a/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
@@ -43,14 +43,12 @@ VclPtr<vcl::Window> RecentMasterPagesSelector::Create (
::boost::shared_ptr<MasterPageContainer> pContainer (new MasterPageContainer());
- VclPtr<MasterPagesSelector> pSelector(
- new RecentMasterPagesSelector (
+ VclPtrInstance<RecentMasterPagesSelector> pSelector(
pParent,
*pDocument,
rViewShellBase,
pContainer,
- rxSidebar),
- SAL_NO_ACQUIRE);
+ rxSidebar);
pSelector->LateInit();
pSelector->SetHelpId(HID_SD_TASK_PANE_PREVIEW_RECENT);
diff --git a/sd/source/ui/sidebar/RecentMasterPagesSelector.hxx b/sd/source/ui/sidebar/RecentMasterPagesSelector.hxx
index a7f470317989..2a74f1447ada 100644
--- a/sd/source/ui/sidebar/RecentMasterPagesSelector.hxx
+++ b/sd/source/ui/sidebar/RecentMasterPagesSelector.hxx
@@ -29,6 +29,7 @@ namespace sd { namespace sidebar {
class RecentMasterPagesSelector
: public MasterPagesSelector
{
+ friend class VclPtrInstance<RecentMasterPagesSelector>;
public:
static VclPtr<vcl::Window> Create (
vcl::Window* pParent,