Bugzilla – Attachment 98040 Details for
Bug 44731
PDF import problems with gradients and patterns
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Clipping patch (experimental)
pdf_import_clipping_patch_by_Vort.diff (text/plain), 2.39 KB, created by
vvort
on 2014-04-26 15:05:58 UTC
(
hide
)
Description:
Clipping patch (experimental)
Filename:
MIME Type:
Creator:
vvort
Created:
2014-04-26 15:05:58 UTC
Size:
2.39 KB
patch
obsolete
>diff --git a/sdext/source/pdfimport/tree/pdfiprocessor.cxx b/sdext/source/pdfimport/tree/pdfiprocessor.cxx >index 487ba20..477bf76 100644 >--- a/sdext/source/pdfimport/tree/pdfiprocessor.cxx >+++ b/sdext/source/pdfimport/tree/pdfiprocessor.cxx >@@ -448,16 +448,28 @@ void PDFIProcessor::strokePath( const uno::Reference< rendering::XPolyPolygon2D > > void PDFIProcessor::fillPath( const uno::Reference< rendering::XPolyPolygon2D >& rPath ) > { >- basegfx::B2DPolyPolygon aPoly=basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(rPath); >- aPoly.transform(getCurrentContext().Transformation); >+ GraphicsContext& gc = getCurrentContext(); > >- PolyPolyElement* pPoly = m_pElFactory->createPolyPolyElement( >- m_pCurElement, >- getGCId(getCurrentContext()), >- aPoly, >- PATH_FILL ); >- pPoly->updateGeometry(); >- pPoly->ZOrder = m_nNextZOrder++; >+ if (gc.Clip.count() == 0) >+ return; >+ >+ basegfx::B2DPolyPolygon aPoly = >+ basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(rPath); >+ aPoly.transform(gc.Transformation); >+ >+ aPoly = basegfx::tools::clipPolyPolygonOnPolyPolygon( >+ aPoly, gc.Clip, true, false); >+ >+ if (aPoly.count() == 0) >+ return; >+ >+ PolyPolyElement* pPoly = m_pElFactory->createPolyPolyElement( >+ m_pCurElement, >+ getGCId(gc), >+ aPoly, >+ PATH_FILL); >+ pPoly->updateGeometry(); >+ pPoly->ZOrder = m_nNextZOrder++; > } > > void PDFIProcessor::eoFillPath( const uno::Reference< rendering::XPolyPolygon2D >& rPath ) >@@ -476,13 +488,17 @@ void PDFIProcessor::eoFillPath( const uno::Reference< rendering::XPolyPolygon2D > > void PDFIProcessor::intersectClip(const uno::Reference< rendering::XPolyPolygon2D >& rPath) > { >+ if (getCurrentContext().Clip.count() == 0) >+ return; >+ > // TODO(F3): interpret fill mode >- basegfx::B2DPolyPolygon aNewClip = basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(rPath); >+ basegfx::B2DPolyPolygon aNewClip = >+ basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(rPath); > aNewClip.transform(getCurrentContext().Transformation); > basegfx::B2DPolyPolygon aCurClip = getCurrentContext().Clip; > >- if( aCurClip.count() ) // #i92985# adapted API from (..., false, false) to (..., true, false) >- aNewClip = basegfx::tools::clipPolyPolygonOnPolyPolygon( aCurClip, aNewClip, true, false ); >+ aNewClip = basegfx::tools::clipPolyPolygonOnPolyPolygon( >+ aCurClip, aNewClip, true, false); > > getCurrentContext().Clip = aNewClip; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 44731
:
55501
|
55502
|
55503
|
98038
|
98039
| 98040 |
135945
|
135946
|
135948
|
135949
|
135951
|
135952
|
135953
|
135954
|
153612