<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>I think that the poppler maintainers have tried to avoid changes that would unnecessarily complicate merging xpdf changes into poppler.<div><br></div><div>Even though poppler has diverged from xpdf, it is still often possible to apply small xpdf diffs to poppler, and I think that there are a number of xpdf-3.04 changes that still need to be merged.</div><div><br></div><div>The qt frontends are not in xpdf, so reformatting them would probably be less of an issue.</div><div><br></div><div>Regards, William</div><div><br><br><div>> From: jakubkucharski97@gmail.com<br>> To: poppler@lists.freedesktop.org<br>> Date: Mon, 27 Jun 2016 19:09:33 +0200<br>> Subject: [poppler] Source code beautifiers<br>> <br>> Hello, everyone!<br>> <br>> Poppler has a very diverse codebase if it comes to coding style. In<br>> some places it gets really weird, e.g. the qt frontends, where we have<br>> code like this ("▸---" marks a tab):<br>> <br>>     bool Document::unlock(const QByteArray &ownerPassword,                                                                                                                <br>> ▸---▸---▸---  const QByteArray &userPassword)                                                                                                                             <br>>     {                                                                                                                                                                     <br>> ▸---if (m_doc->locked) {                                                                                                                                                  <br>> ▸---    /* racier then it needs to be */                                                                                                                                  <br>> ▸---    DocumentData *doc2;                                                                                                                                               <br>> ▸---    if (!m_doc->fileContents.isEmpty())                                                                                                                               <br>> ▸---    {                                                                                                                                                                 <br>> ▸---▸---doc2 = new DocumentData(m_doc->fileContents,                                                                                                                      <br>> ▸---▸---▸---▸---▸---new GooString(ownerPassword.data()),                                                                                                                  <br>> ▸---▸---▸---▸---▸---new GooString(userPassword.data()));                                                                                                                  <br>> ▸---    }                                                                                                                                                                 <br>> ▸---    else                                                                                                                                                              <br>> ▸---    {                                                                                                                                                                 <br>> ▸---▸---doc2 = new DocumentData(m_doc->m_filePath,                                                                                                                        <br>> ▸---▸---▸---▸---▸---new GooString(ownerPassword.data()),                                                                                                                  <br>> ▸---▸---▸---▸---▸---new GooString(userPassword.data()));                                                                                                                  <br>> ▸---    }                                                                                                                                                                 <br>> ▸---    if (!doc2->doc->isOk()) {                                                                                                                                         <br>> ▸---▸---delete doc2;                                                                                                                                                      <br>> ▸---    } else {                                                                                                                                                          <br>> ▸---▸---delete m_doc;                                                                                                                                                     <br>> ▸---▸---m_doc = doc2;                                                                                                                                                     <br>> ▸---▸---m_doc->locked = false;                                                                                                                                            <br>> ▸---▸---m_doc->fillMembers();                                                                                                                                             <br>> ▸---    }                                                                                                                                                                 <br>> ▸---}                                                                                                                                                                     <br>> ▸---return m_doc->locked;                                                                                                                                                 <br>>     }<br>> <br>> With code like this I just end up copy-pasting things hoping that I<br>> manage to guess the right way to format the code. So I've thought we<br>> could make things easier by using a source code beautifier and<br>> providing config files for it. We could either unify the coding style<br>> or we could have different config files for core, goo, qt etc. (I'd be<br>> in favor of unification.)<br>> <br>> Two source code beautifiers that I know of are Uncrustify[1] and<br>> ClangFormat[2]. For the second one there is a web page[3] which makes<br>> its configuration a piece of cake and there is a python script making<br>> it easy to integrate it with vim or any other highly configurable<br>> editor. However Uncrustify seems to be more configurable. Flatpak devs<br>> have a useful shell script making it easier to invoke Uncrustify[4].<br>> <br>> What do you think?<br>> <br>> Jakub<br>> <br>> [1] http://uncrustify.sourceforge.net/<br>> [2] http://clang.llvm.org/docs/ClangFormat.html<br>> [3] http://clangformat.com/<br>> [4] https://github.com/flatpak/flatpak/blob/master/uncrustify.sh<br>> _______________________________________________<br>> poppler mailing list<br>> poppler@lists.freedesktop.org<br>> https://lists.freedesktop.org/mailman/listinfo/poppler<br></div></div>                                      </div></body>
</html>