summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-09-11 22:38:49 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-09-12 09:12:13 +0200
commitda705eff910f512623a689aaf28604270fb8f1c4 (patch)
treecf58069487ef5e55446999438593935f811bfb3d /vcl/source
parent7281f4a73ec3679798a6271ab5a0ad839f278e37 (diff)
tdf#108963 PDF export of editeng text highlight: handle rotated text
The highlight rectangle was not rotated, handle it similar to PDFWriterImpl::drawStrikeoutChar(). Change-Id: I97a5b1fc05706729c58c92b90d6808629af8ca4c Reviewed-on: https://gerrit.libreoffice.org/42180 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 9e3db7068a25..d10671e50cb2 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -6807,7 +6807,17 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool
aRectangle.SetSize(m_pReferenceDevice->PixelToLogic(Size(rLayout.GetTextWidth(), 0)));
// This includes ascent / descent.
aRectangle.setHeight(aRefDevFontMetric.GetLineHeight());
- drawRectangle(aRectangle);
+
+ LogicalFontInstance* pFontInstance = m_pReferenceDevice->mpFontInstance;
+ if (pFontInstance->mnOrientation)
+ {
+ // Adapt rectangle for rotated text.
+ tools::Polygon aPolygon(aRectangle);
+ aPolygon.Rotate(m_pReferenceDevice->PixelToLogic(rLayout.GetDrawPosition()), pFontInstance->mnOrientation);
+ drawPolygon(aPolygon);
+ }
+ else
+ drawRectangle(aRectangle);
pop();
}