]> git.lyx.org Git - lyx.git/blobdiff - src/text.C
more guii moving around.
[lyx.git] / src / text.C
index 17cdc7c930f76cab1205b060846833971b40ca87..e376fff0af1d3c56ddc16df1c3f1a8bc17e1b8cc 100644 (file)
 #include "buffer.h"
 #include "debug.h"
 #include "lyxrc.h"
-#include "LyXView.h"
-#include "Painter.h"
+#include "frontends/LyXView.h"
+#include "frontends/Painter.h"
+#include "frontends/screen.h"
 #include "tracer.h"
 #include "font.h"
 #include "encoding.h"
-#include "lyxscreen.h"
 #include "bufferview_funcs.h"
 #include "BufferView.h"
 #include "language.h"
@@ -849,6 +849,15 @@ int LyXText::leftMargin(BufferView * bview, Row const * row) const
        break;
        }
 
+       if ((workWidth(bview) > 0) &&
+               !row->par()->params().leftIndent().zero())
+       {
+               LyXLength const len = row->par()->params().leftIndent();
+               int const tw = inset_owner ?
+                       inset_owner->latexTextWidth(bview) : workWidth(bview);
+               x += len.inPixels(tw, bview->text->defaultHeight());
+       }
+
        LyXAlignment align; // wrong type
 
        if (row->par()->params().align() == LYX_ALIGN_LAYOUT)
@@ -1746,6 +1755,12 @@ void LyXText::breakParagraph(BufferView * bview, char keep_layout)
      keep_layout = 2;
    else
      keep_layout = layout.isEnvironment();
+
+   // we need to set this before we insert the paragraph. IMO the
+   // breakParagraph call should return a bool if it inserts the
+   // paragraph before or behind and we should react on that one
+   // but we can fix this in 1.3.0 (Jug 20020509)
+   bool const isempty = (layout.keepempty && !cursor.par()->size());
    cursor.par()->breakParagraph(bview->buffer()->params, cursor.pos(),
                                keep_layout);
 
@@ -1798,7 +1813,7 @@ void LyXText::breakParagraph(BufferView * bview, char keep_layout)
 
    /* This check is necessary. Otherwise the new empty paragraph will
     * be deleted automatically. And it is more friendly for the user! */
-   if (cursor.pos() || layout.keepempty)
+   if (cursor.pos() || isempty)
           setCursor(bview, cursor.par()->next(), 0);
    else
           setCursor(bview, cursor.par(), 0);