Kaydet (Commit) 32be5541 authored tarafından Noel Grandin's avatar Noel Grandin

cleanup code in IconChoiceDialog::ActivatePageImpl

which has been this way ever since
   commit d32b3a71
   Author: Mathias Bauer <mba@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/37664Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 4dc82399
...@@ -99,8 +99,8 @@ bool SvxHyperlinkNewDocTp::ImplGetURLObject( const OUString& rPath, const OUStri ...@@ -99,8 +99,8 @@ bool SvxHyperlinkNewDocTp::ImplGetURLObject( const OUString& rPath, const OUStri
|* |*
|************************************************************************/ |************************************************************************/
SvxHyperlinkNewDocTp::SvxHyperlinkNewDocTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet) SvxHyperlinkNewDocTp::SvxHyperlinkNewDocTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet* pItemSet)
: SvxHyperlinkTabPageBase ( pParent, pDlg, "HyperlinkNewDocPage", "cui/ui/hyperlinknewdocpage.ui", rItemSet ) : SvxHyperlinkTabPageBase ( pParent, pDlg, "HyperlinkNewDocPage", "cui/ui/hyperlinknewdocpage.ui", pItemSet )
{ {
get(m_pRbtEditNow, "editnow"); get(m_pRbtEditNow, "editnow");
get(m_pRbtEditLater, "editlater"); get(m_pRbtEditLater, "editlater");
...@@ -247,9 +247,9 @@ void SvxHyperlinkNewDocTp::GetCurentItemData ( OUString& rStrURL, OUString& aStr ...@@ -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 );
} }
/************************************************************************* /*************************************************************************
......
...@@ -35,8 +35,8 @@ sal_Char const sFileScheme[] = INET_FILE_SCHEME; ...@@ -35,8 +35,8 @@ sal_Char const sFileScheme[] = INET_FILE_SCHEME;
|* |*
|************************************************************************/ |************************************************************************/
SvxHyperlinkDocTp::SvxHyperlinkDocTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet) SvxHyperlinkDocTp::SvxHyperlinkDocTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet* pItemSet)
: SvxHyperlinkTabPageBase ( pParent, pDlg, "HyperlinkDocPage", "cui/ui/hyperlinkdocpage.ui", rItemSet ), : SvxHyperlinkTabPageBase ( pParent, pDlg, "HyperlinkDocPage", "cui/ui/hyperlinkdocpage.ui", pItemSet ),
mbMarkWndOpen ( false ) mbMarkWndOpen ( false )
{ {
get(m_pCbbPath, "path"); get(m_pCbbPath, "path");
...@@ -172,9 +172,9 @@ void SvxHyperlinkDocTp::GetCurentItemData ( OUString& rStrURL, OUString& aStrNam ...@@ -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 );
} }
/************************************************************************* /*************************************************************************
......
...@@ -35,9 +35,9 @@ sal_Char const sFTPScheme[] = INET_FTP_SCHEME; ...@@ -35,9 +35,9 @@ sal_Char const sFTPScheme[] = INET_FTP_SCHEME;
SvxHyperlinkInternetTp::SvxHyperlinkInternetTp ( vcl::Window *pParent, SvxHyperlinkInternetTp::SvxHyperlinkInternetTp ( vcl::Window *pParent,
IconChoiceDialog* pDlg, IconChoiceDialog* pDlg,
const SfxItemSet& rItemSet) const SfxItemSet* pItemSet)
: SvxHyperlinkTabPageBase ( pParent, pDlg, "HyperlinkInternetPage", "cui/ui/hyperlinkinternetpage.ui", : SvxHyperlinkTabPageBase ( pParent, pDlg, "HyperlinkInternetPage", "cui/ui/hyperlinkinternetpage.ui",
rItemSet ) , pItemSet ) ,
mbMarkWndOpen ( false ) mbMarkWndOpen ( false )
{ {
get(m_pRbtLinktypInternet, "linktyp_internet"); get(m_pRbtLinktypInternet, "linktyp_internet");
...@@ -193,9 +193,9 @@ OUString SvxHyperlinkInternetTp::CreateAbsoluteURL() const ...@@ -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 );
} }
/************************************************************************* /*************************************************************************
......
...@@ -38,9 +38,9 @@ using namespace ::com::sun::star; ...@@ -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", : SvxHyperlinkTabPageBase ( pParent, pDlg, "HyperlinkMailPage", "cui/ui/hyperlinkmailpage.ui",
rItemSet ) pItemSet )
{ {
get(m_pCbbReceiver, "receiver"); get(m_pCbbReceiver, "receiver");
m_pCbbReceiver->SetSmartProtocol(INetProtocol::Mailto); m_pCbbReceiver->SetSmartProtocol(INetProtocol::Mailto);
...@@ -173,9 +173,9 @@ OUString SvxHyperlinkMailTp::CreateAbsoluteURL() const ...@@ -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 );
} }
/************************************************************************* /*************************************************************************
......
...@@ -105,8 +105,8 @@ SvxHyperlinkTabPageBase::SvxHyperlinkTabPageBase ( vcl::Window *pParent, ...@@ -105,8 +105,8 @@ SvxHyperlinkTabPageBase::SvxHyperlinkTabPageBase ( vcl::Window *pParent,
IconChoiceDialog* pDlg, IconChoiceDialog* pDlg,
const OString& rID, const OString& rID,
const OUString& rUIXMLDescription, const OUString& rUIXMLDescription,
const SfxItemSet& rItemSet ) const SfxItemSet* pItemSet )
: IconChoicePage ( pParent, rID, rUIXMLDescription, rItemSet ), : IconChoicePage ( pParent, rID, rUIXMLDescription, pItemSet ),
mpCbbFrame ( nullptr ), mpCbbFrame ( nullptr ),
mpLbForm ( nullptr ), mpLbForm ( nullptr ),
mpEdIndication ( nullptr ), mpEdIndication ( nullptr ),
......
...@@ -42,9 +42,9 @@ using std::vector; ...@@ -42,9 +42,9 @@ using std::vector;
IconChoicePage::IconChoicePage( vcl::Window *pParent, const OString& rID, IconChoicePage::IconChoicePage( vcl::Window *pParent, const OString& rID,
const OUString& rUIXMLDescription, const OUString& rUIXMLDescription,
const SfxItemSet &rAttrSet ) const SfxItemSet* pItemSet )
: TabPage ( pParent, rID, rUIXMLDescription ), : TabPage ( pParent, rID, rUIXMLDescription ),
pSet ( &rAttrSet ), pSet ( pItemSet ),
bHasExchangeSupport ( false ), bHasExchangeSupport ( false ),
pDialog ( nullptr ) pDialog ( nullptr )
{ {
...@@ -407,20 +407,8 @@ void IconChoiceDialog::ActivatePageImpl () ...@@ -407,20 +407,8 @@ void IconChoiceDialog::ActivatePageImpl ()
{ {
if ( !pData->pPage ) if ( !pData->pPage )
{ {
const SfxItemSet* pTmpSet = nullptr; pData->pPage = (pData->fnCreatePage)( m_pTabContainer, this, pSet );
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->Reset( *pSet ); pData->pPage->Reset( *pSet );
PageCreated( mnCurrentPageId, *pData->pPage ); PageCreated( mnCurrentPageId, *pData->pPage );
} }
else if ( pData->bRefresh ) else if ( pData->bRefresh )
...@@ -568,13 +556,6 @@ void IconChoiceDialog::PageCreated( sal_uInt16 /*nId*/, IconChoicePage& /*rPage* ...@@ -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 | start dialog
......
...@@ -48,11 +48,11 @@ protected: ...@@ -48,11 +48,11 @@ protected:
SvxLinkInsertMode& eMode ) override; SvxLinkInsertMode& eMode ) override;
public: public:
SvxHyperlinkNewDocTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet); SvxHyperlinkNewDocTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet* pItemSet);
virtual ~SvxHyperlinkNewDocTp () override; virtual ~SvxHyperlinkNewDocTp () override;
virtual void dispose() 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 bool AskApply () override;
virtual void DoApply () override; virtual void DoApply () override;
......
...@@ -66,11 +66,11 @@ protected: ...@@ -66,11 +66,11 @@ protected:
OUString GetCurrentURL (); OUString GetCurrentURL ();
public: public:
SvxHyperlinkDocTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet); SvxHyperlinkDocTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet* pItemSet);
virtual ~SvxHyperlinkDocTp() override; virtual ~SvxHyperlinkDocTp() override;
virtual void dispose() 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; virtual void SetMarkStr ( const OUString& aStrMark ) override;
......
...@@ -75,11 +75,11 @@ protected: ...@@ -75,11 +75,11 @@ protected:
virtual void SetMarkWndShouldOpen (bool bOpen) override {mbMarkWndOpen=bOpen;} virtual void SetMarkWndShouldOpen (bool bOpen) override {mbMarkWndOpen=bOpen;}
public: public:
SvxHyperlinkInternetTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet); SvxHyperlinkInternetTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet* pItemSet);
virtual ~SvxHyperlinkInternetTp() override; virtual ~SvxHyperlinkInternetTp() override;
virtual void dispose() 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; virtual void SetMarkStr ( const OUString& aStrMark ) override;
......
...@@ -51,11 +51,11 @@ protected: ...@@ -51,11 +51,11 @@ protected:
SvxLinkInsertMode& eMode ) override; SvxLinkInsertMode& eMode ) override;
public: public:
SvxHyperlinkMailTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet); SvxHyperlinkMailTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet* pItemSet);
virtual ~SvxHyperlinkMailTp() override; virtual ~SvxHyperlinkMailTp() override;
virtual void dispose() 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; virtual void SetInitFocus() override;
}; };
......
...@@ -107,7 +107,7 @@ public: ...@@ -107,7 +107,7 @@ public:
IconChoiceDialog* pDlg, IconChoiceDialog* pDlg,
const OString& rID, const OString& rID,
const OUString& rUIXMLDescription, const OUString& rUIXMLDescription,
const SfxItemSet& rItemSet const SfxItemSet* pItemSet
); );
virtual ~SvxHyperlinkTabPageBase () override; virtual ~SvxHyperlinkTabPageBase () override;
virtual void dispose() override; virtual void dispose() override;
......
...@@ -38,7 +38,7 @@ class SfxItemPool; ...@@ -38,7 +38,7 @@ class SfxItemPool;
class SfxItemSet; class SfxItemSet;
// Create-Function // 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 /// Data-structure for pages in dialog
struct IconChoicePageData struct IconChoicePageData
...@@ -71,7 +71,7 @@ protected: ...@@ -71,7 +71,7 @@ protected:
using TabPage::ActivatePage; using TabPage::ActivatePage;
using TabPage::DeactivatePage; 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: public:
virtual ~IconChoicePage() override; virtual ~IconChoicePage() override;
...@@ -137,7 +137,6 @@ protected: ...@@ -137,7 +137,6 @@ protected:
static void HidePageImpl ( IconChoicePageData* pData ); static void HidePageImpl ( IconChoicePageData* pData );
virtual void PageCreated( sal_uInt16 nId, IconChoicePage& rPage ); virtual void PageCreated( sal_uInt16 nId, IconChoicePage& rPage );
static SfxItemSet* CreateInputItemSet( sal_uInt16 nId );
IconChoicePage* GetTabPage( sal_uInt16 nPageId ) IconChoicePage* GetTabPage( sal_uInt16 nPageId )
{ return ( GetPageData (nPageId)->pPage ? GetPageData (nPageId)->pPage.get() : nullptr); } { return ( GetPageData (nPageId)->pPage ? GetPageData (nPageId)->pPage.get() : nullptr); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment