~ubuntu-branches/ubuntu/trusty/libwpd/trusty

« back to all changes in this revision

Viewing changes to src/lib/WP5VariableLengthGroup.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Rene Engelhard
  • Date: 2006-06-11 23:56:17 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060611235617-ce504k38fuqe8twa
Tags: 0.8.5-2
* dpatch'ize 
* add patch from upstream fixing WP5 font handling regression

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* libwpd
2
2
 * Copyright (C) 2003 William Lachance (william.lachance@sympatico.ca)
3
 
 * Copyright (C) 2003-2004 Marc Maurer (j.m.maurer@student.utwente.nl)
 
3
 * Copyright (C) 2003-2004 Marc Maurer (uwog@uwog.net)
4
4
 *  
5
5
 * This library is free software; you can redistribute it and/or
6
6
 * modify it under the terms of the GNU Lesser General Public
27
27
#include "WP5VariableLengthGroup.h"
28
28
#include "WP5UnsupportedVariableLengthGroup.h"
29
29
#include "libwpd_internal.h"
30
 
#include "WP5FormatGroup.h"
 
30
#include "WP5HeaderFooterGroup.h"
 
31
#include "WP5FontGroup.h"
 
32
#include "WP5FootnoteEndnoteGroup.h"
31
33
#include "WP5DefinitionGroup.h"
32
34
#include "WP5TableEOLGroup.h"
33
35
#include "WP5TableEOPGroup.h"
38
40
 
39
41
WP5VariableLengthGroup * WP5VariableLengthGroup::constructVariableLengthGroup(WPXInputStream *input, uint8_t group)
40
42
{
 
43
        WPD_DEBUG_MSG(("WordPerfect: handling a variable length group Ox%x\n", group)); 
41
44
        switch (group)
42
45
        {
43
 
                case WP5_TOP_FORMAT_GROUP:
44
 
                        return new WP5FormatGroup(input);
45
46
                case WP5_TOP_DEFINITION_GROUP:
46
47
                        return new WP5DefinitionGroup(input);
47
48
                case WP5_TOP_PAGE_FORMAT_GROUP:
48
49
                        return new WP5PageFormatGroup(input);
 
50
                case WP5_TOP_HEADER_FOOTER_GROUP:
 
51
                        return new WP5HeaderFooterGroup(input);
 
52
                case WP5_TOP_FONT_GROUP:
 
53
                        return new WP5FontGroup(input);
 
54
                case WP5_TOP_FOOTNOTE_ENDNOTE_GROUP:
 
55
                        return new WP5FootnoteEndnoteGroup(input);
49
56
                case WP5_TOP_TABLE_EOL_GROUP:
50
57
                        return new WP5TableEOLGroup(input);
51
58
                case WP5_TOP_TABLE_EOP_GROUP:
60
67
{
61
68
        uint32_t startPosition = input->tell();
62
69
 
63
 
        WPD_DEBUG_MSG(("WordPerfect: handling a variable length group\n"));     
64
 
        
65
70
        m_subGroup = readU8(input);
66
71
        m_size = readU16(input) + 4; // the length is the number of data bytes minus 4 (ie. the function codes)
67
72
        
68
 
        WPD_DEBUG_MSG(("WordPerfect: Read variable group header (start_position: %i, sub_group: 0x%x, size: %i)\n", startPosition, m_subGroup, m_size));
 
73
        WPD_DEBUG_MSG(("WordPerfect: Read variable group header (start_position: %i, sub_group: 0x%2x, size: %i)\n", startPosition, m_subGroup, m_size));
69
74
        
70
75
        _readContents(input);
71
76