~ubuntu-branches/ubuntu/saucy/libwpd/saucy

« back to all changes in this revision

Viewing changes to src/lib/WP6OutlineStylePacket.cpp

  • Committer: Package Import Robot
  • Author(s): Rene Engelhard
  • Date: 2011-11-29 23:31:13 UTC
  • mfrom: (1.2.5)
  • Revision ID: package-import@ubuntu.com-20111129233113-xdtwca9h0y6wdxst
Tags: 0.9.4-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
1
2
/* libwpd
2
3
 * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
3
4
 * Copyright (C) 2002 Marc Maurer (uwog@uwog.net)
4
 
 *  
 
5
 *
5
6
 * This library is free software; you can redistribute it and/or
6
7
 * modify it under the terms of the GNU Library General Public
7
8
 * License as published by the Free Software Foundation; either
19
20
 * For further information visit http://libwpd.sourceforge.net
20
21
 */
21
22
 
22
 
/* "This product is not manufactured, approved, or supported by 
 
23
/* "This product is not manufactured, approved, or supported by
23
24
 * Corel Corporation or Corel Corporation Limited."
24
25
 */
25
26
#include <string.h>
27
28
#include "WP6OutlineStylePacket.h"
28
29
#include "libwpd_internal.h"
29
30
 
30
 
WP6OutlineStylePacket::WP6OutlineStylePacket(WPXInputStream *input, WPXEncryption *encryption, int /* id */, uint32_t dataOffset, uint32_t dataSize) : 
 
31
WP6OutlineStylePacket::WP6OutlineStylePacket(WPXInputStream *input, WPXEncryption *encryption, int /* id */, uint32_t dataOffset, uint32_t dataSize) :
31
32
        WP6PrefixDataPacket(input, encryption),
32
33
        m_numPIDs(0),
33
34
        m_nonDeletableInfoSize(0),
34
35
        m_outlineHash(0),
35
 
        m_numberingMethods(),
36
36
        m_outlineFlags(0),
37
37
        m_tabBehaviourFlag(0)
38
38
{
 
39
        for (unsigned i = 0; i < WP6_NUM_LIST_LEVELS; i++)
 
40
                m_numberingMethods[i] = 0;
39
41
        _read(input, encryption, dataOffset, dataSize);
40
42
}
41
43
 
48
50
        m_numPIDs = readU16(input, encryption);
49
51
        input->seek(2 * WP6_NUM_LIST_LEVELS, WPX_SEEK_CUR);
50
52
#if 0
51
 
        for (i=0; i<WP6_NUM_LIST_LEVELS; i++) 
 
53
        for (i=0; i<WP6_NUM_LIST_LEVELS; i++)
52
54
                m_paragraphStylePIDs[i] = readU16(input, encryption); // seemingly useless
53
55
#endif
54
56
        m_outlineFlags = readU8(input, encryption);
55
57
        m_outlineHash = readU16(input, encryption);
56
 
        for (unsigned i=0; i<WP6_NUM_LIST_LEVELS; i++)  
 
58
        for (unsigned i=0; i<WP6_NUM_LIST_LEVELS; i++)
57
59
                m_numberingMethods[i] = readU8(input, encryption);
58
60
        m_tabBehaviourFlag = readU8(input, encryption);
59
 
        
 
61
 
60
62
        WPD_DEBUG_MSG(("WordPerfect: Read Outline Style Packet (numPrefixIDs: %i, outlineHash: %i, outlineFlags: %i, tab behaviour flag: %i)\n", (int) m_numPIDs, (int) m_outlineHash, (int) m_outlineFlags, (int) m_tabBehaviourFlag));
61
 
        WPD_DEBUG_MSG(("WordPerfect: Read Outline Style Packet (m_numberingMethods: %i %i %i %i %i %i %i %i)\n", 
62
 
                       m_numberingMethods[0], m_numberingMethods[1], m_numberingMethods[2], m_numberingMethods[3],
63
 
                       m_numberingMethods[4], m_numberingMethods[5], m_numberingMethods[6], m_numberingMethods[7]));
64
 
                     
 
63
        WPD_DEBUG_MSG(("WordPerfect: Read Outline Style Packet (m_numberingMethods: %i %i %i %i %i %i %i %i)\n",
 
64
                       m_numberingMethods[0], m_numberingMethods[1], m_numberingMethods[2], m_numberingMethods[3],
 
65
                       m_numberingMethods[4], m_numberingMethods[5], m_numberingMethods[6], m_numberingMethods[7]));
 
66
 
65
67
}
66
68
 
67
69
void WP6OutlineStylePacket::parse(WP6Listener *listener) const
68
70
{
69
71
        listener->updateOutlineDefinition(indexHeader, m_outlineHash, m_numberingMethods, m_tabBehaviourFlag);
70
72
}
 
73
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */