commit 5832db46691882a4589e360a215b4f789f7fe766
Author: Juergen Spitzmueller <[email protected]>
Date: Sun Mar 2 05:08:26 2025 +0100
Do not warn on not found Note/Box painter colors for new documents
These colors are only registered when the respective param is parsed
---
src/BufferParams.cpp | 1 +
src/insets/InsetBox.cpp | 4 +++-
src/insets/InsetNote.cpp | 3 ++-
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index 3d71dde5f6..a871c8c57d 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -1152,6 +1152,7 @@ string BufferParams::readToken(Lexer & lex, string const
& token,
lex.eatLine();
boxbgcolor = lex.getString();
registerLyXColor("boxbgcolor", boxbgcolor);
+ // set a local name for the painter
lcolor.setColor("boxbgcolor@" + filename.absFileName(),
lcolor.getX11HexName(boxbgcolor));
} else if (token == "\\table_border_color") {
diff --git a/src/insets/InsetBox.cpp b/src/insets/InsetBox.cpp
index c2f90eaaa0..f2bdda9f15 100644
--- a/src/insets/InsetBox.cpp
+++ b/src/insets/InsetBox.cpp
@@ -219,7 +219,9 @@ ColorCode InsetBox::backgroundColor(PainterInfo const &)
const
return getLayout().bgcolor();
if (params_.type == "Shaded") {
- ColorCode c = lcolor.getFromLyXName("boxbgcolor@" +
buffer().fileName().absFileName());
+ // This is the local color (not overridden by other documents)
+ // the color might not yet be initialized for new documents
+ ColorCode c = lcolor.getFromLyXName("boxbgcolor@" +
buffer().fileName().absFileName(), false);
if (c == Color_none)
return getLayout().bgcolor();
return c;
diff --git a/src/insets/InsetNote.cpp b/src/insets/InsetNote.cpp
index ba827f2311..5602c764ec 100644
--- a/src/insets/InsetNote.cpp
+++ b/src/insets/InsetNote.cpp
@@ -374,7 +374,8 @@ FontInfo InsetNote::getFont() const
if (c != Color_none)
font.setColor(c);
// This is the local color (not overridden by other documents)
- ColorCode lc = lcolor.getFromLyXName("notefontcolor@" +
buffer().fileName().absFileName());
+ // the color might not yet be initialized for new documents
+ ColorCode lc = lcolor.getFromLyXName("notefontcolor@" +
buffer().fileName().absFileName(), false);
if (lc != Color_none)
font.setPaintColor(lc);
}
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs