[poppler] Source code beautifiers

Albert Astals Cid aacid at kde.org
Mon Jul 4 23:21:44 UTC 2016


El dimecres, 29 de juny de 2016, a les 14:29:05 CEST, Jakub Kucharski va escriure:
> On Wed, 2016-06-29 at 21:30 +0930, Adrian Johnson wrote:
> > On 28/06/16 02:39, Jakub Kucharski wrote:
> > > Hello, everyone!
> > > 
> > > Poppler has a very diverse codebase if it comes to coding style. In
> > > some places it gets really weird, e.g. the qt frontends, where we
> > > have
> > > code like this ("▸---" marks a tab):
> > > 
> > >     bool Document::unlock(const QByteArray
> > > &ownerPassword,                                                    
> > >                                                             
> > > ▸---▸---▸---  const QByteArray
> > > &userPassword)                                                     
> > >                                                                    
> > >      
> > >     {                                                              
> > >                                                                    
> > >                                     
> > > ▸---if (m_doc->locked)
> > > {                                                                  
> > >                                                                    
> > >              
> > > ▸---    /* racier then it needs to be
> > > */                                                                 
> > >                                                                  
> > > ▸---    DocumentData
> > > *doc2;                                                             
> > >                                                                    
> > >                
> > > ▸---    if (!m_doc-
> > > 
> > > >fileContents.isEmpty())                                           
> > > 
> > >                                                                    
> > >                  
> > > ▸
> > > -
> > > --    {                                                            
> > >                                                                    
> > >                                   
> > > ▸---▸---doc2 = new DocumentData(m_doc-
> > > 
> > > >fileContents,                                                     
> > > 
> > >                                                                  
> > > ▸---▸---▸---▸---▸---new
> > > GooString(ownerPassword.data()),                                   
> > >                                                                    
> > >             
> > > ▸---▸---▸---▸---▸---new
> > > GooString(userPassword.data()));                                   
> > >                                                                    
> > >             
> > > ▸
> > > -
> > > --    }                                                            
> > >                                                                    
> > >                                   
> > > ▸
> > > -
> > > --    else                                                         
> > >                                                                    
> > >                                   
> > > ▸
> > > -
> > > --    {                                                            
> > >                                                                    
> > >                                   
> > > ▸---▸---doc2 = new DocumentData(m_doc-
> > > 
> > > >m_filePath,                                                       
> > > 
> > >                                                                  
> > > ▸---▸---▸---▸---▸---new
> > > GooString(ownerPassword.data()),                                   
> > >                                                                    
> > >             
> > > ▸---▸---▸---▸---▸---new
> > > GooString(userPassword.data()));                                   
> > >                                                                    
> > >             
> > > ▸
> > > -
> > > --    }                                                            
> > >                                                                    
> > >                                   
> > > ▸---    if (!doc2->doc->isOk())
> > > {                                                                  
> > >                                                                    
> > >     
> > > ▸---▸---delete
> > > doc2;                                                              
> > >                                                                    
> > >                      
> > > ▸---    } else
> > > {                                                                  
> > >                                                                    
> > >                      
> > > ▸---▸---delete
> > > m_doc;                                                             
> > >                                                                    
> > >                      
> > > ▸---▸---m_doc =
> > > doc2;                                                              
> > >                                                                    
> > >                     
> > > ▸---▸---m_doc->locked =
> > > false;                                                             
> > >                                                                    
> > >             
> > > ▸---▸---m_doc-
> > > 
> > > >fillMembers();                                                    
> > > 
> > >                                                                    
> > >                       
> > > ▸
> > > -
> > > --    }                                                            
> > >                                                                    
> > >                                   
> > > ▸---
> > > }                                                                  
> > >                                                                    
> > >                                 
> > > ▸---return m_doc-
> > > 
> > > >locked;                                                           
> > > 
> > >                                                                    
> > >                    
> > >     }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler/attachments/20160705/3b982ff2/attachment-0001.html>


More information about the poppler mailing list