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 @@
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: */
......@@ -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();
......
......@@ -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: */
<?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>
<?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>
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