]> git.lyx.org Git - lyx.git/blobdiff - src/text2.C
Updates from Bennett and myself.
[lyx.git] / src / text2.C
index 7dcc542d63aadffa2033a2153388a3b0e55db1dc..680fa350ee1d6cac1d376a85a795768ff508d93d 100644 (file)
@@ -352,7 +352,7 @@ void LyXText::setLayout(Buffer const & buffer, pit_type start, pit_type end,
        for (pit_type pit = start; pit != end; ++pit) {
                pars_[pit].applyLayout(lyxlayout);
                if (lyxlayout->margintype == MARGIN_MANUAL)
-                       pars_[pit].setLabelWidthString(lyxlayout->labelstring());
+                       pars_[pit].setLabelWidthString(buffer.translateLabel(lyxlayout->labelstring()));
        }
 }
 
@@ -604,7 +604,7 @@ docstring LyXText::getStringToIndex(LCursor const & cur)
 
 void LyXText::setParagraph(LCursor & cur,
                           Spacing const & spacing, LyXAlignment align,
-                          string const & labelwidthstring, bool noindent)
+                          docstring const & labelwidthstring, bool noindent)
 {
        BOOST_ASSERT(cur.text());
        // make sure that the depth behind the selection are restored, too
@@ -628,8 +628,7 @@ void LyXText::setParagraph(LCursor & cur,
                        else
                                params.align(align);
                }
-               // FIXME UNICODE
-               par.setLabelWidthString(from_ascii(labelwidthstring));
+               par.setLabelWidthString(labelwidthstring);
                params.noindent(noindent);
        }
 }
@@ -987,7 +986,7 @@ InsetBase * LyXText::editXY(LCursor & cur, int x, int y)
                return 0;
        }
 
-       InsetBase * insetBefore = pars_[pit].getInset(pos - 1);
+       InsetBase * insetBefore = pos? pars_[pit].getInset(pos - 1): 0;
        //InsetBase * insetBehind = pars_[pit].getInset(pos);
 
        // This should be just before or just behind the
@@ -1025,6 +1024,9 @@ bool LyXText::checkAndActivateInset(LCursor & cur, bool front)
 
 bool LyXText::cursorLeft(LCursor & cur)
 {
+       // Tell BufferView to test for FitCursor in any case!
+       cur.updateFlags(Update::FitCursor);
+
        if (!cur.boundary() && cur.pos() > 0 &&
            cur.textRow().pos() == cur.pos() &&
            !cur.paragraph().isLineSeparator(cur.pos()-1) &&
@@ -1053,6 +1055,9 @@ bool LyXText::cursorLeft(LCursor & cur)
 
 bool LyXText::cursorRight(LCursor & cur)
 {
+       // Tell BufferView to test for FitCursor in any case!
+       cur.updateFlags(Update::FitCursor);
+
        if (cur.pos() != cur.lastpos()) {
                if (cur.boundary())
                        return setCursor(cur, cur.pit(), cur.pos(),
@@ -1082,6 +1087,9 @@ bool LyXText::cursorRight(LCursor & cur)
 
 bool LyXText::cursorUp(LCursor & cur)
 {
+       // Tell BufferView to test for FitCursor in any case!
+       cur.updateFlags(Update::FitCursor);
+
        Paragraph const & par = cur.paragraph();
        int row;
        int const x = cur.targetX();
@@ -1131,6 +1139,9 @@ bool LyXText::cursorUp(LCursor & cur)
 
 bool LyXText::cursorDown(LCursor & cur)
 {
+       // Tell BufferView to test for FitCursor in any case!
+       cur.updateFlags(Update::FitCursor);
+
        Paragraph const & par = cur.paragraph();
        int row;
        int const x = cur.targetX();