diff options
author | Tomaž Vajngerl <quikee@gmail.com> | 2012-06-16 00:05:00 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2012-06-16 00:39:08 +0200 |
commit | ee41193f3e12ea55237f7681e4b53162a0d421d2 (patch) | |
tree | f02ac0b7a6fb8c64df55491152af8eeb4c371c09 /svx | |
parent | Fix wrong variable name in Smooth filter parameters class. (diff) | |
download | core-ee41193f3e12ea55237f7681e4b53162a0d421d2.tar.gz core-ee41193f3e12ea55237f7681e4b53162a0d421d2.zip |
Dialog for Smooth filter
Added dialog for smooth (gaussian blur) filter which now accepts
a parameter for setting the strenth of smoothing (bluring).
Change-Id: Ida6709b060cb5429a63af1994493e716fd0bfebb
Diffstat (limited to 'svx')
-rw-r--r-- | svx/inc/svx/dialogs.hrc | 1 | ||||
-rw-r--r-- | svx/inc/svx/svxcommands.h | 1 | ||||
-rw-r--r-- | svx/inc/svx/svxdlg.hxx | 3 | ||||
-rw-r--r-- | svx/source/dialog/grfflt.cxx | 25 |
4 files changed, 12 insertions, 18 deletions
diff --git a/svx/inc/svx/dialogs.hrc b/svx/inc/svx/dialogs.hrc index 201e7f9b95df..008dcb832f17 100644 --- a/svx/inc/svx/dialogs.hrc +++ b/svx/inc/svx/dialogs.hrc @@ -117,6 +117,7 @@ #define RID_SVX_GRFFILTER_DLG_MOSAIC (RID_SVX_START + 332) #define RID_SVX_GRFFILTER_DLG_SOLARIZE (RID_SVX_START + 333) #define RID_SVX_GRFFILTER_DLG_EMBOSS (RID_SVX_START + 336) +#define RID_SVX_GRFFILTER_DLG_SMOOTH (RID_SVX_START + 337) #define RID_SVXDLG_SEARCHFORMAT (RID_SVX_START + 21) #define RID_SVXDLG_CHARMAP ( RID_SVX_START + 10 ) #define RID_SVXDLG_POSTIT ( RID_SVX_START + 8 ) diff --git a/svx/inc/svx/svxcommands.h b/svx/inc/svx/svxcommands.h index 635ed4d4325f..b42be8f65f97 100644 --- a/svx/inc/svx/svxcommands.h +++ b/svx/inc/svx/svxcommands.h @@ -94,6 +94,7 @@ #define CMD_SID_GRFFILTER_POSTER ".uno:GraphicFilterPoster" #define CMD_SID_GRFFILTER_EMBOSS ".uno:GraphicFilterRelief" #define CMD_SID_GRFFILTER_SEPIA ".uno:GraphicFilterSepia" +#define CMD_SID_GRFFILTER_SMOOTH ".uno:GraphicFilterSmooth" #define CMD_SID_GRFFILTER_SOLARIZE ".uno:GraphicFilterSolarize" #define CMD_SID_GRID_USE ".uno:GridUse" #define CMD_SID_GRID_VISIBLE ".uno:GridVisible" diff --git a/svx/inc/svx/svxdlg.hxx b/svx/inc/svx/svxdlg.hxx index d3bb8b129f53..b7aee5f4d843 100644 --- a/svx/inc/svx/svxdlg.hxx +++ b/svx/inc/svx/svxdlg.hxx @@ -444,6 +444,9 @@ public: const Graphic& rGraphic, sal_uInt16 nCount, sal_uInt32 nResId)=0; + virtual AbstractGraphicFilterDialog * CreateGraphicFilterSmooth (Window* pParent, //add for GraphicFilterSmooth + const Graphic& rGraphic, + double nRadius, sal_uInt32 nResId)=0; virtual AbstractGraphicFilterDialog * CreateGraphicFilterSolarize (Window* pParent, //add for GraphicFilterSolarize const Graphic& rGraphic, sal_uInt8 nGreyThreshold, sal_Bool bInvert, sal_uInt32 nResId)=0; diff --git a/svx/source/dialog/grfflt.cxx b/svx/source/dialog/grfflt.cxx index a446e3dbdd61..809c3dac8fda 100644 --- a/svx/source/dialog/grfflt.cxx +++ b/svx/source/dialog/grfflt.cxx @@ -83,26 +83,15 @@ sal_uIntPtr SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest& rReq, GraphicObj case( SID_GRFFILTER_SMOOTH ): { - if( pShell ) - pShell->SetWaitCursor( sal_True ); - - if( rGraphic.IsAnimated() ) - { - Animation aAnimation( rGraphic.GetAnimation() ); - - if( aAnimation.Filter( BMP_FILTER_SMOOTH ) ) - aGraphic = aAnimation; - } - else + SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); + if(pFact) { - BitmapEx aBmpEx( rGraphic.GetBitmapEx() ); - - if( aBmpEx.Filter( BMP_FILTER_SMOOTH ) ) - aGraphic = aBmpEx; + AbstractGraphicFilterDialog* aDlg = pFact->CreateGraphicFilterSmooth( pWindow, rGraphic, 0.7, RID_SVX_GRFFILTER_DLG_SEPIA); + DBG_ASSERT(aDlg, "Dialogdiet fail!"); + if( aDlg->Execute() == RET_OK ) + aGraphic = aDlg->GetFilteredGraphic( rGraphic, 1.0, 1.0 ); + delete aDlg; } - - if( pShell ) - pShell->SetWaitCursor( sal_False ); } break; |