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 /vcl/source/app/settings.cxx | |
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 'vcl/source/app/settings.cxx')
-rw-r--r-- | vcl/source/app/settings.cxx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 5429c20a400c..883bde42e80a 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -488,7 +488,8 @@ MouseSettings::~MouseSettings() void MouseSettings::CopyData() { // copy if other references exist - if ( ! mxData.unique() ) { + if (mxData.use_count() > 1) + { mxData = std::make_shared<ImplMouseData>(*mxData); } } @@ -2249,7 +2250,8 @@ Color StyleSettings::GetSeparatorColor() const void StyleSettings::CopyData() { // copy if other references exist - if ( ! mxData.unique() ) { + if (mxData.use_count() > 1) + { mxData = std::make_shared<ImplStyleData>(*mxData); } } @@ -2552,7 +2554,8 @@ void MiscSettings::SetEnableATToolSupport( bool bEnable ) void MiscSettings::SetEnableLocalizedDecimalSep( bool bEnable ) { // copy if other references exist - if ( ! mxData.unique() ) { + if (mxData.use_count() > 1) + { mxData = std::make_shared<ImplMiscData>(*mxData); } mxData->mbEnableLocalizedDecimalSep = bEnable; @@ -2611,7 +2614,8 @@ void HelpSettings::SetTipTimeout( sal_uLong nTipTimeout ) { // copy if other references exist - if ( ! mxData.unique() ) { + if (mxData.use_count() > 1) + { mxData = std::make_shared<ImplHelpData>(*mxData); } mxData->mnTipTimeout = nTipTimeout; @@ -2693,7 +2697,8 @@ AllSettings::~AllSettings() void AllSettings::CopyData() { // copy if other references exist - if ( ! mxData.unique() ) { + if (mxData.use_count() > 1) + { mxData = std::make_shared<ImplAllSettingsData>(*mxData); } |