[LyX 2.0.x] Add generated .cpp files to .gitignore.

2012-07-11 Thread Richard Heck
The branch, 2.0.x, has been updated.

- Log -

commit 68135b286870fd0ced5c894c1a52f6ead8b549e2
Author: Richard Heck 
Date:   Wed Jul 11 11:18:17 2012 -0400

Add generated .cpp files to .gitignore.

diff --git a/.gitignore b/.gitignore
index 2bc7058..15a02e1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,3 +12,7 @@ config.log
 config.status
 lyx.1
 stamp-h1
+src/lyxcore.cpp
+src/lyxinsets.cpp
+src/lyxmathed.cpp
+src/client/lyxclient.cpp

---

Summary of changes:
 .gitignore |4 
 1 files changed, 4 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository


[LyX 2.0.x] Math output flavor was not set when viewing source code.

2012-07-11 Thread Richard Heck
The branch, 2.0.x, has been updated.

- Log -

commit 1e8f537481acd03816cb8b1c44daf05de0b52b43
Author: Richard Heck 
Date:   Wed Jul 11 11:35:12 2012 -0400

Math output flavor was not set when viewing source code.

Cherry-picked from e7877f6fee86012b84af15c25776fc22d639f36c.

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 0b4679d..ec525f7 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -3224,6 +3224,7 @@ void Buffer::getSourceCode(odocstream & os, string const 
format,
docbookParagraphs(text(), *this, os, runparams);
else if (runparams.flavor == OutputParams::HTML) {
XHTMLStream xs(os);
+   setMathFlavor(runparams);
xhtmlParagraphs(text(), *this, xs, runparams);
} else if (runparams.flavor == OutputParams::TEXT) {
bool dummy;
@@ -3605,20 +3606,7 @@ bool Buffer::doExport(string const & format, bool 
put_in_tempdir,
// HTML backend
else if (backend_format == "xhtml") {
runparams.flavor = OutputParams::HTML;
-   switch (params().html_math_output) {
-   case BufferParams::MathML: 
-   runparams.math_flavor = OutputParams::MathAsMathML; 
-   break;
-   case BufferParams::HTML: 
-   runparams.math_flavor = OutputParams::MathAsHTML; 
-   break;
-   case BufferParams::Images:
-   runparams.math_flavor = OutputParams::MathAsImages; 
-   break;
-   case BufferParams::LaTeX:
-   runparams.math_flavor = OutputParams::MathAsLaTeX; 
-   break;
-   }
+   setMathFlavor(runparams);
makeLyXHTMLFile(FileName(filename), runparams);
} else if (backend_format == "lyx")
writeFile(FileName(filename));
@@ -3758,6 +3746,26 @@ bool Buffer::doExport(string const & format, bool 
put_in_tempdir,
 }
 
 
+void Buffer::setMathFlavor(OutputParams & op) const
+{
+   switch (params().html_math_output) {
+   case BufferParams::MathML: 
+   op.math_flavor = OutputParams::MathAsMathML; 
+   break;
+   case BufferParams::HTML: 
+   op.math_flavor = OutputParams::MathAsHTML; 
+   break;
+   case BufferParams::Images:
+   op.math_flavor = OutputParams::MathAsImages; 
+   break;
+   case BufferParams::LaTeX:
+   op.math_flavor = OutputParams::MathAsLaTeX; 
+   break;
+   }
+}
+
+
+
 bool Buffer::preview(string const & format, bool includeall) const
 {
MarkAsExporting exporting(this);
diff --git a/src/Buffer.h b/src/Buffer.h
index 8a2de9e..410cb97 100644
--- a/src/Buffer.h
+++ b/src/Buffer.h
@@ -676,6 +676,8 @@ public:
int charCount(bool with_blanks) const;
 
 private:
+   ///
+   void setMathFlavor(OutputParams & op) const;
/// Change name of buffer. Updates "read-only" flag.
void setFileName(support::FileName const & fname);
///

---

Summary of changes:
 src/Buffer.cpp |   36 ++--
 src/Buffer.h   |2 ++
 2 files changed, 24 insertions(+), 14 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository


[LyX 2.0.x] Allow LyX format to be shown in View>Source.

2012-07-11 Thread Richard Heck
The branch, 2.0.x, has been updated.

- Log -

commit 4eab9d49a4f4a90a4c19b1b3de2f6be1b52e0e30
Author: Richard Heck 
Date:   Wed Jul 11 11:20:15 2012 -0400

Allow LyX format to be shown in View>Source.

Cherry-picked from b7ac2d69e7125bbe6b0bcc7a226cf8245773122a.

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index ec525f7..97ed9d8 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -3215,14 +3215,14 @@ void Buffer::getSourceCode(odocstream & os, string 
const format,
convert(par_end - 1))
   << "\n\n";
}
-   TexRow texrow;
-   texrow.reset();
-   texrow.newline();
-   texrow.newline();
// output paragraphs
-   if (params().isDocBook())
-   docbookParagraphs(text(), *this, os, runparams);
-   else if (runparams.flavor == OutputParams::HTML) {
+   if (runparams.flavor == OutputParams::LYX) {
+   Paragraph const & par = text().paragraphs()[par_begin];
+   ostringstream ods;
+   depth_type dt = par.getDepth();
+   par.write(ods, params(), dt);
+   os << from_utf8(ods.str());
+   } else if (runparams.flavor == OutputParams::HTML) {
XHTMLStream xs(os);
setMathFlavor(runparams);
xhtmlParagraphs(text(), *this, xs, runparams);
@@ -3232,6 +3232,8 @@ void Buffer::getSourceCode(odocstream & os, string const 
format,
// Probably should have some routine with a signature 
like them.
writePlaintextParagraph(*this,
text().paragraphs()[par_begin], os, runparams, 
dummy);
+   } else if (params().isDocBook()) {
+   docbookParagraphs(text(), *this, os, runparams);
} else {
// We need to validate the Buffer params' features here
// in order to know if we should output polyglossia
@@ -3239,28 +3241,46 @@ void Buffer::getSourceCode(odocstream & os, string 
const format,
LaTeXFeatures features(*this, params(), runparams);
params().validate(features);
runparams.use_polyglossia = features.usePolyglossia();
+   TexRow texrow;
+   texrow.reset();
+   texrow.newline();
+   texrow.newline();
// latex or literate
otexstream ots(os, texrow);
latexParagraphs(*this, text(), ots, runparams);
}
} else {
os << "% ";
-   if (output == FullSource) 
+   if (output == FullSource)
os << _("Preview source code");
else if (output == OnlyPreamble)
os << _("Preview preamble");
else if (output == OnlyBody)
os << _("Preview body");
os << "\n\n";
-   d->texrow.reset();
-   d->texrow.newline();
-   d->texrow.newline();
-   if (params().isDocBook())
-   writeDocBookSource(os, absFileName(), runparams, 
output);
-   else if (runparams.flavor == OutputParams::HTML)
+   if (runparams.flavor == OutputParams::LYX) {
+   ostringstream ods;
+   if (output == FullSource)
+   write(ods);
+   else if (output == OnlyPreamble)
+   params().writeFile(ods);
+   else if (output == OnlyBody)
+   text().write(ods);
+   os << from_utf8(ods.str());
+   } else if (runparams.flavor == OutputParams::HTML) {
writeLyXHTMLSource(os, runparams, output);
-   else {
+   } else if (runparams.flavor == OutputParams::TEXT) {
+   if (output == OnlyPreamble) {
+   os << _("% Plaintext does not have a 
preamble.");
+   } else
+   writePlaintextFile(*this, os, runparams);
+   } else if (params().isDocBook()) {
+   writeDocBookSource(os, absFileName(), 
runparams, output);
+   } else {
// latex or literate
+   d->texrow.reset();
+   d->texrow.newline();
+   d->texrow.newline();
otexstream ots(os, d->texrow);
writeLaTeXSource(ots, string(), runparams, output);

[LyX 2.0.x] * sk.po

2012-07-11 Thread Kornel Benko
The branch, 2.0.x, has been updated.

- Log -

commit 62c38fef36c1a67a8b6ecf38a443a9ad8830fa91
Author: Kornel Benko 
Date:   Wed Jul 11 20:36:30 2012 +0200

* sk.po

diff --git a/po/sk.po b/po/sk.po
index 4e51329..5f8aefb 100644
--- a/po/sk.po
+++ b/po/sk.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: LyX-2.1\n"
 "Report-Msgid-Bugs-To: lyx-de...@lists.lyx.org\n"
-"POT-Creation-Date: 2012-07-04 11:41+0200\n"
+"POT-Creation-Date: 2012-07-11 20:27+0200\n"
 "PO-Revision-Date: 2012-04-08 11:27+0100\n"
 "Last-Translator: Kornel Benko \n"
 "Language-Team: Slovak \n"
@@ -17164,6 +17164,10 @@ msgstr "Prehľad preambule"
 msgid "Preview body"
 msgstr "Prehľad tela"
 
+#: src/Buffer.cpp:3274
+msgid "% Plaintext does not have a preamble."
+msgstr "% Prostý text nemá preambulu."
+
 #: src/Buffer.cpp:3365
 #, c-format
 msgid "Auto-saving %1$s"

---

Summary of changes:
 po/sk.po |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository