diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-09-17 12:20:44 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-09-18 21:59:11 +0200 |
commit | 117514ec9f79d8a608b34c5372c83cf63b2a6e3b (patch) | |
tree | 9143d5a46e3118687eb3c3fba0026e211b8d34d6 /svx | |
parent | feadf8387fb215ad0e126139c7b32af11ea2e194 (diff) |
weld TextControlCharAttribDialog and TextControlParaAttribDialog
Change-Id: Id90967c9be1a56535aac3900a0cc2555ed8f9600
Reviewed-on: https://gerrit.libreoffice.org/60583
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/form/fmtextcontroldialogs.cxx | 38 | ||||
-rw-r--r-- | svx/source/form/fmtextcontrolshell.cxx | 14 | ||||
-rw-r--r-- | svx/source/inc/fmtextcontroldialogs.hxx | 16 | ||||
-rw-r--r-- | svx/uiconfig/ui/textcontrolchardialog.ui | 102 | ||||
-rw-r--r-- | svx/uiconfig/ui/textcontrolparadialog.ui | 128 |
5 files changed, 230 insertions, 68 deletions
diff --git a/svx/source/form/fmtextcontroldialogs.cxx b/svx/source/form/fmtextcontroldialogs.cxx index eca5ac22a038..53b854120c9f 100644 --- a/svx/source/form/fmtextcontroldialogs.cxx +++ b/svx/source/form/fmtextcontroldialogs.cxx @@ -31,44 +31,38 @@ namespace svx { - TextControlCharAttribDialog::TextControlCharAttribDialog( vcl::Window* pParent, const SfxItemSet& _rCoreSet, const SvxFontListItem& _rFontList ) - : SfxTabDialog( pParent, "TextControlCharacterPropertiesDialog", - "svx/ui/textcontrolchardialog.ui", &_rCoreSet ) - , m_aFontList(_rFontList) - , m_nCharNamePageId(0) - , m_nCharEffectsPageId(0) - , m_nCharPositionPageId(0) + TextControlCharAttribDialog::TextControlCharAttribDialog(weld::Window* pParent, const SfxItemSet& rCoreSet, const SvxFontListItem& rFontList) + : SfxTabDialogController(pParent, "svx/ui/textcontrolchardialog.ui", "TextControlCharacterPropertiesDialog", &rCoreSet) + , m_aFontList(rFontList) { - m_nCharNamePageId = AddTabPage("font", RID_SVXPAGE_CHAR_NAME); - m_nCharEffectsPageId = AddTabPage("fonteffects", RID_SVXPAGE_CHAR_EFFECTS); - m_nCharPositionPageId = AddTabPage("position", RID_SVXPAGE_CHAR_POSITION); + AddTabPage("font", RID_SVXPAGE_CHAR_NAME); + AddTabPage("fonteffects", RID_SVXPAGE_CHAR_EFFECTS); + AddTabPage("position", RID_SVXPAGE_CHAR_POSITION); } - void TextControlCharAttribDialog::PageCreated( sal_uInt16 _nId, SfxTabPage& _rPage ) + void TextControlCharAttribDialog::PageCreated(const OString& rId, SfxTabPage& rPage) { SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); - if (_nId == m_nCharNamePageId) + if (rId == "font") { aSet.Put (m_aFontList); - _rPage.PageCreated(aSet); + rPage.PageCreated(aSet); } - else if (_nId == m_nCharEffectsPageId) + else if (rId == "fonteffects") { aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP)); - _rPage.PageCreated(aSet); + rPage.PageCreated(aSet); } - else if (_nId == m_nCharPositionPageId) + else if (rId == "position") { aSet.Put( SfxUInt32Item(SID_FLAG_TYPE, SVX_PREVIEW_CHARACTER) ); - _rPage.PageCreated(aSet); + rPage.PageCreated(aSet); } } - TextControlParaAttribDialog::TextControlParaAttribDialog(vcl::Window* _pParent, - const SfxItemSet& _rCoreSet) - : SfxTabDialog( _pParent, "TextControlParagraphPropertiesDialog", - "svx/ui/textcontrolparadialog.ui", &_rCoreSet ) + TextControlParaAttribDialog::TextControlParaAttribDialog(weld::Window* pParent, const SfxItemSet& rCoreSet) + : SfxTabDialogController(pParent, "svx/ui/textcontrolparadialog.ui", "TextControlParagraphPropertiesDialog", &rCoreSet) { AddTabPage("labelTP_PARA_STD", RID_SVXPAGE_STD_PARAGRAPH); AddTabPage("labelTP_PARA_ALIGN", RID_SVXPAGE_ALIGN_PARAGRAPH); @@ -81,8 +75,6 @@ namespace svx AddTabPage("labelTP_TABULATOR", RID_SVXPAGE_TABULATOR); } - } - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/form/fmtextcontrolshell.cxx b/svx/source/form/fmtextcontrolshell.cxx index becb05cb0976..d97182f87ec6 100644 --- a/svx/source/form/fmtextcontrolshell.cxx +++ b/svx/source/form/fmtextcontrolshell.cxx @@ -619,7 +619,7 @@ namespace svx } - void FmTextControlShell::executeAttributeDialog( AttributeSet _eSet, SfxRequest& _rReq ) + void FmTextControlShell::executeAttributeDialog( AttributeSet _eSet, SfxRequest& rReq ) { const SvxFontListItem* pFontList = dynamic_cast<const SvxFontListItem*>( m_pViewFrame->GetObjectShell()->GetItem( SID_ATTR_CHAR_FONTLIST ) ); DBG_ASSERT( pFontList, "FmTextControlShell::executeAttributeDialog: no font list item!" ); @@ -640,12 +640,12 @@ namespace svx fillFeatureDispatchers( m_xActiveControl, pDialogSlots, aAdditionalFestures ); transferFeatureStatesToItemSet( aAdditionalFestures, *xCurrentItems, true ); - VclPtr<SfxTabDialog> xDialog; - if ( _eSet == eCharAttribs) - xDialog = VclPtr<TextControlCharAttribDialog>::Create( nullptr, *xCurrentItems, *pFontList ); + std::unique_ptr<SfxTabDialogController> xDialog; + if (_eSet == eCharAttribs) + xDialog = o3tl::make_unique<TextControlCharAttribDialog>(rReq.GetFrameWeld(), *xCurrentItems, *pFontList); else - xDialog = VclPtr<TextControlParaAttribDialog>::Create( nullptr, *xCurrentItems ); - if ( RET_OK == xDialog->Execute() ) + xDialog = o3tl::make_unique<TextControlParaAttribDialog>(rReq.GetFrameWeld(), *xCurrentItems); + if ( RET_OK == xDialog->execute() ) { const SfxItemSet& rModifiedItems = *xDialog->GetOutputItemSet(); for ( WhichId nWhich = pPool->GetFirstWhich(); nWhich <= pPool->GetLastWhich(); ++nWhich ) @@ -721,7 +721,7 @@ namespace svx #endif } } - _rReq.Done( rModifiedItems ); + rReq.Done( rModifiedItems ); } xDialog.reset(); diff --git a/svx/source/inc/fmtextcontroldialogs.hxx b/svx/source/inc/fmtextcontroldialogs.hxx index e15fffde0851..d08a5d0cde13 100644 --- a/svx/source/inc/fmtextcontroldialogs.hxx +++ b/svx/source/inc/fmtextcontroldialogs.hxx @@ -24,34 +24,28 @@ #include <sfx2/tabdlg.hxx> #include <editeng/flstitem.hxx> - namespace svx { - class TextControlCharAttribDialog : public SfxTabDialog + class TextControlCharAttribDialog : public SfxTabDialogController { private: SvxFontListItem m_aFontList; - sal_uInt16 m_nCharNamePageId; - sal_uInt16 m_nCharEffectsPageId; - sal_uInt16 m_nCharPositionPageId; public: - TextControlCharAttribDialog( vcl::Window* pParent, const SfxItemSet& _rCoreSet, const SvxFontListItem& _rFontList ); + TextControlCharAttribDialog(weld::Window* pParent, const SfxItemSet& rCoreSet, const SvxFontListItem& rFontList); protected: - virtual void PageCreated( sal_uInt16 _nId, SfxTabPage& _rPage ) override; + virtual void PageCreated(const OString& rId, SfxTabPage& _rPage) override; }; - class TextControlParaAttribDialog : public SfxTabDialog + class TextControlParaAttribDialog : public SfxTabDialogController { public: - TextControlParaAttribDialog(vcl::Window* _pParent, const SfxItemSet& _rCoreSet); + TextControlParaAttribDialog(weld::Window* pParent, const SfxItemSet& rCoreSet); }; - } - #endif // INCLUDED_SVX_SOURCE_INC_FMTEXTCONTROLDIALOGS_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/uiconfig/ui/textcontrolchardialog.ui b/svx/uiconfig/ui/textcontrolchardialog.ui index 15b664b5b7cb..2b8d7016f52e 100644 --- a/svx/uiconfig/ui/textcontrolchardialog.ui +++ b/svx/uiconfig/ui/textcontrolchardialog.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.20.0 --> +<!-- Generated with glade 3.22.1 --> <interface domain="svx"> <requires lib="gtk+" version="3.18"/> <object class="GtkDialog" id="TextControlCharacterPropertiesDialog"> @@ -8,6 +8,9 @@ <property name="title" translatable="yes" context="textcontrolchardialog|TextControlCharacterPropertiesDialog">Character</property> <property name="resizable">False</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> @@ -18,12 +21,10 @@ <property name="can_focus">False</property> <property name="layout_style">end</property> <child> - <object class="GtkButton" id="ok"> - <property name="label">gtk-ok</property> + <object class="GtkButton" id="reset"> + <property name="label">gtk-revert-to-saved</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> </object> @@ -34,10 +35,12 @@ </packing> </child> <child> - <object class="GtkButton" id="cancel"> - <property name="label">gtk-cancel</property> + <object class="GtkButton" id="ok"> + <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> </object> @@ -48,8 +51,8 @@ </packing> </child> <child> - <object class="GtkButton" id="help"> - <property name="label">gtk-help</property> + <object class="GtkButton" id="cancel"> + <property name="label">gtk-cancel</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -59,12 +62,11 @@ <property name="expand">False</property> <property name="fill">True</property> <property name="position">2</property> - <property name="secondary">True</property> </packing> </child> <child> - <object class="GtkButton" id="reset"> - <property name="label">gtk-revert-to-saved</property> + <object class="GtkButton" id="help"> + <property name="label">gtk-help</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -74,6 +76,7 @@ <property name="expand">False</property> <property name="fill">True</property> <property name="position">3</property> + <property name="secondary">True</property> </packing> </child> </object> @@ -90,6 +93,7 @@ <property name="can_focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> + <property name="scrollable">True</property> <child> <object class="GtkGrid"> <property name="visible">True</property> @@ -97,6 +101,30 @@ <child> <placeholder/> </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> </object> </child> <child type="tab"> @@ -116,6 +144,30 @@ <child> <placeholder/> </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> </object> <packing> <property name="position">1</property> @@ -139,6 +191,30 @@ <child> <placeholder/> </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> </object> <packing> <property name="position">2</property> @@ -165,10 +241,10 @@ </object> </child> <action-widgets> + <action-widget response="0">reset</action-widget> <action-widget response="-5">ok</action-widget> <action-widget response="-6">cancel</action-widget> <action-widget response="-11">help</action-widget> - <action-widget response="0">reset</action-widget> </action-widgets> </object> </interface> diff --git a/svx/uiconfig/ui/textcontrolparadialog.ui b/svx/uiconfig/ui/textcontrolparadialog.ui index ecff2a7ac22c..f87062a90c5b 100644 --- a/svx/uiconfig/ui/textcontrolparadialog.ui +++ b/svx/uiconfig/ui/textcontrolparadialog.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.20.0 --> +<!-- Generated with glade 3.22.1 --> <interface domain="svx"> <requires lib="gtk+" version="3.18"/> <object class="GtkDialog" id="TextControlParagraphPropertiesDialog"> @@ -8,6 +8,9 @@ <property name="title" translatable="yes" context="textcontrolparadialog|TextControlParagraphPropertiesDialog">Paragraph</property> <property name="resizable">False</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> @@ -18,12 +21,10 @@ <property name="can_focus">False</property> <property name="layout_style">end</property> <child> - <object class="GtkButton" id="ok"> - <property name="label">gtk-ok</property> + <object class="GtkButton" id="reset"> + <property name="label">gtk-revert-to-saved</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> </object> @@ -34,10 +35,12 @@ </packing> </child> <child> - <object class="GtkButton" id="cancel"> - <property name="label">gtk-cancel</property> + <object class="GtkButton" id="ok"> + <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> </object> @@ -48,8 +51,8 @@ </packing> </child> <child> - <object class="GtkButton" id="help"> - <property name="label">gtk-help</property> + <object class="GtkButton" id="cancel"> + <property name="label">gtk-cancel</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -59,12 +62,11 @@ <property name="expand">False</property> <property name="fill">True</property> <property name="position">2</property> - <property name="secondary">True</property> </packing> </child> <child> - <object class="GtkButton" id="reset"> - <property name="label">gtk-revert-to-saved</property> + <object class="GtkButton" id="help"> + <property name="label">gtk-help</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -74,6 +76,7 @@ <property name="expand">False</property> <property name="fill">True</property> <property name="position">3</property> + <property name="secondary">True</property> </packing> </child> </object> @@ -87,9 +90,10 @@ <child> <object class="GtkNotebook" id="tabcontrol"> <property name="visible">True</property> - <property name="can_focus">False</property> + <property name="can_focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> + <property name="scrollable">True</property> <child> <object class="GtkGrid"> <property name="visible">True</property> @@ -97,6 +101,30 @@ <child> <placeholder/> </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> </object> </child> <child type="tab"> @@ -116,6 +144,30 @@ <child> <placeholder/> </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> </object> <packing> <property name="position">1</property> @@ -140,6 +192,30 @@ <child> <placeholder/> </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> </object> <packing> <property name="position">2</property> @@ -163,6 +239,30 @@ <child> <placeholder/> </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> </object> <packing> <property name="position">3</property> @@ -189,10 +289,10 @@ </object> </child> <action-widgets> + <action-widget response="0">reset</action-widget> <action-widget response="-5">ok</action-widget> <action-widget response="-6">cancel</action-widget> <action-widget response="-11">help</action-widget> - <action-widget response="0">reset</action-widget> </action-widgets> </object> </interface> |