Coverage Report

Created: 2026-03-12 06:42

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libwpd/src/lib/WP5HeaderFooterGroup.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) 2006 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 "WP5HeaderFooterGroup.h"
27
#include "libwpd_internal.h"
28
29
WP5HeaderFooterGroup::WP5HeaderFooterGroup(librevenge::RVNGInputStream *input, WPXEncryption *encryption) :
30
18.9k
  WP5VariableLengthGroup(),
31
18.9k
  m_occurrenceBits(0),
32
18.9k
  m_subDocument()
33
18.9k
{
34
18.9k
  _read(input, encryption);
35
18.9k
}
36
37
WP5HeaderFooterGroup::~WP5HeaderFooterGroup()
38
18.4k
{
39
18.4k
}
40
41
void WP5HeaderFooterGroup::_readContents(librevenge::RVNGInputStream *input, WPXEncryption *encryption)
42
18.9k
{
43
18.9k
  int tmpSubDocumentLength = getSize() - 26;
44
18.9k
  WPD_DEBUG_MSG(("WordPerfect: reading HeaderFooter group. SubDocument size: %i\n", tmpSubDocumentLength));
45
18.9k
  input->seek(7, librevenge::RVNG_SEEK_CUR);
46
18.9k
  m_occurrenceBits = readU8(input, encryption);
47
18.9k
  if (m_occurrenceBits)
48
14.0k
  {
49
14.0k
    input->seek(10, librevenge::RVNG_SEEK_CUR);
50
14.0k
    if (tmpSubDocumentLength > 0)
51
2.36k
      m_subDocument = std::make_shared<WP5SubDocument>(input, encryption, (unsigned)tmpSubDocumentLength);
52
14.0k
  }
53
18.9k
}
54
55
void WP5HeaderFooterGroup::parse(WP5Listener *listener)
56
18.4k
{
57
18.4k
  WPD_DEBUG_MSG(("WordPerfect: handling a HeaderFooter group\n"));
58
59
18.4k
  listener->headerFooterGroup(getSubGroup(), m_occurrenceBits, m_subDocument);
60
18.4k
}
61
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */