summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-09-20 20:29:36 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-09-26 09:54:18 +0200
commita37e559ed123789f6bc8f7972242d6461ce692ab (patch)
tree7c6304b4541335b2bb706efda58b882132fe3819 /sd
parentb3f249c1351642be6f2774230ff80a6d20bd1401 (diff)
disinherit OWizardPage and SfxTabPage from vcl TabPage
Now that there's no need to support weld/unwelded mixes of pages in dialog any more. inherit from a BuilderPage which contains a Builder and Toplevel container BuilderPage Activate and Deactivate replace TabPage ActivatePage and DeactivatePage, allowing disambiguation wrt SfxTabPage ActivatePage and DeactivatePage. Change-Id: I5706e50fd92f712a25328ee9791e054bb9ad9812 Reviewed-on: https://gerrit.libreoffice.org/79317 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/inc/sdmod.hxx2
-rw-r--r--sd/source/ui/app/sdmod2.cxx22
-rw-r--r--sd/source/ui/dlg/paragr.cxx6
-rw-r--r--sd/source/ui/dlg/prntopts.cxx4
-rw-r--r--sd/source/ui/dlg/tpaction.cxx10
-rw-r--r--sd/source/ui/dlg/tpoption.cxx12
-rw-r--r--sd/source/ui/inc/prntopts.hxx3
-rw-r--r--sd/source/ui/inc/tpaction.hxx5
-rw-r--r--sd/source/ui/inc/tpoption.hxx11
9 files changed, 32 insertions, 43 deletions
diff --git a/sd/inc/sdmod.hxx b/sd/inc/sdmod.hxx
index bcc8a56f86a0..a747e91b2cc3 100644
--- a/sd/inc/sdmod.hxx
+++ b/sd/inc/sdmod.hxx
@@ -112,7 +112,7 @@ public:
// virtual methods for the option dialog
virtual std::unique_ptr<SfxItemSet> CreateItemSet( sal_uInt16 nId ) override;
virtual void ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) override;
- virtual VclPtr<SfxTabPage> CreateTabPage( sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet ) override;
+ virtual std::unique_ptr<SfxTabPage> CreateTabPage( sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet ) override;
virtual std::unique_ptr<SfxStyleFamilies> CreateStyleFamilies() override;
SdExtPropertySetInfoCache gImplImpressPropertySetInfoCache;
diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx
index 5379f25aabde..971ef20cbe66 100644
--- a/sd/source/ui/app/sdmod2.cxx
+++ b/sd/source/ui/app/sdmod2.cxx
@@ -730,9 +730,9 @@ void SdModule::ApplyItemSet( sal_uInt16 nSlot, const SfxItemSet& rSet )
pViewShell->GetViewFrame()->GetBindings().InvalidateAll( true );
}
-VclPtr<SfxTabPage> SdModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet )
+std::unique_ptr<SfxTabPage> SdModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet )
{
- VclPtr<SfxTabPage> pRet;
+ std::unique_ptr<SfxTabPage> xRet;
SfxAllItemSet aSet(*(rSet.GetPool()));
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
@@ -743,7 +743,7 @@ VclPtr<SfxTabPage> SdModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParen
{
::CreateTabPage fnCreatePage = pFact->GetSdOptionsContentsTabPageCreatorFunc();
if( fnCreatePage )
- pRet = (*fnCreatePage)( pParent, &rSet );
+ xRet = (*fnCreatePage)( pParent, &rSet );
}
break;
case SID_SD_TP_SNAP:
@@ -751,7 +751,7 @@ VclPtr<SfxTabPage> SdModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParen
{
::CreateTabPage fnCreatePage = pFact->GetSdOptionsSnapTabPageCreatorFunc();
if( fnCreatePage )
- pRet = (*fnCreatePage)( pParent, &rSet );
+ xRet = (*fnCreatePage)( pParent, &rSet );
}
break;
case SID_SD_TP_PRINT:
@@ -760,10 +760,10 @@ VclPtr<SfxTabPage> SdModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParen
::CreateTabPage fnCreatePage = pFact->GetSdPrintOptionsTabPageCreatorFunc();
if( fnCreatePage )
{
- pRet = (*fnCreatePage)( pParent, &rSet );
+ xRet = (*fnCreatePage)( pParent, &rSet );
if(SID_SD_TP_PRINT == nId)
aSet.Put (SfxUInt32Item(SID_SDMODE_FLAG,SD_DRAW_MODE));
- pRet->PageCreated(aSet);
+ xRet->PageCreated(aSet);
}
}
break;
@@ -773,12 +773,12 @@ VclPtr<SfxTabPage> SdModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParen
::CreateTabPage fnCreatePage = pFact->GetSdOptionsMiscTabPageCreatorFunc();
if( fnCreatePage )
{
- pRet = (*fnCreatePage)( pParent, &rSet );
+ xRet = (*fnCreatePage)( pParent, &rSet );
if(SID_SD_TP_MISC == nId)
aSet.Put (SfxUInt32Item(SID_SDMODE_FLAG,SD_DRAW_MODE));
else
aSet.Put (SfxUInt32Item(SID_SDMODE_FLAG,SD_IMPRESS_MODE));
- pRet->PageCreated(aSet);
+ xRet->PageCreated(aSet);
}
}
break;
@@ -787,13 +787,13 @@ VclPtr<SfxTabPage> SdModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParen
SfxAbstractDialogFactory* pSfxFact = SfxAbstractDialogFactory::Create();
::CreateTabPage fnCreatePage = pSfxFact->GetTabPageCreatorFunc( nId );
if ( fnCreatePage )
- pRet = (*fnCreatePage)( pParent, &rSet );
+ xRet = (*fnCreatePage)( pParent, &rSet );
}
break;
}
- DBG_ASSERT( pRet, "SdModule::CreateTabPage(): no valid ID for TabPage!" );
+ DBG_ASSERT( xRet, "SdModule::CreateTabPage(): no valid ID for TabPage!" );
- return pRet;
+ return xRet;
}
std::unique_ptr<SfxStyleFamilies> SdModule::CreateStyleFamilies()
diff --git a/sd/source/ui/dlg/paragr.cxx b/sd/source/ui/dlg/paragr.cxx
index 4db421f7e02a..7b35e7a52e08 100644
--- a/sd/source/ui/dlg/paragr.cxx
+++ b/sd/source/ui/dlg/paragr.cxx
@@ -35,8 +35,8 @@ class SdParagraphNumTabPage : public SfxTabPage
{
public:
SdParagraphNumTabPage(TabPageParent pParent, const SfxItemSet& rSet);
+ static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet );
- static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet );
static const sal_uInt16* GetRanges();
virtual bool FillItemSet( SfxItemSet* rSet ) override;
@@ -62,9 +62,9 @@ SdParagraphNumTabPage::SdParagraphNumTabPage(TabPageParent pParent, const SfxIte
m_xNewStartNumberCB->connect_clicked(LINK(this, SdParagraphNumTabPage, ImplNewStartHdl));
}
-VclPtr<SfxTabPage> SdParagraphNumTabPage::Create(TabPageParent pParent, const SfxItemSet * rAttrSet)
+std::unique_ptr<SfxTabPage> SdParagraphNumTabPage::Create(TabPageParent pParent, const SfxItemSet * rAttrSet)
{
- return VclPtr<SdParagraphNumTabPage>::Create(pParent, *rAttrSet);
+ return std::make_unique<SdParagraphNumTabPage>(pParent, *rAttrSet);
}
const sal_uInt16* SdParagraphNumTabPage::GetRanges()
diff --git a/sd/source/ui/dlg/prntopts.cxx b/sd/source/ui/dlg/prntopts.cxx
index 74d0f46b0c1b..637954da1f4d 100644
--- a/sd/source/ui/dlg/prntopts.cxx
+++ b/sd/source/ui/dlg/prntopts.cxx
@@ -175,10 +175,10 @@ void SdPrintOptions::Reset( const SfxItemSet* rAttrs )
updateControls();
}
-VclPtr<SfxTabPage> SdPrintOptions::Create( TabPageParent pParent,
+std::unique_ptr<SfxTabPage> SdPrintOptions::Create( TabPageParent pParent,
const SfxItemSet* rOutAttrs )
{
- return VclPtr<SdPrintOptions>::Create( pParent, *rOutAttrs );
+ return std::make_unique<SdPrintOptions>( pParent, *rOutAttrs );
}
IMPL_LINK(SdPrintOptions, ClickCheckboxHdl, weld::ToggleButton&, rCbx, void)
diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx
index 389ccd665245..467e928e1ec3 100644
--- a/sd/source/ui/dlg/tpaction.cxx
+++ b/sd/source/ui/dlg/tpaction.cxx
@@ -74,13 +74,13 @@ SdActionDlg::SdActionDlg(weld::Window* pParent, const SfxItemSet* pAttr, ::sd::V
, rOutAttrs(*pAttr)
{
TabPageParent aParent(get_content_area(), this);
- VclPtr<SfxTabPage> xNewPage = SdTPAction::Create(aParent, rOutAttrs);
+ std::unique_ptr<SfxTabPage> xNewPage = SdTPAction::Create(aParent, rOutAttrs);
// formerly in PageCreated
static_cast<SdTPAction*>( xNewPage.get() )->SetView( pView );
static_cast<SdTPAction*>( xNewPage.get() )->Construct();
- SetTabPage(xNewPage);
+ SetTabPage(std::move(xNewPage));
}
/**
@@ -128,7 +128,6 @@ SdTPAction::SdTPAction(TabPageParent pWindow, const SfxItemSet& rInAttrs)
SdTPAction::~SdTPAction()
{
- disposeOnce();
}
void SdTPAction::SetView( const ::sd::View* pSdView )
@@ -344,10 +343,9 @@ DeactivateRC SdTPAction::DeactivatePage( SfxItemSet* pPageSet )
return DeactivateRC::LeavePage;
}
-VclPtr<SfxTabPage> SdTPAction::Create( TabPageParent pParent,
- const SfxItemSet& rAttrs )
+std::unique_ptr<SfxTabPage> SdTPAction::Create(TabPageParent pParent, const SfxItemSet& rAttrs)
{
- return VclPtr<SdTPAction>::Create( pParent, rAttrs );
+ return std::make_unique<SdTPAction>( pParent, rAttrs );
}
void SdTPAction::UpdateTree()
diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx
index 9e9f8c1d843b..d78a81912d47 100644
--- a/sd/source/ui/dlg/tpoption.cxx
+++ b/sd/source/ui/dlg/tpoption.cxx
@@ -95,10 +95,10 @@ void SdTpOptionsSnap::Reset( const SfxItemSet* rAttrs )
ClickRotateHdl_Impl(*m_xCbxRotate);
}
-VclPtr<SfxTabPage> SdTpOptionsSnap::Create( TabPageParent pWindow,
+std::unique_ptr<SfxTabPage> SdTpOptionsSnap::Create( TabPageParent pWindow,
const SfxItemSet* rAttrs )
{
- return VclPtr<SdTpOptionsSnap>::Create(pWindow, *rAttrs);
+ return std::make_unique<SdTpOptionsSnap>(pWindow, *rAttrs);
}
/*************************************************************************
@@ -157,10 +157,10 @@ void SdTpOptionsContents::Reset( const SfxItemSet* rAttrs )
m_xCbxHandlesBezier->save_state();
}
-VclPtr<SfxTabPage> SdTpOptionsContents::Create( TabPageParent pParent,
+std::unique_ptr<SfxTabPage> SdTpOptionsContents::Create( TabPageParent pParent,
const SfxItemSet* rAttrs )
{
- return VclPtr<SdTpOptionsContents>::Create( pParent, *rAttrs );
+ return std::make_unique<SdTpOptionsContents>(pParent, *rAttrs);
}
/*************************************************************************
@@ -473,10 +473,10 @@ void SdTpOptionsMisc::Reset( const SfxItemSet* rAttrs )
UpdateCompatibilityControls ();
}
-VclPtr<SfxTabPage> SdTpOptionsMisc::Create( TabPageParent pParent,
+std::unique_ptr<SfxTabPage> SdTpOptionsMisc::Create( TabPageParent pParent,
const SfxItemSet* rAttrs )
{
- return VclPtr<SdTpOptionsMisc>::Create( pParent, *rAttrs );
+ return std::make_unique<SdTpOptionsMisc>( pParent, *rAttrs );
}
IMPL_LINK_NOARG(SdTpOptionsMisc, SelectMetricHdl_Impl, weld::ComboBox&, void)
diff --git a/sd/source/ui/inc/prntopts.hxx b/sd/source/ui/inc/prntopts.hxx
index 46077ef749a1..2ed29ac79a07 100644
--- a/sd/source/ui/inc/prntopts.hxx
+++ b/sd/source/ui/inc/prntopts.hxx
@@ -52,12 +52,11 @@ private:
void updateControls();
- using OutputDevice::SetDrawMode;
public:
SdPrintOptions(TabPageParent pParent, const SfxItemSet& rInAttrs);
virtual ~SdPrintOptions() override;
- static VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* );
+ static std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet* );
virtual bool FillItemSet( SfxItemSet* ) override;
virtual void Reset( const SfxItemSet * ) override;
diff --git a/sd/source/ui/inc/tpaction.hxx b/sd/source/ui/inc/tpaction.hxx
index bd862e2135c4..fec2110a8008 100644
--- a/sd/source/ui/inc/tpaction.hxx
+++ b/sd/source/ui/inc/tpaction.hxx
@@ -90,7 +90,7 @@ public:
SdTPAction(TabPageParent pParent, const SfxItemSet& rInAttrs);
virtual ~SdTPAction() override;
- static VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet& );
+ static std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet& );
virtual bool FillItemSet( SfxItemSet* ) override;
virtual void Reset( const SfxItemSet * ) override;
@@ -101,9 +101,6 @@ public:
void Construct();
void SetView( const ::sd::View* pSdView );
-
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
};
#endif // INCLUDED_SD_SOURCE_UI_INC_TPACTION_HXX
diff --git a/sd/source/ui/inc/tpoption.hxx b/sd/source/ui/inc/tpoption.hxx
index c4d17ef6c380..fd1a300afdb3 100644
--- a/sd/source/ui/inc/tpoption.hxx
+++ b/sd/source/ui/inc/tpoption.hxx
@@ -30,9 +30,9 @@ class SdTpOptionsSnap : public SvxGridTabPage
{
public:
SdTpOptionsSnap(TabPageParent pParent, const SfxItemSet& rInAttrs);
+ static std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet* );
virtual ~SdTpOptionsSnap() override;
- static VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* );
virtual bool FillItemSet( SfxItemSet* ) override;
virtual void Reset( const SfxItemSet * ) override;
};
@@ -50,9 +50,9 @@ private:
public:
SdTpOptionsContents(TabPageParent pParent, const SfxItemSet& rInAttrs);
+ static std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet* );
virtual ~SdTpOptionsContents() override;
- static VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* );
virtual bool FillItemSet( SfxItemSet* ) override;
virtual void Reset( const SfxItemSet * ) override;
};
@@ -123,9 +123,9 @@ protected:
public:
SdTpOptionsMisc(TabPageParent pParent, const SfxItemSet& rInAttrs);
+ static std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet* );
virtual ~SdTpOptionsMisc() override;
- static VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* );
virtual bool FillItemSet( SfxItemSet* ) override;
virtual void Reset( const SfxItemSet * ) override;
@@ -141,11 +141,6 @@ public:
*/
void SetImpressMode();
virtual void PageCreated(const SfxAllItemSet& aSet) override;
-
- using TabPage::ActivatePage;
- using TabPage::DeactivatePage;
- using OutputDevice::SetDrawMode;
-
};
#endif // INCLUDED_SD_SOURCE_UI_INC_TPOPTION_HXX