From: Georg Baum Date: Mon, 22 Dec 2008 18:18:47 +0000 (+0000) Subject: fix potential problems detected by gcc X-Git-Tag: 2.0.0~7524 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=030e249d91636dc29b122b9047bd3fb197393e94;p=features.git fix potential problems detected by gcc git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27956 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/LayoutFile.cpp b/src/LayoutFile.cpp index 6b2383c144..a559bbf243 100644 --- a/src/LayoutFile.cpp +++ b/src/LayoutFile.cpp @@ -227,10 +227,11 @@ LayoutFileIndex LayoutFileList::addEmptyClass(string const & textclass) // the last parameter to true will suppress a warning message about missing // tex class. LayoutFile * tc = new LayoutFile(textclass, textclass, "Unknown text class " + textclass, true); - if (!tc->load(tempLayout.absFilename())) + if (!tc->load(tempLayout.absFilename())) { // The only way this happens is because the hardcoded layout file above // is wrong. LASSERT(false, /**/); + } classmap_[textclass] = tc; return textclass; } diff --git a/src/frontends/qt4/GuiInfo.cpp b/src/frontends/qt4/GuiInfo.cpp index fc71f85d87..377d20eeac 100644 --- a/src/frontends/qt4/GuiInfo.cpp +++ b/src/frontends/qt4/GuiInfo.cpp @@ -87,7 +87,7 @@ void GuiInfo::on_nameLE_textChanged(QString const &) void GuiInfo::applyView() { - InsetInfo const * ii = static_cast(inset(INFO_CODE)); + InsetInfo const * ii = dynamic_cast(inset(INFO_CODE)); if (!ii) { return; } @@ -109,7 +109,7 @@ void GuiInfo::applyView() void GuiInfo::updateView() { - InsetInfo const * ii = static_cast(inset(INFO_CODE)); + InsetInfo const * ii = dynamic_cast(inset(INFO_CODE)); if (!ii) { enableView(false); return; diff --git a/src/insets/InsetCommandParams.cpp b/src/insets/InsetCommandParams.cpp index 2162c98666..23ddf13af5 100644 --- a/src/insets/InsetCommandParams.cpp +++ b/src/insets/InsetCommandParams.cpp @@ -324,8 +324,9 @@ void InsetCommandParams::write(ostream & os) const bool InsetCommandParams::writeEmptyOptional(ParamInfo::const_iterator ci) const { - if (!ci->isOptional()) + if (!ci->isOptional()) { LASSERT(false, /**/); + } ++ci; // we want to start with the next one ParamInfo::const_iterator end = info_.end(); for (; ci != end; ++ci) { @@ -394,8 +395,9 @@ docstring InsetCommandParams::getFirstNonOptParam() const ParamInfo::const_iterator it = find_if(info_.begin(), info_.end(), not1(mem_fun_ref(&ParamInfo::ParamData::isOptional))); - if (it == info_.end()) + if (it == info_.end()) { LASSERT(false, return docstring()); + } return (*this)[it->name()]; } diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 580a6a3ba9..bab4413388 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -1149,8 +1149,8 @@ bool Tabular::columnRightLine(col_type c) const idx_type i = cellIndex(r, c); if (c == cellColumn(i) + columnSpan(i) - 1) { ++total; - bool left = c + 1 < column_info.size() - && cellInfo(cellIndex(r, c + 1)).left_line + bool left = (c + 1 < column_info.size() + && cellInfo(cellIndex(r, c + 1)).left_line) || c + 1 == column_info.size(); if (cellInfo(i).right_line && left) ++nrows_right; @@ -3617,7 +3617,7 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd) break; } if (theClipboard().isInternal() || - !theClipboard().hasInternal() && theClipboard().hasLyXContents()) { + (!theClipboard().hasInternal() && theClipboard().hasLyXContents())) { cur.recordUndoInset(INSERT_UNDO); pasteClipboard(cur); } diff --git a/src/output_latex.cpp b/src/output_latex.cpp index 6fe78d0b8e..9984363963 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -658,7 +658,7 @@ ParagraphList::const_iterator TeXOnePar(Buffer const & buf, // also if the next paragraph is a multilingual environment (because of nesting) if (nextpit != paragraphs.end() && open_encoding_ == CJK && (nextpit->getParLanguage(bparams)->encoding()->package() != Encoding::CJK || - nextpit->layout().isEnvironment() && nextpit->isMultiLingual(bparams)) + (nextpit->layout().isEnvironment() && nextpit->isMultiLingual(bparams))) // inbetween environments, CJK has to be closed later (nesting!) && (!style.isEnvironment() || !nextpit->layout().isEnvironment())) { os << "\\end{CJK}\n";