sw/source/core/bastyp/swregion.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit c103294b733961e9ddc551b9b97b9b605ef0e09a
Author:     Mo Amr <[email protected]>
AuthorDate: Thu Feb 12 13:16:21 2026 +0000
Commit:     Hossein <[email protected]>
CommitDate: Sun Feb 15 11:09:53 2026 +0100

    tdf#158337 use C++20 std::erase_if in sw
    
    Use C++20 std::erase_if instead of std::remove_if and resize to simplify
    
    Change-Id: I30341b66927ad4ddbb63a8b1ca66191a2d499070
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199273
    Tested-by: Jenkins
    Reviewed-by: Hossein <[email protected]>

diff --git a/sw/source/core/bastyp/swregion.cxx 
b/sw/source/core/bastyp/swregion.cxx
index b790bf14764f..97e271811ab8 100644
--- a/sw/source/core/bastyp/swregion.cxx
+++ b/sw/source/core/bastyp/swregion.cxx
@@ -17,6 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
 #include <swrect.hxx>
 #include <swregion.hxx>
 #include <swtypes.hxx>
@@ -218,7 +220,7 @@ void SwRegionRects::Compress( CompressType type )
         // Instead of repeated erase() we Width(0) the elements, and now erase
         // all empty elements just once.
         if( bRemoved )
-            resize( std::remove_if(begin(), end(), [](const SwRect& rect) { 
return rect.IsEmpty(); }) - begin());
+            std::erase_if(*this , [](const SwRect& rect) { return 
rect.IsEmpty(); }) ;
         // Code paths setting bAgain alter elements of the vector, possibly 
breaking
         // the Y-axis optimization, so run another pass just to make sure. The 
adjacent-rects
         // merging code may possibly benefit from a repeated pass also if two 
pairs of merged

Reply via email to