diff options
author | Michael Stahl <mstahl@redhat.com> | 2018-01-19 21:00:16 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2018-01-22 09:32:52 +0100 |
commit | 0a0cf00b173d3207ae167b256e496d005615f1ee (patch) | |
tree | 3c3a9b12e6bdb8ef1e72a28e0a7bf517d2da7ec5 /sd | |
parent | 41abd684a6d1f3da71084fd854f66e22cb171b9d (diff) |
C++17 deprecated std::shared_ptr::unique()
Most of these calls are in assertions, and the ones that aren't should
be guarded by SolarMutex, so the thread safety concerns that caused
unique() to be deprecated don't look relevant, so use use_count(),
which oddly enough isn't deprecated.
Change-Id: Ia166615af6c3ce85145c391752669c7461bd35fb
Reviewed-on: https://gerrit.libreoffice.org/48222
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sd')
4 files changed, 5 insertions, 5 deletions
diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx b/sd/source/ui/framework/factories/BasicViewFactory.cxx index e7fd347f8699..34ac40176dce 100644 --- a/sd/source/ui/framework/factories/BasicViewFactory.cxx +++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx @@ -122,7 +122,7 @@ void SAL_CALL BasicViewFactory::disposing() // ViewShellContainer::const_iterator iView; for (iView=mpViewShellContainer->begin(); iView!=mpViewShellContainer->end(); ++iView) { - OSL_ASSERT((*iView)->mpViewShell.unique()); + OSL_ASSERT((*iView)->mpViewShell.use_count() == 1); } mpViewShellContainer.reset(); } diff --git a/sd/source/ui/slidesorter/model/SlideSorterModel.cxx b/sd/source/ui/slidesorter/model/SlideSorterModel.cxx index bdf10c4afdb7..2d22459ed1e7 100644 --- a/sd/source/ui/slidesorter/model/SlideSorterModel.cxx +++ b/sd/source/ui/slidesorter/model/SlideSorterModel.cxx @@ -323,7 +323,7 @@ void SlideSorterModel::ClearDescriptorList() { if (iDescriptor->get() != nullptr) { - if ( ! iDescriptor->unique()) + if (iDescriptor->use_count() > 1) { SAL_INFO( "sd.sls", diff --git a/sd/source/ui/slidesorter/view/SlideSorterView.cxx b/sd/source/ui/slidesorter/view/SlideSorterView.cxx index 5ebdb0d4849f..0a4998df6f22 100644 --- a/sd/source/ui/slidesorter/view/SlideSorterView.cxx +++ b/sd/source/ui/slidesorter/view/SlideSorterView.cxx @@ -198,7 +198,7 @@ void SlideSorterView::Dispose() // Deletion of the objects and the page will be done in SdrModel // destructor (as long as objects and pages are added) - OSL_ASSERT(mpLayeredDevice.unique()); + OSL_ASSERT(mpLayeredDevice.use_count() == 1); mpLayeredDevice.reset(); mbIsDisposed = true; diff --git a/sd/source/ui/tools/SdGlobalResourceContainer.cxx b/sd/source/ui/tools/SdGlobalResourceContainer.cxx index f04b5f4a4c99..a8c07915b54c 100644 --- a/sd/source/ui/tools/SdGlobalResourceContainer.cxx +++ b/sd/source/ui/tools/SdGlobalResourceContainer.cxx @@ -176,12 +176,12 @@ SdGlobalResourceContainer::~SdGlobalResourceContainer() iSharedResource != mpImpl->maSharedResources.rend(); ++iSharedResource) { - if ( ! iSharedResource->unique()) + if (iSharedResource->use_count() > 1) { SdGlobalResource* pResource = iSharedResource->get(); SAL_INFO( "sd.tools", pResource << " " << iSharedResource->use_count()); - DBG_ASSERT(iSharedResource->unique(), + DBG_ASSERT(iSharedResource->use_count() == 1, "SdGlobalResource still held in ~SdGlobalResourceContainer"); } } |