~ubuntu-branches/ubuntu/saucy/libwpd/saucy

« back to all changes in this revision

Viewing changes to src/lib/WP5FontNameStringPoolPacket.cpp

  • Committer: Package Import Robot
  • Author(s): Rene Engelhard
  • Date: 2013-04-19 00:47:04 UTC
  • mfrom: (11.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20130419004704-j04jp8dan8plg630
Tags: 0.9.7-2
upload to unstable 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2
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):
3
10
 * Copyright (C) 2005 Fridrich Strba (fridrich.strba@bluewin.ch)
4
11
 *
5
 
 * This library is free software; you can redistribute it and/or
6
 
 * modify it under the terms of the GNU Library General Public
7
 
 * License as published by the Free Software Foundation; either
8
 
 * version 2 of the License, or (at your option) any later version.
9
 
 *
10
 
 * This library is distributed in the hope that it will be useful,
11
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
 
 * Library General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU Library General Public
16
 
 * License along with this library; if not, write to the Free Software
17
 
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 
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
18
 *
19
19
 * For further information visit http://libwpd.sourceforge.net
20
20
 */
41
41
 
42
42
void WP5FontNameStringPoolPacket::_readContents(WPXInputStream *input, WPXEncryption *encryption, uint32_t dataSize)
43
43
{
44
 
        unsigned int tmpInitialOffset = input->tell();
45
 
        while ((long)input->tell() < (long)(tmpInitialOffset + dataSize))
 
44
        long tmpInitialOffset = input->tell();
 
45
        while (input->tell() < (long)(tmpInitialOffset + dataSize))
46
46
        {
47
 
                unsigned int offset = input->tell() - tmpInitialOffset;
 
47
                unsigned offset = (unsigned)(input->tell() - tmpInitialOffset);
48
48
                WPXString fontName = readCString(input, encryption);
49
49
                m_fontNameString[offset] = fontName;
50
50
        }
51
51
 
52
 
        for (std::map<unsigned int, WPXString>::const_iterator Iter = m_fontNameString.begin(); Iter != m_fontNameString.end(); Iter++)
 
52
        for (std::map<unsigned int, WPXString>::const_iterator Iter = m_fontNameString.begin(); Iter != m_fontNameString.end(); ++Iter)
53
53
                WPD_DEBUG_MSG(("WP5 Font Name String Pool Packet: offset: %i font name: %s\n", Iter->first, (Iter->second).cstr()));
54
54
}
55
55