1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 /* $Id: hwpread.cpp,v 1.5 2008-04-10 12:10:14 rt Exp $ */
30 #include "precompile.h"
41 static short fboxnum
= 1;
42 static int zindex
= 1;
43 static int lnnumber
= 0;
45 int HBox::Read(HWPFile
& )
54 int SkipBlock::Read(HWPFile
& hwpf
)
56 hwpf
.Read4b(&data_block_len
, 1);
57 hwpf
.Read2b(&dummy
, 1);
59 if (!(IS_SP_SKIP_BLOCK(hh
) && (hh
== dummy
))){
60 return hwpf
.SetState(HWP_InvalidFileFormat
);
63 data_block
= new char[data_block_len
];
65 return hwpf
.Read1b(data_block
, data_block_len
);
70 int FieldCode::Read(HWPFile
& hwpf
)
74 ulong len1
; /* hcharŸÀÔÀÇ ¹®ÀÚ¿ Å×ÀÌÅÍ #1ÀÇ ±æÀÌ */
75 ulong len2
; /* hcharŸÀÔÀÇ ¹®ÀÚ¿ Å×ÀÌÅÍ #2ÀÇ ±æÀÌ */
76 ulong len3
; /* hcharŸÀÔÀÇ ¹®ÀÚ¿ Å×ÀÌÅÍ #3ÀÇ ±æÀÌ */
77 ulong binlen
; /* ÀÓÀÇ Çü½ÄÀÇ ¹ÙÀ̳ʸ® µ¥ÀÌŸ ±æÀÌ */
79 hwpf
.Read4b(&size
, 1);
80 hwpf
.Read2b(&dummy
, 1);
81 hwpf
.Read1b(&type
, 2);
82 hwpf
.Read4b(reserved1
, 1);
83 hwpf
.Read2b(&location_info
, 1);
84 hwpf
.Read1b(reserved2
, 22);
85 hwpf
.Read4b(&len1
, 1);
86 hwpf
.Read4b(&len2
, 1);
87 hwpf
.Read4b(&len3
, 1);
88 hwpf
.Read4b(&binlen
, 1);
90 str1
= new hchar
[len1
];
91 str2
= new hchar
[len2
];
92 str3
= new hchar
[len3
];
93 bin
= new char[binlen
];
95 hwpf
.Read2b(str1
, len1
/2);
96 hwpf
.Read2b(str2
, len2
/2);
97 hwpf
.Read2b(str3
, len3
/2);
99 hwpf
.ReadBlock(bin
, binlen
);
101 if( type
[0] == 3 && type
[1] == 2 ){ /* ¸¸µç³¯Â¥·Î¼ Æ÷¸ËÀ» »ý¼ºÇØ¾ß ÇÑ´Ù. */
102 DateCode
*pDate
= new DateCode
;
103 for( int i
= 0 ;i
< (int)(len3
/2) ; i
++ ){
104 if(str3
[i
] == 0 ) break;
105 if( i
>= DATE_SIZE
) break;
106 pDate
->format
[i
] = str3
[i
];
108 hwpf
.AddDateFormat(pDate
);
117 int Bookmark::Read(HWPFile
& hwpf
)
121 hwpf
.Read4b(&len
, 1);
122 dummy
= sal::static_int_cast
<hchar
>(hwpf
.Read2b());
124 if (!(len
== 34))// 2 * (BMK_COMMENT_LEN + 1) + 2
126 return hwpf
.SetState(HWP_InvalidFileFormat
);
128 if (!(hh
== dummy
&& dummy
== CH_BOOKMARK
)){
129 return hwpf
.SetState(HWP_InvalidFileFormat
);
132 hwpf
.Read2b(id
, BMK_COMMENT_LEN
+ 1);
133 hwpf
.Read2b(&type
, 1);
134 //return hwpf.Read2b(&type, 1);
141 int DateFormat::Read(HWPFile
& hwpf
)
143 hwpf
.Read2b(format
, DATE_SIZE
);
144 dummy
= sal::static_int_cast
<hchar
>(hwpf
.Read2b());
145 if (!(hh
== dummy
&& CH_DATE_FORM
== dummy
)){
146 return hwpf
.SetState(HWP_InvalidFileFormat
);
154 int DateCode::Read(HWPFile
& hwpf
)
156 hwpf
.Read2b(format
, DATE_SIZE
);
157 hwpf
.Read2b(date
, 6);
158 dummy
= sal::static_int_cast
<hchar
>(hwpf
.Read2b());
159 if (!(hh
== dummy
&& CH_DATE_CODE
== dummy
)){
160 return hwpf
.SetState(HWP_InvalidFileFormat
);
162 hwpf
.AddDateFormat(this);
169 int Tab::Read(HWPFile
& hwpf
)
171 width
= hwpf
.Read2b();
172 leader
= sal::static_int_cast
<unsigned short>(hwpf
.Read2b());
173 dummy
= sal::static_int_cast
<hchar
>(hwpf
.Read2b());
174 if (!(hh
== dummy
&& CH_TAB
== dummy
)){
175 return hwpf
.SetState(HWP_InvalidFileFormat
);
181 // tbox(10) TABLE BOX MATH BUTTON HYPERTEXT
183 static void UpdateBBox(FBox
* fbox
)
185 fbox
->boundsy
= fbox
->pgy
;
186 fbox
->boundey
= fbox
->pgy
+ fbox
->ys
- 1;
190 void Cell::Read(HWPFile
& hwpf
)
193 hwpf
.Read2b(&color
, 1);
198 hwpf
.Read2b(&txthigh
, 1);
199 hwpf
.Read2b(&cellhigh
, 1);
201 hwpf
.Read1b(&flag
, 1);
202 hwpf
.Read1b(&changed
, 1);
203 hwpf
.Read1b(&used
, 1);
204 hwpf
.Read1b(&ver_align
, 1);
205 hwpf
.Read1b(linetype
, 4);
206 hwpf
.Read1b(&shade
, 1);
207 hwpf
.Read1b(&diagonal
, 1);
208 hwpf
.Read1b(&protect
, 1);
212 int TxtBox::Read(HWPFile
& hwpf
)
216 hwpf
.Read2b(reserved
, 2);
217 hwpf
.Read2b(&dummy
, 1);
219 if (!(hh
== dummy
&& CH_TEXT_BOX
== dummy
)){
220 return hwpf
.SetState(HWP_InvalidFileFormat
);
223 hwpf
.Read2b(&style
.cap_len
, 1);
224 hwpf
.Read2b(&dummy1
, 1);
225 hwpf
.Read2b(&next
, 1);
226 hwpf
.Read2b(&dummy2
, 1);
228 style
.boxnum
= fboxnum
++;
230 hwpf
.Read1b(&style
.anchor_type
, 1);
231 hwpf
.Read1b(&style
.txtflow
, 1);
232 hwpf
.Read2b(&style
.xpos
, 1);
233 hwpf
.Read2b(&style
.ypos
, 1);
234 hwpf
.Read2b(&option
, 1);
235 hwpf
.Read2b(&ctrl_ch
, 1);
236 hwpf
.Read2b(style
.margin
, 12);
237 hwpf
.AddFBoxStyle(&style
);
238 hwpf
.Read2b(&box_xs
, 1);
239 hwpf
.Read2b(&box_ys
, 1);
240 hwpf
.Read2b(&cap_xs
, 1);
241 hwpf
.Read2b(&cap_ys
, 1);
242 hwpf
.Read2b(&style
.cap_len
, 1);
245 hwpf
.Read2b(&cap_margin
, 1);
246 hwpf
.Read1b(&xpos_type
, 1);
247 hwpf
.Read1b(&ypos_type
, 1);
248 hwpf
.Read1b(&smart_linesp
, 1);
249 hwpf
.Read1b(&reserved1
, 1);
250 hwpf
.Read2b(&pgx
, 1);
251 hwpf
.Read2b(&pgy
, 1);
252 hwpf
.Read2b(&pgno
, 1);
253 if( ( pgno
+1 ) != hwpf
.getCurrentPage() )
254 pgno
= sal::static_int_cast
<short>(hwpf
.getCurrentPage() -1) ;
256 hwpf
.Read2b(&showpg
, 1);
257 hwpf
.Read2b(&cap_pos
, 1);
258 hwpf
.Read2b(&num
, 1);
259 hwpf
.Read2b(&dummy3
, 1);
260 hwpf
.Read2b(&baseline
, 1);
261 hwpf
.Read2b(&type
, 1);
262 hwpf
.Read2b(&nCell
, 1);
263 hwpf
.Read2b(&protect
, 1);
287 return hwpf
.SetState(HWP_InvalidFileFormat
);
290 cell
= new Cell
[ncell
];
291 for (ii
= 0; ii
< ncell
; ii
++)
294 cell
[ii
].key
= sal::static_int_cast
<unsigned char>(ii
);
297 style
.cell
= &cell
[0];
298 plists
= new LinkedList
< HWPPara
>[ncell
];
299 for (ii
= 0; ii
< ncell
; ii
++)
300 hwpf
.ReadParaList(plists
[ii
]);
302 hwpf
.ReadParaList(caption
);
304 if( type
== 0 ){ // if table?
305 Table
*tbl
= new Table
;
306 for( ii
= 0 ; ii
< ncell
; ii
++)
308 tbl
->columns
.insert(cell
[ii
].x
);
309 tbl
->columns
.insert(cell
[ii
].x
+ cell
[ii
].w
);
310 tbl
->rows
.insert(cell
[ii
].y
);
311 tbl
->rows
.insert(cell
[ii
].y
+ cell
[ii
].h
);
313 TCell
* *pArr
= new TCell
*[ncell
];
314 for( ii
= 0 ; ii
< ncell
; ii
++)
316 TCell
*tcell
= new TCell
;
317 tcell
->nColumnIndex
= tbl
->columns
.getIndex(cell
[ii
].x
);
318 tcell
->nColumnSpan
= tbl
->columns
.getIndex(cell
[ii
].x
+ cell
[ii
].w
) -
320 tcell
->nRowIndex
= tbl
->rows
.getIndex(cell
[ii
].y
);
321 tcell
->nRowSpan
= tbl
->rows
.getIndex(cell
[ii
].y
+ cell
[ii
].h
) -
323 tcell
->pCell
= &cell
[ii
];
327 // Sort by row and column
328 for( ii
= 0 ; ii
< ncell
- 1; ii
++ ){
329 for( int jj
= ii
; jj
< ncell
; jj
++){
330 if( pArr
[ii
]->nRowIndex
> pArr
[jj
]->nRowIndex
){
336 for( int kk
= ii
; kk
> 0 ; kk
--){
337 if( ( pArr
[kk
]->nRowIndex
== pArr
[kk
-1]->nRowIndex
) &&
338 (pArr
[kk
]->nColumnIndex
< pArr
[kk
-1]->nColumnIndex
)){
340 pArr
[kk
] = pArr
[kk
-1];
345 for( ii
= 0 ; ii
< ncell
; ii
++ ){
346 tbl
->cells
.insert(pArr
[ii
]);
356 return !hwpf
.State();
361 int Picture::Read(HWPFile
& hwpf
)
363 hwpf
.Read2b(reserved
, 2);
364 hwpf
.Read2b(&dummy
, 1);
366 if (!(hh
== dummy
&& CH_PICTURE
== dummy
)){
367 return hwpf
.SetState(HWP_InvalidFileFormat
);
371 hwpf
.Read4b(&follow_block_size
, 1);
372 hwpf
.Read2b(&dummy1
, 1); /* ¿¹¾à 4¹ÙÀÌÆ® */
373 hwpf
.Read2b(&dummy2
, 1);
375 style
.boxnum
= fboxnum
++;
377 hwpf
.Read1b(&style
.anchor_type
, 1); /* ±âÁØÀ§Ä¡ */
378 hwpf
.Read1b(&style
.txtflow
, 1); /* ±×¸²ÇÇÇÔ. 0-2(ÀÚ¸®Â÷Áö,Åõ¸í,¾î¿ï¸²) */
379 hwpf
.Read2b(&style
.xpos
, 1); /* °¡·ÎÀ§Ä¡ : 1 ¿ÞÂÊ, 2¿À¸¥ÂÊ, 3 °¡¿îµ¥, ÀÌ¿Ü = ÀÓÀÇ */
380 hwpf
.Read2b(&style
.ypos
, 1); /* ¼¼·ÎÀ§Ä¡ : 1 À§, 2 ¾Æ·¡, 3 °¡¿îµ¥, ÀÌ¿Ü ÀÓÀÇ */
381 hwpf
.Read2b(&option
, 1); /* ±âŸ¿É¼Ç : Å׵θ®,±×¸²¹ÝÀü,µî. bit·Î ÀúÀå. */
382 hwpf
.Read2b(&ctrl_ch
, 1); /* Ç×»ó 11 */
383 hwpf
.Read2b(style
.margin
, 12); /* ¿©¹é : [0-2][] out/in/¼¿,[][0-3] ¿Þ/¿À¸¥/À§/¾Æ·¡ ¿©¹é */
384 hwpf
.Read2b(&box_xs
, 1); /* ¹Ú½ºÅ©±â °¡·Î */
385 hwpf
.Read2b(&box_ys
, 1); /* ¼¼·Î */
386 hwpf
.Read2b(&cap_xs
, 1); /* ĸ¼Ç Å©±â °¡·Î */
387 hwpf
.Read2b(&cap_ys
, 1); /* ¼¼·Î */
388 hwpf
.Read2b(&style
.cap_len
, 1); /* ±æÀÌ */
389 hwpf
.Read2b(&xs
, 1); /* Àüü Å©±â(¹Ú½º Å©±â + ĸ¼Ç + ¿©¹é) °¡·Î */
390 hwpf
.Read2b(&ys
, 1); /* ¼¼·Î */
391 hwpf
.Read2b(&cap_margin
, 1); /* ĸ¼Ç ¿©¹é */
392 hwpf
.Read1b(&xpos_type
, 1);
393 hwpf
.Read1b(&ypos_type
, 1);
394 hwpf
.Read1b(&smart_linesp
, 1); /* ÁÙ°£°Ý º¸È£ : 0 ¹Ìº¸È£, 1 º¸È£ */
395 hwpf
.Read1b(&reserved1
, 1);
396 hwpf
.Read2b(&pgx
, 1); /* ½ÇÁ¦ °è»êµÈ ¹Ú½º °¡·Î */
397 hwpf
.Read2b(&pgy
, 1); /* ¼¼·Î */
398 hwpf
.Read2b(&pgno
, 1); /* ÆäÀÌÁö ¼ýÀÚ : 0ºÎÅÍ ½ÃÀÛ */
399 hwpf
.Read2b(&showpg
, 1); /* ¹Ú½ºº¸¿©ÁÜ */
400 hwpf
.Read2b(&cap_pos
, 1); /* ĸ¼ÇÀ§Ä¡ 0 - 7 ¸Þ´º¼ø¼. */
401 hwpf
.Read2b(&num
, 1); /* ¹Ú½º¹øÈ£ 0ºÎÅÍ ½ÃÀÛÇؼ ¸Å±äÀϷùøÈ£ */
403 hwpf
.Read1b(&pictype
, 1); /* ±×¸²Á¾·ù */
405 skip
[0] = (short) hwpf
.Read2b(); /* ±×¸²¿¡¼ ½ÇÁ¦ Ç¥½Ã¸¦ ½ÃÀÛÇÒ À§Ä¡ °¡·Î */
406 skip
[1] = (short) hwpf
.Read2b(); /* ¼¼·Î */
407 scale
[0] = (short) hwpf
.Read2b(); /* È®´ëºñÀ² : 0 °íÁ¤, ÀÌ¿Ü ÆÛ¼¾Æ® ´ÜÀ§ °¡·Î */
408 scale
[1] = (short) hwpf
.Read2b(); /* ¼¼·Î */
410 hwpf
.Read1b(picinfo
.picun
.path
, 256); /* ±×¸²ÆÄÀÏ À̸§ : Á¾·ù°¡ DrawingÀÌ ¾Æ´Ò¶§. */
411 hwpf
.Read1b(reserved3
, 9); /* ¹à±â/¸í¾Ï/±×¸²È¿°ú µî */
414 if( pictype
!= PICTYPE_DRAW
)
415 style
.cell
= reserved3
;
417 if (follow_block_size
!= 0)
419 follow
= new unsigned char[follow_block_size
];
421 hwpf
.Read1b(follow
, follow_block_size
);
422 if (pictype
== PICTYPE_DRAW
)
424 hmem
= new HMemIODev((char *) follow
, follow_block_size
);
425 LoadDrawingObjectBlock(this);
426 style
.cell
= picinfo
.picdraw
.hdo
;
433 if ((follow
[3] << 24 | follow
[2] << 16 | follow
[1] << 8 | follow
[0]) == 0x269)
444 hwpf
.AddFBoxStyle(&style
);
447 hwpf
.ReadParaList(caption
);
449 return !hwpf
.State();
455 Line::Line():FBox(CH_LINE
)
460 int Line::Read(HWPFile
& hwpf
)
462 hwpf
.Read2b(reserved
, 2);
463 hwpf
.Read2b(&dummy
, 1);
465 if (!(hh
== dummy
&& CH_LINE
== dummy
)){
466 return hwpf
.SetState(HWP_InvalidFileFormat
);
470 style
.boxnum
= fboxnum
++;
473 hwpf
.Read1b(&reserved2
, 8);
474 hwpf
.Read1b(&style
.anchor_type
, 1);
475 hwpf
.Read1b(&style
.txtflow
, 1);
476 hwpf
.Read2b(&style
.xpos
, 1);
477 hwpf
.Read2b(&style
.ypos
, 1);
478 hwpf
.Read2b(&option
, 1);
479 hwpf
.Read2b(&ctrl_ch
, 1);
480 hwpf
.Read2b(style
.margin
, 12);
481 hwpf
.AddFBoxStyle(&style
);
482 hwpf
.Read2b(&box_xs
, 1);
483 hwpf
.Read2b(&box_ys
, 1);
484 hwpf
.Read2b(&cap_xs
, 1);
485 hwpf
.Read2b(&cap_ys
, 1);
486 hwpf
.Read2b(&style
.cap_len
, 1);
489 lnnumber
= style
.boxnum
;
491 hwpf
.Read2b(&boundsy
, 1);
492 hwpf
.Read2b(&boundey
, 1);
493 hwpf
.Read1b(&boundx
, 1);
494 hwpf
.Read1b(&draw
, 1);
496 hwpf
.Read2b(&pgx
, 1);
497 hwpf
.Read2b(&pgy
, 1);
498 hwpf
.Read2b(&pgno
, 1);
499 hwpf
.Read2b(&showpg
, 1);
505 hwpf
.Read2b(&width
, 1);
506 hwpf
.Read2b(&shade
, 1);
507 hwpf
.Read2b(&color
, 1);
510 return !hwpf
.State();
515 Hidden::Hidden():HBox(CH_HIDDEN
)
520 int Hidden::Read(HWPFile
& hwpf
)
522 hwpf
.Read2b(reserved
, 2);
523 hwpf
.Read2b(&dummy
, 1);
524 if (!(hh
== dummy
&& CH_HIDDEN
== dummy
)){
525 return hwpf
.SetState(HWP_InvalidFileFormat
);
528 hwpf
.Read1b(info
, 8);
529 hwpf
.ReadParaList(plist
);
531 return !hwpf
.State();
536 HeaderFooter::HeaderFooter():HBox(CH_HEADER_FOOTER
)
542 int HeaderFooter::Read(HWPFile
& hwpf
)
544 hwpf
.Read2b(reserved
, 2);
545 hwpf
.Read2b(&dummy
, 1);
546 if (!(hh
== dummy
&& CH_HEADER_FOOTER
== dummy
)){
547 return hwpf
.SetState(HWP_InvalidFileFormat
);
550 hwpf
.Read1b(info
, 8);
551 hwpf
.Read1b(&type
, 1);
552 hwpf
.Read1b(&where
, 1);
554 hwpf
.ReadParaList(plist
, CH_HEADER_FOOTER
);
555 linenumber
= sal::static_int_cast
<unsigned char>(lnnumber
);
556 m_nPageNumber
= hwpf
.getCurrentPage();
557 hwpf
.setMaxSettedPage();
558 hwpf
.AddHeaderFooter(this);
560 return !hwpf
.State();
565 Footnote::Footnote():HBox(CH_FOOTNOTE
)
570 int Footnote::Read(HWPFile
& hwpf
)
572 hwpf
.Read2b(reserved
, 2);
573 hwpf
.Read2b(&dummy
, 1);
574 if (!(hh
== dummy
&& CH_FOOTNOTE
== dummy
)){
575 return hwpf
.SetState(HWP_InvalidFileFormat
);
578 hwpf
.Read1b(info
, 8);
579 hwpf
.Read2b(&number
, 1);
580 hwpf
.Read2b(&type
, 1);
581 width
= (short) hwpf
.Read2b();
582 hwpf
.ReadParaList(plist
, CH_FOOTNOTE
);
584 return !hwpf
.State();
589 AutoNum::AutoNum():HBox(CH_AUTO_NUM
)
594 int AutoNum::Read(HWPFile
& hwpf
)
596 hwpf
.Read2b(&type
, 1);
597 hwpf
.Read2b(&number
, 1);
598 hwpf
.Read2b(&dummy
, 1);
601 return hwpf
.SetState(HWP_InvalidFileFormat
);
603 return !hwpf
.State();
608 NewNum::NewNum():HBox(CH_NEW_NUM
)
613 int NewNum::Read(HWPFile
& hwpf
)
615 hwpf
.Read2b(&type
, 1);
616 hwpf
.Read2b(&number
, 1);
617 hwpf
.Read2b(&dummy
, 1);
620 return hwpf
.SetState(HWP_InvalidFileFormat
);
622 return !hwpf
.State();
626 // show page number (20)
627 ShowPageNum::ShowPageNum():HBox(CH_SHOW_PAGE_NUM
)
632 int ShowPageNum::Read(HWPFile
& hwpf
)
634 hwpf
.Read2b(&where
, 1);
635 hwpf
.Read2b(&shape
, 1);
636 hwpf
.Read2b(&dummy
, 1);
639 return hwpf
.SetState(HWP_InvalidFileFormat
);
641 m_nPageNumber
= hwpf
.getCurrentPage();
642 hwpf
.setMaxSettedPage();
643 hwpf
.AddPageNumber(this);
644 return !hwpf
.State();
648 /* Ȧ¼öÂʽÃÀÛ/°¨Ãß±â (21) */
649 PageNumCtrl::PageNumCtrl():HBox(CH_PAGE_NUM_CTRL
)
654 int PageNumCtrl::Read(HWPFile
& hwpf
)
656 hwpf
.Read2b(&kind
, 1);
657 hwpf
.Read2b(&what
, 1);
658 hwpf
.Read2b(&dummy
, 1);
661 return hwpf
.SetState(HWP_InvalidFileFormat
);
663 return !hwpf
.State();
668 MailMerge::MailMerge():HBox(CH_MAIL_MERGE
)
673 int MailMerge::Read(HWPFile
& hwpf
)
675 hwpf
.Read1b(field_name
, 20);
676 hwpf
.Read2b(&dummy
, 1);
679 return hwpf
.SetState(HWP_InvalidFileFormat
);
681 return !hwpf
.State();
685 // char compositon(23)
686 Compose::Compose():HBox(CH_COMPOSE
)
691 int Compose::Read(HWPFile
& hwpf
)
693 hwpf
.Read2b(compose
, 3);
694 hwpf
.Read2b(&dummy
, 1);
697 return hwpf
.SetState(HWP_InvalidFileFormat
);
699 return !hwpf
.State();
704 Hyphen::Hyphen():HBox(CH_HYPHEN
)
709 int Hyphen::Read(HWPFile
& hwpf
)
711 hwpf
.Read2b(&width
, 1);
712 hwpf
.Read2b(&dummy
, 1);
715 return hwpf
.SetState(HWP_InvalidFileFormat
);
717 return !hwpf
.State();
722 TocMark::TocMark():HBox(CH_TOC_MARK
)
727 int TocMark::Read(HWPFile
& hwpf
)
729 hwpf
.Read2b(&kind
, 1);
730 hwpf
.Read2b(&dummy
, 1);
733 return hwpf
.SetState(HWP_InvalidFileFormat
);
735 return !hwpf
.State();
740 IndexMark::IndexMark():HBox(CH_INDEX_MARK
)
745 int IndexMark::Read(HWPFile
& hwpf
)
747 hwpf
.Read2b(&keyword1
, 60);
748 hwpf
.Read2b(&keyword2
, 60);
749 hwpf
.Read2b(&pgno
, 1);
750 hwpf
.Read2b(&dummy
, 1);
753 return hwpf
.SetState(HWP_InvalidFileFormat
);
755 return !hwpf
.State();
760 Outline::Outline():HBox(CH_OUTLINE
)
765 int Outline::Read(HWPFile
& hwpf
)
767 hwpf
.Read2b(&kind
, 1);
768 hwpf
.Read1b(&shape
, 1);
769 hwpf
.Read1b(&level
, 1);
770 hwpf
.Read2b(number
, 7);
771 hwpf
.Read2b(user_shape
, 7);
772 hwpf
.Read2b(deco
, 14);
773 hwpf
.Read2b(&dummy
, 1);
776 return hwpf
.SetState(HWP_InvalidFileFormat
);
778 return !hwpf
.State();
783 KeepSpace::KeepSpace():HBox(CH_KEEP_SPACE
)
788 int KeepSpace::Read(HWPFile
& hwpf
)
790 hwpf
.Read2b(&dummy
, 1);
793 return hwpf
.SetState(HWP_InvalidFileFormat
);
795 return !hwpf
.State();
799 /* °íÁ¤Æø ºóÄ(31) */
800 FixedSpace::FixedSpace():HBox(CH_FIXED_SPACE
)
805 int FixedSpace::Read(HWPFile
& hwpf
)
807 hwpf
.Read2b(&dummy
, 1);
810 return hwpf
.SetState(HWP_InvalidFileFormat
);
812 return !hwpf
.State();