From f6a66846f50132fab7be6baf516ab6af04acf7e5 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 22 May 2017 21:41:31 +0200 Subject: tdf#107868 PDF export of editeng fill color: restrict to logic map modes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- vcl/source/gdi/pdfwriter_impl.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 9e592a71b977..28fb58db826f 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -9424,7 +9424,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. -- cgit v1.2.3