]> git.lyx.org Git - features.git/commitdiff
Fixed rowbreaking for "character"-insets and ignore all paragraph attributes
authorJürgen Vigna <jug@sad.it>
Tue, 8 Jan 2002 14:24:49 +0000 (14:24 +0000)
committerJürgen Vigna <jug@sad.it>
Tue, 8 Jan 2002 14:24:49 +0000 (14:24 +0000)
when the cell is not fixed lenght in a tabular on LaTeX output!

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

15 files changed:
src/ChangeLog
src/buffer.C
src/buffer.h
src/insets/ChangeLog
src/insets/inset.C
src/insets/inset.h
src/insets/insetlatexaccent.h
src/insets/insetquotes.h
src/insets/insetspecialchar.C
src/insets/insetspecialchar.h
src/insets/insettabular.C
src/insets/insettabular.h
src/paragraph.C
src/support/textutils.h
src/text.C

index 98ef9bd13deb8c8eb48872363cca387ae5c85bac..2521921a5f4e4b46dc4783e2347530661a1123af 100644 (file)
@@ -1,3 +1,13 @@
+2002-01-08  Juergen Vigna  <jug@sad.it>
+
+       * text.C (nextBreakPoint): use function Inset::isChar().
+
+       * paragraph.C (TeXOnePar): use function
+       Inset::forceDefaultParagraphs.
+
+       * buffer.C (latexParagraphs): use function
+       Inset::forceDefaultParagraphs.
+
 2002-01-07  Angus Leeming  <a.leeming@ic.ac.uk>
 
        * lyx_gui.C (init): set the style of the menu popups to
index bd51584ec751c2446b4bfe17389e2df1e4733c60..20bd850f4525b6c4eec545a1d85bf6493b25f9a5 100644 (file)
@@ -2524,33 +2524,41 @@ void Buffer::makeLaTeXFile(string const & fname,
 // LaTeX all paragraphs from par to endpar, if endpar == 0 then to the end
 //
 void Buffer::latexParagraphs(ostream & ofs, Paragraph * par,
-                            Paragraph * endpar, TexRow & texrow) const
+                             Paragraph * endpar, TexRow & texrow) const
 {
        bool was_title = false;
        bool already_title = false;
 
        // if only_body
        while (par != endpar) {
-               LyXLayout const & layout =
-                       textclasslist.Style(params.textclass,
-                                           par->layout);
+               Inset * in = par->inInset();
+               // well we have to check if we are in an inset with unlimited
+               // lenght (all in one row) if that is true then we don't allow
+               // any special options in the paragraph and also we don't allow
+               // any environment other then "Standard" to be valid!
+               if ((in == 0) || !in->forceDefaultParagraphs(in)) {
+                       LyXLayout const & layout =
+                               textclasslist.Style(params.textclass, par->layout);
            
                if (layout.intitle) {
-                       if (already_title) {
-                               lyxerr <<"Error in latexParagraphs: You"
-                                       " should not mix title layouts"
-                                       " with normal ones." << endl;
-                       } else
-                               was_title = true;
+                               if (already_title) {
+                                       lyxerr <<"Error in latexParagraphs: You"
+                                               " should not mix title layouts"
+                                               " with normal ones." << endl;
+                               } else
+                                       was_title = true;
                } else if (was_title && !already_title) {
-                       ofs << "\\maketitle\n";
-                       texrow.newline();
-                       already_title = true;
-                       was_title = false;                  
-               }
-               
-               if (layout.isEnvironment()) {
-                       par = par->TeXEnvironment(this, params, ofs, texrow);
+                               ofs << "\\maketitle\n";
+                               texrow.newline();
+                               already_title = true;
+                               was_title = false;                  
+                       }
+                       
+                       if (layout.isEnvironment()) {
+                               par = par->TeXEnvironment(this, params, ofs, texrow);
+                       } else {
+                               par = par->TeXOnePar(this, params, ofs, texrow, false);
+                       }
                } else {
                        par = par->TeXOnePar(this, params, ofs, texrow, false);
                }
index cd8c55d7cf966d19e11e8ffe17d2e231613517de..4110e4e768a5809ae7c38942a77afb59b5851582 100644 (file)
@@ -161,7 +161,7 @@ public:
            \param \a endpar if == 0 then to the end
        */
        void latexParagraphs(std::ostream & os, Paragraph * par,
-                            Paragraph * endpar, TexRow & texrow) const;
+                            Paragraph * endpar, TexRow & texrow) const;
        ///
        void simpleDocBookOnePar(std::ostream &,
                                 Paragraph * par, int & desc_on,
index 1c0c8b36a11c3eba788fb71bdf34b4515be586ca..db17dd44dd89a2273124b58ce0eb3be792cd14e2 100644 (file)
@@ -1,3 +1,9 @@
+2002-01-08  Juergen Vigna  <jug@sad.it>
+
+       * inset.h: added isChar() function and implemented this for
+       insetspecialchar insetquotes and insetlatexaccent.
+       added forceDefaultParagraphs() and implemented it for insettabular.
+
 2002-01-07  Juergen Vigna  <jug@sad.it>
 
        * insettext.C (getLyXText): Fixed this function. An insert into the
index bda005592db4fd2ad4b0c62b0d28b587b1d13539..9673978b3d866601ea4a6cef5cf079f8b803fc08 100644 (file)
@@ -145,6 +145,15 @@ void Inset::id(int id_arg)
 void Inset::setFont(BufferView *, LyXFont const &, bool, bool )
 {}
 
+
+bool Inset::forceDefaultParagraphs(Inset const * in) const
+{
+       if (owner())
+               return owner()->forceDefaultParagraphs(in);
+       return false;
+}
+
+
 // some stuff for inset locking
 
 UpdatableInset::UpdatableInset()
index bc0ed0aae84700c8bc4c9ac1de0fb4b6747f2201..77f58f7b32485a73a7c41107688073a0b9296ece 100644 (file)
@@ -305,10 +305,15 @@ public:
        ///
        virtual bool allowSpellcheck() { return false; }
 
+       // should this inset be handled like a normal charater
+       virtual bool isChar() const { return false; }
        // is this equivalent to a letter?
        virtual bool isLetter() const { return false; }
        // is this equivalent to a space?
        virtual bool isSpace() const { return false; }
+       // if this inset has paragraphs should they be outputed all as default
+       // paragraps with "Standard" layout?
+       virtual bool forceDefaultParagraphs(Inset const *) const;
 
 protected:
        ///
index b1fefd557008b56e70c3b4459765dd665a7114dc..4d4713b39acbb944d24f1bcb46086dc9316495da 100644 (file)
@@ -72,6 +72,9 @@ public:
        Inset::Code lyxCode()const;
        ///
        inline bool canDisplay();
+       // should this inset be handled like a normal charater
+       bool isChar() const { return true; }
+       
        /// all the accent types
        enum ACCENT_TYPES{
                ///
index d6f117f6bb0178b19722a75ca1737239b0790063..60592c8f86ff2e564df9dcfbb0ca948cf685b4f8 100644 (file)
@@ -103,6 +103,9 @@ public:
        virtual Inset * clone(Buffer const &, bool same_id = false) const;
        ///
        Inset::Code lyxCode() const;
+       // should this inset be handled like a normal charater
+       bool isChar() const { return true; }
+       
 private:
        ///
        quote_language language_;
index 5de4d19e84d49899b586f4d5404a6485692eadbe..ae2704cb308edf21c7a76511367bf7303dc0570c 100644 (file)
@@ -324,6 +324,12 @@ void InsetSpecialChar::validate(LaTeXFeatures & features) const
 }
 
 
+bool InsetSpecialChar::isChar() const
+{
+       return true;
+}
+
+
 bool InsetSpecialChar::isLetter() const
 {
        return kind_ == HYPHENATION || kind_ == LIGATURE_BREAK;
index 5acb4e22acfcdc20327610028cb870937bfae6bf..721dfaebf1f0236f927edde4596137e240b94f59 100644 (file)
@@ -82,6 +82,9 @@ public:
        };
        ///
        void validate(LaTeXFeatures &) const;
+       
+       // should this inset be handled like a normal charater
+       bool isChar() const;
        /// is this equivalent to a letter?
        bool isLetter() const;
        /// is this equivalent to a space?
index 37c8139131c33197c6fdc10fd9df826b604a01cd..2b8125df35b60efea724ddc4caf86afd05719c42 100644 (file)
@@ -2778,3 +2778,37 @@ bool InsetTabular::insetAllowed(Inset::Code code) const
                return the_locking_inset->insetAllowed(code);
        return false;
 }
+
+
+bool InsetTabular::forceDefaultParagraphs(Inset const * in) const
+{
+       int const n = tabular->GetNumberOfCells();
+       static int last = 0;
+
+       // maybe some speedup
+       if ((last < n) && tabular->GetCellInset(last) == in) {
+               if (tabular->GetPWidth(last+1).zero())
+                       return true;
+               return false;
+       }
+       if ((++last < n) && tabular->GetCellInset(last) == in) {
+               if (tabular->GetPWidth(last).zero())
+                       return true;
+               return false;
+       }
+
+       for(int i=0; i < n; ++i) {
+               if (tabular->GetCellInset(i) == in) {
+                       last = i;
+                       if (tabular->GetPWidth(i).zero())
+                               return true;
+                       return false;
+               }
+       }
+       last = 0;
+       // well we didn't obviously find it so maybe our owner knows more
+       if (owner())
+               return owner()->forceDefaultParagraphs(in);
+       // if we're here there is really something strange going on!!!
+       return false;
+}
index e495a272d9a4c399966cae23cef45e5ba6666832..d054ae0d2ca4e06cab4d91c880ccd04f0dc142c0 100644 (file)
@@ -222,6 +222,10 @@ public:
        bool searchBackward(BufferView *, string const &,
                            bool const & = true, bool const & = false);
 
+       // this should return true if we have a "normal" cell, otherwise true.
+       // "normal" means without width set!
+       bool forceDefaultParagraphs(Inset const * in) const;
+       
        //
        // Public structures and variables
        ///
index f3d909649e8f03c35b834bf8cb517e8d661d5545..2e3a09feb90743f57049f9464cc9308d89bdad66 100644 (file)
@@ -1221,51 +1221,59 @@ int Paragraph::getPositionOfInset(Inset const * inset) const
 
 
 Paragraph * Paragraph::TeXOnePar(Buffer const * buf,
-                                      BufferParams const & bparams,
-                                      ostream & os, TexRow & texrow,
-                                      bool moving_arg)
+                                 BufferParams const & bparams,
+                                 ostream & os, TexRow & texrow,
+                                 bool moving_arg)
 {
        lyxerr[Debug::LATEX] << "TeXOnePar...     " << this << endl;
-       LyXLayout const & style =
-               textclasslist.Style(bparams.textclass,
-                                   layout);
-
+       Inset const * in = inInset();
        bool further_blank_line = false;
+       LyXLayout style;
+       
+       // well we have to check if we are in an inset with unlimited
+       // lenght (all in one row) if that is true then we don't allow
+       // any special options in the paragraph and also we don't allow
+       // any environment other then "Standard" to be valid!
+       if ((in == 0) || !in->forceDefaultParagraphs(in)) {
+               style = textclasslist.Style(bparams.textclass, layout);
+
+               if (params().startOfAppendix()) {
+                       os << "\\appendix\n";
+                       texrow.newline();
+               }
 
-       if (params().startOfAppendix()) {
-               os << "\\appendix\n";
-               texrow.newline();
-       }
-
-       if (!params().spacing().isDefault()
-           && (!previous() || !previous()->hasSameLayout(this))) {
-               os << params().spacing().writeEnvirBegin() << "\n";
-               texrow.newline();
-       }
+               if (!params().spacing().isDefault()
+                       && (!previous() || !previous()->hasSameLayout(this))) {
+                       os << params().spacing().writeEnvirBegin() << "\n";
+                       texrow.newline();
+               }
        
-       if (tex_code_break_column && style.isCommand()){
-               os << '\n';
-               texrow.newline();
-       }
+               if (tex_code_break_column && style.isCommand()){
+                       os << '\n';
+                       texrow.newline();
+               }
 
-       if (params().pagebreakTop()) {
-               os << "\\newpage";
-               further_blank_line = true;
-       }
-       if (params().spaceTop().kind() != VSpace::NONE) {
-               os << params().spaceTop().asLatexCommand(bparams);
-               further_blank_line = true;
-       }
+               if (params().pagebreakTop()) {
+                       os << "\\newpage";
+                       further_blank_line = true;
+               }
+               if (params().spaceTop().kind() != VSpace::NONE) {
+                       os << params().spaceTop().asLatexCommand(bparams);
+                       further_blank_line = true;
+               }
 
-       if (params().lineTop()) {
-               os << "\\lyxline{\\" << getFont(bparams, 0).latexSize() << '}'
-                  << "\\vspace{-1\\parskip}";
-               further_blank_line = true;
-       }
+               if (params().lineTop()) {
+                       os << "\\lyxline{\\" << getFont(bparams, 0).latexSize() << '}'
+                          << "\\vspace{-1\\parskip}";
+                       further_blank_line = true;
+               }
 
-       if (further_blank_line){
-               os << '\n';
-               texrow.newline();
+               if (further_blank_line){
+                       os << '\n';
+                       texrow.newline();
+               }
+       } else {
+               style = textclasslist.Style(bparams.textclass, 0);
        }
 
        Language const * language = getParLanguage(bparams);
@@ -1275,22 +1283,24 @@ Paragraph * Paragraph::TeXOnePar(Buffer const * buf,
 
        if (language->babel() != previous_language->babel()
            // check if we already put language command in TeXEnvironment()
-           && !(textclasslist.Style(bparams.textclass, layout).isEnvironment()
-                && (!previous() || previous()->layout != layout ||
-                    previous()->params().depth() != params().depth()))) {
-
+           && !(style.isEnvironment()
+                && (!previous() || previous()->layout != layout ||
+                        previous()->params().depth() != params().depth())))
+       {
                if (!lyxrc.language_command_end.empty() &&
-                   previous_language->babel() != doc_language->babel()) {
+                   previous_language->babel() != doc_language->babel())
+               {
                        os << subst(lyxrc.language_command_end, "$$lang",
-                                   previous_language->babel())
+                                   previous_language->babel())
                           << endl;
                        texrow.newline();
                }
 
                if (lyxrc.language_command_end.empty() ||
-                   language->babel() != doc_language->babel()) {
+                   language->babel() != doc_language->babel())
+               {
                        os << subst(lyxrc.language_command_begin, "$$lang",
-                                   language->babel())
+                                   language->babel())
                           << endl;
                        texrow.newline();
                }
@@ -1336,11 +1346,10 @@ Paragraph * Paragraph::TeXOnePar(Buffer const * buf,
        // or for a command.
        LyXFont const font =
                (size() == 0
-                ? getLayoutFont(bparams)
-                : getFont(bparams, size() - 1));
+                ? getLayoutFont(bparams) : getFont(bparams, size() - 1));
 
-       bool is_command = textclasslist.Style(bparams.textclass,
-                                             getLayout()).isCommand();
+       bool is_command = style.isCommand();
+       
        if (style.resfont.size() != font.size() && next_ && !is_command) {
                if (!need_par)
                        os << "{";
@@ -1374,31 +1383,33 @@ Paragraph * Paragraph::TeXOnePar(Buffer const * buf,
                }
        }
        
-       further_blank_line = false;
-       if (params().lineBottom()) {
-               os << "\\lyxline{\\" << font.latexSize() << '}';
-               further_blank_line = true;
-       }
+       if ((in == 0) || !in->forceDefaultParagraphs(in)) {
+               further_blank_line = false;
+               if (params().lineBottom()) {
+                       os << "\\lyxline{\\" << font.latexSize() << '}';
+                       further_blank_line = true;
+               }
 
-       if (params().spaceBottom().kind() != VSpace::NONE) {
-               os << params().spaceBottom().asLatexCommand(bparams);
-               further_blank_line = true;
-       }
+               if (params().spaceBottom().kind() != VSpace::NONE) {
+                       os << params().spaceBottom().asLatexCommand(bparams);
+                       further_blank_line = true;
+               }
 
-       if (params().pagebreakBottom()) {
-               os << "\\newpage";
-               further_blank_line = true;
-       }
+               if (params().pagebreakBottom()) {
+                       os << "\\newpage";
+                       further_blank_line = true;
+               }
 
-       if (further_blank_line){
-               os << '\n';
-               texrow.newline();
-       }
+               if (further_blank_line){
+                       os << '\n';
+                       texrow.newline();
+               }
 
-       if (!params().spacing().isDefault()
-           && (!next_ || !next_->hasSameLayout(this))) {
-               os << params().spacing().writeEnvirEnd() << "\n";
-               texrow.newline();
+               if (!params().spacing().isDefault()
+                       && (!next_ || !next_->hasSameLayout(this))) {
+                       os << params().spacing().writeEnvirEnd() << "\n";
+                       texrow.newline();
+               }
        }
        
        // we don't need it for the last paragraph!!!
@@ -1432,17 +1443,29 @@ Paragraph * Paragraph::TeXOnePar(Buffer const * buf,
 
 // This one spits out the text of the paragraph
 bool Paragraph::simpleTeXOnePar(Buffer const * buf,
-                                  BufferParams const & bparams,
-                                  ostream & os, TexRow & texrow,
-                                  bool moving_arg)
+                                BufferParams const & bparams,
+                                ostream & os, TexRow & texrow,
+                                bool moving_arg)
 {
        lyxerr[Debug::LATEX] << "SimpleTeXOnePar...     " << this << endl;
 
        bool return_value = false;
 
-       LyXLayout const & style =
-               textclasslist.Style(bparams.textclass,
-                                   getLayout());
+       LyXLayout style;
+       
+       // well we have to check if we are in an inset with unlimited
+       // lenght (all in one row) if that is true then we don't allow
+       // any special options in the paragraph and also we don't allow
+       // any environment other then "Standard" to be valid!
+       bool asdefault =
+               (inInset() && inInset()->forceDefaultParagraphs(inInset()));
+
+       if (asdefault) {
+               style = textclasslist.Style(bparams.textclass, 0);
+       } else {
+               style = textclasslist.Style(bparams.textclass, layout);
+       }
+       
        LyXFont basefont;
 
        // Maybe we have to create a optional argument.
@@ -1497,39 +1520,42 @@ bool Paragraph::simpleTeXOnePar(Buffer const * buf,
                                ++column;
                        }
 
-                       if (params().noindent()) {
-                               os << "\\noindent ";
-                               column += 10;
-                       }
-                       switch (params().align()) {
-                       case LYX_ALIGN_NONE:
-                       case LYX_ALIGN_BLOCK:
-                       case LYX_ALIGN_LAYOUT:
-                       case LYX_ALIGN_SPECIAL:
-                               break;
-                       case LYX_ALIGN_LEFT:
-                               if (getParLanguage(bparams)->babel() != "hebrew") {
-                                       os << "\\begin{flushleft}";
-                                       column += 17;
-                               } else {
-                                       os << "\\begin{flushright}";
-                                       column += 18;
+                       if (!asdefault) {
+                               if (params().noindent()) {
+                                       os << "\\noindent ";
+                                       column += 10;
                                }
-                               break;
-                       case LYX_ALIGN_RIGHT:
-                               if (getParLanguage(bparams)->babel() != "hebrew") {
-                                       os << "\\begin{flushright}";
-                                       column += 18;
-                               } else {
-                                       os << "\\begin{flushleft}";
-                                       column += 17;
+                       
+                               switch (params().align()) {
+                               case LYX_ALIGN_NONE:
+                               case LYX_ALIGN_BLOCK:
+                               case LYX_ALIGN_LAYOUT:
+                               case LYX_ALIGN_SPECIAL:
+                                       break;
+                               case LYX_ALIGN_LEFT:
+                                       if (getParLanguage(bparams)->babel() != "hebrew") {
+                                               os << "\\begin{flushleft}";
+                                               column += 17;
+                                       } else {
+                                               os << "\\begin{flushright}";
+                                               column += 18;
+                                       }
+                                       break;
+                               case LYX_ALIGN_RIGHT:
+                                       if (getParLanguage(bparams)->babel() != "hebrew") {
+                                               os << "\\begin{flushright}";
+                                               column += 18;
+                                       } else {
+                                               os << "\\begin{flushleft}";
+                                               column += 17;
+                                       }
+                                       break;
+                               case LYX_ALIGN_CENTER:
+                                       os << "\\begin{center}";
+                                       column += 14;
+                                       break;
                                }
-                               break;
-                       case LYX_ALIGN_CENTER:
-                               os << "\\begin{center}";
-                               column += 14;
-                               break;
-                       }        
+                       }
                }
 
                value_type c = getChar(i);
@@ -1636,35 +1662,37 @@ bool Paragraph::simpleTeXOnePar(Buffer const * buf,
                return_value = false;
        }
 
-       switch (params().align()) {
-       case LYX_ALIGN_NONE:
-       case LYX_ALIGN_BLOCK:
-       case LYX_ALIGN_LAYOUT:
-       case LYX_ALIGN_SPECIAL:
-               break;
-       case LYX_ALIGN_LEFT:
-               if (getParLanguage(bparams)->babel() != "hebrew") {
-                       os << "\\end{flushleft}";
-                       column+= 15;
-               } else {
-                       os << "\\end{flushright}";
-                       column+= 16;
-               }
-               break;
-       case LYX_ALIGN_RIGHT:
-               if (getParLanguage(bparams)->babel() != "hebrew") {
-                       os << "\\end{flushright}";
-                       column+= 16;
-               } else {
-                       os << "\\end{flushleft}";
-                       column+= 15;
+       if (!asdefault) {
+               switch (params().align()) {
+               case LYX_ALIGN_NONE:
+               case LYX_ALIGN_BLOCK:
+               case LYX_ALIGN_LAYOUT:
+               case LYX_ALIGN_SPECIAL:
+                       break;
+               case LYX_ALIGN_LEFT:
+                       if (getParLanguage(bparams)->babel() != "hebrew") {
+                               os << "\\end{flushleft}";
+                               column+= 15;
+                       } else {
+                               os << "\\end{flushright}";
+                               column+= 16;
+                       }
+                       break;
+               case LYX_ALIGN_RIGHT:
+                       if (getParLanguage(bparams)->babel() != "hebrew") {
+                               os << "\\end{flushright}";
+                               column+= 16;
+                       } else {
+                               os << "\\end{flushleft}";
+                               column+= 15;
+                       }
+                       break;
+               case LYX_ALIGN_CENTER:
+                       os << "\\end{center}";
+                       column+= 12;
+                       break;
                }
-               break;
-       case LYX_ALIGN_CENTER:
-               os << "\\end{center}";
-               column+= 12;
-               break;
-       }        
+       }
 
        lyxerr[Debug::LATEX] << "SimpleTeXOnePar...done " << this << endl;
        return return_value;
index fa077d035a7cfbb67584daa87e2e815d3edf8582..5a48efcc3808db3aaf48c74e12c8003fcad59802 100644 (file)
@@ -47,6 +47,13 @@ bool IsLineSeparatorChar(char c) {
 }
 
 
+///
+inline
+bool IsLineSeparatorChar(char c, Inset * in) {
+       return ((c == ' ') || (in && in->isSpace()));
+}
+
+
 ///
 inline
 bool IsKommaChar(char c) {
index 543971669a02ca1da4f87921a22fa0071b9fae8a..f86bdf8650dc2aaea0892051fb9fc214cd216e9c 100644 (file)
@@ -955,26 +955,25 @@ LyXText::nextBreakPoint(BufferView * bview, Row const * row, int width) const
                while (doitonetime || ((x < width) && (i < last))) {
                        doitonetime = false;
                        char const c = par->getChar(i);
+                       Inset * in = 0;
+                       if (c == Paragraph::META_INSET)
+                               in = par->getInset(i);
                        if (IsNewlineChar(c)) {
                                last_separator = i;
                                x = width; // this means break
-                       } else if (c == Paragraph::META_INSET &&
-                                  par->getInset(i)) {
-                               
+                       } else if (in && !in->isChar()) {
                                // check wether a Display() inset is
                                // valid here. if not, change it to
                                // non-display
-                               if (par->getInset(i)->display() &&
+                               if (in->display() &&
                                    (layout.isCommand() ||
                                     (layout.labeltype == LABEL_MANUAL
                                      && i < beginningOfMainBody(bview->buffer(), par))))
                                {
                                        // display istn't allowd
-                                       par->getInset(i)->display(false);
+                                       in->display(false);
                                        x += singleWidth(bview, par, i, c);
-                               } else if (par->getInset(i)->display() ||
-                                          par->getInset(i)->needFullRow())
-                               {
+                               } else if (in->display() || in->needFullRow()) {
                                        // So break the line here
                                        if (i == pos) {
                                                if (pos < last-1) {
@@ -1000,7 +999,7 @@ LyXText::nextBreakPoint(BufferView * bview, Row const * row, int width) const
                                                last_separator = i - 1;
                                }
                        } else  {
-                               if (IsLineSeparatorChar(c))
+                               if (IsLineSeparatorChar(c, in))
                                        last_separator = i;
                                x += singleWidth(bview, par, i, c);
                        }