CharAttribList::OptimizeRanges: de-optimize to not crash so fast

Crashes on import of bugdoc from fdo#48969 with
 Assertion `n < this->size()' failed.
(regression from b35980d9b2)
This commit is contained in:
Michael Stahl 2012-04-20 16:45:12 +02:00
parent 1b62ccdcb5
commit b37becd401

View file

@ -2682,10 +2682,10 @@ void CharAttribList::ResortAttribs()
void CharAttribList::OptimizeRanges( SfxItemPool& rItemPool )
{
for (size_t i = 0, n = aAttribs.size(); i < n; ++i)
for (size_t i = 0; i < aAttribs.size(); ++i)
{
EditCharAttrib& rAttr = aAttribs[i];
for (size_t nNext = i+1; nNext < n; ++nNext)
for (size_t nNext = i+1; nNext < aAttribs.size(); ++nNext)
{
EditCharAttrib& rNext = aAttribs[nNext];
if (!rAttr.IsFeature() && rNext.GetStart() == rAttr.GetEnd() && rNext.Which() == rAttr.Which())