~ubuntu-branches/ubuntu/quantal/libwpd/quantal

« back to all changes in this revision

Viewing changes to src/lib/WPXEncryption.cpp

  • Committer: Package Import Robot
  • Author(s): Rene Engelhard
  • Date: 2011-11-29 23:31:13 UTC
  • mfrom: (10.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20111129233113-g69767blnzxs6pee
Tags: 0.9.4-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
1
2
/* libwpd
2
3
 * Copyright (C) 2007 Jaroslav Fojtik (JaFojtik@seznam.cz)
3
4
 * Copyright (C) 2007 Fridrich Strba (fridrich.strba@bluewin.ch)
50
51
        if (m_buffer)
51
52
                delete [] m_buffer;
52
53
}
53
 
                
 
54
 
54
55
 
55
56
uint16_t WPXEncryption::getCheckSum() const
56
57
{
64
65
        return checkSum;
65
66
}
66
67
 
67
 
const unsigned char * WPXEncryption::readAndDecrypt(WPXInputStream *input, unsigned long numBytes, unsigned long &numBytesRead)
 
68
const unsigned char *WPXEncryption::readAndDecrypt(WPXInputStream *input, unsigned long numBytes, unsigned long &numBytesRead)
68
69
{
69
70
        if ((m_password.len() <= 0) || (m_encryptionStartOffset > input->tell() + numBytes))
70
71
                return input->read(numBytes, numBytesRead);
89
90
        }
90
91
        return m_buffer;
91
92
}
 
93
/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */