[LyX/master] Markup changed captions in workarea by underline and strikeout, resp.

Juergen Spitzmueller spitz at lyx.org
Fri Mar 6 17:39:53 UTC 2020


commit 5e21a8fbf78babfb69d3e9f236cfe6aaffd1c465
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Fri Mar 6 18:58:25 2020 +0100

    Markup changed captions in workarea by underline and strikeout, resp.
---
 src/insets/InsetCaption.cpp |    7 ++++++-
 src/insets/InsetCaption.h   |    2 ++
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/insets/InsetCaption.cpp b/src/insets/InsetCaption.cpp
index 6b20876..3f1aebf 100644
--- a/src/insets/InsetCaption.cpp
+++ b/src/insets/InsetCaption.cpp
@@ -53,7 +53,7 @@ namespace lyx {
 
 InsetCaption::InsetCaption(Buffer * buf, string const & type)
     : InsetText(buf, InsetText::PlainLayout),
-      labelwidth_(0), is_subfloat_(false), type_(type)
+      labelwidth_(0), is_subfloat_(false), is_deleted_(false), type_(type)
 {
 	setDrawFrame(true);
 	setFrameColor(Color_collapsibleframe);
@@ -150,6 +150,10 @@ void InsetCaption::draw(PainterInfo & pi, int x, int y) const
 	FontInfo tmpfont = pi.base.font;
 	pi.base.font = pi.base.bv->buffer().params().getFont().fontInfo();
 	pi.base.font.setColor(pi.textColor(pi.base.font.color()).baseColor);
+	if (is_deleted_)
+		pi.base.font.setStrikeout(FONT_ON);
+	else if (isChanged())
+		pi.base.font.setUnderbar(FONT_ON);
 	int const xx = x + leftOffset(pi.base.bv);
 	pi.pain.text(xx, y, full_label_, pi.base.font);
 	InsetText::draw(pi, x + labelwidth_, y);
@@ -380,6 +384,7 @@ void InsetCaption::updateBuffer(ParIterator const & it, UpdateType utype, bool c
 		// counters are local to the caption
 		cnts.saveLastCounter();
 	}
+	is_deleted_ = deleted;
 	// Memorize type for addToToc().
 	floattype_ = type;
 	if (type.empty() || type == "senseless")
diff --git a/src/insets/InsetCaption.h b/src/insets/InsetCaption.h
index a1d1465..a651a71 100644
--- a/src/insets/InsetCaption.h
+++ b/src/insets/InsetCaption.h
@@ -98,6 +98,8 @@ private:
 	///
 	bool is_subfloat_;
 	///
+	bool is_deleted_;
+	///
 	std::string type_;
 };
 


More information about the lyx-cvs mailing list