From: José Matox
Date: Wed, 21 Mar 2001 23:38:07 +0000 (+0000)
Subject: Cleaner code for linuxdoc generation that allowed finally to removed some
X-Git-Tag: 1.6.10~21425
X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=540ecf3e20600b36914d778f8439eaff7ec76ea6;p=features.git
Cleaner code for linuxdoc generation that allowed finally to removed some
warnings from Lars, at least for now ;-).
Fixed long time bug regarding nested paragraph tags.
Better support for XML and linuxdoc regarding CDATA sections.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1801 a592a061-630c-0410-9148-cb99ea01b6c8
---
diff --git a/lib/ChangeLog b/lib/ChangeLog
index c21792cb72..02d3cc580d 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,7 @@
+2001-03-21 José Abílio Matos
+
+ * layouts/linuxdoc.layout: add support for CDATA section in code.
+
2001-03-19 Kayvan A. Sylvan
* ui/default.ui: cleanup the entries for the NEW_INSETS changes.
diff --git a/lib/layouts/linuxdoc.layout b/lib/layouts/linuxdoc.layout
index f7cc48613d..c7e58e25e1 100644
--- a/lib/layouts/linuxdoc.layout
+++ b/lib/layouts/linuxdoc.layout
@@ -275,6 +275,7 @@ End
Style Code
Margin Static
LatexType Environment
+ LatexParam CDATA
LatexName code
LeftMargin MM
LabelSep xx
diff --git a/src/ChangeLog b/src/ChangeLog
index be60196712..a9378204d8 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,19 @@
+2001-03-21 José Abílio Matos
+
+ * buffer.C (pop_tag): removed.
+ (push_tag): removed.
+ (makeLinuxDocFile): cleaner C++ code, declarations near usage point,
+ array replaced with vector. Added support for CDATA sections.
+ (SimpleLinuxDocOnePar): ditto. Paragraph tags are correctly handled,
+ at any nest level.
+ (makeDocBookFile): XML conformant declaration of CDATA section,
+ fixed bug related to in the first paragraph char.
+ (sgmlOpenTag): exclude empty tags.
+ (sgmlCloseTag): ditto.
+
+ * buffer.h (pop_tag): removed.
+ (push_tag): removed.
+
2001-03-20 Angus Leeming
* language.h (Languages): added size_type and size().
diff --git a/src/buffer.C b/src/buffer.C
index ce120abe1d..59900ad400 100644
--- a/src/buffer.C
+++ b/src/buffer.C
@@ -17,6 +17,8 @@
#include
#include
#include
");
- break;
}
}
@@ -3115,13 +3054,6 @@ void Buffer::LinuxDocError(LyXParagraph * par, int pos,
par->InsertInset(pos, new_inset);
}
-// This constant defines the maximum number of
-// environment layouts that can be nesteded.
-// The same applies for command layouts.
-// These values should be more than enough.
-// José Matos (1999/07/22)
-
-enum { MAX_NEST_LEVEL = 25};
void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
{
@@ -3130,11 +3062,11 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
niceFile = nice; // this will be used by Insetincludes.
string top_element= textclasslist.LatexnameOfClass(params.textclass);
- // Please use a real stack.
- string environment_stack[MAX_NEST_LEVEL];
- string environment_inner[MAX_NEST_LEVEL];
- // Please use a real stack.
- string command_stack[MAX_NEST_LEVEL];
+
+ vector environment_stack;
+ vector environment_inner;
+ vector command_stack;
+
bool command_flag= false;
int command_depth= 0, command_base= 0, cmd_depth= 0;
@@ -3320,7 +3252,7 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body)
if (style.latextype == LATEX_ENVIRONMENT) {
if (!style.latexparam().empty()) {
if(style.latexparam() == "CDATA")
- ofs << "getFont(params, i);
// handle tag
- if (font1.emph() != font2.emph() && i) {
+ if (font1.emph() != font2.emph()) {
if (font2.emph() == LyXFont::ON) {
os << "";
emph_flag = true;
- }else {
+ }else if(i) {
os << "";
emph_flag = false;
}
diff --git a/src/buffer.h b/src/buffer.h
index 69fc7a3dc2..2d58f33769 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -338,26 +338,17 @@ private:
void DocBookHandleFootnote(std::ostream & os,
LyXParagraph * & par, int depth);
#endif
- ///
+ /// Open SGML/XML tag.
void sgmlOpenTag(std::ostream & os, int depth,
string const & latexname) const;
- ///
+ /// Closes SGML/XML tag.
void sgmlCloseTag(std::ostream & os, int depth,
string const & latexname) const;
///
void LinuxDocError(LyXParagraph * par, int pos,
string const & message);
///
- void SimpleLinuxDocOnePar(std::ostream & os, LyXParagraph * par,
- int desc_on, int depth);
-
- /// LinuxDoc.
- void push_tag(std::ostream & os, string const & tag,
- int & pos, char stack[5][3]);
-
- /// LinuxDoc.
- void pop_tag(std::ostream & os, string const & tag,
- int & pos, char stack[5][3]);
+ void SimpleLinuxDocOnePar(std::ostream & os, LyXParagraph * par, int depth);
/// is save needed
mutable bool lyx_clean;