[Libreoffice-commits] core.git: include/svx sd/source svx/source

Noel Grandin noel.grandin at collabora.co.uk
Thu May 4 10:15:29 UTC 2017


 include/svx/scene3d.hxx                           |    5 +---
 include/svx/sdasitm.hxx                           |    2 -
 include/svx/sphere3d.hxx                          |    3 +-
 sd/source/ui/func/fucon3d.cxx                     |    2 -
 svx/source/customshapes/EnhancedCustomShape3d.cxx |    2 -
 svx/source/dialog/dlgctl3d.cxx                    |    2 -
 svx/source/engine3d/obj3d.cxx                     |    4 +--
 svx/source/engine3d/objfac3d.cxx                  |    2 -
 svx/source/engine3d/scene3d.cxx                   |   23 +++++-----------------
 svx/source/engine3d/sphere3d.cxx                  |    2 -
 svx/source/engine3d/view3d.cxx                    |    5 +---
 svx/source/items/customshapeitem.cxx              |   18 ++---------------
 12 files changed, 22 insertions(+), 48 deletions(-)

New commits:
commit 97f391d4e5ed89425ca6c5ad52d159a7ce8fdee2
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu May 4 11:23:54 2017 +0200

    loplugin:checkunusedparams in svx(part1)
    
    Change-Id: Ie98ec3be5ece2579feca050563c5ab7776ad6a7e
    Reviewed-on: https://gerrit.libreoffice.org/37227
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svx/scene3d.hxx b/include/svx/scene3d.hxx
index 25a230089b79..83ecca16b1f5 100644
--- a/include/svx/scene3d.hxx
+++ b/include/svx/scene3d.hxx
@@ -83,13 +83,12 @@ protected:
     virtual void Notify(SfxBroadcaster &rBC, const SfxHint  &rHint) override;
 
 protected:
-    void SetDefaultAttributes(E3dDefaultAttributes& rDefault);
+    void SetDefaultAttributes();
 
     void ImpCleanup3DDepthMapper();
 
 public:
     E3dScene();
-    E3dScene(E3dDefaultAttributes& rDefault);
     virtual ~E3dScene() override;
 
     virtual void SetBoundRectDirty() override;
@@ -140,7 +139,7 @@ public:
     virtual void SetTransform(const basegfx::B3DHomMatrix& rMatrix) override;
 
     virtual void NbcRotate(const Point& rRef, long nAngle, double sn, double cs) override;
-    void RotateScene(const Point& rRef, long nAngle, double sn, double cs);
+    void RotateScene(const Point& rRef, double sn, double cs);
 
     // TakeObjName...() is for the display in the UI, for example "3 frames selected".
     virtual OUString TakeObjNameSingul() const override;
diff --git a/include/svx/sdasitm.hxx b/include/svx/sdasitm.hxx
index 43a5f36c59b6..57e1e20d3adc 100644
--- a/include/svx/sdasitm.hxx
+++ b/include/svx/sdasitm.hxx
@@ -51,10 +51,8 @@ private:
 
     public:
 
-
             SdrCustomShapeGeometryItem();
             SdrCustomShapeGeometryItem( const css::uno::Sequence< css::beans::PropertyValue >& );
-            SdrCustomShapeGeometryItem( SvStream& rIn, sal_uInt16 nVersion );
             virtual ~SdrCustomShapeGeometryItem() override;
 
             virtual bool                operator==( const SfxPoolItem& ) const override;
diff --git a/include/svx/sphere3d.hxx b/include/svx/sphere3d.hxx
index c0ba4bbf8ceb..c612080185bc 100644
--- a/include/svx/sphere3d.hxx
+++ b/include/svx/sphere3d.hxx
@@ -44,7 +44,8 @@ public:
     // FG: This constructor is only called from MakeObject from the 3d-Objectfactory
     //     when a document with a sphere is loaded.  This constructor does not call
     //     CreateSphere, or create any spheres.
-    E3dSphereObj(int dummy);
+    enum Dummy { DUMMY };
+    E3dSphereObj(Dummy dummy);
 
     // horizontal segments:
     sal_uInt32 GetHorizontalSegments() const
diff --git a/sd/source/ui/func/fucon3d.cxx b/sd/source/ui/func/fucon3d.cxx
index dfbb806136b6..1d12e5bf85fb 100644
--- a/sd/source/ui/func/fucon3d.cxx
+++ b/sd/source/ui/func/fucon3d.cxx
@@ -373,7 +373,7 @@ SdrObject* FuConstruct3dObject::CreateDefaultObject(const sal_uInt16 nID, const
     double fW(aVolume.getWidth());
     double fH(aVolume.getHeight());
     ::tools::Rectangle a3DRect(0, 0, (long)fW, (long)fH);
-    E3dScene* pScene = new E3dScene(mpView->Get3DDefaultAttributes());
+    E3dScene* pScene = new E3dScene;
 
     // copied code from E3dView::InitScene
     double fCamZ(aVolume.getMaxZ() + ((fW + fH) / 4.0));
diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx b/svx/source/customshapes/EnhancedCustomShape3d.cxx
index 6989760ad093..da6ad1357d8c 100644
--- a/svx/source/customshapes/EnhancedCustomShape3d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx
@@ -326,7 +326,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
         a3DDefaultAttr.SetDefaultLatheCharacterMode( true );
         a3DDefaultAttr.SetDefaultExtrudeCharacterMode( true );
 
-        E3dScene* pScene = new E3dScene( a3DDefaultAttr );
+        E3dScene* pScene = new E3dScene;
 
         bool bSceneHasObjects ( false );
         bool bUseTwoFillStyles( false );
diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx
index 4c704e318eee..258fe69f1c4a 100644
--- a/svx/source/dialog/dlgctl3d.cxx
+++ b/svx/source/dialog/dlgctl3d.cxx
@@ -97,7 +97,7 @@ void Svx3DPreviewControl::Construct()
     mp3DView->SetBufferedOverlayAllowed(true);
 
     // 3D Scene
-    mpScene = new E3dScene(mp3DView->Get3DDefaultAttributes());
+    mpScene = new E3dScene;
 
     // initially create object
     SetObjectType(SvxPreviewObjectType::SPHERE);
diff --git a/svx/source/engine3d/obj3d.cxx b/svx/source/engine3d/obj3d.cxx
index 0f5680b726b1..8267a14d9ad0 100644
--- a/svx/source/engine3d/obj3d.cxx
+++ b/svx/source/engine3d/obj3d.cxx
@@ -748,10 +748,10 @@ void E3dObject::NbcRotate(const Point& rRef, long nAngle, double sn, double cs)
     // take no part in the rotation of the scene. To ensure this, there is the
     // SetGlueReallyAbsolute(sal_True);
 
-    double fWinkelInRad = nAngle/100.0 * F_PI180;
+    double fAngleInRad = nAngle/100.0 * F_PI180;
 
     basegfx::B3DHomMatrix aRotateZ;
-    aRotateZ.rotate(0.0, 0.0, fWinkelInRad);
+    aRotateZ.rotate(0.0, 0.0, fAngleInRad);
     NbcSetTransform(aRotateZ * GetTransform());
 
     SetRectsDirty();        // This forces a recalculation of all BoundRects
diff --git a/svx/source/engine3d/objfac3d.cxx b/svx/source/engine3d/objfac3d.cxx
index bf214a12b608..1e0e426f876a 100644
--- a/svx/source/engine3d/objfac3d.cxx
+++ b/svx/source/engine3d/objfac3d.cxx
@@ -63,7 +63,7 @@ IMPL_STATIC_LINK( E3dObjFactory, MakeObject, SdrObjCreatorParams, aParams, SdrOb
                 // determined only after loading the members. This will result
                 // in that the first sphere will be immediately destroyed,
                 // although it was never used.
-                return new E3dSphereObj(123);
+                return new E3dSphereObj(E3dSphereObj::DUMMY);
             case E3D_EXTRUDEOBJ_ID:
                 return new E3dExtrudeObj();
             case E3D_LATHEOBJ_ID:
diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx
index 93d005e663b9..e8d707392db1 100644
--- a/svx/source/engine3d/scene3d.cxx
+++ b/svx/source/engine3d/scene3d.cxx
@@ -177,21 +177,10 @@ E3dScene::E3dScene()
     bDrawOnlySelected(false)
 {
     // Set defaults
-    E3dDefaultAttributes aDefault;
-    SetDefaultAttributes(aDefault);
+    SetDefaultAttributes();
 }
 
-E3dScene::E3dScene(E3dDefaultAttributes& rDefault)
-:   E3dObject(),
-    aCamera(basegfx::B3DPoint(0.0, 0.0, 4.0), basegfx::B3DPoint()),
-    mp3DDepthRemapper(nullptr),
-    bDrawOnlySelected(false)
-{
-    // Set defaults
-    SetDefaultAttributes(rDefault);
-}
-
-void E3dScene::SetDefaultAttributes(E3dDefaultAttributes& /*rDefault*/)
+void E3dScene::SetDefaultAttributes()
 {
     // For WIN95/NT turn off the FP-Exceptions
 #if defined(_WIN32)
@@ -503,7 +492,7 @@ void E3dScene::Notify(SfxBroadcaster &rBC, const SfxHint  &rHint)
     E3dObject::Notify(rBC, rHint);
 }
 
-void E3dScene::RotateScene (const Point& rRef, long /*nAngle*/, double sn, double cs)
+void E3dScene::RotateScene (const Point& rRef, double sn, double cs)
 {
     Point UpperLeft, LowerRight, Center, NewCenter;
 
@@ -605,11 +594,11 @@ void E3dScene::NbcRotate(const Point& rRef, long nAngle, double sn, double cs)
     // objects. So going through the entire list and rotate around the Z axis
     // through the enter of aOutRect's (Steiner's theorem), so RotateZ
 
-    RotateScene (rRef, nAngle, sn, cs);  // Rotates the scene
-    double fWinkelInRad = nAngle/100.0 * F_PI180;
+    RotateScene (rRef, sn, cs);  // Rotates the scene
+    double fAngleInRad = nAngle/100.0 * F_PI180;
 
     basegfx::B3DHomMatrix aRotation;
-    aRotation.rotate(0.0, 0.0, fWinkelInRad);
+    aRotation.rotate(0.0, 0.0, fAngleInRad);
     NbcSetTransform(aRotation * GetTransform());
 
     SetRectsDirty();    // This forces a recalculation of all BoundRects
diff --git a/svx/source/engine3d/sphere3d.cxx b/svx/source/engine3d/sphere3d.cxx
index 17a776e91172..854a677b7c5a 100644
--- a/svx/source/engine3d/sphere3d.cxx
+++ b/svx/source/engine3d/sphere3d.cxx
@@ -67,7 +67,7 @@ E3dSphereObj::E3dSphereObj(E3dDefaultAttributes& rDefault, const basegfx::B3DPoi
 // of segments is not even known yet. This was until 10.02.1997 a (small)
 // memory leak.
 
-E3dSphereObj::E3dSphereObj(int /*dummy*/)
+E3dSphereObj::E3dSphereObj(Dummy /*dummy*/)
 // the parameters it needs to be able to distinguish which
 // constructors of the two is meant. The above is the default.
 {
diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx
index 8c61c239b913..deb4ffe1d24d 100644
--- a/svx/source/engine3d/view3d.cxx
+++ b/svx/source/engine3d/view3d.cxx
@@ -838,7 +838,7 @@ void E3dView::ConvertMarkedObjTo3D(bool bExtrude, const basegfx::B2DPoint& rPnt1
             BegUndo(SVX_RESSTR(RID_SVX_3D_UNDO_LATHE));
 
         // Create a new scene for the created 3D object
-        E3dScene* pScene = new E3dScene(Get3DDefaultAttributes());
+        E3dScene* pScene = new E3dScene;
 
         // Determine rectangle and possibly correct it
         tools::Rectangle aRect = GetAllMarkedRect();
@@ -1292,7 +1292,6 @@ bool E3dView::BegDragObj(const Point& rPnt, OutputDevice* pOut,
 E3dScene* E3dView::SetCurrent3DObj(E3dObject* p3DObj)
 {
     DBG_ASSERT(p3DObj != nullptr, "Who puts in a NULL-pointer here");
-    E3dScene* pScene = nullptr;
 
     // get transformed BoundVolume of the object
     basegfx::B3DRange aVolume(p3DObj->GetBoundVolume());
@@ -1302,7 +1301,7 @@ E3dScene* E3dView::SetCurrent3DObj(E3dObject* p3DObj)
 
     tools::Rectangle aRect(0,0, (long) fW, (long) fH);
 
-    pScene = new E3dScene(Get3DDefaultAttributes());
+    E3dScene* pScene = new E3dScene;
 
     InitScene(pScene, fW, fH, aVolume.getMaxZ() + ((fW + fH) / 4.0));
 
diff --git a/svx/source/items/customshapeitem.cxx b/svx/source/items/customshapeitem.cxx
index 3bf513d2b335..9efc2c3eb01a 100644
--- a/svx/source/items/customshapeitem.cxx
+++ b/svx/source/items/customshapeitem.cxx
@@ -243,14 +243,6 @@ void SdrCustomShapeGeometryItem::ClearPropertyValue( const OUString& rPropName )
 SdrCustomShapeGeometryItem::~SdrCustomShapeGeometryItem()
 {
 }
-SdrCustomShapeGeometryItem::SdrCustomShapeGeometryItem( SvStream& /*rIn*/, sal_uInt16 nVersion ):
-    SfxPoolItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )
-{
-    if ( nVersion )
-    {
-
-    }
-}
 bool SdrCustomShapeGeometryItem::operator==( const SfxPoolItem& rCmp ) const
 {
     bool bRet = SfxPoolItem::operator==( rCmp );
@@ -274,17 +266,13 @@ bool SdrCustomShapeGeometryItem::GetPresentation(
     return false;
 }
 
-SfxPoolItem* SdrCustomShapeGeometryItem::Create( SvStream& rIn, sal_uInt16 nItemVersion ) const
+SfxPoolItem* SdrCustomShapeGeometryItem::Create( SvStream& /*rIn*/, sal_uInt16 /*nItemVersion*/ ) const
 {
-    return new SdrCustomShapeGeometryItem( rIn, nItemVersion );
+    return new SdrCustomShapeGeometryItem;
 }
 
-SvStream& SdrCustomShapeGeometryItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const
+SvStream& SdrCustomShapeGeometryItem::Store( SvStream& rOut, sal_uInt16 /*nItemVersion*/ ) const
 {
-    if ( nItemVersion )
-    {
-
-    }
     return rOut;
 }
 


More information about the Libreoffice-commits mailing list