The following commit introduced (long ago) code that I do not understand. Enrico, can you tell me what the intent is? This is flagged by Coverity Scan, but I am not sure yet of what it means.

From what I understand, ModeSpecifier sets a mode on creation and restores it on deletion. What is the point of using it like that?

JMarc

commit e224ef029b58de61fead592a6134775dbd9a97b8
Author: Enrico Forestieri <[email protected]>
Date:   Tue Jun 17 11:10:43 2008 +0000

    Implement the suggestion by Andre'
[...]

@@ -983,11 +981,8 @@ void InsetMathGrid::write(WriteStream & os) const
                        }
                for (col_type col = 0; col < lastcol; ++col) {
                        os << cell(index(row, col));
-                       if (os.pendingBrace()) {
-                               os.pendingBrace(false);
-                               os.textMode(true);
-                               os << '}';
-                       }
+                       if (os.pendingBrace())
+                               ModeSpecifier specifier(os, TEXT_MODE);
                        os << eocString(col, lastcol);
                }
                eol = eolString(row, emptyline, os.fragile());






--
lyx-devel mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to