Coverage Report

Created: 2026-06-13 06:44

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libwpd/src/lib/WP3DoubleByteScriptCharacterGroup.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) 2003 William Lachance (wrlach@gmail.com)
11
 * Copyright (C) 2003 Marc Maurer (uwog@uwog.net)
12
 * Copyright (C) 2002 Ariya Hidayat <ariyahidayat@yahoo.de>
13
 * Copyright (C) 2004 Fridrich Strba (fridrich.strba@bluewin.ch)
14
 *
15
 * For minor contributions see the git repository.
16
 *
17
 * Alternatively, the contents of this file may be used under the terms
18
 * of the GNU Lesser General Public License Version 2.1 or later
19
 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
20
 * applicable instead of those above.
21
 *
22
 * For further information visit http://libwpd.sourceforge.net
23
 */
24
25
/* "This product is not manufactured, approved, or supported by
26
 * Corel Corporation or Corel Corporation Limited."
27
 */
28
29
#include "WP3DoubleByteScriptCharacterGroup.h"
30
#include "WP3FileStructure.h"
31
#include "WP3Listener.h"
32
#include "libwpd_internal.h"
33
34
WP3DoubleByteScriptCharacterGroup::WP3DoubleByteScriptCharacterGroup(librevenge::RVNGInputStream *input, WPXEncryption *encryption, unsigned char groupID) :
35
0
  WP3FixedLengthGroup(groupID),
36
0
  m_scriptCharacter(0)
37
0
{
38
0
  _read(input, encryption);
39
0
}
40
41
void WP3DoubleByteScriptCharacterGroup::_readContents(librevenge::RVNGInputStream *input, WPXEncryption *encryption)
42
0
{
43
0
  m_scriptCharacter = readU16(input, encryption, true);
44
0
}
45
46
void WP3DoubleByteScriptCharacterGroup::parse(WP3Listener *listener)
47
0
{
48
  // We assume for the time being that the script characters are
49
  // actually 16 bit Unicode characters in Big Endian.
50
0
  if (m_scriptCharacter)
51
0
  {
52
0
    const unsigned *chars;
53
0
    int len = appleWorldScriptToUCS4(m_scriptCharacter, &chars);
54
0
    for (int i = 0; i < len; i++)
55
0
      listener->insertCharacter(chars[i]);
56
0
  }
57
0
}
58
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */