From a590b1e0d26cf9fced598ab623a3041a887ce9c2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Matox?= Date: Sat, 30 Oct 2004 18:44:55 +0000 Subject: [PATCH] Replace CDATA argument as innertag. Use CDATA if environment requires PassThru. The code now feels more natural, as there is one less exception. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9148 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/ChangeLog | 4 ++++ lib/layouts/db_lyxmacros.inc | 1 - src/ChangeLog | 6 ++++++ src/output_docbook.C | 8 ++++---- src/paragraph.C | 7 ++----- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index 90a5460265..2e37fa5385 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,7 @@ +2004-10-30 José Matos + + * layouts/db_lyxmacros.inc: Remove innertag "CDATA" from Code. + 2004-10-30 José Matos * layouts/db_stdlayouts.inc: remove SGML paragraph type. diff --git a/lib/layouts/db_lyxmacros.inc b/lib/layouts/db_lyxmacros.inc index a93467d6ff..c43bc3546b 100644 --- a/lib/layouts/db_lyxmacros.inc +++ b/lib/layouts/db_lyxmacros.inc @@ -11,7 +11,6 @@ Style Code CopyStyle LyX-Code LatexType Environment LatexName screen - InnerTag CDATA PassThru 1 End diff --git a/src/ChangeLog b/src/ChangeLog index 52167a5abc..16edfe0062 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2004-10-30 José Matos + + * paragraph.C (getFirstWord): the content should always be escaped there. + (simpleDocBookOnePar): + * output_docbook.C (makeEnvironment): replace reference to CDATA to style pass_thru. + 2004-10-30 José Matos * paragraph.C (simpleDocBookOnePar): fix reference to CDATA. diff --git a/src/output_docbook.C b/src/output_docbook.C index 47c8eefd47..a46b085680 100644 --- a/src/output_docbook.C +++ b/src/output_docbook.C @@ -132,7 +132,7 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf, // Opening outter tag sgml::openTag(buf, os, *pbegin); os << '\n'; - if (bstyle->latextype == LATEX_ENVIRONMENT and bstyle->innertag() == "CDATA") + if (bstyle->latextype == LATEX_ENVIRONMENT and bstyle->pass_thru) os << "latextype) { case LATEX_ENVIRONMENT: - if (!bstyle->innertag().empty() and bstyle->innertag() != "CDATA") { + if (!bstyle->innertag().empty()) { sgml::openTag(os, bstyle->innertag(), id); } break; @@ -189,7 +189,7 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf, // Closing inner tag switch (bstyle->latextype) { case LATEX_ENVIRONMENT: - if (!bstyle->innertag().empty() and bstyle->innertag() != "CDATA") { + if (!bstyle->innertag().empty()) { sgml::closeTag(os, bstyle->innertag()); os << '\n'; } @@ -204,7 +204,7 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf, } } - if (bstyle->latextype == LATEX_ENVIRONMENT and bstyle->innertag() == "CDATA") + if (bstyle->latextype == LATEX_ENVIRONMENT and bstyle->pass_thru) os << "]]>"; // Closing outter tag diff --git a/src/paragraph.C b/src/paragraph.C index 17a70818ca..88a4193cb7 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -1389,10 +1389,7 @@ pos_type Paragraph::getFirstWord(Buffer const & buf, ostream & os, OutputParams string str; boost::tie(ws, str) = sgml::escapeChar(c); - if (style->pass_thru) - os << c; - else - os << str; + os << str; } } return i; @@ -1410,7 +1407,7 @@ void Paragraph::simpleDocBookOnePar(Buffer const & buf, LyXFont font_old = style->labeltype == LABEL_MANUAL ? style->labelfont : style->font; - bool cdata = (style->innertag() == "CDATA"); + bool cdata = style->pass_thru; // parsing main loop for (pos_type i = initial; i < size(); ++i) { LyXFont font = getFont(buf.params(), i, outerfont); -- 2.39.5