diff options
author | Armin Le Grand <alg@apache.org> | 2012-10-22 14:15:22 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-05-20 09:31:15 +0100 |
commit | 3df12741fa949d1b0e90d45aceeaa99679066b83 (patch) | |
tree | 8961ff3613a828ad65deefdcf6446e794a5351b2 | |
parent | 869b787deeda5b45d5b0732d1bf777c26abce51e (diff) |
Resolves: #i116162# Forced DRAWMODE_WHITEFILL to DRAWMODE_BLACKFILL
during line geometry processing to get line geometry rendered black (as
intended) in b&w mode (e.g. print preview)
(cherry picked from commit e3ec94e68f63e4e9fda829c9214f89dd5ffc4df2)
Change-Id: I35fd6d26ac48bb478a8a3b9cd4f50ccd0e4468d0
-rw-r--r-- | drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx index 7ae4de94f676..706020b37dd3 100644 --- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx @@ -1306,8 +1306,34 @@ namespace drawinglayer &rStrokeArrowPrimitive.getStart(), &rStrokeArrowPrimitive.getEnd()); + // write LineGeometry start marker impStartSvtGraphicStroke(pSvtGraphicStroke); + + // #116162# When B&W is set as DrawMode, DRAWMODE_WHITEFILL is used + // to let all fills be just white; for lines DRAWMODE_BLACKLINE is used + // so all line geometry is supposed to get black. Since in the in-between + // stages of line geometry drawing filled polygons are used (e.g. line + // start/ends) it is necessary to change these drawmodes to preserve + // that lines shall be black; thus change DRAWMODE_WHITEFILL to + // DRAWMODE_BLACKFILL during line geometry processing to have line geometry + // parts filled black. + const sal_uLong nOldDrawMode(mpOutputDevice->GetDrawMode()); + const bool bDrawmodeChange(nOldDrawMode & DRAWMODE_WHITEFILL && mnSvtGraphicStrokeCount); + + if(bDrawmodeChange) + { + mpOutputDevice->SetDrawMode((nOldDrawMode & ~DRAWMODE_WHITEFILL) | DRAWMODE_BLACKFILL); + } + + // process sub-line geometry (evtl. filled PolyPolygons) process(rCandidate.get2DDecomposition(getViewInformation2D())); + + if(bDrawmodeChange) + { + mpOutputDevice->SetDrawMode(nOldDrawMode); + } + + // write LineGeometry end marker impEndSvtGraphicStroke(pSvtGraphicStroke); } |