sw/source/core/inc/viewimp.hxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1a3bfd3af113da246b0327e5cc816542682f90ba
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Mon May 15 21:09:05 2023 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Tue May 16 14:08:20 2023 +0200

    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.mcnam...@collabora.com>

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(); }
 

Reply via email to