]> git.lyx.org Git - features.git/blobdiff - src/Changes.cpp
* FORMAT
[features.git] / src / Changes.cpp
index 64fb3c4d2ee1cffe591a151efbdfeca36f95e18e..33209afbbb58b22c4e13d3fdd30c9d9eff9c4475 100644 (file)
@@ -17,8 +17,8 @@
 #include "Author.h"
 #include "Buffer.h"
 #include "BufferParams.h"
+#include "Color.h"
 #include "Encoding.h"
-#include "LaTeXFeatures.h"
 #include "LyXRC.h"
 #include "MetricsInfo.h"
 #include "OutputParams.h"
@@ -429,18 +429,14 @@ int Changes::latexMarkChange(otexstream & os, BufferParams const & bparams,
 
        int column = 0;
 
-       bool const dvipost = LaTeXFeatures::isAvailable("dvipost") &&
-                       (runparams.flavor == OutputParams::LATEX
-                        || runparams.flavor == OutputParams::DVILUATEX);
-
        if (oldChange.type != Change::UNCHANGED) {
-               if (oldChange.type != Change::DELETED || runparams.ctObject != OutputParams::CT_OMITOBJECT) {
+               if (oldChange.type != Change::DELETED || runparams.ctObject != CtObject::OmitObject) {
                        // close \lyxadded or \lyxdeleted
                        os << '}';
                        column++;
                }
                if (oldChange.type == Change::DELETED
-                   && !runparams.wasDisplayMath && !dvipost)
+                   && !runparams.wasDisplayMath)
                        --runparams.inulemcmd;
        }
 
@@ -451,17 +447,17 @@ int Changes::latexMarkChange(otexstream & os, BufferParams const & bparams,
 
        docstring macro_beg;
        if (change.type == Change::DELETED) {
-               if (runparams.ctObject == OutputParams::CT_OMITOBJECT)
+               if (runparams.ctObject == CtObject::OmitObject)
                        return 0;
-               else if (runparams.ctObject == OutputParams::CT_OBJECT)
+               else if (runparams.ctObject == CtObject::Object)
                        macro_beg = from_ascii("\\lyxobjdeleted");
-               else if (runparams.ctObject == OutputParams::CT_DISPLAYOBJECT)
+               else if (runparams.ctObject == CtObject::DisplayObject)
                        macro_beg = from_ascii("\\lyxdisplayobjdeleted");
-               else if (runparams.ctObject == OutputParams::CT_UDISPLAYOBJECT)
+               else if (runparams.ctObject == CtObject::UDisplayObject)
                        macro_beg = from_ascii("\\lyxudisplayobjdeleted");
                else {
                        macro_beg = from_ascii("\\lyxdeleted");
-                       if (!runparams.inDisplayMath && !dvipost)
+                       if (!runparams.inDisplayMath)
                                ++runparams.inulemcmd;
                }
        }
@@ -507,7 +503,7 @@ void Changes::lyxMarkChange(ostream & os, BufferParams const & bparams, int & co
 }
 
 
-void Changes::checkAuthors(AuthorList const & authorList)
+void Changes::checkAuthors(AuthorList const & authorList) const
 {
        for (ChangeRange const & cr : table_)
                if (cr.change.type != Change::UNCHANGED)
@@ -561,14 +557,6 @@ void Changes::addToToc(DocIterator const & cdit, Buffer const & buffer,
 }
 
 
-void Changes::updateBuffer(Buffer const & buf)
-{
-       bool const changed = isChanged();
-       buf.setChangesPresent(buf.areChangesPresent() || changed);
-       previously_changed_ = changed;
-}
-
-
 void Change::paintCue(PainterInfo & pi, double const x1, double const y,
                       double const x2, FontInfo const & font) const
 {
@@ -600,7 +588,7 @@ void Change::paintCue(PainterInfo & pi, double const x1, double const y1,
                return;
        case INSERTED: {
                if (!lyxrc.ct_additions_underlined)
-                       break;
+                       return;
                pi.pain.line(int(x1), int(y2) + 1, int(x2), int(y2) + 1,
                             color(), Painter::line_solid,
                             pi.base.solidLineThickness());