Constify some catches and others

This commit is contained in:
Scott Kostyshak 2012-09-17 04:01:26 -04:00
parent ec078bd29d
commit 51c380440b
7 changed files with 13 additions and 13 deletions

View File

@ -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;

View File

@ -1283,7 +1283,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_)
@ -2423,7 +2423,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;
@ -2443,7 +2443,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);
}
@ -2452,7 +2452,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;

View File

@ -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>();
}

View File

@ -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();

View File

@ -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;

View File

@ -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: ")

View File

@ -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);