]> git.lyx.org Git - lyx.git/blobdiff - src/output_plaintext.cpp
cleanup and reorder initialisation code of GuiView and GuiToolbars. Move some things...
[lyx.git] / src / output_plaintext.cpp
index 39c5f1a13403a7522241eb311048c2bfaf104c5a..d12c82b85cc3f70c8e52b3d3b0edc1c1750559fc 100644 (file)
@@ -192,7 +192,7 @@ void writePlaintextParagraph(Buffer const & buf,
 
                char_type c = par.getUChar(buf.params(), i);
 
-               if (c == Paragraph::META_INSET || c == ' ') {
+               if (par.isInset(i) || c == ' ') {
                        if (runparams.linelen > 0 &&
                            currlinelen + word.length() > runparams.linelen) {
                                os << '\n';
@@ -205,8 +205,7 @@ void writePlaintextParagraph(Buffer const & buf,
                        word.erase();
                }
 
-               switch (c) {
-               case Paragraph::META_INSET: {
+               if (par.isInset(i)) {
                        OutputParams rp = runparams;
                        rp.depth = par.params().depth();
                        int len = par.getInset(i)->plaintext(buf, os, rp);
@@ -214,17 +213,17 @@ void writePlaintextParagraph(Buffer const & buf,
                                currlinelen = len - Inset::PLAINTEXT_NEWLINE;
                        else
                                currlinelen += len;
-                       break;
+                       continue;
                }
 
+               switch (c) {
                case ' ':
                        os << ' ';
                        currlinelen++;
                        break;
 
                case '\0':
-                       LYXERR(Debug::INFO) <<
-                               "writePlaintextFile: NULL char in structure." << endl;
+                       LYXERR(Debug::INFO, "writePlaintextFile: NULL char in structure.");
                        break;
 
                default: