]> git.lyx.org Git - features.git/commitdiff
Handle branches with space in their name
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 7 Sep 2018 13:49:21 +0000 (15:49 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sat, 8 Sep 2018 11:07:07 +0000 (13:07 +0200)
1/ Handle space in color name in set-color (with quoting)

2/ read properly branch inset when name has a space

Fixes bug #11108.

src/frontends/qt4/GuiApplication.cpp
src/insets/InsetBranch.cpp

index d4b1701758ae248bae8345d66164d0d7d1250441..cbea58ad1c239f96cf7daf413237e8b5695c0bd8 100644 (file)
@@ -1738,8 +1738,8 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
        }
 
        case LFUN_SET_COLOR: {
-               string lyx_name;
-               string const x11_name = split(to_utf8(cmd.argument()), lyx_name, ' ');
+               string const lyx_name = cmd.getArg(0);
+               string const x11_name = cmd.getArg(1);
                if (lyx_name.empty() || x11_name.empty()) {
                        if (current_view_)
                                current_view_->message(
index a2148201fe5b03bc01d423bd9943719dc156d4c1..d30e348da571f9ecc60a1e6163ad878cf93bc81b 100644 (file)
@@ -402,7 +402,10 @@ void InsetBranchParams::write(ostream & os) const
 
 void InsetBranchParams::read(Lexer & lex)
 {
-       lex >> branch;
+       // There may be a space in branch name
+       // if we wanted to use lex>>, the branch name should be properly in quotes
+       lex.eatLine();
+       branch = lex.getDocString();
        lex >> "inverted" >> inverted;
 }