summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/tabdlg.cxx29
1 files changed, 27 insertions, 2 deletions
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 3ccc31662287..4fcc3cc25653 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -1938,6 +1938,17 @@ void SfxTabDialogController::AddTabPage(const OString &rName, const OUString& rR
AddTabPage(rName, nPageCreateId);
}
+/* [Description]
+
+ Default implementation of the virtual Method.
+ This is called when pages create their sets onDemand.
+*/
+SfxItemSet* SfxTabDialogController::CreateInputItemSet(const OString&)
+{
+ SAL_WARN( "sfx.dialog", "CreateInputItemSet not implemented" );
+ return new SfxAllItemSet(SfxGetpApp()->GetPool());
+}
+
void SfxTabDialogController::CreatePages()
{
for (auto pDataObject : m_pImpl->aData)
@@ -1946,9 +1957,13 @@ void SfxTabDialogController::CreatePages()
continue;
weld::Container* pPage = m_xTabCtrl->get_page(pDataObject->sId);
// TODO eventually pass DialogController as distinct argument instead of bundling into TabPageParent
- pDataObject->pTabPage = (pDataObject->fnCreatePage)(TabPageParent(pPage, this), m_pSet.get());
- pDataObject->pTabPage->SetDialogController(this);
+ TabPageParent aParent(pPage, this);
+ if (m_pSet)
+ pDataObject->pTabPage = (pDataObject->fnCreatePage)(aParent, m_pSet.get());
+ else
+ pDataObject->pTabPage = (pDataObject->fnCreatePage)(aParent, CreateInputItemSet(pDataObject->sId));
+ pDataObject->pTabPage->SetDialogController(this);
OUString sConfigId = OStringToOUString(pDataObject->pTabPage->GetConfigId(), RTL_TEXTENCODING_UTF8);
SvtViewOptions aPageOpt(EViewType::TabPage, sConfigId);
OUString sUserData;
@@ -2058,6 +2073,16 @@ void SfxTabDialogController::SetCurPageId(const OString& rIdent)
m_xTabCtrl->set_current_page(m_sAppPageId);
}
+/* [Description]
+
+ The TabPage is activated with the specified Id.
+*/
+void SfxTabDialogController::ShowPage(const OString& rIdent)
+{
+ SetCurPageId(rIdent);
+ ActivatePageHdl(rIdent);
+}
+
OString SfxTabDialogController::GetCurPageId() const
{
return m_xTabCtrl->get_current_page_ident();