X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLaTeX.C;h=5995025dee4872a8781e4d96595bc33a798c0433;hb=cd3d0bc0b26f4d92fdfbfaac4adefebcf51f11ff;hp=797b316b56b214f90b141ecb75e9abfcce09fb3d;hpb=691568ea39ce8efc4a6e6e5461d3f65705cf2d72;p=lyx.git diff --git a/src/LaTeX.C b/src/LaTeX.C index 797b316b56..5995025dee 100644 --- a/src/LaTeX.C +++ b/src/LaTeX.C @@ -13,10 +13,6 @@ #include -#ifdef __GNUG__ -#pragma implementation -#endif - #include "LaTeX.h" #include "bufferlist.h" #include "gettext.h" @@ -70,6 +66,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 +152,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 +213,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 +296,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 +350,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()();