summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-05-22 21:41:31 +0200
committerCaolán McNamara <caolanm@redhat.com>2017-05-25 21:46:23 +0200
commitf6a66846f50132fab7be6baf516ab6af04acf7e5 (patch)
treebcfb0335a602091097597294c9b14b553d003186
parent398ab416bd552162131e74751e48d266a1f31ee9 (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>
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx5
1 files changed, 4 insertions, 1 deletions
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.