summaryrefslogtreecommitdiffstats
path: root/chart2/source/controller/main/DragMethod_RotateDiagram.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source/controller/main/DragMethod_RotateDiagram.cxx')
-rw-r--r--chart2/source/controller/main/DragMethod_RotateDiagram.cxx31
1 files changed, 15 insertions, 16 deletions
diff --git a/chart2/source/controller/main/DragMethod_RotateDiagram.cxx b/chart2/source/controller/main/DragMethod_RotateDiagram.cxx
index 030fcd0bf8bc..6172a25edad2 100644
--- a/chart2/source/controller/main/DragMethod_RotateDiagram.cxx
+++ b/chart2/source/controller/main/DragMethod_RotateDiagram.cxx
@@ -21,10 +21,9 @@
#include <DrawViewWrapper.hxx>
#include <SelectionHelper.hxx>
-#include <ChartModelHelper.hxx>
#include <ChartModel.hxx>
-#include <DiagramHelper.hxx>
#include <Diagram.hxx>
+#include <ChartType.hxx>
#include <ChartTypeHelper.hxx>
#include <ThreeDHelper.hxx>
#include <defines.hxx>
@@ -32,8 +31,6 @@
#include <svx/scene3d.hxx>
#include <basegfx/matrix/b3dhommatrix.hxx>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/frame/XModel.hpp>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <svx/sdr/contact/viewcontactofe3dscene.hxx>
#include <drawinglayer/geometry/viewinformation3d.hxx>
@@ -42,7 +39,6 @@ namespace chart
{
using namespace ::com::sun::star;
-using ::com::sun::star::uno::Reference;
DragMethod_RotateDiagram::DragMethod_RotateDiagram( DrawViewWrapper& rDrawViewWrapper
, const OUString& rObjectCID
@@ -74,18 +70,18 @@ DragMethod_RotateDiagram::DragMethod_RotateDiagram( DrawViewWrapper& rDrawViewWr
m_aWireframePolyPolygon = m_pScene->CreateWireframe();
- rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram(getChartModel());
+ rtl::Reference< Diagram > xDiagram = getChartModel()->getFirstChartDiagram();
if( !xDiagram.is() )
return;
- ThreeDHelper::getRotationFromDiagram( xDiagram
- , m_nInitialHorizontalAngleDegree, m_nInitialVerticalAngleDegree );
+ xDiagram->getRotation(
+ m_nInitialHorizontalAngleDegree, m_nInitialVerticalAngleDegree );
- ThreeDHelper::getRotationAngleFromDiagram( xDiagram
- , m_fInitialXAngleRad, m_fInitialYAngleRad, m_fInitialZAngleRad );
+ xDiagram->getRotationAngle(
+ m_fInitialXAngleRad, m_fInitialYAngleRad, m_fInitialZAngleRad );
if( ChartTypeHelper::isSupportingRightAngledAxes(
- DiagramHelper::getChartTypeByIndex( xDiagram, 0 ) ) )
+ xDiagram->getChartTypeByIndex( 0 ) ) )
xDiagram->getPropertyValue("RightAngledAxes") >>= m_bRightAngledAxes;
if(m_bRightAngledAxes)
{
@@ -161,13 +157,16 @@ bool DragMethod_RotateDiagram::EndSdrDrag(bool /*bCopy*/)
if(m_bRightAngledAxes)
ThreeDHelper::adaptRadAnglesForRightAngledAxes( fResultX, fResultY );
- ThreeDHelper::setRotationAngleToDiagram( ChartModelHelper::findDiagram( getChartModel() )
- , fResultX, fResultY, fResultZ );
+ rtl::Reference<Diagram> xDiagram = getChartModel()->getFirstChartDiagram();
+ if (xDiagram)
+ xDiagram->setRotationAngle( fResultX, fResultY, fResultZ );
}
else
{
- ThreeDHelper::setRotationToDiagram( ChartModelHelper::findDiagram( getChartModel() )
- , m_nInitialHorizontalAngleDegree+m_nAdditionalHorizontalAngleDegree, m_nInitialVerticalAngleDegree+m_nAdditionalVerticalAngleDegree );
+ rtl::Reference<Diagram> xDiagram = getChartModel()->getFirstChartDiagram();
+ if (xDiagram)
+ xDiagram->setRotation(
+ m_nInitialHorizontalAngleDegree+m_nAdditionalHorizontalAngleDegree, m_nInitialVerticalAngleDegree+m_nAdditionalVerticalAngleDegree );
}
return true;
@@ -217,7 +216,7 @@ void DragMethod_RotateDiagram::CreateOverlayGeometry(
std::unique_ptr<sdr::overlay::OverlayPolyPolygonStripedAndFilled> pNew(
new sdr::overlay::OverlayPolyPolygonStripedAndFilled(
- aPolyPolygon));
+ std::move(aPolyPolygon)));
insertNewlyCreatedOverlayObjectForSdrDragMethod(
std::move(pNew),