diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-05-22 21:41:31 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-05-30 09:41:23 +0200 |
commit | 67338c3c91b8a47543d1a79c4d245d2d70f2df62 (patch) | |
tree | d83ecfec765bc23681c86eed659623bb6b033acb /vcl | |
parent | 6ef1aea8bd6040fd2b57c8330a5691d340a78ca2 (diff) |
tdf#107868 PDF export of editeng fill color: restrict to logic map modes
The original use case was Writer/Impress shape text, but when the map
mode is pixels, the reference device gives bogus values for the
PixelToLogic() calls, affecting e.g. form controls.
Just go back to the old way of not painting the background for those.
(cherry picked from commit 919a4ef592b6026a7533a93682f39118fef29ce8)
Conflicts:
vcl/qa/cppunit/pdfexport/pdfexport.cxx
Change-Id: I52f1901af15732274915fa3c77c06909b5164afb
Reviewed-on: https://gerrit.libreoffice.org/37977
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit f6a66846f50132fab7be6baf516ab6af04acf7e5)
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index a6ced4d62952..8c3575cdca14 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -9548,7 +9548,10 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool } } - if (m_aCurrentPDFState.m_aFont.GetFillColor() != Color(COL_TRANSPARENT)) + // Avoid fill color when map mode is in pixels, the below code assumes + // logic map mode. + bool bPixel = m_aCurrentPDFState.m_aMapMode.GetMapUnit() == MapUnit::MapPixel; + if (m_aCurrentPDFState.m_aFont.GetFillColor() != Color(COL_TRANSPARENT) && !bPixel) { // PDF doesn't have a text fill color, so draw a rectangle before // drawing the actual text. |