summaryrefslogtreecommitdiff
path: root/cui/source/dialogs/srchxtra.cxx
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/dialogs/srchxtra.cxx
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/dialogs/srchxtra.cxx')
-rw-r--r--cui/source/dialogs/srchxtra.cxx35
1 files changed, 12 insertions, 23 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)));