summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-06-02 19:37:35 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-06-02 22:16:25 +0200
commitcd08397eedbe347784a3ac569481a17a8391e7b2 (patch)
treeda1e98217f92c5b505caaa2dcb8d71a09180705d /sw
parent846675d6c0ff6838526f97961e95eca945c60eeb (diff)
weld SwSectionFootnoteEndTabPage
Change-Id: Ib4246a2f90780a005e79e2d071b43a5629a3242c Reviewed-on: https://gerrit.libreoffice.org/55216 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/dialog/uiregionsw.cxx293
-rw-r--r--sw/source/uibase/inc/numberingtypelistbox.hxx18
-rw-r--r--sw/source/uibase/inc/regionsw.hxx52
-rw-r--r--sw/source/uibase/misc/numberingtypelistbox.cxx145
-rw-r--r--sw/uiconfig/swriter/ui/footnotesendnotestabpage.ui88
5 files changed, 178 insertions, 418 deletions
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index 6e1b83666fea..50f052154de7 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -1827,81 +1827,50 @@ IMPL_LINK( SwInsertSectionTabPage, DlgClosedHdl, sfx2::FileDialogHelper *, _pFil
m_sFilterName = m_sFilePasswd = aEmptyOUStr;
}
-SwSectionFootnoteEndTabPage::SwSectionFootnoteEndTabPage( vcl::Window *pParent,
- const SfxItemSet &rAttrSet)
- : SfxTabPage( pParent, "FootnotesEndnotesTabPage", "modules/swriter/ui/footnotesendnotestabpage.ui", &rAttrSet )
-
-{
- get(m_pFootnoteNtAtTextEndCB,"ftnntattextend");
-
- get(m_pFootnoteNtNumCB,"ftnntnum");
- get(m_pFootnoteOffsetLbl,"ftnoffset_label");
- get(m_pFootnoteOffsetField,"ftnoffset");
-
- get(m_pFootnoteNtNumFormatCB,"ftnntnumfmt");
- get(m_pFootnotePrefixFT,"ftnprefix_label");
- get(m_pFootnotePrefixED,"ftnprefix");
- get(m_pFootnoteNumViewBox,"ftnnumviewbox");
- get(m_pFootnoteSuffixFT,"ftnsuffix_label");
- get(m_pFootnoteSuffixED,"ftnsuffix");
-
- get(m_pEndNtAtTextEndCB,"endntattextend");
-
- get(m_pEndNtNumCB,"endntnum");
- get(m_pEndOffsetLbl,"endoffset_label");
- get(m_pEndOffsetField,"endoffset");
-
- get(m_pEndNtNumFormatCB,"endntnumfmt");
- get(m_pEndPrefixFT,"endprefix_label");
- get(m_pEndPrefixED,"endprefix");
- get(m_pEndNumViewBox,"endnumviewbox");
- get(m_pEndSuffixFT,"endsuffix_label");
- get(m_pEndSuffixED,"endsuffix");
-
- Link<Button*,void> aLk( LINK( this, SwSectionFootnoteEndTabPage, FootEndHdl));
- m_pFootnoteNtAtTextEndCB->SetClickHdl( aLk );
- m_pFootnoteNtNumCB->SetClickHdl( aLk );
- m_pEndNtAtTextEndCB->SetClickHdl( aLk );
- m_pEndNtNumCB->SetClickHdl( aLk );
- m_pFootnoteNtNumFormatCB->SetClickHdl( aLk );
- m_pEndNtNumFormatCB->SetClickHdl( aLk );
+SwSectionFootnoteEndTabPage::SwSectionFootnoteEndTabPage(TabPageParent pParent, const SfxItemSet &rAttrSet)
+ : SfxTabPage(pParent, "modules/swriter/ui/footnotesendnotestabpage.ui", "FootnotesEndnotesTabPage", &rAttrSet)
+ , m_xFootnoteNtAtTextEndCB(m_xBuilder->weld_check_button("ftnntattextend"))
+ , m_xFootnoteNtNumCB(m_xBuilder->weld_check_button("ftnntnum"))
+ , m_xFootnoteOffsetLbl(m_xBuilder->weld_label("ftnoffset_label"))
+ , m_xFootnoteOffsetField(m_xBuilder->weld_spin_button("ftnoffset"))
+ , m_xFootnoteNtNumFormatCB(m_xBuilder->weld_check_button("ftnntnumfmt"))
+ , m_xFootnotePrefixFT(m_xBuilder->weld_label("ftnprefix_label"))
+ , m_xFootnotePrefixED(m_xBuilder->weld_entry("ftnprefix"))
+ , m_xFootnoteNumViewBox(new NumberingTypeListBox(m_xBuilder->weld_combo_box_text("ftnnumviewbox")))
+ , m_xFootnoteSuffixFT(m_xBuilder->weld_label("ftnsuffix_label"))
+ , m_xFootnoteSuffixED(m_xBuilder->weld_entry("ftnsuffix"))
+ , m_xEndNtAtTextEndCB(m_xBuilder->weld_check_button("endntattextend"))
+ , m_xEndNtNumCB(m_xBuilder->weld_check_button("endntnum"))
+ , m_xEndOffsetLbl(m_xBuilder->weld_label("endoffset_label"))
+ , m_xEndOffsetField(m_xBuilder->weld_spin_button("endoffset"))
+ , m_xEndNtNumFormatCB(m_xBuilder->weld_check_button("endntnumfmt"))
+ , m_xEndPrefixFT(m_xBuilder->weld_label("endprefix_label"))
+ , m_xEndPrefixED(m_xBuilder->weld_entry("endprefix"))
+ , m_xEndNumViewBox(new NumberingTypeListBox(m_xBuilder->weld_combo_box_text("endnumviewbox")))
+ , m_xEndSuffixFT(m_xBuilder->weld_label("endsuffix_label"))
+ , m_xEndSuffixED(m_xBuilder->weld_entry("endsuffix"))
+{
+ m_xFootnoteNumViewBox->Reload(SwInsertNumTypes::Extended);
+ m_xEndNumViewBox->Reload(SwInsertNumTypes::Extended);
+
+ Link<weld::ToggleButton&,void> aLk( LINK( this, SwSectionFootnoteEndTabPage, FootEndHdl));
+ m_xFootnoteNtAtTextEndCB->connect_toggled( aLk );
+ m_xFootnoteNtNumCB->connect_toggled( aLk );
+ m_xEndNtAtTextEndCB->connect_toggled( aLk );
+ m_xEndNtNumCB->connect_toggled( aLk );
+ m_xFootnoteNtNumFormatCB->connect_toggled( aLk );
+ m_xEndNtNumFormatCB->connect_toggled( aLk );
}
SwSectionFootnoteEndTabPage::~SwSectionFootnoteEndTabPage()
{
- disposeOnce();
-}
-
-void SwSectionFootnoteEndTabPage::dispose()
-{
- m_pFootnoteNtAtTextEndCB.clear();
- m_pFootnoteNtNumCB.clear();
- m_pFootnoteOffsetLbl.clear();
- m_pFootnoteOffsetField.clear();
- m_pFootnoteNtNumFormatCB.clear();
- m_pFootnotePrefixFT.clear();
- m_pFootnotePrefixED.clear();
- m_pFootnoteNumViewBox.clear();
- m_pFootnoteSuffixFT.clear();
- m_pFootnoteSuffixED.clear();
- m_pEndNtAtTextEndCB.clear();
- m_pEndNtNumCB.clear();
- m_pEndOffsetLbl.clear();
- m_pEndOffsetField.clear();
- m_pEndNtNumFormatCB.clear();
- m_pEndPrefixFT.clear();
- m_pEndPrefixED.clear();
- m_pEndNumViewBox.clear();
- m_pEndSuffixFT.clear();
- m_pEndSuffixED.clear();
- SfxTabPage::dispose();
}
bool SwSectionFootnoteEndTabPage::FillItemSet( SfxItemSet* rSet )
{
- SwFormatFootnoteAtTextEnd aFootnote( m_pFootnoteNtAtTextEndCB->IsChecked()
- ? ( m_pFootnoteNtNumCB->IsChecked()
- ? ( m_pFootnoteNtNumFormatCB->IsChecked()
+ SwFormatFootnoteAtTextEnd aFootnote( m_xFootnoteNtAtTextEndCB->get_active()
+ ? ( m_xFootnoteNtNumCB->get_active()
+ ? ( m_xFootnoteNtNumFormatCB->get_active()
? FTNEND_ATTXTEND_OWNNUMANDFMT
: FTNEND_ATTXTEND_OWNNUMSEQ )
: FTNEND_ATTXTEND )
@@ -1910,20 +1879,20 @@ bool SwSectionFootnoteEndTabPage::FillItemSet( SfxItemSet* rSet )
switch( aFootnote.GetValue() )
{
case FTNEND_ATTXTEND_OWNNUMANDFMT:
- aFootnote.SetNumType( m_pFootnoteNumViewBox->GetSelectedNumberingType() );
- aFootnote.SetPrefix( m_pFootnotePrefixED->GetText().replaceAll("\\t", "\t") ); // fdo#65666
- aFootnote.SetSuffix( m_pFootnoteSuffixED->GetText().replaceAll("\\t", "\t") );
+ aFootnote.SetNumType( m_xFootnoteNumViewBox->GetSelectedNumberingType() );
+ aFootnote.SetPrefix( m_xFootnotePrefixED->get_text().replaceAll("\\t", "\t") ); // fdo#65666
+ aFootnote.SetSuffix( m_xFootnoteSuffixED->get_text().replaceAll("\\t", "\t") );
SAL_FALLTHROUGH;
case FTNEND_ATTXTEND_OWNNUMSEQ:
- aFootnote.SetOffset( static_cast< sal_uInt16 >( m_pFootnoteOffsetField->GetValue()-1 ) );
+ aFootnote.SetOffset( static_cast< sal_uInt16 >( m_xFootnoteOffsetField->get_value()-1 ) );
break;
default: break;
}
- SwFormatEndAtTextEnd aEnd( m_pEndNtAtTextEndCB->IsChecked()
- ? ( m_pEndNtNumCB->IsChecked()
- ? ( m_pEndNtNumFormatCB->IsChecked()
+ SwFormatEndAtTextEnd aEnd( m_xEndNtAtTextEndCB->get_active()
+ ? ( m_xEndNtNumCB->get_active()
+ ? ( m_xEndNtNumFormatCB->get_active()
? FTNEND_ATTXTEND_OWNNUMANDFMT
: FTNEND_ATTXTEND_OWNNUMSEQ )
: FTNEND_ATTXTEND )
@@ -1932,13 +1901,13 @@ bool SwSectionFootnoteEndTabPage::FillItemSet( SfxItemSet* rSet )
switch( aEnd.GetValue() )
{
case FTNEND_ATTXTEND_OWNNUMANDFMT:
- aEnd.SetNumType( m_pEndNumViewBox->GetSelectedNumberingType() );
- aEnd.SetPrefix( m_pEndPrefixED->GetText().replaceAll("\\t", "\t") );
- aEnd.SetSuffix( m_pEndSuffixED->GetText().replaceAll("\\t", "\t") );
+ aEnd.SetNumType( m_xEndNumViewBox->GetSelectedNumberingType() );
+ aEnd.SetPrefix( m_xEndPrefixED->get_text().replaceAll("\\t", "\t") );
+ aEnd.SetSuffix( m_xEndSuffixED->get_text().replaceAll("\\t", "\t") );
SAL_FALLTHROUGH;
case FTNEND_ATTXTEND_OWNNUMSEQ:
- aEnd.SetOffset( static_cast< sal_uInt16 >( m_pEndOffsetField->GetValue()-1 ) );
+ aEnd.SetOffset( static_cast< sal_uInt16 >( m_xEndOffsetField->get_value()-1 ) );
break;
default: break;
}
@@ -1952,79 +1921,79 @@ bool SwSectionFootnoteEndTabPage::FillItemSet( SfxItemSet* rSet )
void SwSectionFootnoteEndTabPage::ResetState( bool bFootnote,
const SwFormatFootnoteEndAtTextEnd& rAttr )
{
- CheckBox *pNtAtTextEndCB, *pNtNumCB, *pNtNumFormatCB;
- FixedText*pPrefixFT, *pSuffixFT;
- Edit *pPrefixED, *pSuffixED;
- SwNumberingTypeListBox *pNumViewBox;
- FixedText* pOffsetText;
- NumericField *pOffsetField;
+ weld::CheckButton *pNtAtTextEndCB, *pNtNumCB, *pNtNumFormatCB;
+ weld::Label *pPrefixFT, *pSuffixFT;
+ weld::Entry *pPrefixED, *pSuffixED;
+ NumberingTypeListBox *pNumViewBox;
+ weld::Label *pOffsetText;
+ weld::SpinButton *pOffsetField;
if( bFootnote )
{
- pNtAtTextEndCB = m_pFootnoteNtAtTextEndCB;
- pNtNumCB = m_pFootnoteNtNumCB;
- pNtNumFormatCB = m_pFootnoteNtNumFormatCB;
- pPrefixFT = m_pFootnotePrefixFT;
- pPrefixED = m_pFootnotePrefixED;
- pSuffixFT = m_pFootnoteSuffixFT;
- pSuffixED = m_pFootnoteSuffixED;
- pNumViewBox = m_pFootnoteNumViewBox;
- pOffsetText = m_pFootnoteOffsetLbl;
- pOffsetField = m_pFootnoteOffsetField;
+ pNtAtTextEndCB = m_xFootnoteNtAtTextEndCB.get();
+ pNtNumCB = m_xFootnoteNtNumCB.get();
+ pNtNumFormatCB = m_xFootnoteNtNumFormatCB.get();
+ pPrefixFT = m_xFootnotePrefixFT.get();
+ pPrefixED = m_xFootnotePrefixED.get();
+ pSuffixFT = m_xFootnoteSuffixFT.get();
+ pSuffixED = m_xFootnoteSuffixED.get();
+ pNumViewBox = m_xFootnoteNumViewBox.get();
+ pOffsetText = m_xFootnoteOffsetLbl.get();
+ pOffsetField = m_xFootnoteOffsetField.get();
}
else
{
- pNtAtTextEndCB = m_pEndNtAtTextEndCB;
- pNtNumCB = m_pEndNtNumCB;
- pNtNumFormatCB = m_pEndNtNumFormatCB;
- pPrefixFT = m_pEndPrefixFT;
- pPrefixED = m_pEndPrefixED;
- pSuffixFT = m_pEndSuffixFT;
- pSuffixED = m_pEndSuffixED;
- pNumViewBox = m_pEndNumViewBox;
- pOffsetText = m_pEndOffsetLbl;
- pOffsetField = m_pEndOffsetField;
+ pNtAtTextEndCB = m_xEndNtAtTextEndCB.get();
+ pNtNumCB = m_xEndNtNumCB.get();
+ pNtNumFormatCB = m_xEndNtNumFormatCB.get();
+ pPrefixFT = m_xEndPrefixFT.get();
+ pPrefixED = m_xEndPrefixED.get();
+ pSuffixFT = m_xEndSuffixFT.get();
+ pSuffixED = m_xEndSuffixED.get();
+ pNumViewBox = m_xEndNumViewBox.get();
+ pOffsetText = m_xEndOffsetLbl.get();
+ pOffsetField = m_xEndOffsetField.get();
}
const sal_uInt16 eState = rAttr.GetValue();
switch( eState )
{
case FTNEND_ATTXTEND_OWNNUMANDFMT:
- pNtNumFormatCB->SetState( TRISTATE_TRUE );
+ pNtNumFormatCB->set_state( TRISTATE_TRUE );
SAL_FALLTHROUGH;
case FTNEND_ATTXTEND_OWNNUMSEQ:
- pNtNumCB->SetState( TRISTATE_TRUE );
+ pNtNumCB->set_state( TRISTATE_TRUE );
SAL_FALLTHROUGH;
case FTNEND_ATTXTEND:
- pNtAtTextEndCB->SetState( TRISTATE_TRUE );
+ pNtAtTextEndCB->set_state( TRISTATE_TRUE );
// no break;
}
pNumViewBox->SelectNumberingType( rAttr.GetNumType() );
- pOffsetField->SetValue( rAttr.GetOffset() + 1 );
- pPrefixED->SetText( rAttr.GetPrefix().replaceAll("\t", "\\t") );
- pSuffixED->SetText( rAttr.GetSuffix().replaceAll("\t", "\\t") );
+ pOffsetField->set_value( rAttr.GetOffset() + 1 );
+ pPrefixED->set_text( rAttr.GetPrefix().replaceAll("\t", "\\t") );
+ pSuffixED->set_text( rAttr.GetSuffix().replaceAll("\t", "\\t") );
switch( eState )
{
case FTNEND_ATPGORDOCEND:
- pNtNumCB->Enable( false );
+ pNtNumCB->set_sensitive( false );
SAL_FALLTHROUGH;
case FTNEND_ATTXTEND:
- pNtNumFormatCB->Enable( false );
- pOffsetField->Enable( false );
- pOffsetText->Enable( false );
+ pNtNumFormatCB->set_sensitive( false );
+ pOffsetField->set_sensitive( false );
+ pOffsetText->set_sensitive( false );
SAL_FALLTHROUGH;
case FTNEND_ATTXTEND_OWNNUMSEQ:
pNumViewBox->Enable( false );
- pPrefixFT->Enable( false );
- pPrefixED->Enable( false );
- pSuffixFT->Enable( false );
- pSuffixED->Enable( false );
+ pPrefixFT->set_sensitive( false );
+ pPrefixED->set_sensitive( false );
+ pSuffixFT->set_sensitive( false );
+ pSuffixED->set_sensitive( false );
// no break;
}
}
@@ -2038,61 +2007,61 @@ void SwSectionFootnoteEndTabPage::Reset( const SfxItemSet* rSet )
VclPtr<SfxTabPage> SwSectionFootnoteEndTabPage::Create( TabPageParent pParent,
const SfxItemSet* rAttrSet)
{
- return VclPtr<SwSectionFootnoteEndTabPage>::Create(pParent.pParent, *rAttrSet);
+ return VclPtr<SwSectionFootnoteEndTabPage>::Create(pParent, *rAttrSet);
}
-IMPL_LINK( SwSectionFootnoteEndTabPage, FootEndHdl, Button *, pBox, void )
+IMPL_LINK( SwSectionFootnoteEndTabPage, FootEndHdl, weld::ToggleButton&, rBox, void )
{
- bool bFoot = m_pFootnoteNtAtTextEndCB == pBox || m_pFootnoteNtNumCB == pBox ||
- m_pFootnoteNtNumFormatCB == pBox ;
+ bool bFoot = m_xFootnoteNtAtTextEndCB.get() == &rBox || m_xFootnoteNtNumCB.get() == &rBox ||
+ m_xFootnoteNtNumFormatCB.get() == &rBox ;
- CheckBox *pNumBox, *pNumFormatBox, *pEndBox;
- SwNumberingTypeListBox* pNumViewBox;
- FixedText* pOffsetText;
- NumericField *pOffsetField;
- FixedText*pPrefixFT, *pSuffixFT;
- Edit *pPrefixED, *pSuffixED;
+ weld::CheckButton *pNumBox, *pNumFormatBox, *pEndBox;
+ NumberingTypeListBox* pNumViewBox;
+ weld::Label *pOffsetText;
+ weld::SpinButton *pOffsetField;
+ weld::Label *pPrefixFT, *pSuffixFT;
+ weld::Entry *pPrefixED, *pSuffixED;
if( bFoot )
{
- pEndBox = m_pFootnoteNtAtTextEndCB;
- pNumBox = m_pFootnoteNtNumCB;
- pNumFormatBox = m_pFootnoteNtNumFormatCB;
- pNumViewBox = m_pFootnoteNumViewBox;
- pOffsetText = m_pFootnoteOffsetLbl;
- pOffsetField = m_pFootnoteOffsetField;
- pPrefixFT = m_pFootnotePrefixFT;
- pSuffixFT = m_pFootnoteSuffixFT;
- pPrefixED = m_pFootnotePrefixED;
- pSuffixED = m_pFootnoteSuffixED;
+ pEndBox = m_xFootnoteNtAtTextEndCB.get();
+ pNumBox = m_xFootnoteNtNumCB.get();
+ pNumFormatBox = m_xFootnoteNtNumFormatCB.get();
+ pNumViewBox = m_xFootnoteNumViewBox.get();
+ pOffsetText = m_xFootnoteOffsetLbl.get();
+ pOffsetField = m_xFootnoteOffsetField.get();
+ pPrefixFT = m_xFootnotePrefixFT.get();
+ pSuffixFT = m_xFootnoteSuffixFT.get();
+ pPrefixED = m_xFootnotePrefixED.get();
+ pSuffixED = m_xFootnoteSuffixED.get();
}
else
{
- pEndBox = m_pEndNtAtTextEndCB;
- pNumBox = m_pEndNtNumCB;
- pNumFormatBox = m_pEndNtNumFormatCB;
- pNumViewBox = m_pEndNumViewBox;
- pOffsetText = m_pEndOffsetLbl;
- pOffsetField = m_pEndOffsetField;
- pPrefixFT = m_pEndPrefixFT;
- pSuffixFT = m_pEndSuffixFT;
- pPrefixED = m_pEndPrefixED;
- pSuffixED = m_pEndSuffixED;
- }
-
- bool bEnableAtEnd = TRISTATE_TRUE == pEndBox->GetState();
- bool bEnableNum = bEnableAtEnd && TRISTATE_TRUE == pNumBox->GetState();
- bool bEnableNumFormat = bEnableNum && TRISTATE_TRUE == pNumFormatBox->GetState();
-
- pNumBox->Enable( bEnableAtEnd );
- pOffsetText->Enable( bEnableNum );
- pOffsetField->Enable( bEnableNum );
- pNumFormatBox->Enable( bEnableNum );
+ pEndBox = m_xEndNtAtTextEndCB.get();
+ pNumBox = m_xEndNtNumCB.get();
+ pNumFormatBox = m_xEndNtNumFormatCB.get();
+ pNumViewBox = m_xEndNumViewBox.get();
+ pOffsetText = m_xEndOffsetLbl.get();
+ pOffsetField = m_xEndOffsetField.get();
+ pPrefixFT = m_xEndPrefixFT.get();
+ pSuffixFT = m_xEndSuffixFT.get();
+ pPrefixED = m_xEndPrefixED.get();
+ pSuffixED = m_xEndSuffixED.get();
+ }
+
+ bool bEnableAtEnd = TRISTATE_TRUE == pEndBox->get_state();
+ bool bEnableNum = bEnableAtEnd && TRISTATE_TRUE == pNumBox->get_state();
+ bool bEnableNumFormat = bEnableNum && TRISTATE_TRUE == pNumFormatBox->get_state();
+
+ pNumBox->set_sensitive( bEnableAtEnd );
+ pOffsetText->set_sensitive( bEnableNum );
+ pOffsetField->set_sensitive( bEnableNum );
+ pNumFormatBox->set_sensitive( bEnableNum );
pNumViewBox->Enable( bEnableNumFormat );
- pPrefixED->Enable( bEnableNumFormat );
- pSuffixED->Enable( bEnableNumFormat );
- pPrefixFT->Enable( bEnableNumFormat );
- pSuffixFT->Enable( bEnableNumFormat );
+ pPrefixED->set_sensitive( bEnableNumFormat );
+ pSuffixED->set_sensitive( bEnableNumFormat );
+ pPrefixFT->set_sensitive( bEnableNumFormat );
+ pSuffixFT->set_sensitive( bEnableNumFormat );
}
SwSectionPropertyTabDialog::SwSectionPropertyTabDialog(
diff --git a/sw/source/uibase/inc/numberingtypelistbox.hxx b/sw/source/uibase/inc/numberingtypelistbox.hxx
index b6c83f14e5c1..fc4c48890805 100644
--- a/sw/source/uibase/inc/numberingtypelistbox.hxx
+++ b/sw/source/uibase/inc/numberingtypelistbox.hxx
@@ -41,23 +41,6 @@ namespace o3tl {
struct SwNumberingTypeListBox_Impl;
-class SW_DLLPUBLIC SwNumberingTypeListBox : public ListBox
-{
- std::unique_ptr<SwNumberingTypeListBox_Impl> pImpl;
-
-public:
- SwNumberingTypeListBox( vcl::Window* pWin, WinBits nStyle );
- virtual ~SwNumberingTypeListBox() override;
- virtual void dispose() override;
-
- virtual bool set_property(const OString &rKey, const OUString &rValue) override;
-
- void Reload(SwInsertNumTypes nTypeFlags);
-
- SvxNumType GetSelectedNumberingType();
- bool SelectNumberingType(SvxNumType nType);
-};
-
class SW_DLLPUBLIC NumberingTypeListBox
{
std::unique_ptr<weld::ComboBoxText> m_xWidget;
@@ -73,6 +56,7 @@ public:
SvxNumType GetSelectedNumberingType();
bool SelectNumberingType(SvxNumType nType);
void SetNoSelection() { m_xWidget->set_active(-1); }
+ void Enable(bool bEnable) { m_xWidget->set_sensitive(bEnable); }
};
#endif
diff --git a/sw/source/uibase/inc/regionsw.hxx b/sw/source/uibase/inc/regionsw.hxx
index 83480447d891..df0642a2e140 100644
--- a/sw/source/uibase/inc/regionsw.hxx
+++ b/sw/source/uibase/inc/regionsw.hxx
@@ -191,39 +191,33 @@ public:
class SwSectionFootnoteEndTabPage : public SfxTabPage
{
- VclPtr<CheckBox> m_pFootnoteNtAtTextEndCB;
-
- VclPtr<CheckBox> m_pFootnoteNtNumCB;
- VclPtr<FixedText> m_pFootnoteOffsetLbl;
- VclPtr<NumericField> m_pFootnoteOffsetField;
-
- VclPtr<CheckBox> m_pFootnoteNtNumFormatCB;
- VclPtr<FixedText> m_pFootnotePrefixFT;
- VclPtr<Edit> m_pFootnotePrefixED;
- VclPtr<SwNumberingTypeListBox> m_pFootnoteNumViewBox;
- VclPtr<FixedText> m_pFootnoteSuffixFT;
- VclPtr<Edit> m_pFootnoteSuffixED;
-
- VclPtr<CheckBox> m_pEndNtAtTextEndCB;
-
- VclPtr<CheckBox> m_pEndNtNumCB;
- VclPtr<FixedText> m_pEndOffsetLbl;
- VclPtr<NumericField> m_pEndOffsetField;
-
- VclPtr<CheckBox> m_pEndNtNumFormatCB;
- VclPtr<FixedText> m_pEndPrefixFT;
- VclPtr<Edit> m_pEndPrefixED;
- VclPtr<SwNumberingTypeListBox> m_pEndNumViewBox;
- VclPtr<FixedText> m_pEndSuffixFT;
- VclPtr<Edit> m_pEndSuffixED;
-
- DECL_LINK( FootEndHdl, Button*, void );
+ std::unique_ptr<weld::CheckButton> m_xFootnoteNtAtTextEndCB;
+ std::unique_ptr<weld::CheckButton> m_xFootnoteNtNumCB;
+ std::unique_ptr<weld::Label> m_xFootnoteOffsetLbl;
+ std::unique_ptr<weld::SpinButton> m_xFootnoteOffsetField;
+ std::unique_ptr<weld::CheckButton> m_xFootnoteNtNumFormatCB;
+ std::unique_ptr<weld::Label> m_xFootnotePrefixFT;
+ std::unique_ptr<weld::Entry> m_xFootnotePrefixED;
+ std::unique_ptr<NumberingTypeListBox> m_xFootnoteNumViewBox;
+ std::unique_ptr<weld::Label> m_xFootnoteSuffixFT;
+ std::unique_ptr<weld::Entry> m_xFootnoteSuffixED;
+ std::unique_ptr<weld::CheckButton> m_xEndNtAtTextEndCB;
+ std::unique_ptr<weld::CheckButton> m_xEndNtNumCB;
+ std::unique_ptr<weld::Label> m_xEndOffsetLbl;
+ std::unique_ptr<weld::SpinButton> m_xEndOffsetField;
+ std::unique_ptr<weld::CheckButton> m_xEndNtNumFormatCB;
+ std::unique_ptr<weld::Label> m_xEndPrefixFT;
+ std::unique_ptr<weld::Entry> m_xEndPrefixED;
+ std::unique_ptr<NumberingTypeListBox> m_xEndNumViewBox;
+ std::unique_ptr<weld::Label> m_xEndSuffixFT;
+ std::unique_ptr<weld::Entry> m_xEndSuffixED;
+
+ DECL_LINK(FootEndHdl, weld::ToggleButton&, void);
void ResetState( bool bFootnote, const SwFormatFootnoteEndAtTextEnd& );
public:
- SwSectionFootnoteEndTabPage( vcl::Window *pParent, const SfxItemSet &rAttrSet );
+ SwSectionFootnoteEndTabPage(TabPageParent pParent, const SfxItemSet &rAttrSet);
virtual ~SwSectionFootnoteEndTabPage() override;
- virtual void dispose() override;
virtual bool FillItemSet( SfxItemSet* ) override;
virtual void Reset( const SfxItemSet* ) override;
diff --git a/sw/source/uibase/misc/numberingtypelistbox.cxx b/sw/source/uibase/misc/numberingtypelistbox.cxx
index c4bc802155ca..ad3b37db48f7 100644
--- a/sw/source/uibase/misc/numberingtypelistbox.cxx
+++ b/sw/source/uibase/misc/numberingtypelistbox.cxx
@@ -38,151 +38,6 @@ struct SwNumberingTypeListBox_Impl
uno::Reference<text::XNumberingTypeInfo> xInfo;
};
-SwNumberingTypeListBox::SwNumberingTypeListBox( vcl::Window* pWin, WinBits nStyle ) :
- ListBox(pWin, nStyle),
- pImpl(new SwNumberingTypeListBox_Impl)
-{
- uno::Reference<uno::XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
- uno::Reference<text::XDefaultNumberingProvider> xDefNum = text::DefaultNumberingProvider::create(xContext);
-
- pImpl->xInfo.set(xDefNum, uno::UNO_QUERY);
-}
-
-bool SwNumberingTypeListBox::set_property(const OString &rKey, const OUString &rValue)
-{
- if (rKey == "type")
- Reload(static_cast<SwInsertNumTypes>(rValue.toInt32()));
- else
- return ListBox::set_property(rKey, rValue);
- return true;
-}
-
-extern "C" SAL_DLLPUBLIC_EXPORT void makeSwNumberingTypeListBox(VclPtr<vcl::Window> & rRet, VclPtr<vcl::Window> & pParent, VclBuilder::stringmap &)
-{
- VclPtrInstance<SwNumberingTypeListBox> pListBox(pParent, WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK|WB_TABSTOP);
- pListBox->EnableAutoSize(true);
- rRet = pListBox;
-}
-
-SwNumberingTypeListBox::~SwNumberingTypeListBox()
-{
- disposeOnce();
-}
-
-void SwNumberingTypeListBox::dispose()
-{
- pImpl.reset();
- ListBox::dispose();
-}
-
-void SwNumberingTypeListBox::Reload(SwInsertNumTypes nTypeFlags)
-{
- Clear();
- uno::Sequence<sal_Int16> aTypes;
- const sal_Int16* pTypes = nullptr;
- if(nTypeFlags & SwInsertNumTypes::Extended)
- {
- if(pImpl->xInfo.is())
- {
- aTypes = pImpl->xInfo->getSupportedNumberingTypes();
- pTypes = aTypes.getConstArray();
- }
- }
-
- for(size_t i = 0; i < SvxNumberingTypeTable::Count(); i++)
- {
- sal_IntPtr nValue = SvxNumberingTypeTable::GetValue(i);
- bool bInsert = true;
- sal_Int32 nPos = LISTBOX_APPEND;
- switch(nValue)
- {
- case style::NumberingType::NUMBER_NONE:
- bInsert = bool(nTypeFlags & SwInsertNumTypes::NoNumbering);
- nPos = 0;
-
- break;
- case style::NumberingType::CHAR_SPECIAL:
- bInsert = bool(nTypeFlags & SwInsertNumTypes::Bullet);
-
- break;
- case style::NumberingType::PAGE_DESCRIPTOR:
- bInsert = bool(nTypeFlags & SwInsertNumTypes::PageStyleNumbering);
-
- break;
- case style::NumberingType::BITMAP:
- bInsert = bool(nTypeFlags & SwInsertNumTypes::Bitmap );
-
- break;
- case style::NumberingType::BITMAP | LINK_TOKEN:
- bInsert = false;
-
- break;
- default:
- if (nValue > style::NumberingType::CHARS_LOWER_LETTER_N)
- {
- // Insert only if offered by i18n framework per configuration.
- bInsert = false;
- if (pTypes)
- {
- for(sal_Int32 nType = 0; nType < aTypes.getLength(); nType++)
- {
- if (pTypes[nType] == nValue)
- {
- bInsert = true;
- break; // for
- }
- }
- }
- }
- }
- if(bInsert)
- {
- sal_Int32 nEntry = InsertEntry(SvxNumberingTypeTable::GetString(i), nPos);
- SetEntryData( nEntry, reinterpret_cast<void*>(nValue) );
- }
- }
- if(nTypeFlags & SwInsertNumTypes::Extended)
- {
- if(pTypes)
- {
- for(sal_Int32 nType = 0; nType < aTypes.getLength(); nType++)
- {
- sal_Int16 nCurrent = pTypes[nType];
- if(nCurrent > style::NumberingType::CHARS_LOWER_LETTER_N)
- {
- if(LISTBOX_ENTRY_NOTFOUND == GetEntryPos(reinterpret_cast<void*>(static_cast<sal_uLong>(nCurrent))))
- {
- OUString aIdent = pImpl->xInfo->getNumberingIdentifier( nCurrent );
- sal_Int32 nPos = InsertEntry(aIdent);
- SetEntryData(nPos, reinterpret_cast<void*>(static_cast<sal_uLong>(nCurrent)));
- }
- }
- }
- }
- SelectEntryPos(0);
- }
-}
-
-SvxNumType SwNumberingTypeListBox::GetSelectedNumberingType()
-{
- SvxNumType nRet = SVX_NUM_CHARS_UPPER_LETTER;
- sal_Int32 nSelPos = GetSelectedEntryPos();
- if(LISTBOX_ENTRY_NOTFOUND != nSelPos)
- nRet = static_cast<SvxNumType>(reinterpret_cast<sal_uLong>(GetEntryData(nSelPos)));
-#if OSL_DEBUG_LEVEL > 0
- else
- OSL_FAIL("SwNumberingTypeListBox not selected");
-#endif
- return nRet;
-}
-
-bool SwNumberingTypeListBox::SelectNumberingType(SvxNumType nType)
-{
- sal_Int32 nPos = GetEntryPos(reinterpret_cast<void*>(static_cast<sal_uLong>(nType)));
- SelectEntryPos( nPos );
- return LISTBOX_ENTRY_NOTFOUND != nPos;
-}
-
NumberingTypeListBox::NumberingTypeListBox(weld::ComboBoxText* pWidget)
: m_xWidget(pWidget)
, m_xImpl(new SwNumberingTypeListBox_Impl)
diff --git a/sw/uiconfig/swriter/ui/footnotesendnotestabpage.ui b/sw/uiconfig/swriter/ui/footnotesendnotestabpage.ui
index 7c846fa4c5d9..bd4e527399d3 100644
--- a/sw/uiconfig/swriter/ui/footnotesendnotestabpage.ui
+++ b/sw/uiconfig/swriter/ui/footnotesendnotestabpage.ui
@@ -1,13 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.1 -->
<interface domain="sw">
- <!-- interface-requires gtk+ 3.0 -->
- <!-- interface-requires LibreOffice 1.0 -->
+ <requires lib="gtk+" version="3.18"/>
<object class="GtkAdjustment" id="adjustment1">
<property name="lower">1</property>
<property name="upper">9999</property>
<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">9999</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
<object class="GtkBox" id="FootnotesEndnotesTabPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -58,8 +64,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -73,13 +77,12 @@
<object class="GtkSpinButton" id="ftnoffset">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="activates_default">True</property>
<property name="adjustment">adjustment1</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -87,24 +90,20 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">12</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="footnotesendnotestabpage|ftnoffset_label">_Start at:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">ftnoffset</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -122,8 +121,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -138,42 +135,36 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="max_length">50</property>
+ <property name="activates_default">True</property>
<property name="width_chars">6</property>
</object>
<packing>
<property name="left_attach">4</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="ftnsuffix_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="footnotesendnotestabpage|ftnsuffix_label">Aft_er:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">ftnsuffix</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
- <object class="swlo-SwNumberingTypeListBox" id="ftnnumviewbox">
+ <object class="GtkComboBoxText" id="ftnnumviewbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="type">16</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -181,13 +172,12 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="max_length">50</property>
+ <property name="activates_default">True</property>
<property name="width_chars">6</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -195,32 +185,26 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">24</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="footnotesendnotestabpage|ftnprefix_label">Be_fore:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">ftnprefix</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -237,8 +221,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
@@ -298,8 +280,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -324,8 +304,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -339,13 +317,12 @@
<object class="GtkSpinButton" id="endoffset">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="adjustment">adjustment1</property>
+ <property name="activates_default">True</property>
+ <property name="adjustment">adjustment2</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -353,24 +330,20 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">12</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="footnotesendnotestabpage|endoffset_label">_Start at:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">endoffset</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -388,8 +361,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -404,42 +375,36 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="max_length">50</property>
+ <property name="activates_default">True</property>
<property name="width_chars">6</property>
</object>
<packing>
<property name="left_attach">4</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="endsuffix_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="footnotesendnotestabpage|endsuffix_label">Aft_er:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">endsuffix</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
- <object class="swlo-SwNumberingTypeListBox" id="endnumviewbox">
+ <object class="GtkComboBoxText" id="endnumviewbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="type">16</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -447,13 +412,12 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="max_length">50</property>
+ <property name="activates_default">True</property>
<property name="width_chars">6</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
<child>
@@ -461,32 +425,26 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">24</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="footnotesendnotestabpage|endprefix_label">Be_fore:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">endprefix</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
</packing>
</child>
</object>