summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svx/scene3d.hxx2
-rw-r--r--sd/source/ui/func/fucon3d.cxx2
-rw-r--r--svx/source/customshapes/EnhancedCustomShape3d.cxx2
-rw-r--r--svx/source/dialog/dlgctl3d.cxx4
-rw-r--r--svx/source/engine3d/scene3d.cxx19
5 files changed, 12 insertions, 17 deletions
diff --git a/include/svx/scene3d.hxx b/include/svx/scene3d.hxx
index f8642e02b540..70d77e8373f8 100644
--- a/include/svx/scene3d.hxx
+++ b/include/svx/scene3d.hxx
@@ -126,7 +126,7 @@ public:
virtual E3dScene* GetScene() const override;
void SetCamera(const Camera3D& rNewCamera);
- const Camera3D& GetCamera() const { return aCamera; }
+ Camera3D GetCamera() const { return aCamera; }
void removeAllNonSelectedObjects();
virtual E3dScene* Clone() const override;
diff --git a/sd/source/ui/func/fucon3d.cxx b/sd/source/ui/func/fucon3d.cxx
index 0c27ad0381c3..702d1bd0a106 100644
--- a/sd/source/ui/func/fucon3d.cxx
+++ b/sd/source/ui/func/fucon3d.cxx
@@ -238,7 +238,7 @@ E3dCompoundObject* FuConstruct3dObject::ImpCreateBasic3DShape()
void FuConstruct3dObject::ImpPrepareBasic3DShape(E3dCompoundObject* p3DObj, E3dScene *pScene)
{
- Camera3D &aCamera = (Camera3D&) pScene->GetCamera ();
+ Camera3D aCamera = pScene->GetCamera ();
// get transformed BoundVolume of the new object
basegfx::B3DRange aBoundVol;
diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx b/svx/source/customshapes/EnhancedCustomShape3d.cxx
index 7e2b45ee057a..1f802b8bc49e 100644
--- a/svx/source/customshapes/EnhancedCustomShape3d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx
@@ -574,7 +574,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
pRet = pScene;
// Camera settings, Perspective ...
- Camera3D& rCamera = (Camera3D&)pScene->GetCamera();
+ Camera3D rCamera = pScene->GetCamera();
const basegfx::B3DRange& rVolume = pScene->GetBoundVolume();
pScene->NbcSetSnapRect( aSnapRect );
diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx
index 2dbd53e6f72b..482a89d794ba 100644
--- a/svx/source/dialog/dlgctl3d.cxx
+++ b/svx/source/dialog/dlgctl3d.cxx
@@ -103,7 +103,7 @@ void Svx3DPreviewControl::Construct()
SetObjectType(SvxPreviewObjectType::SPHERE);
// camera and perspective
- Camera3D& rCamera = (Camera3D&) mpScene->GetCamera();
+ Camera3D rCamera = mpScene->GetCamera();
const basegfx::B3DRange& rVolume = mpScene->GetBoundVolume();
double fW = rVolume.getWidth();
double fH = rVolume.getHeight();
@@ -341,7 +341,7 @@ void Svx3DLightControl::Construct2()
{
// change camera settings
- Camera3D& rCamera = (Camera3D&) mpScene->GetCamera();
+ Camera3D rCamera = mpScene->GetCamera();
const basegfx::B3DRange& rVolume = mpScene->GetBoundVolume();
double fW = rVolume.getWidth();
double fH = rVolume.getHeight();
diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx
index 911aca6e1820..7ca48718a07d 100644
--- a/svx/source/engine3d/scene3d.cxx
+++ b/svx/source/engine3d/scene3d.cxx
@@ -330,31 +330,27 @@ void E3dScene::NbcResize(const Point& rRef, const Fraction& rXFact,
void E3dScene::SetCamera(const Camera3D& rNewCamera)
{
- // Set old camera
aCamera = rNewCamera;
static_cast<sdr::properties::E3dSceneProperties&>(GetProperties()).SetSceneItemsFromCamera();
SetRectsDirty();
- // Fill new camera from old
- Camera3D& rCam = (Camera3D&)GetCamera();
-
// Turn off ratio
- if(rCam.GetAspectMapping() == AS_NO_MAPPING)
+ if(aCamera.GetAspectMapping() == AS_NO_MAPPING)
GetCameraSet().SetRatio(0.0);
// Set Imaging geometry
- basegfx::B3DPoint aVRP(rCam.GetViewPoint());
- basegfx::B3DVector aVPN(aVRP - rCam.GetVRP());
- basegfx::B3DVector aVUV(rCam.GetVUV());
+ basegfx::B3DPoint aVRP(aCamera.GetViewPoint());
+ basegfx::B3DVector aVPN(aVRP - aCamera.GetVRP());
+ basegfx::B3DVector aVUV(aCamera.GetVUV());
// use SetViewportValues() to set VRP, VPN and VUV as vectors, too.
// Else these values would not be exported/imported correctly.
GetCameraSet().SetViewportValues(aVRP, aVPN, aVUV);
// Set perspective
- GetCameraSet().SetPerspective(rCam.GetProjection() == PR_PERSPECTIVE);
- GetCameraSet().SetViewportRectangle((Rectangle&)rCam.GetDeviceWindow());
+ GetCameraSet().SetPerspective(aCamera.GetProjection() == PR_PERSPECTIVE);
+ GetCameraSet().SetViewportRectangle((Rectangle&)aCamera.GetDeviceWindow());
ImpCleanup3DDepthMapper();
}
@@ -646,8 +642,7 @@ void E3dScene::RecalcSnapRect()
{
// The Scene is used as a 2D-Objekt, take the SnapRect from the
// 2D Display settings
- Camera3D& rCam = (Camera3D&)pScene->GetCamera();
- maSnapRect = rCam.GetDeviceWindow();
+ maSnapRect = pScene->aCamera.GetDeviceWindow();
}
else
{