]> git.lyx.org Git - lyx.git/blobdiff - src/TextClass.cpp
Get rid of all-insets-toggle and explain how to replace it with inset-forall.
[lyx.git] / src / TextClass.cpp
index 5a51cef31557d25a037e4d28e6e97f2cbd622c0a..6d13d7de0a26b0d92aae8e9d2ce9476f365521f2 100644 (file)
@@ -837,7 +837,10 @@ void TextClass::readClassOptions(Lexer & lexrc)
                        break;
                case CO_OTHER:
                        lexrc.next();
-                       options_ = lexrc.getString();
+                       if (options_.empty())
+                               options_ = lexrc.getString();
+                       else
+                               options_ += ',' + lexrc.getString();
                        break;
                case CO_HEADER:
                        lexrc.next();
@@ -863,7 +866,13 @@ void TextClass::readCiteFormat(Lexer & lexrc)
                        break;
                lexrc.eatLine();
                definition = lexrc.getString();
-               cite_formats_[etype] = definition;
+               char initchar = etype[0];
+               if (initchar == '#')
+                       continue;
+               if (initchar == '!' || initchar == '_')
+                       cite_macros_[etype] = definition;
+               else
+                       cite_formats_[etype] = definition;
        }
 }
 
@@ -1135,7 +1144,8 @@ bool TextClass::load(string const & path) const
                       << to_utf8(makeDisplayPath(layout_file.absFilename()))
                       << "'\n(Check `" << name_
                       << "')\nCheck your installation and "
-                       "try Options/Reconfigure..." << endl;
+                         "try Options/Reconfigure..." 
+                      << endl;
        }
 
        return loaded_;
@@ -1352,7 +1362,7 @@ Layout const & DocumentClass::htmlTOCLayout() const
 
 string const & DocumentClass::getCiteFormat(string const & entry_type) const
 {
-       static string default_format = "{%author%[[%author%, ]][[{%editor%[[%editor%, %ed_text%, ]]}]]}\"%title%\"{%journal%[[, {!<i>!}%journal%{!</i>!}]][[{%publisher%[[, %publisher%]][[{%institution%[[, %institution%]]}]]}]]}{%year%[[ (%year%)]]}{%pages%[[, %pages%]]}.";
+       static string default_format = N_("{%author%[[%author%, ]][[{%editor%[[%editor%, ed., ]]}]]}\"%title%\"{%journal%[[, {!<i>!}%journal%{!</i>!}]][[{%publisher%[[, %publisher%]][[{%institution%[[, %institution%]]}]]}]]}{%year%[[ (%year%)]]}{%pages%[[, %pages%]]}.");
        
        map<string, string>::const_iterator it = cite_formats_.find(entry_type);
        if (it != cite_formats_.end())
@@ -1361,6 +1371,16 @@ string const & DocumentClass::getCiteFormat(string const & entry_type) const
 }
 
 
+string const & DocumentClass::getCiteMacro(string const & macro) const
+{
+       static string empty;
+       map<string, string>::const_iterator it = cite_macros_.find(macro);
+       if (it != cite_macros_.end())
+               return it->second;
+       return empty;
+}
+
+
 /////////////////////////////////////////////////////////////////////////
 //
 // PageSides