diff options
author | Oliver Bolte <obo@openoffice.org> | 2005-04-20 09:51:17 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2005-04-20 09:51:17 +0000 |
commit | 9b16eaacbaf24b7204b32fe5a4adbac1857653c8 (patch) | |
tree | c644a5a4593bd3b525e357839ff43088293e6527 /vcl/source | |
parent | 3feb0520d07b420d01f0185ea6ea07a4686bbb04 (diff) |
INTEGRATION: CWS vclshowstop03 (1.80.26); FILE MERGED
2005/04/18 17:12:13 pl 1.80.26.1: #i47544# mimic OutputDevice font color behaviour
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index adfae87d24ee..c663660d54f8 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: pdfwriter_impl.cxx,v $ * - * $Revision: 1.80 $ + * $Revision: 1.81 $ * - * last change: $Author: rt $ $Date: 2005-03-30 09:06:52 $ + * last change: $Author: obo $ $Date: 2005-04-20 10:51:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -7802,6 +7802,20 @@ void PDFWriterImpl::updateGraphicsState() writeBuffer( aLine.getStr(), aLine.getLength() ); } +/* #i47544# imitate OutputDevice behaviour: +* if a font with a nontransparent color is set, it overwrites the current +* text color. OTOH setting the text color will overwrite the color of the font. +*/ +void PDFWriterImpl::setFont( const Font& rFont ) +{ + Color aColor = rFont.GetColor(); + if( aColor == Color( COL_TRANSPARENT ) ) + aColor = m_aGraphicsStack.front().m_aFont.GetColor(); + m_aGraphicsStack.front().m_aFont = rFont; + m_aGraphicsStack.front().m_aFont.SetColor( aColor ); + m_aGraphicsStack.front().m_nUpdateFlags |= GraphicsState::updateFont; +} + void PDFWriterImpl::push( sal_uInt16 nFlags ) { m_aGraphicsStack.push_front( m_aGraphicsStack.front() ); @@ -7822,6 +7836,8 @@ void PDFWriterImpl::pop() setFillColor( aState.m_aFillColor ); if( ! (aState.m_nFlags & PUSH_FONT) ) setFont( aState.m_aFont ); + if( ! (aState.m_nFlags & PUSH_TEXTCOLOR) ) + setTextColor( aState.m_aFont.GetColor() ); if( ! (aState.m_nFlags & PUSH_MAPMODE) ) setMapMode( aState.m_aMapMode ); if( ! (aState.m_nFlags & PUSH_CLIPREGION) ) |