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/+/151774
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Tested-by: Michael Stahl <michael.stahl@allotropia.de>
diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx
index f68c9c7..4b24915 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(); }