LibreOffice Module hwpfilter (master) 1
hwpfile.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#include <memory>
21#include "precompile.h"
22
23#include <algorithm>
24#include <stdio.h>
25#include <stdlib.h>
26#include <string.h>
27#include <errno.h>
28
29#include <o3tl/safeint.hxx>
30
31#include "hwplib.h"
32#include "hwpfile.h"
33#include "hiodev.h"
34#include "hfont.h"
35#include "hstyle.h"
36#include "hbox.h"
37#include "hpara.h"
38#include "htags.h"
39#include "hcode.h"
40#include "hstream.hxx"
41
42
43HWPFile *HWPFile::cur_doc = nullptr;
44static int ccount = 0;
45static int pcount = 0;
46static int datecodecount = 0;
47
49 : version(HWP_V30)
50 , compressed(false)
51 , encrypted(false)
52 , linenumber(0)
53 , info_block_len(0)
54 , error_code(HWP_NoError)
55 , readdepth(0)
56 , m_nCurrentPage(1)
57 , m_nMaxSettedPage(0)
58 , currenthyper(0)
59{
60 SetCurrentDoc(this);
61}
62
64{
65 oledata.reset();
66 hiodev.reset();
67}
68
69int HWPFile::ReadHwpFile(std::unique_ptr<HStream> stream)
70{
71 if (Open(std::move(stream)) != HWP_NoError)
72 return State();
73 InfoRead();
74 FontRead();
75 StyleRead();
78 TagsRead();
79
80 return State();
81}
82
83int detect_hwp_version(const char *str)
84{
85 if (memcmp(V20SIGNATURE, str, HWPIDLen) == 0)
86 return HWP_V20;
87 else if (memcmp(V21SIGNATURE, str, HWPIDLen) == 0)
88 return HWP_V21;
89 else if (memcmp(V30SIGNATURE, str, HWPIDLen) == 0)
90 return HWP_V30;
91 return 0;
92}
93
94// HIODev wrapper
95
96int HWPFile::Open(std::unique_ptr<HStream> stream)
97{
98 std::unique_ptr<HStreamIODev> hstreamio(new HStreamIODev(std::move(stream)));
99
100 if (!hstreamio->open())
101 {
102 return SetState(HWP_EMPTY_FILE);
103 }
104
105 SetIODevice(std::move(hstreamio));
106
107 char idstr[HWPIDLen];
108
109 if (ReadBlock(idstr, HWPIDLen) < HWPIDLen)
112 if (HWP_V30 != version)
114 return HWP_NoError;
115}
116
117int HWPFile::SetState(int errcode)
118{
119 error_code = errcode;
120 return error_code;
121}
122
123bool HWPFile::Read1b(unsigned char &out)
124{
125 return hiodev && hiodev->read1b(out);
126}
127
128bool HWPFile::Read1b(char &out)
129{
130 unsigned char tmp8;
131 if (!hiodev || !hiodev->read1b(tmp8))
132 return false;
133 out = tmp8;
134 return true;
135}
136
137bool HWPFile::Read2b(unsigned short &out)
138{
139 return hiodev && hiodev->read2b(out);
140}
141
142bool HWPFile::Read2b(char16_t &out)
143{
144 unsigned short n;
145 auto const ok = Read2b(n);
146 if (ok) {
147 out = n;
148 }
149 return ok;
150}
151
152bool HWPFile::Read4b(unsigned int &out)
153{
154 return hiodev && hiodev->read4b(out);
155}
156
157bool HWPFile::Read4b(int &out)
158{
159 unsigned int tmp32;
160 if (!Read4b(tmp32))
161 return false;
162 out = tmp32;
163 return true;
164}
165
166size_t HWPFile::Read2b(void *ptr, size_t nmemb)
167{
168 return hiodev ? hiodev->read2b(ptr, nmemb) : 0;
169}
170
171size_t HWPFile::ReadBlock(void *ptr, size_t size)
172{
173 return hiodev ? hiodev->readBlock(ptr, size) : 0;
174}
175
176size_t HWPFile::SkipBlock(size_t size)
177{
178 return hiodev ? hiodev->skipBlock(size) : 0;
179}
180
182{
183 if (hiodev)
184 hiodev->setCompressed(flag);
185}
186
187
188std::unique_ptr<HIODev> HWPFile::SetIODevice(std::unique_ptr<HIODev> new_hiodev)
189{
190 std::swap(hiodev, new_hiodev);
191 return new_hiodev;
192}
193
194
195// end of HIODev wrapper
196
198{
199 _hwpInfo.Read(*this);
200}
201
202
204{
205 _hwpFont.Read(*this);
206}
207
208
210{
211 _hwpStyle.Read(*this);
212}
213
214
216{
218}
219
220void HWPFile::ReadParaList(std::vector < HWPPara* > &aplist)
221{
222 std::unique_ptr<HWPPara> spNode( new HWPPara );
223 unsigned char tmp_etcflag;
224 unsigned char prev_etcflag = 0;
225 while (spNode->Read(*this, 0))
226 {
227 if( !(spNode->etcflag & 0x04) ){
228 tmp_etcflag = spNode->etcflag;
229 spNode->etcflag = prev_etcflag;
230 prev_etcflag = tmp_etcflag;
231 }
232 if (spNode->nch && spNode->reuse_shape)
233 {
234 if (!aplist.empty()){
235 spNode->pshape = aplist.back()->pshape;
236 }
237 else{
238 spNode->nch = 0;
239 spNode->reuse_shape = 0;
240 }
241 }
242 spNode->pshape->pagebreak = spNode->etcflag;
243 if (spNode->nch)
244 AddParaShape(spNode->pshape);
245
246 if (!aplist.empty())
247 aplist.back()->SetNext(spNode.get());
248 aplist.push_back(spNode.release());
249 spNode.reset( new HWPPara );
250 }
251 move_to_failed(std::move(spNode));
252}
253
254void HWPFile::ReadParaList(std::vector< std::unique_ptr<HWPPara> > &aplist, unsigned char flag)
255{
256 std::unique_ptr<HWPPara> spNode( new HWPPara );
257 unsigned char tmp_etcflag;
258 unsigned char prev_etcflag = 0;
259 while (spNode->Read(*this, flag))
260 {
261 if( !(spNode->etcflag & 0x04) ){
262 tmp_etcflag = spNode->etcflag;
263 spNode->etcflag = prev_etcflag;
264 prev_etcflag = tmp_etcflag;
265 }
266 if (spNode->nch && spNode->reuse_shape)
267 {
268 if (!aplist.empty()){
269 spNode->pshape = aplist.back()->pshape;
270 }
271 else{
272 spNode->nch = 0;
273 spNode->reuse_shape = 0;
274 }
275 }
276 spNode->pshape->pagebreak = spNode->etcflag;
277 if (spNode->nch)
278 AddParaShape(spNode->pshape);
279
280 if (!aplist.empty())
281 aplist.back()->SetNext(spNode.get());
282 aplist.push_back(std::move(spNode));
283 spNode.reset( new HWPPara );
284 }
285 move_to_failed(std::move(spNode));
286}
287
288void HWPFile::move_to_failed(std::unique_ptr<HWPPara> xPara)
289{
290 pfailedlist.push_back(std::move(xPara));
291}
292
294{
295 while (true)
296 {
297 uint tag;
298 if (!Read4b(tag))
299 return;
300 int size;
301 if (!Read4b(size))
302 return;
303 if (size <= 0 && tag > 0){
304 continue;
307 if (tag == FILETAG_END_OF_COMPRESSED ||
309 return;
310 switch (tag)
311 {
313 {
314 std::unique_ptr<EmPicture> emb(new EmPicture(size));
315
316 if (emb->Read(*this))
317 emblist.push_back(std::move(emb));
318 }
319 break;
321 oledata.reset( new OlePicture(size) );
322 oledata->Read(*this);
323 break;
325 {
326 const int nRecordLen = 617;
327 if( (size % nRecordLen) != 0 )
328 SkipBlock( size );
329 else
330 {
331 const int nRecords = size / nRecordLen;
332 for (int i = 0 ; i < nRecords; ++i)
333 {
334 std::unique_ptr<HyperText> hypert(new HyperText);
335 if (hypert->Read(*this))
336 hyperlist.push_back(std::move(hypert));
337 else
338 break;
339 }
340 }
341 break;
342 }
343 case 6:
344 {
347 return;
349 return;
351 return;
355 unsigned short nFlag;
356 if (!Read2b(nFlag))
357 return;
358 _hwpInfo.back_info.flag = nFlag >> 8 ;
359 int nRange;
360 if (!Read4b(nRange))
361 return;
362 _hwpInfo.back_info.range = nRange >> 24;
365 return;
366
367 if (_hwpInfo.back_info.size < 0)
368 {
370 return;
371 }
372
373 _hwpInfo.back_info.data.clear();
374
375 //read potentially compressed data in blocks as it's more
376 //likely large values are simply broken and we'll run out
377 //of data before we need to realloc
378 for (int i = 0; i < _hwpInfo.back_info.size; i+= SAL_MAX_UINT16)
379 {
380 int nOldSize = _hwpInfo.back_info.data.size();
381 size_t nBlock = std::min<int>(SAL_MAX_UINT16, _hwpInfo.back_info.size - nOldSize);
382 _hwpInfo.back_info.data.resize(nOldSize + nBlock);
383 size_t nReadBlock = ReadBlock(_hwpInfo.back_info.data.data() + nOldSize, nBlock);
384 if (nBlock != nReadBlock)
385 {
386 _hwpInfo.back_info.data.resize(nOldSize + nReadBlock);
387 break;
388 }
389 }
391
392 if( _hwpInfo.back_info.size > 0 )
394 else if( _hwpInfo.back_info.filename[0] )
396 else
398
399
400 _hwpInfo.back_info.isset = true;
401
402 break;
403 }
407 default:
409 }
410 }
411}
412
413
415{
416 if (o3tl::make_unsigned(num) < columnlist.size())
417 return columnlist[num]->xColdef.get();
418 else
419 return nullptr;
420}
421
422/* Index of @return starts from 1 */
424{
425 int i = 0;
426 for (auto const& column : columnlist)
427 {
428 if( page < column->start_page )
429 return i;
430 ++i;
431 }
432 return i;
433}
434
436{
437 ++currenthyper;
439 return hyperlist[currenthyper-1].get();
440 else
441 return nullptr;
442}
443
445{
446 char *name = pic->picinfo.picembed.embname;
447
448 name[0] = 'H';
449 name[1] = 'W';
450 name[2] = 'P';
451
452 for (auto const& emb : emblist)
453 if (strcmp(name, emb->name) == 0)
454 return emb.get();
455 return nullptr;
456}
457
459{
460 name[0] = 'H';
461 name[1] = 'W';
462 name[2] = 'P';
463
464 for (auto const& emb : emblist)
465 if (strcmp(name, emb->name) == 0)
466 return emb.get();
467 return nullptr;
468}
469
471{
472 if (index < 0 || o3tl::make_unsigned(index) >= pslist.size())
473 return nullptr;
474 return pslist[index].get();
475}
476
478{
479 if (index < 0 || o3tl::make_unsigned(index) >= cslist.size())
480 return nullptr;
481 return cslist[index].get();
482}
483
485{
486 if (index < 0 || o3tl::make_unsigned(index) >= fbslist.size())
487 return nullptr;
488 return fbslist[index];
489}
490
492{
493 if (index < 0 || o3tl::make_unsigned(index) >= datecodes.size())
494 return nullptr;
495 return datecodes[index];
496}
497
499{
500 if (index < 0 || o3tl::make_unsigned(index) >= headerfooters.size())
501 return nullptr;
502 return headerfooters[index];
503}
504
506{
507 if (index < 0 || o3tl::make_unsigned(index) >= pagenumbers.size())
508 return nullptr;
509 return pagenumbers[index];
510}
511
513{
514 if (index < 0 || o3tl::make_unsigned(index) >= tables.size())
515 return nullptr;
516 return tables[index].get();
517}
518
519void HWPFile::AddParaShape(std::shared_ptr<ParaShape> const & pshape)
520{
521 int nscount = 0;
522 for(int j = 0 ; j < MAXTABS-1 ; j++)
523 {
524 if( j > 0 && pshape->tabs[j].position == 0 )
525 break;
526 if( pshape->tabs[0].position == 0 ){
527 if( pshape->tabs[j].type || pshape->tabs[j].dot_continue ||
528 (pshape->tabs[j].position != 1000 *j) )
529 nscount = j;
530 }
531 else {
532 if( pshape->tabs[j].type || pshape->tabs[j].dot_continue ||
533 (pshape->tabs[j].position != 1000 * (j + 1)) )
534 nscount = j;
535 }
536 }
537 if( nscount )
538 {
539 pshape->tabs[MAXTABS-1].type = sal::static_int_cast<char>(nscount);
540 pshape->index = ++pcount;
541 pslist.push_back(pshape);
542 return;
543 }
544
545 int value = compareParaShape(pshape.get());
546 if (value == 0)
547 {
548 pshape->index = ++pcount;
549 pslist.push_back(pshape);
550 return;
551 }
552 pshape->index = value;
553}
554
555void HWPFile::AddCharShape(std::shared_ptr<CharShape> const & cshape)
556{
557 int value = compareCharShape(cshape.get());
558 if (value == 0)
559 {
560 cshape->index = ++ccount;
561 cslist.push_back(cshape);
562 }
563 else
564 cshape->index = value;
565}
566
568{
569 columnlist.emplace_back(new ColumnInfo(m_nCurrentPage));
571}
572
573void HWPFile::SetColumnDef(const std::shared_ptr<ColumnDef>& rColdef)
574{
575 ColumnInfo *cinfo = columnlist.back().get();
576 if( cinfo->bIsSet )
577 return;
578 cinfo->xColdef = rColdef;
579 cinfo->bIsSet = true;
580}
581
583{
584 hbox->key = sal::static_int_cast<char>(++datecodecount);
585 datecodes.push_back(hbox);
586}
587
589{
590 pagenumbers.push_back(hbox);
591}
592
594{
595 headerfooters.push_back(hbox);
596}
597
598void HWPFile::AddTable(std::unique_ptr<Table> hbox)
599{
600 tables.push_back(std::move(hbox));
601}
602
604{
605 fbslist.push_back(fbstyle);
606}
607
609{
610 int count = cslist.size();
611 for(int i = 0; i< count; i++)
612 {
613 CharShape *cshape = getCharShape(i);
614
615 if( shape->size == cshape->size &&
616 shape->font == cshape->font &&
617 shape->ratio == cshape->ratio &&
618 shape->space == cshape->space &&
619 shape->color[1] == cshape->color[1] &&
620 shape->color[0] == cshape->color[0] &&
621 shape->shade == cshape->shade &&
622 shape->attr == cshape->attr )
623 {
624 return cshape->index;
625 }
626 }
627 return 0;
628}
629
631{
632 if (!shape->cshape)
633 return 0;
634
635 int count = pslist.size();
636 for (int i = 0; i < count; ++i)
637 {
638 ParaShape *pshape = pslist[i].get();
639 if (!pshape->cshape)
640 continue;
641 if (shape->left_margin == pshape->left_margin &&
642 shape->right_margin == pshape->right_margin &&
643 shape->pspacing_prev == pshape->pspacing_prev &&
644 shape->pspacing_next == pshape->pspacing_next &&
645 shape->indent == pshape->indent &&
646 shape->lspacing == pshape->lspacing &&
647 shape->arrange_type == pshape->arrange_type &&
648 shape->outline == pshape->outline &&
649 shape->pagebreak == pshape->pagebreak)
650 {
651 if (shape->cshape->size == pshape->cshape->size &&
652 shape->cshape->font == pshape->cshape->font &&
653 shape->cshape->ratio == pshape->cshape->ratio &&
654 shape->cshape->space == pshape->cshape->space &&
655 shape->cshape->color[1] == pshape->cshape->color[1] &&
656 shape->cshape->color[0] == pshape->cshape->color[0] &&
657 shape->cshape->shade == pshape->cshape->shade &&
658 shape->cshape->attr == pshape->cshape->attr)
659 {
660 return pshape->index;
661 }
662 }
663 }
664 return 0;
665}
666
668{
669 return HWPFile::cur_doc;
670}
671
672
674{
676
677 HWPFile::cur_doc = hwpfp;
678 return org;
679}
680
681/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
unsigned int uint
This controls the HStream given by constructor.
Definition: hiodev.h:75
The HWPFile class is the main class of hwp for reading file information from stream.
Definition: hwpfile.h:98
void AddPageNumber(ShowPageNum *)
Definition: hwpfile.cxx:588
std::vector< HeaderFooter * > headerfooters
Definition: hwpfile.h:297
void AddHeaderFooter(HeaderFooter *)
Definition: hwpfile.cxx:593
EmPicture * GetEmPictureByName(char *name)
Definition: hwpfile.cxx:458
void StyleRead(void)
Reads style list of hwp file from HIODev.
Definition: hwpfile.cxx:209
ParaShape * getParaShape(int)
Definition: hwpfile.cxx:470
std::vector< std::unique_ptr< ColumnInfo > > columnlist
Definition: hwpfile.h:282
std::vector< std::unique_ptr< HWPPara > > pfailedlist
Definition: hwpfile.h:288
HyperText * GetHyperText()
Definition: hwpfile.cxx:435
int ReadHwpFile(std::unique_ptr< HStream >)
Reads all information of hwp file from stream.
Definition: hwpfile.cxx:69
void ParaListRead()
Reads paragraph list of hwp file from HIODev.
Definition: hwpfile.cxx:215
EmPicture * GetEmPicture(Picture *pic)
Definition: hwpfile.cxx:444
void SetColumnDef(std::shared_ptr< ColumnDef > const &)
Definition: hwpfile.cxx:573
static HWPFile * cur_doc
Definition: hwpfile.h:304
~HWPFile()
Definition: hwpfile.cxx:63
std::vector< FBoxStyle * > fbslist
Definition: hwpfile.h:295
int compareParaShape(ParaShape const *shape)
Definition: hwpfile.cxx:630
int m_nCurrentPage
Definition: hwpfile.h:275
int error_code
Definition: hwpfile.h:268
std::unique_ptr< HIODev > hiodev
Definition: hwpfile.h:277
HWPFont _hwpFont
Definition: hwpfile.h:280
FBoxStyle * getFBoxStyle(int)
Definition: hwpfile.cxx:484
void FontRead(void)
Reads font list of hwp file from HIODev.
Definition: hwpfile.cxx:203
void AddFBoxStyle(FBoxStyle *)
Definition: hwpfile.cxx:603
int version
Definition: hwpfile.h:263
HWPInfo _hwpInfo
Definition: hwpfile.h:279
Table * getTable(int)
Definition: hwpfile.cxx:512
HeaderFooter * getHeaderFooter(int)
Definition: hwpfile.cxx:498
void TagsRead()
Reads additional information like embedded image of hwp file from HIODev.
Definition: hwpfile.cxx:293
void AddColumnInfo()
Definition: hwpfile.cxx:567
HWPStyle _hwpStyle
Definition: hwpfile.h:281
void AddTable(std::unique_ptr< Table >)
Definition: hwpfile.cxx:598
ColumnDef * GetColumnDef(int)
Definition: hwpfile.cxx:414
size_t SkipBlock(size_t size)
Skips some bytes from HIODev.
Definition: hwpfile.cxx:176
std::unique_ptr< HIODev > SetIODevice(std::unique_ptr< HIODev > hiodev)
Sets current HIODev.
Definition: hwpfile.cxx:188
ShowPageNum * getPageNumber(int)
Definition: hwpfile.cxx:505
int State(void) const
Say current state.
Definition: hwpfile.h:119
std::vector< DateCode * > datecodes
Definition: hwpfile.h:296
int SetState(int errcode)
Sets the current state.
Definition: hwpfile.cxx:117
void move_to_failed(std::unique_ptr< HWPPara > rPara)
Definition: hwpfile.cxx:288
void SetCompressed(bool)
Sets if the stream is compressed.
Definition: hwpfile.cxx:181
void AddCharShape(std::shared_ptr< CharShape > const &)
Definition: hwpfile.cxx:555
std::vector< std::unique_ptr< EmPicture > > emblist
Definition: hwpfile.h:290
std::vector< std::shared_ptr< CharShape > > cslist
Definition: hwpfile.h:294
void AddDateFormat(DateCode *)
Definition: hwpfile.cxx:582
DateCode * getDateCode(int)
Definition: hwpfile.cxx:491
std::unique_ptr< OlePicture > oledata
Definition: hwpfile.h:269
void InfoRead(void)
Reads document information of hwp file from HIODev.
Definition: hwpfile.cxx:197
bool Read1b(unsigned char &out)
Reads one byte from HIODev.
Definition: hwpfile.cxx:123
void setMaxSettedPage()
Definition: hwpfile.h:247
std::vector< std::shared_ptr< ParaShape > > pslist
Definition: hwpfile.h:293
friend HWPFile * SetCurrentDoc(HWPFile *)
Definition: hwpfile.cxx:673
int GetPageMasterNum(int page)
Definition: hwpfile.cxx:423
int compareCharShape(CharShape const *shape)
Definition: hwpfile.cxx:608
HWPFile()
Default constructor.
Definition: hwpfile.cxx:48
std::vector< std::unique_ptr< HyperText > > hyperlist
Definition: hwpfile.h:291
std::vector< std::unique_ptr< Table > > tables
Definition: hwpfile.h:299
void ReadParaList(std::vector< std::unique_ptr< HWPPara > > &aplist, unsigned char flag=0)
Reads main paragraph list.
Definition: hwpfile.cxx:254
int currenthyper
Definition: hwpfile.h:292
bool Read2b(unsigned short &out)
Reads two byte from HIODev.
Definition: hwpfile.cxx:137
void AddParaShape(std::shared_ptr< ParaShape > const &)
Definition: hwpfile.cxx:519
std::vector< ShowPageNum * > pagenumbers
Definition: hwpfile.h:298
std::vector< std::unique_ptr< HWPPara > > plist
Definition: hwpfile.h:284
size_t ReadBlock(void *ptr, size_t size)
Reads some bytes from HIODev not regarding endian's way.
Definition: hwpfile.cxx:171
int Open(std::unique_ptr< HStream >)
Opens HStream to use it.
Definition: hwpfile.cxx:96
bool Read4b(unsigned int &out)
Reads four byte from HIODev.
Definition: hwpfile.cxx:152
CharShape * getCharShape(int)
Definition: hwpfile.cxx:477
void Read(HWPFile &hwpf)
Definition: hfont.cxx:63
PaperBackInfo back_info
Definition: hinfo.h:159
void Read(HWPFile &hwpf)
Function for reading document information (128 bytes) Document information is the information after t...
Definition: hinfo.cxx:72
It represents the paragraph.
Definition: hpara.h:69
void Read(HWPFile &hwpf)
Definition: hstyle.cxx:122
Any value
Reference< XOutputStream > stream
#define MAXTABS
Definition: hinfo.h:236
static int datecodecount
Definition: hwpfile.cxx:46
static int ccount
Definition: hwpfile.cxx:44
static int pcount
Definition: hwpfile.cxx:45
HWPFile * GetCurrentDoc()
Definition: hwpfile.cxx:667
HWPFile * SetCurrentDoc(HWPFile *hwpfp)
Definition: hwpfile.cxx:673
int detect_hwp_version(const char *str)
Definition: hwpfile.cxx:83
#define HWP_V20
Definition: hwpfile.h:45
#define V20SIGNATURE
Definition: hwpfile.h:41
#define V30SIGNATURE
Definition: hwpfile.h:43
#define HWPIDLen
Definition: hwpfile.h:40
#define HWP_V21
Definition: hwpfile.h:46
#define HWP_V30
Definition: hwpfile.h:47
#define V21SIGNATURE
Definition: hwpfile.h:42
#define FILETAG_PREVIEW_TEXT
Definition: hwplib.h:170
#define FILETAG_EMBEDDED_PICTURE
Definition: hwplib.h:163
#define FILETAG_END_OF_COMPRESSED
Definition: hwplib.h:161
@ HWP_NoError
Definition: hwplib.h:175
@ HWP_UNSUPPORTED_VERSION
Definition: hwplib.h:181
@ HWP_EMPTY_FILE
Definition: hwplib.h:182
#define FILETAG_END_OF_UNCOMPRESSED
Definition: hwplib.h:168
#define FILETAG_PRESENTATION
Definition: hwplib.h:166
#define FILETAG_PREVIEW_IMAGE
Definition: hwplib.h:169
#define FILETAG_HYPERTEXT
Definition: hwplib.h:165
#define FILETAG_OLE_OBJECT
Definition: hwplib.h:164
const char * name
Definition: hwpreader.cxx:365
sal_Int64 n
size
int i
index
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
Style of character.
Definition: hinfo.h:213
int index
Index of character style.
Definition: hinfo.h:217
unsigned char font
Definition: hinfo.h:223
char space
Definition: hinfo.h:224
unsigned char attr
Definition: hinfo.h:227
unsigned char ratio
Definition: hinfo.h:225
unsigned char color[2]
Definition: hinfo.h:222
unsigned char shade
Definition: hinfo.h:226
hunit size
Font size.
Definition: hinfo.h:221
Column properties.
Definition: hinfo.h:257
Class for current date and time with specified format.
Definition: hbox.h:142
unsigned char key
Definition: hbox.h:154
Embedded image.
Definition: htags.h:34
Style for floating object.
Definition: hbox.h:238
Header or footer.
Definition: hbox.h:681
HyperText.
Definition: htags.h:49
Win32 OLE object.
Definition: htags.h:61
char effect
Definition: hinfo.h:75
int luminance
Definition: hinfo.h:73
unsigned char color[3]
Definition: hinfo.h:78
unsigned short flag
Definition: hinfo.h:79
char reserved2[8]
Definition: hinfo.h:76
char reserved1[8]
Definition: hinfo.h:72
int size
Definition: hinfo.h:82
bool isset
Definition: hinfo.h:84
char type
Definition: hinfo.h:71
char reserved3[27]
Definition: hinfo.h:81
int contrast
Definition: hinfo.h:74
std::vector< char > data
Definition: hinfo.h:83
int range
Definition: hinfo.h:80
char filename[260+1]
Definition: hinfo.h:77
Style of paragraph.
Definition: hinfo.h:276
hunit right_margin
Definition: hinfo.h:282
hunit pspacing_next
Definition: hinfo.h:286
hunit left_margin
Definition: hinfo.h:281
std::shared_ptr< CharShape > cshape
Definition: hinfo.h:295
unsigned char outline
Definition: hinfo.h:292
unsigned char pagebreak
Definition: hinfo.h:296
unsigned char arrange_type
Definition: hinfo.h:288
hunit indent
Definition: hinfo.h:283
int index
Index of paragraph style.
Definition: hinfo.h:280
hunit lspacing
Definition: hinfo.h:284
hunit pspacing_prev
Definition: hinfo.h:285
char embname[16]
Definition: hbox.h:541
There are four kinds of image.
Definition: hbox.h:593
PicDef picinfo
Definition: hbox.h:623
Input page index in footer or header.
Definition: hbox.h:786
Definition: hbox.h:511
#define SAL_MAX_UINT16
PicDefEmbed picembed
Definition: hbox.h:577