sw/source/core/doc/doc.cxx |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

New commits:
commit 15e32eb2a8c817e31e9bcaf3832a503f6b488200
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Apr 18 16:46:03 2019 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Apr 18 18:25:52 2019 +0200

    don't use SwSectionFormats here
    
    since SwSectionFormats wants to own the things it points to, and we
    don't want to own here. The only reason it was working is because we
    call clear() on the horrible SwVectorModifyBase base class here, which
    removes the pointers without deleting the pointed-to objects.
    
    Change-Id: I8aba61e74ce1463ff4be439c0feb830d1aa8988e
    Reviewed-on: https://gerrit.libreoffice.org/70940
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 6d2841fc6be3..77408b4e9f53 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1467,7 +1467,7 @@ bool SwDoc::RemoveInvisibleContent()
 
     {
         // Delete/empty all hidden areas
-        SwSectionFormats aSectFormats;
+        o3tl::sorted_vector<SwSectionFormat*> aSectFormats;
         SwSectionFormats& rSectFormats = GetSections();
 
         for( SwSectionFormats::size_type n = rSectFormats.size(); n; )
@@ -1487,10 +1487,7 @@ bool SwDoc::RemoveInvisibleContent()
                     pParent = pTmp;
                 }
 
-                SwSectionFormats::iterator it = std::find(
-                        aSectFormats.begin(), aSectFormats.end(), 
pSect->GetFormat() );
-                if (it == aSectFormats.end())
-                    aSectFormats.insert( aSectFormats.begin(), 
pSect->GetFormat() );
+                aSectFormats.insert( pSect->GetFormat() );
             }
             if( !pSect->GetCondition().isEmpty() )
             {
@@ -1501,7 +1498,7 @@ bool SwDoc::RemoveInvisibleContent()
             }
         }
 
-        SwSectionFormats::size_type n = aSectFormats.size();
+        auto n = aSectFormats.size();
 
         if( 0 != n )
         {
@@ -1541,7 +1538,6 @@ bool SwDoc::RemoveInvisibleContent()
 
                 }
             }
-            aSectFormats.clear();
         }
     }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to