Kaydet (Commit) 15e32eb2 authored tarafından Noel Grandin's avatar Noel Grandin

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: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst a606fc64
......@@ -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();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment