[Libreoffice-commits] core.git: cui/source

Noel Grandin noel.grandin at collabora.co.uk
Tue May 16 09:21:40 UTC 2017


 cui/source/dialogs/hldocntp.cxx |    8 ++++----
 cui/source/dialogs/hldoctp.cxx  |    8 ++++----
 cui/source/dialogs/hlinettp.cxx |    8 ++++----
 cui/source/dialogs/hlmailtp.cxx |    8 ++++----
 cui/source/dialogs/hltpbase.cxx |    4 ++--
 cui/source/dialogs/iconcdlg.cxx |   25 +++----------------------
 cui/source/inc/hldocntp.hxx     |    4 ++--
 cui/source/inc/hldoctp.hxx      |    4 ++--
 cui/source/inc/hlinettp.hxx     |    4 ++--
 cui/source/inc/hlmailtp.hxx     |    4 ++--
 cui/source/inc/hltpbase.hxx     |    2 +-
 cui/source/inc/iconcdlg.hxx     |    5 ++---
 12 files changed, 32 insertions(+), 52 deletions(-)

New commits:
commit 32be55414da2af0ea796a57c7f15d18a3fd756cb
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue May 16 10:11:26 2017 +0200

    cleanup code in IconChoiceDialog::ActivatePageImpl
    
    which has been this way ever since
       commit d32b3a714fe55892bdead03502c5a9b0e77fa61d
       Author: Mathias Bauer <mba at openoffice.org>
       Date:   Sat Oct 31 00:36:06 2009 +0100
       #i106421#: move svx/source/cui to cui
    
    And pass the SfxItemSet as a pointer up the constructor hierarchy,
    instead of a reference, since the base class wants a pointer anyway
    
    Change-Id: Iac4081fb5f3fc9cb9b0223f903d74ba84cdd5f6c
    Reviewed-on: https://gerrit.libreoffice.org/37664
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index 34ca087432b1..2b4c4e533a6f 100644
--- a/cui/source/dialogs/hldocntp.cxx
+++ b/cui/source/dialogs/hldocntp.cxx
@@ -99,8 +99,8 @@ bool SvxHyperlinkNewDocTp::ImplGetURLObject( const OUString& rPath, const OUStri
 |*
 |************************************************************************/
 
-SvxHyperlinkNewDocTp::SvxHyperlinkNewDocTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet)
-:   SvxHyperlinkTabPageBase ( pParent, pDlg, "HyperlinkNewDocPage", "cui/ui/hyperlinknewdocpage.ui", rItemSet )
+SvxHyperlinkNewDocTp::SvxHyperlinkNewDocTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet* pItemSet)
+:   SvxHyperlinkTabPageBase ( pParent, pDlg, "HyperlinkNewDocPage", "cui/ui/hyperlinknewdocpage.ui", pItemSet )
 {
     get(m_pRbtEditNow, "editnow");
     get(m_pRbtEditLater, "editlater");
@@ -247,9 +247,9 @@ void SvxHyperlinkNewDocTp::GetCurentItemData ( OUString& rStrURL, OUString& aStr
 |*
 |************************************************************************/
 
-VclPtr<IconChoicePage> SvxHyperlinkNewDocTp::Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet )
+VclPtr<IconChoicePage> SvxHyperlinkNewDocTp::Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet* pItemSet )
 {
-    return VclPtr<SvxHyperlinkNewDocTp>::Create( pWindow, pDlg, rItemSet );
+    return VclPtr<SvxHyperlinkNewDocTp>::Create( pWindow, pDlg, pItemSet );
 }
 
 /*************************************************************************
diff --git a/cui/source/dialogs/hldoctp.cxx b/cui/source/dialogs/hldoctp.cxx
index 1c002d1035fb..92c4e64a3602 100644
--- a/cui/source/dialogs/hldoctp.cxx
+++ b/cui/source/dialogs/hldoctp.cxx
@@ -35,8 +35,8 @@ sal_Char const sFileScheme[]    = INET_FILE_SCHEME;
 |*
 |************************************************************************/
 
