Show
Ignore:
Timestamp:
04/11/06 12:15:53 (3 years ago)
Author:
jordi
Message:

The user can now open an encrypted pdf file, as the presenter will ask for the password three time before to show an error, or until the user gives the cancels out.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests/DumbDocument.cxx

    r26 r27  
    3030    m_Loaded = FALSE; 
    3131    m_OpenError = DocumentErrorNone; 
     32    m_Password = NULL; 
    3233} 
    3334 
    3435DumbDocument::~DumbDocument () 
    3536{ 
     37    g_free (m_Password); 
    3638} 
    3739 
     
    4749{ 
    4850    if ( DocumentErrorNone == m_OpenError ) 
     51    { 
     52        setFileName (filename); 
     53        m_Loaded = TRUE; 
     54    } 
     55    else if ( DocumentErrorEncrypted == m_OpenError && 
     56              password != NULL &&  
     57              0 == g_ascii_strcasecmp (password, m_Password)) 
    4958    { 
    5059        setFileName (filename); 
     
    8089    m_OpenError = error; 
    8190} 
     91 
     92void 
     93DumbDocument::setPassword (const gchar *password) 
     94{ 
     95    g_free (m_Password); 
     96    m_Password = g_strdup (password); 
     97}