Coverage Report

Created: 2026-10-28 06:34

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libwpd/src/lib/WP6OutlineStylePacket.cpp
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2
/* libwpd
3
 * Version: MPL 2.0 / LGPLv2.1+
4
 *
5
 * This Source Code Form is subject to the terms of the Mozilla Public
6
 * License, v. 2.0. If a copy of the MPL was not distributed with this
7
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
 *
9
 * Major Contributor(s):
10
 * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
11
 * Copyright (C) 2002 Marc Maurer (uwog@uwog.net)
12
 *
13
 * For minor contributions see the git repository.
14
 *
15
 * Alternatively, the contents of this file may be used under the terms
16
 * of the GNU Lesser General Public License Version 2.1 or later
17
 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
18
 * applicable instead of those above.
19
 *
20
 * For further information visit http://libwpd.sourceforge.net
21
 */
22
23
/* "This product is not manufactured, approved, or supported by
24
 * Corel Corporation or Corel Corporation Limited."
25
 */
26
#include <string.h>
27
28
#include "WP6OutlineStylePacket.h"
29
#include "libwpd_internal.h"
30
31
WP6OutlineStylePacket::WP6OutlineStylePacket(librevenge::RVNGInputStream *input, WPXEncryption *encryption, int /* id */, unsigned dataOffset, unsigned dataSize) :
32
0
  WP6PrefixDataPacket(input, encryption),
33
0
  m_numPIDs(0),
34
0
  m_outlineHash(0),
35
0
  m_outlineFlags(0),
36
0
  m_tabBehaviourFlag(0)
37
0
{
38
0
  for (unsigned char &numberingMethod : m_numberingMethods)
39
0
    numberingMethod = 0;
40
0
  _read(input, encryption, dataOffset, dataSize);
41
0
}
42
43
WP6OutlineStylePacket::~WP6OutlineStylePacket()
44
0
{
45
0
}
46
47
void WP6OutlineStylePacket::_readContents(librevenge::RVNGInputStream *input, WPXEncryption *encryption)
48
0
{
49
0
  m_numPIDs = readU16(input, encryption);
50
0
  input->seek(2 * WP6_NUM_LIST_LEVELS, librevenge::RVNG_SEEK_CUR);
51
#if 0
52
  for (i=0; i<WP6_NUM_LIST_LEVELS; i++)
53
    m_paragraphStylePIDs[i] = readU16(input, encryption); // seemingly useless
54
#endif
55
0
  m_outlineFlags = readU8(input, encryption);
56
0
  m_outlineHash = readU16(input, encryption);
57
0
  for (unsigned char &numberingMethod : m_numberingMethods)
58
0
    numberingMethod = readU8(input, encryption);
59
0
  m_tabBehaviourFlag = readU8(input, encryption);
60
61
0
  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));
62
0
  WPD_DEBUG_MSG(("WordPerfect: Read Outline Style Packet (m_numberingMethods: %i %i %i %i %i %i %i %i)\n",
63
0
                 m_numberingMethods[0], m_numberingMethods[1], m_numberingMethods[2], m_numberingMethods[3],
64
0
                 m_numberingMethods[4], m_numberingMethods[5], m_numberingMethods[6], m_numberingMethods[7]));
65
66
0
}
67
68
void WP6OutlineStylePacket::parse(WP6Listener *listener) const
69
0
{
70
0
  listener->updateOutlineDefinition(m_outlineHash, m_numberingMethods, m_tabBehaviourFlag);
71
0
}
72
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */