diff -c -r doxygen-1.5.1-orig/src/dot.cpp doxygen-1.5.1/src/dot.cpp
*** doxygen-1.5.1-orig/src/dot.cpp	Wed Aug 23 21:00:37 2006
--- doxygen-1.5.1/src/dot.cpp	Wed Jan 24 21:58:05 2007
***************
*** 377,382 ****
--- 377,415 ----
    return TRUE;
  }
  
+ /*! Checks if a graph image for a given output format needs to be
+  *  generated.  For BITMAP output, this is accomplished by checking
+  *  for the existance of the file \a baseName".map".  For EPS output,
+  *  \a baseName".eps" and, if option \c USE_PDFLATEX is set,
+  *  \a baseName".pdf" are checked.
+  *  This function returns TRUE if any of the necessary files is
+  *  missing, and FALSE otherwise.
+  */
+ static bool needToGenerateGraph(const QCString &baseName, GraphOutputFormat format)
+ {
+   bool haveFiles = FALSE;
+ 
+   if (format == BITMAP)
+   {
+     // The image file is generated simultaneously with the .map
+     // file, so it suffices to only check for one file.
+     haveFiles = QFileInfo(baseName+".map").exists();
+   }
+   else if (format == EPS)
+   {
+     haveFiles = QFileInfo(baseName+".eps").exists();
+ 
+     // If the USE_PDFLATEX option is set, the .pdf file is generated
+     // from the .eps file.  This two-step process can be interrupted
+     // by the user, so we have to explicitly check for both files.
+     if (haveFiles && Config_getBool("USE_PDFLATEX"))
+     {
+       haveFiles = QFileInfo(baseName+".pdf").exists();
+     }
+   }
+   return !haveFiles;
+ }
+ 
  //--------------------------------------------------------------------
  
  class DotNodeList : public QList<DotNode>
***************
*** 1095,1102 ****
      QCString sigStr(33);
      MD5Buffer((const unsigned char *)buf.ascii(),buf.length(),md5_sig);
      MD5SigToString(md5_sig,sigStr.data(),33);
!     if (checkAndUpdateMd5Signature(baseName,sigStr) || 
!         !QFileInfo(mapName).exists())
      { 
        // image was new or has changed
        QCString dotName=baseName+".dot";
--- 1128,1135 ----
      QCString sigStr(33);
      MD5Buffer((const unsigned char *)buf.ascii(),buf.length(),md5_sig);
      MD5SigToString(md5_sig,sigStr.data(),33);
!     if (checkAndUpdateMd5Signature(baseName,sigStr) ||
!         needToGenerateGraph(baseName, BITMAP))
      { 
        // image was new or has changed
        QCString dotName=baseName+".dot";
***************
*** 1819,1825 ****
                                       TRUE                               // backArrows
                                      );
    if (checkAndUpdateMd5Signature(baseName,md5) ||
!       !QFileInfo(baseName+".map").exists()
       )
    {
      findMaximalDotGraph(m_startNode,                       // root
--- 1852,1858 ----
                                       TRUE                               // backArrows
                                      );
    if (checkAndUpdateMd5Signature(baseName,md5) ||
!       needToGenerateGraph(baseName,format)
       )
    {
      findMaximalDotGraph(m_startNode,                       // root
***************
*** 1915,1921 ****
          return baseName;
        }
        int maxWidth = 420; /* approx. page width in points */
!       out << "\\begin{figure}[H]\n"
          "\\begin{center}\n"
          "\\leavevmode\n"
          "\\includegraphics[width=" << QMIN(width/2,maxWidth) 
--- 1948,1954 ----
          return baseName;
        }
        int maxWidth = 420; /* approx. page width in points */
!       out << "\\nopagebreak\\begin{figure}[H]\n"
          "\\begin{center}\n"
          "\\leavevmode\n"
          "\\includegraphics[width=" << QMIN(width/2,maxWidth) 
***************
*** 2081,2087 ****
                                       FALSE                // backArrows
                                      );
    if (checkAndUpdateMd5Signature(baseName,md5) ||
!       !QFileInfo(baseName+".map").exists()
       )
    {
      findMaximalDotGraph(m_startNode,                      // root
--- 2114,2120 ----
                                       FALSE                // backArrows
                                      );
    if (checkAndUpdateMd5Signature(baseName,md5) ||
!       needToGenerateGraph(baseName,format)
       )
    {
      findMaximalDotGraph(m_startNode,                      // root
***************
*** 2163,2169 ****
      }
      int maxWidth = 420; /* approx. page width in points */
     
!     out << "\\begin{figure}[H]\n"
             "\\begin{center}\n"
             "\\leavevmode\n"
             "\\includegraphics[width=" << QMIN(width/2,maxWidth) 
--- 2196,2203 ----
      }
      int maxWidth = 420; /* approx. page width in points */
     
!     out << "\\nopagebreak\n"
!            "\\begin{figure}[H]\n"
             "\\begin{center}\n"
             "\\leavevmode\n"
             "\\includegraphics[width=" << QMIN(width/2,maxWidth) 
***************
*** 2260,2266 ****
                                       FALSE                // backArrows
                                      );
    if (checkAndUpdateMd5Signature(baseName,md5) ||
!       !QFileInfo(baseName+".map").exists()
       )
    {
      findMaximalDotGraph(m_startNode,                      // root
--- 2294,2300 ----
                                       FALSE                // backArrows
                                      );
    if (checkAndUpdateMd5Signature(baseName,md5) ||
!       needToGenerateGraph(baseName,format)
       )
    {
      findMaximalDotGraph(m_startNode,                      // root
***************
*** 2342,2348 ****
      }
      int maxWidth = 420; /* approx. page width in points */
     
!     out << "\\begin{figure}[H]\n"
             "\\begin{center}\n"
             "\\leavevmode\n"
             "\\includegraphics[width=" << QMIN(width/2,maxWidth) 
--- 2376,2383 ----
      }
      int maxWidth = 420; /* approx. page width in points */
     
!     out << "\\nopagebreak\n"
!            "\\begin{figure}[H]\n"
             "\\begin{center}\n"
             "\\leavevmode\n"
             "\\includegraphics[width=" << QMIN(width/2,maxWidth) 
***************
*** 2531,2537 ****
      }
      int maxWidth = 420; /* approx. page width in points */
     
!     out << "\\begin{figure}[H]\n"
             "\\begin{center}\n"
             "\\leavevmode\n"
             "\\includegraphics[width=" << QMIN(width/2,maxWidth) 
--- 2566,2573 ----
      }
      int maxWidth = 420; /* approx. page width in points */
     
!     out << "\\nopagebreak\n"
!            "\\begin{figure}[H]\n"
             "\\begin{center}\n"
             "\\leavevmode\n"
             "\\includegraphics[width=" << QMIN(width/2,maxWidth) 
