1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "precompile.h"
22 #include <comphelper/newarray.hxx>
33 static short fboxnum
= 1;
34 static int zindex
= 1;
35 static int lnnumber
= 0;
37 bool HBox::Read(HWPFile
& )
46 bool SkipData::Read(HWPFile
& hwpf
)
48 hwpf
.Read4b(&data_block_len
, 1);
49 hwpf
.Read2b(&dummy
, 1);
51 if (!(IS_SP_SKIP_BLOCK(hh
) && (hh
== dummy
))){
52 return hwpf
.SetState(HWP_InvalidFileFormat
);
55 data_block
= new char[data_block_len
];
57 return hwpf
.Read1b(data_block
, data_block_len
);
62 bool FieldCode::Read(HWPFile
& hwpf
)
66 uint len1
; /* hchar타입의 문자열 테이터 #1의 길이 */
67 uint len2
; /* hchar타입의 문자열 테이터 #2의 길이 */
68 uint len3
; /* hchar타입의 문자열 테이터 #3의 길이 */
69 uint binlen
; /* 임의 형식의 바이너리 데이타 길이 */
71 hwpf
.Read4b(&size
, 1);
72 hwpf
.Read2b(&dummy
, 1);
73 hwpf
.Read1b(&type
, 2);
74 hwpf
.Read4b(reserved1
, 1);
75 hwpf
.Read2b(&location_info
, 1);
76 hwpf
.Read1b(reserved2
, 22);
77 hwpf
.Read4b(&len1
, 1);
78 hwpf
.Read4b(&len2
, 1);
79 hwpf
.Read4b(&len3
, 1);
80 hwpf
.Read4b(&binlen
, 1);
82 uint
const len1_
= ((len1
> 1024) ? 1024 : len1
) / sizeof(hchar
);
83 uint
const len2_
= ((len2
> 1024) ? 1024 : len2
) / sizeof(hchar
);
84 uint
const len3_
= ((len3
> 1024) ? 1024 : len3
) / sizeof(hchar
);
86 str1
= new hchar
[len1_
? len1_
: 1];
87 str2
= new hchar
[len2_
? len2_
: 1];
88 str3
= new hchar
[len3_
? len3_
: 1];
89 bin
= new char[binlen
];
91 hwpf
.Read2b(str1
, len1_
);
92 hwpf
.SkipBlock(len1
- (len1_
* sizeof(hchar
)));
93 str1
[len1_
? (len1_
- 1) : 0] = 0;
94 hwpf
.Read2b(str2
, len2_
);
95 hwpf
.SkipBlock(len2
- (len2_
* sizeof(hchar
)));
96 str2
[len2_
? (len2_
- 1) : 0] = 0;
97 hwpf
.Read2b(str3
, len3_
);
98 hwpf
.SkipBlock(len3
- (len3_
* sizeof(hchar
)));
99 str3
[len3_
? (len3_
- 1) : 0] = 0;
101 hwpf
.ReadBlock(bin
, binlen
);
103 if( type
[0] == 3 && type
[1] == 2 ){ /* 만든날짜로서 포맷을 생성해야 한다. */
104 DateCode
*pDate
= new DateCode
;
105 for (int i
= 0 ; i
< static_cast<int>(len3_
); i
++) {
106 if(str3
[i
] == 0 ) break;
107 if( i
>= DATE_SIZE
) break;
108 pDate
->format
[i
] = str3
[i
];
110 hwpf
.AddDateFormat(pDate
);
118 bool Bookmark::Read(HWPFile
& hwpf
)
122 hwpf
.Read4b(&len
, 1);
123 if (!hwpf
.Read2b(dummy
))
126 if (!(len
== 34))// 2 * (BMK_COMMENT_LEN + 1) + 2
128 return hwpf
.SetState(HWP_InvalidFileFormat
);
130 if (!(hh
== dummy
&& dummy
== CH_BOOKMARK
)){
131 return hwpf
.SetState(HWP_InvalidFileFormat
);
134 hwpf
.Read2b(id
, BMK_COMMENT_LEN
+ 1);
135 hwpf
.Read2b(&type
, 1);
140 bool DateFormat::Read(HWPFile
& hwpf
)
142 hwpf
.Read2b(format
, DATE_SIZE
);
143 if (!hwpf
.Read2b(dummy
))
145 if (!(hh
== dummy
&& CH_DATE_FORM
== dummy
)){
146 return hwpf
.SetState(HWP_InvalidFileFormat
);
152 bool DateCode::Read(HWPFile
& hwpf
)
154 hwpf
.Read2b(format
, DATE_SIZE
);
155 hwpf
.Read2b(date
, 6);
156 if (!hwpf
.Read2b(dummy
))
158 if (!(hh
== dummy
&& CH_DATE_CODE
== dummy
)){
159 return hwpf
.SetState(HWP_InvalidFileFormat
);
161 hwpf
.AddDateFormat(this);
166 bool Tab::Read(HWPFile
& hwpf
)
168 unsigned short tmp16
;
169 if (!hwpf
.Read2b(tmp16
))
172 if (!hwpf
.Read2b(leader
))
174 if (!hwpf
.Read2b(dummy
))
176 if (!(hh
== dummy
&& CH_TAB
== dummy
)){
177 return hwpf
.SetState(HWP_InvalidFileFormat
);
182 // 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;
189 void Cell::Read(HWPFile
& hwpf
)
192 hwpf
.Read2b(&color
, 1);
197 hwpf
.Read2b(&txthigh
, 1);
198 hwpf
.Read2b(&cellhigh
, 1);
200 hwpf
.Read1b(&flag
, 1);
201 hwpf
.Read1b(&changed
, 1);
202 hwpf
.Read1b(&used
, 1);
203 hwpf
.Read1b(&ver_align
, 1);
204 hwpf
.Read1b(linetype
, 4);
205 hwpf
.Read1b(&shade
, 1);
206 hwpf
.Read1b(&diagonal
, 1);
207 hwpf
.Read1b(&protect
, 1);
211 bool TxtBox::Read(HWPFile
& hwpf
)
215 hwpf
.Read2b(reserved
, 2);
216 hwpf
.Read2b(&dummy
, 1);
218 if (!(hh
== dummy
&& CH_TEXT_BOX
== dummy
)){
219 return hwpf
.SetState(HWP_InvalidFileFormat
);
222 hwpf
.Read2b(&style
.cap_len
, 1);
223 hwpf
.Read2b(&dummy1
, 1);
224 hwpf
.Read2b(&next
, 1);
225 hwpf
.Read2b(&dummy2
, 1);
227 style
.boxnum
= fboxnum
++;
229 hwpf
.Read1b(&style
.anchor_type
, 1);
230 hwpf
.Read1b(&style
.txtflow
, 1);
231 hwpf
.Read2b(&style
.xpos
, 1);
232 hwpf
.Read2b(&style
.ypos
, 1);
233 hwpf
.Read2b(&option
, 1);
234 hwpf
.Read2b(&ctrl_ch
, 1);
235 hwpf
.Read2b(style
.margin
, 12);
236 hwpf
.AddFBoxStyle(&style
);
237 hwpf
.Read2b(&box_xs
, 1);
238 hwpf
.Read2b(&box_ys
, 1);
239 hwpf
.Read2b(&cap_xs
, 1);
240 hwpf
.Read2b(&cap_ys
, 1);
241 hwpf
.Read2b(&style
.cap_len
, 1);
244 hwpf
.Read2b(&cap_margin
, 1);
245 hwpf
.Read1b(&xpos_type
, 1);
246 hwpf
.Read1b(&ypos_type
, 1);
247 hwpf
.Read1b(&smart_linesp
, 1);
248 hwpf
.Read1b(&reserved1
, 1);
249 hwpf
.Read2b(&pgx
, 1);
250 hwpf
.Read2b(&pgy
, 1);
251 hwpf
.Read2b(&pgno
, 1);
252 if( ( pgno
+1 ) != hwpf
.getCurrentPage() )
253 pgno
= sal::static_int_cast
<short>(hwpf
.getCurrentPage() -1) ;
255 hwpf
.Read2b(&showpg
, 1);
256 hwpf
.Read2b(&cap_pos
, 1);
257 hwpf
.Read2b(&num
, 1);
258 hwpf
.Read2b(&dummy3
, 1);
259 hwpf
.Read2b(&baseline
, 1);
260 hwpf
.Read2b(&type
, 1);
261 hwpf
.Read2b(&nCell
, 1);
262 hwpf
.Read2b(&protect
, 1);
286 return hwpf
.SetState(HWP_InvalidFileFormat
);
289 cell
= ::comphelper::newArray_null
<Cell
>(ncell
);
291 return hwpf
.SetState(HWP_InvalidFileFormat
);
293 for (ii
= 0; ii
< ncell
; ii
++)
296 cell
[ii
].key
= sal::static_int_cast
<unsigned char>(ii
);
299 style
.cell
= &cell
[0];
300 plists
= ::comphelper::newArray_null
< std::list
< HWPPara
* > >(ncell
);
302 return hwpf
.SetState(HWP_InvalidFileFormat
);
304 for (ii
= 0; ii
< ncell
; ii
++)
305 hwpf
.ReadParaList(plists
[ii
]);
307 hwpf
.ReadParaList(caption
);
309 if( type
== 0 ){ // if table?
310 TCell
* *pArr
= ::comphelper::newArray_null
<TCell
*>(ncell
);
312 return hwpf
.SetState(HWP_InvalidFileFormat
);
314 Table
*tbl
= new Table
;
315 for( ii
= 0 ; ii
< ncell
; ii
++)
317 tbl
->columns
.insert(cell
[ii
].x
);
318 tbl
->columns
.insert(cell
[ii
].x
+ cell
[ii
].w
);
319 tbl
->rows
.insert(cell
[ii
].y
);
320 tbl
->rows
.insert(cell
[ii
].y
+ cell
[ii
].h
);
322 for( ii
= 0 ; ii
< ncell
; ii
++)
324 TCell
*tcell
= new TCell
;
325 tcell
->nColumnIndex
= tbl
->columns
.getIndex(cell
[ii
].x
);
326 tcell
->nColumnSpan
= tbl
->columns
.getIndex(cell
[ii
].x
+ cell
[ii
].w
) -
328 tcell
->nRowIndex
= tbl
->rows
.getIndex(cell
[ii
].y
);
329 tcell
->nRowSpan
= tbl
->rows
.getIndex(cell
[ii
].y
+ cell
[ii
].h
) -
331 tcell
->pCell
= &cell
[ii
];
335 // Sort by row and column
336 for( ii
= 0 ; ii
< ncell
- 1; ii
++ ){
337 for( int jj
= ii
; jj
< ncell
; jj
++){
338 if( pArr
[ii
]->nRowIndex
> pArr
[jj
]->nRowIndex
){
344 for( int kk
= ii
; kk
> 0 ; kk
--){
345 if( ( pArr
[kk
]->nRowIndex
== pArr
[kk
-1]->nRowIndex
) &&
346 (pArr
[kk
]->nColumnIndex
< pArr
[kk
-1]->nColumnIndex
)){
348 pArr
[kk
] = pArr
[kk
-1];
353 for( ii
= 0 ; ii
< ncell
; ii
++ ){
354 tbl
->cells
.push_back(pArr
[ii
]);
364 return !hwpf
.State();
369 bool Picture::Read(HWPFile
& hwpf
)
371 hwpf
.Read2b(reserved
, 2);
372 hwpf
.Read2b(&dummy
, 1);
374 if (!(hh
== dummy
&& CH_PICTURE
== dummy
)){
375 return hwpf
.SetState(HWP_InvalidFileFormat
);
379 hwpf
.Read4b(&follow_block_size
, 1);
380 hwpf
.Read2b(&dummy1
, 1); /* 예약 4바이트 */
381 hwpf
.Read2b(&dummy2
, 1);
383 style
.boxnum
= fboxnum
++;
385 hwpf
.Read1b(&style
.anchor_type
, 1); /* 기준위치 */
386 hwpf
.Read1b(&style
.txtflow
, 1); /* 그림피함. 0-2(자리차지,투명,어울림) */
387 hwpf
.Read2b(&style
.xpos
, 1); /* 가로위치 : 1 왼쪽, 2오른쪽, 3 가운데, 이외 = 임의 */
388 hwpf
.Read2b(&style
.ypos
, 1); /* 세로위치 : 1 위, 2 아래, 3 가운데, 이외 임의 */
389 hwpf
.Read2b(&option
, 1); /* 기타옵션 : 테두리,그림반전,등. bit로 저장. */
390 hwpf
.Read2b(&ctrl_ch
, 1); /* 항상 11 */
391 hwpf
.Read2b(style
.margin
, 12); /* 여백 : [0-2][] out/in/셀,[][0-3] 왼/오른/위/아래 여백 */
392 hwpf
.Read2b(&box_xs
, 1); /* 박스크기 가로 */
393 hwpf
.Read2b(&box_ys
, 1); /* 세로 */
394 hwpf
.Read2b(&cap_xs
, 1); /* 캡션 크기 가로 */
395 hwpf
.Read2b(&cap_ys
, 1); /* 세로 */
396 hwpf
.Read2b(&style
.cap_len
, 1); /* 길이 */
397 hwpf
.Read2b(&xs
, 1); /* 전체 크기(박스 크기 + 캡션 + 여백) 가로 */
398 hwpf
.Read2b(&ys
, 1); /* 세로 */
399 hwpf
.Read2b(&cap_margin
, 1); /* 캡션 여백 */
400 hwpf
.Read1b(&xpos_type
, 1);
401 hwpf
.Read1b(&ypos_type
, 1);
402 hwpf
.Read1b(&smart_linesp
, 1); /* 줄간격 보호 : 0 미보호, 1 보호 */
403 hwpf
.Read1b(&reserved1
, 1);
404 hwpf
.Read2b(&pgx
, 1); /* 실제 계산된 박스 가로 */
405 hwpf
.Read2b(&pgy
, 1); /* 세로 */
406 hwpf
.Read2b(&pgno
, 1); /* 페이지 숫자 : 0부터 시작 */
407 hwpf
.Read2b(&showpg
, 1); /* 박스보여줌 */
408 hwpf
.Read2b(&cap_pos
, 1); /* 캡션위치 0 - 7 메뉴순서. */
409 hwpf
.Read2b(&num
, 1); /* 박스번호 0부터 시작해서 매긴일련번호 */
411 hwpf
.Read1b(&pictype
, 1); /* 그림종류 */
413 unsigned short tmp16
;
414 if (!hwpf
.Read2b(tmp16
)) /* 그림에서 실제 표시를 시작할 위치 가로 */
417 if (!hwpf
.Read2b(tmp16
)) /* 세로 */
420 if (!hwpf
.Read2b(tmp16
)) /* 확대비율 : 0 고정, 이외 퍼센트 단위 가로 */
423 if (!hwpf
.Read2b(tmp16
)) /* 세로 */
427 hwpf
.Read1b(picinfo
.picun
.path
, 256); /* 그림파일 이름 : 종류가 Drawing이 아닐때. */
428 hwpf
.Read1b(reserved3
, 9); /* 밝기/명암/그림효과 등 */
431 if( pictype
!= PICTYPE_DRAW
)
432 style
.cell
= reserved3
;
434 if (follow_block_size
!= 0)
436 follow
= new unsigned char[follow_block_size
];
438 hwpf
.Read1b(follow
, follow_block_size
);
439 if (pictype
== PICTYPE_DRAW
)
441 hmem
= new HMemIODev(reinterpret_cast<char *>(follow
), follow_block_size
);
442 LoadDrawingObjectBlock(this);
443 style
.cell
= picinfo
.picdraw
.hdo
;
450 if ((follow
[3] << 24 | follow
[2] << 16 | follow
[1] << 8 | follow
[0]) == 0x269)
461 hwpf
.AddFBoxStyle(&style
);
464 hwpf
.ReadParaList(caption
);
466 return !hwpf
.State();
483 bool Line::Read(HWPFile
& hwpf
)
485 hwpf
.Read2b(reserved
, 2);
486 hwpf
.Read2b(&dummy
, 1);
488 if (!(hh
== dummy
&& CH_LINE
== dummy
)){
489 return hwpf
.SetState(HWP_InvalidFileFormat
);
493 style
.boxnum
= fboxnum
++;
496 hwpf
.Read1b(&reserved2
, 8);
497 hwpf
.Read1b(&style
.anchor_type
, 1);
498 hwpf
.Read1b(&style
.txtflow
, 1);
499 hwpf
.Read2b(&style
.xpos
, 1);
500 hwpf
.Read2b(&style
.ypos
, 1);
501 hwpf
.Read2b(&option
, 1);
502 hwpf
.Read2b(&ctrl_ch
, 1);
503 hwpf
.Read2b(style
.margin
, 12);
504 hwpf
.AddFBoxStyle(&style
);
505 hwpf
.Read2b(&box_xs
, 1);
506 hwpf
.Read2b(&box_ys
, 1);
507 hwpf
.Read2b(&cap_xs
, 1);
508 hwpf
.Read2b(&cap_ys
, 1);
509 hwpf
.Read2b(&style
.cap_len
, 1);
512 lnnumber
= style
.boxnum
;
514 hwpf
.Read2b(&boundsy
, 1);
515 hwpf
.Read2b(&boundey
, 1);
516 hwpf
.Read1b(&boundx
, 1);
517 hwpf
.Read1b(&draw
, 1);
519 hwpf
.Read2b(&pgx
, 1);
520 hwpf
.Read2b(&pgy
, 1);
521 hwpf
.Read2b(&pgno
, 1);
522 hwpf
.Read2b(&showpg
, 1);
528 hwpf
.Read2b(&width
, 1);
529 hwpf
.Read2b(&shade
, 1);
530 hwpf
.Read2b(&color
, 1);
533 return !hwpf
.State();
543 bool Hidden::Read(HWPFile
& hwpf
)
545 hwpf
.Read2b(reserved
, 2);
546 hwpf
.Read2b(&dummy
, 1);
547 if (!(hh
== dummy
&& CH_HIDDEN
== dummy
)){
548 return hwpf
.SetState(HWP_InvalidFileFormat
);
551 hwpf
.Read1b(info
, 8);
552 hwpf
.ReadParaList(plist
);
554 return !hwpf
.State();
558 HeaderFooter::HeaderFooter()
559 : HBox(CH_HEADER_FOOTER
)
568 bool HeaderFooter::Read(HWPFile
& hwpf
)
570 hwpf
.Read2b(reserved
, 2);
571 hwpf
.Read2b(&dummy
, 1);
572 if (!(hh
== dummy
&& CH_HEADER_FOOTER
== dummy
)){
573 return hwpf
.SetState(HWP_InvalidFileFormat
);
576 hwpf
.Read1b(info
, 8);
577 hwpf
.Read1b(&type
, 1);
578 hwpf
.Read1b(&where
, 1);
580 hwpf
.ReadParaList(plist
, CH_HEADER_FOOTER
);
581 linenumber
= sal::static_int_cast
<unsigned char>(lnnumber
);
582 m_nPageNumber
= hwpf
.getCurrentPage();
583 hwpf
.setMaxSettedPage();
584 hwpf
.AddHeaderFooter(this);
586 return !hwpf
.State();
600 bool Footnote::Read(HWPFile
& hwpf
)
602 hwpf
.Read2b(reserved
, 2);
603 hwpf
.Read2b(&dummy
, 1);
604 if (!(hh
== dummy
&& CH_FOOTNOTE
== dummy
)){
605 return hwpf
.SetState(HWP_InvalidFileFormat
);
608 hwpf
.Read1b(info
, 8);
609 hwpf
.Read2b(&number
, 1);
610 hwpf
.Read2b(&type
, 1);
611 unsigned short tmp16
;
612 if (!hwpf
.Read2b(tmp16
))
615 hwpf
.ReadParaList(plist
, CH_FOOTNOTE
);
617 return !hwpf
.State();
629 bool AutoNum::Read(HWPFile
& hwpf
)
631 hwpf
.Read2b(&type
, 1);
632 hwpf
.Read2b(&number
, 1);
633 hwpf
.Read2b(&dummy
, 1);
636 return hwpf
.SetState(HWP_InvalidFileFormat
);
638 return !hwpf
.State();
652 bool NewNum::Read(HWPFile
& hwpf
)
654 hwpf
.Read2b(&type
, 1);
655 hwpf
.Read2b(&number
, 1);
656 hwpf
.Read2b(&dummy
, 1);
659 return hwpf
.SetState(HWP_InvalidFileFormat
);
661 return !hwpf
.State();
664 // show page number (20)
665 ShowPageNum::ShowPageNum()
666 : HBox(CH_SHOW_PAGE_NUM
)
674 bool ShowPageNum::Read(HWPFile
& hwpf
)
676 hwpf
.Read2b(&where
, 1);
677 hwpf
.Read2b(&shape
, 1);
678 hwpf
.Read2b(&dummy
, 1);
681 return hwpf
.SetState(HWP_InvalidFileFormat
);
683 m_nPageNumber
= hwpf
.getCurrentPage();
684 hwpf
.setMaxSettedPage();
685 hwpf
.AddPageNumber(this);
686 return !hwpf
.State();
690 PageNumCtrl::PageNumCtrl()
691 : HBox(CH_PAGE_NUM_CTRL
)
698 bool PageNumCtrl::Read(HWPFile
& hwpf
)
700 hwpf
.Read2b(&kind
, 1);
701 hwpf
.Read2b(&what
, 1);
702 hwpf
.Read2b(&dummy
, 1);
705 return hwpf
.SetState(HWP_InvalidFileFormat
);
707 return !hwpf
.State();
711 MailMerge::MailMerge()
712 : HBox(CH_MAIL_MERGE
)
715 memset(field_name
, 0, sizeof(field_name
));
718 bool MailMerge::Read(HWPFile
& hwpf
)
720 hwpf
.Read1b(field_name
, 20);
721 hwpf
.Read2b(&dummy
, 1);
724 return hwpf
.SetState(HWP_InvalidFileFormat
);
726 return !hwpf
.State();
729 // char compositon(23)
736 bool Compose::Read(HWPFile
& hwpf
)
738 hwpf
.Read2b(compose
, 3);
739 hwpf
.Read2b(&dummy
, 1);
742 return hwpf
.SetState(HWP_InvalidFileFormat
);
744 return !hwpf
.State();
755 bool Hyphen::Read(HWPFile
& hwpf
)
757 hwpf
.Read2b(&width
, 1);
758 hwpf
.Read2b(&dummy
, 1);
761 return hwpf
.SetState(HWP_InvalidFileFormat
);
763 return !hwpf
.State();
776 bool TocMark::Read(HWPFile
& hwpf
)
778 hwpf
.Read2b(&kind
, 1);
779 hwpf
.Read2b(&dummy
, 1);
782 return hwpf
.SetState(HWP_InvalidFileFormat
);
784 return !hwpf
.State();
788 IndexMark::IndexMark()
789 : HBox(CH_INDEX_MARK
)
793 memset(keyword1
, 0, sizeof(keyword1
));
794 memset(keyword2
, 0, sizeof(keyword2
));
797 bool IndexMark::Read(HWPFile
& hwpf
)
799 hwpf
.Read2b(&keyword1
, 60);
800 hwpf
.Read2b(&keyword2
, 60);
801 hwpf
.Read2b(&pgno
, 1);
802 hwpf
.Read2b(&dummy
, 1);
805 return hwpf
.SetState(HWP_InvalidFileFormat
);
807 return !hwpf
.State();
820 bool Outline::Read(HWPFile
& hwpf
)
822 hwpf
.Read2b(&kind
, 1);
823 hwpf
.Read1b(&shape
, 1);
824 hwpf
.Read1b(&level
, 1);
825 hwpf
.Read2b(number
, 7);
826 hwpf
.Read2b(user_shape
, 7);
827 hwpf
.Read2b(deco
, 14);
828 hwpf
.Read2b(&dummy
, 1);
831 return hwpf
.SetState(HWP_InvalidFileFormat
);
833 return !hwpf
.State();
838 KeepSpace::KeepSpace()
839 : HBox(CH_KEEP_SPACE
)
845 bool KeepSpace::Read(HWPFile
& hwpf
)
847 hwpf
.Read2b(&dummy
, 1);
850 return hwpf
.SetState(HWP_InvalidFileFormat
);
852 return !hwpf
.State();
857 FixedSpace::FixedSpace()
858 : HBox(CH_FIXED_SPACE
)
864 bool FixedSpace::Read(HWPFile
& hwpf
)
866 hwpf
.Read2b(&dummy
, 1);
869 return hwpf
.SetState(HWP_InvalidFileFormat
);
871 return !hwpf
.State();
874 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */