]> git.lyx.org Git - lyx.git/blobdiff - src/paragraph.C
Fix my breakage. Sorry guys.
[lyx.git] / src / paragraph.C
index b33ebcfdd983e593de32b00ae3ae330a1fe9d69f..5be1eaaa76da4c9c3269dc2c0e086c63bbea2a9c 100644 (file)
@@ -42,7 +42,7 @@
 
 #include "support/lstrings.h"
 #include "support/textutils.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include <boost/tuple/tuple.hpp>
 #include <boost/bind.hpp>
@@ -156,10 +156,6 @@ void Paragraph::write(Buffer const & buf, ostream & os,
 
        int column = 0;
        for (pos_type i = 0; i < size(); ++i) {
-               if (!i) {
-                       os << '\n';
-                       column = 0;
-               }
 
                Change change = pimpl_->lookupChangeFull(i);
                Changes::lyxMarkChange(os, column, curtime, running_change, change);
@@ -185,7 +181,9 @@ void Paragraph::write(Buffer const & buf, ostream & os,
                                        // the file
                                        inset->write(buf, os);
                                } else {
-                                       os << "\n\\begin_inset ";
+                                       if (i)
+                                               os << '\n';
+                                       os << "\\begin_inset ";
                                        inset->write(buf, os);
                                        os << "\n\\end_inset\n\n";
                                        column = 0;
@@ -1265,7 +1263,7 @@ void Paragraph::simpleLinuxDocOnePar(Buffer const & buf,
                        os << '<' << tag_name(*j) << '>';
                }
 
-               char c = getChar(i);
+               value_type c = getChar(i);
 
 
                if (c == Paragraph::META_INSET) {
@@ -1323,20 +1321,19 @@ bool Paragraph::emptyTag() const
                if (isInset(i)) {
                        InsetBase const * inset = getInset(i);
                        InsetBase::Code lyx_code = inset->lyxCode();
-                       if (lyx_code != InsetBase::TOC_CODE and
-                           lyx_code != InsetBase::INCLUDE_CODE and
-                           lyx_code != InsetBase::GRAPHICS_CODE and
-                           lyx_code != InsetBase::ERT_CODE and
-                           lyx_code != InsetBase::FLOAT_CODE and
+                       if (lyx_code != InsetBase::TOC_CODE &&
+                           lyx_code != InsetBase::INCLUDE_CODE &&
+                           lyx_code != InsetBase::GRAPHICS_CODE &&
+                           lyx_code != InsetBase::ERT_CODE &&
+                           lyx_code != InsetBase::FLOAT_CODE &&
                            lyx_code != InsetBase::TABULAR_CODE) {
                                return false;
                        }
                } else {
-                       char c = getChar(i);
-                       if(c!= ' ' and c!= '\t')
+                       value_type c = getChar(i);
+                       if (c != ' ' && c != '\t')
                                return false;
                }
-
        }
        return true;
 }
@@ -1367,7 +1364,7 @@ pos_type Paragraph::getFirstWord(Buffer const & buf, ostream & os, OutputParams
                        InsetBase const * inset = getInset(i);
                        inset->docbook(buf, os, runparams);
                } else {
-                       char c = getChar(i);
+                       value_type c = getChar(i);
                        if (c == ' ')
                                break;
                        bool ws;
@@ -1389,7 +1386,7 @@ bool Paragraph::onlyText(Buffer const & buf, LyXFont const & outerfont, pos_type
                LyXFont font = getFont(buf.params(), i, outerfont);
                if (isInset(i))
                        return false;
-               if ( i != initial and font != font_old)
+               if (i != initial && font != font_old)
                        return false;
                font_old = font;
        }
@@ -1410,8 +1407,9 @@ void Paragraph::simpleDocBookOnePar(Buffer const & buf,
        LyXFont font_old =
                style->labeltype == LABEL_MANUAL ? style->labelfont : style->font;
 
-       if (style->pass_thru and not onlyText(buf, outerfont, initial))
+       if (style->pass_thru && !onlyText(buf, outerfont, initial))
                os << "]]>";
+
        // parsing main loop
        for (pos_type i = initial; i < size(); ++i) {
                LyXFont font = getFont(buf.params(), i, outerfont);
@@ -1431,7 +1429,7 @@ void Paragraph::simpleDocBookOnePar(Buffer const & buf,
                        InsetBase const * inset = getInset(i);
                        inset->docbook(buf, os, runparams);
                } else {
-                       char c = getChar(i);
+                       value_type c = getChar(i);
                        bool ws;
                        string str;
                        boost::tie(ws, str) = sgml::escapeChar(c);
@@ -1450,7 +1448,7 @@ void Paragraph::simpleDocBookOnePar(Buffer const & buf,
 
        if (style->free_spacing)
                os << '\n';
-       if (style->pass_thru and not onlyText(buf, outerfont, initial))
+       if (style->pass_thru && !onlyText(buf, outerfont, initial))
                os << "<![CDATA[";
 }
 
@@ -1868,4 +1866,3 @@ void Paragraph::dump() const
 //void draw(PainterInfo & pi, int x, int y, LyXText & text) const
 //{
 //}
-