Skip to content

Commit

Permalink
weld SwAddrDlg
Browse files Browse the repository at this point in the history
Change-Id: I6d8b5ffa4b9db27335e771153119264216c0b8f7
Reviewed-on: https://gerrit.libreoffice.org/69084
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
  • Loading branch information
Caolán McNamara committed Mar 12, 2019
1 parent 47cf977 commit 84f48dc
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion sw/inc/swabstdlg.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public:
SfxChildWindow* pChild, weld::Window *pParent, SfxChildWinInfo* pInfo) = 0;

virtual VclPtr<AbstractSwInsertAbstractDlg> CreateSwInsertAbstractDlg(weld::Window* pParent) = 0;
virtual VclPtr<SfxAbstractDialog> CreateSwAddressAbstractDlg(vcl::Window* pParent, const SfxItemSet& rSet) = 0;
virtual VclPtr<SfxAbstractDialog> CreateSwAddressAbstractDlg(weld::Window* pParent, const SfxItemSet& rSet) = 0;
virtual VclPtr<AbstractSwAsciiFilterDlg> CreateSwAsciiFilterDlg(weld::Window* pParent, SwDocShell& rDocSh,
SvStream* pStream) = 0;
virtual VclPtr<VclAbstractDialog> CreateSwInsertBookmarkDlg( vcl::Window *pParent, SwWrtShell &rSh, SfxRequest& rReq ) = 0;
Expand Down
12 changes: 6 additions & 6 deletions sw/source/ui/dialog/addrdlg.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@
*/

#include <addrdlg.hxx>
#include <svx/svxdlg.hxx>
#include <sfx2/pageids.hxx>
#include <vcl/layout.hxx>
#include <svx/svxdlg.hxx>

SwAddrDlg::SwAddrDlg(vcl::Window* pParent, const SfxItemSet& rSet)
: SfxSingleTabDialog(pParent, rSet)
SwAddrDlg::SwAddrDlg(weld::Window* pParent, const SfxItemSet& rSet)
: SfxSingleTabDialogController(pParent, rSet)
{
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SFXPAGE_GENERAL );
if ( fnCreatePage )
{
VclPtr<SfxTabPage> pPage2 = (*fnCreatePage)(TabPageParent(get_content_area()), &rSet);
SetTabPage(pPage2);
// create TabPage
TabPageParent aParent(get_content_area(), this);
SetTabPage(fnCreatePage(aParent, &rSet));
}
}

Expand Down
5 changes: 2 additions & 3 deletions sw/source/ui/dialog/swdlgfact.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -749,11 +749,10 @@ VclPtr<AbstractSwInsertAbstractDlg> SwAbstractDialogFactory_Impl::CreateSwInsert
return VclPtr<AbstractSwInsertAbstractDlg_Impl>::Create(std::make_unique<SwInsertAbstractDlg>(pParent));
}

VclPtr<SfxAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwAddressAbstractDlg(vcl::Window* pParent,
VclPtr<SfxAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwAddressAbstractDlg(weld::Window* pParent,
const SfxItemSet& rSet)
{
VclPtr<SfxModalDialog> pDlg = VclPtr<SwAddrDlg>::Create( pParent, rSet );
return VclPtr<SwAbstractSfxDialog_Impl>::Create(pDlg);
return VclPtr<SwAbstractSfxController_Impl>::Create(std::make_unique<SwAddrDlg>(pParent, rSet));
}

VclPtr<SfxAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwDropCapsDialog(weld::Window* pParent,
Expand Down
2 changes: 1 addition & 1 deletion sw/source/ui/dialog/swdlgfact.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ public:
virtual VclPtr<AbstractSwWordCountFloatDlg> CreateSwWordCountDialog(SfxBindings* pBindings,
SfxChildWindow* pChild, weld::Window *pParent, SfxChildWinInfo* pInfo) override;
virtual VclPtr<AbstractSwInsertAbstractDlg> CreateSwInsertAbstractDlg(weld::Window* pParent) override;
virtual VclPtr<SfxAbstractDialog> CreateSwAddressAbstractDlg(vcl::Window* pParent, const SfxItemSet& rSet) override;
virtual VclPtr<SfxAbstractDialog> CreateSwAddressAbstractDlg(weld::Window* pParent, const SfxItemSet& rSet) override;
virtual VclPtr<AbstractSwAsciiFilterDlg> CreateSwAsciiFilterDlg(weld::Window* pParent, SwDocShell& rDocSh,
SvStream* pStream) override;
virtual VclPtr<VclAbstractDialog> CreateSwInsertBookmarkDlg( vcl::Window *pParent, SwWrtShell &rSh, SfxRequest& rReq ) override;
Expand Down
2 changes: 1 addition & 1 deletion sw/source/ui/fldui/fldedt.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ IMPL_LINK_NOARG(SwFieldEditDlg, AddressHdl, Button*, void)
aSet.Put(SfxUInt16Item(SID_FIELD_GRABFOCUS, static_cast<sal_uInt16>(nEditPos)));
SwAbstractDialogFactory& rFact = swui::GetFactory();

ScopedVclPtr<SfxAbstractDialog> pDlg(rFact.CreateSwAddressAbstractDlg(this, aSet));
ScopedVclPtr<SfxAbstractDialog> pDlg(rFact.CreateSwAddressAbstractDlg(GetFrameWeld(), aSet));
if (RET_OK == pDlg->Execute())
{
pSh->UpdateOneField(*pCurField);
Expand Down
4 changes: 2 additions & 2 deletions sw/source/uibase/inc/addrdlg.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

#include <sfx2/basedlgs.hxx>

class SwAddrDlg : public SfxSingleTabDialog
class SwAddrDlg : public SfxSingleTabDialogController
{
public:
SwAddrDlg(vcl::Window* pParent, const SfxItemSet& rSet);
SwAddrDlg(weld::Window* pParent, const SfxItemSet& rSet);
};

#endif
Expand Down

0 comments on commit 84f48dc

Please sign in to comment.