The branch, master, has been updated.

- Log -----------------------------------------------------------------

commit 9f93983b610bcda27468b62c17867d496114a88d
Author: Georg Baum <b...@lyx.org>
Date:   Tue Feb 19 22:19:10 2013 +0100

    Extend unicodesymbols force flag
    
    As suggested by Günter Milde.

diff --git a/lib/unicodesymbols b/lib/unicodesymbols
index f073844..f4469de 100644
--- a/lib/unicodesymbols
+++ b/lib/unicodesymbols
@@ -35,9 +35,11 @@
 # Therefore it may depend on the whole document contents which feature is 
chosen.
 # Known flags:
 # - combining       This is a combining char that will get combined with a 
base char
-# - force              Always output replacement command except for encodings
-#                      with iconv name "UTF-8"
+# - force              Always output replacement command
 # - force=enc1;enc2... Always output replacement command in the specified 
encodings.
+# - force!=en1;en2...  Always output replacement command in all but the 
specified encodings.
+#                      Symbols are never forced in encodings with iconv name
+#                      UTF-8 and package none (currently only utf8-plain).
 # - mathalpha       This character is considered as a math variable in mathmode
 # - notermination=text Do not terminate this textcommand (by {} or space).
 #                      This is set by default if textcommand ends with }.
diff --git a/src/Encoding.cpp b/src/Encoding.cpp
index 98ad851..82f2ea9 100644
--- a/src/Encoding.cpp
+++ b/src/Encoding.cpp
@@ -896,6 +896,7 @@ void Encodings::read(FileName const & encfile, FileName 
const & symbolsfile)
 {
        // We must read the symbolsfile first, because the Encoding
        // constructor depends on it.
+       CharSetMap forcednotselected;
        Lexer symbolslex;
        symbolslex.setFile(symbolsfile);
        bool getNextToken = true;
@@ -947,6 +948,12 @@ void Encodings::read(FileName const & encfile, FileName 
const & symbolsfile)
                                for (size_t i = 0; i < encodings.size(); ++i)
                                        
forcedselected[encodings[i]].insert(symbol);
                                info.flags |= CharInfoForceSelected;
+                       } else if (prefixIs(flag, "force!=")) {
+                               vector<string> encodings =
+                                       getVectorFromString(flag.substr(7), 
";");
+                               for (size_t i = 0; i < encodings.size(); ++i)
+                                       
forcednotselected[encodings[i]].insert(symbol);
+                               info.flags |= CharInfoForceSelected;
                        } else if (flag == "mathalpha") {
                                mathalpha.insert(symbol);
                        } else if (flag == "notermination=text") {
@@ -1094,6 +1101,15 @@ void Encodings::read(FileName const & encfile, FileName 
const & symbolsfile)
                        break;
                }
        }
+
+       // Move all information from forcednotselected to forcedselected
+       for (CharSetMap::const_iterator it1 = forcednotselected.begin(); it1 != 
forcednotselected.end(); ++it1) {
+               for (CharSetMap::iterator it2 = forcedselected.begin(); it2 != 
forcedselected.end(); ++it2) {
+                       if (it2->first != it1->first)
+                               it2->second.insert(it1->second.begin(), 
it1->second.end());
+               }
+       }
+
 }
 
 

-----------------------------------------------------------------------

Summary of changes:
 lib/unicodesymbols |    6 ++++--
 src/Encoding.cpp   |   16 ++++++++++++++++
 2 files changed, 20 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to