/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* libwpd * Copyright (C) 2002 William Lachance (wrlach@gmail.com) * Copyright (C) 2002-2003 Marc Maurer (uwog@uwog.net) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * * For further information visit http://libwpd.sourceforge.net */ /* "This product is not manufactured, approved, or supported by * Corel Corporation or Corel Corporation Limited." */ #include "WP6PrefixData.h" #include "WP6PrefixIndice.h" #include "WP6PrefixDataPacket.h" #include "WP6FontDescriptorPacket.h" #include "WP6DefaultInitialFontPacket.h" #include "libwpd_internal.h" WP6PrefixData::WP6PrefixData(WPXInputStream *input, WPXEncryption *encryption, const int numPrefixIndices) : m_prefixDataPacketHash(), m_prefixDataPacketTypeHash(), m_defaultInitialFontPID((-1)) { uint16_t i; WP6PrefixIndice **prefixIndiceArray = new WP6PrefixIndice *[(numPrefixIndices-1)]; for (i=1; i::value_type(prefixIndiceArray[i-1]->getType(), prefixDataPacket)); if (dynamic_cast(prefixDataPacket)) m_defaultInitialFontPID = i; } } for (i=1; isecond); } } const WP6PrefixDataPacket *WP6PrefixData::getPrefixDataPacket(const int prefixID) const { DPH::const_iterator pos = m_prefixDataPacketHash.find(prefixID); if (pos != m_prefixDataPacketHash.end()) return static_cast(pos->second); else return 0; } std::pair WP6PrefixData::getPrefixDataPacketsOfType(const int type) const { std::pair tempPair = m_prefixDataPacketTypeHash.equal_range(type); return tempPair; } /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */