diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-09-20 11:31:05 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-09-20 16:47:25 +0200 |
commit | 11a229c0094979b4980d8e3be8a8a7db60d01be7 (patch) | |
tree | 2d8f84835f1d6f027070861a5503d2f157a9963d | |
parent | 6520afe69286e46fa50aceb30cffbf6f9a4a1709 (diff) |
weld SwBackgroundDlg
Change-Id: Ia470058b1bb42d0a9bd6a40e8af4c5aac33df3a8
Reviewed-on: https://gerrit.libreoffice.org/60811
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | cui/source/tabpages/backgrnd.cxx | 4 | ||||
-rw-r--r-- | sw/inc/swabstdlg.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/frmdlg/pattern.cxx | 10 | ||||
-rw-r--r-- | sw/source/uibase/inc/pattern.hxx | 7 | ||||
-rw-r--r-- | sw/source/uibase/shells/basesh.cxx | 16 |
7 files changed, 22 insertions, 24 deletions
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index c3c9a61850fd..4052f988d2f1 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -176,7 +176,9 @@ BackgroundPreviewImpl::BackgroundPreviewImpl() void BackgroundPreviewImpl::SetDrawingArea(weld::DrawingArea* pDrawingArea) { CustomWidgetController::SetDrawingArea(pDrawingArea); - aDrawRect = tools::Rectangle(Point(0,0), GetOutputSizePixel()); + Size aSize(pDrawingArea->get_ref_device().LogicToPixel(Size(300, 77))); + pDrawingArea->set_size_request(aSize.Width(), aSize.Height()); + aDrawRect = tools::Rectangle(Point(0,0), aSize); Invalidate(aDrawRect); } diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index c6e587b391fc..63e966bbd723 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -362,7 +362,7 @@ public: virtual VclPtr<SfxAbstractDialog> CreateNumFormatDialog( vcl::Window* pParent, const SfxItemSet& rAttr) = 0; virtual VclPtr<SfxAbstractDialog> CreateSwDropCapsDialog(weld::Window* pParent, const SfxItemSet& rSet) = 0; - virtual VclPtr<SfxAbstractDialog> CreateSwBackgroundDialog(vcl::Window* pParent, const SfxItemSet& rSet) = 0; + virtual VclPtr<SfxAbstractDialog> CreateSwBackgroundDialog(weld::Window* pParent, const SfxItemSet& rSet) = 0; virtual VclPtr<AbstractSwWordCountFloatDlg> CreateSwWordCountDialog(SfxBindings* pBindings, SfxChildWindow* pChild, vcl::Window *pParent, SfxChildWinInfo* pInfo) = 0; diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index 7374679ae9fa..973e46ab8fd7 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -764,11 +764,10 @@ VclPtr<SfxAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwDropCapsDialog(w return VclPtr<SwAbstractSfxController_Impl>::Create(o3tl::make_unique<SwDropCapsDlg>(pParent, rSet)); } -VclPtr<SfxAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwBackgroundDialog( vcl::Window* pParent, +VclPtr<SfxAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwBackgroundDialog(weld::Window* pParent, const SfxItemSet& rSet) { - VclPtr<SfxModalDialog> pDlg = VclPtr<SwBackgroundDlg>::Create( pParent, rSet ); - return VclPtr<SwAbstractSfxDialog_Impl>::Create( pDlg ); + return VclPtr<SwAbstractSfxController_Impl>::Create(o3tl::make_unique<SwBackgroundDlg>(pParent, rSet)); } VclPtr<SfxAbstractDialog> SwAbstractDialogFactory_Impl::CreateNumFormatDialog( vcl::Window* pParent, diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index 8a8044f96645..ba2412c50a70 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -575,7 +575,7 @@ public: virtual VclPtr<SfxAbstractDialog> CreateNumFormatDialog(vcl::Window* pParent, const SfxItemSet& rAttr) override; virtual VclPtr<SfxAbstractDialog> CreateSwDropCapsDialog(weld::Window* pParent, const SfxItemSet& rSet) override; - virtual VclPtr<SfxAbstractDialog> CreateSwBackgroundDialog(vcl::Window* pParent, const SfxItemSet& rSet) override; + virtual VclPtr<SfxAbstractDialog> CreateSwBackgroundDialog(weld::Window* pParent, const SfxItemSet& rSet) override; virtual VclPtr<AbstractSwWordCountFloatDlg> CreateSwWordCountDialog(SfxBindings* pBindings, SfxChildWindow* pChild, vcl::Window *pParent, SfxChildWinInfo* pInfo) override; virtual VclPtr<AbstractSwInsertAbstractDlg> CreateSwInsertAbstractDlg() override; diff --git a/sw/source/ui/frmdlg/pattern.cxx b/sw/source/ui/frmdlg/pattern.cxx index 332601519f7e..390166828dd4 100644 --- a/sw/source/ui/frmdlg/pattern.cxx +++ b/sw/source/ui/frmdlg/pattern.cxx @@ -23,18 +23,18 @@ #include <pattern.hxx> #include <strings.hrc> -SwBackgroundDlg::SwBackgroundDlg(vcl::Window* pParent, const SfxItemSet& rSet) - : SfxSingleTabDialog(pParent, rSet) +SwBackgroundDlg::SwBackgroundDlg(weld::Window* pParent, const SfxItemSet& rSet) + : SfxSingleTabDialogController(pParent, rSet) { - SetText(SwResId(STR_FRMUI_PATTERN)); + m_xDialog->set_title(SwResId(STR_FRMUI_PATTERN)); SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ); if ( fnCreatePage ) { - SetTabPage((*fnCreatePage)(get_content_area(), &rSet)); + TabPageParent pPageParent(get_content_area(), this); + SetTabPage((*fnCreatePage)(pPageParent, &rSet)); } - } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/inc/pattern.hxx b/sw/source/uibase/inc/pattern.hxx index 68a673dff751..4be18c6342a8 100644 --- a/sw/source/uibase/inc/pattern.hxx +++ b/sw/source/uibase/inc/pattern.hxx @@ -22,13 +22,10 @@ #include <sfx2/basedlgs.hxx> -namespace vcl { class Window; } -class SfxItemSet; - -class SwBackgroundDlg : public SfxSingleTabDialog +class SwBackgroundDlg : public SfxSingleTabDialogController { public: - SwBackgroundDlg(vcl::Window* pParent, const SfxItemSet& rSet); + SwBackgroundDlg(weld::Window* pParent, const SfxItemSet& rSet); }; #endif diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index 91cb88b3d175..0a6baea02225 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -2400,7 +2400,7 @@ void SwBaseShell::GetBorderState(SfxItemSet &rSet) void SwBaseShell::ExecDlg(SfxRequest &rReq) { SwWrtShell &rSh = GetShell(); - vcl::Window& rMDI = GetView().GetViewFrame()->GetWindow(); + weld::Window* pMDI = GetView().GetViewFrame()->GetWindow().GetFrameWeld(); // So that from the basic no dialogues for the background views are called: bool bBackground = (&GetView() != GetActiveView()); const SfxPoolItem* pItem = nullptr; @@ -2417,7 +2417,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) case FN_FORMAT_TITLEPAGE_DLG: { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateTitlePageDlg(rMDI.GetFrameWeld())); + ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateTitlePageDlg(pMDI)); pDlg->Execute(); } break; @@ -2467,7 +2467,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) ::PrepareBoxInfo( aSet, rSh ); rSh.GetTabBorders( aSet ); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - pDlg.disposeAndReset(pFact->CreateSwBorderDlg(rMDI.GetFrameWeld(), aSet, SwBorderModes::TABLE)); + pDlg.disposeAndReset(pFact->CreateSwBorderDlg(pMDI, aSet, SwBorderModes::TABLE)); if ( pDlg->Execute() == RET_OK ) { rSh.SetTabBorders( *pDlg->GetOutputItemSet() ); @@ -2481,7 +2481,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) aSet.Put( aMgr.GetAttrSet() ); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - pDlg.disposeAndReset(pFact->CreateSwBorderDlg(rMDI.GetFrameWeld(), aSet, SwBorderModes::FRAME)); + pDlg.disposeAndReset(pFact->CreateSwBorderDlg(pMDI, aSet, SwBorderModes::FRAME)); if ( pDlg->Execute() == RET_OK ) { aMgr.SetAttrSet( *pDlg->GetOutputItemSet() ); @@ -2496,7 +2496,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) ::PrepareBoxInfo( aSet, rSh ); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - pDlg.disposeAndReset(pFact->CreateSwBorderDlg(rMDI.GetFrameWeld(), aSet, SwBorderModes::PARA)); + pDlg.disposeAndReset(pFact->CreateSwBorderDlg(pMDI, aSet, SwBorderModes::PARA)); if ( pDlg->Execute() == RET_OK ) { rSh.SetAttrSet( *pDlg->GetOutputItemSet() ); @@ -2524,7 +2524,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) // Get background attributes of the table and put it in the set SvxBrushItem aBrush(RES_BACKGROUND); rSh.GetBoxBackground( aBrush ); - pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(&rMDI, aSet)); + pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(pMDI, aSet)); aSet.Put( aBrush ); if ( pDlg->Execute() == RET_OK ) { @@ -2538,7 +2538,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) rSh.GetFlyFrameAttr( aSet ); - pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(&rMDI, aSet)); + pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(pMDI, aSet)); if ( pDlg->Execute() == RET_OK ) { rSh.SetFlyFrameAttr(const_cast<SfxItemSet &>(*pDlg->GetOutputItemSet()) ); @@ -2550,7 +2550,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) // Set border attributes Umrandungsattribute with the shell quite normal. rSh.GetCurAttr( aSet ); - pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(&rMDI, aSet)); + pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(pMDI, aSet)); if ( pDlg->Execute() == RET_OK ) { rSh.SetAttrSet( *pDlg->GetOutputItemSet() ); |