]> git.lyx.org Git - features.git/blobdiff - src/Text2.cpp
Update tex2lyx tests
[features.git] / src / Text2.cpp
index cc5340317a0956e688fa87537b6fdb2ec6941003..3dae072cecfa9e9132d396c16764f7f053f9dd08 100644 (file)
@@ -162,6 +162,7 @@ void Text::setInsetFont(BufferView const & bv, pit_type pit,
 void Text::setLayout(pit_type start, pit_type end,
                     docstring const & layout)
 {
+       // FIXME: make this work in multicell selection case
        LASSERT(start != end, return);
 
        Buffer const & buffer = owner_->buffer();
@@ -426,6 +427,11 @@ void Text::toggleFree(Cursor & cur, Font const & font, bool toggleall)
                cur.top() = resetCursor;
                cur.resetAnchor();
        }
+
+       // if there was no selection at all, the point was to change cursor font.
+       // Otherwise, we want to reset it to local text font.
+       if (cur.selection() || implicitSelection)
+               cur.setCurrentFont();
 }
 
 
@@ -934,7 +940,7 @@ bool Text::deleteEmptyParagraphMechanism(Cursor & cur,
 
 void Text::deleteEmptyParagraphMechanism(pit_type first, pit_type last, bool trackChanges)
 {
-       pos_type last_pos = static_cast<pos_type>(pars_[last].size() - 1);
+       pos_type last_pos = pars_[last].size() - 1;
        deleteEmptyParagraphMechanism(first, last, 0, last_pos, trackChanges);
 }