On Sat, Apr 12, 2025 at 11:25:43AM +0000, Scott Kostyshak wrote: > commit 7660d14875c9d8b8b83f134c5ac8ffbe12f846cc > Author: Scott Kostyshak <skost...@lyx.org> > Date: Sat Apr 12 13:20:18 2025 +0200 > > Comments > --- > src/insets/InsetBibtex.cpp | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/src/insets/InsetBibtex.cpp b/src/insets/InsetBibtex.cpp > index a6482d9315..e96f9d4d9d 100644 > --- a/src/insets/InsetBibtex.cpp > +++ b/src/insets/InsetBibtex.cpp > @@ -178,6 +178,7 @@ docstring InsetBibtex::screenLabel() const > { > docstring res; > if (getParam("bibfiles").empty()) > + // additionally, in updateBuffer(), we setBroken() in this case. > res = _("EMPTY: "); > res += usingBiblatex() ? _("Biblatex Generated Bibliography") > : _("BibTeX Generated Bibliography"); > @@ -939,6 +940,7 @@ void InsetBibtex::updateBuffer(ParIterator const &, > UpdateType, bool const /*del > if (invalidate) > buffer().invalidateBibinfoCache(); > > + // additionally, in screenLabel(), we prepend string "EMPTY". > setBroken(getParam("bibfiles").empty()); > }
Can I move the setBroken() to inside screenLabel(), as in the attached patch? When looking at this code (for a different purpose), I was confused that "EMPTY" is prepended in one part, and the inset is colored red in a different part. On the other hand, I do not know if it is an abuse of screenLabel(), which perhaps should be reserved strictly for setting the text of the label. Scott
From 7064e937d0ad6753332ce9d6b8862f9a645b3918 Mon Sep 17 00:00:00 2001 From: Scott Kostyshak <skost...@lyx.org> Date: Sat, 12 Apr 2025 13:26:01 +0200 Subject: [PATCH] InsetBibtex: centralize marking of error if empty Instead of prepending "EMPTY" in one member, and marking as broken (which colors the inset red) in another, now both actions are done in screenLabel(). No change in functionality intended. --- src/insets/InsetBibtex.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/insets/InsetBibtex.cpp b/src/insets/InsetBibtex.cpp index e96f9d4d9d..ccffa55940 100644 --- a/src/insets/InsetBibtex.cpp +++ b/src/insets/InsetBibtex.cpp @@ -177,9 +177,10 @@ bool InsetBibtex::usingBiblatex() const docstring InsetBibtex::screenLabel() const { docstring res; - if (getParam("bibfiles").empty()) - // additionally, in updateBuffer(), we setBroken() in this case. + if (getParam("bibfiles").empty()) { res = _("EMPTY: "); + setBroken(true); + } res += usingBiblatex() ? _("Biblatex Generated Bibliography") : _("BibTeX Generated Bibliography"); return res; @@ -939,9 +940,6 @@ void InsetBibtex::updateBuffer(ParIterator const &, UpdateType, bool const /*del } if (invalidate) buffer().invalidateBibinfoCache(); - - // additionally, in screenLabel(), we prepend string "EMPTY". - setBroken(getParam("bibfiles").empty()); } -- 2.43.0
signature.asc
Description: PGP signature
-- lyx-devel mailing list lyx-devel@lists.lyx.org https://lists.lyx.org/mailman/listinfo/lyx-devel