summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-12-18 10:46:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-12-18 18:15:20 +0100
commitd7602d052dd12b6764942890ea7c11247e2bd222 (patch)
treee1a0c34fdad80a0832dd00bb5b44e71e20002b9a
parente98bad89ddff5bebc3f26d944c1e1be6afe2b6f2 (diff)
convert SVX_GRAPHICFILTER constants to scoped enum
Change-Id: I220a2cfe9ea9ef2aa85e4ad8278be70c338891a5 Reviewed-on: https://gerrit.libreoffice.org/46705 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--include/svx/grfflt.hxx8
-rw-r--r--sc/source/ui/drawfunc/graphsh.cxx2
-rw-r--r--sd/source/ui/view/GraphicObjectBar.cxx2
-rw-r--r--svx/source/dialog/grfflt.cxx10
-rw-r--r--sw/source/uibase/shells/grfsh.cxx2
5 files changed, 12 insertions, 12 deletions
diff --git a/include/svx/grfflt.hxx b/include/svx/grfflt.hxx
index fc60cd256a05..b3896c0e1387 100644
--- a/include/svx/grfflt.hxx
+++ b/include/svx/grfflt.hxx
@@ -23,9 +23,9 @@
#include <svtools/grfmgr.hxx>
#include <svx/svxdllapi.h>
-#define SVX_GRAPHICFILTER_ERRCODE_NONE 0x00000000
-#define SVX_GRAPHICFILTER_UNSUPPORTED_GRAPHICTYPE 0x00000001
-#define SVX_GRAPHICFILTER_UNSUPPORTED_SLOT 0x00000002
+enum class SvxGraphicFilterResult {
+ NONE, UnsupportedGraphicType, UnsupportedSlot
+};
class SfxRequest;
class SfxItemSet;
@@ -34,7 +34,7 @@ class SVX_DLLPUBLIC SvxGraphicFilter
{
public:
- static sal_uLong ExecuteGrfFilterSlot( SfxRequest const & rReq, GraphicObject& rFilterObject );
+ static SvxGraphicFilterResult ExecuteGrfFilterSlot( SfxRequest const & rReq, GraphicObject& rFilterObject );
static void DisableGraphicFilterSlots( SfxItemSet& rSet );
};
diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx
index e13638fe2e06..02e7a0b4cbb8 100644
--- a/sc/source/ui/drawfunc/graphsh.cxx
+++ b/sc/source/ui/drawfunc/graphsh.cxx
@@ -115,7 +115,7 @@ void ScGraphicShell::ExecuteFilter( const SfxRequest& rReq )
{
GraphicObject aFilterObj( static_cast<SdrGrafObj*>(pObj)->GetGraphicObject() );
- if( SVX_GRAPHICFILTER_ERRCODE_NONE ==
+ if( SvxGraphicFilterResult::NONE ==
SvxGraphicFilter::ExecuteGrfFilterSlot( rReq, aFilterObj ) )
{
SdrPageView* pPageView = pView->GetSdrPageView();
diff --git a/sd/source/ui/view/GraphicObjectBar.cxx b/sd/source/ui/view/GraphicObjectBar.cxx
index 38794f9c8e34..64105642182e 100644
--- a/sd/source/ui/view/GraphicObjectBar.cxx
+++ b/sd/source/ui/view/GraphicObjectBar.cxx
@@ -123,7 +123,7 @@ void GraphicObjectBar::ExecuteFilter( SfxRequest const & rReq )
{
GraphicObject aFilterObj( static_cast<SdrGrafObj*>(pObj)->GetGraphicObject() );
- if( SVX_GRAPHICFILTER_ERRCODE_NONE ==
+ if( SvxGraphicFilterResult::NONE ==
SvxGraphicFilter::ExecuteGrfFilterSlot( rReq, aFilterObj ) )
{
SdrPageView* pPageView = mpView->GetSdrPageView();
diff --git a/svx/source/dialog/grfflt.cxx b/svx/source/dialog/grfflt.cxx
index 0f9d7cbd1f0c..2d008bec558a 100644
--- a/svx/source/dialog/grfflt.cxx
+++ b/svx/source/dialog/grfflt.cxx
@@ -31,10 +31,10 @@
#include <memory>
-sal_uIntPtr SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest const & rReq, GraphicObject& rFilterObject )
+SvxGraphicFilterResult SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest const & rReq, GraphicObject& rFilterObject )
{
const Graphic& rGraphic = rFilterObject.GetGraphic();
- sal_uIntPtr nRet = SVX_GRAPHICFILTER_UNSUPPORTED_GRAPHICTYPE;
+ SvxGraphicFilterResult nRet = SvxGraphicFilterResult::UnsupportedGraphicType;
if( rGraphic.GetType() == GraphicType::Bitmap )
{
@@ -251,14 +251,14 @@ sal_uIntPtr SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest const & rReq, Gra
case SID_GRFFILTER :
{
// do nothing; no error
- nRet = SVX_GRAPHICFILTER_ERRCODE_NONE;
+ nRet = SvxGraphicFilterResult::NONE;
break;
}
default:
{
OSL_FAIL( "SvxGraphicFilter: selected filter slot not yet implemented" );
- nRet = SVX_GRAPHICFILTER_UNSUPPORTED_SLOT;
+ nRet = SvxGraphicFilterResult::UnsupportedSlot;
}
break;
}
@@ -266,7 +266,7 @@ sal_uIntPtr SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest const & rReq, Gra
if( aGraphic.GetType() != GraphicType::NONE )
{
rFilterObject.SetGraphic( aGraphic );
- nRet = SVX_GRAPHICFILTER_ERRCODE_NONE;
+ nRet = SvxGraphicFilterResult::NONE;
}
}
diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx
index 2b3a7a8d13d3..bda2b2b395ff 100644
--- a/sw/source/uibase/shells/grfsh.cxx
+++ b/sw/source/uibase/shells/grfsh.cxx
@@ -707,7 +707,7 @@ void SwGrfShell::ExecAttr( SfxRequest const &rReq )
if ( pFilterObj )
{
GraphicObject aFilterObj( *pFilterObj );
- if( SVX_GRAPHICFILTER_ERRCODE_NONE ==
+ if( SvxGraphicFilterResult::NONE ==
SvxGraphicFilter::ExecuteGrfFilterSlot( rReq, aFilterObj ))
GetShell().ReRead( OUString(), OUString(),
&aFilterObj.GetGraphic() );