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

« back to all changes in this revision

Viewing changes to src/lib/WP42HeaderFooterGroup.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) 2006 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 Lesser 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
 */
42
42
void WP42HeaderFooterGroup::_readContents(WPXInputStream *input, WPXEncryption *encryption)
43
43
{
44
44
        input->seek(4, WPX_SEEK_CUR);
45
 
        unsigned int tmpStartPosition = input->tell();
46
 
        while (readU8(input, encryption) != 0xD1);
 
45
        long tmpStartPosition = input->tell();
 
46
        while (readU8(input, encryption) != 0xD1)
 
47
        {
 
48
        }
47
49
        input->seek(-3, WPX_SEEK_CUR);
48
 
        int tmpSubDocumentSize = 0;
 
50
        long tmpSubDocumentSize = 0;
49
51
        if (readU8(input, encryption) == 0xFF)
50
 
                tmpSubDocumentSize=input->tell() - tmpStartPosition -1;
51
 
        WPD_DEBUG_MSG(("WP42SubDocument startPosition = %i; SubDocumentSize = %i\n", tmpStartPosition, tmpSubDocumentSize));
 
52
                tmpSubDocumentSize = input->tell() - tmpStartPosition - 1;
 
53
        WPD_DEBUG_MSG(("WP42SubDocument startPosition = %li; SubDocumentSize = %li\n", tmpStartPosition, tmpSubDocumentSize));
52
54
        input->seek(1, WPX_SEEK_CUR);
53
55
        m_definition = readU8(input, encryption);
54
56
        input->seek(tmpStartPosition, WPX_SEEK_SET);
55
57
        if (tmpSubDocumentSize > 2)
56
 
                m_subDocument = new WP42SubDocument(input, encryption, tmpSubDocumentSize);
 
58
                m_subDocument = new WP42SubDocument(input, encryption, (unsigned)tmpSubDocumentSize);
57
59
}
58
60
 
59
61
void WP42HeaderFooterGroup::parse(WP42Listener *listener)