50 hwpf.
Read4b(data_block_len);
87 uint const len1_ = std::min<uint>(len1, 1024) /
sizeof(
hchar);
88 uint const len2_ = std::min<uint>(len2, 1024) /
sizeof(
hchar);
89 uint const len3_ = std::min<uint>(len3, 1024) /
sizeof(
hchar);
91 str1.reset(
new hchar[len1_ ? len1_ : 1] );
92 str2.reset(
new hchar[len2_ ? len2_ : 1] );
93 str3.reset(
new hchar[len3_ ? len3_ : 1] );
98 str1[len1_ ? (len1_ - 1) : 0] = 0;
102 str2[len2_ ? (len2_ - 1) : 0] = 0;
106 str3[len3_ ? (len3_ - 1) : 0] = 0;
112 for (
uint i = 0 ;
i < len3_;
i++) {
113 if(
str3[
i] == 0 )
break;
175 unsigned short tmp16;
299 cell.reset( ::comphelper::newArray_null<Cell>(ncell) );
303 bool bSuccess =
true;
304 for (ii = 0; ii < ncell && bSuccess; ii++)
306 bSuccess =
cell[ii].Read(hwpf);
307 cell[ii].key = sal::static_int_cast<unsigned char>(ii);
314 for (ii = 0; ii < ncell; ii++)
320 std::unique_ptr<TCell*[]> pArr(
new TCell*[ncell]);
321 std::fill(pArr.get(), pArr.get() + ncell,
nullptr);
325 std::unique_ptr<Table> tbl(
new Table);
326 for( ii = 0 ; ii < ncell; ii++)
328 tbl->columns.insert(
cell[ii].
x);
330 tbl->rows.insert(
cell[ii].
y);
333 for( ii = 0 ; ii < ncell; ii++)
347 for( ii = 0 ; ii < ncell - 1; ii++ ){
348 for(
int jj = ii ; jj < ncell ; jj++){
349 if( pArr[ii]->nRowIndex > pArr[jj]->nRowIndex ){
350 std::swap(pArr[ii], pArr[jj]);
353 for(
int kk = ii ; kk > 0 ; kk--){
354 if( ( pArr[kk]->nRowIndex == pArr[kk-1]->nRowIndex ) &&
355 (pArr[kk]->nColumnIndex < pArr[kk-1]->nColumnIndex )){
356 std::swap(pArr[kk], pArr[kk-1]);
360 for( ii = 0 ; ii < ncell ; ii++ ){
361 tbl->cells.emplace_back(pArr[ii]);
370 bSuccess = !hwpf.
State();
382 std::unique_ptr<HMemIODev> m_xNewMem;
384 ChangeMemGuard(
unsigned char* data,
size_t nLen)
386 , m_xNewMem(
std::make_unique<
HMemIODev>(reinterpret_cast<char*>(data), nLen))
388 hmem = m_xNewMem.get();
392 assert(
hmem == m_xNewMem.get());
411 static size_t nMaxAllowedDecompression = [](
const char* pEnv) {
size_t nRet = pEnv ? std::atoi(pEnv) : 0;
return nRet * 10; }(std::getenv(
"FUZZ_MAX_INPUT_LEN"));
446 unsigned short tmp16;
484 size_t nOldSize =
follow.size();
491 if (nBlock != nReadBlock)
493 if (nMaxAllowedDecompression &&
follow.size() > nMaxAllowedDecompression)
495 SAL_WARN(
"filter.hwp",
"too much decompression, abandoning");
526 bool bSuccess = !hwpf.
State();
594 bool bSuccess = !hwpf.
State();
618 return !hwpf.
State();
650 return !hwpf.
State();
675 unsigned short tmp16;
681 return !hwpf.
State();
702 return !hwpf.
State();
725 return !hwpf.
State();
750 return !hwpf.
State();
771 return !hwpf.
State();
789 return !hwpf.
State();
807 return !hwpf.
State();
826 return !hwpf.
State();
847 return !hwpf.
State();
868 return !hwpf.
State();
894 return !hwpf.
State();
913 return !hwpf.
State();
932 return !hwpf.
State();
hwpio.h (C) 1999 Mizi Research, All rights are reserved
The HMemIODev class controls the Input/Output device.
The HWPFile class is the main class of hwp for reading file information from stream.
void AddPageNumber(ShowPageNum *)
void AddHeaderFooter(HeaderFooter *)
int getCurrentPage() const
void AddFBoxStyle(FBoxStyle *)
void AddTable(std::unique_ptr< Table >)
size_t SkipBlock(size_t size)
Skips some bytes from HIODev.
int State(void) const
Say current state.
int SetState(int errcode)
Sets the current state.
void AddDateFormat(DateCode *)
unsigned char scratch[SAL_MAX_UINT16]
bool Read1b(unsigned char &out)
Reads one byte from HIODev.
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.
size_t ReadBlock(void *ptr, size_t size)
Reads some bytes from HIODev not regarding endian's way.
bool Read4b(unsigned int &out)
Reads four byte from HIODev.
hchar user_shape[MAX_OUTLINE_LEVEL]
shape of level
unsigned short kind
kind of numbering format
unsigned char level
level of number, Ex) The level of 1.3.2.4 is four
unsigned short number[MAX_OUTLINE_LEVEL]
value of level
hchar deco[MAX_OUTLINE_LEVEL][2]
decoration character for the level type
virtual bool Read(HWPFile &hwpf) override
Read properties from HIODevice object like stream, file, memory.
static bool LoadDrawingObjectBlock(Picture *pic, HWPFile &hwpf)
char16_t hchar
size of hunit is 4 since hwp96 version
#define IS_SP_SKIP_BLOCK(hch)
static void UpdateBBox(FBox *fbox)
#define SAL_WARN(area, stream)
#define SAL_N_ELEMENTS(arr)
virtual bool Read(HWPFile &hwpf) override
Read properties from HIODevice object like stream, file, memory.
virtual bool Read(HWPFile &hwpf) override
Read properties from HIODevice object like stream, file, memory.
unsigned char linetype[4]
virtual bool Read(HWPFile &hwpf) override
Read properties from HIODevice object like stream, file, memory.
Class for current date and time with specified format.
virtual bool Read(HWPFile &hwpf) override
Read properties from HIODevice object like stream, file, memory.
short date[6]
year/month/week/day/hour/minute
short ypos
Vertical alignment.
unsigned char boxtype
Type of floating object : line, txtbox, image, table, equalizer and button.
short margin[3][4]
Every margin of border [0-2][] : out/in/cell margin [][0-3] : left/right/top/bottom.
unsigned char txtflow
Kind of wrap.
short boxnum
Index of floating object.
short xpos
Horizontal alignment.
unsigned char anchor_type
Anchor type : paragraph , page, char.
This object is for floating object like table, image, line and so on.
short pgx
Physical x,y position.
unsigned char smart_linesp
unsigned short location_info
std::unique_ptr< hchar[]> str2
std::unique_ptr< hchar[]> str1
std::unique_ptr< hchar[]> str3
std::array< char, 22 > reserved2
std::array< char, 4 > reserved1
std::unique_ptr< DateCode > m_pDate
virtual bool Read(HWPFile &hwpf) override
Read properties from HIODevice object like stream, file, memory.
virtual bool Read(HWPFile &hwpf) override
Read properties from HIODevice object like stream, file, memory.
The HBox class is the base class for all date classes in hwp document.
virtual bool Read(HWPFile &hwpf)
Read properties from HIODevice object like stream, file, memory.
virtual bool Read(HWPFile &hwpf) override
Read properties from HIODevice object like stream, file, memory.
std::vector< std::unique_ptr< HWPPara > > plist
hchar width
Width of hyphen.
virtual bool Read(HWPFile &hwpf) override
Read properties from HIODevice object like stream, file, memory.
virtual bool Read(HWPFile &hwpf) override
Read properties from HIODevice object like stream, file, memory.
virtual bool Read(HWPFile &hwpf) override
Read properties from HIODevice object like stream, file, memory.
virtual bool Read(HWPFile &hwpf) override
Read properties from HIODevice object like stream, file, memory.
unsigned char field_name[20]
virtual bool Read(HWPFile &hwpf) override
Read properties from HIODevice object like stream, file, memory.
virtual bool Read(HWPFile &hwpf) override
Read properties from HIODevice object like stream, file, memory.
unsigned short kind
object type
unsigned short what
control command.
virtual bool Read(HWPFile &hwpf) override
Read properties from HIODevice object like stream, file, memory.
std::vector< unsigned char > follow
It's for the Drawing object.
std::vector< std::unique_ptr< HWPPara > > caption
short num
Index of current Picture object.
short cap_pos
Position of caption.
hunit scale[2]
Ratio of magnification or reduction.
uint follow_block_size
follow_block_size is the size information of the Drawing object of hwp.
virtual bool Read(HWPFile &hwpf) override
Read properties from HIODevice object like stream, file, memory.
unsigned int m_nPageNumber
unsigned short where
Location of page number to be inserted.
unsigned short shape
Shape of page number to be inserted.
virtual bool Read(HWPFile &hwpf) override
Read properties from HIODevice object like stream, file, memory.
virtual bool Read(HWPFile &hwpf) override
Read properties from HIODevice object like stream, file, memory.
virtual bool Read(HWPFile &hwpf) override
Read properties from HIODevice object like stream, file, memory.
virtual bool Read(HWPFile &hwpf) override
Read properties from HIODevice object like stream, file, memory.
short nCell
nCell is greater than one only for table, otherwise it is 1.
std::vector< std::unique_ptr< HWPPara > > caption
Caption.
short protect
If value of protect is 1, size of cell can't change.
std::unique_ptr< Cell[]> cell
short cap_pos
caption position
short type
The value of type indicates as the below: zero is table, one is textbox, two is equalizer and three i...
virtual bool Read(HWPFile &hwpf) override
Read properties from HIODevice object like stream, file, memory.