[LyX master] Add DefaultStyle to siamltex.layut (bug #8194) Patch by Dima Batenkov.

2012-06-09 Thread Juergen Spitzmueller
The branch, master, has been updated.

- Log -

commit dd790192d354f08053559d2ed6781db6afe3d1b9
Author: Juergen Spitzmueller 
Date:   Sat Jun 9 18:29:08 2012 +0200

Add DefaultStyle to siamltex.layut (bug #8194)
Patch by Dima Batenkov.

diff --git a/lib/layouts/siamltex.layout b/lib/layouts/siamltex.layout
index cdf90f3..111822e 100644
--- a/lib/layouts/siamltex.layout
+++ b/lib/layouts/siamltex.layout
@@ -14,6 +14,7 @@ Format 36
 Columns 1
 Sides   2
 PageStyle   Headers
+DefaultStyleStandard
 Provides makeidx1
 Provides amsthm 1
 

---

Summary of changes:
 lib/layouts/siamltex.layout |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository


[LyX master] Let getOutputFlavor return the correct flavors for the latex varieties

2012-06-09 Thread Juergen Spitzmueller
The branch, master, has been updated.

- Log -

commit 4698ebd2b749ca24f962f9e0ebfb94bc13a88658
Author: Juergen Spitzmueller 
Date:   Sat Jun 9 15:11:34 2012 +0200

Let getOutputFlavor return the correct flavors for the latex varieties

diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index ac028fc..d7503d4 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -2177,12 +2177,22 @@ OutputParams::FLAVOR 
BufferParams::getOutputFlavor(string const format) const
 
OutputParams::FLAVOR result = OutputParams::LATEX;
 
+   // FIXME It'd be better not to hardcode this, but to do
+   //   something with formats.
if (dformat == "xhtml")
result = OutputParams::HTML;
else if (dformat == "text")
result = OutputParams::TEXT;
else if (dformat == "lyx")
result = OutputParams::LYX;
+   else if (dformat == "pdflatex")
+   result = OutputParams::PDFLATEX;
+   else if (dformat == "xetex")
+   result = OutputParams::XETEX;
+   else if (dformat == "luatex")
+   result = OutputParams::LUATEX;
+   else if (dformat == "dviluatex")
+   result = OutputParams::DVILUATEX;
else {
// Try to determine flavor of default output format
vector backs = backends();

---

Summary of changes:
 src/BufferParams.cpp |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository


[LyX master] some less language hardcoding

2012-06-09 Thread Juergen Spitzmueller
The branch, master, has been updated.

- Log -

commit f71a55a279914247f986ada9f3b78ebfd29c460b
Author: Juergen Spitzmueller 
Date:   Sat Jun 9 11:32:34 2012 +0200

some less language hardcoding

diff --git a/lib/languages b/lib/languages
index 25169dc..92d23c1 100644
--- a/lib/languages
+++ b/lib/languages
@@ -21,6 +21,7 @@
 #  PostBabelPreamble
 #
 #  EndPostBabelPreamble
+#  Requires   
 # End
 #
 #
@@ -261,6 +262,7 @@ Language chinese-simplified
GuiName  "Chinese (simplified)"
Encoding euc-cn
LangCode zh_CN
+   Requires CJK
 End
 
 # uses CJK package
@@ -268,6 +270,7 @@ Language chinese-traditional
GuiName "Chinese (traditional)"
Encodingutf8-cjk
LangCodezh_CN
+   Requires CJK
 End
 
 # not supported by babel
@@ -513,6 +516,7 @@ Language japanese
Encoding jis-plain
LangCode ja_JP
AsBabelOptions   true
+   Requires japanese
 End
 
 # uses CJK package
@@ -520,6 +524,7 @@ Language japanese-cjk
GuiName "Japanese (CJK)"
Encodingeuc-jp
LangCodeja_JP
+   RequiresCJK
 End
 
 # not yet supported by polyglossia
@@ -534,6 +539,7 @@ Language korean
GuiName "Korean"
Encodingeuc-kr
LangCodeko_KR
+   RequiresCJK
 End
 
 # not supported by babel
@@ -873,6 +879,7 @@ Language vietnamese
Encoding utf8
LangCode vi_VN
AsBabelOptions   true
+   Requires vietnamese
 End
 
 Language welsh
diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index 7237a94..ac028fc 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -1250,10 +1250,8 @@ void BufferParams::validate(LaTeXFeatures & features) 
const
|| useNonTeXFonts))
features.require("polyglossia");
 
-   if (language->lang() == "vietnamese")
-   features.require("vietnamese");
-   else if (language->lang() == "japanese")
-   features.require("japanese");
+   if (!language->requires().empty())
+   features.require(language->requires());
 }
 
 
@@ -2688,9 +2686,6 @@ void BufferParams::writeEncodingPreamble(otexstream & os,
// If the "japanese" package (i.e. pLaTeX) is used,
// inputenc must be omitted.
// see 
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg129680.html
-   if (package == Encoding::japanese)
-features.require("japanese");
-
if ((!encodings.empty() || package == Encoding::inputenc)
&& !features.isRequired("japanese")) {
os << "\\usepackage[";
diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp
index f75fdc4..c4b49e6 100644
--- a/src/LaTeXFeatures.cpp
+++ b/src/LaTeXFeatures.cpp
@@ -453,8 +453,8 @@ void LaTeXFeatures::useLanguage(Language const * lang)
 {
if (!lang->babel().empty())
UsedLanguages_.insert(lang);
-   if (lang->lang() == "vietnamese")
-   require("vietnamese");
+   if (!lang->requires().empty())
+   require(lang->requires());
// CJK languages do not have a babel name.
// They use the CJK package
if (lang->encoding()->package() == Encoding::CJK)
diff --git a/src/Language.cpp b/src/Language.cpp
index cbe425d..ddb63e3 100644
--- a/src/Language.cpp
+++ b/src/Language.cpp
@@ -74,6 +74,7 @@ bool Language::readLanguage(Lexer & lex)
LA_POLYGLOSSIAOPTS,
LA_POSTBABELPREAMBLE,
LA_PREBABELPREAMBLE,
+   LA_REQUIRES,
LA_RTL
};
 
@@ -91,6 +92,7 @@ bool Language::readLanguage(Lexer & lex)
{ "polyglossiaopts",  LA_POLYGLOSSIAOPTS },
{ "postbabelpreamble",LA_POSTBABELPREAMBLE },
{ "prebabelpreamble", LA_PREBABELPREAMBLE },
+   { "requires", LA_REQUIRES },
{ "rtl",  LA_RTL }
};
 
@@ -152,6 +154,9 @@ bool Language::readLanguage(Lexer & lex)
babel_presettings_ =
lex.getLongString("EndPreBabelPreamble");
break;
+   case LA_REQUIRES:
+   lex >> requires_;
+   break;
case LA_RTL:
lex >> rightToLeft_;
break;
diff --git a/src/Language.h b/src/Language.h
index 537c7f7..955df26 100644
--- a/src/Language.h
+++ b/src/Language.h
@@ -40,6 +40,8 @@ public:
std::string const & polyglossia() const { return polyglossia_name_; }
/// polyglossia language options
std::string const & polyglossiaOpts() const { return p