-SvxHyperlinkDocTp::SvxHyperlinkDocTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet)
-    : SvxHyperlinkTabPageBase ( pParent, pDlg, "HyperlinkDocPage", "cui/ui/hyperlinkdocpage.ui", rItemSet ),
+SvxHyperlinkDocTp::SvxHyperlinkDocTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet* pItemSet)
+    : SvxHyperlinkTabPageBase ( pParent, pDlg, "HyperlinkDocPage", "cui/ui/hyperlinkdocpage.ui", pItemSet ),
     mbMarkWndOpen   ( false )
 {
     get(m_pCbbPath, "path");
@@ -172,9 +172,9 @@ void SvxHyperlinkDocTp::GetCurentItemData ( OUString& rStrURL, OUString& aStrNam
 |*
 |************************************************************************/
 
-VclPtr<IconChoicePage> SvxHyperlinkDocTp::Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet )
+VclPtr<IconChoicePage> SvxHyperlinkDocTp::Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet* pItemSet )
 {
-    return VclPtr<SvxHyperlinkDocTp>::Create( pWindow, pDlg, rItemSet );
+    return VclPtr<SvxHyperlinkDocTp>::Create( pWindow, pDlg, pItemSet );
 }
 
 /*************************************************************************
diff --git a/cui/source/dialogs/hlinettp.cxx b/cui/source/dialogs/hlinettp.cxx
index 9b6ff256b5f1..eb86a6629873 100644
--- a/cui/source/dialogs/hlinettp.cxx
+++ b/cui/source/dialogs/hlinettp.cxx
@@ -35,9 +35,9 @@ sal_Char const sFTPScheme[]    = INET_FTP_SCHEME;
 
 SvxHyperlinkInternetTp::SvxHyperlinkInternetTp ( vcl::Window *pParent,
                                                  IconChoiceDialog* pDlg,
-                                                 const SfxItemSet& rItemSet)
+                                                 const SfxItemSet* pItemSet)
 :   SvxHyperlinkTabPageBase ( pParent, pDlg, "HyperlinkInternetPage", "cui/ui/hyperlinkinternetpage.ui",
-                              rItemSet ) ,
+                              pItemSet ) ,
     mbMarkWndOpen           ( false )
 {
     get(m_pRbtLinktypInternet, "linktyp_internet");
@@ -193,9 +193,9 @@ OUString SvxHyperlinkInternetTp::CreateAbsoluteURL() const
 |*
 |************************************************************************/
 
-VclPtr<IconChoicePage> SvxHyperlinkInternetTp::Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet )
+VclPtr<IconChoicePage> SvxHyperlinkInternetTp::Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet* pItemSet )
 {
-    return VclPtr<SvxHyperlinkInternetTp>::Create( pWindow, pDlg, rItemSet );
+    return VclPtr<SvxHyperlinkInternetTp>::Create( pWindow, pDlg, pItemSet );
 }
 
 /*************************************************************************
diff --git a/cui/source/dialogs/hlmailtp.cxx b/cui/source/dialogs/hlmailtp.cxx
index 1edb472dd525..9170db2e63fc 100644
--- a/cui/source/dialogs/hlmailtp.cxx
+++ b/cui/source/dialogs/hlmailtp.cxx
@@ -38,9 +38,9 @@ using namespace ::com::sun::star;
 |*
 |************************************************************************/
 
