[Libreoffice-commits] core.git: cui/source cui/uiconfig include/svx svx/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Sep 19 14:52:27 UTC 2018
cui/source/dialogs/cuigrfflt.cxx | 34 ++++++++--------------------------
cui/source/factory/dlgfact.cxx | 5 ++---
cui/source/factory/dlgfact.hxx | 2 +-
cui/source/inc/cuigrfflt.hxx | 11 ++++-------
cui/uiconfig/ui/smoothdialog.ui | 30 ++++++++++++++++++++++++++----
include/svx/svxdlg.hxx | 2 +-
svx/source/dialog/grfflt.cxx | 14 +++++++-------
7 files changed, 49 insertions(+), 49 deletions(-)
New commits:
commit d6cee8ad86ded54004f0dc87b390e43b20560390
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Sep 18 14:31:16 2018 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Sep 19 16:51:58 2018 +0200
weld GraphicFilterSmooth
Change-Id: I9f92b49bff105965c13e5977ef39788c6684da29
Reviewed-on: https://gerrit.libreoffice.org/60711
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx
index 0a0c9f718dce..f489112798c4 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 d8240ce678e9..c6cc366e97a1 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1297,11 +1297,10 @@ VclPtr<AbstractGraphicFilterDialog> AbstractDialogFactory_Impl::CreateGraphicFil
return VclPtr<AbstractGraphicFilterDialogController_Impl>::Create(o3tl::make_unique<GraphicFilterSepia>(pParent, rGraphic, 10));
}
-VclPtr<AbstractGraphicFilterDialog> AbstractDialogFactory_Impl::CreateGraphicFilterSmooth(vcl::Window* pParent,
+VclPtr<AbstractGraphicFilterDialog> AbstractDialogFactory_Impl::CreateGraphicFilterSmooth(weld::Window* pParent,
const Graphic& rGraphic, double nRadius)
{
- VclPtrInstance<GraphicFilterSmooth> pDlg( pParent, rGraphic, nRadius );
- return VclPtr<AbstractGraphicFilterDialog_Impl>::Create( pDlg );
+ return VclPtr<AbstractGraphicFilterDialogController_Impl>::Create(o3tl::make_unique<GraphicFilterSmooth>(pParent, rGraphic, nRadius));
}
VclPtr<AbstractGraphicFilterDialog> AbstractDialogFactory_Impl::CreateGraphicFilterSolarize(weld::Window* pParent,
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 753b12bd150d..59b9dd574de8 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -759,7 +759,7 @@ public:
const Graphic& rGraphic) override;
virtual VclPtr<AbstractGraphicFilterDialog> CreateGraphicFilterSepia(weld::Window* pParent,
const Graphic& rGraphic) override;
- virtual VclPtr<AbstractGraphicFilterDialog> CreateGraphicFilterSmooth (vcl::Window* pParent,
+ virtual VclPtr<AbstractGraphicFilterDialog> CreateGraphicFilterSmooth(weld::Window* pParent,
const Graphic& rGraphic, double nRadius) override;
virtual VclPtr<AbstractGraphicFilterDialog> CreateGraphicFilterSolarize(weld::Window* pParent,
const Graphic& rGraphic) override;
diff --git a/cui/source/inc/cuigrfflt.hxx b/cui/source/inc/cuigrfflt.hxx
index c202a189a95c..48ee3f3b25de 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<NumericField> mpMtrRadius;
- DECL_LINK(EditModifyHdl, Edit&, void);
+ std::unique_ptr<weld::SpinButton> 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 50eef4351c08..c96e76821ddf 100644
--- a/cui/uiconfig/ui/smoothdialog.ui
+++ b/cui/uiconfig/ui/smoothdialog.ui
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
<interface domain="cui">
<requires lib="gtk+" version="3.18"/>
- <requires lib="LibreOffice" version="1.0"/>
<object class="GtkAdjustment" id="adjustment1">
<property name="lower">0.10000000000000001</property>
<property name="upper">100</property>
@@ -15,7 +14,13 @@
<property name="border_width">6</property>
<property name="title" translatable="yes" context="smoothdialog|SmoothDialog">Smooth</property>
<property name="resizable">False</property>
+ <property name="modal">True</property>
+ <property name="default_width">0</property>
+ <property name="default_height">0</property>
<property name="type_hint">dialog</property>
+ <child>
+ <placeholder/>
+ </child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
@@ -102,11 +107,28 @@
<property name="vexpand">True</property>
<property name="column_spacing">24</property>
<child>
- <object class="cuilo-GraphicPreviewWindow" id="preview">
+ <object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="vscrollbar_policy">never</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkViewport">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkDrawingArea" id="preview">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
</object>
<packing>
<property name="left_attach">1</property>
@@ -134,10 +156,10 @@
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes" context="smoothdialog|label2">_Smooth radius:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">radius</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index d1f5c3303263..fd36c0297688 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -418,7 +418,7 @@ public:
const Graphic& rGraphic)=0;
virtual VclPtr<AbstractGraphicFilterDialog> CreateGraphicFilterSepia(weld::Window* pParent,
const Graphic& rGraphic)=0;
- virtual VclPtr<AbstractGraphicFilterDialog> CreateGraphicFilterSmooth (vcl::Window* pParent,
+ virtual VclPtr<AbstractGraphicFilterDialog> CreateGraphicFilterSmooth(weld::Window* pParent,
const Graphic& rGraphic,
double nRadius)=0;
virtual VclPtr<AbstractGraphicFilterDialog> CreateGraphicFilterSolarize(weld::Window* pParent,
diff --git a/svx/source/dialog/grfflt.cxx b/svx/source/dialog/grfflt.cxx
index 3983bc8be4e5..3e8bf8e093ef 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<AbstractGraphicFilterDialog> aDlg(pFact->CreateGraphicFilterSmooth(pWindow, rGraphic, 0.7));
+ ScopedVclPtr<AbstractGraphicFilterDialog> 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<AbstractGraphicFilterDialog> aDlg(pFact->CreateGraphicFilterMosaic(pWindow ? pWindow->GetFrameWeld() : nullptr, rGraphic));
+ ScopedVclPtr<AbstractGraphicFilterDialog> 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<AbstractGraphicFilterDialog> aDlg(pFact->CreateGraphicFilterEmboss(pWindow ? pWindow->GetFrameWeld() : nullptr, rGraphic));
+ ScopedVclPtr<AbstractGraphicFilterDialog> 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<AbstractGraphicFilterDialog> aDlg(pFact->CreateGraphicFilterPoster(pWindow ? pWindow->GetFrameWeld() : nullptr, rGraphic));
+ ScopedVclPtr<AbstractGraphicFilterDialog> 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<AbstractGraphicFilterDialog> aDlg(pFact->CreateGraphicFilterSepia(pWindow ? pWindow->GetFrameWeld() : nullptr, rGraphic));
+ ScopedVclPtr<AbstractGraphicFilterDialog> 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<AbstractGraphicFilterDialog> aDlg(pFact->CreateGraphicFilterSolarize(pWindow ? pWindow->GetFrameWeld() : nullptr, rGraphic));
+ ScopedVclPtr<AbstractGraphicFilterDialog> aDlg(pFact->CreateGraphicFilterSolarize(pFrameWeld, rGraphic));
if( aDlg->Execute() == RET_OK )
aGraphic = aDlg->GetFilteredGraphic( rGraphic, 1.0, 1.0 );
}
More information about the Libreoffice-commits
mailing list