1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #include "precompile.h"
31 #include <comphelper/newarray.hxx>
42 static short fboxnum
= 1;
43 static int zindex
= 1;
44 static int lnnumber
= 0;
46 int HBox::Read(HWPFile
& )
55 int SkipData::Read(HWPFile
& hwpf
)
57 hwpf
.Read4b(&data_block_len
, 1);
58 hwpf
.Read2b(&dummy
, 1);
60 if (!(IS_SP_SKIP_BLOCK(hh
) && (hh
== dummy
))){
61 return hwpf
.SetState(HWP_InvalidFileFormat
);
64 data_block
= new char[data_block_len
];
66 return hwpf
.Read1b(data_block
, data_block_len
);
71 int FieldCode::Read(HWPFile
& hwpf
)
75 ulong len1
; /* hcharŸÀÔÀÇ ¹®ÀÚ¿ Å×ÀÌÅÍ #1ÀÇ ±æÀÌ */
76 ulong len2
; /* hcharŸÀÔÀÇ ¹®ÀÚ¿ Å×ÀÌÅÍ #2ÀÇ ±æÀÌ */
77 ulong len3
; /* hcharŸÀÔÀÇ ¹®ÀÚ¿ Å×ÀÌÅÍ #3ÀÇ ±æÀÌ */
78 ulong binlen
; /* ÀÓÀÇ Çü½ÄÀÇ ¹ÙÀ̳ʸ® µ¥ÀÌŸ ±æÀÌ */
80 hwpf
.Read4b(&size
, 1);
81 hwpf
.Read2b(&dummy
, 1);
82 hwpf
.Read1b(&type
, 2);
83 hwpf
.Read4b(reserved1
, 1);
84 hwpf
.Read2b(&location_info
, 1);
85 hwpf
.Read1b(reserved2
, 22);
86 hwpf
.Read4b(&len1
, 1);
87 hwpf
.Read4b(&len2
, 1);
88 hwpf
.Read4b(&len3
, 1);
89 hwpf
.Read4b(&binlen
, 1);
91 ulong
const len1_
= ((len1
> 1024) ? 1024 : len1
) / sizeof(hchar
);
92 ulong
const len2_
= ((len2
> 1024) ? 1024 : len2
) / sizeof(hchar
);
93 ulong
const len3_
= ((len3
> 1024) ? 1024 : len3
) / sizeof(hchar
);
95 str1
= new hchar
[len1_
? len1_
: 1];
96 str2
= new hchar
[len2_
? len2_
: 1];
97 str3
= new hchar
[len3_
? len3_
: 1];
98 bin
= new char[binlen
];
100 hwpf
.Read2b(str1
, len1_
);
101 hwpf
.SkipBlock(len1
- (len1_
* sizeof(hchar
)));
102 str1
[len1_
? (len1_
- 1) : 0] = 0;
103 hwpf
.Read2b(str2
, len2_
);
104 hwpf
.SkipBlock(len2
- (len2_
* sizeof(hchar
)));
105 str2
[len2_
? (len2_
- 1) : 0] = 0;
106 hwpf
.Read2b(str3
, len3_
);
107 hwpf
.SkipBlock(len3
- (len3_
* sizeof(hchar
)));
108 str3
[len3_
? (len3_
- 1) : 0] = 0;
110 hwpf
.ReadBlock(bin
, binlen
);
112 if( type
[0] == 3 && type
[1] == 2 ){ /* ¸¸µç³¯Â¥·Î¼ Æ÷¸ËÀ» »ý¼ºÇØ¾ß ÇÑ´Ù. */
113 DateCode
*pDate
= new DateCode
;
114 for (int i
= 0 ; i
< static_cast<int>(len3_
); i
++) {
115 if(str3
[i
] == 0 ) break;
116 if( i
>= DATE_SIZE
) break;
117 pDate
->format
[i
] = str3
[i
];
119 hwpf
.AddDateFormat(pDate
);
128 int Bookmark::Read(HWPFile
& hwpf
)
132 hwpf
.Read4b(&len
, 1);
133 dummy
= sal::static_int_cast
<hchar
>(hwpf
.Read2b());
135 if (!(len
== 34))// 2 * (BMK_COMMENT_LEN + 1) + 2
137 return hwpf
.SetState(HWP_InvalidFileFormat
);
139 if (!(hh
== dummy
&& dummy
== CH_BOOKMARK
)){
140 return hwpf
.SetState(HWP_InvalidFileFormat
);
143 hwpf
.Read2b(id
, BMK_COMMENT_LEN
+ 1);
144 hwpf
.Read2b(&type
, 1);
145 //return hwpf.Read2b(&type, 1);
152 int DateFormat::Read(HWPFile
& hwpf
)
154 hwpf
.Read2b(format
, DATE_SIZE
);
155 dummy
= sal::static_int_cast
<hchar
>(hwpf
.Read2b());
156 if (!(hh
== dummy
&& CH_DATE_FORM
== dummy
)){
157 return hwpf
.SetState(HWP_InvalidFileFormat
);
165 int DateCode::Read(HWPFile
& hwpf
)
167 hwpf
.Read2b(format
, DATE_SIZE
);
168 hwpf
.Read2b(date
, 6);
169 dummy
= sal::static_int_cast
<hchar
>(hwpf
.Read2b());
170 if (!(hh
== dummy
&& CH_DATE_CODE
== dummy
)){
171 return hwpf
.SetState(HWP_InvalidFileFormat
);
173 hwpf
.AddDateFormat(this);
180 int Tab::Read(HWPFile
& hwpf
)
182 width
= hwpf
.Read2b();
183 leader
= sal::static_int_cast
<unsigned short>(hwpf
.Read2b());
184 dummy
= sal::static_int_cast
<hchar
>(hwpf
.Read2b());
185 if (!(hh
== dummy
&& CH_TAB
== dummy
)){
186 return hwpf
.SetState(HWP_InvalidFileFormat
);
192 // tbox(10) TABLE BOX MATH BUTTON HYPERTEXT
194 static void UpdateBBox(FBox
* fbox
)
196 fbox
->boundsy
= fbox
->pgy
;
197 fbox
->boundey
= fbox
->pgy
+ fbox
->ys
- 1;
201 void Cell::Read(HWPFile
& hwpf
)
204 hwpf
.Read2b(&color
, 1);
209 hwpf
.Read2b(&txthigh
, 1);
210 hwpf
.Read2b(&cellhigh
, 1);
212 hwpf
.Read1b(&flag
, 1);
213 hwpf
.Read1b(&changed
, 1);
214 hwpf
.Read1b(&used
, 1);
215 hwpf
.Read1b(&ver_align
, 1);
216 hwpf
.Read1b(linetype
, 4);
217 hwpf
.Read1b(&shade
, 1);
218 hwpf
.Read1b(&diagonal
, 1);
219 hwpf
.Read1b(&protect
, 1);
223 int TxtBox::Read(HWPFile
& hwpf
)
227 hwpf
.Read2b(reserved
, 2);
228 hwpf
.Read2b(&dummy
, 1);
230 if (!(hh
== dummy
&& CH_TEXT_BOX
== dummy
)){
231 return hwpf
.SetState(HWP_InvalidFileFormat
);
234 hwpf
.Read2b(&style
.cap_len
, 1);
235 hwpf
.Read2b(&dummy1
, 1);
236 hwpf
.Read2b(&next
, 1);
237 hwpf
.Read2b(&dummy2
, 1);
239 style
.boxnum
= fboxnum
++;
241 hwpf
.Read1b(&style
.anchor_type
, 1);
242 hwpf
.Read1b(&style
.txtflow
, 1);
243 hwpf
.Read2b(&style
.xpos
, 1);
244 hwpf
.Read2b(&style
.ypos
, 1);
245 hwpf
.Read2b(&option
, 1);
246 hwpf
.Read2b(&ctrl_ch
, 1);
247 hwpf
.Read2b(style
.margin
, 12);
248 hwpf
.AddFBoxStyle(&style
);
249 hwpf
.Read2b(&box_xs
, 1);
250 hwpf
.Read2b(&box_ys
, 1);
251 hwpf
.Read2b(&cap_xs
, 1);
252 hwpf
.Read2b(&cap_ys
, 1);
253 hwpf
.Read2b(&style
.cap_len
, 1);
256 hwpf
.Read2b(&cap_margin
, 1);
257 hwpf
.Read1b(&xpos_type
, 1);
258 hwpf
.Read1b(&ypos_type
, 1);
259 hwpf
.Read1b(&smart_linesp
, 1);
260 hwpf
.Read1b(&reserved1
, 1);
261 hwpf
.Read2b(&pgx
, 1);
262 hwpf
.Read2b(&pgy
, 1);
263 hwpf
.Read2b(&pgno
, 1);
264 if( ( pgno
+1 ) != hwpf
.getCurrentPage() )
265 pgno
= sal::static_int_cast
<short>(hwpf
.getCurrentPage() -1) ;
267 hwpf
.Read2b(&showpg
, 1);
268 hwpf
.Read2b(&cap_pos
, 1);
269 hwpf
.Read2b(&num
, 1);
270 hwpf
.Read2b(&dummy3
, 1);
271 hwpf
.Read2b(&baseline
, 1);
272 hwpf
.Read2b(&type
, 1);
273 hwpf
.Read2b(&nCell
, 1);
274 hwpf
.Read2b(&protect
, 1);
298 return hwpf
.SetState(HWP_InvalidFileFormat
);
301 cell
= ::comphelper::newArray_null
<Cell
>(ncell
);
303 return hwpf
.SetState(HWP_InvalidFileFormat
);
305 for (ii
= 0; ii
< ncell
; ii
++)
308 cell
[ii
].key
= sal::static_int_cast
<unsigned char>(ii
);
311 style
.cell
= &cell
[0];
312 plists
= ::comphelper::newArray_null
< std::list
< HWPPara
* > >(ncell
);
314 return hwpf
.SetState(HWP_InvalidFileFormat
);
316 for (ii
= 0; ii
< ncell
; ii
++)
317 hwpf
.ReadParaList(plists
[ii
]);
319 hwpf
.ReadParaList(caption
);
321 if( type
== 0 ){ // if table?
322 Table
*tbl
= new Table
;
323 for( ii
= 0 ; ii
< ncell
; ii
++)
325 tbl
->columns
.insert(cell
[ii
].x
);
326 tbl
->columns
.insert(cell
[ii
].x
+ cell
[ii
].w
);
327 tbl
->rows
.insert(cell
[ii
].y
);
328 tbl
->rows
.insert(cell
[ii
].y
+ cell
[ii
].h
);
330 TCell
* *pArr
= ::comphelper::newArray_null
<TCell
*>(ncell
);
332 return hwpf
.SetState(HWP_InvalidFileFormat
);
334 for( ii
= 0 ; ii
< ncell
; ii
++)
336 TCell
*tcell
= new TCell
;
337 tcell
->nColumnIndex
= tbl
->columns
.getIndex(cell
[ii
].x
);
338 tcell
->nColumnSpan
= tbl
->columns
.getIndex(cell
[ii
].x
+ cell
[ii
].w
) -
340 tcell
->nRowIndex
= tbl
->rows
.getIndex(cell
[ii
].y
);
341 tcell
->nRowSpan
= tbl
->rows
.getIndex(cell
[ii
].y
+ cell
[ii
].h
) -
343 tcell
->pCell
= &cell
[ii
];
347 // Sort by row and column
348 for( ii
= 0 ; ii
< ncell
- 1; ii
++ ){
349 for( int jj
= ii
; jj
< ncell
; jj
++){
350 if( pArr
[ii
]->nRowIndex
> pArr
[jj
]->nRowIndex
){
356 for( int kk
= ii
; kk
> 0 ; kk
--){
357 if( ( pArr
[kk
]->nRowIndex
== pArr
[kk
-1]->nRowIndex
) &&
358 (pArr
[kk
]->nColumnIndex
< pArr
[kk
-1]->nColumnIndex
)){
360 pArr
[kk
] = pArr
[kk
-1];
365 for( ii
= 0 ; ii
< ncell
; ii
++ ){
366 tbl
->cells
.push_back(pArr
[ii
]);
376 return !hwpf
.State();
381 int Picture::Read(HWPFile
& hwpf
)
383 hwpf
.Read2b(reserved
, 2);
384 hwpf
.Read2b(&dummy
, 1);
386 if (!(hh
== dummy
&& CH_PICTURE
== dummy
)){
387 return hwpf
.SetState(HWP_InvalidFileFormat
);
391 hwpf
.Read4b(&follow_block_size
, 1);
392 hwpf
.Read2b(&dummy1
, 1); /* ¿¹¾à 4¹ÙÀÌÆ® */
393 hwpf
.Read2b(&dummy2
, 1);
395 style
.boxnum
= fboxnum
++;
397 hwpf
.Read1b(&style
.anchor_type
, 1); /* ±âÁØÀ§Ä¡ */
398 hwpf
.Read1b(&style
.txtflow
, 1); /* ±×¸²ÇÇÇÔ. 0-2(ÀÚ¸®Â÷Áö,Åõ¸í,¾î¿ï¸²) */
399 hwpf
.Read2b(&style
.xpos
, 1); /* °¡·ÎÀ§Ä¡ : 1 ¿ÞÂÊ, 2¿À¸¥ÂÊ, 3 °¡¿îµ¥, ÀÌ¿Ü = ÀÓÀÇ */
400 hwpf
.Read2b(&style
.ypos
, 1); /* ¼¼·ÎÀ§Ä¡ : 1 À§, 2 ¾Æ·¡, 3 °¡¿îµ¥, ÀÌ¿Ü ÀÓÀÇ */
401 hwpf
.Read2b(&option
, 1); /* ±âŸ¿É¼Ç : Å׵θ®,±×¸²¹ÝÀü,µî. bit·Î ÀúÀå. */
402 hwpf
.Read2b(&ctrl_ch
, 1); /* Ç×»ó 11 */
403 hwpf
.Read2b(style
.margin
, 12); /* ¿©¹é : [0-2][] out/in/¼¿,[][0-3] ¿Þ/¿À¸¥/À§/¾Æ·¡ ¿©¹é */
404 hwpf
.Read2b(&box_xs
, 1); /* ¹Ú½ºÅ©±â °¡·Î */
405 hwpf
.Read2b(&box_ys
, 1); /* ¼¼·Î */
406 hwpf
.Read2b(&cap_xs
, 1); /* ĸ¼Ç Å©±â °¡·Î */
407 hwpf
.Read2b(&cap_ys
, 1); /* ¼¼·Î */
408 hwpf
.Read2b(&style
.cap_len
, 1); /* ±æÀÌ */
409 hwpf
.Read2b(&xs
, 1); /* Àüü Å©±â(¹Ú½º Å©±â + ĸ¼Ç + ¿©¹é) °¡·Î */
410 hwpf
.Read2b(&ys
, 1); /* ¼¼·Î */
411 hwpf
.Read2b(&cap_margin
, 1); /* ĸ¼Ç ¿©¹é */
412 hwpf
.Read1b(&xpos_type
, 1);
413 hwpf
.Read1b(&ypos_type
, 1);
414 hwpf
.Read1b(&smart_linesp
, 1); /* ÁÙ°£°Ý º¸È£ : 0 ¹Ìº¸È£, 1 º¸È£ */
415 hwpf
.Read1b(&reserved1
, 1);
416 hwpf
.Read2b(&pgx
, 1); /* ½ÇÁ¦ °è»êµÈ ¹Ú½º °¡·Î */
417 hwpf
.Read2b(&pgy
, 1); /* ¼¼·Î */
418 hwpf
.Read2b(&pgno
, 1); /* ÆäÀÌÁö ¼ýÀÚ : 0ºÎÅÍ ½ÃÀÛ */
419 hwpf
.Read2b(&showpg
, 1); /* ¹Ú½ºº¸¿©ÁÜ */
420 hwpf
.Read2b(&cap_pos
, 1); /* ĸ¼ÇÀ§Ä¡ 0 - 7 ¸Þ´º¼ø¼. */
421 hwpf
.Read2b(&num
, 1); /* ¹Ú½º¹øÈ£ 0ºÎÅÍ ½ÃÀÛÇؼ ¸Å±äÀϷùøÈ£ */
423 hwpf
.Read1b(&pictype
, 1); /* ±×¸²Á¾·ù */
425 skip
[0] = (short) hwpf
.Read2b(); /* ±×¸²¿¡¼ ½ÇÁ¦ Ç¥½Ã¸¦ ½ÃÀÛÇÒ À§Ä¡ °¡·Î */
426 skip
[1] = (short) hwpf
.Read2b(); /* ¼¼·Î */
427 scale
[0] = (short) hwpf
.Read2b(); /* È®´ëºñÀ² : 0 °íÁ¤, ÀÌ¿Ü ÆÛ¼¾Æ® ´ÜÀ§ °¡·Î */
428 scale
[1] = (short) hwpf
.Read2b(); /* ¼¼·Î */
430 hwpf
.Read1b(picinfo
.picun
.path
, 256); /* ±×¸²ÆÄÀÏ À̸§ : Á¾·ù°¡ DrawingÀÌ ¾Æ´Ò¶§. */
431 hwpf
.Read1b(reserved3
, 9); /* ¹à±â/¸í¾Ï/±×¸²È¿°ú µî */
434 if( pictype
!= PICTYPE_DRAW
)
435 style
.cell
= reserved3
;
437 if (follow_block_size
!= 0)
439 follow
= new unsigned char[follow_block_size
];
441 hwpf
.Read1b(follow
, follow_block_size
);
442 if (pictype
== PICTYPE_DRAW
)
444 hmem
= new HMemIODev((char *) follow
, follow_block_size
);
445 LoadDrawingObjectBlock(this);
446 style
.cell
= picinfo
.picdraw
.hdo
;
453 if ((follow
[3] << 24 | follow
[2] << 16 | follow
[1] << 8 | follow
[0]) == 0x269)
464 hwpf
.AddFBoxStyle(&style
);
467 hwpf
.ReadParaList(caption
);
469 return !hwpf
.State();
475 Line::Line():FBox(CH_LINE
)
480 int Line::Read(HWPFile
& hwpf
)
482 hwpf
.Read2b(reserved
, 2);
483 hwpf
.Read2b(&dummy
, 1);
485 if (!(hh
== dummy
&& CH_LINE
== dummy
)){
486 return hwpf
.SetState(HWP_InvalidFileFormat
);
490 style
.boxnum
= fboxnum
++;
493 hwpf
.Read1b(&reserved2
, 8);
494 hwpf
.Read1b(&style
.anchor_type
, 1);
495 hwpf
.Read1b(&style
.txtflow
, 1);
496 hwpf
.Read2b(&style
.xpos
, 1);
497 hwpf
.Read2b(&style
.ypos
, 1);
498 hwpf
.Read2b(&option
, 1);
499 hwpf
.Read2b(&ctrl_ch
, 1);
500 hwpf
.Read2b(style
.margin
, 12);
501 hwpf
.AddFBoxStyle(&style
);
502 hwpf
.Read2b(&box_xs
, 1);
503 hwpf
.Read2b(&box_ys
, 1);
504 hwpf
.Read2b(&cap_xs
, 1);
505 hwpf
.Read2b(&cap_ys
, 1);
506 hwpf
.Read2b(&style
.cap_len
, 1);
509 lnnumber
= style
.boxnum
;
511 hwpf
.Read2b(&boundsy
, 1);
512 hwpf
.Read2b(&boundey
, 1);
513 hwpf
.Read1b(&boundx
, 1);
514 hwpf
.Read1b(&draw
, 1);
516 hwpf
.Read2b(&pgx
, 1);
517 hwpf
.Read2b(&pgy
, 1);
518 hwpf
.Read2b(&pgno
, 1);
519 hwpf
.Read2b(&showpg
, 1);
525 hwpf
.Read2b(&width
, 1);
526 hwpf
.Read2b(&shade
, 1);
527 hwpf
.Read2b(&color
, 1);
530 return !hwpf
.State();
535 Hidden::Hidden():HBox(CH_HIDDEN
)
540 int Hidden::Read(HWPFile
& hwpf
)
542 hwpf
.Read2b(reserved
, 2);
543 hwpf
.Read2b(&dummy
, 1);
544 if (!(hh
== dummy
&& CH_HIDDEN
== dummy
)){
545 return hwpf
.SetState(HWP_InvalidFileFormat
);
548 hwpf
.Read1b(info
, 8);
549 hwpf
.ReadParaList(plist
);
551 return !hwpf
.State();
556 HeaderFooter::HeaderFooter():HBox(CH_HEADER_FOOTER
)
562 int HeaderFooter::Read(HWPFile
& hwpf
)
564 hwpf
.Read2b(reserved
, 2);
565 hwpf
.Read2b(&dummy
, 1);
566 if (!(hh
== dummy
&& CH_HEADER_FOOTER
== dummy
)){
567 return hwpf
.SetState(HWP_InvalidFileFormat
);
570 hwpf
.Read1b(info
, 8);
571 hwpf
.Read1b(&type
, 1);
572 hwpf
.Read1b(&where
, 1);
574 hwpf
.ReadParaList(plist
, CH_HEADER_FOOTER
);
575 linenumber
= sal::static_int_cast
<unsigned char>(lnnumber
);
576 m_nPageNumber
= hwpf
.getCurrentPage();
577 hwpf
.setMaxSettedPage();
578 hwpf
.AddHeaderFooter(this);
580 return !hwpf
.State();
585 Footnote::Footnote():HBox(CH_FOOTNOTE
)
590 int Footnote::Read(HWPFile
& hwpf
)
592 hwpf
.Read2b(reserved
, 2);
593 hwpf
.Read2b(&dummy
, 1);
594 if (!(hh
== dummy
&& CH_FOOTNOTE
== dummy
)){
595 return hwpf
.SetState(HWP_InvalidFileFormat
);
598 hwpf
.Read1b(info
, 8);
599 hwpf
.Read2b(&number
, 1);
600 hwpf
.Read2b(&type
, 1);
601 width
= (short) hwpf
.Read2b();
602 hwpf
.ReadParaList(plist
, CH_FOOTNOTE
);
604 return !hwpf
.State();
609 AutoNum::AutoNum():HBox(CH_AUTO_NUM
)
614 int AutoNum::Read(HWPFile
& hwpf
)
616 hwpf
.Read2b(&type
, 1);
617 hwpf
.Read2b(&number
, 1);
618 hwpf
.Read2b(&dummy
, 1);
621 return hwpf
.SetState(HWP_InvalidFileFormat
);
623 return !hwpf
.State();
628 NewNum::NewNum():HBox(CH_NEW_NUM
)
633 int NewNum::Read(HWPFile
& hwpf
)
635 hwpf
.Read2b(&type
, 1);
636 hwpf
.Read2b(&number
, 1);
637 hwpf
.Read2b(&dummy
, 1);
640 return hwpf
.SetState(HWP_InvalidFileFormat
);
642 return !hwpf
.State();
646 // show page number (20)
647 ShowPageNum::ShowPageNum():HBox(CH_SHOW_PAGE_NUM
)
652 int ShowPageNum::Read(HWPFile
& hwpf
)
654 hwpf
.Read2b(&where
, 1);
655 hwpf
.Read2b(&shape
, 1);
656 hwpf
.Read2b(&dummy
, 1);
659 return hwpf
.SetState(HWP_InvalidFileFormat
);
661 m_nPageNumber
= hwpf
.getCurrentPage();
662 hwpf
.setMaxSettedPage();
663 hwpf
.AddPageNumber(this);
664 return !hwpf
.State();
668 /* Ȧ¼öÂʽÃÀÛ/°¨Ãß±â (21) */
669 PageNumCtrl::PageNumCtrl():HBox(CH_PAGE_NUM_CTRL
)
674 int PageNumCtrl::Read(HWPFile
& hwpf
)
676 hwpf
.Read2b(&kind
, 1);
677 hwpf
.Read2b(&what
, 1);
678 hwpf
.Read2b(&dummy
, 1);
681 return hwpf
.SetState(HWP_InvalidFileFormat
);
683 return !hwpf
.State();
688 MailMerge::MailMerge():HBox(CH_MAIL_MERGE
)
693 int MailMerge::Read(HWPFile
& hwpf
)
695 hwpf
.Read1b(field_name
, 20);
696 hwpf
.Read2b(&dummy
, 1);
699 return hwpf
.SetState(HWP_InvalidFileFormat
);
701 return !hwpf
.State();
705 // char compositon(23)
706 Compose::Compose():HBox(CH_COMPOSE
)
711 int Compose::Read(HWPFile
& hwpf
)
713 hwpf
.Read2b(compose
, 3);
714 hwpf
.Read2b(&dummy
, 1);
717 return hwpf
.SetState(HWP_InvalidFileFormat
);
719 return !hwpf
.State();
724 Hyphen::Hyphen():HBox(CH_HYPHEN
)
729 int Hyphen::Read(HWPFile
& hwpf
)
731 hwpf
.Read2b(&width
, 1);
732 hwpf
.Read2b(&dummy
, 1);
735 return hwpf
.SetState(HWP_InvalidFileFormat
);
737 return !hwpf
.State();
742 TocMark::TocMark():HBox(CH_TOC_MARK
)
747 int TocMark::Read(HWPFile
& hwpf
)
749 hwpf
.Read2b(&kind
, 1);
750 hwpf
.Read2b(&dummy
, 1);
753 return hwpf
.SetState(HWP_InvalidFileFormat
);
755 return !hwpf
.State();
760 IndexMark::IndexMark():HBox(CH_INDEX_MARK
)
765 int IndexMark::Read(HWPFile
& hwpf
)
767 hwpf
.Read2b(&keyword1
, 60);
768 hwpf
.Read2b(&keyword2
, 60);
769 hwpf
.Read2b(&pgno
, 1);
770 hwpf
.Read2b(&dummy
, 1);
773 return hwpf
.SetState(HWP_InvalidFileFormat
);
775 return !hwpf
.State();
780 Outline::Outline():HBox(CH_OUTLINE
)
785 int Outline::Read(HWPFile
& hwpf
)
787 hwpf
.Read2b(&kind
, 1);
788 hwpf
.Read1b(&shape
, 1);
789 hwpf
.Read1b(&level
, 1);
790 hwpf
.Read2b(number
, 7);
791 hwpf
.Read2b(user_shape
, 7);
792 hwpf
.Read2b(deco
, 14);
793 hwpf
.Read2b(&dummy
, 1);
796 return hwpf
.SetState(HWP_InvalidFileFormat
);
798 return !hwpf
.State();
803 KeepSpace::KeepSpace():HBox(CH_KEEP_SPACE
)
808 int KeepSpace::Read(HWPFile
& hwpf
)
810 hwpf
.Read2b(&dummy
, 1);
813 return hwpf
.SetState(HWP_InvalidFileFormat
);
815 return !hwpf
.State();
819 /* °íÁ¤Æø ºóÄ(31) */
820 FixedSpace::FixedSpace():HBox(CH_FIXED_SPACE
)
825 int FixedSpace::Read(HWPFile
& hwpf
)
827 hwpf
.Read2b(&dummy
, 1);
830 return hwpf
.SetState(HWP_InvalidFileFormat
);
832 return !hwpf
.State();
835 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */