File: docRtfReadObjects.c

package info (click to toggle)
ted 2.11-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 11,064 kB
  • ctags: 13,935
  • sloc: ansic: 120,446; makefile: 7,469; sh: 253
file content (588 lines) | stat: -rw-r--r-- 16,034 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
/************************************************************************/
/*									*/
/*  Read an RTF text file into a BufferDocument				*/
/*									*/
/************************************************************************/

#   include	"tedConfig.h"

#   include	<stdlib.h>
#   include	<string.h>
#   include	<stdio.h>
#   include	<ctype.h>
#   include	<bitmap.h>

#   include	<appDebugon.h>

#   include	"docRtf.h"


static int docRtfResultPictWord(	SimpleInputStream *	sis,
					const RtfControlWord *	rcw,
					int			arg,
					RtfReadingContext *	rrc	)
    {
    switch( rcw->rcwId )
	{
	case RTFidWMETAFILE:
	    rrc->rrcInsertedObject->ioResultKind= DOCokPICTWMETAFILE;
	    rrc->rrcInsertedObject->ioResultMapMode= arg;
	    break;

	case RTFidPICWGOAL:
	    if  ( rrc->rrcInsertedObject->ioTwipsWide == 0 )
		{ rrc->rrcInsertedObject->ioTwipsWide= arg; }
	    else{
		if  ( rrc->rrcInsertedObject->ioTwipsWide- arg >  1	||
		      rrc->rrcInsertedObject->ioTwipsWide- arg < -1	)
		    { LLDEB(rrc->rrcInsertedObject->ioTwipsWide,arg);	}
		}
	    break;

	case RTFidPICHGOAL:
	    if  ( rrc->rrcInsertedObject->ioTwipsHigh == 0 )
		{ rrc->rrcInsertedObject->ioTwipsHigh= arg; }
	    else{
		if  ( rrc->rrcInsertedObject->ioTwipsHigh- arg >  1	||
		      rrc->rrcInsertedObject->ioTwipsHigh- arg < -1	)
		    { LLDEB(rrc->rrcInsertedObject->ioTwipsHigh,arg);	}
		}
	    break;

	case RTFidPICSCALEX:
	    if  ( rrc->rrcInsertedObject->ioScaleX == 100 )
		{ rrc->rrcInsertedObject->ioScaleX= arg; }
	    else{
		if  ( rrc->rrcInsertedObject->ioScaleX != arg )
		    { LLDEB(rrc->rrcInsertedObject->ioScaleX,arg);	}
		}
	    break;

	case RTFidPICSCALEY:
	    if  ( rrc->rrcInsertedObject->ioScaleY == 100 )
		{ rrc->rrcInsertedObject->ioScaleY= arg; }
	    else{
		if  ( rrc->rrcInsertedObject->ioScaleY != arg )
		    { LLDEB(rrc->rrcInsertedObject->ioScaleY,arg);	}
		}
	    break;

	case RTFidPICW:
	    rrc->rrcInsertedObject->io_xWinExt= arg;
	    break;

	case RTFidPICH:
	    rrc->rrcInsertedObject->io_yWinExt= arg;
	    break;

	case RTFidPICCROPT:
	    rrc->rrcInsertedObject->ioTopCropTwips= arg;
	    break;

	case RTFidPICCROPB:
	    rrc->rrcInsertedObject->ioBottomCropTwips= arg;
	    break;

	case RTFidPICCROPL:
	    rrc->rrcInsertedObject->ioLeftCropTwips= arg;
	    break;

	case RTFidPICCROPR:
	    rrc->rrcInsertedObject->ioRightCropTwips= arg;
	    break;

	default:
	    SLDEB(rcw->rcwWord,rcw->rcwId); break;
	}

    return 0;
    }

static int docRtfPictWord(	SimpleInputStream *	sis,
				const RtfControlWord *	rcw,
				int			arg,
				RtfReadingContext *	rrc	)
    {
    switch( rcw->rcwId )
	{
	case RTFidMACPICT:
	    rrc->rrcInsertedObject->ioKind= DOCokMACPICT;
	    break;
	case RTFidWMETAFILE:
	    rrc->rrcInsertedObject->ioKind= DOCokPICTWMETAFILE;
	    rrc->rrcInsertedObject->ioMapMode= arg;
	    break;
	case RTFidPNGBLIP:
	    rrc->rrcInsertedObject->ioKind= DOCokPICTPNGBLIP;
	    break;
	case RTFidJPEGBLIP:
	    rrc->rrcInsertedObject->ioKind= DOCokPICTJPEGBLIP;
	    break;
	case RTFidEMFBLIP:
	    rrc->rrcInsertedObject->ioKind= DOCokPICTEMFBLIP;
	    break;
	case RTFidPICWGOAL:
	    rrc->rrcInsertedObject->ioTwipsWide= arg;
	    break;
	case RTFidPICHGOAL:
	    rrc->rrcInsertedObject->ioTwipsHigh= arg;
	    break;
	case RTFidPICSCALEX:
	    rrc->rrcInsertedObject->ioScaleX= arg;
	    break;
	case RTFidPICSCALEY:
	    rrc->rrcInsertedObject->ioScaleY= arg;
	    break;
	case RTFidBLIPTAG:
	    rrc->rrcInsertedObject->ioBliptag= arg;
	    break;
	case RTFidPICW:
	    rrc->rrcInsertedObject->io_xWinExt= arg;
	    break;
	case RTFidPICH:
	    rrc->rrcInsertedObject->io_yWinExt= arg;
	    break;
	case RTFidPICCROPT:
	    rrc->rrcInsertedObject->ioTopCropTwips= arg;
	    break;
	case RTFidPICCROPB:
	    rrc->rrcInsertedObject->ioBottomCropTwips= arg;
	    break;
	case RTFidPICCROPL:
	    rrc->rrcInsertedObject->ioLeftCropTwips= arg;
	    break;
	case RTFidPICCROPR:
	    rrc->rrcInsertedObject->ioRightCropTwips= arg;
	    break;

	default:
	    /* SLDEB(rcw->rcwWord,rcw->rcwId); */
	    break;
	}

    return 0;
    }

static RtfControlWord	docRtfPictWords[]=
    {
	{ "bin",	RTFidBIN,	DOClevPARA, docRtfPictWord, },
	{ "dibitmap",	RTFidDIBITMAP,	DOClevPARA, docRtfPictWord, },
	{ "macpict",	RTFidMACPICT,	DOClevPARA, docRtfPictWord, },
	{ "picbmp",	RTFidPICBMP,	DOClevPARA, docRtfPictWord, },
	{ "picbpp",	RTFidPICBPP,	DOClevPARA, docRtfPictWord, },
	{ "piccropb",	RTFidPICCROPB,	DOClevPARA, docRtfPictWord, },
	{ "piccropl",	RTFidPICCROPL,	DOClevPARA, docRtfPictWord, },
	{ "piccropr",	RTFidPICCROPR,	DOClevPARA, docRtfPictWord, },
	{ "piccropt",	RTFidPICCROPT,	DOClevPARA, docRtfPictWord, },
	{ "pich",	RTFidPICH,	DOClevPARA, docRtfPictWord, },
	{ "pichgoal",	RTFidPICHGOAL,	DOClevPARA, docRtfPictWord, },
	{ "picscaled",	RTFidPICSCALED,	DOClevPARA, docRtfPictWord, },
	{ "picscalex",	RTFidPICSCALEX,	DOClevPARA, docRtfPictWord, },
	{ "picscaley",	RTFidPICSCALEY,	DOClevPARA, docRtfPictWord, },
	{ "picw",	RTFidPICW,	DOClevPARA, docRtfPictWord, },
	{ "picwgoal",	RTFidPICWGOAL,	DOClevPARA, docRtfPictWord, },
	{ "pmmetafile",	RTFidPMMETAFILE, DOClevPARA, docRtfPictWord, },
	{ "wbitmap",	RTFidWBITMAP,	DOClevPARA, docRtfPictWord, },
	{ "wbmbitspixel", RTFidWBMBITSPIXEL, DOClevPARA, docRtfPictWord, },
	{ "wbmplanes",	RTFidWBMPLANES,	DOClevPARA, docRtfPictWord, },
	{ "wbmwidthbytes", RTFidWBMWIDTHBYTES,DOClevPARA, docRtfPictWord, },
	{ "wmetafile",	RTFidWMETAFILE,	DOClevPARA, docRtfPictWord, },
	{ "pngblip",	RTFidPNGBLIP,	DOClevPARA, docRtfPictWord, },
	{ "jpegblip",	RTFidJPEGBLIP,	DOClevPARA, docRtfPictWord, },
	{ "emfblip",	RTFidEMFBLIP,	DOClevPARA, docRtfPictWord, },

	{ "bliptag",	RTFidBLIPTAG,	DOClevPARA, docRtfPictWord, },
	{ "blipupi",	RTFidBLIPUPI,	DOClevPARA, docRtfPictWord, },

					/********************************/
					/*  Bug in textbridge...	*/
					/********************************/
	{ "picwGoal",	RTFidPICWGOAL,	DOClevPARA, docRtfPictWord, },
	{ "pichGoal",	RTFidPICHGOAL,	DOClevPARA, docRtfPictWord, },

	{ 0, 0, 0 }
    };

static RtfControlWord	docRtfResultPictWords[]=
    {
	{ "bin",	RTFidBIN,	DOClevPARA, docRtfResultPictWord, },
	{ "dibitmap",	RTFidDIBITMAP,	DOClevPARA, docRtfResultPictWord, },
	{ "macpict",	RTFidMACPICT,	DOClevPARA, docRtfResultPictWord, },
	{ "picbmp",	RTFidPICBMP,	DOClevPARA, docRtfResultPictWord, },
	{ "picbpp",	RTFidPICBPP,	DOClevPARA, docRtfResultPictWord, },
	{ "piccropb",	RTFidPICCROPB,	DOClevPARA, docRtfResultPictWord, },
	{ "piccropl",	RTFidPICCROPL,	DOClevPARA, docRtfResultPictWord, },
	{ "piccropr",	RTFidPICCROPR,	DOClevPARA, docRtfResultPictWord, },
	{ "piccropt",	RTFidPICCROPT,	DOClevPARA, docRtfResultPictWord, },
	{ "pich",	RTFidPICH,	DOClevPARA, docRtfResultPictWord, },
	{ "pichgoal",	RTFidPICHGOAL,	DOClevPARA, docRtfResultPictWord, },
	{ "picscaled",	RTFidPICSCALED,	DOClevPARA, docRtfResultPictWord, },
	{ "picscalex",	RTFidPICSCALEX,	DOClevPARA, docRtfResultPictWord, },
	{ "picscaley",	RTFidPICSCALEY,	DOClevPARA, docRtfResultPictWord, },
	{ "picw",	RTFidPICW,	DOClevPARA, docRtfResultPictWord, },
	{ "picwgoal",	RTFidPICWGOAL,	DOClevPARA, docRtfResultPictWord, },
	{ "pmmetafile",	RTFidPMMETAFILE,DOClevPARA, docRtfResultPictWord, },
	{ "wbitmap",	RTFidWBITMAP,	DOClevPARA, docRtfResultPictWord, },
	{ "wbmbitspixel",
			RTFidWBMBITSPIXEL, DOClevPARA, docRtfResultPictWord, },
	{ "wbmplanes",	RTFidWBMPLANES,	DOClevPARA, docRtfResultPictWord, },
	{ "wbmwidthbytes",
			RTFidWBMWIDTHBYTES,DOClevPARA, docRtfResultPictWord, },
	{ "wmetafile",	RTFidWMETAFILE,	DOClevPARA, docRtfResultPictWord, },

	{ "bliptag",	RTFidBLIPTAG,	DOClevPARA, docRtfPictWord, },
	{ "blipupi",	RTFidBLIPUPI,	DOClevPARA, docRtfPictWord, },

					/********************************/
					/*  Bug in textbridge...	*/
					/********************************/
	{ "picwGoal",	RTFidPICWGOAL,	DOClevPARA, docRtfResultPictWord, },
	{ "pichGoal",	RTFidPICHGOAL,	DOClevPARA, docRtfResultPictWord, },

	{ 0, 0, 0 }
    };

static int docRtfSaveObjectData(	RtfReadingContext *	rrc,
					const unsigned char *	text,
					int			len )
    {
    if  ( docObjectSetData( rrc->rrcInsertedObject, text, len ) )
	{ LDEB(len); return -1;	}

    return 0;
    }

static int docRtfSaveResultData(	RtfReadingContext *	rrc,
					const unsigned char *	text,
					int			len	)
    {
    if  ( docSetResultData( rrc->rrcInsertedObject, text, len ) )
	{ LDEB(len); return -1;	}

    return 0;
    }

int docRtfReadPict(	SimpleInputStream *	sis,
			const RtfControlWord *	rcw,
			int			arg,
			RtfReadingContext *	externRrc )
    {
    RtfReadingContext		internRrc;
    int				rval;
    TextParticule *		tp;

    BufferItem *		bi= externRrc->rrcBi;
    int				off= bi->biParaStrlen;

    if  ( docInflateTextString( bi, 1 ) )
	{ LLDEB(bi->biParaStrlen,1); return -1; }

    bi->biParaString[off]= ' ';
    bi->biParaStrlen++;
    bi->biParaString[bi->biParaStrlen]= '\0';

    tp= docInsertObject( bi, &externRrc->rrcInsertedObject,
			    -1, off, externRrc->rrcCurrentTextAttribute );
    if  ( ! tp )
	{ LDEB(bi->biParaParticuleCount); return -1;	}

    docRtfInitReadingContext( &internRrc );
    docRtfCopyReadingContext( &internRrc, externRrc );

    rval= docRtfConsumeGroup( sis, DOClevPARA, &internRrc,
				docRtfPictWords, docRtfEmptyTable,
				docRtfSaveObjectData );

    if  ( rval )
	{ SLDEB(rcw->rcwWord,rval);	}

    docRtfCopyReadingContextBack( externRrc, &internRrc  );
    docRtfCleanReadingContext( &internRrc );

    return rval;
    }


#   if 0
static RtfControlWord	docRtfNonshppictGroups[]=
    {
	{ "pict",	RTFidPICT,	DOClevPARA, docRtfReadPict, },
    };
#   endif

int docRtfReadNonshppict(	SimpleInputStream *	sis,
				const RtfControlWord *	rcw,
				int			arg,
				RtfReadingContext *	rrc )
    {
    int				rval;

#   if 0
    rval= docRtfConsumeGroup( sis, DOClevPARA, rrc,
				docRtfEmptyTable, docRtfNonshppictGroups,
				docRtfIgnoreParticule );
#   else
    rval= docRtfSkipGroup( sis, rcw, arg, rrc );
#   endif

    if  ( rval )
	{ SLDEB(rcw->rcwWord,rval);	}

    return rval;
    }

static RtfControlWord	docRtfShppictGroups[]=
    {
	{ "pict",	RTFidPICT,	DOClevPARA, docRtfReadPict, },
    };

int docRtfReadShppict(		SimpleInputStream *	sis,
				const RtfControlWord *	rcw,
				int			arg,
				RtfReadingContext *	rrc )
    {
    int				rval;

    rval= docRtfConsumeGroup( sis, DOClevPARA, rrc,
				docRtfEmptyTable, docRtfShppictGroups,
				docRtfIgnoreParticule );
    if  ( rval )
	{ SLDEB(rcw->rcwWord,rval);	}

    return rval;
    }

