]> git.lyx.org Git - features.git/commitdiff
* src/paragraph.C (corrected_env, endTeXParams):
authorJürgen Spitzmüller <spitz@lyx.org>
Mon, 4 Dec 2006 07:27:49 +0000 (07:27 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Mon, 4 Dec 2006 07:27:49 +0000 (07:27 +0000)
- writeout \begin and \end alignment tags on their own lines (bug 3010).
(patch from Gregor Gorjanc and me).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16164 a592a061-630c-0410-9148-cb99ea01b6c8

src/paragraph.C

index 23d34acac9191927f73c1381a21c8a46382ca050..b51641bf2996a0013f0d99acfc3ea2ecbd2298e0 100644 (file)
@@ -736,7 +736,10 @@ string const corrected_env(string const & suffix, string const & env,
                output += correction(env);
        else
                output += env;
-       return output + "}";
+       output += "}";
+       if (suffix == "\\begin")
+               output += "\n";
+       return output;
 }
 
 } // namespace anon
@@ -837,24 +840,24 @@ int Paragraph::endTeXParParams(BufferParams const & bparams,
        case LYX_ALIGN_LEFT: {
                string output;
                if (getParLanguage(bparams)->babel() != "hebrew")
-                       output = corrected_env("\\par\\end", "flushleft", ownerCode());
+                       output = corrected_env("\n\\par\\end", "flushleft", ownerCode());
                else
-                       output = corrected_env("\\par\\end", "flushright", ownerCode());
+                       output = corrected_env("\n\\par\\end", "flushright", ownerCode());
                os << from_ascii(output);
                column += output.size();
                break;
        } case LYX_ALIGN_RIGHT: {
                string output;
                if (getParLanguage(bparams)->babel() != "hebrew")
-                       output = corrected_env("\\par\\end", "flushright", ownerCode());
+                       output = corrected_env("\n\\par\\end", "flushright", ownerCode());
                else
-                       output = corrected_env("\\par\\end", "flushleft", ownerCode());
+                       output = corrected_env("\n\\par\\end", "flushleft", ownerCode());
                os << from_ascii(output);
                column += output.size();
                break;
        } case LYX_ALIGN_CENTER: {
                string output;
-               output = corrected_env("\\par\\end", "center", ownerCode());
+               output = corrected_env("\n\\par\\end", "center", ownerCode());
                os << from_ascii(output);
                column += output.size();
                break;