Blame src/lib/WP3HeaderFooterGroup.cpp

Packit Service 9d1170
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
Packit Service 9d1170
/* libwpd
Packit Service 9d1170
 * Version: MPL 2.0 / LGPLv2.1+
Packit Service 9d1170
 *
Packit Service 9d1170
 * This Source Code Form is subject to the terms of the Mozilla Public
Packit Service 9d1170
 * License, v. 2.0. If a copy of the MPL was not distributed with this
Packit Service 9d1170
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
Packit Service 9d1170
 *
Packit Service 9d1170
 * Major Contributor(s):
Packit Service 9d1170
 * Copyright (C) 2006 Fridrich Strba (fridrich.strba@bluewin.ch)
Packit Service 9d1170
 *
Packit Service 9d1170
 * For minor contributions see the git repository.
Packit Service 9d1170
 *
Packit Service 9d1170
 * Alternatively, the contents of this file may be used under the terms
Packit Service 9d1170
 * of the GNU Lesser General Public License Version 2.1 or later
Packit Service 9d1170
 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
Packit Service 9d1170
 * applicable instead of those above.
Packit Service 9d1170
 *
Packit Service 9d1170
 * For further information visit http://libwpd.sourceforge.net
Packit Service 9d1170
 */
Packit Service 9d1170
Packit Service 9d1170
/* "This product is not manufactured, approved, or supported by
Packit Service 9d1170
 * Corel Corporation or Corel Corporation Limited."
Packit Service 9d1170
 */
Packit Service 9d1170
Packit Service 9d1170
#include "WP3HeaderFooterGroup.h"
Packit Service 9d1170
#include "libwpd_internal.h"
Packit Service 9d1170
#include "WP3FileStructure.h"
Packit Service 9d1170
Packit Service 9d1170
WP3HeaderFooterGroup::WP3HeaderFooterGroup(librevenge::RVNGInputStream *input, WPXEncryption *encryption) :
Packit Service 9d1170
	WP3VariableLengthGroup(),
Packit Service 9d1170
	m_definition(0),
Packit Service 9d1170
	m_subDocument(nullptr)
Packit Service 9d1170
{
Packit Service 9d1170
	_read(input, encryption);
Packit Service 9d1170
}
Packit Service 9d1170
Packit Service 9d1170
WP3HeaderFooterGroup::~WP3HeaderFooterGroup()
Packit Service 9d1170
{
Packit Service 9d1170
}
Packit Service 9d1170
Packit Service 9d1170
void WP3HeaderFooterGroup::_readContents(librevenge::RVNGInputStream *input, WPXEncryption *encryption)
Packit Service 9d1170
{
Packit Service 9d1170
	if (getSubGroup() <= WP3_HEADER_FOOTER_GROUP_FOOTER_B)  // omit watermarks for the while
Packit Service 9d1170
	{
Packit Service 9d1170
		input->seek(14, librevenge::RVNG_SEEK_CUR);
Packit Service 9d1170
		unsigned short tmpSubDocumentLength = readU16(input, encryption, true);  // read first the old subdocument length
Packit Service 9d1170
		input->seek(tmpSubDocumentLength, librevenge::RVNG_SEEK_CUR);  // and skip the old subdocument
Packit Service 9d1170
		m_definition = readU8(input, encryption);
Packit Service 9d1170
		input->seek(4, librevenge::RVNG_SEEK_CUR);
Packit Service 9d1170
		tmpSubDocumentLength = readU16(input, encryption, true);
Packit Service 9d1170
		if (tmpSubDocumentLength)
Packit Service 9d1170
			m_subDocument = new WP3SubDocument(input, encryption, tmpSubDocumentLength);
Packit Service 9d1170
	}
Packit Service 9d1170
}
Packit Service 9d1170
Packit Service 9d1170
void WP3HeaderFooterGroup::parse(WP3Listener *listener)
Packit Service 9d1170
{
Packit Service 9d1170
	WPD_DEBUG_MSG(("WordPerfect: handling a HeaderFooter group\n"));
Packit Service 9d1170
Packit Service 9d1170
	if (getSubGroup() <= WP3_HEADER_FOOTER_GROUP_FOOTER_B)  // omit watermarks for the while
Packit Service 9d1170
	{
Packit Service 9d1170
		listener->headerFooterGroup(getSubGroup(), m_definition, m_subDocument);
Packit Service 9d1170
	}
Packit Service 9d1170
}
Packit Service 9d1170
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */