commit b956265be3feaed361be0a9d5054392acfed411f
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Fri Sep 7 15:49:21 2018 +0200

    Handle branches with space in their name
    
    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 |    4 ++--
 src/insets/InsetBranch.cpp           |    5 ++++-
 status.23x                           |    2 ++
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/frontends/qt4/GuiApplication.cpp 
b/src/frontends/qt4/GuiApplication.cpp
index 93eb2e8..79f14d6 100644
--- a/src/frontends/qt4/GuiApplication.cpp
+++ b/src/frontends/qt4/GuiApplication.cpp
@@ -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(
diff --git a/src/insets/InsetBranch.cpp b/src/insets/InsetBranch.cpp
index 77af282..28400bc 100644
--- a/src/insets/InsetBranch.cpp
+++ b/src/insets/InsetBranch.cpp
@@ -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;
 }
 
diff --git a/status.23x b/status.23x
index 77f72af..d149b70 100644
--- a/status.23x
+++ b/status.23x
@@ -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
 

Reply via email to