]> git.lyx.org Git - lyx.git/blobdiff - src/paragraph_pimpl.C
* InsetMathNest.C (handleFont): avoid crash on undo when
[lyx.git] / src / paragraph_pimpl.C
index 1ece42dadb61f5810e112abdce7e95087214ce8f..bad7602b1d0e286ef030524a38709432eb5f81d0 100644 (file)
@@ -163,14 +163,23 @@ void Paragraph::Pimpl::acceptChanges(pos_type start, pos_type end)
 {
        BOOST_ASSERT(start >= 0 && start <= size());
        BOOST_ASSERT(end > start && end <= size() + 1);
-       
+
        for (pos_type pos = start; pos < end; ++pos) {
                switch (lookupChange(pos).type) {
                        case Change::UNCHANGED:
+                               // accept changes in nested inset
+                               if (pos < size() && owner_->isInset(pos)) {
+                                       owner_->getInset(pos)->acceptChanges();
+                               }
+
                                break;
 
                        case Change::INSERTED:
                                changes_.set(Change(Change::UNCHANGED), pos);
+                               // also accept changes in nested inset
+                               if (pos < size() && owner_->isInset(pos)) {
+                                       owner_->getInset(pos)->acceptChanges();
+                               }
                                break;
 
                        case Change::DELETED:
@@ -184,10 +193,6 @@ void Paragraph::Pimpl::acceptChanges(pos_type start, pos_type end)
                                break;
                }
 
-               // also accept changes in nested insets
-               if (pos < size() && owner_->isInset(pos)) {
-                       owner_->getInset(pos)->acceptChanges();
-               }
        }
 }
 
@@ -200,7 +205,7 @@ void Paragraph::Pimpl::rejectChanges(pos_type start, pos_type end)
        for (pos_type pos = start; pos < end; ++pos) {
                switch (lookupChange(pos).type) {
                        case Change::UNCHANGED:
-                               // also reject changes inside of insets
+                               // reject changes in nested inset
                                if (pos < size() && owner_->isInset(pos)) {
                                        owner_->getInset(pos)->rejectChanges();
                                }
@@ -658,7 +663,9 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
                case 0x20ac:    // EURO SIGN
                        if (isEncoding(bparams, font, "latin9")
                            || isEncoding(bparams, font, "cp1251")
-                           || isEncoding(bparams, font, "utf8")) {
+                           || isEncoding(bparams, font, "utf8")
+                           || isEncoding(bparams, font, "latin10")
+                           || isEncoding(bparams, font, "cp858")) {
                                os.put(c);
                        } else {
                                os << "\\texteuro{}";
@@ -816,7 +823,7 @@ void Paragraph::Pimpl::validate(LaTeXFeatures & features,
                                             << endl;
                        features.require("noun");
                        lyxerr[Debug::LATEX] << "Noun enabled. Font: "
-                                            << fcit->font().stateText(0)
+                                            << to_utf8(fcit->font().stateText(0))
                                             << endl;
                }
                switch (fcit->font().color()) {
@@ -831,7 +838,7 @@ void Paragraph::Pimpl::validate(LaTeXFeatures & features,
                default:
                        features.require("color");
                        lyxerr[Debug::LATEX] << "Color enabled. Font: "
-                                            << fcit->font().stateText(0)
+                                            << to_utf8(fcit->font().stateText(0))
                                             << endl;
                }