]> git.lyx.org Git - lyx.git/blobdiff - src/Text.cpp
Do not overwrite read-only files. We now move the file to the backup directory and...
[lyx.git] / src / Text.cpp
index d00d2d5356ee710b7fa26a2e9df288173a89a118..63cf1734b9b88551bc5d1301e63b41c75e7d375e 100644 (file)
@@ -456,10 +456,10 @@ void Text::readParToken(Paragraph & par, Lexer & lex,
        } else if (token == "\\change_inserted" || token == "\\change_deleted") {
                lex.eatLine();
                istringstream is(lex.getString());
-               unsigned int aid;
+               int aid;
                time_t ct;
                is >> aid >> ct;
-               map<unsigned int, int> const & am = bp.author_map;
+               BufferParams::AuthorMap const & am = bp.author_map;
                if (am.find(aid) == am.end()) {
                        errorList.push_back(ErrorItem(_("Change tracking error"),
                                            bformat(_("Unknown author index for change: %1$d\n"), aid),
@@ -599,7 +599,6 @@ static void breakParagraph(Text & text, pit_type par_offset, pos_type pos,
        // end of a paragraph
        tmp->setPlainOrDefaultLayout(bparams.documentClass());
 
-       // layout stays the same with latex-environments
        if (keep_layout) {
                tmp->setLayout(par.layout());
                tmp->setLabelWidthString(par.params().labelWidthString());
@@ -665,7 +664,6 @@ static void breakParagraph(Text & text, pit_type par_offset, pos_type pos,
                par.setPlainOrDefaultLayout(bparams.documentClass());
        }
 
-       // layout stays the same with latex-environments
        if (keep_layout) {
                par.setLayout(tmp->layout());
                par.setLabelWidthString(tmp->params().labelWidthString());
@@ -701,9 +699,10 @@ void Text::breakParagraph(Cursor & cur, bool inverse_logic)
                cpar.eraseChar(cur.pos(), cur.buffer()->params().trackChanges);
 
        // What should the layout for the new paragraph be?
-       bool keep_layout = inverse_logic ? 
-               !layout.isEnvironment() 
-               : layout.isEnvironment();
+       bool keep_layout = layout.isEnvironment() 
+               || (layout.isParagraph() && layout.parbreak_is_newline);
+       if (inverse_logic)
+               keep_layout = !keep_layout;
 
        // We need to remember this before we break the paragraph, because
        // that invalidates the layout variable