1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2
3
* Copyright (C) 2003 William Lachance (wrlach@gmail.com)
3
4
* Copyright (C) 2003-2004 Marc Maurer (uwog@uwog.net)
4
5
* Copyright (C) 2006 Fridrich Strba (fridrich.strba@bluewin.ch)
6
7
* This library is free software; you can redistribute it and/or
7
8
* modify it under the terms of the GNU Lesser General Public
8
9
* License as published by the Free Software Foundation; either
45
WP5VariableLengthGroup * WP5VariableLengthGroup::constructVariableLengthGroup(WPXInputStream *input, WPXEncryption *encryption, const uint8_t group)
46
WP5VariableLengthGroup *WP5VariableLengthGroup::constructVariableLengthGroup(WPXInputStream *input, WPXEncryption *encryption, const uint8_t group)
47
WPD_DEBUG_MSG(("WordPerfect: handling a variable length group Ox%x\n", group));
48
WPD_DEBUG_MSG(("WordPerfect: handling a variable length group Ox%x\n", group));
50
case WP5_TOP_DEFINITION_GROUP:
51
return new WP5DefinitionGroup(input, encryption);
52
case WP5_TOP_PAGE_FORMAT_GROUP:
53
return new WP5PageFormatGroup(input, encryption);
54
case WP5_TOP_HEADER_FOOTER_GROUP:
55
return new WP5HeaderFooterGroup(input, encryption);
56
case WP5_TOP_FONT_GROUP:
57
return new WP5FontGroup(input, encryption);
58
case WP5_TOP_FOOTNOTE_ENDNOTE_GROUP:
59
return new WP5FootnoteEndnoteGroup(input, encryption);
60
case WP5_TOP_BOX_GROUP:
61
return new WP5BoxGroup(input, encryption);
62
case WP5_TOP_TABLE_EOL_GROUP:
63
return new WP5TableEOLGroup(input, encryption);
64
case WP5_TOP_TABLE_EOP_GROUP:
65
return new WP5TableEOPGroup(input, encryption);
67
// this is an unhandled group, just skip it
68
return new WP5UnsupportedVariableLengthGroup(input, encryption);
51
case WP5_TOP_DEFINITION_GROUP:
52
return new WP5DefinitionGroup(input, encryption);
53
case WP5_TOP_PAGE_FORMAT_GROUP:
54
return new WP5PageFormatGroup(input, encryption);
55
case WP5_TOP_HEADER_FOOTER_GROUP:
56
return new WP5HeaderFooterGroup(input, encryption);
57
case WP5_TOP_FONT_GROUP:
58
return new WP5FontGroup(input, encryption);
59
case WP5_TOP_FOOTNOTE_ENDNOTE_GROUP:
60
return new WP5FootnoteEndnoteGroup(input, encryption);
61
case WP5_TOP_BOX_GROUP:
62
return new WP5BoxGroup(input, encryption);
63
case WP5_TOP_TABLE_EOL_GROUP:
64
return new WP5TableEOLGroup(input, encryption);
65
case WP5_TOP_TABLE_EOP_GROUP:
66
return new WP5TableEOPGroup(input, encryption);
68
// this is an unhandled group, just skip it
69
return new WP5UnsupportedVariableLengthGroup(input, encryption);
116
117
m_subGroup = readU8(input, encryption);
117
118
m_size = readU16(input, encryption) + 4; // the length is the number of data bytes minus 4 (ie. the function codes)
119
120
WPD_DEBUG_MSG(("WordPerfect: Read variable group header (start_position: %i, sub_group: 0x%2x, size: %i)\n", startPosition, m_subGroup, m_size));
121
122
_readContents(input, encryption);