static int docRtfReadResultPict(	SimpleInputStream *	sis,
					const RtfControlWord *	rcw,
					int			arg,
					RtfReadingContext *	rrc )
    {
    int				rval;

    rval= docRtfConsumeGroup( sis, DOClevPARA, rrc,
				docRtfResultPictWords, docRtfEmptyTable,
				docRtfSaveResultData );

    if  ( rval )
	{ SLDEB(rcw->rcwWord,rval);	}

    return rval;
    }

static RtfControlWord	docRtfNonshpResultpictGroups[]=
    {
	{ "pict",	RTFidPICT,	DOClevPARA, docRtfReadResultPict, },
    };

static int docRtfReadNonshResultpict(	SimpleInputStream *	sis,
					const RtfControlWord *	rcw,
					int			arg,
					RtfReadingContext *	rrc )
    {
    int				rval;

    rval= docRtfConsumeGroup( sis, DOClevPARA, rrc,
				docRtfEmptyTable, docRtfNonshpResultpictGroups,
				docRtfIgnoreParticule );

    if  ( rval )
	{ SLDEB(rcw->rcwWord,rval);	}

    return rval;
    }

static int docRtfObjectWord(	SimpleInputStream *	sis,
				const RtfControlWord *	rcw,
				int			arg,
				RtfReadingContext *	rrc	)
    {
    switch( rcw->rcwId )
	{
	case RTFidOBJEMB:
	    rrc->rrcInsertedObject->ioKind= DOCokOLEOBJECT;
	    break;
	case RTFidOBJW:
	    rrc->rrcInsertedObject->ioTwipsWide= arg;
	    break;
	case RTFidOBJH:
	    rrc->rrcInsertedObject->ioTwipsHigh= arg;
	    break;
	case RTFidOBJSCALEX:
	    rrc->rrcInsertedObject->ioScaleX= arg;
	    break;
	case RTFidOBJSCALEY:
	    rrc->rrcInsertedObject->ioScaleY= arg;
	    break;
	default:
	    /* SLDEB(rcw->rcwWord,rcw->rcwId); */ break;
	}

    return 0;
    }

static int docRtfSaveObjectClass(	RtfReadingContext *	rrc,
					const unsigned char *	text,
					int			len	)
    {
    if  ( docSetObjectClass( rrc->rrcInsertedObject, text, len ) )
	{ LDEB(len); return -1;	}

    return 0;
    }

static int docRtfSaveObjectName(	RtfReadingContext *	rrc,
					const unsigned char *	text,
					int			len	)
    {
    if  ( docSetObjectName( rrc->rrcInsertedObject, text, len ) )
	{ LDEB(len); return -1;	}

    return 0;
    }

static int docRtfObjectClass(	SimpleInputStream *	sis,
				const RtfControlWord *	rcw,
				int			arg,
				RtfReadingContext *	rrc	)
    {
    int				rval;

    rval= docRtfConsumeGroup( sis, DOClevPARA, rrc,
				docRtfEmptyTable, docRtfEmptyTable,
				docRtfSaveObjectClass );

    if  ( rval )
	{ SLDEB(rcw->rcwWord,rval);	}

    return rval;
    }

static int docRtfObjectName(	SimpleInputStream *	sis,
				const RtfControlWord *	rcw,
				int			arg,
				RtfReadingContext *	rrc	)
    {
    int				rval;

    rval= docRtfConsumeGroup( sis, DOClevPARA, rrc,
				docRtfEmptyTable, docRtfEmptyTable,
				docRtfSaveObjectName );
    if  ( rval )
	{ SLDEB(rcw->rcwWord,rval);	}

    return rval;
    }

static int docRtfObjectData(	SimpleInputStream *	sis,
				const RtfControlWord *	rcw,
				int			arg,
				RtfReadingContext *	rrc	)
    {
    int				rval;

    rval= docRtfConsumeGroup( sis, DOClevPARA, rrc,
				docRtfEmptyTable, docRtfEmptyTable,
				docRtfSaveObjectData );
    if  ( rval )
	{ SLDEB(rcw->rcwWord,rval);	}

    return rval;
    }

