Coverage Report

Created: 2026-04-29 07:28

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libwpd/src/lib/WP6NumberingMethodGroup.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
 * Copyright (C) 2004 Fridrich Strba (fridrich.strba@bluewin.ch)
13
 *
14
 * For minor contributions see the git repository.
15
 *
16
 * Alternatively, the contents of this file may be used under the terms
17
 * of the GNU Lesser General Public License Version 2.1 or later
18
 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
19
 * applicable instead of those above.
20
 *
21
 * For further information visit http://libwpd.sourceforge.net
22
 */
23
24
/* "This product is not manufactured, approved, or supported by
25
 * Corel Corporation or Corel Corporation Limited."
26
 */
27
28
#include "WP6NumberingMethodGroup.h"
29
#include "WP6FileStructure.h"
30
#include "WP6Listener.h"
31
#include "libwpd_internal.h"
32
33
34
WP6NumberingMethodGroup::WP6NumberingMethodGroup(librevenge::RVNGInputStream *input,
35
                                                 WPXEncryption *encryption) :
36
3.61k
  WP6VariableLengthGroup(),
37
3.61k
  m_levelNumber(0x00),
38
3.61k
  m_numberingMethod(0x00)
39
3.61k
{
40
3.61k
  _read(input, encryption);
41
3.61k
}
42
43
WP6NumberingMethodGroup::~WP6NumberingMethodGroup()
44
3.60k
{
45
3.60k
}
46
47
void WP6NumberingMethodGroup::_readContents(librevenge::RVNGInputStream *input, WPXEncryption *encryption)
48
3.60k
{
49
3.60k
  switch (getSubGroup())
50
3.60k
  {
51
3.17k
  case WP6_NUMBERING_METHOD_GROUP_SET_PAGE_NUMBERING_MODE:
52
3.17k
    m_levelNumber = readU8(input, encryption);;
53
3.17k
    m_numberingMethod = readU8(input, encryption);
54
3.17k
    break;
55
425
  default:
56
425
    break;
57
3.60k
  }
58
3.60k
}
59
60
void WP6NumberingMethodGroup::parse(WP6Listener *listener)
61
3.60k
{
62
3.60k
  switch (getSubGroup())
63
3.60k
  {
64
3.17k
  case WP6_NUMBERING_METHOD_GROUP_SET_PAGE_NUMBERING_MODE:
65
3.17k
    switch (m_numberingMethod)
66
3.17k
    {
67
137
    case WP6_NUMBERING_METHOD_GROUP_PAGE_NUMBERING_LOWERCASE:
68
137
      listener->setPageNumberingType(LOWERCASE);
69
137
      break;
70
1.62k
    case WP6_NUMBERING_METHOD_GROUP_PAGE_NUMBERING_UPPERCASE:
71
1.62k
      listener->setPageNumberingType(UPPERCASE);
72
1.62k
      break;
73
57
    case WP6_NUMBERING_METHOD_GROUP_PAGE_NUMBERING_LOWERCASE_ROMAN:
74
57
      listener->setPageNumberingType(LOWERCASE_ROMAN);
75
57
      break;
76
5
    case WP6_NUMBERING_METHOD_GROUP_PAGE_NUMBERING_UPPERCASE_ROMAN:
77
5
      listener->setPageNumberingType(UPPERCASE_ROMAN);
78
5
      break;
79
883
    case WP6_NUMBERING_METHOD_GROUP_PAGE_NUMBERING_ARABIC:
80
1.35k
    default:
81
1.35k
      listener->setPageNumberingType(ARABIC);
82
1.35k
      break;
83
3.17k
    }
84
3.17k
    break;
85
3.17k
  default:
86
425
    break;
87
3.60k
  }
88
3.60k
}
89
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */