Kaydet (Commit) 117514ec authored tarafından Caolán McNamara's avatar Caolán McNamara

weld TextControlCharAttribDialog and TextControlParaAttribDialog

Change-Id: Id90967c9be1a56535aac3900a0cc2555ed8f9600
Reviewed-on: https://gerrit.libreoffice.org/60583
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst feadf838
...@@ -31,44 +31,38 @@ ...@@ -31,44 +31,38 @@
namespace svx namespace svx
{ {
TextControlCharAttribDialog::TextControlCharAttribDialog( vcl::Window* pParent, const SfxItemSet& _rCoreSet, const SvxFontListItem& _rFontList ) TextControlCharAttribDialog::TextControlCharAttribDialog(weld::Window* pParent, const SfxItemSet& rCoreSet, const SvxFontListItem& rFontList)
: SfxTabDialog( pParent, "TextControlCharacterPropertiesDialog", : SfxTabDialogController(pParent, "svx/ui/textcontrolchardialog.ui", "TextControlCharacterPropertiesDialog", &rCoreSet)
"svx/ui/textcontrolchardialog.ui", &_rCoreSet ) , m_aFontList(rFontList)
, m_aFontList(_rFontList)
, m_nCharNamePageId(0)
, m_nCharEffectsPageId(0)
, m_nCharPositionPageId(0)
{ {
m_nCharNamePageId = AddTabPage("font", RID_SVXPAGE_CHAR_NAME); AddTabPage("font", RID_SVXPAGE_CHAR_NAME);
m_nCharEffectsPageId = AddTabPage("fonteffects", RID_SVXPAGE_CHAR_EFFECTS); AddTabPage("fonteffects", RID_SVXPAGE_CHAR_EFFECTS);
m_nCharPositionPageId = AddTabPage("position", RID_SVXPAGE_CHAR_POSITION); 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())); SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
if (_nId == m_nCharNamePageId) if (rId == "font")
{ {
aSet.Put (m_aFontList); 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)); 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) ); aSet.Put( SfxUInt32Item(SID_FLAG_TYPE, SVX_PREVIEW_CHARACTER) );
_rPage.PageCreated(aSet); rPage.PageCreated(aSet);
} }
} }
TextControlParaAttribDialog::TextControlParaAttribDialog(vcl::Window* _pParent, TextControlParaAttribDialog::TextControlParaAttribDialog(weld::Window* pParent, const SfxItemSet& rCoreSet)
const SfxItemSet& _rCoreSet) : SfxTabDialogController(pParent, "svx/ui/textcontrolparadialog.ui", "TextControlParagraphPropertiesDialog", &rCoreSet)
: SfxTabDialog( _pParent, "TextControlParagraphPropertiesDialog",
"svx/ui/textcontrolparadialog.ui", &_rCoreSet )
{ {
AddTabPage("labelTP_PARA_STD", RID_SVXPAGE_STD_PARAGRAPH); AddTabPage("labelTP_PARA_STD", RID_SVXPAGE_STD_PARAGRAPH);
AddTabPage("labelTP_PARA_ALIGN", RID_SVXPAGE_ALIGN_PARAGRAPH); AddTabPage("labelTP_PARA_ALIGN", RID_SVXPAGE_ALIGN_PARAGRAPH);
...@@ -81,8 +75,6 @@ namespace svx ...@@ -81,8 +75,6 @@ namespace svx
AddTabPage("labelTP_TABULATOR", RID_SVXPAGE_TABULATOR); AddTabPage("labelTP_TABULATOR", RID_SVXPAGE_TABULATOR);
} }
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -619,7 +619,7 @@ namespace svx ...@@ -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 ) ); const SvxFontListItem* pFontList = dynamic_cast<const SvxFontListItem*>( m_pViewFrame->GetObjectShell()->GetItem( SID_ATTR_CHAR_FONTLIST ) );
DBG_ASSERT( pFontList, "FmTextControlShell::executeAttributeDialog: no font list item!" ); DBG_ASSERT( pFontList, "FmTextControlShell::executeAttributeDialog: no font list item!" );
...@@ -640,12 +640,12 @@ namespace svx ...@@ -640,12 +640,12 @@ namespace svx
fillFeatureDispatchers( m_xActiveControl, pDialogSlots, aAdditionalFestures ); fillFeatureDispatchers( m_xActiveControl, pDialogSlots, aAdditionalFestures );
transferFeatureStatesToItemSet( aAdditionalFestures, *xCurrentItems, true ); transferFeatureStatesToItemSet( aAdditionalFestures, *xCurrentItems, true );
VclPtr<SfxTabDialog> xDialog; std::unique_ptr<SfxTabDialogController> xDialog;
if ( _eSet == eCharAttribs) if (_eSet == eCharAttribs)
xDialog = VclPtr<TextControlCharAttribDialog>::Create( nullptr, *xCurrentItems, *pFontList ); xDialog = o3tl::make_unique<TextControlCharAttribDialog>(rReq.GetFrameWeld(), *xCurrentItems, *pFontList);
else else
xDialog = VclPtr<TextControlParaAttribDialog>::Create( nullptr, *xCurrentItems ); xDialog = o3tl::make_unique<TextControlParaAttribDialog>(rReq.GetFrameWeld(), *xCurrentItems);
if ( RET_OK == xDialog->Execute() ) if ( RET_OK == xDialog->execute() )
{ {
const SfxItemSet& rModifiedItems = *xDialog->GetOutputItemSet(); const SfxItemSet& rModifiedItems = *xDialog->GetOutputItemSet();
for ( WhichId nWhich = pPool->GetFirstWhich(); nWhich <= pPool->GetLastWhich(); ++nWhich ) for ( WhichId nWhich = pPool->GetFirstWhich(); nWhich <= pPool->GetLastWhich(); ++nWhich )
...@@ -721,7 +721,7 @@ namespace svx ...@@ -721,7 +721,7 @@ namespace svx
#endif #endif
} }
} }
_rReq.Done( rModifiedItems ); rReq.Done( rModifiedItems );
} }
xDialog.reset(); xDialog.reset();
......
...@@ -24,34 +24,28 @@ ...@@ -24,34 +24,28 @@
#include <sfx2/tabdlg.hxx> #include <sfx2/tabdlg.hxx>
#include <editeng/flstitem.hxx> #include <editeng/flstitem.hxx>
namespace svx namespace svx
{ {
class TextControlCharAttribDialog : public SfxTabDialog class TextControlCharAttribDialog : public SfxTabDialogController
{ {
private: private:
SvxFontListItem m_aFontList; SvxFontListItem m_aFontList;
sal_uInt16 m_nCharNamePageId;
sal_uInt16 m_nCharEffectsPageId;
sal_uInt16 m_nCharPositionPageId;
public: public:
TextControlCharAttribDialog( vcl::Window* pParent, const SfxItemSet& _rCoreSet, const SvxFontListItem& _rFontList ); TextControlCharAttribDialog(weld::Window* pParent, const SfxItemSet& rCoreSet, const SvxFontListItem& rFontList);
protected: 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: public:
TextControlParaAttribDialog(vcl::Window* _pParent, const SfxItemSet& _rCoreSet); TextControlParaAttribDialog(weld::Window* pParent, const SfxItemSet& rCoreSet);
}; };
} }
#endif // INCLUDED_SVX_SOURCE_INC_FMTEXTCONTROLDIALOGS_HXX #endif // INCLUDED_SVX_SOURCE_INC_FMTEXTCONTROLDIALOGS_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 --> <!-- Generated with glade 3.22.1 -->
<interface domain="svx"> <interface domain="svx">
<requires lib="gtk+" version="3.18"/> <requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="TextControlCharacterPropertiesDialog"> <object class="GtkDialog" id="TextControlCharacterPropertiesDialog">
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
<property name="title" translatable="yes" context="textcontrolchardialog|TextControlCharacterPropertiesDialog">Character</property> <property name="title" translatable="yes" context="textcontrolchardialog|TextControlCharacterPropertiesDialog">Character</property>
<property name="resizable">False</property> <property name="resizable">False</property>
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
<child>
<placeholder/>
</child>
<child internal-child="vbox"> <child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1"> <object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property> <property name="can_focus">False</property>
...@@ -18,12 +21,10 @@ ...@@ -18,12 +21,10 @@
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="layout_style">end</property> <property name="layout_style">end</property>
<child> <child>
<object class="GtkButton" id="ok"> <object class="GtkButton" id="reset">
<property name="label">gtk-ok</property> <property name="label">gtk-revert-to-saved</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">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="receives_default">True</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
</object> </object>
...@@ -34,10 +35,12 @@ ...@@ -34,10 +35,12 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton" id="cancel"> <object class="GtkButton" id="ok">
<property name="label">gtk-cancel</property> <property name="label">gtk-ok</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">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="receives_default">True</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
</object> </object>
...@@ -48,8 +51,8 @@ ...@@ -48,8 +51,8 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton" id="help"> <object class="GtkButton" id="cancel">
<property name="label">gtk-help</property> <property name="label">gtk-cancel</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>
...@@ -59,12 +62,11 @@ ...@@ -59,12 +62,11 @@
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">2</property> <property name="position">2</property>
<property name="secondary">True</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton" id="reset"> <object class="GtkButton" id="help">
<property name="label">gtk-revert-to-saved</property> <property name="label">gtk-help</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>
...@@ -74,6 +76,7 @@ ...@@ -74,6 +76,7 @@
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">3</property> <property name="position">3</property>
<property name="secondary">True</property>
</packing> </packing>
</child> </child>
</object> </object>
...@@ -90,6 +93,7 @@ ...@@ -90,6 +93,7 @@
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="vexpand">True</property> <property name="vexpand">True</property>
<property name="scrollable">True</property>
<child> <child>
<object class="GtkGrid"> <object class="GtkGrid">
<property name="visible">True</property> <property name="visible">True</property>
...@@ -97,6 +101,30 @@ ...@@ -97,6 +101,30 @@
<child> <child>
<placeholder/> <placeholder/>
</child> </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> </object>
</child> </child>
<child type="tab"> <child type="tab">
...@@ -116,6 +144,30 @@ ...@@ -116,6 +144,30 @@
<child> <child>
<placeholder/> <placeholder/>
</child> </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> </object>
<packing> <packing>
<property name="position">1</property> <property name="position">1</property>
...@@ -139,6 +191,30 @@ ...@@ -139,6 +191,30 @@
<child> <child>
<placeholder/> <placeholder/>
</child> </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> </object>
<packing> <packing>
<property name="position">2</property> <property name="position">2</property>
...@@ -165,10 +241,10 @@ ...@@ -165,10 +241,10 @@
</object> </object>
</child> </child>
<action-widgets> <action-widgets>
<action-widget response="0">reset</action-widget>
<action-widget response="-5">ok</action-widget> <action-widget response="-5">ok</action-widget>
<action-widget response="-6">cancel</action-widget> <action-widget response="-6">cancel</action-widget>
<action-widget response="-11">help</action-widget> <action-widget response="-11">help</action-widget>
<action-widget response="0">reset</action-widget>
</action-widgets> </action-widgets>
</object> </object>
</interface> </interface>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 --> <!-- Generated with glade 3.22.1 -->
<interface domain="svx"> <interface domain="svx">
<requires lib="gtk+" version="3.18"/> <requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="TextControlParagraphPropertiesDialog"> <object class="GtkDialog" id="TextControlParagraphPropertiesDialog">
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
<property name="title" translatable="yes" context="textcontrolparadialog|TextControlParagraphPropertiesDialog">Paragraph</property> <property name="title" translatable="yes" context="textcontrolparadialog|TextControlParagraphPropertiesDialog">Paragraph</property>
<property name="resizable">False</property> <property name="resizable">False</property>
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
<child>
<placeholder/>
</child>
<child internal-child="vbox"> <child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1"> <object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property> <property name="can_focus">False</property>
...@@ -18,12 +21,10 @@ ...@@ -18,12 +21,10 @@
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="layout_style">end</property> <property name="layout_style">end</property>
<child> <child>
<object class="GtkButton" id="ok"> <object class="GtkButton" id="reset">
<property name="label">gtk-ok</property> <property name="label">gtk-revert-to-saved</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">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="receives_default">True</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
</object> </object>
...@@ -34,10 +35,12 @@ ...@@ -34,10 +35,12 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton" id="cancel"> <object class="GtkButton" id="ok">
<property name="label">gtk-cancel</property> <property name="label">gtk-ok</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">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="receives_default">True</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
</object> </object>
...@@ -48,8 +51,8 @@ ...@@ -48,8 +51,8 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton" id="help"> <object class="GtkButton" id="cancel">
<property name="label">gtk-help</property> <property name="label">gtk-cancel</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>
...@@ -59,12 +62,11 @@ ...@@ -59,12 +62,11 @@
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">2</property> <property name="position">2</property>
<property name="secondary">True</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton" id="reset"> <object class="GtkButton" id="help">
<property name="label">gtk-revert-to-saved</property> <property name="label">gtk-help</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>
...@@ -74,6 +76,7 @@ ...@@ -74,6 +76,7 @@
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">3</property> <property name="position">3</property>
<property name="secondary">True</property>
</packing> </packing>
</child> </child>
</object> </object>
...@@ -87,9 +90,10 @@ ...@@ -87,9 +90,10 @@
<child> <child>
<object class="GtkNotebook" id="tabcontrol"> <object class="GtkNotebook" id="tabcontrol">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="vexpand">True</property> <property name="vexpand">True</property>
<property name="scrollable">True</property>
<child> <child>
<object class="GtkGrid"> <object class="GtkGrid">
<property name="visible">True</property> <property name="visible">True</property>
...@@ -97,6 +101,30 @@ ...@@ -97,6 +101,30 @@
<child> <child>
<placeholder/> <placeholder/>
</child> </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> </object>
</child> </child>
<child type="tab"> <child type="tab">
...@@ -116,6 +144,30 @@ ...@@ -116,6 +144,30 @@
<child> <child>
<placeholder/> <placeholder/>
</child> </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> </object>
<packing> <packing>
<property name="position">1</property> <property name="position">1</property>
...@@ -140,6 +192,30 @@ ...@@ -140,6 +192,30 @@
<child> <child>
<placeholder/> <placeholder/>
</child> </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> </object>
<packing> <packing>
<property name="position">2</property> <property name="position">2</property>
...@@ -163,6 +239,30 @@ ...@@ -163,6 +239,30 @@
<child> <child>
<placeholder/> <placeholder/>
</child> </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> </object>
<packing> <packing>
<property name="position">3</property> <property name="position">3</property>
...@@ -189,10 +289,10 @@ ...@@ -189,10 +289,10 @@
</object> </object>
</child> </child>
<action-widgets> <action-widgets>
<action-widget response="0">reset</action-widget>
<action-widget response="-5">ok</action-widget> <action-widget response="-5">ok</action-widget>
<action-widget response="-6">cancel</action-widget> <action-widget response="-6">cancel</action-widget>
<action-widget response="-11">help</action-widget> <action-widget response="-11">help</action-widget>
<action-widget response="0">reset</action-widget>
</action-widgets> </action-widgets>
</object> </object>
</interface> </interface>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment