sdext/source/pdfimport/tree/writertreevisiting.cxx | 56 ++++++++++----------- 1 file changed, 29 insertions(+), 27 deletions(-)
New commits: commit 9bc57ae7669fcdde4827f9a8e0a52cc6101c78c1 Author: Noel Grandin <[email protected]> Date: Fri Jun 19 11:13:48 2015 +0200 fix older compiler after my commit e0f3e7c007e9eeced888b491ec2698acba4bc588 "tdf#42374 some small optimisations for opening this PDF file" Change-Id: I908770ca618581ffe26ebb2205b804d1abcae5a7 diff --git a/sdext/source/pdfimport/tree/writertreevisiting.cxx b/sdext/source/pdfimport/tree/writertreevisiting.cxx index 0844c6e..73d4d19 100644 --- a/sdext/source/pdfimport/tree/writertreevisiting.cxx +++ b/sdext/source/pdfimport/tree/writertreevisiting.cxx @@ -378,33 +378,35 @@ void WriterXmlOptimizer::visit( PolyPolyElement& elem, const std::list< Element* if( !pNext || pNext->PolyPoly != elem.PolyPoly ) return; - const GraphicsContext& rNextGC = - m_rProcessor.getGraphicsContext( pNext->GCId ); - const GraphicsContext& rThisGC = - m_rProcessor.getGraphicsContext( elem.GCId ); - - if( rThisGC.BlendMode == rNextGC.BlendMode && - rThisGC.Flatness == rNextGC.Flatness && - rThisGC.Transformation == rNextGC.Transformation && - rThisGC.Clip == rNextGC.Clip && - pNext->Action == PATH_STROKE && - (elem.Action == PATH_FILL || elem.Action == PATH_EOFILL) ) - { - GraphicsContext aGC = rThisGC; - aGC.LineJoin = rNextGC.LineJoin; - aGC.LineCap = rNextGC.LineCap; - aGC.LineWidth = rNextGC.LineWidth; - aGC.MiterLimit= rNextGC.MiterLimit; - aGC.DashArray = rNextGC.DashArray; - aGC.LineColor = rNextGC.LineColor; - elem.GCId = m_rProcessor.getGCId( aGC ); - - elem.Action |= pNext->Action; - - elem.Children.splice( elem.Children.end(), pNext->Children ); - elem.Parent->Children.erase( next_it ); - delete pNext; - } + const GraphicsContext& rNextGC = + m_rProcessor.getGraphicsContext( pNext->GCId ); + const GraphicsContext& rThisGC = + m_rProcessor.getGraphicsContext( elem.GCId ); + + if( rThisGC.BlendMode == rNextGC.BlendMode && + rThisGC.Flatness == rNextGC.Flatness && + rThisGC.Transformation == rNextGC.Transformation && + rThisGC.Clip == rNextGC.Clip && + pNext->Action == PATH_STROKE && + (elem.Action == PATH_FILL || elem.Action == PATH_EOFILL) ) + { + GraphicsContext aGC = rThisGC; + aGC.LineJoin = rNextGC.LineJoin; + aGC.LineCap = rNextGC.LineCap; + aGC.LineWidth = rNextGC.LineWidth; + aGC.MiterLimit= rNextGC.MiterLimit; + aGC.DashArray = rNextGC.DashArray; + aGC.LineColor = rNextGC.LineColor; + elem.GCId = m_rProcessor.getGCId( aGC ); + + elem.Action |= pNext->Action; + + elem.Children.splice( elem.Children.end(), pNext->Children ); + // workaround older compilers that do not have std::list::erase(const_iterator) + std::list< Element* > tmp; + tmp.splice( tmp.begin(), elem.Parent->Children, next_it, next_it); + delete pNext; + } } void WriterXmlOptimizer::visit( ParagraphElement& elem, const std::list< Element* >::const_iterator& rParentIt) _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
