]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetText.cpp
Fixup aeb51be9: set current font correctly when editing inset
[features.git] / src / insets / InsetText.cpp
index 10b15c88edad34abd39a31fb90b9223ff2700e91..ec223fa83a13c5350979be155ef4d1dc28ec5d29 100644 (file)
@@ -51,6 +51,7 @@
 #include "Text.h"
 #include "TextMetrics.h"
 #include "TocBackend.h"
+#include "TocBuilder.h"
 
 #include "frontends/alert.h"
 #include "frontends/Painter.h"
@@ -63,6 +64,7 @@
 #include "support/RefChanger.h"
 
 #include <algorithm>
+#include <stack>
 
 
 using namespace std;
@@ -278,6 +280,7 @@ void InsetText::edit(Cursor & cur, bool front, EntryDirection entry_from)
        }
 
        cur.top().setPitPos(pit, pos);
+       cur.setCurrentFont();
        cur.finishUndo();
 }
 
@@ -292,6 +295,7 @@ void InsetText::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
        LYXERR(Debug::ACTION, "InsetText::doDispatch(): cmd: " << cmd);
 
+#if 0
        // See bug #9042, for instance.
        if (isPassThru()) {
                // Force any new text to latex_language FIXME: This
@@ -303,6 +307,7 @@ void InsetText::doDispatch(Cursor & cur, FuncRequest & cmd)
                cur.current_font.setLanguage(latex_language);
                cur.real_current_font.setLanguage(latex_language);
        }
+#endif
 
        switch (cmd.action()) {
        case LFUN_PASTE:
@@ -1009,7 +1014,7 @@ pit_type InsetText::openAddToTocForParagraph(pit_type pit,
 {
        Paragraph const & par = paragraphs()[pit];
        TocBuilder & b = backend.builder(par.layout().tocType());
-       docstring const label = par.labelString();
+       docstring const label = par.labelString();
        b.pushItem(dit, label + (label.empty() ? "" : " "), output_active);
        return text().lastInSequence(pit);
 }
@@ -1128,7 +1133,7 @@ string InsetText::contextMenuName() const
 }
 
 
-docstring InsetText::toolTipText(docstring prefix, size_t const len) const
+docstring InsetText::toolTipText(docstring const & prefix, size_t const len) const
 {
        OutputParams rp(&buffer().params().encoding());
        rp.for_tooltip = true;