diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-05-15 21:09:05 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-05-16 14:08:20 +0200 |
commit | 1a3bfd3af113da246b0327e5cc816542682f90ba (patch) | |
tree | 6459613d43fd1db0f968da3088bd2d652128be87 | |
parent | c01639c556276e496d9e762468cad6b27f9ed0f4 (diff) |
tdf#155349 std::move of a std::optional leave behind a set std::optional
unlike std::move of a std::unique_ptr which leaves behind an empty
std::unique_ptr
so if HasPaintRegion was true before TakePaintRegion it was
still true after TakePaintRegion
Change-Id: I6569f5ccd8081cbcec42190c474a98c4e28030a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151807
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
-rw-r--r-- | sw/source/core/inc/viewimp.hxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx index f68c9c7f1f90..4b249154c2f8 100644 --- a/sw/source/core/inc/viewimp.hxx +++ b/sw/source/core/inc/viewimp.hxx @@ -152,7 +152,7 @@ public: bool AddPaintRect( const SwRect &rRect ); bool HasPaintRegion() { return m_oPaintRegion.has_value(); } - std::optional<SwRegionRects> TakePaintRegion() { return std::move(m_oPaintRegion); } + std::optional<SwRegionRects> TakePaintRegion() { auto ret = std::move(m_oPaintRegion); m_oPaintRegion.reset(); return ret; } const std::optional<SwRegionRects>& GetPaintRegion() { return m_oPaintRegion; } void DeletePaintRegion() { m_oPaintRegion.reset(); } |