From 9af953f349652d16763c72babf260ad49ee94ec0 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Wed, 22 Jun 2011 20:48:02 +0000 Subject: [PATCH] Fix bug #7645 (stream encoding not properly reset after a float) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@39194 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Paragraph.cpp | 23 +++++++---------------- status.20x | 2 ++ 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 11728b49a1..8ba663939b 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -312,8 +312,8 @@ public: OutputParams const &) const; /// This could go to ParagraphParameters if we want to. - int endTeXParParams(BufferParams const &, otexstream &, - OutputParams const &) const; + bool endTeXParParams(BufferParams const &, otexstream &, + OutputParams const &) const; /// void latexInset(BufferParams const &, @@ -2213,15 +2213,13 @@ int Paragraph::Private::startTeXParParams(BufferParams const & bparams, } -int Paragraph::Private::endTeXParParams(BufferParams const & bparams, +bool Paragraph::Private::endTeXParParams(BufferParams const & bparams, otexstream & os, OutputParams const & runparams) const { - int column = 0; - LyXAlignment const curAlign = params_.align(); if (curAlign == layout_->align) - return column; + return false; switch (curAlign) { case LYX_ALIGN_NONE: @@ -2233,13 +2231,12 @@ int Paragraph::Private::endTeXParParams(BufferParams const & bparams, case LYX_ALIGN_LEFT: case LYX_ALIGN_RIGHT: case LYX_ALIGN_CENTER: - if (runparams.moving_arg) { + if (runparams.moving_arg) os << "\\protect"; - column = 8; - } break; } + string output; string const end_tag = "\n\\par\\end"; InsetCode code = ownerCode(); bool const lastpar = runparams.isLastPar; @@ -2252,33 +2249,27 @@ int Paragraph::Private::endTeXParParams(BufferParams const & bparams, case LYX_ALIGN_DECIMAL: break; case LYX_ALIGN_LEFT: { - string output; if (owner_->getParLanguage(bparams)->babel() != "hebrew") output = corrected_env(end_tag, "flushleft", code, lastpar); else output = corrected_env(end_tag, "flushright", code, lastpar); os << from_ascii(output); - adjust_column(output, column); break; } case LYX_ALIGN_RIGHT: { - string output; if (owner_->getParLanguage(bparams)->babel() != "hebrew") output = corrected_env(end_tag, "flushright", code, lastpar); else output = corrected_env(end_tag, "flushleft", code, lastpar); os << from_ascii(output); - adjust_column(output, column); break; } case LYX_ALIGN_CENTER: { - string output; output = corrected_env(end_tag, "center", code, lastpar); os << from_ascii(output); - adjust_column(output, column); break; } } - return column; + return !output.empty() || lastpar; } diff --git a/status.20x b/status.20x index c224f064c0..f54a743d66 100644 --- a/status.20x +++ b/status.20x @@ -136,6 +136,8 @@ What's new - Fix incompatibility between jss.layout and Sweave (see bug 7555). +- Fix LaTeX export when the file encoding changes after a float (bug 7645). + * USER INTERFACE - Fixed crash relating to outliner and mouse movement. -- 2.39.5