]> 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>
Wed, 19 Sep 2018 20:39:01 +0000 (22:39 +0200)
1/ Handle space in color name in set-color (with quoting)

2/ read properly branch inset which name has a space

Fixes bug #11108.

(cherry picked from commit 819cf53c2254f17e9bb6c6b971904451cfaaae6d)

src/frontends/qt4/GuiApplication.cpp
src/insets/InsetBranch.cpp
status.23x

index 93eb2e86ecded8a82771a7f6b02aa3dc585464d8..79f14d64582840a3bf00600734b47369b3429a72 100644 (file)
@@ -1724,8 +1724,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 77af2829e1a70421e319ea01bcbc03068aad03d5..28400bc851dc432b6d42722f2f78cacf45e24a21 100644 (file)
@@ -403,7 +403,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;
 }
 
index 77f72af5985a90d2fb6d6db9d39317af90f95559..d149b701ef79ea46885d7e1b4cc9e92e1bafcac0 100644 (file)
@@ -59,6 +59,8 @@ What's new
 
 - When using formal tables, draw top/bottom rules thicker when adequate.
 
+- Handle properly branches with a space in their name (bug 11108).
+
 
 * DOCUMENTATION AND LOCALIZATION