]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetGraphicsParams.cpp
DocBook, InsetFloat: avoid a potential nullptr dereference when detecting the type...
[features.git] / src / insets / InsetGraphicsParams.cpp
index a8c2a26239994033f0036aac749edcb08e96a917..9f6ffbb901ecbca5e387869c83d887a247582622 100644 (file)
@@ -74,6 +74,7 @@ void InsetGraphicsParams::init()
 
        bbox = graphics::BoundingBox(); // bounding box
        clip = false;                   // clip image
+       darkModeSensitive = false;      // dark mode dependency
 
        rotateAngle = "0";              // angle of rotation in degrees
        rotateOrigin.erase();           // Origin of rotation
@@ -96,6 +97,7 @@ void InsetGraphicsParams::copy(InsetGraphicsParams const & params)
 
        bbox = params.bbox;
        clip = params.clip;
+       darkModeSensitive = params.darkModeSensitive;
 
        rotateAngle = params.rotateAngle;
        rotateOrigin = params.rotateOrigin;
@@ -119,6 +121,7 @@ bool operator==(InsetGraphicsParams const & left,
 
            left.bbox == right.bbox &&
            left.clip == right.clip &&
+           left.darkModeSensitive == right.darkModeSensitive &&
 
            left.rotateAngle == right.rotateAngle &&
            left.rotateOrigin == right.rotateOrigin &&
@@ -143,6 +146,8 @@ void InsetGraphicsParams::Write(ostream & os, Buffer const & buffer) const
                os << "\tlyxscale " << lyxscale << '\n';
        if (!display)
                os << "\tdisplay false\n";
+       if (darkModeSensitive)
+               os << "\tdarkModeSensitive\n";
        if (!scale.empty() && !float_equal(convert<double>(scale), 0.0, 0.05)) {
                if (!float_equal(convert<double>(scale), 100.0, 0.05))
                        os << "\tscale " << scale << '\n';
@@ -192,6 +197,8 @@ bool InsetGraphicsParams::Read(Lexer & lex, string const & token,
        } else if (token == "display") {
                lex.next();
                display = lex.getString() != "false";
+       } else if (token == "darkModeSensitive") {
+               darkModeSensitive = true;
        } else if (token == "scale") {
                lex.next();
                scale = lex.getString();