diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-10 13:13:44 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-11 10:16:16 +0200 |
commit | 9fa75f677a7b48a2177fe11cca0d00f5a2deb7da (patch) | |
tree | aecf6d5d272166c169935e1563517d020085ee54 /svx/source | |
parent | 88829fd914105a0837ee41d3f00f9178228c19cf (diff) |
loplugin:mergeclasses merge E3dScene with E3dPolyScene
Change-Id: I70f28fb4c87ad8c0e0ad46f4ce04914b6536d6b9
Reviewed-on: https://gerrit.libreoffice.org/36376
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShape3d.cxx | 4 | ||||
-rw-r--r-- | svx/source/dialog/dlgctl3d.cxx | 4 | ||||
-rw-r--r-- | svx/source/engine3d/dragmt3d.cxx | 1 | ||||
-rw-r--r-- | svx/source/engine3d/float3d.cxx | 1 | ||||
-rw-r--r-- | svx/source/engine3d/obj3d.cxx | 1 | ||||
-rw-r--r-- | svx/source/engine3d/objfac3d.cxx | 6 | ||||
-rw-r--r-- | svx/source/engine3d/polysc3d.cxx | 58 | ||||
-rw-r--r-- | svx/source/engine3d/view3d.cxx | 5 | ||||
-rw-r--r-- | svx/source/engine3d/view3d1.cxx | 20 | ||||
-rw-r--r-- | svx/source/sdr/contact/viewcontactofe3dscene.cxx | 1 | ||||
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 1 | ||||
-rw-r--r-- | svx/source/svdraw/svdpage.cxx | 1 | ||||
-rw-r--r-- | svx/source/unodraw/unopage.cxx | 10 | ||||
-rw-r--r-- | svx/source/unodraw/unoprov.cxx | 2 | ||||
-rw-r--r-- | svx/source/unodraw/unoshap3.cxx | 4 | ||||
-rw-r--r-- | svx/source/unodraw/unoshape.cxx | 6 |
16 files changed, 26 insertions, 99 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx b/svx/source/customshapes/EnhancedCustomShape3d.cxx index d33942b0190f..6989760ad093 100644 --- a/svx/source/customshapes/EnhancedCustomShape3d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx @@ -34,7 +34,6 @@ #include <svx/svdopath.hxx> #include <svx/svdogrp.hxx> #include <svx/svdpage.hxx> -#include <svx/polysc3d.hxx> #include <svx/svddef.hxx> #include <svx/svx3ditems.hxx> #include <svx/extrud3d.hxx> @@ -42,6 +41,7 @@ #include <vcl/svapp.hxx> #include <svx/xlnclit.hxx> #include <svx/sdasitm.hxx> +#include <svx/scene3d.hxx> #include <com/sun/star/awt/Point.hpp> #include <com/sun/star/drawing/Position3D.hpp> #include <com/sun/star/drawing/Direction3D.hpp> @@ -326,7 +326,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con a3DDefaultAttr.SetDefaultLatheCharacterMode( true ); a3DDefaultAttr.SetDefaultExtrudeCharacterMode( true ); - E3dScene* pScene = new E3dPolyScene( a3DDefaultAttr ); + E3dScene* pScene = new E3dScene( a3DDefaultAttr ); bool bSceneHasObjects ( false ); bool bUseTwoFillStyles( false ); diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx index 5b4a90cb6dab..85b23ffcf272 100644 --- a/svx/source/dialog/dlgctl3d.cxx +++ b/svx/source/dialog/dlgctl3d.cxx @@ -24,9 +24,9 @@ #include <svx/fmmodel.hxx> #include <svl/itempool.hxx> #include <svx/fmpage.hxx> -#include <svx/polysc3d.hxx> #include <svx/sphere3d.hxx> #include <svx/cube3d.hxx> +#include <svx/scene3d.hxx> #include <vcl/svapp.hxx> #include <vcl/builderfactory.hxx> #include <svx/helperhittest3d.hxx> @@ -97,7 +97,7 @@ void Svx3DPreviewControl::Construct() mp3DView->SetBufferedOverlayAllowed(true); // 3D Scene - mpScene = new E3dPolyScene(mp3DView->Get3DDefaultAttributes()); + mpScene = new E3dScene(mp3DView->Get3DDefaultAttributes()); // initially create object SetObjectType(SvxPreviewObjectType::SPHERE); diff --git a/svx/source/engine3d/dragmt3d.cxx b/svx/source/engine3d/dragmt3d.cxx index fef392fe38af..8a3b4e8b8ae8 100644 --- a/svx/source/engine3d/dragmt3d.cxx +++ b/svx/source/engine3d/dragmt3d.cxx @@ -25,7 +25,6 @@ #include <svx/svddrgmt.hxx> #include <svx/svdtrans.hxx> #include <svx/obj3d.hxx> -#include <svx/polysc3d.hxx> #include <svx/e3dundo.hxx> #include <svx/dialogs.hrc> #include <svx/sdr/overlay/overlaypolypolygon.hxx> diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx index ad1a163a5e5d..7b239d7f16f6 100644 --- a/svx/source/engine3d/float3d.cxx +++ b/svx/source/engine3d/float3d.cxx @@ -35,7 +35,6 @@ #include <svx/camera3d.hxx> #include <svx/fmmodel.hxx> #include <svx/fmpage.hxx> -#include <svx/polysc3d.hxx> #include <editeng/eeitem.hxx> #include <svl/style.hxx> #include <svx/dlgutil.hxx> diff --git a/svx/source/engine3d/obj3d.cxx b/svx/source/engine3d/obj3d.cxx index e1999f3b9a61..0f5680b726b1 100644 --- a/svx/source/engine3d/obj3d.cxx +++ b/svx/source/engine3d/obj3d.cxx @@ -29,7 +29,6 @@ #include "svx/globl3d.hxx" #include <svx/camera3d.hxx> #include <svx/scene3d.hxx> -#include <svx/polysc3d.hxx> #include <svx/cube3d.hxx> #include <svx/lathe3d.hxx> #include <svx/sphere3d.hxx> diff --git a/svx/source/engine3d/objfac3d.cxx b/svx/source/engine3d/objfac3d.cxx index 7baa7a5eba2b..bf214a12b608 100644 --- a/svx/source/engine3d/objfac3d.cxx +++ b/svx/source/engine3d/objfac3d.cxx @@ -19,7 +19,6 @@ #include <svx/svdpage.hxx> #include "svx/globl3d.hxx" -#include <svx/polysc3d.hxx> #include <svx/cube3d.hxx> #include <svx/sphere3d.hxx> #include <svx/extrud3d.hxx> @@ -27,6 +26,7 @@ #include <svx/polygn3d.hxx> #include "svx/objfac3d.hxx" #include <svx/svdobj.hxx> +#include <svx/scene3d.hxx> static bool bInit = false; @@ -51,8 +51,8 @@ IMPL_STATIC_LINK( E3dObjFactory, MakeObject, SdrObjCreatorParams, aParams, SdrOb { switch ( aParams.nObjIdentifier ) { - case E3D_POLYSCENE_ID: - return new E3dPolyScene(); + case E3D_SCENE_ID: + return new E3dScene(); case E3D_POLYGONOBJ_ID : return new E3dPolygonObj(); case E3D_CUBEOBJ_ID : diff --git a/svx/source/engine3d/polysc3d.cxx b/svx/source/engine3d/polysc3d.cxx deleted file mode 100644 index d6aac7a216bb..000000000000 --- a/svx/source/engine3d/polysc3d.cxx +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include <svx/xfillit.hxx> -#include <svx/svdopath.hxx> -#include <svx/svdogrp.hxx> -#include "svx/svditer.hxx" -#include <svx/svdetc.hxx> -#include <vcl/virdev.hxx> -#include <vcl/svapp.hxx> -#include <svx/svdpage.hxx> -#include <svx/svdpool.hxx> -#include <svl/style.hxx> -#include "svx/globl3d.hxx" -#include <svx/polysc3d.hxx> -#include <svx/xlnclit.hxx> -#include <svl/metitem.hxx> -#include <svx/xtable.hxx> -#include <svx/xlnwtit.hxx> - - -E3dPolyScene::E3dPolyScene() -: E3dScene() -{ -} - -E3dPolyScene::E3dPolyScene(E3dDefaultAttributes& rDefault) -: E3dScene(rDefault) -{ -} - -sal_uInt16 E3dPolyScene::GetObjIdentifier() const -{ - return E3D_POLYSCENE_ID; -} - -E3dPolyScene* E3dPolyScene::Clone() const -{ - return CloneHelper< E3dPolyScene >(); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx index a2b0af5f3261..8c61c239b913 100644 --- a/svx/source/engine3d/view3d.cxx +++ b/svx/source/engine3d/view3d.cxx @@ -39,7 +39,6 @@ #include <svx/sphere3d.hxx> #include <svx/extrud3d.hxx> #include <svx/cube3d.hxx> -#include <svx/polysc3d.hxx> #include "dragmt3d.hxx" #include <svx/view3d.hxx> #include <svx/svdundo.hxx> @@ -839,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 E3dPolyScene(Get3DDefaultAttributes()); + E3dScene* pScene = new E3dScene(Get3DDefaultAttributes()); // Determine rectangle and possibly correct it tools::Rectangle aRect = GetAllMarkedRect(); @@ -1303,7 +1302,7 @@ E3dScene* E3dView::SetCurrent3DObj(E3dObject* p3DObj) tools::Rectangle aRect(0,0, (long) fW, (long) fH); - pScene = new E3dPolyScene(Get3DDefaultAttributes()); + pScene = new E3dScene(Get3DDefaultAttributes()); InitScene(pScene, fW, fH, aVolume.getMaxZ() + ((fW + fH) / 4.0)); diff --git a/svx/source/engine3d/view3d1.cxx b/svx/source/engine3d/view3d1.cxx index 75746f93e345..649e2ddf4fb8 100644 --- a/svx/source/engine3d/view3d1.cxx +++ b/svx/source/engine3d/view3d1.cxx @@ -28,7 +28,6 @@ #include <svx/dialmgr.hxx> #include "svx/globl3d.hxx" #include <svx/obj3d.hxx> -#include <svx/polysc3d.hxx> #include <svx/e3ditem.hxx> #include <editeng/colritem.hxx> #include <svx/lathe3d.hxx> @@ -50,16 +49,19 @@ void E3dView::ConvertMarkedToPolyObj() { SdrObject* pObj = GetMarkedObjectByIndex(0); - if (pObj && dynamic_cast< const E3dPolyScene* >(pObj) != nullptr) + if (pObj) { - bool bBezier = false; - pNewObj = static_cast<E3dPolyScene*>(pObj)->ConvertToPolyObj(bBezier, false/*bLineToArea*/); - - if (pNewObj) + auto pScene = dynamic_cast< const E3dScene* >(pObj); + if (pScene) { - BegUndo(SVX_RESSTR(RID_SVX_3D_UNDO_EXTRUDE)); - ReplaceObjectAtView(pObj, *GetSdrPageView(), pNewObj); - EndUndo(); + bool bBezier = false; + pNewObj = pScene->ConvertToPolyObj(bBezier, false/*bLineToArea*/); + if (pNewObj) + { + BegUndo(SVX_RESSTR(RID_SVX_3D_UNDO_EXTRUDE)); + ReplaceObjectAtView(pObj, *GetSdrPageView(), pNewObj); + EndUndo(); + } } } } diff --git a/svx/source/sdr/contact/viewcontactofe3dscene.cxx b/svx/source/sdr/contact/viewcontactofe3dscene.cxx index 18f99ccc0445..75292d9b860f 100644 --- a/svx/source/sdr/contact/viewcontactofe3dscene.cxx +++ b/svx/source/sdr/contact/viewcontactofe3dscene.cxx @@ -18,7 +18,6 @@ */ #include <svx/sdr/contact/viewcontactofe3dscene.hxx> -#include <svx/polysc3d.hxx> #include <svx/sdr/contact/displayinfo.hxx> #include <svx/sdr/contact/viewobjectcontact.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index a275c9d2477a..d0cdb107f9e3 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -60,7 +60,6 @@ #include "svx/xlinjoit.hxx" #include <svx/fmmodel.hxx> -#include <svx/polysc3d.hxx> #include <svx/sdr/contact/displayinfo.hxx> #include <svx/sdr/contact/objectcontactofobjlistpainter.hxx> #include <sdr/contact/viewcontactofgraphic.hxx> diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index cec60959272b..3ad1d0bb4709 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -44,7 +44,6 @@ #include <svx/svdpagv.hxx> #include <svx/svdundo.hxx> #include <svx/fmglob.hxx> -#include <svx/polysc3d.hxx> #include <svx/fmdpage.hxx> diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx index e41825f7fb85..5da13dbcbc40 100644 --- a/svx/source/unodraw/unopage.cxx +++ b/svx/source/unodraw/unopage.cxx @@ -41,13 +41,13 @@ #include "shapeimpl.hxx" #include "svdglob.hxx" #include "svx/globl3d.hxx" -#include <svx/polysc3d.hxx> #include <svx/unoprov.hxx> #include <svx/svdopath.hxx> #include "svx/unoapi.hxx" #include <svx/svdomeas.hxx> #include <svx/extrud3d.hxx> #include <svx/lathe3d.hxx> +#include <svx/scene3d.hxx> #include <vcl/svapp.hxx> #include <tools/diagnose_ex.h> #include <tools/globname.hxx> @@ -484,10 +484,9 @@ SdrObject *SvxDrawPage::CreateSdrObject_(const Reference< drawing::XShape > & xS if (!pNewObj) return nullptr; - if( dynamic_cast<const E3dPolyScene* >(pNewObj) != nullptr) + if( auto pScene = dynamic_cast<E3dScene* >(pNewObj) ) { // initialise scene - E3dScene* pScene = static_cast<E3dScene*>(pNewObj); double fW = (double)aSize.Width; double fH = (double)aSize.Height; @@ -585,7 +584,6 @@ SvxShape* SvxDrawPage::CreateShapeByTypeAndInventor( sal_uInt16 nType, SdrInvent switch( nType ) { case E3D_SCENE_ID : - case E3D_POLYSCENE_ID : pRet = new Svx3DSceneObject( pObj, mpPage ); break; case E3D_CUBEOBJ_ID : @@ -781,10 +779,6 @@ SvxShape* SvxDrawPage::CreateShapeByTypeAndInventor( sal_uInt16 nType, SdrInvent nObjId = OBJ_CIRC; break; - case E3D_SCENE_ID | E3D_INVENTOR_FLAG: - nObjId = E3D_POLYSCENE_ID | E3D_INVENTOR_FLAG; - break; - case OBJ_TITLETEXT: case OBJ_OUTLINETEXT: nObjId = OBJ_TEXT; diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx index 87473aeb760a..24ba390d0309 100644 --- a/svx/source/unodraw/unoprov.cxx +++ b/svx/source/unodraw/unoprov.cxx @@ -841,7 +841,7 @@ const UHashMapImpl& GetUHashImpl() { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.CustomShape"), OBJ_CUSTOMSHAPE }, { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.MediaShape"), OBJ_MEDIA }, - { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DSceneObject"), E3D_POLYSCENE_ID | E3D_INVENTOR_FLAG }, + { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DSceneObject"), E3D_SCENE_ID | E3D_INVENTOR_FLAG }, { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DCubeObject"), E3D_CUBEOBJ_ID | E3D_INVENTOR_FLAG }, { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DSphereObject"), E3D_SPHEREOBJ_ID | E3D_INVENTOR_FLAG }, { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DLatheObject"), E3D_LATHEOBJ_ID | E3D_INVENTOR_FLAG }, diff --git a/svx/source/unodraw/unoshap3.cxx b/svx/source/unodraw/unoshap3.cxx index 7a7797f64430..880e99d08042 100644 --- a/svx/source/unodraw/unoshap3.cxx +++ b/svx/source/unodraw/unoshap3.cxx @@ -33,7 +33,6 @@ #include <svx/unoshape.hxx> #include <svx/unopage.hxx> #include <editeng/unoprnms.hxx> -#include <svx/polysc3d.hxx> #include "svx/globl3d.hxx" #include <svx/cube3d.hxx> #include <svx/sphere3d.hxx> @@ -42,6 +41,7 @@ #include <svx/polygn3d.hxx> #include "svx/unoshprp.hxx" #include "svx/svdmodel.hxx" +#include <svx/scene3d.hxx> #include <basegfx/polygon/b3dpolygon.hxx> #include <basegfx/polygon/b3dpolygontools.hxx> #include <com/sun/star/drawing/PolyPolygonShape3D.hpp> @@ -187,7 +187,7 @@ sal_Int32 SAL_CALL Svx3DSceneObject::getCount() sal_Int32 nRetval = 0; - if(mpObj.is() && dynamic_cast<const E3dPolyScene* >(mpObj.get()) != nullptr && mpObj->GetSubList()) + if(mpObj.is() && dynamic_cast<const E3dScene* >(mpObj.get()) != nullptr && mpObj->GetSubList()) nRetval = mpObj->GetSubList()->GetObjCount(); return nRetval; } diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index ee49c9913b1b..acb0783dc0b2 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -384,10 +384,6 @@ void SvxShape::impl_initFromSdrObject() case OBJ_SECT: // sector mpImpl->mnObjId = OBJ_CIRC; break; - - case E3D_SCENE_ID | E3D_INVENTOR_FLAG: - mpImpl->mnObjId = E3D_POLYSCENE_ID | E3D_INVENTOR_FLAG; - break; } } } @@ -874,7 +870,7 @@ uno::Sequence< uno::Type > SAL_CALL SvxShape::_getTypes() return aTypeSequence; } // 3d scene shape - case E3D_POLYSCENE_ID|E3D_INVENTOR_FLAG: + case E3D_SCENE_ID|E3D_INVENTOR_FLAG: { static css::uno::Sequence< css::uno::Type > aTypeSequence; |