From a1a47b2255af0e1f24858b0c57ac5545fba54c85 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Matox?= Date: Thu, 8 Nov 2001 11:32:18 +0000 Subject: [PATCH] Removed obsolete code. Replaced linuxdoc by sgml in two sgml helper functions. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2982 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 8 ++++++++ src/buffer.C | 37 +++++++------------------------------ src/paragraph.C | 2 +- src/paragraph.h | 2 +- 4 files changed, 17 insertions(+), 32 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 2fb5f37712..c24cb41301 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2001-11-08 José Matos + + * buffer.C (sgmlLineBreak): renamed from linux_doc_line_break. + (simpleDocBookOnePar): removed code made obsolete by the new inset code. + + * paragraph.h: + * paragraph.C (sgmlConvertChar): renamed from linuxDocConvertChar. + 2001-11-07 José Matos * buffer.h: diff --git a/src/buffer.C b/src/buffer.C index 3455879be7..f1d774986e 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -2708,7 +2708,7 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only) // writes newline, if necessary. namespace { -void linux_doc_line_break(ostream & os, string::size_type & colcount, +void sgmlLineBreak(ostream & os, string::size_type & colcount, string::size_type newcol) { colcount += newcol; @@ -2916,18 +2916,18 @@ void Buffer::simpleLinuxDocOnePar(ostream & os, ++char_line_count; } else { string sgml_string; - if (par->linuxDocConvertChar(c, sgml_string) + if (par->sgmlConvertChar(c, sgml_string) && !style.free_spacing) { // in freespacing mode, spaces are // non-breaking characters if (desc_on) {// if char is ' ' then... ++char_line_count; - linux_doc_line_break(os, char_line_count, 6); + sgmlLineBreak(os, char_line_count, 6); os << ""; desc_on = false; } else { - linux_doc_line_break(os, char_line_count, 1); + sgmlLineBreak(os, char_line_count, 1); os << c; } } else { @@ -2946,7 +2946,7 @@ void Buffer::simpleLinuxDocOnePar(ostream & os, // resets description flag correctly if (desc_on) { // not closed... - linux_doc_line_break(os, char_line_count, 6); + sgmlLineBreak(os, char_line_count, 6); os << ""; } } @@ -3299,33 +3299,10 @@ void Buffer::simpleDocBookOnePar(ostream & os, string & extra, if (c == Paragraph::META_INSET) { Inset * inset = par->getInset(i); - ostringstream ost; - inset->docbook(this, ost); - string tmp_out = ost.str().c_str(); - - // - // This code needs some explanation: - // Two insets are treated specially - // label if it is the first element in a command paragraph - // desc_on == 3 - // graphics inside tables or figure floats can't go on - // title (the equivalente in latex for this case is caption - // and title should come first - // desc_on == 4 - // - if (desc_on!= 3 || i!= 0) { - if (!tmp_out.empty() && tmp_out[0] == '@') { - if (desc_on == 4) - extra += frontStrip(tmp_out, '@'); - else - os << frontStrip(tmp_out, '@'); - } - else - os << tmp_out; - } + inset->docbook(this, os); } else { string sgml_string; - par->linuxDocConvertChar(c, sgml_string); + par->sgmlConvertChar(c, sgml_string); if (style.pass_thru) { os << c; diff --git a/src/paragraph.C b/src/paragraph.C index fbdeb4f36d..c6b27ee944 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -1685,7 +1685,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const * buf, } -bool Paragraph::linuxDocConvertChar(char c, string & sgml_string) +bool Paragraph::sgmlConvertChar(char c, string & sgml_string) { bool retval = false; switch (c) { diff --git a/src/paragraph.h b/src/paragraph.h index 0b4ba210e8..604c9f034d 100644 --- a/src/paragraph.h +++ b/src/paragraph.h @@ -341,7 +341,7 @@ public: void unsetPExtraType(BufferParams const &); #endif /// - bool linuxDocConvertChar(char c, string & sgml_string); + bool sgmlConvertChar(char c, string & sgml_string); ParagraphParameters & params(); ParagraphParameters const & params() const; -- 2.39.5