summaryrefslogtreecommitdiff
path: root/sw
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
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')
-rw-r--r--sw/inc/swabstdlg.hxx2
-rw-r--r--sw/source/ui/dialog/swdlgfact.cxx5
-rw-r--r--sw/source/ui/dialog/swdlgfact.hxx2
-rw-r--r--sw/source/ui/misc/titlepage.cxx148
-rw-r--r--sw/source/uibase/inc/titlepage.hxx55
-rw-r--r--sw/source/uibase/shells/basesh.cxx28
-rw-r--r--sw/uiconfig/swriter/ui/titlepage.ui53
7 files changed, 135 insertions, 158 deletions
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index 5caf37cb4c5b..9d6e4dbf147c 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -449,7 +449,7 @@ public:
SwWrtShell &rSh, SwField* pField, bool bPrevButton, bool bNextButton) = 0;
virtual VclPtr<AbstractInsFootNoteDlg> CreateInsFootNoteDlg(weld::Window * pParent,
SwWrtShell &rSh, bool bEd = false) = 0;
- virtual VclPtr<VclAbstractDialog> CreateTitlePageDlg ( vcl::Window * pParent ) = 0;
+ virtual VclPtr<VclAbstractDialog> CreateTitlePageDlg(weld::Window* pParent) = 0;
virtual VclPtr<VclAbstractDialog> CreateVclSwViewDialog(SwView& rView) = 0;
virtual VclPtr<AbstractInsTableDlg> CreateInsTableDlg(SwView& rView) = 0;
virtual VclPtr<AbstractJavaEditDialog> CreateJavaEditDialog(weld::Window* pParent,
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index b623c5d81a87..ae69d4b54f04 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -949,10 +949,9 @@ VclPtr<AbstractInsFootNoteDlg> SwAbstractDialogFactory_Impl::CreateInsFootNoteDl
return VclPtr<AbstractInsFootNoteDlg_Impl>::Create(new SwInsFootNoteDlg(pParent, rSh, bEd));
}
-VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateTitlePageDlg ( vcl::Window *pParent )
+VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateTitlePageDlg(weld::Window *pParent)
{
- VclPtr<Dialog> pDlg = VclPtr<SwTitlePageDlg>::Create( pParent );
- return VclPtr<VclAbstractDialog_Impl>::Create( pDlg );
+ return VclPtr<AbstractGenericDialog_Impl>::Create(new SwTitlePageDlg(pParent));
}
VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateVclSwViewDialog(SwView& rView)
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index 60b7072bf4a1..a06afd8175b6 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -622,7 +622,7 @@ public:
SwWrtShell &rSh, SwField* pField, bool bPrevButton, bool bNextButton) override;
virtual VclPtr<AbstractInsFootNoteDlg> CreateInsFootNoteDlg(
weld::Window * pParent, SwWrtShell &rSh, bool bEd = false) override;
- virtual VclPtr<VclAbstractDialog> CreateTitlePageDlg ( vcl::Window * pParent ) override;
+ virtual VclPtr<VclAbstractDialog> CreateTitlePageDlg(weld::Window* pParent) override;
virtual VclPtr<VclAbstractDialog> CreateVclSwViewDialog(SwView& rView) override;
virtual VclPtr<AbstractInsTableDlg> CreateInsTableDlg(SwView& rView) override;
virtual VclPtr<AbstractJavaEditDialog> CreateJavaEditDialog(weld::Window* pParent,
diff --git a/sw/source/ui/misc/titlepage.cxx b/sw/source/ui/misc/titlepage.cxx
index 4d21a57850fa..36034678463b 100644
--- a/sw/source/ui/misc/titlepage.cxx
+++ b/sw/source/ui/misc/titlepage.cxx
@@ -130,45 +130,44 @@ namespace
*/
void SwTitlePageDlg::FillList()
{
- sal_uInt16 nTitlePages = m_pPageCountNF->GetValue();
- m_pPagePropertiesLB->Clear();
+ sal_uInt16 nTitlePages = m_xPageCountNF->get_value();
+ m_xPagePropertiesLB->clear();
if (mpTitleDesc)
- m_pPagePropertiesLB->InsertEntry(mpTitleDesc->GetName());
+ m_xPagePropertiesLB->append_text(mpTitleDesc->GetName());
if (nTitlePages > 1 && mpIndexDesc)
- m_pPagePropertiesLB->InsertEntry(mpIndexDesc->GetName());
+ m_xPagePropertiesLB->append_text(mpIndexDesc->GetName());
if (mpNormalDesc)
- m_pPagePropertiesLB->InsertEntry(mpNormalDesc->GetName());
- m_pPagePropertiesLB->SelectEntryPos(0);
+ m_xPagePropertiesLB->append_text(mpNormalDesc->GetName());
+ m_xPagePropertiesLB->set_active(0);
}
sal_uInt16 SwTitlePageDlg::GetInsertPosition() const
{
sal_uInt16 nPage = 1;
- if (m_pPageStartNF->IsEnabled())
- nPage = m_pPageStartNF->GetValue();
+ if (m_xPageStartNF->get_sensitive())
+ nPage = m_xPageStartNF->get_value();
return nPage;
}
-SwTitlePageDlg::SwTitlePageDlg( vcl::Window *pParent ) :
- SfxModalDialog( pParent, "DLG_TITLEPAGE", "modules/swriter/ui/titlepage.ui"),
- mpPageFormatDesc(nullptr)
+SwTitlePageDlg::SwTitlePageDlg(weld::Window *pParent)
+ : GenericDialogController(pParent, "modules/swriter/ui/titlepage.ui", "DLG_TITLEPAGE")
+ , mpPageFormatDesc(nullptr)
+ , m_xUseExistingPagesRB(m_xBuilder->weld_radio_button("RB_USE_EXISTING_PAGES"))
+ , m_xPageCountNF(m_xBuilder->weld_spin_button("NF_PAGE_COUNT"))
+ , m_xDocumentStartRB(m_xBuilder->weld_radio_button("RB_DOCUMENT_START"))
+ , m_xPageStartRB(m_xBuilder->weld_radio_button("RB_PAGE_START"))
+ , m_xPageStartNF(m_xBuilder->weld_spin_button("NF_PAGE_START"))
+ , m_xRestartNumberingCB(m_xBuilder->weld_check_button("CB_RESTART_NUMBERING"))
+ , m_xRestartNumberingNF(m_xBuilder->weld_spin_button("NF_RESTART_NUMBERING"))
+ , m_xSetPageNumberCB(m_xBuilder->weld_check_button("CB_SET_PAGE_NUMBER"))
+ , m_xSetPageNumberNF(m_xBuilder->weld_spin_button("NF_SET_PAGE_NUMBER"))
+ , m_xPagePropertiesLB(m_xBuilder->weld_combo_box_text("LB_PAGE_PROPERTIES"))
+ , m_xPagePropertiesPB(m_xBuilder->weld_button("PB_PAGE_PROPERTIES"))
+ , m_xOkPB(m_xBuilder->weld_button("ok"))
{
- get(m_pUseExistingPagesRB, "RB_USE_EXISTING_PAGES");
- get(m_pPageCountNF, "NF_PAGE_COUNT");
- get(m_pDocumentStartRB, "RB_DOCUMENT_START");
- get(m_pPageStartRB, "RB_PAGE_START");
- get(m_pPageStartNF, "NF_PAGE_START");
- get(m_pRestartNumberingCB, "CB_RESTART_NUMBERING");
- get(m_pRestartNumberingNF, "NF_RESTART_NUMBERING");
- get(m_pSetPageNumberCB, "CB_SET_PAGE_NUMBER");
- get(m_pSetPageNumberNF, "NF_SET_PAGE_NUMBER");
- get(m_pPagePropertiesLB, "LB_PAGE_PROPERTIES");
- get(m_pPagePropertiesPB, "PB_PAGE_PROPERTIES");
- get(m_pOkPB, "ok");
-
- m_pOkPB->SetClickHdl(LINK(this, SwTitlePageDlg, OKHdl));
- m_pRestartNumberingCB->SetClickHdl(LINK(this, SwTitlePageDlg, RestartNumberingHdl));
- m_pSetPageNumberCB->SetClickHdl(LINK(this, SwTitlePageDlg, SetPageNumberHdl));
+ m_xOkPB->connect_clicked(LINK(this, SwTitlePageDlg, OKHdl));
+ m_xRestartNumberingCB->connect_toggled(LINK(this, SwTitlePageDlg, RestartNumberingHdl));
+ m_xSetPageNumberCB->connect_toggled(LINK(this, SwTitlePageDlg, SetPageNumberHdl));
sal_uInt16 nSetPage = 1;
sal_uInt16 nResetPage = 1;
@@ -207,92 +206,67 @@ SwTitlePageDlg::SwTitlePageDlg( vcl::Window *pParent ) :
}
lcl_PopCursor(mpSh);
- m_pUseExistingPagesRB->Check();
- m_pPageCountNF->SetValue(nTitlePages);
- m_pPageCountNF->SetUpHdl(LINK(this, SwTitlePageDlg, UpHdl));
- m_pPageCountNF->SetDownHdl(LINK(this, SwTitlePageDlg, DownHdl));
+ m_xUseExistingPagesRB->set_active(true);
+ m_xPageCountNF->set_value(nTitlePages);
+ m_xPageCountNF->connect_value_changed(LINK(this, SwTitlePageDlg, ValueChangeHdl));
- m_pDocumentStartRB->Check();
- m_pPageStartNF->Enable(false);
- m_pPageStartNF->SetValue(lcl_GetCurrentPage(mpSh));
- Link<Button*,void> aStartPageHdl = LINK(this, SwTitlePageDlg, StartPageHdl);
- m_pDocumentStartRB->SetClickHdl(aStartPageHdl);
- m_pPageStartRB->SetClickHdl(aStartPageHdl);
+ m_xDocumentStartRB->set_active(true);
+ m_xPageStartNF->set_sensitive(false);
+ m_xPageStartNF->set_value(lcl_GetCurrentPage(mpSh));
+ Link<weld::ToggleButton&,void> aStartPageHdl = LINK(this, SwTitlePageDlg, StartPageHdl);
+ m_xDocumentStartRB->connect_toggled(aStartPageHdl);
+ m_xPageStartRB->connect_toggled(aStartPageHdl);
if (bMaybeResetNumbering && nResetPage > 0)
{
- m_pRestartNumberingCB->Check();
- m_pRestartNumberingNF->SetValue(nResetPage);
+ m_xRestartNumberingCB->set_active(true);
+ m_xRestartNumberingNF->set_value(nResetPage);
}
- m_pRestartNumberingNF->Enable(m_pRestartNumberingCB->IsChecked());
+ m_xRestartNumberingNF->set_sensitive(m_xRestartNumberingCB->get_active());
- m_pSetPageNumberNF->SetValue(nSetPage);
+ m_xSetPageNumberNF->set_value(nSetPage);
if (nSetPage > 1)
- m_pSetPageNumberCB->Check();
- m_pSetPageNumberNF->Enable(m_pSetPageNumberCB->IsChecked());
+ m_xSetPageNumberCB->set_active(true);
+ m_xSetPageNumberNF->set_sensitive(m_xSetPageNumberCB->get_active());
FillList();
- m_pPagePropertiesPB->SetClickHdl(LINK(this, SwTitlePageDlg, EditHdl));
+ m_xPagePropertiesPB->connect_clicked(LINK(this, SwTitlePageDlg, EditHdl));
}
-IMPL_LINK_NOARG(SwTitlePageDlg, UpHdl, SpinField&, void)
+IMPL_LINK_NOARG(SwTitlePageDlg, ValueChangeHdl, weld::SpinButton&, void)
{
- if (m_pPageCountNF->GetValue() == 2)
+ if (m_xPageCountNF->get_value() == 1 || m_xPageCountNF->get_value() == 2)
FillList();
}
-IMPL_LINK_NOARG(SwTitlePageDlg, DownHdl, SpinField&, void)
+IMPL_LINK_NOARG(SwTitlePageDlg, RestartNumberingHdl, weld::ToggleButton&, void)
{
- if (m_pPageCountNF->GetValue() == 1)
- FillList();
-}
-
-IMPL_LINK_NOARG(SwTitlePageDlg, RestartNumberingHdl, Button*, void)
-{
- m_pRestartNumberingNF->Enable(m_pRestartNumberingCB->IsChecked());
+ m_xRestartNumberingNF->set_sensitive(m_xRestartNumberingCB->get_active());
}
-IMPL_LINK_NOARG(SwTitlePageDlg, SetPageNumberHdl, Button*, void)
+IMPL_LINK_NOARG(SwTitlePageDlg, SetPageNumberHdl, weld::ToggleButton&, void)
{
- m_pSetPageNumberNF->Enable(m_pSetPageNumberCB->IsChecked());
+ m_xSetPageNumberNF->set_sensitive(m_xSetPageNumberCB->get_active());
}
-IMPL_LINK_NOARG(SwTitlePageDlg, StartPageHdl, Button*, void)
+IMPL_LINK_NOARG(SwTitlePageDlg, StartPageHdl, weld::ToggleButton&, void)
{
- m_pPageStartNF->Enable(m_pPageStartRB->IsChecked());
+ m_xPageStartNF->set_sensitive(m_xPageStartRB->get_active());
}
SwTitlePageDlg::~SwTitlePageDlg()
{
- disposeOnce();
-}
-
-void SwTitlePageDlg::dispose()
-{
delete mpPageFormatDesc;
- m_pUseExistingPagesRB.clear();
- m_pPageCountNF.clear();
- m_pDocumentStartRB.clear();
- m_pPageStartRB.clear();
- m_pPageStartNF.clear();
- m_pRestartNumberingCB.clear();
- m_pRestartNumberingNF.clear();
- m_pSetPageNumberCB.clear();
- m_pSetPageNumberNF.clear();
- m_pPagePropertiesLB.clear();
- m_pPagePropertiesPB.clear();
- m_pOkPB.clear();
- SfxModalDialog::dispose();
}
-IMPL_LINK_NOARG(SwTitlePageDlg, EditHdl, Button*, void)
+IMPL_LINK_NOARG(SwTitlePageDlg, EditHdl, weld::Button&, void)
{
SwView& rView = mpSh->GetView();
- rView.GetDocShell()->FormatPage(m_pPagePropertiesLB->GetSelectedEntry(), "page", *mpSh);
+ rView.GetDocShell()->FormatPage(m_xPagePropertiesLB->get_active_text(), "page", *mpSh);
rView.InvalidateRulerPos();
}
-IMPL_LINK_NOARG(SwTitlePageDlg, OKHdl, Button*, void)
+IMPL_LINK_NOARG(SwTitlePageDlg, OKHdl, weld::Button&, void)
{
lcl_PushCursor(mpSh);
@@ -300,13 +274,13 @@ IMPL_LINK_NOARG(SwTitlePageDlg, OKHdl, Button*, void)
SwFormatPageDesc aTitleDesc(mpTitleDesc);
- if (m_pSetPageNumberCB->IsChecked())
- aTitleDesc.SetNumOffset(m_pSetPageNumberNF->GetValue());
+ if (m_xSetPageNumberCB->get_active())
+ aTitleDesc.SetNumOffset(m_xSetPageNumberNF->get_value());
else if (mpPageFormatDesc)
aTitleDesc.SetNumOffset(mpPageFormatDesc->GetNumOffset());
- sal_uInt16 nNoPages = m_pPageCountNF->GetValue();
- if (!m_pUseExistingPagesRB->IsChecked())
+ sal_uInt16 nNoPages = m_xPageCountNF->get_value();
+ if (!m_xUseExistingPagesRB->get_active())
{
mpSh->GotoPage(GetInsertPosition(), false);
for (sal_uInt16 nI=0; nI < nNoPages; ++nI)
@@ -329,9 +303,9 @@ IMPL_LINK_NOARG(SwTitlePageDlg, OKHdl, Button*, void)
mpSh->SetAttrItem(aPageFormatDesc);
}
- if (m_pRestartNumberingCB->IsChecked() || nNoPages > 1)
+ if (m_xRestartNumberingCB->get_active() || nNoPages > 1)
{
- sal_uInt16 nPgNo = m_pRestartNumberingCB->IsChecked() ? m_pRestartNumberingNF->GetValue() : 0;
+ sal_uInt16 nPgNo = m_xRestartNumberingCB->get_active() ? m_xRestartNumberingNF->get_value() : 0;
const SwPageDesc *pNewDesc = nNoPages > 1 ? mpNormalDesc : nullptr;
mpSh->GotoPage(GetInsertPosition() + nNoPages, false);
lcl_ChangePage(mpSh, nPgNo, pNewDesc);
@@ -339,9 +313,9 @@ IMPL_LINK_NOARG(SwTitlePageDlg, OKHdl, Button*, void)
mpSh->EndUndo();
lcl_PopCursor(mpSh);
- if (!m_pUseExistingPagesRB->IsChecked())
+ if (!m_xUseExistingPagesRB->get_active())
mpSh->GotoPage(GetInsertPosition(), false);
- EndDialog( RET_OK );
+ m_xDialog->response(RET_OK);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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() );
diff --git a/sw/uiconfig/swriter/ui/titlepage.ui b/sw/uiconfig/swriter/ui/titlepage.ui
index 23ab51ed6fc1..0ae2ee2e18b1 100644
--- a/sw/uiconfig/swriter/ui/titlepage.ui
+++ b/sw/uiconfig/swriter/ui/titlepage.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
<interface domain="sw">
<requires lib="gtk+" version="3.18"/>
<object class="GtkAdjustment" id="adjustment1">
@@ -9,12 +9,36 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
+ <object class="GtkAdjustment" id="adjustment2">
+ <property name="lower">1</property>
+ <property name="upper">65535</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkAdjustment" id="adjustment3">
+ <property name="lower">1</property>
+ <property name="upper">65535</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkAdjustment" id="adjustment4">
+ <property name="lower">1</property>
+ <property name="upper">65535</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
<object class="GtkDialog" id="DLG_TITLEPAGE">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes" context="titlepage|DLG_TITLEPAGE">Title Page</property>
<property name="resizable">False</property>
+ <property name="modal">True</property>
+ <property name="default_width">0</property>
+ <property name="default_height">0</property>
<property name="type_hint">dialog</property>
+ <child>
+ <placeholder/>
+ </child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
@@ -29,6 +53,7 @@
<property name="label">gtk-ok</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
@@ -98,17 +123,17 @@
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="row_spacing">6</property>
<property name="column_spacing">12</property>
- <property name="row_homogeneous">True</property>
<child>
<object class="GtkLabel" id="label6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="titlepage|label6">Number of title pages:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">NF_PAGE_COUNT</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -119,8 +144,8 @@
<object class="GtkLabel" id="label7">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="titlepage|label7">Place title pages at:</property>
+ <property name="xalign">0</property>
<accessibility>
<relation type="label-for" target="RB_DOCUMENT_START"/>
<relation type="label-for" target="RB_PAGE_START"/>
@@ -137,6 +162,7 @@
<property name="can_focus">True</property>
<property name="halign">start</property>
<property name="valign">center</property>
+ <property name="activates_default">True</property>
<property name="adjustment">adjustment1</property>
<property name="numeric">True</property>
</object>
@@ -152,9 +178,10 @@
<property name="can_focus">True</property>
<property name="halign">start</property>
<property name="valign">center</property>
+ <property name="activates_default">True</property>
<property name="progress_fraction">0.040000000000000001</property>
<property name="progress_pulse_step">1</property>
- <property name="adjustment">adjustment1</property>
+ <property name="adjustment">adjustment2</property>
<property name="climb_rate">1</property>
<property name="numeric">True</property>
<accessibility>
@@ -172,8 +199,8 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_underline">True</property>
<property name="halign">start</property>
+ <property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
@@ -191,8 +218,8 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="use_underline">True</property>
<property name="halign">start</property>
+ <property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
@@ -214,7 +241,6 @@
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
- <property name="group">RB_PAGE_START</property>
<accessibility>
<relation type="labelled-by" target="label7"/>
</accessibility>
@@ -233,7 +259,6 @@
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
- <property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">RB_DOCUMENT_START</property>
<accessibility>
@@ -289,7 +314,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
- <property name="homogeneous">True</property>
+ <property name="spacing">6</property>
<child>
<object class="GtkCheckButton" id="CB_RESTART_NUMBERING">
<property name="label" translatable="yes" context="titlepage|CB_RESTART_NUMBERING">Reset page numbering after title pages</property>
@@ -336,7 +361,8 @@
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="valign">center</property>
- <property name="adjustment">adjustment1</property>
+ <property name="activates_default">True</property>
+ <property name="adjustment">adjustment3</property>
<property name="numeric">True</property>
</object>
<packing>
@@ -400,7 +426,8 @@
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="valign">center</property>
- <property name="adjustment">adjustment1</property>
+ <property name="activates_default">True</property>
+ <property name="adjustment">adjustment4</property>
<property name="numeric">True</property>
</object>
<packing>
@@ -471,7 +498,7 @@
</packing>
</child>
<child>
- <object class="GtkComboBox" id="LB_PAGE_PROPERTIES">
+ <object class="GtkComboBoxText" id="LB_PAGE_PROPERTIES">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>