~ubuntu-branches/ubuntu/edgy/djvulibre/edgy

« back to all changes in this revision

Viewing changes to tools/csepdjvu.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2006-07-03 11:38:23 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060703113823-un2te7742kk04c63
Tags: 3.5.17-1ubuntu1
* Sync with Debian
* debian/rules:
  - use dh_iconcache.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
52
52
//C- +------------------------------------------------------------------
53
53
// 
54
 
// $Id: csepdjvu.cpp,v 1.15 2005/07/23 15:15:19 leonb Exp $
55
 
// $Name: debian_version_3_5_16-1 $
 
54
// $Id: csepdjvu.cpp,v 1.20 2006/02/21 17:27:34 leonb Exp $
 
55
// $Name: debian_version_3_5_17-1 $
56
56
 
57
57
#ifdef HAVE_CONFIG_H
58
58
# include "config.h"
134
134
    @author
135
135
    L\'eon Bottou <leonb@research.att.com>
136
136
    @version
137
 
    #$Id: csepdjvu.cpp,v 1.15 2005/07/23 15:15:19 leonb Exp $# */
 
137
    #$Id: csepdjvu.cpp,v 1.20 2006/02/21 17:27:34 leonb Exp $# */
138
138
//@{
139
139
//@}
140
140
 
332
332
{
333
333
  int c;
334
334
  x = y = 0;
335
 
  return read_integer(x) && expect(c, ":") && read_integer(y);
 
335
  expect(c, "-");
 
336
  if (! read_integer(x)) 
 
337
    return false;
 
338
  if (c == '-') 
 
339
    x = -x;
 
340
  if (! expect(c, ":"))
 
341
    return false;
 
342
  expect(c, "-");
 
343
  if (! read_integer(y)) 
 
344
    return false;
 
345
  if (c == '-')
 
346
    y = -y;
 
347
  return true;
336
348
}
337
349
 
338
350
bool 
1167
1179
             bs.skip(" \t") && bs.read_pair(mark->dx,mark->dy) &&
1168
1180
             bs.skip(" \t") && bs.read_geometry(mark->r) &&
1169
1181
             bs.skip(" \t") && bs.read_ps_string(mark->s) ) )
1170
 
        G_THROW("msepdjvu: corrupted file (syntax error in text comment)");
 
1182
        G_THROW("csepdjvu: corrupted file (syntax error in text comment)");
1171
1183
      textmark(mark);
1172
1184
      return true;
1173
1185
    }
1228
1240
      int shy = (mark->y - lasty) * 100 / fontsize;
1229
1241
      int inter = dirx * shx + diry * shy;
1230
1242
      if ( (dirx == lastdirx) && (diry == lastdiry) &&
1231
 
           (inter > -50) && (inter < 300) && 
 
1243
           (inter > -150) && (inter < 300) && 
1232
1244
           abs(diry * shx + dirx * shy) < 80 )
1233
1245
        mark->inter = inter;
1234
1246
      else
1259
1271
      // compute word list
1260
1272
      GP<TxtMark> word;
1261
1273
      GPList<TxtMark> words;
1262
 
      for (GPosition p=lastline; p; ++p)
 
1274
          { // extra nesting for windows
 
1275
        for (GPosition p=lastline; p; ++p)
1263
1276
        {
1264
1277
          TxtMark *mark = lastline[p];
1265
1278
          if (word && mark->inter > wordsep) 
1280
1293
              word->r.recthull(word->r, mark->r);
1281
1294
            }
1282
1295
        }
 
1296
          }
1283
1297
      if (word)
1284
1298
        {
1285
1299
          if (! allspaces(word->s))