Coverage Report

Created: 2026-09-14 06:37

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libwpd/src/lib/WP42DefineColumnsGroup.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 "WP42DefineColumnsGroup.h"
27
#include "WP42FileStructure.h"
28
#include "libwpd_internal.h"
29
30
WP42DefineColumnsGroup::WP42DefineColumnsGroup(librevenge::RVNGInputStream *input, WPXEncryption *encryption, unsigned char group) :
31
0
  WP42MultiByteFunctionGroup(group),
32
0
  m_groupId(group),
33
0
  m_numColumns(0),
34
0
  m_isParallel(false),
35
0
  m_columnsDefinition()
36
0
{
37
0
  _read(input, encryption);
38
0
}
39
40
WP42DefineColumnsGroup::~WP42DefineColumnsGroup()
41
0
{
42
0
}
43
44
void WP42DefineColumnsGroup::_readContents(librevenge::RVNGInputStream *input, WPXEncryption *encryption)
45
0
{
46
0
  unsigned char maxNumColumns = 0;
47
0
  switch (m_groupId)
48
0
  {
49
0
  case WP42_DEFINE_COLUMNS_OLD_GROUP:
50
0
    input->seek(11, librevenge::RVNG_SEEK_CUR);
51
0
    maxNumColumns = 5;
52
0
    break;
53
0
  case WP42_DEFINE_COLUMNS_NEW_GROUP:
54
0
    input->seek(49, librevenge::RVNG_SEEK_CUR);
55
0
    maxNumColumns = 24;
56
0
    break;
57
0
  default:
58
0
    return;
59
0
  }
60
0
  unsigned char tmpNumColumns = readU8(input, encryption);
61
0
  m_numColumns = tmpNumColumns & 0x7F;
62
0
  if (m_numColumns > maxNumColumns)
63
0
    m_numColumns = maxNumColumns;
64
0
  m_isParallel = ((tmpNumColumns & 0x80) != 0);
65
0
  for (unsigned char i = 0; i<2*m_numColumns; i++)
66
0
    m_columnsDefinition.push_back(readU8(input, encryption));
67
0
}
68
69
void WP42DefineColumnsGroup::parse(WP42Listener * /* listener */)
70
0
{
71
0
  WPD_DEBUG_MSG(("WordPerfect: handling an DefineColumns group\n"));
72
0
}
73
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */