]> git.lyx.org Git - features.git/commitdiff
fix potential problems detected by gcc
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Mon, 22 Dec 2008 18:18:47 +0000 (18:18 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Mon, 22 Dec 2008 18:18:47 +0000 (18:18 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27956 a592a061-630c-0410-9148-cb99ea01b6c8

src/LayoutFile.cpp
src/frontends/qt4/GuiInfo.cpp
src/insets/InsetCommandParams.cpp
src/insets/InsetTabular.cpp
src/output_latex.cpp

index 6b2383c1446cdd3d4824eda51036e6de1b264991..a559bbf243bb622e69f1099cef63cc2479e4bb6a 100644 (file)
@@ -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;
 }
index fc71f85d87a42d6a472ece86ac150c03fae7b481..377d20eeac4b4518ec0d633a58ddd07d7e50ec52 100644 (file)
@@ -87,7 +87,7 @@ void GuiInfo::on_nameLE_textChanged(QString const &)
 
 void GuiInfo::applyView()
 {
-       InsetInfo const * ii = static_cast<InsetInfo const *>(inset(INFO_CODE));
+       InsetInfo const * ii = dynamic_cast<InsetInfo const *>(inset(INFO_CODE));
        if (!ii) {
                return;
        }
@@ -109,7 +109,7 @@ void GuiInfo::applyView()
 
 void GuiInfo::updateView()
 {
-       InsetInfo const * ii = static_cast<InsetInfo const *>(inset(INFO_CODE));
+       InsetInfo const * ii = dynamic_cast<InsetInfo const *>(inset(INFO_CODE));
        if (!ii) {
                enableView(false);
                return;
index 2162c98666c43c2208de76fae948c6aebfe458a0..23ddf13af5cee4308d4c2368cac6d6db96a06aa4 100644 (file)
@@ -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()];
 }
 
index 580a6a3ba9412c798ff1d629230427e5ef06827e..bab4413388ed6128cf39769ed0936f4327119ce2 100644 (file)
@@ -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);
                }
index 6fe78d0b8e89f4d581b90867bd63854122d3da9c..99843639632c1e539cd5ba2213fb999dbb636c5b 100644 (file)
@@ -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";