[LyX/master] Little bit more debug info for unset Buffer members.
Richard Kimberly Heck
rikiheck at lyx.org
Thu Apr 18 22:25:52 UTC 2024
commit 7c140f743d7ae4b75dfe77449c38c354f3a46336
Author: Richard Kimberly Heck <rikiheck at lyx.org>
Date: Thu Apr 18 16:03:14 2024 -0400
Little bit more debug info for unset Buffer members.
---
src/MetricsInfo.cpp | 4 +++-
src/mathed/MathRow.cpp | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/MetricsInfo.cpp b/src/MetricsInfo.cpp
index 844c1c13f3..3fa8973e01 100644
--- a/src/MetricsInfo.cpp
+++ b/src/MetricsInfo.cpp
@@ -193,9 +193,11 @@ ColorCode PainterInfo::backgroundColor(Inset const * inset, bool sel) const
// special handling for inset background
if (inset != nullptr) {
- if (pain.develMode() && !inset->isBufferValid())
+ if (pain.develMode() && !inset->isBufferValid()) {
+ LYXERR0("Invalid or no buffer set in " << insetName(inset->lyxCode()));
// This inset is in error
return Color_error;
+ }
ColorCode const color_bg = inset->backgroundColor(*this);
if (color_bg != Color_none)
diff --git a/src/mathed/MathRow.cpp b/src/mathed/MathRow.cpp
index 7b5ff9e1d0..b8d8f63d8e 100644
--- a/src/mathed/MathRow.cpp
+++ b/src/mathed/MathRow.cpp
@@ -337,9 +337,11 @@ void MathRow::draw(PainterInfo & pi, int x, int const y) const
// while it is drawing, because it relies on this value.
Geometry & g = coords.insets().geometry(e.inset);
g.dim.wid -= e.before + e.after;
- if (pi.pain.develMode() && !e.inset->isBufferValid())
+ if (pi.pain.develMode() && !e.inset->isBufferValid()) {
pi.pain.fillRectangle(x + e.before, y - g.dim.ascent(),
g.dim.width(), g.dim.height(), Color_error);
+ LYXERR0("Unset Buffer memeber in " << insetName(e.inset->lyxCode()));
+ }
e.inset->draw(pi, x + e.before, y);
g.pos = {x, y};
g.dim.wid += e.before + e.after;
More information about the lyx-cvs
mailing list