summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2018-03-21 16:54:10 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-03-21 18:31:53 +0100
commitb94a66ebc8db6c5ca9c7dcfdfbb06b49deae4939 (patch)
tree9bc490e09c28bdd3092fed7073cfec8711102839 /vcl/inc
parentc75705b2306d3fd41e71eb4613773b62bdaa9ca5 (diff)
tdf#115117: Fix PDF ToUnicode CMAP for ligatures
Move the glyph to character(s) mapping to CommonSalLayout where we have enough information to do this properly. This correctly handles ligatures at end of run that wasn’t handled before, and also fixes a bug in the PDF writer code when there is more than one ligature in the run (it forgot to clear aCodeUnitsPerGlyph vector after each iteration). Also drop the “temporary” fix for rotated glyph from 2009 that does not seem to be needed now (the document from that bug exports correctly after this change). Change-Id: I5b5b1f4470bbd0ef05cbbc86dfa29d2ff51249ea Reviewed-on: https://gerrit.libreoffice.org/51617 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/sallayout.hxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx
index b1037bc684ef..962f0f6905ac 100644
--- a/vcl/inc/sallayout.hxx
+++ b/vcl/inc/sallayout.hxx
@@ -255,6 +255,7 @@ struct GlyphItem
{
int mnFlags;
int mnCharPos; // index in string
+ int mnCharCount; // number of characters making up this glyph
int mnOrigWidth; // original glyph width
int mnNewWidth; // width after adjustments
@@ -270,6 +271,7 @@ public:
long nFlags, int nOrigWidth )
: mnFlags(nFlags)
, mnCharPos(nCharPos)
+ , mnCharCount(1)
, mnOrigWidth(nOrigWidth)
, mnNewWidth(nOrigWidth)
, mnXOffset(0)
@@ -278,10 +280,11 @@ public:
, mnFallbackLevel(0)
{ }
- GlyphItem( int nCharPos, sal_GlyphId aGlyphId, const Point& rLinearPos,
+ GlyphItem(int nCharPos, int nCharCount, sal_GlyphId aGlyphId, const Point& rLinearPos,
long nFlags, int nOrigWidth, int nXOffset )
: mnFlags(nFlags)
, mnCharPos(nCharPos)
+ , mnCharCount(nCharCount)
, mnOrigWidth(nOrigWidth)
, mnNewWidth(nOrigWidth)
, mnXOffset(nXOffset)