1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: hwpread.cpp,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 /* $Id: hwpread.cpp,v 1.5 2008-04-10 12:10:14 rt Exp $ */
33 #include "precompile.h"
44 static short fboxnum
= 1;
45 static int zindex
= 1;
46 static int lnnumber
= 0;
48 int HBox::Read(HWPFile
& )
57 int SkipBlock::Read(HWPFile
& hwpf
)
59 hwpf
.Read4b(&data_block_len
, 1);
60 hwpf
.Read2b(&dummy
, 1);
62 if (!(IS_SP_SKIP_BLOCK(hh
) && (hh
== dummy
))){
63 return hwpf
.SetState(HWP_InvalidFileFormat
);
66 data_block
= new char[data_block_len
];
68 return hwpf
.Read1b(data_block
, data_block_len
);
73 int FieldCode::Read(HWPFile
& hwpf
)
77 ulong len1
; /* hcharŸÀÔÀÇ ¹®ÀÚ¿ Å×ÀÌÅÍ #1ÀÇ ±æÀÌ */
78 ulong len2
; /* hcharŸÀÔÀÇ ¹®ÀÚ¿ Å×ÀÌÅÍ #2ÀÇ ±æÀÌ */
79 ulong len3
; /* hcharŸÀÔÀÇ ¹®ÀÚ¿ Å×ÀÌÅÍ #3ÀÇ ±æÀÌ */
80 ulong binlen
; /* ÀÓÀÇ Çü½ÄÀÇ ¹ÙÀ̳ʸ® µ¥ÀÌŸ ±æÀÌ */
82 hwpf
.Read4b(&size
, 1);
83 hwpf
.Read2b(&dummy
, 1);
84 hwpf
.Read1b(&type
, 2);
85 hwpf
.Read4b(reserved1
, 1);
86 hwpf
.Read2b(&location_info
, 1);
87 hwpf
.Read1b(reserved2
, 22);
88 hwpf
.Read4b(&len1
, 1);
89 hwpf
.Read4b(&len2
, 1);
90 hwpf
.Read4b(&len3
, 1);
91 hwpf
.Read4b(&binlen
, 1);
93 str1
= new hchar
[len1
];
94 str2
= new hchar
[len2
];
95 str3
= new hchar
[len3
];
96 bin
= new char[binlen
];
98 hwpf
.Read2b(str1
, len1
/2);
99 hwpf
.Read2b(str2
, len2
/2);
100 hwpf
.Read2b(str3
, len3
/2);
102 hwpf
.ReadBlock(bin
, binlen
);
104 if( type
[0] == 3 && type
[1] == 2 ){ /* ¸¸µç³¯Â¥·Î¼ Æ÷¸ËÀ» »ý¼ºÇØ¾ß ÇÑ´Ù. */
105 DateCode
*pDate
= new DateCode
;
106 for( int i
= 0 ;i
< (int)(len3
/2) ; i
++ ){
107 if(str3
[i
] == 0 ) break;
108 if( i
>= DATE_SIZE
) break;
109 pDate
->format
[i
] = str3
[i
];
111 hwpf
.AddDateFormat(pDate
);
120 int Bookmark::Read(HWPFile
& hwpf
)
124 hwpf
.Read4b(&len
, 1);
125 dummy
= sal::static_int_cast
<hchar
>(hwpf
.Read2b());
127 if (!(len
== 34))// 2 * (BMK_COMMENT_LEN + 1) + 2
129 return hwpf
.SetState(HWP_InvalidFileFormat
);
131 if (!(hh
== dummy
&& dummy
== CH_BOOKMARK
)){
132 return hwpf
.SetState(HWP_InvalidFileFormat
);
135 hwpf
.Read2b(id
, BMK_COMMENT_LEN
+ 1);
136 hwpf
.Read2b(&type
, 1);
137 //return hwpf.Read2b(&type, 1);
144 int DateFormat::Read(HWPFile
& hwpf
)
146 hwpf
.Read2b(format
, DATE_SIZE
);
147 dummy
= sal::static_int_cast
<hchar
>(hwpf
.Read2b());
148 if (!(hh
== dummy
&& CH_DATE_FORM
== dummy
)){
149 return hwpf
.SetState(HWP_InvalidFileFormat
);
157 int DateCode::Read(HWPFile
& hwpf
)
159 hwpf
.Read2b(format
, DATE_SIZE
);
160 hwpf
.Read2b(date
, 6);
161 dummy
= sal::static_int_cast
<hchar
>(hwpf
.Read2b());
162 if (!(hh
== dummy
&& CH_DATE_CODE
== dummy
)){
163 return hwpf
.SetState(HWP_InvalidFileFormat
);
165 hwpf
.AddDateFormat(this);
172 int Tab::Read(HWPFile
& hwpf
)
174 width
= hwpf
.Read2b();
175 leader
= sal::static_int_cast
<unsigned short>(hwpf
.Read2b());
176 dummy
= sal::static_int_cast
<hchar
>(hwpf
.Read2b());
177 if (!(hh
== dummy
&& CH_TAB
== dummy
)){
178 return hwpf
.SetState(HWP_InvalidFileFormat
);
184 // tbox(10) TABLE BOX MATH BUTTON HYPERTEXT
186 static void UpdateBBox(FBox
* fbox
)
188 fbox
->boundsy
= fbox
->pgy
;
189 fbox
->boundey
= fbox
->pgy
+ fbox
->ys
- 1;
193 void Cell::Read(HWPFile
& hwpf
)
196 hwpf
.Read2b(&color
, 1);
201 hwpf
.Read2b(&txthigh
, 1);
202 hwpf
.Read2b(&cellhigh
, 1);
204 hwpf
.Read1b(&flag
, 1);
205 hwpf
.Read1b(&changed
, 1);
206 hwpf
.Read1b(&used
, 1);
207 hwpf
.Read1b(&ver_align
, 1);
208 hwpf
.Read1b(linetype
, 4);
209 hwpf
.Read1b(&shade
, 1);
210 hwpf
.Read1b(&diagonal
, 1);
211 hwpf
.Read1b(&protect
, 1);
215 int TxtBox::Read(HWPFile
& hwpf
)
219 hwpf
.Read2b(reserved
, 2);
220 hwpf
.Read2b(&dummy
, 1);
222 if (!(hh
== dummy
&& CH_TEXT_BOX
== dummy
)){
223 return hwpf
.SetState(HWP_InvalidFileFormat
);
226 hwpf
.Read2b(&style
.cap_len
, 1);
227 hwpf
.Read2b(&dummy1
, 1);
228 hwpf
.Read2b(&next
, 1);
229 hwpf
.Read2b(&dummy2
, 1);
231 style
.boxnum
= fboxnum
++;
233 hwpf
.Read1b(&style
.anchor_type
, 1);
234 hwpf
.Read1b(&style
.txtflow
, 1);
235 hwpf
.Read2b(&style
.xpos
, 1);
236 hwpf
.Read2b(&style
.ypos
, 1);
237 hwpf
.Read2b(&option
, 1);
238 hwpf
.Read2b(&ctrl_ch
, 1);
239 hwpf
.Read2b(style
.margin
, 12);
240 hwpf
.AddFBoxStyle(&style
);
241 hwpf
.Read2b(&box_xs
, 1);
242 hwpf
.Read2b(&box_ys
, 1);
243 hwpf
.Read2b(&cap_xs
, 1);
244 hwpf
.Read2b(&cap_ys
, 1);
245 hwpf
.Read2b(&style
.cap_len
, 1);
248 hwpf
.Read2b(&cap_margin
, 1);
249 hwpf
.Read1b(&xpos_type
, 1);
250 hwpf
.Read1b(&ypos_type
, 1);
251 hwpf
.Read1b(&smart_linesp
, 1);
252 hwpf
.Read1b(&reserved1
, 1);
253 hwpf
.Read2b(&pgx
, 1);
254 hwpf
.Read2b(&pgy
, 1);
255 hwpf
.Read2b(&pgno
, 1);
256 if( ( pgno
+1 ) != hwpf
.getCurrentPage() )
257 pgno
= sal::static_int_cast
<short>(hwpf
.getCurrentPage() -1) ;
259 hwpf
.Read2b(&showpg
, 1);
260 hwpf
.Read2b(&cap_pos
, 1);
261 hwpf
.Read2b(&num
, 1);
262 hwpf
.Read2b(&dummy3
, 1);
263 hwpf
.Read2b(&baseline
, 1);
264 hwpf
.Read2b(&type
, 1);
265 hwpf
.Read2b(&nCell
, 1);
266 hwpf
.Read2b(&protect
, 1);
290 return hwpf
.SetState(HWP_InvalidFileFormat
);
293 cell
= new Cell
[ncell
];
294 for (ii
= 0; ii
< ncell
; ii
++)
297 cell
[ii
].key
= sal::static_int_cast
<unsigned char>(ii
);
300 style
.cell
= &cell
[0];
301 plists
= new LinkedList
< HWPPara
>[ncell
];
302 for (ii
= 0; ii
< ncell
; ii
++)
303 hwpf
.ReadParaList(plists
[ii
]);
305 hwpf
.ReadParaList(caption
);
307 if( type
== 0 ){ // if table?
308 Table
*tbl
= new Table
;
309 for( ii
= 0 ; ii
< ncell
; ii
++)
311 tbl
->columns
.insert(cell
[ii
].x
);
312 tbl
->columns
.insert(cell
[ii
].x
+ cell
[ii
].w
);
313 tbl
->rows
.insert(cell
[ii
].y
);
314 tbl
->rows
.insert(cell
[ii
].y
+ cell
[ii
].h
);
316 TCell
* *pArr
= new TCell
*[ncell
];
317 for( ii
= 0 ; ii
< ncell
; ii
++)
319 TCell
*tcell
= new TCell
;
320 tcell
->nColumnIndex
= tbl
->columns
.getIndex(cell
[ii
].x
);
321 tcell
->nColumnSpan
= tbl
->columns
.getIndex(cell
[ii
].x
+ cell
[ii
].w
) -
323 tcell
->nRowIndex
= tbl
->rows
.getIndex(cell
[ii
].y
);
324 tcell
->nRowSpan
= tbl
->rows
.getIndex(cell
[ii
].y
+ cell
[ii
].h
) -
326 tcell
->pCell
= &cell
[ii
];
330 // Sort by row and column
331 for( ii
= 0 ; ii
< ncell
- 1; ii
++ ){
332 for( int jj
= ii
; jj
< ncell
; jj
++){
333 if( pArr
[ii
]->nRowIndex
> pArr
[jj
]->nRowIndex
){
339 for( int kk
= ii
; kk
> 0 ; kk
--){
340 if( ( pArr
[kk
]->nRowIndex
== pArr
[kk
-1]->nRowIndex
) &&
341 (pArr
[kk
]->nColumnIndex
< pArr
[kk
-1]->nColumnIndex
)){
343 pArr
[kk
] = pArr
[kk
-1];
348 for( ii
= 0 ; ii
< ncell
; ii
++ ){
349 tbl
->cells
.insert(pArr
[ii
]);
359 return !hwpf
.State();
364 int Picture::Read(HWPFile
& hwpf
)
366 hwpf
.Read2b(reserved
, 2);
367 hwpf
.Read2b(&dummy
, 1);
369 if (!(hh
== dummy
&& CH_PICTURE
== dummy
)){
370 return hwpf
.SetState(HWP_InvalidFileFormat
);
374 hwpf
.Read4b(&follow_block_size
, 1);
375 hwpf
.Read2b(&dummy1
, 1); /* ¿¹¾à 4¹ÙÀÌÆ® */
376 hwpf
.Read2b(&dummy2
, 1);
378 style
.boxnum
= fboxnum
++;
380 hwpf
.Read1b(&style
.anchor_type
, 1); /* ±âÁØÀ§Ä¡ */
381 hwpf
.Read1b(&style
.txtflow
, 1); /* ±×¸²ÇÇÇÔ. 0-2(ÀÚ¸®Â÷Áö,Åõ¸í,¾î¿ï¸²) */
382 hwpf
.Read2b(&style
.xpos
, 1); /* °¡·ÎÀ§Ä¡ : 1 ¿ÞÂÊ, 2¿À¸¥ÂÊ, 3 °¡¿îµ¥, ÀÌ¿Ü = ÀÓÀÇ */
383 hwpf
.Read2b(&style
.ypos
, 1); /* ¼¼·ÎÀ§Ä¡ : 1 À§, 2 ¾Æ·¡, 3 °¡¿îµ¥, ÀÌ¿Ü ÀÓÀÇ */
384 hwpf
.Read2b(&option
, 1); /* ±âŸ¿É¼Ç : Å׵θ®,±×¸²¹ÝÀü,µî. bit·Î ÀúÀå. */
385 hwpf
.Read2b(&ctrl_ch
, 1); /* Ç×»ó 11 */
386 hwpf
.Read2b(style
.margin
, 12); /* ¿©¹é : [0-2][] out/in/¼¿,[][0-3] ¿Þ/¿À¸¥/À§/¾Æ·¡ ¿©¹é */
387 hwpf
.Read2b(&box_xs
, 1); /* ¹Ú½ºÅ©±â °¡·Î */
388 hwpf
.Read2b(&box_ys
, 1); /* ¼¼·Î */
389 hwpf
.Read2b(&cap_xs
, 1); /* ĸ¼Ç Å©±â °¡·Î */
390 hwpf
.Read2b(&cap_ys
, 1); /* ¼¼·Î */
391 hwpf
.Read2b(&style
.cap_len
, 1); /* ±æÀÌ */
392 hwpf
.Read2b(&xs
, 1); /* Àüü Å©±â(¹Ú½º Å©±â + ĸ¼Ç + ¿©¹é) °¡·Î */
393 hwpf
.Read2b(&ys
, 1); /* ¼¼·Î */
394 hwpf
.Read2b(&cap_margin
, 1); /* ĸ¼Ç ¿©¹é */
395 hwpf
.Read1b(&xpos_type
, 1);
396 hwpf
.Read1b(&ypos_type
, 1);
397 hwpf
.Read1b(&smart_linesp
, 1); /* ÁÙ°£°Ý º¸È£ : 0 ¹Ìº¸È£, 1 º¸È£ */
398 hwpf
.Read1b(&reserved1
, 1);
399 hwpf
.Read2b(&pgx
, 1); /* ½ÇÁ¦ °è»êµÈ ¹Ú½º °¡·Î */
400 hwpf
.Read2b(&pgy
, 1); /* ¼¼·Î */
401 hwpf
.Read2b(&pgno
, 1); /* ÆäÀÌÁö ¼ýÀÚ : 0ºÎÅÍ ½ÃÀÛ */
402 hwpf
.Read2b(&showpg
, 1); /* ¹Ú½ºº¸¿©ÁÜ */
403 hwpf
.Read2b(&cap_pos
, 1); /* ĸ¼ÇÀ§Ä¡ 0 - 7 ¸Þ´º¼ø¼. */
404 hwpf
.Read2b(&num
, 1); /* ¹Ú½º¹øÈ£ 0ºÎÅÍ ½ÃÀÛÇؼ ¸Å±äÀϷùøÈ£ */
406 hwpf
.Read1b(&pictype
, 1); /* ±×¸²Á¾·ù */
408 skip
[0] = (short) hwpf
.Read2b(); /* ±×¸²¿¡¼ ½ÇÁ¦ Ç¥½Ã¸¦ ½ÃÀÛÇÒ À§Ä¡ °¡·Î */
409 skip
[1] = (short) hwpf
.Read2b(); /* ¼¼·Î */
410 scale
[0] = (short) hwpf
.Read2b(); /* È®´ëºñÀ² : 0 °íÁ¤, ÀÌ¿Ü ÆÛ¼¾Æ® ´ÜÀ§ °¡·Î */
411 scale
[1] = (short) hwpf
.Read2b(); /* ¼¼·Î */
413 hwpf
.Read1b(picinfo
.picun
.path
, 256); /* ±×¸²ÆÄÀÏ À̸§ : Á¾·ù°¡ DrawingÀÌ ¾Æ´Ò¶§. */
414 hwpf
.Read1b(reserved3
, 9); /* ¹à±â/¸í¾Ï/±×¸²È¿°ú µî */
417 if( pictype
!= PICTYPE_DRAW
)
418 style
.cell
= reserved3
;
420 if (follow_block_size
!= 0)
422 follow
= new unsigned char[follow_block_size
];
424 hwpf
.Read1b(follow
, follow_block_size
);
425 if (pictype
== PICTYPE_DRAW
)
427 hmem
= new HMemIODev((char *) follow
, follow_block_size
);
428 LoadDrawingObjectBlock(this);
429 style
.cell
= picinfo
.picdraw
.hdo
;
436 if ((follow
[3] << 24 | follow
[2] << 16 | follow
[1] << 8 | follow
[0]) == 0x269)
447 hwpf
.AddFBoxStyle(&style
);
450 hwpf
.ReadParaList(caption
);
452 return !hwpf
.State();
458 Line::Line():FBox(CH_LINE
)
463 int Line::Read(HWPFile
& hwpf
)
465 hwpf
.Read2b(reserved
, 2);
466 hwpf
.Read2b(&dummy
, 1);
468 if (!(hh
== dummy
&& CH_LINE
== dummy
)){
469 return hwpf
.SetState(HWP_InvalidFileFormat
);
473 style
.boxnum
= fboxnum
++;
476 hwpf
.Read1b(&reserved2
, 8);
477 hwpf
.Read1b(&style
.anchor_type
, 1);
478 hwpf
.Read1b(&style
.txtflow
, 1);
479 hwpf
.Read2b(&style
.xpos
, 1);
480 hwpf
.Read2b(&style
.ypos
, 1);
481 hwpf
.Read2b(&option
, 1);
482 hwpf
.Read2b(&ctrl_ch
, 1);
483 hwpf
.Read2b(style
.margin
, 12);
484 hwpf
.AddFBoxStyle(&style
);
485 hwpf
.Read2b(&box_xs
, 1);
486 hwpf
.Read2b(&box_ys
, 1);
487 hwpf
.Read2b(&cap_xs
, 1);
488 hwpf
.Read2b(&cap_ys
, 1);
489 hwpf
.Read2b(&style
.cap_len
, 1);
492 lnnumber
= style
.boxnum
;
494 hwpf
.Read2b(&boundsy
, 1);
495 hwpf
.Read2b(&boundey
, 1);
496 hwpf
.Read1b(&boundx
, 1);
497 hwpf
.Read1b(&draw
, 1);
499 hwpf
.Read2b(&pgx
, 1);
500 hwpf
.Read2b(&pgy
, 1);
501 hwpf
.Read2b(&pgno
, 1);
502 hwpf
.Read2b(&showpg
, 1);
508 hwpf
.Read2b(&width
, 1);
509 hwpf
.Read2b(&shade
, 1);
510 hwpf
.Read2b(&color
, 1);
513 return !hwpf
.State();
518 Hidden::Hidden():HBox(CH_HIDDEN
)
523 int Hidden::Read(HWPFile
& hwpf
)
525 hwpf
.Read2b(reserved
, 2);
526 hwpf
.Read2b(&dummy
, 1);
527 if (!(hh
== dummy
&& CH_HIDDEN
== dummy
)){
528 return hwpf
.SetState(HWP_InvalidFileFormat
);
531 hwpf
.Read1b(info
, 8);
532 hwpf
.ReadParaList(plist
);
534 return !hwpf
.State();
539 HeaderFooter::HeaderFooter():HBox(CH_HEADER_FOOTER
)
545 int HeaderFooter::Read(HWPFile
& hwpf
)
547 hwpf
.Read2b(reserved
, 2);
548 hwpf
.Read2b(&dummy
, 1);
549 if (!(hh
== dummy
&& CH_HEADER_FOOTER
== dummy
)){
550 return hwpf
.SetState(HWP_InvalidFileFormat
);
553 hwpf
.Read1b(info
, 8);
554 hwpf
.Read1b(&type
, 1);
555 hwpf
.Read1b(&where
, 1);
557 hwpf
.ReadParaList(plist
, CH_HEADER_FOOTER
);
558 linenumber
= sal::static_int_cast
<unsigned char>(lnnumber
);
559 m_nPageNumber
= hwpf
.getCurrentPage();
560 hwpf
.setMaxSettedPage();
561 hwpf
.AddHeaderFooter(this);
563 return !hwpf
.State();
568 Footnote::Footnote():HBox(CH_FOOTNOTE
)
573 int Footnote::Read(HWPFile
& hwpf
)
575 hwpf
.Read2b(reserved
, 2);
576 hwpf
.Read2b(&dummy
, 1);
577 if (!(hh
== dummy
&& CH_FOOTNOTE
== dummy
)){
578 return hwpf
.SetState(HWP_InvalidFileFormat
);
581 hwpf
.Read1b(info
, 8);
582 hwpf
.Read2b(&number
, 1);
583 hwpf
.Read2b(&type
, 1);
584 width
= (short) hwpf
.Read2b();
585 hwpf
.ReadParaList(plist
, CH_FOOTNOTE
);
587 return !hwpf
.State();
592 AutoNum::AutoNum():HBox(CH_AUTO_NUM
)
597 int AutoNum::Read(HWPFile
& hwpf
)
599 hwpf
.Read2b(&type
, 1);
600 hwpf
.Read2b(&number
, 1);
601 hwpf
.Read2b(&dummy
, 1);
604 return hwpf
.SetState(HWP_InvalidFileFormat
);
606 return !hwpf
.State();
611 NewNum::NewNum():HBox(CH_NEW_NUM
)
616 int NewNum::Read(HWPFile
& hwpf
)
618 hwpf
.Read2b(&type
, 1);
619 hwpf
.Read2b(&number
, 1);
620 hwpf
.Read2b(&dummy
, 1);
623 return hwpf
.SetState(HWP_InvalidFileFormat
);
625 return !hwpf
.State();
629 // show page number (20)
630 ShowPageNum::ShowPageNum():HBox(CH_SHOW_PAGE_NUM
)
635 int ShowPageNum::Read(HWPFile
& hwpf
)
637 hwpf
.Read2b(&where
, 1);
638 hwpf
.Read2b(&shape
, 1);
639 hwpf
.Read2b(&dummy
, 1);
642 return hwpf
.SetState(HWP_InvalidFileFormat
);
644 m_nPageNumber
= hwpf
.getCurrentPage();
645 hwpf
.setMaxSettedPage();
646 hwpf
.AddPageNumber(this);
647 return !hwpf
.State();
651 /* Ȧ¼öÂʽÃÀÛ/°¨Ãß±â (21) */
652 PageNumCtrl::PageNumCtrl():HBox(CH_PAGE_NUM_CTRL
)
657 int PageNumCtrl::Read(HWPFile
& hwpf
)
659 hwpf
.Read2b(&kind
, 1);
660 hwpf
.Read2b(&what
, 1);
661 hwpf
.Read2b(&dummy
, 1);
664 return hwpf
.SetState(HWP_InvalidFileFormat
);
666 return !hwpf
.State();
671 MailMerge::MailMerge():HBox(CH_MAIL_MERGE
)
676 int MailMerge::Read(HWPFile
& hwpf
)
678 hwpf
.Read1b(field_name
, 20);
679 hwpf
.Read2b(&dummy
, 1);
682 return hwpf
.SetState(HWP_InvalidFileFormat
);
684 return !hwpf
.State();
688 // char compositon(23)
689 Compose::Compose():HBox(CH_COMPOSE
)
694 int Compose::Read(HWPFile
& hwpf
)
696 hwpf
.Read2b(compose
, 3);
697 hwpf
.Read2b(&dummy
, 1);
700 return hwpf
.SetState(HWP_InvalidFileFormat
);
702 return !hwpf
.State();
707 Hyphen::Hyphen():HBox(CH_HYPHEN
)
712 int Hyphen::Read(HWPFile
& hwpf
)
714 hwpf
.Read2b(&width
, 1);
715 hwpf
.Read2b(&dummy
, 1);
718 return hwpf
.SetState(HWP_InvalidFileFormat
);
720 return !hwpf
.State();
725 TocMark::TocMark():HBox(CH_TOC_MARK
)
730 int TocMark::Read(HWPFile
& hwpf
)
732 hwpf
.Read2b(&kind
, 1);
733 hwpf
.Read2b(&dummy
, 1);
736 return hwpf
.SetState(HWP_InvalidFileFormat
);
738 return !hwpf
.State();
743 IndexMark::IndexMark():HBox(CH_INDEX_MARK
)
748 int IndexMark::Read(HWPFile
& hwpf
)
750 hwpf
.Read2b(&keyword1
, 60);
751 hwpf
.Read2b(&keyword2
, 60);
752 hwpf
.Read2b(&pgno
, 1);
753 hwpf
.Read2b(&dummy
, 1);
756 return hwpf
.SetState(HWP_InvalidFileFormat
);
758 return !hwpf
.State();
763 Outline::Outline():HBox(CH_OUTLINE
)
768 int Outline::Read(HWPFile
& hwpf
)
770 hwpf
.Read2b(&kind
, 1);
771 hwpf
.Read1b(&shape
, 1);
772 hwpf
.Read1b(&level
, 1);
773 hwpf
.Read2b(number
, 7);
774 hwpf
.Read2b(user_shape
, 7);
775 hwpf
.Read2b(deco
, 14);
776 hwpf
.Read2b(&dummy
, 1);
779 return hwpf
.SetState(HWP_InvalidFileFormat
);
781 return !hwpf
.State();
786 KeepSpace::KeepSpace():HBox(CH_KEEP_SPACE
)
791 int KeepSpace::Read(HWPFile
& hwpf
)
793 hwpf
.Read2b(&dummy
, 1);
796 return hwpf
.SetState(HWP_InvalidFileFormat
);
798 return !hwpf
.State();
802 /* °íÁ¤Æø ºóÄ(31) */
803 FixedSpace::FixedSpace():HBox(CH_FIXED_SPACE
)
808 int FixedSpace::Read(HWPFile
& hwpf
)
810 hwpf
.Read2b(&dummy
, 1);
813 return hwpf
.SetState(HWP_InvalidFileFormat
);
815 return !hwpf
.State();