Author: forenr
Date: Thu Mar 10 05:05:49 2011
New Revision: 37894
URL: http://www.lyx.org/trac/changeset/37894

Log:
Make sure to associate each line of the exported latex code to the id/pos
of the first call of TexRow::start(), rather than the last before a newline.
This is what was causing some recent grief (bug #7325, for example).

Modified:
   lyx-devel/trunk/src/TexRow.cpp
   lyx-devel/trunk/src/TexRow.h

Modified: lyx-devel/trunk/src/TexRow.cpp
==============================================================================
--- lyx-devel/trunk/src/TexRow.cpp      Wed Mar  9 23:18:34 2011        (r37893)
+++ lyx-devel/trunk/src/TexRow.cpp      Thu Mar 10 05:05:49 2011        (r37894)
@@ -32,8 +32,12 @@
 
 void TexRow::start(int id, int pos)
 {
+       if (started)
+               return;
+
        lastid = id;
        lastpos = pos;
+       started = true;
 }
 
 
@@ -42,6 +46,7 @@
        int const id = lastid;
        RowList::value_type tmp(id, lastpos);
        rowlist.push_back(tmp);
+       started = false;
 }
 
 void TexRow::newlines(int num_lines)

Modified: lyx-devel/trunk/src/TexRow.h
==============================================================================
--- lyx-devel/trunk/src/TexRow.h        Wed Mar  9 23:18:34 2011        (r37893)
+++ lyx-devel/trunk/src/TexRow.h        Thu Mar 10 05:05:49 2011        (r37894)
@@ -26,7 +26,7 @@
 class TexRow {
 public:
        ///
-       TexRow() : lastid(-1), lastpos(-1) {}
+       TexRow() : lastid(-1), lastpos(-1), started(false) {}
 
        /// Clears structure
        void reset();
@@ -90,6 +90,8 @@
        int lastid;
        /// Last position
        int lastpos;
+       /// Is id/pos already registered for current row?
+       bool started;
 };
 
 

Reply via email to