-SvxHyperlinkMailTp::SvxHyperlinkMailTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet)
+SvxHyperlinkMailTp::SvxHyperlinkMailTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet* pItemSet)
 :   SvxHyperlinkTabPageBase ( pParent, pDlg, "HyperlinkMailPage", "cui/ui/hyperlinkmailpage.ui",
-                              rItemSet )
+                              pItemSet )
 {
     get(m_pCbbReceiver, "receiver");
     m_pCbbReceiver->SetSmartProtocol(INetProtocol::Mailto);
@@ -173,9 +173,9 @@ OUString SvxHyperlinkMailTp::CreateAbsoluteURL() const
 |*
 |************************************************************************/
 
-VclPtr<IconChoicePage> SvxHyperlinkMailTp::Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet )
+VclPtr<IconChoicePage> SvxHyperlinkMailTp::Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet* pItemSet )
 {
-    return VclPtr<SvxHyperlinkMailTp>::Create( pWindow, pDlg, rItemSet );
+    return VclPtr<SvxHyperlinkMailTp>::Create( pWindow, pDlg, pItemSet );
 }
 
 /*************************************************************************
diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx
index e85226c9c1e1..255c6759532d 100644
--- a/cui/source/dialogs/hltpbase.cxx
+++ b/cui/source/dialogs/hltpbase.cxx
@@ -105,8 +105,8 @@ SvxHyperlinkTabPageBase::SvxHyperlinkTabPageBase ( vcl::Window *pParent,
                                                    IconChoiceDialog* pDlg,
                                                    const OString& rID,
                                                    const OUString& rUIXMLDescription,
-                                                   const SfxItemSet& rItemSet )
-:   IconChoicePage          ( pParent, rID, rUIXMLDescription, rItemSet ),
+                                                   const SfxItemSet* pItemSet )
+:   IconChoicePage          ( pParent, rID, rUIXMLDescription, pItemSet ),
     mpCbbFrame              ( nullptr ),
     mpLbForm                ( nullptr ),
     mpEdIndication          ( nullptr ),
diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index 94c6ddc9f45e..360f6c19c19b 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -42,9 +42,9 @@ using std::vector;
 
 IconChoicePage::IconChoicePage( vcl::Window *pParent, const OString& rID,
                                 const OUString& rUIXMLDescription,
-                                const SfxItemSet &rAttrSet )
+                                const SfxItemSet* pItemSet )
 :   TabPage                   ( pParent, rID, rUIXMLDescription ),
-    pSet                      ( &rAttrSet ),
+    pSet                      ( pItemSet ),
     bHasExchangeSupport       ( false ),
     pDialog                   ( nullptr )
 {
@@ -407,20 +407,8 @@ void IconChoiceDialog::ActivatePageImpl ()
     {
         if ( !pData->pPage )
         {
-            const SfxItemSet* pTmpSet = nullptr;
-
-            if ( pSet )
-            {
-                pTmpSet = pSet;
-            }
-
-            if ( pTmpSet )
-                pData->pPage = (pData->fnCreatePage)( m_pTabContainer, this, *pTmpSet );
-            else
-                pData->pPage = (pData->fnCreatePage)( m_pTabContainer, this, *CreateInputItemSet( mnCurrentPageId ) );
-
+            pData->pPage = (pData->fnCreatePage)( m_pTabContainer, this, pSet );
             pData->pPage->Reset( *pSet );
-
             PageCreated( mnCurrentPageId, *pData->pPage );
         }
         else if ( pData->bRefresh )
@@ -568,13 +556,6 @@ void IconChoiceDialog::PageCreated( sal_uInt16 /*nId*/, IconChoicePage& /*rPage*
 }
 
 
-SfxItemSet* IconChoiceDialog::CreateInputItemSet( sal_uInt16 )
-{
-    SAL_INFO( "cui.dialogs", "CreateInputItemSet not implemented" );
-
-    return nullptr;
-}
-
 /**********************************************************************
 |
 | start dialog
diff --git a/cui/source/inc/hldocntp.hxx b/cui/source/inc/hldocntp.hxx
index 82bf563f53cd..c33bb85a7610 100644
--- a/cui/source/inc/hldocntp.hxx
+++ b/cui/source/inc/hldocntp.hxx
@@ -48,11 +48,11 @@ protected:
                              SvxLinkInsertMode& eMode ) override;
 
 public:
-    SvxHyperlinkNewDocTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet);
+    SvxHyperlinkNewDocTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet* pItemSet);
     virtual ~SvxHyperlinkNewDocTp () override;
     virtual void dispose() override;
 
-    static  VclPtr<IconChoicePage> Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet );
+    static  VclPtr<IconChoicePage> Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet* pItemSet );
 
     virtual bool        AskApply () override;
     virtual void        DoApply () override;
diff --git a/cui/source/inc/hldoctp.hxx b/cui/source/inc/hldoctp.hxx
index be739f471468..51e4f9cc7002 100644
--- a/cui/source/inc/hldoctp.hxx
+++ b/cui/source/inc/hldoctp.hxx
@@ -66,11 +66,11 @@ protected:
     OUString GetCurrentURL    ();
 
 public:
-    SvxHyperlinkDocTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet);
+    SvxHyperlinkDocTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet* pItemSet);
     virtual ~SvxHyperlinkDocTp() override;
     virtual void dispose() override;
 
-    static VclPtr<IconChoicePage> Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet );
+    static VclPtr<IconChoicePage> Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet* pItemSet );
 
     virtual void        SetMarkStr ( const OUString& aStrMark ) override;
 
diff --git a/cui/source/inc/hlinettp.hxx b/cui/source/inc/hlinettp.hxx
index f10bf5a0b297..79b0e0750e25 100644
--- a/cui/source/inc/hlinettp.hxx
+++ b/cui/source/inc/hlinettp.hxx
@@ -75,11 +75,11 @@ protected:
     virtual void SetMarkWndShouldOpen (bool bOpen) override {mbMarkWndOpen=bOpen;}
 
 public:
-    SvxHyperlinkInternetTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet);
+    SvxHyperlinkInternetTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet* pItemSet);
     virtual ~SvxHyperlinkInternetTp() override;
     virtual void dispose() override;
 
-    static  VclPtr<IconChoicePage> Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet );
+    static  VclPtr<IconChoicePage> Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet* pItemSet );
 
     virtual void        SetMarkStr ( const OUString& aStrMark ) override;
 
diff --git a/cui/source/inc/hlmailtp.hxx b/cui/source/inc/hlmailtp.hxx
index 349437d1ef2e..77fef7a473f2 100644
--- a/cui/source/inc/hlmailtp.hxx
+++ b/cui/source/inc/hlmailtp.hxx
@@ -51,11 +51,11 @@ protected:
                                      SvxLinkInsertMode& eMode ) override;
 
 public:
-    SvxHyperlinkMailTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet);
+    SvxHyperlinkMailTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet* pItemSet);
     virtual ~SvxHyperlinkMailTp() override;
     virtual void dispose() override;
 
-    static VclPtr<IconChoicePage> Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet );
+    static VclPtr<IconChoicePage> Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet* pItemSet );
 
     virtual void        SetInitFocus() override;
 };
diff --git a/cui/source/inc/hltpbase.hxx b/cui/source/inc/hltpbase.hxx
index 5debbd79f5dc..310942d6ddb4 100644
--- a/cui/source/inc/hltpbase.hxx
+++ b/cui/source/inc/hltpbase.hxx
@@ -107,7 +107,7 @@ public:
         IconChoiceDialog* pDlg,
         const OString& rID,
         const OUString& rUIXMLDescription,
-        const SfxItemSet& rItemSet
+        const SfxItemSet* pItemSet
     );
     virtual ~SvxHyperlinkTabPageBase () override;
     virtual void dispose() override;
diff --git a/cui/source/inc/iconcdlg.hxx b/cui/source/inc/iconcdlg.hxx
index ba8ac1d02bcd..adfdf0941a06 100644
--- a/cui/source/inc/iconcdlg.hxx
+++ b/cui/source/inc/iconcdlg.hxx
@@ -38,7 +38,7 @@ class SfxItemPool;
 class SfxItemSet;
 
 // Create-Function
-typedef VclPtr<IconChoicePage> (*CreatePage)(vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet &rAttrSet);
+typedef VclPtr<IconChoicePage> (*CreatePage)(vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet* pAttrSet);
 
 /// Data-structure for pages in dialog
 struct IconChoicePageData
@@ -71,7 +71,7 @@ protected:
     using TabPage::ActivatePage;
     using TabPage::DeactivatePage;
 
-    IconChoicePage( vcl::Window *pParent, const OString& rID, const OUString& rUIXMLDescription, const SfxItemSet &rAttrSet );
+    IconChoicePage( vcl::Window *pParent, const OString& rID, const OUString& rUIXMLDescription, const SfxItemSet* pItemSet );
 
 public:
     virtual ~IconChoicePage() override;
@@ -137,7 +137,6 @@ protected:
     static void             HidePageImpl ( IconChoicePageData* pData );
 
     virtual void            PageCreated( sal_uInt16 nId, IconChoicePage& rPage );
-    static SfxItemSet*      CreateInputItemSet( sal_uInt16 nId );
     IconChoicePage*  GetTabPage( sal_uInt16 nPageId )
                                 { return ( GetPageData (nPageId)->pPage ? GetPageData (nPageId)->pPage.get() : nullptr); }
 


More information about the Libreoffice-commits mailing list