Coverage Report

Created: 2026-04-29 07:28

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libwpd/src/lib/WP3DisplayGroup.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) 2005 Fridrich Strba (fridrich.strba@bluewin.ch)
11
 *
12
 * For minor contributions see the git repository.
13
 *
14
 * Alternatively, the contents of this file may be used under the terms
15
 * of the GNU Lesser General Public License Version 2.1 or later
16
 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
17
 * applicable instead of those above.
18
 *
19
 * For further information visit http://libwpd.sourceforge.net
20
 */
21
22
/* "This product is not manufactured, approved, or supported by
23
 * Corel Corporation or Corel Corporation Limited."
24
 */
25
26
#include <math.h>
27
#include "WP3DisplayGroup.h"
28
#include "WP3FileStructure.h"
29
#include "libwpd_internal.h"
30
#include "libwpd_math.h"
31
#include "WP3Listener.h"
32
33
WP3DisplayGroup::WP3DisplayGroup(librevenge::RVNGInputStream *input, WPXEncryption *encryption) :
34
4.24k
  WP3VariableLengthGroup(),
35
4.24k
  m_noteReference(),
36
4.24k
  m_pageNumber()
37
4.24k
{
38
4.24k
  _read(input, encryption);
39
4.24k
}
40
41
WP3DisplayGroup::~WP3DisplayGroup()
42
4.24k
{
43
4.24k
}
44
45
void WP3DisplayGroup::_readContents(librevenge::RVNGInputStream *input, WPXEncryption *encryption)
46
4.24k
{
47
4.24k
  switch (getSubGroup())
48
4.24k
  {
49
1.21k
  case WP3_DISPLAY_GROUP_INSERT_PAGE_NUMBER:
50
1.21k
    input->seek(4, librevenge::RVNG_SEEK_CUR);
51
1.21k
    m_pageNumber = readPascalString(input, encryption);
52
1.21k
    break;
53
583
  case WP3_DISPLAY_GROUP_INSERT_FOOTNOTE_NUMBER:
54
2.81k
  case WP3_DISPLAY_GROUP_INSERT_ENDNOTE_NUMBER:
55
2.81k
    input->seek(4, librevenge::RVNG_SEEK_CUR);
56
2.81k
    m_noteReference = readPascalString(input, encryption);
57
2.81k
    break;
58
212
  default:
59
212
    break;
60
4.24k
  }
61
4.24k
}
62
63
void WP3DisplayGroup::parse(WP3Listener *listener)
64
4.24k
{
65
4.24k
  WPD_DEBUG_MSG(("WordPerfect: handling a Display group\n"));
66
67
4.24k
  switch (getSubGroup())
68
4.24k
  {
69
1.21k
  case WP3_DISPLAY_GROUP_INSERT_PAGE_NUMBER:
70
1.21k
    listener->insertPageNumber(m_pageNumber);
71
1.21k
    break;
72
583
  case WP3_DISPLAY_GROUP_INSERT_FOOTNOTE_NUMBER:
73
2.81k
  case WP3_DISPLAY_GROUP_INSERT_ENDNOTE_NUMBER:
74
2.81k
    listener->insertNoteReference(m_noteReference);
75
2.81k
    break;
76
212
  default:
77
212
    break;
78
4.24k
  }
79
4.24k
}
80
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */