]> git.lyx.org Git - lyx.git/blobdiff - src/TexRow.cpp
RefChanger
[lyx.git] / src / TexRow.cpp
index 4bec66e05af69a8c7cbfe1b1bfde51334324a2e6..8586a81c41d8fbaac884176d327a02cb8a951d77 100644 (file)
@@ -75,7 +75,7 @@ void TexRow::RowEntryList::append(RowEntryList const & row)
 
 
 TexRow::TextEntry const TexRow::text_none = { -1, 0 };
-TexRow::RowEntry const TexRow::row_none = { false, TexRow::text_none };
+TexRow::RowEntry const TexRow::row_none = { false, { TexRow::text_none } };
 
 
 bool TexRow::isNone(TextEntry const & t)
@@ -204,15 +204,12 @@ void TexRow::append(TexRow const & texrow)
 bool TexRow::getIdFromRow(int row, int & id, int & pos) const
 {
        TextEntry t = text_none;
-       bool ret = false;
        if (row <= int(rowlist_.size()))
                while (row > 0 && isNone(t = rowlist_[row - 1].getTextEntry()))
                        --row;
-       if (row > 0)
-               ret = true;
        id = t.id;
        pos = t.pos;
-       return ret;
+       return !isNone(t);
 }
 
 
@@ -478,7 +475,7 @@ docstring TexRow::asString(RowEntry const & entry)
 ///prepends the texrow to the source given by tex, for debugging purpose
 void TexRow::prepend(docstring_list & tex) const
 {
-       int const prefix_length = 25;
+       size_type const prefix_length = 25;
        if (tex.size() < rowlist_.size())
                tex.resize(rowlist_.size());
        std::vector<RowEntryList>::const_iterator it = rowlist_.begin();
@@ -492,7 +489,7 @@ void TexRow::prepend(docstring_list & tex) const
                        entry += asString(*it2);
                if (entry.length() < prefix_length)
                        entry = entry + docstring(prefix_length - entry.length(), L' ');
-               int i = it - beg;
+               ptrdiff_t i = it - beg;
                tex[i] = entry + "  " + tex[i];
        }
 }