[Libreoffice-commits] core.git: cui/source cui/uiconfig include/svx svx/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Sep 17 16:15:22 UTC 2018
cui/source/dialogs/srchxtra.cxx | 35 +---
cui/source/factory/dlgfact.cxx | 6
cui/source/factory/dlgfact.hxx | 3
cui/source/inc/srchxtra.hxx | 11 -
cui/uiconfig/ui/searchformatdialog.ui | 246 ++++++++++++++++++++++++++++++++--
include/svx/svxdlg.hxx | 3
svx/source/dialog/srchdlg.cxx | 2
7 files changed, 254 insertions(+), 52 deletions(-)
New commits:
commit c090d2fc981d237a5591a51a94674a35835b706d
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Sep 17 12:30:14 2018 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Sep 17 18:14:58 2018 +0200
weld SvxSearchFormatDialog
Change-Id: Iefe6c616dc5f6bd525ed9708785846626f43c9b6
Reviewed-on: https://gerrit.libreoffice.org/60579
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/cui/source/dialogs/srchxtra.cxx b/cui/source/dialogs/srchxtra.cxx
index edfb1d0df063..4efffd9aecea 100644
--- a/cui/source/dialogs/srchxtra.cxx
+++ b/cui/source/dialogs/srchxtra.cxx
@@ -33,22 +33,18 @@
#include <rtl/strbuf.hxx>
#include <svtools/treelistentry.hxx>
-SvxSearchFormatDialog::SvxSearchFormatDialog(vcl::Window* pParent, const SfxItemSet& rSet)
- : SfxTabDialog(pParent, "SearchFormatDialog", "cui/ui/searchformatdialog.ui", &rSet)
- , m_nNamePageId(0)
- , m_nParaStdPageId(0)
- , m_nParaAlignPageId(0)
- , m_nBackPageId(0)
+SvxSearchFormatDialog::SvxSearchFormatDialog(weld::Window* pParent, const SfxItemSet& rSet)
+ : SfxTabDialogController(pParent, "cui/ui/searchformatdialog.ui", "SearchFormatDialog", &rSet)
{
- m_nNamePageId = AddTabPage("font", SvxCharNamePage::Create, nullptr);
+ AddTabPage("font", SvxCharNamePage::Create, nullptr);
AddTabPage("fonteffects", SvxCharEffectsPage::Create, nullptr);
AddTabPage("position", SvxCharPositionPage::Create, nullptr);
AddTabPage("asianlayout", SvxCharTwoLinesPage::Create, nullptr);
- m_nParaStdPageId = AddTabPage("labelTP_PARA_STD", SvxStdParagraphTabPage::Create, nullptr);
- m_nParaAlignPageId = AddTabPage("labelTP_PARA_ALIGN", SvxParaAlignTabPage::Create, nullptr);
+ AddTabPage("labelTP_PARA_STD", SvxStdParagraphTabPage::Create, nullptr);
+ AddTabPage("labelTP_PARA_ALIGN", SvxParaAlignTabPage::Create, nullptr);
AddTabPage("labelTP_PARA_EXT", SvxExtParagraphTabPage::Create, nullptr);
AddTabPage("labelTP_PARA_ASIAN", SvxAsianTabPage::Create, nullptr );
- m_nBackPageId = AddTabPage("background", SvxBackgroundTabPage::Create, nullptr);
+ AddTabPage("background", SvxBackgroundTabPage::Create, nullptr);
// remove asian tabpages if necessary
SvtCJKOptions aCJKOptions;
@@ -60,18 +56,11 @@ SvxSearchFormatDialog::SvxSearchFormatDialog(vcl::Window* pParent, const SfxItem
SvxSearchFormatDialog::~SvxSearchFormatDialog()
{
- disposeOnce();
-}
-
-void SvxSearchFormatDialog::dispose()
-{
- m_pFontList.reset();
- SfxTabDialog::dispose();
}
-void SvxSearchFormatDialog::PageCreated( sal_uInt16 nId, SfxTabPage& rPage )
+void SvxSearchFormatDialog::PageCreated(const OString& rId, SfxTabPage& rPage)
{
- if (nId == m_nNamePageId)
+ if (rId == "font")
{
const FontList* pApm_pFontList = nullptr;
SfxObjectShell* pSh = SfxObjectShell::Current();
@@ -89,7 +78,7 @@ void SvxSearchFormatDialog::PageCreated( sal_uInt16 nId, SfxTabPage& rPage )
if ( !pList )
{
if ( !m_pFontList )
- m_pFontList.reset( new FontList( this ) );
+ m_pFontList.reset(new FontList(Application::GetDefaultDevice()));
pList = m_pFontList.get();
}
@@ -98,15 +87,15 @@ void SvxSearchFormatDialog::PageCreated( sal_uInt16 nId, SfxTabPage& rPage )
SetFontList( SvxFontListItem( pList, SID_ATTR_CHAR_FONTLIST ) );
static_cast<SvxCharNamePage&>(rPage).EnableSearchMode();
}
- else if (nId == m_nParaStdPageId)
+ else if (rId == "labelTP_PARA_STD")
{
static_cast<SvxStdParagraphTabPage&>(rPage).EnableAutoFirstLine();
}
- else if (nId == m_nParaAlignPageId)
+ else if (rId == "labelTP_PARA_ALIGN")
{
static_cast<SvxParaAlignTabPage&>(rPage).EnableJustifyExt();
}
- else if (nId == m_nBackPageId)
+ else if (rId == "background")
{
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,static_cast<sal_uInt32>(SvxBackgroundTabFlags::SHOW_HIGHLIGHTING)));
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index e7c622ad507c..e2c8a6fda1c8 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1143,11 +1143,11 @@ VclPtr<AbstractURLDlg> AbstractDialogFactory_Impl::CreateURLDialog( vcl::Window*
return VclPtr<AbstractURLDlg_Impl>::Create( pDlg );
}
-VclPtr<SfxAbstractTabDialog> AbstractDialogFactory_Impl::CreateTabItemDialog(vcl::Window* pParent,
+VclPtr<SfxAbstractTabDialog> AbstractDialogFactory_Impl::CreateTabItemDialog(weld::Window* pParent,
const SfxItemSet& rSet)
{
- VclPtrInstance<SvxSearchFormatDialog> pDlg(pParent, rSet);
- return VclPtr<CuiAbstractTabDialog_Impl>::Create(pDlg);
+ return VclPtr<CuiAbstractTabController_Impl>::Create(o3tl::make_unique<SvxSearchFormatDialog>(
+ pParent, rSet));
}
VclPtr<VclAbstractDialog> AbstractDialogFactory_Impl::CreateSvxSearchAttributeDialog( vcl::Window* pParent,
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index c3340103e61c..503ffb68b99c 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -652,8 +652,7 @@ public:
virtual VclPtr<SfxAbstractTabDialog> CreateTextTabDialog( weld::Window* pParent,
const SfxItemSet* pAttrSet,
SdrView* pView ) override;
- virtual VclPtr<SfxAbstractTabDialog> CreateTabItemDialog(vcl::Window* pParent,
- const SfxItemSet& rSet) override;
+ virtual VclPtr<SfxAbstractTabDialog> CreateTabItemDialog(weld::Window* pParent, const SfxItemSet& rSet) override;
virtual VclPtr<AbstractSvxCaptionDialog>
CreateCaptionDialog(weld::Window* pParent,
const SdrView* pView,
diff --git a/cui/source/inc/srchxtra.hxx b/cui/source/inc/srchxtra.hxx
index 23ca743016ba..e6ca82ba9697 100644
--- a/cui/source/inc/srchxtra.hxx
+++ b/cui/source/inc/srchxtra.hxx
@@ -27,22 +27,17 @@
#include <svx/checklbx.hxx>
#include <svx/srchdlg.hxx>
-class SvxSearchFormatDialog : public SfxTabDialog
+class SvxSearchFormatDialog : public SfxTabDialogController
{
public:
- SvxSearchFormatDialog( vcl::Window* pParent, const SfxItemSet& rSet );
+ SvxSearchFormatDialog(weld::Window* pParent, const SfxItemSet& rSet);
virtual ~SvxSearchFormatDialog() override;
- virtual void dispose() override;
protected:
- virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) override;
+ virtual void PageCreated(const OString& rId, SfxTabPage &rPage) override;
private:
std::unique_ptr<FontList> m_pFontList;
- sal_uInt16 m_nNamePageId;
- sal_uInt16 m_nParaStdPageId;
- sal_uInt16 m_nParaAlignPageId;
- sal_uInt16 m_nBackPageId;
};
// class SvxSearchFormatDialog -------------------------------------------
diff --git a/cui/uiconfig/ui/searchformatdialog.ui b/cui/uiconfig/ui/searchformatdialog.ui
index 47b683267e03..26b77019bec2 100644
--- a/cui/uiconfig/ui/searchformatdialog.ui
+++ b/cui/uiconfig/ui/searchformatdialog.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="cui">
<requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="SearchFormatDialog">
@@ -8,6 +8,9 @@
<property name="title" translatable="yes" context="searchformatdialog|SearchFormatDialog">Text Format </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>
@@ -162,6 +238,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>
@@ -185,6 +285,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">4</property>
@@ -208,6 +332,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">5</property>
@@ -232,6 +380,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">6</property>
@@ -256,6 +428,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">7</property>
@@ -279,6 +475,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">8</property>
@@ -305,10 +525,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/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index 61d7cfb20083..3f9e3a9f24f5 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -367,8 +367,7 @@ public:
const OUString& rTarget, const OUString& rName,
TargetList& rTargetList ) = 0;
- virtual VclPtr<SfxAbstractTabDialog> CreateTabItemDialog(vcl::Window* pParent,
- const SfxItemSet& rSet) = 0;
+ virtual VclPtr<SfxAbstractTabDialog> CreateTabItemDialog(weld::Window* pParent, const SfxItemSet& rSet) = 0;
virtual VclPtr<VclAbstractDialog> CreateSvxSearchAttributeDialog( vcl::Window* pParent,
SearchAttrItemList& rLst,
const sal_uInt16* pWhRanges)=0;
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 109fd7c78d83..eabfacde7d79 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -2019,7 +2019,7 @@ IMPL_LINK_NOARG(SvxSearchDialog, FormatHdl_Impl, Button*, void)
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTabItemDialog(this, aSet));
+ ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTabItemDialog(GetFrameWeld(), aSet));
pDlg->SetText( aTxt );
if ( pDlg->Execute() == RET_OK )
More information about the Libreoffice-commits
mailing list