summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-12-12 15:06:31 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-12-13 14:58:39 +0000
commitd29529cf9badda40eeb151a355fa0e6bd50912db (patch)
treef6a31d3affedb1aa47102a1f4120e52b6477c651
parentRelated fdo#33484: Terminate OfficeIPCThread by closing the accepting pipe (diff)
downloadcore-d29529cf9badda40eeb151a355fa0e6bd50912db.tar.gz
core-d29529cf9badda40eeb151a355fa0e6bd50912db.zip
add get_content_area and get_action_area to Dialog
Change-Id: I147cea986b8152e54586a0296e446652bd695a18
-rw-r--r--sfx2/inc/sfx2/tabdlg.hxx4
-rw-r--r--sfx2/source/dialog/tabdlg.cxx20
-rw-r--r--sfx2/source/view/printer.cxx2
-rw-r--r--vcl/inc/vcl/dialog.hxx4
-rw-r--r--vcl/source/window/dialog.cxx10
5 files changed, 27 insertions, 13 deletions
diff --git a/sfx2/inc/sfx2/tabdlg.hxx b/sfx2/inc/sfx2/tabdlg.hxx
index c3e010a86c62..6b1e9859f8f1 100644
--- a/sfx2/inc/sfx2/tabdlg.hxx
+++ b/sfx2/inc/sfx2/tabdlg.hxx
@@ -65,7 +65,7 @@ friend class SfxTabDialogController;
SfxViewFrame* pFrame;
- VclVBox *m_pVBox;
+ VclBox *m_pBox;
TabControl *m_pTabCtrl;
OKButton *m_pOKBtn;
@@ -114,7 +114,7 @@ protected:
virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
virtual long Notify( NotifyEvent& rNEvt );
- VclHButtonBox* m_pActionArea;
+ VclButtonBox* m_pActionArea;
SfxItemSet* pExampleSet;
SfxItemSet* GetInputSetImpl();
SfxTabPage* GetTabPage( sal_uInt16 nPageId ) const;
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index eda237570f9a..a7574c573d5a 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -513,7 +513,7 @@ SfxTabDialog::~SfxTabDialog()
if (m_bOwnsTabCtrl)
delete m_pTabCtrl;
if (m_bOwnsVBox)
- delete m_pVBox;
+ delete m_pBox;
}
// -----------------------------------------------------------------------
@@ -526,26 +526,26 @@ void SfxTabDialog::Init_Impl( sal_Bool bFmtFlag, const String* pUserButtonText,
*/
{
- m_pVBox = m_pUIBuilder ? m_pUIBuilder->get<VclVBox>("dialog-vbox1") : NULL;
- m_bOwnsVBox = m_pVBox == NULL;
+ m_pBox = get_content_area();
+ m_bOwnsVBox = m_pBox == NULL;
if (m_bOwnsVBox)
{
- m_pVBox = new VclVBox(this, false, 7);
- m_pVBox->set_expand(true);
+ m_pBox = new VclVBox(this, false, 7);
+ m_pBox->set_expand(true);
}
m_pTabCtrl = m_pUIBuilder ? m_pUIBuilder->get<TabControl>(SAL_STRINGIFY(ID_TABCONTROL)) : NULL;
m_bOwnsTabCtrl = m_pTabCtrl == NULL;
if (m_bOwnsTabCtrl)
{
- m_pTabCtrl = new TabControl(m_pVBox, ResId(ID_TABCONTROL, *rResId.GetResMgr()));
+ m_pTabCtrl = new TabControl(m_pBox, ResId(ID_TABCONTROL, *rResId.GetResMgr()));
m_pTabCtrl->set_expand(true);
}
- m_pActionArea = m_pUIBuilder ? m_pUIBuilder->get<VclHButtonBox>("dialog-action_area1") : NULL;
+ m_pActionArea = get_action_area();
m_bOwnsActionArea = m_pActionArea == NULL;
if (m_bOwnsActionArea)
- m_pActionArea = new VclHButtonBox(m_pVBox);
+ m_pActionArea = new VclHButtonBox(m_pBox);
m_pOKBtn = m_pUIBuilder ? m_pUIBuilder->get<OKButton>("ok") : NULL;
m_bOwnsOKBtn = m_pOKBtn == NULL;
@@ -593,7 +593,7 @@ void SfxTabDialog::Init_Impl( sal_Bool bFmtFlag, const String* pUserButtonText,
m_pTabCtrl->SetDeactivatePageHdl(
LINK( this, SfxTabDialog, DeactivatePageHdl ) );
m_pActionArea->Show();
- m_pVBox->Show();
+ m_pBox->Show();
m_pTabCtrl->Show();
m_pOKBtn->Show();
m_pCancelBtn->Show();
@@ -1084,7 +1084,7 @@ IMPL_LINK_NOARG(SfxTabDialog, OkHdl)
Handler of the Ok-Buttons
This calls the current page <SfxTabPage::DeactivatePage(SfxItemSet *)>.
Returns <SfxTabPage::LEAVE_PAGE>, <SfxTabDialog::Ok()> is called
- anf the Dialog is ended.
+ and the Dialog is ended.
*/
{
diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx
index efdcd6aa3b77..7439760e1178 100644
--- a/sfx2/source/view/printer.cxx
+++ b/sfx2/source/view/printer.cxx
@@ -208,7 +208,7 @@ SfxPrintOptionsDialog::SfxPrintOptionsDialog(Window *pParent,
, pViewSh(pViewShell)
, pOptions(pSet->Clone())
{
- VclContainer *pVBox = m_pUIBuilder->get<VclVBox>("dialog-vbox1");
+ VclContainer *pVBox = get_content_area();
// Insert TabPage
pPage = pViewSh->CreatePrintOptionsPage(pVBox, *pOptions);
diff --git a/vcl/inc/vcl/dialog.hxx b/vcl/inc/vcl/dialog.hxx
index 3700c8b65942..6f5b0c0db934 100644
--- a/vcl/inc/vcl/dialog.hxx
+++ b/vcl/inc/vcl/dialog.hxx
@@ -34,6 +34,8 @@
// - Dialog -
// ----------
struct DialogImpl;
+class VclBox;
+class VclButtonBox;
class VclContainer;
class VCL_DLLPUBLIC Dialog
@@ -95,6 +97,8 @@ public:
void setInitialLayoutSize();
void queue_layout();
virtual bool set_property(const rtl::OString &rKey, const rtl::OString &rValue);
+ VclButtonBox* get_action_area();
+ VclBox* get_content_area();
virtual sal_Bool Close();
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index bea6412cb6e5..d76d359bc85e 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -560,6 +560,16 @@ WinBits Dialog::init(Window *pParent, const ResId& rResId)
return nStyle;
}
+VclButtonBox* Dialog::get_action_area()
+{
+ return m_pUIBuilder ? m_pUIBuilder->get<VclButtonBox>("dialog-action_area1") : NULL;
+}
+
+VclBox* Dialog::get_content_area()
+{
+ return m_pUIBuilder ? m_pUIBuilder->get<VclBox>("dialog-vbox1") : NULL;
+}
+
// -----------------------------------------------------------------------
Dialog::~Dialog()