From 100e323d041b55d5dbaa837c5f0dc099a12b9647 Mon Sep 17 00:00:00 2001 From: Martin Vermeer Date: Mon, 22 Sep 2003 07:46:27 +0000 Subject: [PATCH] Bug fix in branches (was earlier fixed wrongly) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7803 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 4 ++++ src/factory.C | 2 +- src/insets/ChangeLog | 4 ++++ src/insets/insetbranch.C | 6 +++--- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index d71458e592..2f04279eba 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2003-09-22 Martin Vermeer + + * factory.C: bug fix in branches + 2003-09-22 Lars Gullik Bjønnes * lyxfunc.C (processKeySym): adjust diff --git a/src/factory.C b/src/factory.C index 6870bb9af4..4eabc25c46 100644 --- a/src/factory.C +++ b/src/factory.C @@ -370,7 +370,7 @@ InsetOld * readInset(LyXLex & lex, Buffer const & buf) || tmptok == "Greyedout") { inset = new InsetNote(buf.params(), tmptok); } else if (tmptok == "Branch") { - inset = new InsetBranch(buf.params(), tmptok); + inset = new InsetBranch(buf.params(), string()); } else if (tmptok == "Include") { InsetCommandParams p("Include"); inset = new InsetInclude(p); diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 001394049b..9137244341 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,7 @@ +2003-09-22 Martin Vermeer + + * insetbranch.C: bug fix in branches + 2003-09-22 Martin Vermeer * insetnote.C: small clean-up. diff --git a/src/insets/insetbranch.C b/src/insets/insetbranch.C index af18dd23cd..1262a52fad 100644 --- a/src/insets/insetbranch.C +++ b/src/insets/insetbranch.C @@ -32,6 +32,7 @@ using std::ostringstream; void InsetBranch::init() { setInsetName("Branch"); + setButtonLabel(); } @@ -98,10 +99,9 @@ void InsetBranch::setButtonLabel() setLabel("Branch: " + params_.branch); font.setColor(LColor::foreground); - string const color = params_.branchlist.getColor(params_.branch); - if (!color.empty()) { + if (!params_.branch.empty()) setBackgroundColor(lcolor.getFromLyXName(params_.branch)); - } else + else setBackgroundColor(LColor::background); setLabelFont(font); }