]> git.lyx.org Git - lyx.git/blobdiff - src/Changes.cpp
Add "Plain" quotation mark style
[lyx.git] / src / Changes.cpp
index e9191e37d80210958a8fa909e4fe31f0460b85f0..90ad07501add91569ae11984c7b1e5361e91e59b 100644 (file)
@@ -22,6 +22,7 @@
 #include "MetricsInfo.h"
 #include "OutputParams.h"
 #include "Paragraph.h"
+#include "texstream.h"
 #include "TocBackend.h"
 
 #include "support/debug.h"
@@ -427,7 +428,7 @@ int Changes::latexMarkChange(otexstream & os, BufferParams const & bparams,
                // close \lyxadded or \lyxdeleted
                os << '}';
                column++;
-               if (oldChange.type == Change::DELETED)
+               if (oldChange.type == Change::DELETED && !runparams.wasDisplayMath)
                        --runparams.inulemcmd;
        }
 
@@ -439,7 +440,8 @@ int Changes::latexMarkChange(otexstream & os, BufferParams const & bparams,
        docstring macro_beg;
        if (change.type == Change::DELETED) {
                macro_beg = from_ascii("\\lyxdeleted{");
-               ++runparams.inulemcmd;
+               if (!runparams.inDisplayMath)
+                       ++runparams.inulemcmd;
        }
        else if (change.type == Change::INSERTED)
                macro_beg = from_ascii("\\lyxadded{");
@@ -448,6 +450,17 @@ int Changes::latexMarkChange(otexstream & os, BufferParams const & bparams,
                                       bparams.authors().get(change.author).name(),
                                       chgTime, runparams);
        
+       // signature needed by \lyxsout to correctly strike out display math
+       if (change.type == Change::DELETED && runparams.inDisplayMath
+           && (!LaTeXFeatures::isAvailable("dvipost")
+               || (runparams.flavor != OutputParams::LATEX
+                   && runparams.flavor != OutputParams::DVILUATEX))) {
+               if (os.afterParbreak())
+                       str += from_ascii("\\\\\\noindent\n");
+               else
+                       str += from_ascii("\\\\\\\\\n");
+       }
+
        os << str;
        column += str.size();
 
@@ -575,21 +588,22 @@ void Change::paintCue(PainterInfo & pi, double const x1, double const y1,
         * y2 /_____
         *    x1  x2
         */
-       double y = 0;
        switch(type) {
        case UNCHANGED:
                return;
        case INSERTED:
-               y = y2;
-               break;
+               pi.pain.line(int(x1), int(y2) + 1, int(x2), int(y2) + 1,
+                            color(), Painter::line_solid,
+                            pi.base.solidLineThickness());
+               return;
        case DELETED:
-               y = y1;
-               break;
+               // FIXME: we cannot use antialias since we keep drawing on the same
+               // background with the current painting mechanism.
+               pi.pain.line(int(x1), int(y2), int(x2), int(y1),
+                            color(), Painter::line_solid_aliased,
+                            pi.base.solidLineThickness());
+               return;
        }
-       // we cannot use antialias since we keep drawing on the same background
-       pi.pain.line(int(x1), int(y2), int(x2), int(y),
-                    color(), Painter::line_solid_aliased,
-                    pi.base.solidLineThickness());
 }