]> git.lyx.org Git - lyx.git/commitdiff
consolidate some code into one function
authorJohn Levon <levon@movementarian.org>
Sat, 8 Feb 2003 21:46:17 +0000 (21:46 +0000)
committerJohn Levon <levon@movementarian.org>
Sat, 8 Feb 2003 21:46:17 +0000 (21:46 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6075 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/LaTeX.C

index 6c54f2a6e982a86cba1e8846dbcef9995202394c..c07b42f6e6021403ccae7cff7a7bad2a067dd3b6 100644 (file)
@@ -1,3 +1,7 @@
+2003-02-08  John Levon  <levon@movementarian.org>
+
+       * LaTeX.C: consolidate code into showRunMessage() helper
+
 2003-02-08  John Levon  <levon@movementarian.org>
 
        * lyxfind.C:
index 797b316b56b214f90b141ecb75e9abfcce09fb3d..512fd4918c6bae18ecdf425ddc8c43d03ab88253 100644 (file)
@@ -70,6 +70,21 @@ using boost::cmatch;
 
 extern BufferList bufferlist;
 
+namespace {
+
+void showRunMessage(LyXFunc * lf, unsigned int count)
+{
+       ostringstream str;
+#if USE_BOOST_FORMAT
+       str << boost::format(_("Waiting for LaTeX run number %1$d")) % count;
+#else
+       str << _("Waiting for LaTeX run number ") << count;
+#endif
+       lf->dispatch(FuncRequest(LFUN_MESSAGE, STRCONV(str.str())));
+}
+
+};
 /*
  * CLASS TEXERRORS
  */
@@ -141,7 +156,7 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun)
        bool rerun = false; // rerun requested
 
        // The class LaTeX does not know the temp path.
-       bufferlist.updateIncludedTeXfiles(lyx::getcwd()); //GetCWD());
+       bufferlist.updateIncludedTeXfiles(lyx::getcwd());
 
        // Never write the depfile if an error was encountered.
 
@@ -202,13 +217,7 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun)
        ++count;
        lyxerr[Debug::LATEX] << "Run #" << count << endl;
        if (lfun) {
-               ostringstream str;
-#if USE_BOOST_FORMAT
-               str << boost::format(_("LaTeX run number %1$d")) % count;
-#else
-               str << _("LaTeX run number ") << count;
-#endif
-               lfun->dispatch(FuncRequest(LFUN_MESSAGE, STRCONV(str.str())));
+               showRunMessage(lfun, count); 
        }
 
        this->operator()();
@@ -291,14 +300,7 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun)
                lyxerr[Debug::LATEX]
                        << "Run #" << count << endl;
                if (lfun) {
-                       ostringstream str;
-#if USE_BOOST_FORMAT
-                       str << boost::format(_("LaTeX run number %1$d")) % count;
-#else
-                       str << _("LaTeX run number ") << count;
-#endif
-                       // check lyxstring string stream and gcc 3.1 before fixing
-                       lfun->dispatch(FuncRequest(LFUN_MESSAGE, STRCONV(str.str())));
+                       showRunMessage(lfun, count);
                }
 
                this->operator()();
@@ -352,13 +354,7 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun)
                ++count;
                lyxerr[Debug::LATEX] << "Run #" << count << endl;
                if (lfun) {
-                       ostringstream str;
-#if USE_BOOST_FORMAT
-                       str << boost::format(_("LaTeX run number %1$d")) % count;
-#else
-                       str << _("LaTeX run number ") << count;
-#endif
-                       lfun->dispatch(FuncRequest(LFUN_MESSAGE, STRCONV(str.str())));
+                       showRunMessage(lfun, count);
                }
 
                this->operator()();