Am 21.06.2012 09:36, schrieb Vincent van Ravesteijn:

Please use the commit log to explain what the bug was, how it is solved, and 
why this is the correct
solution ?

What do you mean? We always only gave the bug number as reference. Just click on it and you can read why the change was made and what the bug was/is about.

+                for (size_t i = 0; i + 1<  ncells; ++i) {

Why do you prefer  "i + 1 < ncells" instead of " i < ncells - 1". I find the 
second option better,
so why do you want to change it ?

Both are identic and the provider of the patch used the first one, so I simply took his change. But OK I changed tis now.

                      ++col;
+                    if (col>= colinfo.size()) {
+                        cerr<<  "The cell '"
+                            <<  cells[cell]
+                            <<  "' specifies"
+                            <<  convert<string>(ncells)
+                            <<  " columns while the table has only"
+                            <<  convert<string>(colinfo.size())
+                            <<  " columns!"
+                            <<  " Therefore the surplus columns will be 
ignored."
+                            <<  endl;
+                        break;
+                    }

Is this information useful to be outputted ?

Sure.

In which cases can this happen ?

When you have a multicol that specifies more columns than the table, see the 
bug report.

We already check that
col can't be larger or equal to colinfo.size(). Fixing the bug and adding the 
error message are two
different issues.

It is always good to inform the user about problems. Here we tell him that his LaTeX code has a logic bug and tel him what he needs to fix.

Isn't the problem solved with the following much simpler fix ? :

-                for (size_t i = 0; i<  ncells - 1&&  col<  colinfo.size(); 
++i) {
-                     ++col;
+                for (size_t i = 0; i<  ncells - 1&&  col<  colinfo.size(); 
++i, ++col) {

Sure, but we then don't give feedback that the LaTeX code is wrong and that tex2lyx will cut off surplus columns. I prefer to give the user a feedback.

regards Uwe

Reply via email to