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

weld SvxSearchFormatDialog

Change-Id: Iefe6c616dc5f6bd525ed9708785846626f43c9b6
Reviewed-on: https://gerrit.libreoffice.org/60579
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 88582ebe
......@@ -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)));
......
......@@ -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,
......
......@@ -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,
......
......@@ -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 -------------------------------------------
......
......@@ -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;
......
......@@ -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 )
......
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