From b37becd401e342bf658f9e9be69dbf7385781f45 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 20 Apr 2012 16:45:12 +0200 Subject: [PATCH] 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 b35980d9b28f1e3985f94238f7d8c9962f654bd0) --- editeng/source/editeng/editdoc.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index c24e72bb592d..23549a776666 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -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())