diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-20 09:04:30 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-22 07:34:12 +0100 |
commit | e1315724322e0bcacb9c8fe25e3385ebd94ed505 (patch) | |
tree | 2e2d3d708429fc90d4682553a98a39bb3e5c7764 | |
parent | cc2c1d9525baa5746ee58bb4cb6b0b62eca20a51 (diff) |
loplugin:useuniqueptr in SwAccessibleMap
Change-Id: I47b64b30123918fb0d8251ae7ba113775cfb3625
Reviewed-on: https://gerrit.libreoffice.org/51664
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sw/inc/accmap.hxx | 4 | ||||
-rw-r--r-- | sw/source/core/access/accmap.cxx | 8 |
2 files changed, 5 insertions, 7 deletions
diff --git a/sw/inc/accmap.hxx b/sw/inc/accmap.hxx index 975c01f559b9..5ed3fcfae7e3 100644 --- a/sw/inc/accmap.hxx +++ b/sw/inc/accmap.hxx @@ -104,7 +104,7 @@ class SwAccessibleMap : public ::accessibility::IAccessibleViewForwarder, SwViewShell *mpVSh; /// for page preview: store preview data, VisArea, and mapping of /// preview-to-display coordinates - SwAccPreviewData* mpPreview; + std::unique_ptr<SwAccPreviewData> mpPreview; css::uno::WeakReference < css::accessibility::XAccessible > mxCursorContext; @@ -120,7 +120,7 @@ class SwAccessibleMap : public ::accessibility::IAccessibleViewForwarder, void InvalidateShapeSelection(); //mpSelectedFrameMap contains the old selected objects. - SwAccessibleContextMap_Impl *mpSeletedFrameMap; + std::unique_ptr<SwAccessibleContextMap_Impl> mpSeletedFrameMap; OUString maDocName; diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index 215985502de2..dbfa3a76f9a3 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -1361,7 +1361,7 @@ void SwAccessibleMap::InvalidateShapeInParaSelection() } } if( !mpSeletedFrameMap ) - mpSeletedFrameMap = new SwAccessibleContextMap_Impl; + mpSeletedFrameMap.reset( new SwAccessibleContextMap_Impl ); if( !mpSeletedFrameMap->empty() ) { SwAccessibleContextMap_Impl::iterator aIter = mpSeletedFrameMap->begin(); @@ -1705,8 +1705,7 @@ SwAccessibleMap::~SwAccessibleMap() mpSelectedParas = nullptr; } - delete mpPreview; - mpPreview = nullptr; + mpPreview.reset(); { osl::MutexGuard aGuard( maEventMutex ); @@ -1718,7 +1717,6 @@ SwAccessibleMap::~SwAccessibleMap() mpEvents = nullptr; } mpVSh->GetLayout()->RemoveAccessibleShell(); - delete mpSeletedFrameMap; } uno::Reference< XAccessible > SwAccessibleMap::GetDocumentView_( @@ -1796,7 +1794,7 @@ uno::Reference<XAccessible> SwAccessibleMap::GetDocumentPreview( { // create & update preview data object if( mpPreview == nullptr ) - mpPreview = new SwAccPreviewData(); + mpPreview.reset( new SwAccPreviewData() ); mpPreview->Update( *this, _rPreviewPages, _rScale, _pSelectedPageFrame, _rPreviewWinSize ); uno::Reference<XAccessible> xAcc = GetDocumentView_( true ); |