The attached patch does some constifying that has been hanging around.
Scott
diff --git a/src/Buffer.cpp b/src/Buffer.cpp index cb856b0..5386520 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -1391,7 +1391,7 @@ bool Buffer::makeLaTeXFile(FileName const & fname, ofdocstream ofs; try { ofs.reset(encoding); } - catch (iconv_codecvt_facet_exception & e) { + catch (iconv_codecvt_facet_exception const & e) { lyxerr << "Caught iconv exception: " << e.what() << endl; Alert::error(_("Iconv software exception Detected"), bformat(_("Please " "verify that the support software for your encoding (%1$s) is " @@ -1418,7 +1418,7 @@ bool Buffer::makeLaTeXFile(FileName const & fname, os.texrow().reset(); writeLaTeXSource(os, original_path, runparams, output); } - catch (EncodingException & e) { + catch (EncodingException const & e) { odocstringstream ods; ods.put(e.failed_char); ostringstream oss; @@ -1432,7 +1432,7 @@ bool Buffer::makeLaTeXFile(FileName const & fname, e.par_id, e.pos, e.pos + 1)); failed_export = true; } - catch (iconv_codecvt_facet_exception & e) { + catch (iconv_codecvt_facet_exception const & e) { errorList.push_back(ErrorItem(_("iconv conversion failed"), _(e.what()), -1, 0, 0)); failed_export = true; diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index c5048dd..7a0444f 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -1284,7 +1284,7 @@ void GuiApplication::reconfigure(string const & option) string configure_command = package().configure_command(); configure_command += option; Systemcall one; - int ret = one.startscript(Systemcall::Wait, configure_command); + int const ret = one.startscript(Systemcall::Wait, configure_command); p.pop(); // emit message signal. if (current_view_) @@ -2424,7 +2424,7 @@ bool GuiApplication::closeAllViews() // are already entries in the lastOpened list. theSession().lastOpened().clear(); - QList<GuiView *> views = d->views_.values(); + QList<GuiView *> const views = d->views_.values(); foreach (GuiView * view, views) { if (!view->closeScheduled()) return false; @@ -2444,7 +2444,7 @@ GuiView & GuiApplication::view(int id) const void GuiApplication::hideDialogs(string const & name, Inset * inset) const { - QList<GuiView *> views = d->views_.values(); + QList<GuiView *> const views = d->views_.values(); foreach (GuiView * view, views) view->hideDialog(name, inset); } @@ -2453,7 +2453,7 @@ void GuiApplication::hideDialogs(string const & name, Inset * inset) const Buffer const * GuiApplication::updateInset(Inset const * inset) const { Buffer const * buffer_ = 0; - QHash<int, GuiView *>::iterator end = d->views_.end(); + QHash<int, GuiView *>::const_iterator end = d->views_.end(); for (QHash<int, GuiView *>::iterator it = d->views_.begin(); it != end; ++it) { if (Buffer const * ptr = (*it)->updateInset(inset)) buffer_ = ptr; diff --git a/src/frontends/qt4/GuiCitation.cpp b/src/frontends/qt4/GuiCitation.cpp index 13b9345..84c9c82 100644 --- a/src/frontends/qt4/GuiCitation.cpp +++ b/src/frontends/qt4/GuiCitation.cpp @@ -688,7 +688,7 @@ vector<docstring> GuiCitation::searchKeys(BiblioInfo const & bi, try { reg_exp.assign(to_utf8(expr), case_sensitive ? lyx::regex_constants::ECMAScript : lyx::regex_constants::icase); - } catch (lyx::regex_error & e) { + } catch (lyx::regex_error const & e) { // lyx::regex throws an exception if the regular expression is not // valid. LYXERR(Debug::GUI, e.what()); @@ -718,7 +718,7 @@ vector<docstring> GuiCitation::searchKeys(BiblioInfo const & bi, if (lyx::regex_search(data, reg_exp)) foundKeys.push_back(*it); } - catch (lyx::regex_error & e) { + catch (lyx::regex_error const & e) { LYXERR(Debug::GUI, e.what()); return vector<docstring>(); } diff --git a/src/frontends/qt4/GuiCommandBuffer.cpp b/src/frontends/qt4/GuiCommandBuffer.cpp index 0d19a49..f3179f0 100644 --- a/src/frontends/qt4/GuiCommandBuffer.cpp +++ b/src/frontends/qt4/GuiCommandBuffer.cpp @@ -147,7 +147,7 @@ void GuiCommandBuffer::cancel() void GuiCommandBuffer::dispatch() { - QString cmd = edit_->text(); + QString const cmd = edit_->text(); view_->setFocus(); edit_->setText(QString()); edit_->clearFocus(); diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp index 26c9b3c..6185681 100644 --- a/src/graphics/PreviewLoader.cpp +++ b/src/graphics/PreviewLoader.cpp @@ -547,7 +547,7 @@ void PreviewLoader::Impl::startLoading(bool wait) Encoding const & enc = buffer_.params().encoding(); ofdocstream of; try { of.reset(enc.iconvName()); } - catch (iconv_codecvt_facet_exception & e) { + catch (iconv_codecvt_facet_exception const & e) { LYXERR0("Caught iconv exception: " << e.what() << "\nUnable to create LaTeX file: " << latexfile); return; diff --git a/src/mathed/InsetMathString.cpp b/src/mathed/InsetMathString.cpp index af9bc98..5217566 100644 --- a/src/mathed/InsetMathString.cpp +++ b/src/mathed/InsetMathString.cpp @@ -156,7 +156,7 @@ void InsetMathString::write(WriteStream & os) const // and the last char is ASCII. if (termination) os.pendingSpace(true); - } catch (EncodingException & e) { + } catch (EncodingException const & e) { switch (os.output()) { case WriteStream::wsDryrun: { os << "<" << _("LyX Warning: ") diff --git a/src/support/Systemcall.cpp b/src/support/Systemcall.cpp index 419b0d3..11f5051 100644 --- a/src/support/Systemcall.cpp +++ b/src/support/Systemcall.cpp @@ -245,7 +245,7 @@ int Systemcall::startscript(Starttype how, string const & what, string infile; string outfile; string errfile; - QString cmd = QString::fromLocal8Bit( + QString const cmd = QString::fromLocal8Bit( parsecmd(what, infile, outfile, errfile).c_str()); SystemcallPrivate d(infile, outfile, errfile);