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

weld SwBackgroundDlg

Change-Id: Ia470058b1bb42d0a9bd6a40e8af4c5aac33df3a8
Reviewed-on: https://gerrit.libreoffice.org/60811
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 6520afe6
...@@ -176,7 +176,9 @@ BackgroundPreviewImpl::BackgroundPreviewImpl() ...@@ -176,7 +176,9 @@ BackgroundPreviewImpl::BackgroundPreviewImpl()
void BackgroundPreviewImpl::SetDrawingArea(weld::DrawingArea* pDrawingArea) void BackgroundPreviewImpl::SetDrawingArea(weld::DrawingArea* pDrawingArea)
{ {
CustomWidgetController::SetDrawingArea(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); Invalidate(aDrawRect);
} }
......
...@@ -362,7 +362,7 @@ public: ...@@ -362,7 +362,7 @@ public:
virtual VclPtr<SfxAbstractDialog> CreateNumFormatDialog( vcl::Window* pParent, virtual VclPtr<SfxAbstractDialog> CreateNumFormatDialog( vcl::Window* pParent,
const SfxItemSet& rAttr) = 0; const SfxItemSet& rAttr) = 0;
virtual VclPtr<SfxAbstractDialog> CreateSwDropCapsDialog(weld::Window* pParent, const SfxItemSet& rSet) = 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, virtual VclPtr<AbstractSwWordCountFloatDlg> CreateSwWordCountDialog(SfxBindings* pBindings,
SfxChildWindow* pChild, vcl::Window *pParent, SfxChildWinInfo* pInfo) = 0; SfxChildWindow* pChild, vcl::Window *pParent, SfxChildWinInfo* pInfo) = 0;
......
...@@ -764,11 +764,10 @@ VclPtr<SfxAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwDropCapsDialog(w ...@@ -764,11 +764,10 @@ VclPtr<SfxAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwDropCapsDialog(w
return VclPtr<SwAbstractSfxController_Impl>::Create(o3tl::make_unique<SwDropCapsDlg>(pParent, rSet)); 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) const SfxItemSet& rSet)
{ {
VclPtr<SfxModalDialog> pDlg = VclPtr<SwBackgroundDlg>::Create( pParent, rSet ); return VclPtr<SwAbstractSfxController_Impl>::Create(o3tl::make_unique<SwBackgroundDlg>(pParent, rSet));
return VclPtr<SwAbstractSfxDialog_Impl>::Create( pDlg );
} }
VclPtr<SfxAbstractDialog> SwAbstractDialogFactory_Impl::CreateNumFormatDialog( vcl::Window* pParent, VclPtr<SfxAbstractDialog> SwAbstractDialogFactory_Impl::CreateNumFormatDialog( vcl::Window* pParent,
......
...@@ -575,7 +575,7 @@ public: ...@@ -575,7 +575,7 @@ public:
virtual VclPtr<SfxAbstractDialog> CreateNumFormatDialog(vcl::Window* pParent, const SfxItemSet& rAttr) override; 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> 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, virtual VclPtr<AbstractSwWordCountFloatDlg> CreateSwWordCountDialog(SfxBindings* pBindings,
SfxChildWindow* pChild, vcl::Window *pParent, SfxChildWinInfo* pInfo) override; SfxChildWindow* pChild, vcl::Window *pParent, SfxChildWinInfo* pInfo) override;
virtual VclPtr<AbstractSwInsertAbstractDlg> CreateSwInsertAbstractDlg() override; virtual VclPtr<AbstractSwInsertAbstractDlg> CreateSwInsertAbstractDlg() override;
......
...@@ -23,18 +23,18 @@ ...@@ -23,18 +23,18 @@
#include <pattern.hxx> #include <pattern.hxx>
#include <strings.hrc> #include <strings.hrc>
SwBackgroundDlg::SwBackgroundDlg(vcl::Window* pParent, const SfxItemSet& rSet) SwBackgroundDlg::SwBackgroundDlg(weld::Window* pParent, const SfxItemSet& rSet)
: SfxSingleTabDialog(pParent, rSet) : SfxSingleTabDialogController(pParent, rSet)
{ {
SetText(SwResId(STR_FRMUI_PATTERN)); m_xDialog->set_title(SwResId(STR_FRMUI_PATTERN));
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ); ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND );
if ( fnCreatePage ) 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: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -22,13 +22,10 @@ ...@@ -22,13 +22,10 @@
#include <sfx2/basedlgs.hxx> #include <sfx2/basedlgs.hxx>
namespace vcl { class Window; } class SwBackgroundDlg : public SfxSingleTabDialogController
class SfxItemSet;
class SwBackgroundDlg : public SfxSingleTabDialog
{ {
public: public:
SwBackgroundDlg(vcl::Window* pParent, const SfxItemSet& rSet); SwBackgroundDlg(weld::Window* pParent, const SfxItemSet& rSet);
}; };
#endif #endif
......
...@@ -2400,7 +2400,7 @@ void SwBaseShell::GetBorderState(SfxItemSet &rSet) ...@@ -2400,7 +2400,7 @@ void SwBaseShell::GetBorderState(SfxItemSet &rSet)
void SwBaseShell::ExecDlg(SfxRequest &rReq) void SwBaseShell::ExecDlg(SfxRequest &rReq)
{ {
SwWrtShell &rSh = GetShell(); 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: // So that from the basic no dialogues for the background views are called:
bool bBackground = (&GetView() != GetActiveView()); bool bBackground = (&GetView() != GetActiveView());
const SfxPoolItem* pItem = nullptr; const SfxPoolItem* pItem = nullptr;
...@@ -2417,7 +2417,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) ...@@ -2417,7 +2417,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
case FN_FORMAT_TITLEPAGE_DLG: case FN_FORMAT_TITLEPAGE_DLG:
{ {
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateTitlePageDlg(rMDI.GetFrameWeld())); ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateTitlePageDlg(pMDI));
pDlg->Execute(); pDlg->Execute();
} }
break; break;
...@@ -2467,7 +2467,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) ...@@ -2467,7 +2467,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
::PrepareBoxInfo( aSet, rSh ); ::PrepareBoxInfo( aSet, rSh );
rSh.GetTabBorders( aSet ); rSh.GetTabBorders( aSet );
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); 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 ) if ( pDlg->Execute() == RET_OK )
{ {
rSh.SetTabBorders( *pDlg->GetOutputItemSet() ); rSh.SetTabBorders( *pDlg->GetOutputItemSet() );
...@@ -2481,7 +2481,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) ...@@ -2481,7 +2481,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
aSet.Put( aMgr.GetAttrSet() ); aSet.Put( aMgr.GetAttrSet() );
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); 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 ) if ( pDlg->Execute() == RET_OK )
{ {
aMgr.SetAttrSet( *pDlg->GetOutputItemSet() ); aMgr.SetAttrSet( *pDlg->GetOutputItemSet() );
...@@ -2496,7 +2496,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) ...@@ -2496,7 +2496,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
::PrepareBoxInfo( aSet, rSh ); ::PrepareBoxInfo( aSet, rSh );
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); 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 ) if ( pDlg->Execute() == RET_OK )
{ {
rSh.SetAttrSet( *pDlg->GetOutputItemSet() ); rSh.SetAttrSet( *pDlg->GetOutputItemSet() );
...@@ -2524,7 +2524,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) ...@@ -2524,7 +2524,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
// Get background attributes of the table and put it in the set // Get background attributes of the table and put it in the set
SvxBrushItem aBrush(RES_BACKGROUND); SvxBrushItem aBrush(RES_BACKGROUND);
rSh.GetBoxBackground( aBrush ); rSh.GetBoxBackground( aBrush );
pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(&rMDI, aSet)); pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(pMDI, aSet));
aSet.Put( aBrush ); aSet.Put( aBrush );
if ( pDlg->Execute() == RET_OK ) if ( pDlg->Execute() == RET_OK )
{ {
...@@ -2538,7 +2538,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) ...@@ -2538,7 +2538,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
rSh.GetFlyFrameAttr( aSet ); rSh.GetFlyFrameAttr( aSet );
pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(&rMDI, aSet)); pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(pMDI, aSet));
if ( pDlg->Execute() == RET_OK ) if ( pDlg->Execute() == RET_OK )
{ {
rSh.SetFlyFrameAttr(const_cast<SfxItemSet &>(*pDlg->GetOutputItemSet()) ); rSh.SetFlyFrameAttr(const_cast<SfxItemSet &>(*pDlg->GetOutputItemSet()) );
...@@ -2550,7 +2550,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) ...@@ -2550,7 +2550,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
// Set border attributes Umrandungsattribute with the shell quite normal. // Set border attributes Umrandungsattribute with the shell quite normal.
rSh.GetCurAttr( aSet ); rSh.GetCurAttr( aSet );
pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(&rMDI, aSet)); pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(pMDI, aSet));
if ( pDlg->Execute() == RET_OK ) if ( pDlg->Execute() == RET_OK )
{ {
rSh.SetAttrSet( *pDlg->GetOutputItemSet() ); rSh.SetAttrSet( *pDlg->GetOutputItemSet() );
......
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