diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx index 0a0c9f718dce52062653dcf02d696c6f24f914a4..f489112798c4f3445f00c7599ea50cc1ac1bb4ec 100644 --- a/cui/source/dialogs/cuigrfflt.cxx +++ b/cui/source/dialogs/cuigrfflt.cxx @@ -370,42 +370,24 @@ Graphic GraphicFilterMosaic::GetFilteredGraphic( const Graphic& rGraphic, return aRet; } - -GraphicFilterSmooth::GraphicFilterSmooth( vcl::Window* pParent, const Graphic& rGraphic, double nRadius) - : GraphicFilterDialog(pParent, "SmoothDialog", - "cui/ui/smoothdialog.ui", rGraphic) +GraphicFilterSmooth::GraphicFilterSmooth(weld::Window* pParent, const Graphic& rGraphic, double nRadius) + : GraphicFilterDialogController(pParent, "cui/ui/smoothdialog.ui", "SmoothDialog", rGraphic) + , mxMtrRadius(m_xBuilder->weld_spin_button("radius")) { - get(mpMtrRadius, "radius"); - - mpMtrRadius->SetValue( nRadius* 10 ); - mpMtrRadius->SetModifyHdl( LINK(this, GraphicFilterSmooth, EditModifyHdl) ); - mpMtrRadius->GrabFocus(); + mxMtrRadius->set_value(nRadius * 10); + mxMtrRadius->connect_value_changed(LINK(this, GraphicFilterSmooth, EditModifyHdl)); + mxMtrRadius->grab_focus(); } - -IMPL_LINK_NOARG(GraphicFilterSmooth, EditModifyHdl, Edit&, void) +IMPL_LINK_NOARG(GraphicFilterSmooth, EditModifyHdl, weld::SpinButton&, void) { GetModifyHdl().Call(nullptr); } - -GraphicFilterSmooth::~GraphicFilterSmooth() -{ - disposeOnce(); -} - - -void GraphicFilterSmooth::dispose() -{ - mpMtrRadius.clear(); - GraphicFilterDialog::dispose(); -} - - Graphic GraphicFilterSmooth::GetFilteredGraphic( const Graphic& rGraphic, double, double ) { Graphic aRet; - double nRadius = mpMtrRadius->GetValue() / 10.0; + double nRadius = mxMtrRadius->get_value() / 10.0; if( rGraphic.IsAnimated() ) { diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index d8240ce678e9058dd0a9b5a479f24e1c3d2f7b09..c6cc366e97a1163bb5a2b7f5b7de05cd710923ab 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -1297,11 +1297,10 @@ VclPtr AbstractDialogFactory_Impl::CreateGraphicFil return VclPtr::Create(o3tl::make_unique(pParent, rGraphic, 10)); } -VclPtr AbstractDialogFactory_Impl::CreateGraphicFilterSmooth(vcl::Window* pParent, +VclPtr AbstractDialogFactory_Impl::CreateGraphicFilterSmooth(weld::Window* pParent, const Graphic& rGraphic, double nRadius) { - VclPtrInstance pDlg( pParent, rGraphic, nRadius ); - return VclPtr::Create( pDlg ); + return VclPtr::Create(o3tl::make_unique(pParent, rGraphic, nRadius)); } VclPtr AbstractDialogFactory_Impl::CreateGraphicFilterSolarize(weld::Window* pParent, diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index 753b12bd150de2fa1d3539fc1d2ad73ae83648c1..59b9dd574de8a7a4ed090479b5645574c756b883 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -759,7 +759,7 @@ public: const Graphic& rGraphic) override; virtual VclPtr CreateGraphicFilterSepia(weld::Window* pParent, const Graphic& rGraphic) override; - virtual VclPtr CreateGraphicFilterSmooth (vcl::Window* pParent, + virtual VclPtr CreateGraphicFilterSmooth(weld::Window* pParent, const Graphic& rGraphic, double nRadius) override; virtual VclPtr CreateGraphicFilterSolarize(weld::Window* pParent, const Graphic& rGraphic) override; diff --git a/cui/source/inc/cuigrfflt.hxx b/cui/source/inc/cuigrfflt.hxx index c202a189a95c7cc3c01cfdf1caf2b24c18dfd363..48ee3f3b25de7513db345b6e2b8dedfa24a61b7e 100644 --- a/cui/source/inc/cuigrfflt.hxx +++ b/cui/source/inc/cuigrfflt.hxx @@ -151,18 +151,15 @@ public: virtual Graphic GetFilteredGraphic(const Graphic& rGraphic, double fScaleX, double fScaleY) = 0; }; -class GraphicFilterSmooth : public GraphicFilterDialog +class GraphicFilterSmooth : public GraphicFilterDialogController { private: - VclPtr mpMtrRadius; - DECL_LINK(EditModifyHdl, Edit&, void); + std::unique_ptr mxMtrRadius; + DECL_LINK(EditModifyHdl, weld::SpinButton&, void); public: - GraphicFilterSmooth( vcl::Window* pParent, const Graphic& rGraphic, double nRadius); - virtual ~GraphicFilterSmooth() override; - virtual void dispose() override; - + GraphicFilterSmooth(weld::Window* pParent, const Graphic& rGraphic, double nRadius); virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) override; }; diff --git a/cui/uiconfig/ui/smoothdialog.ui b/cui/uiconfig/ui/smoothdialog.ui index 50eef4351c085556120eda72d8cab320956d0f35..c96e76821ddf584f53a099d7b1b0faffd518028d 100644 --- a/cui/uiconfig/ui/smoothdialog.ui +++ b/cui/uiconfig/ui/smoothdialog.ui @@ -1,8 +1,7 @@ - + - 0.10000000000000001 100 @@ -15,7 +14,13 @@ 6 Smooth False + True + 0 + 0 dialog + + + False @@ -102,11 +107,28 @@ True 24 - + True False True True + never + never + in + + + True + False + + + True + False + True + True + + + + 1 @@ -134,10 +156,10 @@ True False - 0 _Smooth radius: True radius + 0 0 diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx index d1f5c330326348156c2ed9833ca16e0314a5b251..fd36c0297688733359c1373c3e6353370da82255 100644 --- a/include/svx/svxdlg.hxx +++ b/include/svx/svxdlg.hxx @@ -418,7 +418,7 @@ public: const Graphic& rGraphic)=0; virtual VclPtr CreateGraphicFilterSepia(weld::Window* pParent, const Graphic& rGraphic)=0; - virtual VclPtr CreateGraphicFilterSmooth (vcl::Window* pParent, + virtual VclPtr CreateGraphicFilterSmooth(weld::Window* pParent, const Graphic& rGraphic, double nRadius)=0; virtual VclPtr CreateGraphicFilterSolarize(weld::Window* pParent, diff --git a/svx/source/dialog/grfflt.cxx b/svx/source/dialog/grfflt.cxx index 3983bc8be4e51aec0b10c2d6002a389dd7f90b2a..3e8bf8e093ef528f8026669b5a156e6bbd3d9ebe 100644 --- a/svx/source/dialog/grfflt.cxx +++ b/svx/source/dialog/grfflt.cxx @@ -42,7 +42,7 @@ SvxGraphicFilterResult SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest const { SfxViewFrame* pViewFrame = SfxViewFrame::Current(); SfxObjectShell* pShell = pViewFrame ? pViewFrame->GetObjectShell() : nullptr; - vcl::Window* pWindow = ( pViewFrame && pViewFrame->GetViewShell() ) ? pViewFrame->GetViewShell()->GetWindow() : nullptr; + weld::Window* pFrameWeld = (pViewFrame && pViewFrame->GetViewShell()) ? pViewFrame->GetViewShell()->GetFrameWeld() : nullptr; Graphic aGraphic; switch( rReq.GetSlot() ) @@ -75,7 +75,7 @@ SvxGraphicFilterResult SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest const case SID_GRFFILTER_SMOOTH: { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr aDlg(pFact->CreateGraphicFilterSmooth(pWindow, rGraphic, 0.7)); + ScopedVclPtr aDlg(pFact->CreateGraphicFilterSmooth(pFrameWeld, rGraphic, 0.7)); if( aDlg->Execute() == RET_OK ) aGraphic = aDlg->GetFilteredGraphic( rGraphic, 1.0, 1.0 ); } @@ -159,7 +159,7 @@ SvxGraphicFilterResult SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest const case SID_GRFFILTER_MOSAIC: { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr aDlg(pFact->CreateGraphicFilterMosaic(pWindow ? pWindow->GetFrameWeld() : nullptr, rGraphic)); + ScopedVclPtr aDlg(pFact->CreateGraphicFilterMosaic(pFrameWeld, rGraphic)); if( aDlg->Execute() == RET_OK ) aGraphic = aDlg->GetFilteredGraphic( rGraphic, 1.0, 1.0 ); } @@ -168,7 +168,7 @@ SvxGraphicFilterResult SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest const case SID_GRFFILTER_EMBOSS: { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr aDlg(pFact->CreateGraphicFilterEmboss(pWindow ? pWindow->GetFrameWeld() : nullptr, rGraphic)); + ScopedVclPtr aDlg(pFact->CreateGraphicFilterEmboss(pFrameWeld, rGraphic)); if( aDlg->Execute() == RET_OK ) aGraphic = aDlg->GetFilteredGraphic( rGraphic, 1.0, 1.0 ); } @@ -177,7 +177,7 @@ SvxGraphicFilterResult SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest const case SID_GRFFILTER_POSTER: { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr aDlg(pFact->CreateGraphicFilterPoster(pWindow ? pWindow->GetFrameWeld() : nullptr, rGraphic)); + ScopedVclPtr aDlg(pFact->CreateGraphicFilterPoster(pFrameWeld, rGraphic)); if( aDlg->Execute() == RET_OK ) aGraphic = aDlg->GetFilteredGraphic( rGraphic, 1.0, 1.0 ); } @@ -211,7 +211,7 @@ SvxGraphicFilterResult SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest const case SID_GRFFILTER_SEPIA: { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr aDlg(pFact->CreateGraphicFilterSepia(pWindow ? pWindow->GetFrameWeld() : nullptr, rGraphic)); + ScopedVclPtr aDlg(pFact->CreateGraphicFilterSepia(pFrameWeld, rGraphic)); if( aDlg->Execute() == RET_OK ) aGraphic = aDlg->GetFilteredGraphic( rGraphic, 1.0, 1.0 ); } @@ -220,7 +220,7 @@ SvxGraphicFilterResult SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest const case SID_GRFFILTER_SOLARIZE: { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr aDlg(pFact->CreateGraphicFilterSolarize(pWindow ? pWindow->GetFrameWeld() : nullptr, rGraphic)); + ScopedVclPtr aDlg(pFact->CreateGraphicFilterSolarize(pFrameWeld, rGraphic)); if( aDlg->Execute() == RET_OK ) aGraphic = aDlg->GetFilteredGraphic( rGraphic, 1.0, 1.0 ); }