summaryrefslogtreecommitdiff
path: root/sfx2/source/dialog/tabdlg.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-01-07 14:31:56 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-01-07 16:17:52 +0000
commit6b3686e54520b5cf02d6ce03aa421c755a33b140 (patch)
tree3710b998585ea32da78693408ebadcb22e48374f /sfx2/source/dialog/tabdlg.cxx
parent0cdf12e0ee217916e25593184d38306a05388fbb (diff)
allow associating tab page names and tab page creation ids
so we can refer to the .ui name of the tab dialog and pass in the page creation id to associate with that Change-Id: If3df6d3de9dc7da482a45d7d91b610b81981d5ed
Diffstat (limited to 'sfx2/source/dialog/tabdlg.cxx')
-rw-r--r--sfx2/source/dialog/tabdlg.cxx71
1 files changed, 59 insertions, 12 deletions
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index aca2b196fdac..68d001dbee3c 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -434,13 +434,11 @@ SfxTabDialog::SfxTabDialog
(
SfxViewFrame* pViewFrame, // Frame, to which the Dialog belongs
Window* pParent, // Parent Window
- const rtl::OString& rID, const rtl::OUString& rUIXMLDescription, //Dialog Name, Dialog .ui path
+ const OString& rID, const OUString& rUIXMLDescription, //Dialog Name, Dialog .ui path
const SfxItemSet* pItemSet, // Itemset with the data;
// can be NULL, when Pages are onDemand
- sal_Bool bEditFmt, // Flag: templates are processed
+ sal_Bool bEditFmt // Flag: templates are processed
// when yes -> additional Button for standard
- const String* pUserButtonText // Text for UserButton;
- // if != 0, the UserButton is created
)
: TabDialog(pParent, rID, rUIXMLDescription)
, pFrame(pViewFrame)
@@ -453,7 +451,7 @@ SfxTabDialog::SfxTabDialog
, bFmt(bEditFmt)
, pExampleSet(0)
{
- Init_Impl( bFmt, pUserButtonText, NULL );
+ Init_Impl( bFmt, NULL, NULL );
}
// -----------------------------------------------------------------------
@@ -483,6 +481,36 @@ SfxTabDialog::SfxTabDialog
DBG_WARNING( "Please use the Construtor with the ViewFrame" );
}
+SfxTabDialog::SfxTabDialog
+
+/* [Description]
+
+ Constructor, temporary without Frame
+*/
+
+(
+ Window* pParent, // Parent Window
+ const OString& rID, const OUString& rUIXMLDescription, //Dialog Name, Dialog .ui path
+ const SfxItemSet* pItemSet, // Itemset with the data;
+ // can be NULL, when Pages are onDemand
+ sal_Bool bEditFmt // Flag: templates are processed
+ // when yes -> additional Button for standard
+)
+ : TabDialog(pParent, rID, rUIXMLDescription)
+ , pFrame(0)
+ , pSet(pItemSet)
+ , pOutSet(0)
+ , pRanges(0)
+ , nResId(0)
+ , nAppPageId(USHRT_MAX)
+ , bItemsReset(sal_False)
+ , bFmt(bEditFmt)
+ , pExampleSet(0)
+{
+ Init_Impl(bFmt, NULL, NULL);
+ DBG_WARNING( "Please use the Construtor with the ViewFrame" );
+}
+
// -----------------------------------------------------------------------
SfxTabDialog::~SfxTabDialog()
@@ -629,7 +657,8 @@ void SfxTabDialog::Init_Impl( sal_Bool bFmtFlag, const String* pUserButtonText,
if ( m_pUserBtn )
{
- m_pUserBtn->SetText( *pUserButtonText );
+ if (pUserButtonText)
+ m_pUserBtn->SetText(*pUserButtonText);
m_pUserBtn->SetClickHdl( LINK( this, SfxTabDialog, UserHdl ) );
m_pUserBtn->Show();
}
@@ -826,16 +855,14 @@ void SfxTabDialog::AddTabPage
new Data_Impl( nId, pCreateFunc, pRangesFunc, bItemsOnDemand ) );
}
-sal_uInt16 SfxTabDialog::AddTabPage
-
-/* [Description]
- Adding a page to the dialogue. Must correspond to a entry in the
+/*
+ Adds a page to the dialog. The Name must correspond to a entry in the
TabControl in the dialog .ui
*/
-
+sal_uInt16 SfxTabDialog::AddTabPage
(
- const OString &rName, // Page ID
+ const OString &rName, // Page ID
CreateTabPage pCreateFunc, // Pointer to the Factory Method
GetTabPageRanges pRangesFunc, // Pointer to the Method for quering
// Ranges onDemand
@@ -849,6 +876,26 @@ sal_uInt16 SfxTabDialog::AddTabPage
return nId;
}
+/*
+ Adds a page to the dialog. The Name must correspond to a entry in the
+ TabControl in the dialog .ui
+ */
+sal_uInt16 SfxTabDialog::AddTabPage
+(
+ const OString &rName, // Page ID
+ sal_uInt16 nPageCreateId // Identifier of the Factory Method to create the page
+)
+{
+ SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
+ assert(pFact);
+ CreateTabPage pCreateFunc = pFact->GetTabPageCreatorFunc(nPageCreateId);
+ assert(pCreateFunc);
+ GetTabPageRanges pRangesFunc = pFact->GetTabPageRangesFunc(nPageCreateId);
+ sal_uInt16 nPageId = m_pTabCtrl->GetPageId(rName);
+ pImpl->pData->Append(new Data_Impl(nPageId, pCreateFunc, pRangesFunc, false));
+ return nPageId;
+}
+
// -----------------------------------------------------------------------
void SfxTabDialog::AddTabPage