summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-09-17 12:30:14 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-09-17 18:14:58 +0200
commitc090d2fc981d237a5591a51a94674a35835b706d (patch)
tree217d366c270f535f43b0f15af02eed0e0854e57d /cui/source
parent88582ebee383c63c3fba588924f36ff7655af9c1 (diff)
weld SvxSearchFormatDialog
Change-Id: Iefe6c616dc5f6bd525ed9708785846626f43c9b6 Reviewed-on: https://gerrit.libreoffice.org/60579 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/dialogs/srchxtra.cxx35
-rw-r--r--cui/source/factory/dlgfact.cxx6
-rw-r--r--cui/source/factory/dlgfact.hxx3
-rw-r--r--cui/source/inc/srchxtra.hxx11
4 files changed, 19 insertions, 36 deletions
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 -------------------------------------------