]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCommandParams.cpp
Remove all BufferParam arguments in InsetXXX methods (since insets know about their...
[lyx.git] / src / insets / InsetCommandParams.cpp
index fae7ce61e45fbfbf53ff24b0bd938eb59bd25eb8..13e31a7b0097ff0ac6e75fb0b8ab0f0da615bd80 100644 (file)
@@ -35,7 +35,7 @@
 #include "support/gettext.h"
 #include "support/lstrings.h"
 
-#include "support/assert.h"
+#include "support/lassert.h"
 
 using namespace std;
 using namespace lyx::support;
@@ -55,7 +55,7 @@ static ParamInfo const & findInfo(InsetCode code, string const & cmdName)
        case BIBTEX_CODE:
                return InsetBibtex::findInfo(cmdName);
        case CITE_CODE:
-               return InsetCitation::findInfo(cmdName);        
+               return InsetCitation::findInfo(cmdName);
        case FLOAT_LIST_CODE:
                return InsetFloatList::findInfo(cmdName);
        case HYPERLINK_CODE:
@@ -65,7 +65,7 @@ static ParamInfo const & findInfo(InsetCode code, string const & cmdName)
        case INDEX_PRINT_CODE:
                return InsetPrintIndex::findInfo(cmdName);
        case LABEL_CODE:
-               return InsetLabel::findInfo(cmdName);   
+               return InsetLabel::findInfo(cmdName);
        case NOMENCL_CODE:
                return InsetNomencl::findInfo(cmdName);
        case NOMENCL_PRINT_CODE:
@@ -295,8 +295,8 @@ void InsetCommandParams::read(Lexer & lex)
                lex.printError("Missing \\end_inset at this point. "
                               "Read: `$$Token'");
                throw ExceptionMessage(WarningException,
-                       _("Missing \\end_inset at this point."),
-                       from_utf8(token));
+                       _("InsetCommandParams Error: "),
+                       _("Missing \\end_inset at this point: ") + from_utf8(token));
        }
 }
 
@@ -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()];
 }