[Libreoffice-commits] core.git: 4 commits - include/vcl sc/inc sc/source svx/source sw/source

Caolán McNamara caolanm at redhat.com
Fri Oct 28 09:56:48 UTC 2016


 include/vcl/lstbox.hxx             |    4 ----
 sc/inc/scabstdlg.hxx               |   14 +++++++-------
 sc/source/ui/attrdlg/scdlgfact.cxx |   14 +++++++-------
 sc/source/ui/attrdlg/scdlgfact.hxx |   14 +++++++-------
 sc/source/ui/view/tabvwsha.cxx     |    3 +--
 svx/source/dialog/hdft.cxx         |    4 ++--
 sw/source/ui/dialog/macassgn.cxx   |    2 +-
 7 files changed, 25 insertions(+), 30 deletions(-)

New commits:
commit 6dc8f25ecf676a2e4d1a1018b729fef4096df8e7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Oct 28 10:56:00 2016 +0100

    these need to be VclPtrs
    
    Change-Id: I83616728289e398c97e50f33b5dd1de404deaa27

diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx
index bd5f5d9..a3e54fa 100644
--- a/sc/inc/scabstdlg.hxx
+++ b/sc/inc/scabstdlg.hxx
@@ -518,29 +518,29 @@ public:
                                                                     bool                    bOnlyDbtoolsEncodings = false,
                                                                     bool                    bImport = true ) = 0;
 
