From 3bbfbed375ffaa9ad5b0e857ef6c57575298baed Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 10 Oct 2014 09:37:38 +0200 Subject: cid#1244941 Invalid iterator comparison this is just a false+, but creating a local var will likely fix it Change-Id: Ia02e04098a70102c70f5fe5ecd156eea6f40d2af --- writerfilter/source/dmapper/DomainMapper_Impl.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index fbfae7c1a85e..f49a14f3a2b8 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1664,13 +1664,19 @@ void DomainMapper_Impl::CheckRedline( uno::Reference< text::XTextRange > const& // Create the redlines here from lowest (formats) to highest (inserts/removals) priority, since the last one is // what Writer presents graphically, so this will show deletes as deleted text and not as just formatted text being there. if( GetTopContextOfType(CONTEXT_PARAGRAPH) ) - for( std::vector::const_iterator it = GetTopContextOfType(CONTEXT_PARAGRAPH)->Redlines().begin(); - it != GetTopContextOfType(CONTEXT_PARAGRAPH)->Redlines().end(); ++it ) + { + std::vector& avRedLines = GetTopContextOfType(CONTEXT_PARAGRAPH)->Redlines(); + for( std::vector::const_iterator it = avRedLines.begin(); + it != avRedLines.end(); ++it ) CreateRedline( xRange, *it ); + } if( GetTopContextOfType(CONTEXT_CHARACTER) ) - for( std::vector::const_iterator it = GetTopContextOfType(CONTEXT_CHARACTER)->Redlines().begin(); - it != GetTopContextOfType(CONTEXT_CHARACTER)->Redlines().end(); ++it ) + { + std::vector& avRedLines = GetTopContextOfType(CONTEXT_CHARACTER)->Redlines(); + for( std::vector::const_iterator it = avRedLines.begin(); + it != avRedLines.end(); ++it ) CreateRedline( xRange, *it ); + } std::vector::iterator pIt = m_aRedlines.top().begin( ); for (; pIt != m_aRedlines.top().end( ); ++pIt ) CreateRedline( xRange, *pIt ); -- cgit