From e7ac80f17d7012e1853d95761217106d5e20e508 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Matox?= Date: Mon, 15 Oct 2001 12:21:11 +0000 Subject: [PATCH] add suport for ert export for docbook and linuxdoc add support for revision history related tags. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2885 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/ChangeLog | 5 +++ lib/layouts/db_stdtitle.inc | 63 +++++++++++++++++++++++++++++++++++++ src/insets/ChangeLog | 4 +++ src/insets/insetert.C | 54 ++++++++++++++++++++++++++++--- 4 files changed, 122 insertions(+), 4 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index 3d9e1a4346..6b4d32e43f 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2001-10-15 José Matos + + * layouts/db_stdtitle.inc: add AuthorGroup, RevisionHistory, + RevisionMark and Revision styles. + 2001-10-12 Jean-Marc Lasgouttes * scripts/TeXFiles.sh: use -follow predicate in "find" to follow diff --git a/lib/layouts/db_stdtitle.inc b/lib/layouts/db_stdtitle.inc index 365da4177f..e42b42fbb2 100644 --- a/lib/layouts/db_stdtitle.inc +++ b/lib/layouts/db_stdtitle.inc @@ -21,6 +21,14 @@ Style Author KeepEmpty 1 End +# Authorgroup +Style Authorgroup + CopyStyle Author + LatexType Environment + LatexName authorgroup + LatexParam author +End + # first name style definition Style FirstName Margin Static @@ -50,3 +58,58 @@ Style Date LatexType Paragraph LatexName date End + +# Revision History style definition +Style RevisionHistory + Margin Static + LatexType Command + LatexName revhistory + LatexParam "3|!-- --" + LeftMargin MMM + RightMargin MMM + ParIndent MM + TopSep 0.7 + BottomSep 0 + ParSep 0 + Align Block + AlignPossible Block + KeepEmpty 1 + LabelType Centered_Top_Environment + LabelString "Revision History" + LabelBottomSep 0.5 + +End + +# Revision style definition +Style Revision + Margin Dynamic + LatexType Command + LatexName revision + LatexParam "4|revnumber" + LabelSep xxx + ParSkip 0.4 + TopSep 0.9 + BottomSep 0.5 + ParSep 0.5 + Align Block + AlignPossible Block + +End + +# RevisionRemark style definition +Style RevisionRemark + Margin Static + LatexType Paragraph + InTitle 1 + LatexName revremark + LabelSep xxx + ParIndent MM + ParSkip 0.0 + TopSep 0.0 + BottomSep 0.0 + ParSep 1 + Align Block + AlignPossible Block + LabelType No_Label + +End diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index b76c7c856d..7f38a62ad0 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,7 @@ +2001-10-15 José Matos + + * insetert.C: allow export for docbook and linuxdoc + 2001-10-07 Adrien Rebollo * insetquotes.C (dispString): handles latin3 and latin4 quotes diff --git a/src/insets/insetert.C b/src/insets/insetert.C index 6ce0971d73..7a4f5b4a47 100644 --- a/src/insets/insetert.C +++ b/src/insets/insetert.C @@ -348,15 +348,61 @@ int InsetERT::ascii(Buffer const *, } -int InsetERT::linuxdoc(Buffer const *, std::ostream &) const +int InsetERT::linuxdoc(Buffer const *, std::ostream & os) const { - return 0; + Paragraph * par = inset.paragraph(); + int lines = 0; + while (par) { + Paragraph::size_type siz = par->size(); + for (Paragraph::size_type i = 0; i < siz; ++i) { + Paragraph::value_type c = par->getChar(i); + switch (c) { + case Paragraph::META_NEWLINE: + os << '\n'; + ++lines; + break; + default: + os << c; + break; + } + } + par = par->next(); + if (par) { + os << "\n"; + lines ++; + } + } + + return lines; } -int InsetERT::docbook(Buffer const *, std::ostream &) const +int InsetERT::docbook(Buffer const *, std::ostream & os) const { - return 0; + Paragraph * par = inset.paragraph(); + int lines = 0; + while (par) { + Paragraph::size_type siz = par->size(); + for (Paragraph::size_type i = 0; i < siz; ++i) { + Paragraph::value_type c = par->getChar(i); + switch (c) { + case Paragraph::META_NEWLINE: + os << '\n'; + ++lines; + break; + default: + os << c; + break; + } + } + par = par->next(); + if (par) { + os << "\n"; + lines ++; + } + } + + return lines; } -- 2.39.5