static int docRtfResultWord(	SimpleInputStream *	sis,
				const RtfControlWord *	rcw,
				int			arg,
				RtfReadingContext *	rrc	)
    {
    switch( rcw->rcwId )
	{
	case RTFidCGRID:
	    break;
	default:
	    SLDEB(rcw->rcwWord,rcw->rcwId); break;
	    break;
	}

    return 0;
    }

static RtfControlWord	docRtfResultWords[]=
    {
	{ "cgrid",	RTFidCGRID,	DOClevANY, docRtfResultWord, },
	{ 0, 0, 0 }
    };

static RtfControlWord	docRtfResultGroups[]=
    {
	{ "pict",	RTFidPICT,	DOClevPARA, docRtfReadResultPict, },
	{ "nonshppict",	RTFidNONSHPPICT,DOClevPARA, docRtfReadNonshResultpict, },
	{ 0, 0, 0 }
    };

static int docRtfObjectResult(	SimpleInputStream *	sis,
				const RtfControlWord *	rcw,
				int			arg,
				RtfReadingContext *	rrc	)
    {
    int				rval;

    rval= docRtfConsumeGroup( sis, DOClevPARA, rrc,
				docRtfResultWords, docRtfResultGroups,
				docRtfIgnoreParticule );
    if  ( rval )
	{ SLDEB(rcw->rcwWord,rval);	}

    return rval;
    }

static RtfControlWord	docRtfObjectWords[]=
    {
	{ "objemb",	RTFidOBJEMB,	DOClevPARA, docRtfObjectWord, },
	{ "objw",	RTFidOBJW,	DOClevPARA, docRtfObjectWord, },
	{ "objh",	RTFidOBJH,	DOClevPARA, docRtfObjectWord, },
	{ "objscalex",	RTFidOBJSCALEX,	DOClevPARA, docRtfObjectWord, },
	{ "objscaley",	RTFidOBJSCALEY,	DOClevPARA, docRtfObjectWord, },
	{ "objsetsize",	RTFidOBJSETSIZE,DOClevPARA, docRtfObjectWord, },
	{ "rsltmerge",	RTFidRSLTMERGE, DOClevPARA, docRtfObjectWord, },
	{ 0, 0, 0 }
    };

static RtfControlWord	docRtfObjectGroups[]=
    {
	{ "objname",	RTFidOBJNAME,	DOClevPARA, docRtfObjectName, },
	{ "objclass",	RTFidOBJCLASS,	DOClevPARA, docRtfObjectClass, },
	{ "objdata",	RTFidOBJDATA,	DOClevPARA, docRtfObjectData, },
	{ "result",	RTFidOBJDATA,	DOClevPARA, docRtfObjectResult, },
	{ 0, 0, 0 }
    };

int docRtfReadObject(	SimpleInputStream *	sis,
			const RtfControlWord *	rcw,
			int			arg,
			RtfReadingContext *	rrc )
    {
    int				rval;

    BufferItem *		bi= rrc->rrcBi;
    int				off= bi->biParaStrlen;

    if  ( docInflateTextString( bi, 1 ) )
	{ LLDEB(bi->biParaStrlen,1); return -1; }

    bi->biParaString[off]= ' ';
    bi->biParaStrlen++;
    bi->biParaString[bi->biParaStrlen]= '\0';

    if  ( ! docInsertObject( bi, &rrc->rrcInsertedObject, -1,
					off, rrc->rrcCurrentTextAttribute ) )
	{ LDEB(bi->biParaParticuleCount); return -1;	}

    rval= docRtfConsumeGroup( sis, DOClevPARA, rrc,
				docRtfObjectWords, docRtfObjectGroups,
				docRtfSaveObjectData );

    if  ( rval )
	{ SLDEB(rcw->rcwWord,rval);	}

    return rval;
    }