]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathHull.cpp
Fix assertion when checking if change in selection
[lyx.git] / src / mathed / InsetMathHull.cpp
index 83983477515083f7b351af2536726fee2e1fc7be..582685e4f968a512b383a13958194b16811e05c8 100644 (file)
@@ -316,8 +316,12 @@ void InsetMathHull::updateBuffer(ParIterator const & it, UpdateType utype)
                                counter_map[eqstr] = cnts.value(eqstr);
                        for (size_t i = 0; i != label_.size(); ++i) {
                                if (numbered(i)) {
-                                       cnts.step(eqstr, utype);
-                                       numbers_[i] = cnts.theCounter(eqstr, lang);
+                                       Paragraph const & par = it.paragraph();
+                                       if (!par.isDeleted(it.pos())) {
+                                               cnts.step(eqstr, utype);
+                                               numbers_[i] = cnts.theCounter(eqstr, lang);
+                                       } else
+                                               numbers_[i] = from_ascii("#");
                                } else
                                        numbers_[i] = empty_docstring();
                        }
@@ -426,7 +430,7 @@ InsetMath::mode_type InsetMathHull::currentMode() const
 // alignment is not implemented in the LyXHTML output.
 char InsetMathHull::defaultColAlign(col_type col)
 {
-       return colAlign(type_, col);
+       return colAlign(type_, col, buffer().params());
 }
 
 
@@ -448,7 +452,7 @@ char InsetMathHull::displayColAlign(idx_type idx) const
        case hullXAlignAt:
        case hullXXAlignAt:
        case hullFlAlign:
-               return colAlign(type_, col(idx));
+               return colAlign(type_, col(idx), buffer().params());
        default:
                break;
        }
@@ -1718,13 +1722,11 @@ void InsetMathHull::check() const
 
 void InsetMathHull::doExtern(Cursor & cur, FuncRequest & func)
 {
-       docstring dlang;
-       docstring extra;
-       idocstringstream iss(func.argument());
-       iss >> dlang >> extra;
+       //FIXME: sort out whether we want std::string or docstring for those
+       string const lang = func.getArg(0);
+       docstring extra = from_utf8(func.getArg(1));
        if (extra.empty())
                extra = from_ascii("noextra");
-       string const lang = to_ascii(dlang);
 
        // replace selection with result of computation
        if (reduceSelectionToOneCell(cur)) {