]> git.lyx.org Git - lyx.git/blobdiff - src/Cursor.cpp
Refactor InsetQuotes.h enums
[lyx.git] / src / Cursor.cpp
index b30ed0f7942628482790e4be4837ebfc01a7be8b..ee54ace608a3c31a0a297af01c2f6fd6150a563a 100644 (file)
@@ -502,7 +502,7 @@ void CursorData::clearSelection()
 }
 
 
-int CursorData::countInsetsInSelection(InsetCode const & inset_code)
+int CursorData::countInsetsInSelection(InsetCode const & inset_code) const
 {
        if (!selection_)
                return 0;
@@ -528,7 +528,7 @@ int CursorData::countInsetsInSelection(InsetCode const & inset_code)
 }
 
 
-bool CursorData::insetInSelection(InsetCode const & inset_code)
+bool CursorData::insetInSelection(InsetCode const & inset_code) const
 {
        if (!selection_)
                return false;
@@ -637,9 +637,9 @@ void CursorData::recordUndo(UndoKind kind) const
 }
 
 
-void CursorData::recordUndoInset(Inset const * in) const
+void CursorData::recordUndoInset(Inset const * inset) const
 {
-       buffer()->undo().recordUndoInset(*this, in);
+       buffer()->undo().recordUndoInset(*this, inset);
 }
 
 
@@ -669,7 +669,7 @@ void CursorData::recordUndoSelection() const
 }
 
 
-int CursorData::currentMode()
+int CursorData::currentMode() const
 {
        LASSERT(!empty(), return Inset::UNDECIDED_MODE);
        for (int i = depth() - 1; i >= 0; --i) {
@@ -897,19 +897,19 @@ void Cursor::pop()
 }
 
 
-void Cursor::push(Inset & p)
+void Cursor::push(Inset & inset)
 {
-       push_back(CursorSlice(p));
-       p.setBuffer(*buffer());
+       push_back(CursorSlice(inset));
+       inset.setBuffer(*buffer());
 }
 
 
-void Cursor::pushBackward(Inset & p)
+void Cursor::pushBackward(Inset & inset)
 {
        LASSERT(!empty(), return);
        //lyxerr << "Entering inset " << t << " front" << endl;
-       push(p);
-       p.idxFirst(*this);
+       push(inset);
+       inset.idxFirst(*this);
 }
 
 
@@ -1379,19 +1379,19 @@ void Cursor::updateTextTargetOffset()
 }
 
 
-bool Cursor::selHandle(bool sel)
+bool Cursor::selHandle(bool selecting)
 {
        //lyxerr << "Cursor::selHandle" << endl;
        if (mark())
-               sel = true;
-       if (sel == selection())
+               selecting = true;
+       if (selecting == selection())
                return false;
 
-       if (!sel)
+       if (!selecting)
                cap::saveSelection(*this);
 
        resetAnchor();
-       selection(sel);
+       selection(selecting);
        return true;
 }
 
@@ -2400,7 +2400,8 @@ bool notifyCursorLeavesOrEnters(Cursor const & old, Cursor & cur)
 void Cursor::setLanguageFromInput()
 {
        if (!lyxrc.respect_os_kbd_language
-           || (inTextEd() && paragraph().isPassthru())
+           || !inTexted()
+           || paragraph().isPassThru())
                return;
        string const & code = theApp()->inputLanguageCode();
        Language const * lang = languages.getFromCode(code, buffer()->getLanguages());
@@ -2458,6 +2459,12 @@ void Cursor::setCurrentFont()
                real_current_font.setLanguage(lang);
                real_current_font.fontInfo().setNumber(FONT_OFF);
        }
+
+       // No language in pass thru situations
+       if (cs.paragraph().isPassThru()) {
+               current_font.setLanguage(latex_language);
+               real_current_font.setLanguage(latex_language);
+       }
 }