~ubuntu-branches/debian/wheezy/cuneiform/wheezy

« back to all changes in this revision

Viewing changes to cuneiform_src/Kern/rstuff/sources/main/ocomp.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jakub Wilk, c-assert.diff, slovenian-slv.diff
  • Date: 2011-01-26 21:53:07 UTC
  • mfrom: (5.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20110126215307-62x61mcesr607qb7
Tags: 1.0.0+dfsg-2
* Upload to unstable.
* Explicitly build-depend on pkg-config. Thanks to Stefano Rivera for the
  bug report.
* Add Vcs-* fields.
* Use the standard C assert() macro, rather than custom Cuneiform one.
  [c-assert.diff]
* Pass CFLAGS, CXXFLAGS and LDFLAGS (get from dpkg-buildflags) to cmake
  (closes: #608345). Thanks to Sami Liedes for the bug report.
  + Build depend on dpkg-dev (>= 1.15.7).
* Pass --parallel to dh.
  + Bump debhelper minimum version to 7.4.10.
* Update debian/copyright to the latest DEP-5 version.
* Bump year in debian/copyright.
* Explicitly link to GraphicsMagick (rather than via the ImageMagick
  compatibility layer).
* Don't ship /usr/lib/cuneiform/*.so symlinks. These libraries are
  considered private, at least until #598616 is fixed.
* Rename some private variables in debian/rules to make them lowercase.
* Update patch headers.
* Provide proper ‘build-arch’ and ‘build-indep’ targets in debian/rules.
* Document input format in the manual page (closes: #572061). Thanks to
  Janusz S. Bień for the bug report.
* Use ‘slv’ (rather than ‘slo’) as language code for Slovenian.
  [slovenian-slv.diff]
* Fix package description: Slovenian is supported, Slovak is not.
* Improve documentation of the language (-l) option (closes: #602512).
  Thanks to Jari Aalto for the bug report.
* Install reasons file for vrms.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
Copyright (c) 1993-2008, Cognitive Technologies
3
3
All rights reserved.
4
4
 
5
 
����������� ��������� ��������������� � ������������� ��� � ���� ��������� ����,
6
 
��� � � �������� �����, � ����������� ��� ���, ��� ���������� ��������� �������:
7
 
 
8
 
      * ��� ��������� ��������������� ��������� ���� ������ ���������� ���������
9
 
        ���� ����������� �� ��������� �����, ���� ������ ������� � �����������
10
 
        ����� �� ��������.
11
 
      * ��� ��������� ��������������� ��������� ���� � ������������ �/��� �
12
 
        ������ ����������, ������������ ��� ���������������, ������ �����������
13
 
        ��������� ���� ���������� �� ��������� �����, ���� ������ ������� �
14
 
        ����������� ����� �� ��������.
15
 
      * �� �������� Cognitive Technologies, �� ����� �� ����������� �� �����
16
 
        ���� ������������ � �������� �������� ��������� �/��� �����������
17
 
        ���������, ���������� �� ���� ��, ��� ���������������� �����������
18
 
        ����������.
19
 
 
20
 
��� ��������� ������������� ����������� ��������� ���� �/��� ������� ������ "���
21
 
��� ����" ��� ������-���� ���� ��������, ���������� ���� ��� ���������������,
22
 
������� �������� ������������ �������� � ����������� ��� ���������� ����, �� ��
23
 
������������� ���. �� �������� ��������� ���� � �� ���� ������ ����, �������
24
 
����� �������� �/��� �������� �������������� ���������, �� � ���� ������ ��
25
 
��Ѩ� ���������������, ������� ����� �����, ���������, ����������� ���
26
 
������������� ������, ��������� � �������������� ��� ���������� ����������
27
 
������������� ������������� ��������� (������� ������ ������, ��� ������,
28
 
������� ���������, ��� ������ �/��� ������ �������, ���������� ��-�� ��������
29
 
������� ��� �/��� ������ ��������� �������� ��������� � ������� �����������,
30
 
�� �� ������������� ����� ��������), �� �� ������������� ���, ���� ���� �����
31
 
�������� ��� ������ ���� ���� �������� � ����������� ����� ������� � ������.
 
5
Разрешается повторное распространение и использование как в виде исходного кода,
 
6
так и в двоичной форме, с изменениями или без, при соблюдении следующих условий:
 
7
 
 
8
      * При повторном распространении исходного кода должны оставаться указанное
 
9
        выше уведомление об авторском праве, этот список условий и последующий
 
10
        отказ от гарантий.
 
11
      * При повторном распространении двоичного кода в документации и/или в
 
12
        других материалах, поставляемых при распространении, должны сохраняться
 
13
        указанная выше информация об авторском праве, этот список условий и
 
14
        последующий отказ от гарантий.
 
15
      * Ни название Cognitive Technologies, ни имена ее сотрудников не могут
 
16
        быть использованы в качестве средства поддержки и/или продвижения
 
17
        продуктов, основанных на этом ПО, без предварительного письменного
 
18
        разрешения.
 
19
 
 
20
ЭТА ПРОГРАММА ПРЕДОСТАВЛЕНА ВЛАДЕЛЬЦАМИ АВТОРСКИХ ПРАВ И/ИЛИ ДРУГИМИ ЛИЦАМИ "КАК
 
21
ОНА ЕСТЬ" БЕЗ КАКОГО-ЛИБО ВИДА ГАРАНТИЙ, ВЫРАЖЕННЫХ ЯВНО ИЛИ ПОДРАЗУМЕВАЕМЫХ,
 
22
ВКЛЮЧАЯ ГАРАНТИИ КОММЕРЧЕСКОЙ ЦЕННОСТИ И ПРИГОДНОСТИ ДЛЯ КОНКРЕТНОЙ ЦЕЛИ, НО НЕ
 
23
ОГРАНИЧИВАЯСЬ ИМИ. НИ ВЛАДЕЛЕЦ АВТОРСКИХ ПРАВ И НИ ОДНО ДРУГОЕ ЛИЦО, КОТОРОЕ
 
24
МОЖЕТ ИЗМЕНЯТЬ И/ИЛИ ПОВТОРНО РАСПРОСТРАНЯТЬ ПРОГРАММУ, НИ В КОЕМ СЛУЧАЕ НЕ
 
25
НЕСЁТ ОТВЕТСТВЕННОСТИ, ВКЛЮЧАЯ ЛЮБЫЕ ОБЩИЕ, СЛУЧАЙНЫЕ, СПЕЦИАЛЬНЫЕ ИЛИ
 
26
ПОСЛЕДОВАВШИЕ УБЫТКИ, СВЯЗАННЫЕ С ИСПОЛЬЗОВАНИЕМ ИЛИ ПОНЕСЕННЫЕ ВСЛЕДСТВИЕ
 
27
НЕВОЗМОЖНОСТИ ИСПОЛЬЗОВАНИЯ ПРОГРАММЫ (ВКЛЮЧАЯ ПОТЕРИ ДАННЫХ, ИЛИ ДАННЫЕ,
 
28
СТАВШИЕ НЕГОДНЫМИ, ИЛИ УБЫТКИ И/ИЛИ ПОТЕРИ ДОХОДОВ, ПОНЕСЕННЫЕ ИЗ-ЗА ДЕЙСТВИЙ
 
29
ТРЕТЬИХ ЛИЦ И/ИЛИ ОТКАЗА ПРОГРАММЫ РАБОТАТЬ СОВМЕСТНО С ДРУГИМИ ПРОГРАММАМИ,
 
30
НО НЕ ОГРАНИЧИВАЯСЬ ЭТИМИ СЛУЧАЯМИ), НО НЕ ОГРАНИЧИВАЯСЬ ИМИ, ДАЖЕ ЕСЛИ ТАКОЙ
 
31
ВЛАДЕЛЕЦ ИЛИ ДРУГОЕ ЛИЦО БЫЛИ ИЗВЕЩЕНЫ О ВОЗМОЖНОСТИ ТАКИХ УБЫТКОВ И ПОТЕРЬ.
32
32
 
33
33
Redistribution and use in source and binary forms, with or without modification,
34
34
are permitted provided that the following conditions are met:
70
70
 
71
71
extern Handle hDebugAutoTemplate;
72
72
 
73
 
static Word32 key=2;                  //��� snap'�
74
 
static Word8 buffer[256];
 
73
static uint32_t key=2;                  //для snap'а
 
74
static uchar buffer[256];
75
75
static char *message = (char *)buffer;
76
76
 
77
77
 
78
 
//============ ������� ��� ���������� =================//
 
78
//============ Функции для интервалов =================//
79
79
 
80
80
static Bool32   intersect  (CCOM_interval16 *f, CCOM_interval16 *s)
81
81
{
82
82
        if (f->l==0 || s->l==0)
83
83
                return FALSE;
84
84
 
85
 
        Int16 fbeg=BEGIN(*f),sbeg=BEGIN(*s);
 
85
        int16_t fbeg=BEGIN(*f),sbeg=BEGIN(*s);
86
86
        return fbeg<=sbeg && sbeg<=f->e || fbeg<=s->e && s->e<=f->e || sbeg<=fbeg && f->e<=s->e;
87
87
}
88
88
 
89
 
static Int16 distance  (CCOM_interval16 *f, CCOM_interval16 *s)
 
89
static int16_t distance  (CCOM_interval16 *f, CCOM_interval16 *s)
90
90
{
91
91
        if (f->l==0 || s->l==0)
92
92
                return MAXWIDTH;
93
93
 
94
 
        Int16 fbeg=BEGIN(*f),sbeg=BEGIN(*s);
95
 
        Int16 ro1=sbeg-f->e,ro2=fbeg-s->e;
 
94
        int16_t fbeg=BEGIN(*f),sbeg=BEGIN(*s);
 
95
        int16_t ro1=sbeg-f->e,ro2=fbeg-s->e;
96
96
        return MAX(ro1,ro2);
97
97
}
98
98
 
110
110
        if (s->l==0)
111
111
                return *f;
112
112
 
113
 
        Int16 fbeg=BEGIN(*f),sbeg=BEGIN(*s);
114
 
        Int16 rbeg=MIN(fbeg,sbeg),rend=MAX(f->e,s->e);
 
113
        int16_t fbeg=BEGIN(*f),sbeg=BEGIN(*s);
 
114
        int16_t rbeg=MIN(fbeg,sbeg),rend=MAX(f->e,s->e);
115
115
        CCOM_interval16 res={rend-rbeg,rend};
116
116
        return res;
117
117
}
118
118
 
119
 
static void reorder(CCOM_interval16 set[], Int32 n)
 
119
static void reorder(CCOM_interval16 set[], int32_t n)
120
120
{
121
121
        if (n<=1)
122
122
                return;
123
123
 
124
124
        Bool32 changed;
125
 
        Int32 i;
 
125
        int32_t i;
126
126
        CCOM_interval16 *sc,*sp;
127
127
        do
128
128
        {
146
146
        memset(right,0,sizeof(right));
147
147
}
148
148
*-/
149
 
Int32 DoubleInterval::Number()
 
149
int32_t DoubleInterval::Number()
150
150
{
151
 
        Int32 n=0;
 
151
        int32_t n=0;
152
152
        if (left.l)     n++;
153
153
        if (right.l)    n++;
154
154
        return n;
156
156
 
157
157
void DoubleInterval::SetOne(CCOM_interval16 *add)
158
158
{
159
 
        Int32 mid=add->e-add->l/2;
 
159
        int32_t mid=add->e-add->l/2;
160
160
        if (mid > pComp->nWidth/2)
161
161
        {
162
162
                right=*add;
198
198
                return;
199
199
        }
200
200
 
201
 
        //�� ������������ �� � �����
 
201
        //не пересекается ни с одним
202
202
        CCOM_interval16  set[3],*l=set,*m=set+1,*r=set+2;
203
203
        set[0]=left; set[1]=*add; set[2]=right;
204
 
        reorder(set,3);   // � ������� ����������� ������
 
204
        reorder(set,3);   // в порядке возрастания концов
205
205
        if (Number()==1)
206
206
        {
207
207
                left=*m;  right=*r;
228
228
        CCOM_interval16 cav={BEGIN(right)-left.e,BEGIN(right)};
229
229
        return cav;
230
230
/*
231
 
        CCOM_interval16 cavl={0,0},cavm={0,(Int16)pComp->nWidth},cavr={0,cavm.e};
232
 
        Int16 cavmb=0;
 
231
        CCOM_interval16 cavl={0,0},cavm={0,(int16_t)pComp->nWidth},cavr={0,cavm.e};
 
232
        int16_t cavmb=0;
233
233
        if (left.l>0)
234
234
        {
235
235
                cavl.l=cavl.e=BEGIN(left);
260
260
        nCavBeg=-1;      nCavWidth=nCavEnd=0;
261
261
        rCavRect=SmRect32();
262
262
        memset(ints,0,(nHeight+1)*sizeof(DoubleInterval));
263
 
        for (Int32 i=0; i<=nHeight && i<=MAXHEIGHT; i++)
 
263
        for (int32_t i=0; i<=nHeight && i<=MAXHEIGHT; i++)
264
264
                ints[i].pComp=this;
265
265
}
266
266
 
272
272
 
273
273
        if (rect)
274
274
        {
275
 
                CCOM_interval16 inter = {(Int16)(rect->right-rect->left),(Int16)rect->right};
 
275
                CCOM_interval16 inter = {(int16_t)(rect->right-rect->left),(int16_t)rect->right};
276
276
                if (inter.l != 0)
277
277
                {
278
278
                        memset(ints,0,(nHeight+1)*sizeof(DoubleInterval));
279
 
                        for (Int32 i=0; i<=nHeight && i<=MAXHEIGHT; i++)
 
279
                        for (int32_t i=0; i<=nHeight && i<=MAXHEIGHT; i++)
280
280
                        {
281
281
                                ints[i].pComp=this;
282
282
                                if (i>=rect->top && i<=rect->bottom)
290
290
 
291
291
        rCavRect=SmRect32();
292
292
        nCavBeg=-1;      nCavWidth=nCavEnd=0;
293
 
        Int32 i,cLeft=0,cUp=0,cRight=0;
 
293
        int32_t i,cLeft=0,cUp=0,cRight=0;
294
294
        Bool32 found=FALSE;
295
295
        CCOM_interval16 prev={0,0};
296
 
        for (i=0; i<=nHeight; i++)      //��������� �������� - ���������
 
296
        for (i=0; i<=nHeight; i++)      //последний интервал - фиктивный
297
297
        {
298
298
                CCOM_interval16 curr=ints[i].Cavity();
299
299
                Bool32 notcross = !intersect(&curr,&prev);
301
301
                Bool32 end = prev.l>0 && (notcross || curr.l==0);
302
302
                if (end)
303
303
                {
304
 
                        Int32 h=i-cUp;
 
304
                        int32_t h=i-cUp;
305
305
                        cLeft=DIV_ROUND(cLeft,h);
306
306
                        cRight=DIV_ROUND(cRight,h);
307
307
                        if (h>=nHeight/2 && cRight-cLeft>=nWidth/2)
308
 
                           if (involve(&(ints[i].left),&prev) || involve(&(ints[i].right),&prev))  //���� ���
 
308
                           if (involve(&(ints[i].left),&prev) || involve(&(ints[i].right),&prev))  //есть дно
309
309
                           {
310
310
                                        found=TRUE;
311
311
                                        rCavRect=SmRect32(cLeft,cUp,cRight,i-1);
312
312
                                        break;
313
313
                           }
314
314
 
315
 
                        //���� ������
 
315
                        //ищем дальше
316
316
                }
317
317
                if (beg)
318
318
                {
334
334
        if (pComp->scale & CCOM_LONGLINES)
335
335
        {
336
336
                CCOM_lnhead  *lnhead;
337
 
                lnhead = (CCOM_lnhead*)(pComp->linerep + sizeof(Word16));
338
 
                while( lnhead->lth )                                            // �� ������
 
337
                lnhead = (CCOM_lnhead*)(pComp->linerep + sizeof(uint16_t));
 
338
                while( lnhead->lth )                                            // по линиям
339
339
                {
340
 
                        Int16 cInter = lnhead->row;
 
340
                        int16_t cInter = lnhead->row;
341
341
                        CCOM_interval16 *inter = (CCOM_interval16*)(lnhead+1);
342
 
                        while( inter->l && cInter<MAXHEIGHT )   // �� ���������� �����
 
342
                        while( inter->l && cInter<MAXHEIGHT )   // по интервалам линии
343
343
                        {
344
344
                                if (cInter>=nHeight)
345
345
                                        return FALSE;
353
353
        else
354
354
        {
355
355
                CCOM_lnhead  *lnhead;
356
 
                lnhead = (CCOM_lnhead*)(pComp->linerep + sizeof(Word16));
357
 
                while( lnhead->lth )                                            // �� ������
 
356
                lnhead = (CCOM_lnhead*)(pComp->linerep + sizeof(uint16_t));
 
357
                while( lnhead->lth )                                            // по линиям
358
358
                {
359
 
                        Int16 cInter = lnhead->row;
 
359
                        int16_t cInter = lnhead->row;
360
360
                        CCOM_interval *inter = (CCOM_interval*)(lnhead+1);
361
 
                        while( inter->l && cInter<MAXHEIGHT )   // �� ���������� �����
 
361
                        while( inter->l && cInter<MAXHEIGHT )   // по интервалам линии
362
362
                        {
363
363
                                if (cInter>=nHeight)
364
364
                                        return FALSE;
377
377
 
378
378
void Ocomp::ShowCavity()
379
379
{
380
 
        for (Int32 i=nCavBeg; i<nCavEnd; i++)
 
380
        for (int32_t i=nCavBeg; i<nCavEnd; i++)
381
381
        {
382
 
                Int16 h=(Int16)(pComp->upper+i);
 
382
                int16_t h=(int16_t)(pComp->upper+i);
383
383
                Point16 beg1={pComp->left+ints[i].left.e,h},end1={beg1.x+1,h};
384
384
                LDPUMA_DrawLine(hWndTurn,&beg1,&end1,0,wRGB(0,0,255),PEN_WIDTH,key);
385
385
                Point16 beg2={pComp->left+BEGIN(ints[i].right),h},end2={beg2.x+1,h};
389
389
        LDPUMA_DeleteLines(hWndTurn,key);
390
390
}
391
391
 
392
 
Int32 TripleInterval::Number()
 
392
int32_t TripleInterval::Number()
393
393
{
394
 
        Int32 n=0;
 
394
        int32_t n=0;
395
395
        if (left.l)     n++;
396
396
        if (middle.l)   n++;
397
397
        if (right.l)    n++;
400
400
 
401
401
void TripleInterval::SetOne(CCOM_interval16 *add)
402
402
{
403
 
        Int32 Ithird=pComp->nWidth/3,IIthird=2*Ithird;
404
 
        Int32 mid=add->e-add->l/2;
 
403
        int32_t Ithird=pComp->nWidth/3,IIthird=2*Ithird;
 
404
        int32_t mid=add->e-add->l/2;
405
405
        if (mid >= IIthird)
406
406
        {
407
407
                right=*add;
430
430
                SetOne(toAdd);  return;
431
431
        }
432
432
 
433
 
        Int32 i,Ithird=pComp->nWidth/3,IIthird=2*Ithird;
 
433
        int32_t i,Ithird=pComp->nWidth/3,IIthird=2*Ithird;
434
434
        CCOM_interval16  set[4];
435
435
        set[0]=left; set[1]=middle; set[2]=right; set[3]=*toAdd;
436
436
        CCOM_interval16 *curr,*next;
437
437
        CCOM_interval16 *first=set,*sec=set+1,*third=set+2,*add=set+3;
438
438
 
439
 
        reorder(set,4);         // � ������� ����������� ������
440
 
        if (set[0].l)           // ����� 4 ��������� - ���� ���� ����������
 
439
        reorder(set,4);         // в порядке возрастания концов
 
440
        if (set[0].l)           // всего 4 интервала - пару надо объединить
441
441
        {
442
 
                Int32 distmin=MAXWIDTH,imin;
 
442
                int32_t distmin=MAXWIDTH,imin;
443
443
                for (i=0,curr=set+i,next=curr+1; i<3; i++,curr++,next++)
444
444
                {
445
 
                        Int16 dist=distance(curr,next);
 
445
                        int16_t dist=distance(curr,next);
446
446
                        if (dist<distmin) { distmin=dist; imin=i; };
447
447
                }
448
448
                set[imin+1]=join(set+imin,set+imin+1);
449
 
                memmove(set+1,set,imin*sizeof(CCOM_interval16));        //��������� ������
 
449
                memmove(set+1,set,imin*sizeof(CCOM_interval16));        //поджимаем вправо
450
450
                memset(set,0,sizeof(CCOM_interval16));
451
451
        }
452
452
 
453
 
        //�������� <= 3 ��������� - ����������, ���� �����
 
453
        //осталось <= 3 интервала - объединяем, если нужно
454
454
        Bool32 joined;
455
455
        do
456
456
        {
457
457
                joined=FALSE;
458
458
                for (i=1,curr=set+i,next=curr+1; i<3; i++,curr++,next++)
459
459
                {
460
 
                        Int16 dist=distance(curr,next);
 
460
                        int16_t dist=distance(curr,next);
461
461
                        if (dist<curr->l && dist<next->l)
462
462
                        {
463
463
                                joined=TRUE;
464
464
                                *next=join(curr,next);
465
 
                                memmove(set+1,set,i*sizeof(CCOM_interval16));   //��������� ������
 
465
                                memmove(set+1,set,i*sizeof(CCOM_interval16));   //поджимаем вправо
466
466
                        }
467
467
                }
468
468
        }
469
469
        while(joined);
470
470
 
471
 
        //������������ �� ������
472
 
        if (set[1].l)           // 3 ��������� - ������ ����� �������
 
471
        //распределяем по местам
 
472
        if (set[1].l)           // 3 интервала - кладем слева направо
473
473
        {
474
474
                left=set[1];  middle=set[2];  right=set[3];
475
475
        }
476
 
        else if (set[2].l)      // 2 ��������� - ������������ �� ���� ���������
 
476
        else if (set[2].l)      // 2 интервала - распределяем по трем вакансиям
477
477
        {
478
 
                Int32 mid=set[3].e-set[3].l/2;
 
478
                int32_t mid=set[3].e-set[3].l/2;
479
479
                if (mid<IIthird)
480
480
                {
481
481
                        left=set[2];  middle=set[3];  memset(&right,0,sizeof(right));
488
488
                        else                      {     memset(&left,0,sizeof(left));  middle=set[2];     }
489
489
                }
490
490
        }
491
 
        else if (set[3].l)      //���� ��������
 
491
        else if (set[3].l)      //один интервал
492
492
                SetOne(set+3);
493
493
        else
494
494
                assert(0);
495
495
}
496
496
 
497
 
void OOcomp::SetComp(CCOM_comp *comp, Int32 pageWidth, Int32 pageHeight)
 
497
void OOcomp::SetComp(CCOM_comp *comp, int32_t pageWidth, int32_t pageHeight)
498
498
{
499
499
        if (comp==NULL)
500
500
                return;
506
506
        nDens=0;
507
507
        rCavRect=SmRect32();
508
508
        memset(ints,0,(nHeight+1)*sizeof(TripleInterval));
509
 
        for (Int32 i=0; i<=nHeight && i<=MAXHEIGHT; i++)
 
509
        for (int32_t i=0; i<=nHeight && i<=MAXHEIGHT; i++)
510
510
                ints[i].pComp=this;
511
511
}
512
512
 
515
515
        if (pComp->scale & CCOM_LONGLINES)
516
516
        {
517
517
                CCOM_lnhead  *lnhead;
518
 
                lnhead = (CCOM_lnhead*)(pComp->linerep + sizeof(Word16));
519
 
                while( lnhead->lth )                                            // �� ������
 
518
                lnhead = (CCOM_lnhead*)(pComp->linerep + sizeof(uint16_t));
 
519
                while( lnhead->lth )                                            // по линиям
520
520
                {
521
 
                        Int16 cInter = lnhead->row;
 
521
                        int16_t cInter = lnhead->row;
522
522
                        CCOM_interval16 *inter = (CCOM_interval16*)(lnhead+1);
523
 
                        while( inter->l && cInter<MAXHEIGHT )   // �� ���������� �����
 
523
                        while( inter->l && cInter<MAXHEIGHT )   // по интервалам линии
524
524
                        {
525
525
                                if (cInter>=nHeight)
526
526
                                        return FALSE;
535
535
        else
536
536
        {
537
537
                CCOM_lnhead  *lnhead;
538
 
                lnhead = (CCOM_lnhead*)(pComp->linerep + sizeof(Word16));
539
 
                while( lnhead->lth )                                            // �� ������
 
538
                lnhead = (CCOM_lnhead*)(pComp->linerep + sizeof(uint16_t));
 
539
                while( lnhead->lth )                                            // по линиям
540
540
                {
541
 
                        Int16 cInter = lnhead->row;
 
541
                        int16_t cInter = lnhead->row;
542
542
                        CCOM_interval *inter = (CCOM_interval*)(lnhead+1);
543
 
                        while( inter->l && cInter<MAXHEIGHT )   // �� ���������� �����
 
543
                        while( inter->l && cInter<MAXHEIGHT )   // по интервалам линии
544
544
                        {
545
545
                                if (cInter>=nHeight)
546
546
                                        return FALSE;
568
568
                return FALSE;
569
569
 
570
570
 
571
 
        Int32 i,dens=0;
572
 
        Int32 lm=0,lc=0,rm=0,rc=0;
573
 
        Int16 um=pComp->upper,bm=nPageHeight-(um+pComp->h);
 
571
        int32_t i,dens=0;
 
572
        int32_t lm=0,lc=0,rm=0,rc=0;
 
573
        int16_t um=pComp->upper,bm=nPageHeight-(um+pComp->h);
574
574
        for (i=0; i<nHeight; i++)
575
575
        {
576
576
                TripleInterval *intv=ints+i;
577
577
#ifdef DRAWTPIPLEINT
578
 
                                Int32 color=wRGB(0,0,255);
579
 
                                Int16 h=(Int16)(pComp->upper+i);
 
578
                                int32_t color=wRGB(0,0,255);
 
579
                                int16_t h=(int16_t)(pComp->upper+i);
580
580
                                {
581
581
                                Point16 beg={pComp->left+intv->left.e-intv->left.l,h},end={pComp->left+intv->left.e,h};
582
582
                                LDPUMA_DrawLine(hWndTurn,&beg,&end,0,wRGB(0,0,255),PEN_WIDTH,key);
615
615
                10*pComp->left>=3*nPageWidth && 10*(pComp->left+pComp->w)<=7*nPageWidth)
616
616
                        return TRUE;
617
617
 
618
 
        Int16 wm=(Int16)nPageWidth/128,hm=(Int16)nPageHeight/128;
619
 
        Int32 boundh=0,boundv=0;
 
618
        int16_t wm=(int16_t)nPageWidth/128,hm=(int16_t)nPageHeight/128;
 
619
        int32_t boundh=0,boundv=0;
620
620
        if (pComp->left<=wm)  boundv++;
621
621
        if (pComp->upper<=hm) boundh++;
622
622
        if (pComp->left+pComp->w>=nPageWidth-wm)        boundv++;