~ubuntu-branches/ubuntu/trusty/libwpd/trusty

« back to all changes in this revision

Viewing changes to src/lib/WP42Part.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Rene Engelhard
  • Date: 2008-02-12 15:22:12 UTC
  • mfrom: (1.2.1 upstream) (10.1.5 gutsy)
  • Revision ID: james.westby@ubuntu.com-20080212152212-beh3l4ahg9b4o3lj
Tags: 0.8.14-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 * Corel Corporation or Corel Corporation Limited."
25
25
 */
26
26
 
27
 
#include "WPXPart.h"
28
27
#include "WP42Part.h"
29
28
#include "WP42FileStructure.h"
30
29
#include "WP42MultiByteFunctionGroup.h"
31
30
#include "libwpd_internal.h"
32
31
 
33
32
// constructPart: constructs a parseable low-level representation of part of the document
34
 
// returns the part if it successfully creates the part, returns NULL if it can't
 
33
// returns the part if it successfully creates the part, returns 0 if it can't
35
34
// throws an exception if there is an error
36
35
// precondition: readVal us between 0xC0 and 0xFF
37
36
// TODO: check the precondition :D
38
37
WP42Part * WP42Part::constructPart(WPXInputStream *input, uint8_t readVal)
39
38
{       
40
 
        WPD_DEBUG_MSG(("WordPerfect: Offset: %i, ConstructPart(readVal: 0x%2x)\n", input->tell(), readVal));
 
39
        WPD_DEBUG_MSG(("WordPerfect: Offset: %i, ConstructPart(readVal: 0x%2x)\n", (unsigned int)input->tell(), readVal));
41
40
 
42
41
        if (((uint8_t)0xC0 > readVal) || ((uint8_t)0xFE < readVal))
43
42
        {
44
 
                WPD_DEBUG_MSG(("WordPerfect: Returning NULL from constructPart\n"));
45
 
                return NULL;
 
43
                WPD_DEBUG_MSG(("WordPerfect: Returning 0 from constructPart\n"));
 
44
                return 0;
46
45
        }
47
46
        
48
47
        WPD_DEBUG_MSG(("WordPerfect: constructMultiByteFunctionGroup(input, val)\n"));