summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-06-18 16:18:03 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-06-19 12:22:18 +0200
commit04c041491983ec1f7bd71b965a55255ec0e3ea51 (patch)
treea34078dd41dded363f0038b5c92a26da1cdbe73c /sw/source/uibase
parent657c141acbae11945072ae3f38982cb225131de6 (diff)
weld SwTitlePageDlg
Change-Id: I16a82709f49ed9e85751afd8c8001705c40a6e6d Reviewed-on: https://gerrit.libreoffice.org/56063 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r--sw/source/uibase/inc/titlepage.hxx55
-rw-r--r--sw/source/uibase/shells/basesh.cxx28
2 files changed, 30 insertions, 53 deletions
diff --git a/sw/source/uibase/inc/titlepage.hxx b/sw/source/uibase/inc/titlepage.hxx
index 18bd3d93f161..836d1d7dc0c5 100644
--- a/sw/source/uibase/inc/titlepage.hxx
+++ b/sw/source/uibase/inc/titlepage.hxx
@@ -10,37 +10,15 @@
#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_TITLEPAGE_HXX
#define INCLUDED_SW_SOURCE_UIBASE_INC_TITLEPAGE_HXX
-#include <sfx2/basedlgs.hxx>
-#include <vcl/button.hxx>
-#include <vcl/field.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/lstbox.hxx>
-#include "numberingtypelistbox.hxx"
+#include <vcl/weld.hxx>
namespace vcl { class Window; }
class SwWrtShell;
class SwPageDesc;
-class SwTitlePageDlg : public SfxModalDialog
+class SwTitlePageDlg : public weld::GenericDialogController
{
private:
- VclPtr<RadioButton> m_pUseExistingPagesRB;
- VclPtr<NumericField> m_pPageCountNF;
-
- VclPtr<RadioButton> m_pDocumentStartRB;
- VclPtr<RadioButton> m_pPageStartRB;
- VclPtr<NumericField> m_pPageStartNF;
-
- VclPtr<CheckBox> m_pRestartNumberingCB;
- VclPtr<NumericField> m_pRestartNumberingNF;
- VclPtr<CheckBox> m_pSetPageNumberCB;
- VclPtr<NumericField> m_pSetPageNumberNF;
-
- VclPtr<ListBox> m_pPagePropertiesLB;
- VclPtr<PushButton> m_pPagePropertiesPB;
-
- VclPtr<OKButton> m_pOkPB;
-
SwWrtShell *mpSh;
const SwFormatPageDesc *mpPageFormatDesc;
@@ -49,21 +27,32 @@ private:
const SwPageDesc *mpIndexDesc;
const SwPageDesc *mpNormalDesc;
+ std::unique_ptr<weld::RadioButton> m_xUseExistingPagesRB;
+ std::unique_ptr<weld::SpinButton> m_xPageCountNF;
+ std::unique_ptr<weld::RadioButton> m_xDocumentStartRB;
+ std::unique_ptr<weld::RadioButton> m_xPageStartRB;
+ std::unique_ptr<weld::SpinButton> m_xPageStartNF;
+ std::unique_ptr<weld::CheckButton> m_xRestartNumberingCB;
+ std::unique_ptr<weld::SpinButton> m_xRestartNumberingNF;
+ std::unique_ptr<weld::CheckButton> m_xSetPageNumberCB;
+ std::unique_ptr<weld::SpinButton> m_xSetPageNumberNF;
+ std::unique_ptr<weld::ComboBoxText> m_xPagePropertiesLB;
+ std::unique_ptr<weld::Button> m_xPagePropertiesPB;
+ std::unique_ptr<weld::Button> m_xOkPB;
+
void FillList();
sal_uInt16 GetInsertPosition() const;
- DECL_LINK(OKHdl, Button*, void);
- DECL_LINK(EditHdl, Button*, void);
- DECL_LINK(RestartNumberingHdl, Button*, void);
- DECL_LINK(SetPageNumberHdl, Button*, void);
- DECL_LINK(UpHdl, SpinField&, void);
- DECL_LINK(DownHdl, SpinField&, void);
- DECL_LINK(StartPageHdl, Button*, void);
+ DECL_LINK(OKHdl, weld::Button&, void);
+ DECL_LINK(EditHdl, weld::Button&, void);
+ DECL_LINK(RestartNumberingHdl, weld::ToggleButton&, void);
+ DECL_LINK(SetPageNumberHdl, weld::ToggleButton&, void);
+ DECL_LINK(ValueChangeHdl, weld::SpinButton&, void);
+ DECL_LINK(StartPageHdl, weld::ToggleButton&, void);
public:
- SwTitlePageDlg( vcl::Window *pParent );
+ SwTitlePageDlg(weld::Window *pParent);
virtual ~SwTitlePageDlg() override;
- virtual void dispose() override;
};
#endif
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx
index 234daac5e1f3..9bd0e475b43f 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -2403,7 +2403,7 @@ void SwBaseShell::GetBorderState(SfxItemSet &rSet)
void SwBaseShell::ExecDlg(SfxRequest &rReq)
{
SwWrtShell &rSh = GetShell();
- vcl::Window *pMDI = &GetView().GetViewFrame()->GetWindow();
+ vcl::Window& rMDI = GetView().GetViewFrame()->GetWindow();
// So that from the basic no dialogues for the background views are called:
bool bBackground = (&GetView() != GetActiveView());
const SfxPoolItem* pItem = nullptr;
@@ -2420,7 +2420,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
case FN_FORMAT_TITLEPAGE_DLG:
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateTitlePageDlg( pMDI ));
+ ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateTitlePageDlg(rMDI.GetFrameWeld()));
pDlg->Execute();
}
break;
@@ -2470,10 +2470,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
::PrepareBoxInfo( aSet, rSh );
rSh.GetTabBorders( aSet );
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
-
- pDlg.disposeAndReset(pFact->CreateSwBorderDlg( pMDI, aSet, SwBorderModes::TABLE ));
- OSL_ENSURE(pDlg, "Dialog creation failed!");
+ pDlg.disposeAndReset(pFact->CreateSwBorderDlg( &rMDI, aSet, SwBorderModes::TABLE ));
if ( pDlg->Execute() == RET_OK )
{
rSh.SetTabBorders( *pDlg->GetOutputItemSet() );
@@ -2487,10 +2484,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
aSet.Put( aMgr.GetAttrSet() );
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
-
- pDlg.disposeAndReset(pFact->CreateSwBorderDlg( pMDI, aSet, SwBorderModes::FRAME ));
- OSL_ENSURE(pDlg, "Dialog creation failed!");
+ pDlg.disposeAndReset(pFact->CreateSwBorderDlg( &rMDI, aSet, SwBorderModes::FRAME ));
if ( pDlg->Execute() == RET_OK )
{
aMgr.SetAttrSet( *pDlg->GetOutputItemSet() );
@@ -2505,10 +2499,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
::PrepareBoxInfo( aSet, rSh );
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
-
- pDlg.disposeAndReset(pFact->CreateSwBorderDlg( pMDI, aSet, SwBorderModes::PARA ));
- OSL_ENSURE(pDlg, "Dialog creation failed!");
+ pDlg.disposeAndReset(pFact->CreateSwBorderDlg( &rMDI, aSet, SwBorderModes::PARA ));
if ( pDlg->Execute() == RET_OK )
{
rSh.SetAttrSet( *pDlg->GetOutputItemSet() );
@@ -2537,8 +2528,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
// Get background attributes of the table and put it in the set
SvxBrushItem aBrush(RES_BACKGROUND);
rSh.GetBoxBackground( aBrush );
- pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(pMDI, aSet));
- assert(pDlg && "Dialog creation failed!");
+ pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(&rMDI, aSet));
aSet.Put( aBrush );
if ( pDlg->Execute() == RET_OK )
{
@@ -2552,8 +2542,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
rSh.GetFlyFrameAttr( aSet );
- pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(pMDI, aSet));
- assert(pDlg && "Dialog creation failed!");
+ pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(&rMDI, aSet));
if ( pDlg->Execute() == RET_OK )
{
rSh.SetFlyFrameAttr(const_cast<SfxItemSet &>(*pDlg->GetOutputItemSet()) );
@@ -2565,8 +2554,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
// Set border attributes Umrandungsattribute with the shell quite normal.
rSh.GetCurAttr( aSet );
- pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(pMDI, aSet));
- assert(pDlg && "Dialog creation failed!");
+ pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(&rMDI, aSet));
if ( pDlg->Execute() == RET_OK )
{
rSh.SetAttrSet( *pDlg->GetOutputItemSet() );