summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-23 13:42:00 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-24 08:34:43 +0200
commite83e5144119cba5514d07e03b6af557dae542b5b (patch)
tree2c80c3de7e77a6a227b4b0e16c8cfb56ddbe9a6d /chart2
parent4089e1d9f67a61322b1fa4330ee10f62b3684f7f (diff)
loplugin:useuniqueptr in ChartController
Change-Id: I224db5ab179bfd84125617e643441fd9a2872e67 Reviewed-on: https://gerrit.libreoffice.org/57872 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/inc/ChartController.hxx2
-rw-r--r--chart2/source/controller/main/ChartController.cxx6
-rw-r--r--chart2/source/controller/main/ChartController_Position.cxx2
-rw-r--r--chart2/source/controller/main/ChartController_TextEdit.cxx2
-rw-r--r--chart2/source/controller/main/ChartController_Tools.cxx6
-rw-r--r--chart2/source/controller/main/ChartController_Window.cxx18
6 files changed, 18 insertions, 18 deletions
diff --git a/chart2/source/controller/inc/ChartController.hxx b/chart2/source/controller/inc/ChartController.hxx
index d6f5658b62cf..2cf1978811db 100644
--- a/chart2/source/controller/inc/ChartController.hxx
+++ b/chart2/source/controller/inc/ChartController.hxx
@@ -389,7 +389,7 @@ private:
css::uno::Reference<css::awt::XWindow> m_xViewWindow;
css::uno::Reference<css::uno::XInterface> m_xChartView;
std::shared_ptr< DrawModelWrapper > m_pDrawModelWrapper;
- DrawViewWrapper* m_pDrawViewWrapper;
+ std::unique_ptr<DrawViewWrapper> m_pDrawViewWrapper;
Selection m_aSelection;
SdrDragMode m_eDragMode;
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index b0c27a4e6a43..2467f267d27f 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -729,7 +729,7 @@ void ChartController::impl_createDrawViewController()
{
if( m_pDrawModelWrapper )
{
- m_pDrawViewWrapper = new DrawViewWrapper(m_pDrawModelWrapper->getSdrModel(),GetChartWindow());
+ m_pDrawViewWrapper.reset( new DrawViewWrapper(m_pDrawModelWrapper->getSdrModel(),GetChartWindow()) );
m_pDrawViewWrapper->attachParentReferenceDevice( getModel() );
}
}
@@ -742,7 +742,7 @@ void ChartController::impl_deleteDrawViewController()
SolarMutexGuard aGuard;
if( m_pDrawViewWrapper->IsTextEdit() )
this->EndTextEdit();
- DELETEZ( m_pDrawViewWrapper );
+ m_pDrawViewWrapper.reset();
}
}
@@ -1470,7 +1470,7 @@ DrawViewWrapper* ChartController::GetDrawViewWrapper()
{
impl_createDrawViewController();
}
- return m_pDrawViewWrapper;
+ return m_pDrawViewWrapper.get();
}
diff --git a/chart2/source/controller/main/ChartController_Position.cxx b/chart2/source/controller/main/ChartController_Position.cxx
index 5746569a5836..cac61217b4a0 100644
--- a/chart2/source/controller/main/ChartController_Position.cxx
+++ b/chart2/source/controller/main/ChartController_Position.cxx
@@ -131,7 +131,7 @@ void ChartController::executeDispatch_PositionAndSize()
SfxItemSet aItemSet = m_pDrawViewWrapper->getPositionAndSizeItemSetFromMarkedObject();
//prepare and open dialog
- SdrView* pSdrView = m_pDrawViewWrapper;
+ SdrView* pSdrView = m_pDrawViewWrapper.get();
bool bResizePossible = m_aSelection.isResizeableObjectSelected();
SolarMutexGuard aGuard;
diff --git a/chart2/source/controller/main/ChartController_TextEdit.cxx b/chart2/source/controller/main/ChartController_TextEdit.cxx
index dfb94cc64725..acaac25d4668 100644
--- a/chart2/source/controller/main/ChartController_TextEdit.cxx
+++ b/chart2/source/controller/main/ChartController_TextEdit.cxx
@@ -209,7 +209,7 @@ uno::Reference< css::accessibility::XAccessibleContext >
ChartController::impl_createAccessibleTextContext()
{
uno::Reference< css::accessibility::XAccessibleContext > xResult(
- new AccessibleTextHelper( m_pDrawViewWrapper ));
+ new AccessibleTextHelper( m_pDrawViewWrapper.get() ));
return xResult;
}
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index 312d701c2add..a8269b760edf 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -361,7 +361,7 @@ void ChartController::impl_PasteGraphic(
}
//select new shape
m_aSelection.setSelection( xGraphicShape );
- m_aSelection.applySelection( m_pDrawViewWrapper );
+ m_aSelection.applySelection( m_pDrawViewWrapper.get() );
}
xGraphicShapeProp->setPropertyValue( "Graphic", uno::Any( xGraphic ));
uno::Reference< beans::XPropertySet > xGraphicProp( xGraphic, uno::UNO_QUERY );
@@ -427,7 +427,7 @@ void ChartController::impl_PasteShapes( SdrModel* pModel )
// select last inserted shape
m_aSelection.setSelection( xSelShape );
- m_aSelection.applySelection( m_pDrawViewWrapper );
+ m_aSelection.applySelection( m_pDrawViewWrapper.get() );
m_pDrawViewWrapper->EndUndo();
@@ -470,7 +470,7 @@ void ChartController::impl_PasteStringAsTextShape( const OUString& rString, cons
xTextShape->setPosition( rPosition );
m_aSelection.setSelection( xTextShape );
- m_aSelection.applySelection( m_pDrawViewWrapper );
+ m_aSelection.applySelection( m_pDrawViewWrapper.get() );
SdrObject* pObj = DrawViewWrapper::getSdrObject( xTextShape );
if ( pObj )
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index a7d12d1c5388..0bbe37e0cf5e 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -437,7 +437,7 @@ void SAL_CALL ChartController::removePaintListener(
void ChartController::PrePaint()
{
// forward VCLs PrePaint window event to DrawingLayer
- DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper;
+ DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper.get();
if (pDrawViewWrapper)
{
@@ -477,7 +477,7 @@ void ChartController::execute_Paint(vcl::RenderContext& rRenderContext, const to
{
SolarMutexGuard aGuard;
- DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper;
+ DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper.get();
if (pDrawViewWrapper)
pDrawViewWrapper->CompleteRedraw(&rRenderContext, vcl::Region(rRect));
}
@@ -557,7 +557,7 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt )
m_aSelection.remindSelectionBeforeMouseDown();
- DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper;
+ DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper.get();
auto pChartWindow(GetChartWindow());
if(!pChartWindow || !pDrawViewWrapper )
return;
@@ -707,7 +707,7 @@ void ChartController::execute_MouseMove( const MouseEvent& rMEvt )
{
SolarMutexGuard aGuard;
- DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper;
+ DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper.get();
auto pChartWindow(GetChartWindow());
if(!pChartWindow || !pDrawViewWrapper)
return;
@@ -735,7 +735,7 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
{
SolarMutexGuard aGuard;
- DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper;
+ DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper.get();
auto pChartWindow(GetChartWindow());
if(!pChartWindow || !pDrawViewWrapper)
return;
@@ -967,7 +967,7 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
auto pChartWindow(GetChartWindow());
bool bIsAction = false;
{
- DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper;
+ DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper.get();
if(!pChartWindow || !pDrawViewWrapper)
return;
bIsAction = m_pDrawViewWrapper->IsAction();
@@ -1306,7 +1306,7 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
SolarMutexGuard aGuard;
bool bReturn=false;
- DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper;
+ DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper.get();
auto pChartWindow(GetChartWindow());
if(!pChartWindow || !pDrawViewWrapper)
return bReturn;
@@ -1724,11 +1724,11 @@ void ChartController::impl_selectObjectAndNotiy()
{
{
SolarMutexGuard aGuard;
- DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper;
+ DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper.get();
if( pDrawViewWrapper )
{
pDrawViewWrapper->SetDragMode( m_eDragMode );
- m_aSelection.applySelection( m_pDrawViewWrapper );
+ m_aSelection.applySelection( m_pDrawViewWrapper.get() );
}
}
impl_notifySelectionChangeListeners();