~matttbe/ubuntu/raring/poppler/lp1072129

« back to all changes in this revision

Viewing changes to poppler/TextOutputDev.cc

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2011-12-05 17:23:02 UTC
  • mfrom: (1.7.1)
  • Revision ID: package-import@ubuntu.com-20111205172302-tmhrk7s9hikjsa79
Tags: 0.18.2-0ubuntu1
* New upstream version, bugs fixed in the new version (lp: #869850):
  - lines and graphics wrongly rendered (lp: #603929) (lp: #780169)
  - rendering issues on some documents (lp: #784154)
  - some pages are displayed blank (lp: #817626)
* debian/control, debian/rules:
  - updated for the libpoppler and libpoppler-glib soname changes
* drop patches included in the new version
* debian/libpoppler-glib-dev.install:
  - drop deprecated test-poppler-glib
* debian/rules: 
  - drop deprecated qt3 and abiword configure options

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
//
11
11
// Modified under the Poppler project - http://poppler.freedesktop.org
12
12
//
 
13
// All changes made under the Poppler project to this file are licensed
 
14
// under GPL version 2 or later
 
15
//
13
16
// Copyright (C) 2005-2007 Kristian Høgsberg <krh@redhat.com>
14
17
// Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru>
15
 
// Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org>
 
18
// Copyright (C) 2006-2008, 2011 Carlos Garcia Campos <carlosgc@gnome.org>
16
19
// Copyright (C) 2006, 2007 Ed Catmur <ed@catmur.co.uk>
17
20
// Copyright (C) 2006 Jeff Muizelaar <jeff@infidigm.net>
18
21
// Copyright (C) 2007, 2008 Adrian Johnson <ajohnson@redneon.com>
19
22
// Copyright (C) 2008 Koji Otani <sho@bbr.jp>
20
 
// Copyright (C) 2008, 2010 Albert Astals Cid <aacid@kde.org>
 
23
// Copyright (C) 2008, 2010, 2011 Albert Astals Cid <aacid@kde.org>
21
24
// Copyright (C) 2008 Pino Toscano <pino@kde.org>
22
25
// Copyright (C) 2008, 2010 Hib Eris <hib@hiberis.nl>
23
26
// Copyright (C) 2009 Ross Moore <ross@maths.mq.edu.au>
24
27
// Copyright (C) 2009 Kovid Goyal <kovid@kovidgoyal.net>
25
28
// Copyright (C) 2010 Brian Ewins <brian.ewins@gmail.com>
26
29
// Copyright (C) 2010 Suzuki Toshiya <mpsuzuki@hiroshima-u.ac.jp>
 
30
// Copyright (C) 2011 Sam Liao <phyomh@gmail.com>
27
31
//
28
32
// To see a description of the changes please see the Changelog file that
29
33
// came with your tarball or type make ChangeLog if you are building from git
57
61
#include "Link.h"
58
62
#include "TextOutputDev.h"
59
63
#include "Page.h"
 
64
#include "Annot.h"
60
65
#include "PDFDocEncoding.h"
61
66
 
62
67
#ifdef MACOS
183
188
class TextLink {
184
189
public:
185
190
 
186
 
  TextLink(int xMinA, int yMinA, int xMaxA, int yMaxA, Link *linkA)
 
191
  TextLink(int xMinA, int yMinA, int xMaxA, int yMaxA, AnnotLink *linkA)
187
192
    { xMin = xMinA; yMin = yMinA; xMax = xMaxA; yMax = yMaxA; link = linkA; }
188
193
  ~TextLink() {}
189
194
 
190
195
  int xMin, yMin, xMax, yMax;
191
 
  Link *link;
 
196
  AnnotLink *link;
192
197
};
193
198
 
194
199
//------------------------------------------------------------------------
221
226
  return state->getFont() == gfxFont;
222
227
}
223
228
 
 
229
GBool TextFontInfo::matches(TextFontInfo *fontInfo) {
 
230
  return gfxFont == fontInfo->gfxFont;
 
231
}
 
232
 
224
233
//------------------------------------------------------------------------
225
234
// TextWord
226
235
//------------------------------------------------------------------------
2336
2345
  underlines->append(new TextUnderline(x0, y0, x1, y1));
2337
2346
}
2338
2347
 
2339
 
void TextPage::addLink(int xMin, int yMin, int xMax, int yMax, Link *link) {
 
2348
void TextPage::addLink(int xMin, int yMin, int xMax, int yMax, AnnotLink *link) {
2340
2349
  links->append(new TextLink(xMin, yMin, xMax, yMax, link));
2341
2350
}
2342
2351
 
3591
3600
                           double xMax, double yMax) {
3592
3601
  GooString *s;
3593
3602
  UnicodeMap *uMap;
3594
 
  GBool isUnicode;
3595
3603
  TextBlock *blk;
3596
3604
  TextLine *line;
3597
3605
  TextLineFrag *frags;
3630
3638
    return s;
3631
3639
  }
3632
3640
 
3633
 
  isUnicode = uMap->isUnicode();
3634
3641
  spaceLen = uMap->mapUnicode(0x20, space, sizeof(space));
3635
3642
  eolLen = 0; // make gcc happy
3636
3643
  switch (globalParams->getTextEOL()) {
3916
3923
  GooString *s;
3917
3924
  TextLineFrag *frag;
3918
3925
  int i, j;
3919
 
  GBool multiLine;
3920
3926
  UnicodeMap *uMap;
3921
3927
  char space[8], eol[16];
3922
3928
  int spaceLen, eolLen;
3937
3943
  eolLen = uMap->mapUnicode(0x0a, eol, sizeof(eol));
3938
3944
 
3939
3945
  if (nFrags > 0) {
3940
 
    multiLine = gFalse;
3941
3946
    for (i = 0; i < nFrags; ++i) {
3942
3947
      frag = &frags[i];
3943
3948
 
5346
5351
  fill(state);
5347
5352
}
5348
5353
 
5349
 
void TextOutputDev::processLink(Link *link, Catalog * /*catalog*/) {
 
5354
void TextOutputDev::processLink(AnnotLink *link, Catalog * /*catalog*/) {
5350
5355
  double x1, y1, x2, y2;
5351
5356
  int xMin, yMin, xMax, yMax, x, y;
5352
5357