]> git.lyx.org Git - lyx.git/blobdiff - src/Text.cpp
Update po directory, new Portuguese translation
[lyx.git] / src / Text.cpp
index db8929e4c0cca752fc0e5965ee4cc862238265a9..3fd04c724f69f9c6c689f516b25af67ac1cf90eb 100644 (file)
@@ -118,7 +118,7 @@ void readParToken(Buffer const & buf, Paragraph & par, Lexer & lex,
 #endif
        } else if (token == "\\begin_layout") {
                lex.eatLine();
-               string layoutname = lex.getString();
+               docstring layoutname = lex.getDocString();
 
                font = Font(Font::ALL_INHERIT, bp.language);
                change = Change(Change::UNCHANGED);
@@ -134,7 +134,7 @@ void readParToken(Buffer const & buf, Paragraph & par, Lexer & lex,
                if (!hasLayout) {
                        errorList.push_back(ErrorItem(_("Unknown layout"),
                        bformat(_("Layout '%1$s' does not exist in textclass '%2$s'\nTrying to use the default instead.\n"),
-                       from_utf8(layoutname), from_utf8(tclass.name())), par.id(), 0, par.size()));
+                       layoutname, from_utf8(tclass.name())), par.id(), 0, par.size()));
                        layoutname = tclass.defaultLayoutName();
                }
 
@@ -523,9 +523,7 @@ int Text::leftMargin(Buffer const & buffer, int max_width,
                // row in this paragraph.
                RowList::iterator rit = par.rows().begin();
                RowList::iterator end = par.rows().end();
-#ifdef WITH_WARNINGS
-#warning This is wrong.
-#endif
+               // FIXME: This is wrong.
                int minfill = max_width;
                for ( ; rit != end; ++rit)
                        if (rit->fill() < minfill)
@@ -1228,7 +1226,7 @@ bool Text::erase(Cursor & cur)
                recordUndo(cur, Undo::DELETE);
                if(!par.eraseChar(cur.pos(), cur.buffer().params().trackChanges)) {
                        // the character has been logically deleted only => skip it
-                       cur.forwardPosNoDescend();
+                       cur.top().forwardPos();
                }
                checkBufferStructure(cur.buffer(), cur);
                needsUpdate = true;
@@ -1630,6 +1628,10 @@ void Text::write(Buffer const & buf, std::ostream & os) const
        depth_type dth = 0;
        for (; pit != end; ++pit)
                pit->write(buf, os, buf.params(), dth);
+
+       // Close begin_deeper
+       for(; dth > 0; --dth)
+               os << "\n\\end_deeper";
 }