100 if (!hstreamio->open())
184 hiodev->setCompressed(flag);
190 std::swap(
hiodev, new_hiodev);
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))
227 if( !(spNode->etcflag & 0x04) ){
228 tmp_etcflag = spNode->etcflag;
229 spNode->etcflag = prev_etcflag;
230 prev_etcflag = tmp_etcflag;
232 if (spNode->nch && spNode->reuse_shape)
234 if (!aplist.empty()){
235 spNode->pshape = aplist.back()->pshape;
239 spNode->reuse_shape = 0;
242 spNode->pshape->pagebreak = spNode->etcflag;
247 aplist.back()->SetNext(spNode.get());
248 aplist.push_back(spNode.release());
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))
261 if( !(spNode->etcflag & 0x04) ){
262 tmp_etcflag = spNode->etcflag;
263 spNode->etcflag = prev_etcflag;
264 prev_etcflag = tmp_etcflag;
266 if (spNode->nch && spNode->reuse_shape)
268 if (!aplist.empty()){
269 spNode->pshape = aplist.back()->pshape;
273 spNode->reuse_shape = 0;
276 spNode->pshape->pagebreak = spNode->etcflag;
281 aplist.back()->SetNext(spNode.get());
282 aplist.push_back(std::move(spNode));
303 if (size <= 0 && tag > 0){
316 if (emb->Read(*
this))
317 emblist.push_back(std::move(emb));
326 const int nRecordLen = 617;
327 if( (
size % nRecordLen) != 0 )
331 const int nRecords =
size / nRecordLen;
332 for (
int i = 0 ;
i < nRecords; ++
i)
334 std::unique_ptr<HyperText> hypert(
new HyperText);
335 if (hypert->Read(*
this))
355 unsigned short nFlag;
384 if (nBlock != nReadBlock)
428 if( page < column->start_page )
452 for (
auto const& emb :
emblist)
453 if (strcmp(
name, emb->name) == 0)
464 for (
auto const& emb :
emblist)
465 if (strcmp(
name, emb->name) == 0)
522 for(
int j = 0 ; j <
MAXTABS-1 ; j++)
524 if( j > 0 && pshape->tabs[j].position == 0 )
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) )
532 if( pshape->tabs[j].type || pshape->tabs[j].dot_continue ||
533 (pshape->tabs[j].position != 1000 * (j + 1)) )
539 pshape->tabs[
MAXTABS-1].type = sal::static_int_cast<char>(nscount);
552 pshape->index =
value;
564 cshape->index =
value;
578 cinfo->xColdef = rColdef;
579 cinfo->bIsSet =
true;
600 tables.push_back(std::move(hbox));
624 return cshape->
index;
660 return pshape->
index;
This controls the HStream given by constructor.
The HWPFile class is the main class of hwp for reading file information from stream.
void AddPageNumber(ShowPageNum *)
std::vector< HeaderFooter * > headerfooters
void AddHeaderFooter(HeaderFooter *)
EmPicture * GetEmPictureByName(char *name)
void StyleRead(void)
Reads style list of hwp file from HIODev.
ParaShape * getParaShape(int)
std::vector< std::unique_ptr< ColumnInfo > > columnlist
std::vector< std::unique_ptr< HWPPara > > pfailedlist
HyperText * GetHyperText()
int ReadHwpFile(std::unique_ptr< HStream >)
Reads all information of hwp file from stream.
void ParaListRead()
Reads paragraph list of hwp file from HIODev.
EmPicture * GetEmPicture(Picture *pic)
void SetColumnDef(std::shared_ptr< ColumnDef > const &)
std::vector< FBoxStyle * > fbslist
int compareParaShape(ParaShape const *shape)
std::unique_ptr< HIODev > hiodev
FBoxStyle * getFBoxStyle(int)
void FontRead(void)
Reads font list of hwp file from HIODev.
void AddFBoxStyle(FBoxStyle *)
HeaderFooter * getHeaderFooter(int)
void TagsRead()
Reads additional information like embedded image of hwp file from HIODev.
void AddTable(std::unique_ptr< Table >)
ColumnDef * GetColumnDef(int)
size_t SkipBlock(size_t size)
Skips some bytes from HIODev.
std::unique_ptr< HIODev > SetIODevice(std::unique_ptr< HIODev > hiodev)
Sets current HIODev.
ShowPageNum * getPageNumber(int)
int State(void) const
Say current state.
std::vector< DateCode * > datecodes
int SetState(int errcode)
Sets the current state.
void move_to_failed(std::unique_ptr< HWPPara > rPara)
void SetCompressed(bool)
Sets if the stream is compressed.
void AddCharShape(std::shared_ptr< CharShape > const &)
std::vector< std::unique_ptr< EmPicture > > emblist
std::vector< std::shared_ptr< CharShape > > cslist
void AddDateFormat(DateCode *)
DateCode * getDateCode(int)
std::unique_ptr< OlePicture > oledata
void InfoRead(void)
Reads document information of hwp file from HIODev.
bool Read1b(unsigned char &out)
Reads one byte from HIODev.
std::vector< std::shared_ptr< ParaShape > > pslist
friend HWPFile * SetCurrentDoc(HWPFile *)
int GetPageMasterNum(int page)
int compareCharShape(CharShape const *shape)
HWPFile()
Default constructor.
std::vector< std::unique_ptr< HyperText > > hyperlist
std::vector< std::unique_ptr< Table > > tables
void ReadParaList(std::vector< std::unique_ptr< HWPPara > > &aplist, unsigned char flag=0)
Reads main paragraph list.
bool Read2b(unsigned short &out)
Reads two byte from HIODev.
void AddParaShape(std::shared_ptr< ParaShape > const &)
std::vector< ShowPageNum * > pagenumbers
std::vector< std::unique_ptr< HWPPara > > plist
size_t ReadBlock(void *ptr, size_t size)
Reads some bytes from HIODev not regarding endian's way.
int Open(std::unique_ptr< HStream >)
Opens HStream to use it.
bool Read4b(unsigned int &out)
Reads four byte from HIODev.
CharShape * getCharShape(int)
void Read(HWPFile &hwpf)
Function for reading document information (128 bytes) Document information is the information after t...
It represents the paragraph.
Reference< XOutputStream > stream
HWPFile * GetCurrentDoc()
HWPFile * SetCurrentDoc(HWPFile *hwpfp)
int detect_hwp_version(const char *str)
#define FILETAG_PREVIEW_TEXT
#define FILETAG_EMBEDDED_PICTURE
#define FILETAG_END_OF_COMPRESSED
@ HWP_UNSUPPORTED_VERSION
#define FILETAG_END_OF_UNCOMPRESSED
#define FILETAG_PRESENTATION
#define FILETAG_PREVIEW_IMAGE
#define FILETAG_HYPERTEXT
#define FILETAG_OLE_OBJECT
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
int index
Index of character style.
Class for current date and time with specified format.
Style for floating object.
std::shared_ptr< CharShape > cshape
unsigned char arrange_type
int index
Index of paragraph style.
There are four kinds of image.
Input page index in footer or header.