<< token << '\'');
string const result =
- params().readToken(lex, token, d->filename.onlyPath());
+ params().readToken(lex, token, d->filename);
if (!result.empty()) {
if (token == "\\textclass") {
d->layout_position = result;
string BufferParams::readToken(Lexer & lex, string const & token,
- FileName const & filepath)
+ FileName const & filename)
{
string result;
+ FileName const & filepath = filename.onlyPath();
if (token == "\\textclass") {
lex.next();
color = lcolor.getX11HexName(Color_background);
// FIXME UNICODE
if (!shortcut.empty())
- lcolor.setColor(to_utf8(shortcut), color);
+ lcolor.setColor(to_utf8(shortcut)+ "@" + filename.absFileName(), color);
}
}
} else if (token == "\\author") {
notefontcolor = lyx::rgbFromHexName(color);
lcolor.setColor("notefontcolor", color);
lcolor.setLaTeXName("notefontcolor", "note_fontcolor");
+ // set a local name for the painter
+ lcolor.setColor("notefontcolor@" + filename.absFileName(), color);
isnotefontcolor = true;
} else if (token == "\\boxbgcolor") {
lex.eatLine();
string color = lex.getString();
boxbgcolor = lyx::rgbFromHexName(color);
- lcolor.setColor("boxbgcolor", color);
+ lcolor.setColor("boxbgcolor@" + filename.absFileName(), color);
isboxbgcolor = true;
} else if (token == "\\paperwidth") {
lex >> paperwidth;
#include "Citation.h"
#include "ColorCode.h"
+#include "ColorSet.h"
#include "DocumentClassPtr.h"
#include "LayoutModuleList.h"
#include "paper.h"
/// read a header token, if unrecognised, return it or an unknown class name
std::string readToken(Lexer & lex,
std::string const & token, ///< token to read.
- support::FileName const & filepath);
+ support::FileName const & filename);
///
void writeFile(std::ostream &, Buffer const *) const;
#include "support/debug.h"
#include "support/docstream.h"
+#include "support/FileName.h"
#include "support/gettext.h"
#include "support/lstrings.h"
#include "support/Translator.h"
return getLayout().bgcolor();
if (params_.type == "Shaded") {
- if (buffer().params().isboxbgcolor)
+ if (!buffer().params().isboxbgcolor)
return getLayout().bgcolor();
- ColorCode c = lcolor.getFromLyXName("boxbgcolor");
+ ColorCode c = lcolor.getFromLyXName("boxbgcolor@" + buffer().fileName().absFileName());
if (c == Color_none)
return getLayout().bgcolor();
return c;
#include "support/debug.h"
#include "support/docstream.h"
+#include "support/FileName.h"
#include "support/gettext.h"
#include "support/lstrings.h"
if (params_.index.empty() || params_.index == from_ascii("idx"))
return InsetCollapsible::labelColor();
// FIXME UNICODE
- ColorCode c = lcolor.getFromLyXName(to_utf8(params_.index));
+ ColorCode c = lcolor.getFromLyXName(to_utf8(params_.index)
+ + "@" + buffer().fileName().absFileName());
if (c == Color_none)
c = InsetCollapsible::labelColor();
return c;
ColorCode c = lcolor.getFromLyXName("notefontcolor");
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());
+ if (lc != Color_none)
+ font.setPaintColor(lc);
}
return font;
}