diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-21 10:22:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-21 11:48:17 +0200 |
commit | eab3a2ffe1618e2beec820300abef1843c079bae (patch) | |
tree | 67f4a7ddb6edfcfaf21904b687900ab93b3a7f49 /sdext/source | |
parent | 9f5439e83f5506011f5b1d3acf01182a2b1f3e0e (diff) |
use weak_ptr properly
just call lock() instead of manually calling expired()
Change-Id: If76826fb62092b00fce25c53cf6be89b72d40c4f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92609
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Tested-by: Jenkins
Diffstat (limited to 'sdext/source')
-rw-r--r-- | sdext/source/presenter/PresenterScrollBar.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sdext/source/presenter/PresenterScrollBar.cxx b/sdext/source/presenter/PresenterScrollBar.cxx index 58a34d0f73f7..46f1490e38f3 100644 --- a/sdext/source/presenter/PresenterScrollBar.cxx +++ b/sdext/source/presenter/PresenterScrollBar.cxx @@ -241,7 +241,8 @@ void PresenterScrollBar::SetCanvas (const Reference<css::rendering::XCanvas>& rx if (mpBitmaps == nullptr) { - if (mpSharedBitmaps.expired()) + mpBitmaps = mpSharedBitmaps.lock(); + if (!mpBitmaps) { try { @@ -257,8 +258,6 @@ void PresenterScrollBar::SetCanvas (const Reference<css::rendering::XCanvas>& rx OSL_ASSERT(false); } } - else - mpBitmaps = std::shared_ptr<PresenterBitmapContainer>(mpSharedBitmaps); UpdateBitmaps(); UpdateBorders(); } |