-    virtual SfxAbstractTabDialog * CreateScAttrDlg( vcl::Window*          pParent,
+    virtual VclPtr<SfxAbstractTabDialog> CreateScAttrDlg( vcl::Window*          pParent,
                                                     const SfxItemSet* pCellAttrs ) = 0;
 
-    virtual SfxAbstractTabDialog * CreateScHFEditDlg(vcl::Window*       pParent,
+    virtual VclPtr<SfxAbstractTabDialog> CreateScHFEditDlg(vcl::Window*       pParent,
                                                     const SfxItemSet&   rCoreSet,
                                                     const OUString&     rPageStyle,
                                                     sal_uInt16          nResId ) = 0;
 
-    virtual SfxAbstractTabDialog * CreateScStyleDlg( vcl::Window*                pParent,
+    virtual VclPtr<SfxAbstractTabDialog> CreateScStyleDlg( vcl::Window*                pParent,
                                                     SfxStyleSheetBase&  rStyleBase,
                                                     sal_uInt16              nRscId,
                                                     int nId) = 0;
 
-    virtual SfxAbstractTabDialog * CreateScSubTotalDlg( vcl::Window*             pParent,
+    virtual VclPtr<SfxAbstractTabDialog> CreateScSubTotalDlg( vcl::Window*             pParent,
                                                         const SfxItemSet*   pArgSet ) = 0;
 
-    virtual SfxAbstractTabDialog * CreateScCharDlg(vcl::Window* pParent,
+    virtual VclPtr<SfxAbstractTabDialog> CreateScCharDlg(vcl::Window* pParent,
         const SfxItemSet* pAttr, const SfxObjectShell* pDocShell) = 0;
 
-    virtual SfxAbstractTabDialog * CreateScParagraphDlg(vcl::Window* pParent,
+    virtual VclPtr<SfxAbstractTabDialog> CreateScParagraphDlg(vcl::Window* pParent,
         const SfxItemSet* pAttr) = 0;
 
-    virtual SfxAbstractTabDialog * CreateScSortDlg(vcl::Window* pParent, const SfxItemSet* pArgSet) = 0;
+    virtual VclPtr<SfxAbstractTabDialog> CreateScSortDlg(vcl::Window* pParent, const SfxItemSet* pArgSet) = 0;
 
     // for tabpage
     virtual CreateTabPage               GetTabPageCreatorFunc( sal_uInt16 nId ) = 0;
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index 5f61a0ef..e6e3a38 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -857,13 +857,13 @@ AbstractScImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScImportOptions
     return VclPtr<AbstractScImportOptionsDlg_Impl>::Create( pDlg );
 }
 
-SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScAttrDlg(vcl::Window* pParent, const SfxItemSet* pCellAttrs)
+VclPtr<SfxAbstractTabDialog> ScAbstractDialogFactory_Impl::CreateScAttrDlg(vcl::Window* pParent, const SfxItemSet* pCellAttrs)
 {
     VclPtr<SfxTabDialog> pDlg = VclPtr<ScAttrDlg>::Create(pParent, pCellAttrs);
     return VclPtr<ScAbstractTabDialog_Impl>::Create(pDlg);
 }
 
-SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScHFEditDlg( vcl::Window*         pParent,
+VclPtr<SfxAbstractTabDialog> ScAbstractDialogFactory_Impl::CreateScHFEditDlg( vcl::Window*         pParent,
                                                                         const SfxItemSet&   rCoreSet,
                                                                         const OUString&     rPageStyle,
                                                                         sal_uInt16          nResId )
@@ -910,7 +910,7 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScHFEditDlg( vcl::Win
     return pDlg ? VclPtr<ScAbstractTabDialog_Impl>::Create( pDlg ) : nullptr;
 }
 
-SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScStyleDlg( vcl::Window*              pParent,
+VclPtr<SfxAbstractTabDialog> ScAbstractDialogFactory_Impl::CreateScStyleDlg( vcl::Window*              pParent,
                                                                         SfxStyleSheetBase&  rStyleBase,
                                                                         sal_uInt16              nRscId,
                                                                         int nId)
@@ -931,27 +931,27 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScStyleDlg( vcl::Wind
     return nullptr;
 }
 
-SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScSubTotalDlg(vcl::Window* pParent, const SfxItemSet* pArgSet)
+VclPtr<SfxAbstractTabDialog> ScAbstractDialogFactory_Impl::CreateScSubTotalDlg(vcl::Window* pParent, const SfxItemSet* pArgSet)
 {
     VclPtr<SfxTabDialog> pDlg = VclPtr<ScSubTotalDlg>::Create( pParent, pArgSet );
     return VclPtr<ScAbstractTabDialog_Impl>::Create( pDlg );
 }
 
-SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScCharDlg(
+VclPtr<SfxAbstractTabDialog> ScAbstractDialogFactory_Impl::CreateScCharDlg(
     vcl::Window* pParent, const SfxItemSet* pAttr, const SfxObjectShell* pDocShell)
 {
     VclPtr<SfxTabDialog> pDlg = VclPtr<ScCharDlg>::Create(pParent, pAttr, pDocShell);
     return VclPtr<ScAbstractTabDialog_Impl>::Create(pDlg);
 }
 
-SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScParagraphDlg(
+VclPtr<SfxAbstractTabDialog> ScAbstractDialogFactory_Impl::CreateScParagraphDlg(
     vcl::Window* pParent, const SfxItemSet* pAttr)
 {
     VclPtr<SfxTabDialog> pDlg = VclPtr<ScParagraphDlg>::Create(pParent, pAttr);
     return VclPtr<ScAbstractTabDialog_Impl>::Create(pDlg);
 }
 
-SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScSortDlg(vcl::Window* pParent, const SfxItemSet* pArgSet)
+VclPtr<SfxAbstractTabDialog> ScAbstractDialogFactory_Impl::CreateScSortDlg(vcl::Window* pParent, const SfxItemSet* pArgSet)
 {
     VclPtr<SfxTabDialog> pDlg = VclPtr<ScSortDlg>::Create( pParent, pArgSet );
     return VclPtr<ScAbstractTabDialog_Impl>::Create( pDlg );
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index c03bea9..d4104b7 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -532,28 +532,28 @@ public:
                                                                     bool                    bMultiByte = false,
                                                                     bool                    bOnlyDbtoolsEncodings = false,
                                                                     bool                    bImport = true ) override;
-    virtual SfxAbstractTabDialog * CreateScAttrDlg( vcl::Window*          pParent,
+    virtual VclPtr<SfxAbstractTabDialog> CreateScAttrDlg( vcl::Window*          pParent,
                                                     const SfxItemSet* pCellAttrs ) override;
 
-    virtual SfxAbstractTabDialog * CreateScHFEditDlg(vcl::Window*       pParent,
+    virtual VclPtr<SfxAbstractTabDialog> CreateScHFEditDlg(vcl::Window*       pParent,
                                                     const SfxItemSet&   rCoreSet,
                                                     const OUString&     rPageStyle,
                                                     sal_uInt16          nResId ) override;
 
-    virtual SfxAbstractTabDialog * CreateScStyleDlg( vcl::Window*                pParent,
+    virtual VclPtr<SfxAbstractTabDialog> CreateScStyleDlg( vcl::Window*                pParent,
                                                     SfxStyleSheetBase&  rStyleBase,
                                                     sal_uInt16              nRscId,
                                                     int nId) override;
 
-    virtual SfxAbstractTabDialog * CreateScSubTotalDlg( vcl::Window*             pParent,
+    virtual VclPtr<SfxAbstractTabDialog> CreateScSubTotalDlg( vcl::Window*             pParent,
                                                         const SfxItemSet*   pArgSet ) override;
-    virtual SfxAbstractTabDialog * CreateScCharDlg(vcl::Window* pParent,
+    virtual VclPtr<SfxAbstractTabDialog> CreateScCharDlg(vcl::Window* pParent,
         const SfxItemSet* pAttr, const SfxObjectShell* pDocShell) override;
 
-    virtual SfxAbstractTabDialog * CreateScParagraphDlg(vcl::Window* pParent,
+    virtual VclPtr<SfxAbstractTabDialog> CreateScParagraphDlg(vcl::Window* pParent,
         const SfxItemSet* pAttr) override;
 
-    virtual SfxAbstractTabDialog * CreateScSortDlg(vcl::Window* pParent, const SfxItemSet* pArgSet) override;
+    virtual VclPtr<SfxAbstractTabDialog> CreateScSortDlg(vcl::Window* pParent, const SfxItemSet* pArgSet) override;
 
     // For TabPage
     virtual CreateTabPage               GetTabPageCreatorFunc( sal_uInt16 nId ) override;
commit ec06f95d91341c277d53828323fc0f4f3f8d9570
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Oct 28 10:51:01 2016 +0100

    fix leak
    
    Change-Id: I5bc8efa8a9de6d7a2be99f6c816e3dfca4f2b390

diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx
index 3a3c191..d2b28df 100644
--- a/svx/source/dialog/hdft.cxx
+++ b/svx/source/dialog/hdft.cxx
@@ -664,11 +664,11 @@ IMPL_LINK_NOARG(SvxHFPage, BackgroundHdl, Button*, void)
     if(pFact)
     {
         //UUUU
-        SfxAbstractTabDialog* pDlg = pFact->CreateSvxBorderBackgroundDlg(
+        ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxBorderBackgroundDlg(
             this,
             *pBBSet,
             true/*EnableBackgroundSelector*/,
-            mbEnableDrawingLayerFillStyles);
+            mbEnableDrawingLayerFillStyles));
 
         DBG_ASSERT(pDlg,"Dialog creation failed!");
         if(RET_OK == pDlg->Execute() && pDlg->GetOutputItemSet())
diff --git a/sw/source/ui/dialog/macassgn.cxx b/sw/source/ui/dialog/macassgn.cxx
index 3fc1146..2c32404 100644
--- a/sw/source/ui/dialog/macassgn.cxx
+++ b/sw/source/ui/dialog/macassgn.cxx
@@ -119,7 +119,7 @@ bool SwMacroAssignDlg::INetFormatDlg( vcl::Window* pParent, SwWrtShell& rSh,
     aSet.Put( AddEvents( MACASSGN_INETFMT ) );
 
     SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-    SfxAbstractDialog* pMacroDlg = pFact->CreateSfxDialog( pParent, aSet,
+    VclPtr<SfxAbstractDialog> pMacroDlg = pFact->CreateSfxDialog( pParent, aSet,
         rSh.GetView().GetViewFrame()->GetFrame().GetFrameInterface(),
         SID_EVENTCONFIG );
     if ( pMacroDlg && pMacroDlg->Execute() == RET_OK )
commit cd3edd369bf3e846a897e4973de361b6380b74f3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Oct 28 10:50:24 2016 +0100

    can do this in one step
    
    Change-Id: Iab4798b34018a272a68d3d1a206dfbeef6ff19ca

diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index b3e19e1..e9055fd 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -478,7 +478,6 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString &rName
 
     const ScPatternAttr*    pOldAttrs       = GetSelectionPattern();
 
-    ScopedVclPtr<SfxAbstractTabDialog> pDlg;
     std::unique_ptr<SfxItemSet> pOldSet(new SfxItemSet(pOldAttrs->GetItemSet()));
     std::unique_ptr<SvxNumberInfoItem> pNumberInfoItem;
 
@@ -538,7 +537,7 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString &rName
     ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
     OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
 
-    pDlg.disposeAndReset(pFact->CreateScAttrDlg(GetDialogParent(), pOldSet.get()));
+    ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScAttrDlg(GetDialogParent(), pOldSet.get()));
 
     if (!rName.isEmpty())
         pDlg->SetCurPageId(rName);
commit 77d5d9f9afed5b4673c9be3976e5c61b4e745739
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Oct 28 10:20:01 2016 +0100

    these usings are unnecessary
    
    Change-Id: Ieeb753b700631958ad101354406b13863b3bab03

diff --git a/include/vcl/lstbox.hxx b/include/vcl/lstbox.hxx
index 194739b..0248e15 100644
--- a/include/vcl/lstbox.hxx
+++ b/include/vcl/lstbox.hxx
@@ -276,10 +276,6 @@ public:
 class VCL_DLLPUBLIC MultiListBox : public ListBox
 {
 public:
-    using ListBox::SaveValue;
-    using ListBox::GetSavedValue;
-    using ListBox::IsValueChangedFromSaved;
-
     explicit        MultiListBox( vcl::Window* pParent, WinBits nStyle );
 
 };


More information about the Libreoffice-commits mailing list