diff options
author | Noel Grandin <noel@peralex.com> | 2015-06-19 10:55:44 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-06-19 10:56:11 +0200 |
commit | 7d69c94104ef60d4c9f08274136067b6120fa23e (patch) | |
tree | a23c765b67e02a3372fe0790c78db279b478178f /sdext/source | |
parent | 4f1587965e85e09796c2074d90e9067337f2b710 (diff) |
fix older compiler
after my commit e0f3e7c007e9eeced888b491ec2698acba4bc588
"tdf#42374 some small optimisations for opening this PDF file"
Change-Id: Ib9dc0aaf3ad2afca272160a934049d89bbd54175
Diffstat (limited to 'sdext/source')
-rw-r--r-- | sdext/source/pdfimport/tree/drawtreevisiting.cxx | 69 |
1 files changed, 35 insertions, 34 deletions
diff --git a/sdext/source/pdfimport/tree/drawtreevisiting.cxx b/sdext/source/pdfimport/tree/drawtreevisiting.cxx index 832d35569630..9c19aa4cd7bb 100644 --- a/sdext/source/pdfimport/tree/drawtreevisiting.cxx +++ b/sdext/source/pdfimport/tree/drawtreevisiting.cxx @@ -418,42 +418,43 @@ void DrawXmlOptimizer::visit( PolyPolyElement& elem, const std::list< Element* > if( next_it == elem.Parent->Children.end() ) return; - PolyPolyElement* pNext = dynamic_cast<PolyPolyElement*>(*next_it); - // TODO(F2): this comparison fails for OOo-generated polygons with beziers. - if( !pNext || pNext->PolyPoly != elem.PolyPoly ) + PolyPolyElement* pNext = dynamic_cast<PolyPolyElement*>(*next_it); + // TODO(F2): this comparison fails for OOo-generated polygons with beziers. + 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 && - rThisGC.FillColor.Red == rNextGC.FillColor.Red && - rThisGC.FillColor.Green== rNextGC.FillColor.Green && - rThisGC.FillColor.Blue == rNextGC.FillColor.Blue && - rThisGC.FillColor.Alpha== rNextGC.FillColor.Alpha && - 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 && + rThisGC.FillColor.Red == rNextGC.FillColor.Red && + rThisGC.FillColor.Green== rNextGC.FillColor.Green && + rThisGC.FillColor.Blue == rNextGC.FillColor.Blue && + rThisGC.FillColor.Alpha== rNextGC.FillColor.Alpha && + 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 ); + std::list< Element* > tmp; + tmp.splice( tmp.begin(), elem.Parent->Children, next_it, next_it); + delete pNext; + } } void DrawXmlOptimizer::visit( ParagraphElement& elem, const std::list< Element* >::const_iterator& ) |