summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svx/dlgctl3d.hxx11
-rw-r--r--svx/source/dialog/dlgctl3d.cxx24
2 files changed, 17 insertions, 18 deletions
diff --git a/include/svx/dlgctl3d.hxx b/include/svx/dlgctl3d.hxx
index 762fa1c9bd22..4d704d63814a 100644
--- a/include/svx/dlgctl3d.hxx
+++ b/include/svx/dlgctl3d.hxx
@@ -33,8 +33,7 @@ class E3dView;
class E3dPolyScene;
class E3dObject;
-#define PREVIEW_OBJECTTYPE_SPHERE 0x0000
-#define PREVIEW_OBJECTTYPE_CUBE 0x0001
+enum class SvxPreviewObjectType { SPHERE, CUBE };
class SVX_DLLPUBLIC SAL_WARN_UNUSED Svx3DPreviewControl : public Control
{
@@ -44,7 +43,7 @@ protected:
E3dView* mp3DView;
E3dPolyScene* mpScene;
E3dObject* mp3DObj;
- sal_uInt16 mnObjectType;
+ SvxPreviewObjectType mnObjectType;
void Construct();
@@ -59,8 +58,8 @@ public:
virtual Size GetOptimalSize() const SAL_OVERRIDE;
void Reset();
- virtual void SetObjectType(sal_uInt16 nType);
- sal_uInt16 GetObjectType() const { return mnObjectType; }
+ virtual void SetObjectType(SvxPreviewObjectType nType);
+ SvxPreviewObjectType GetObjectType() const { return mnObjectType; }
SfxItemSet Get3DAttributes() const;
virtual void Set3DAttributes(const SfxItemSet& rAttr);
};
@@ -111,7 +110,7 @@ public:
virtual void Tracking( const TrackingEvent& rTEvt ) SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
- virtual void SetObjectType(sal_uInt16 nType) SAL_OVERRIDE;
+ virtual void SetObjectType(SvxPreviewObjectType nType) SAL_OVERRIDE;
// register user callback
void SetUserInteractiveChangeCallback(Link aNew) { maUserInteractiveChangeCallback = aNew; }
diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx
index e30ec5920d8e..2972abdf60ce 100644
--- a/svx/source/dialog/dlgctl3d.cxx
+++ b/svx/source/dialog/dlgctl3d.cxx
@@ -48,7 +48,7 @@ Svx3DPreviewControl::Svx3DPreviewControl(vcl::Window* pParent, WinBits nStyle)
mp3DView(0),
mpScene(0),
mp3DObj(0),
- mnObjectType(PREVIEW_OBJECTTYPE_SPHERE)
+ mnObjectType(SvxPreviewObjectType::SPHERE)
{
Construct();
@@ -103,7 +103,7 @@ void Svx3DPreviewControl::Construct()
mpScene = new E3dPolyScene(mp3DView->Get3DDefaultAttributes());
// initially create object
- SetObjectType(PREVIEW_OBJECTTYPE_SPHERE);
+ SetObjectType(SvxPreviewObjectType::SPHERE);
// camera and perspective
Camera3D& rCamera = (Camera3D&) mpScene->GetCamera();
@@ -177,18 +177,18 @@ void Svx3DPreviewControl::MouseButtonDown(const MouseEvent& rMEvt)
if( rMEvt.IsShift() && rMEvt.IsMod1() )
{
- if(PREVIEW_OBJECTTYPE_SPHERE == GetObjectType())
+ if(SvxPreviewObjectType::SPHERE == GetObjectType())
{
- SetObjectType(PREVIEW_OBJECTTYPE_CUBE);
+ SetObjectType(SvxPreviewObjectType::CUBE);
}
else
{
- SetObjectType(PREVIEW_OBJECTTYPE_SPHERE);
+ SetObjectType(SvxPreviewObjectType::SPHERE);
}
}
}
-void Svx3DPreviewControl::SetObjectType(sal_uInt16 nType)
+void Svx3DPreviewControl::SetObjectType(SvxPreviewObjectType nType)
{
if( mnObjectType != nType || !mp3DObj)
{
@@ -205,7 +205,7 @@ void Svx3DPreviewControl::SetObjectType(sal_uInt16 nType)
switch( nType )
{
- case PREVIEW_OBJECTTYPE_SPHERE:
+ case SvxPreviewObjectType::SPHERE:
{
mp3DObj = new E3dSphereObj(
mp3DView->Get3DDefaultAttributes(),
@@ -214,7 +214,7 @@ void Svx3DPreviewControl::SetObjectType(sal_uInt16 nType)
}
break;
- case PREVIEW_OBJECTTYPE_CUBE:
+ case SvxPreviewObjectType::CUBE:
{
mp3DObj = new E3dCubeObj(
mp3DView->Get3DDefaultAttributes(),
@@ -713,7 +713,7 @@ void Svx3DLightControl::Resize()
mpScene->SetSnapRect(Rectangle(Point(0, 0), aSize));
}
-void Svx3DLightControl::SetObjectType(sal_uInt16 nType)
+void Svx3DLightControl::SetObjectType(SvxPreviewObjectType nType)
{
// call parent
Svx3DPreviewControl::SetObjectType(nType);
@@ -1251,13 +1251,13 @@ IMPL_LINK_NOARG(SvxLightCtl3D, ScrollBarMove)
IMPL_LINK_NOARG(SvxLightCtl3D, ButtonPress)
{
- if(PREVIEW_OBJECTTYPE_SPHERE == GetSvx3DLightControl().GetObjectType())
+ if(SvxPreviewObjectType::SPHERE == GetSvx3DLightControl().GetObjectType())
{
- GetSvx3DLightControl().SetObjectType(PREVIEW_OBJECTTYPE_CUBE);
+ GetSvx3DLightControl().SetObjectType(SvxPreviewObjectType::CUBE);
}
else
{
- GetSvx3DLightControl().SetObjectType(PREVIEW_OBJECTTYPE_SPHERE);
+ GetSvx3DLightControl().SetObjectType(SvxPreviewObjectType::SPHERE);
}
return 0;