/src/libwpd/src/lib/WP3IndentGroup.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) 2007 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 "WP3IndentGroup.h" |
27 | | #include "WP3FileStructure.h" |
28 | | #include "WP3Listener.h" |
29 | | #include "libwpd_internal.h" |
30 | | |
31 | | WP3IndentGroup::WP3IndentGroup(librevenge::RVNGInputStream *input, WPXEncryption *encryption, unsigned char groupID) : |
32 | 46.3k | WP3FixedLengthGroup(groupID), |
33 | 46.3k | m_subGroup(0), |
34 | 46.3k | m_offset(0.0) |
35 | 46.3k | { |
36 | 46.3k | _read(input, encryption); |
37 | 46.3k | } |
38 | | |
39 | | void WP3IndentGroup::_readContents(librevenge::RVNGInputStream *input, WPXEncryption *encryption) |
40 | 46.3k | { |
41 | 46.3k | m_subGroup = readU8(input, encryption); |
42 | 46.3k | m_offset = fixedPointToDouble(readU32(input, encryption, true)); |
43 | 46.3k | } |
44 | | |
45 | | void WP3IndentGroup::parse(WP3Listener *listener) |
46 | 46.3k | { |
47 | 46.3k | switch (m_subGroup) |
48 | 46.3k | { |
49 | 6.52k | case WP3_INDENT_GROUP_LEFT_INDENT: |
50 | 6.52k | listener->leftIndent(m_offset); |
51 | 6.52k | break; |
52 | 5.19k | case WP3_INDENT_GROUP_LEFT_RIGHT_INDENT: |
53 | 5.19k | listener->leftRightIndent(m_offset); |
54 | 5.19k | break; |
55 | 34.5k | default: |
56 | 34.5k | break; |
57 | 46.3k | } |
58 | 46.3k | } |
59 | | /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */ |