From 94b5a7b16393043968ef6467dc2fa1fc345402a9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Matox?= Date: Fri, 30 Nov 2001 11:56:04 +0000 Subject: [PATCH] docbook code cleanup. renamed some DocBook to docbook that Lars forgot. (inset methods) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3119 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 11 +++++++++++ src/buffer.C | 10 +++++++--- src/insets/ChangeLog | 4 ++++ src/insets/insettoc.C | 2 +- src/insets/insettoc.h | 2 +- src/insets/inseturl.C | 2 +- src/insets/inseturl.h | 2 +- 7 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 5d0d4cacf3..b82401af6f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2001-11-30 José Matos + + * buffer.C (makeDocBookFile): add a comment to point a hack. + (simpleDocBookOnePar): changed a PAR::META_INSET to isInset(). + Fixed a double write of labels. + 2001-11-28 André Pönitz * all the files from the change on 2001/11/26: @@ -167,6 +173,11 @@ Change return code to string::npos when there have been no error (0 was a bad idea when error is at first character) +2001-11-14 José Matos + + * buffer.h: + * buffer.C (simpleDocBookOnePar): removed unused argument. + 2001-11-13 Jean-Marc Lasgouttes * text.C (selectNextWordToSpellcheck): do not test explicitely for diff --git a/src/buffer.C b/src/buffer.C index a89d1e3160..fd04286441 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -3126,6 +3126,8 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body) // treat label as a special case for // more WYSIWYM handling. + // This is a hack while paragraphs can't have + // attributes, like id in this case. if (par->isInset(0)) { Inset * inset = par->getInset(0); Inset::Code lyx_code = inset->lyxCode(); @@ -3306,12 +3308,14 @@ void Buffer::simpleDocBookOnePar(ostream & os, } } - char c = par->getChar(i); - if (c == Paragraph::META_INSET) { + if ( par->isInset(i) ) { Inset * inset = par->getInset(i); - inset->docbook(this, os); + // don't print the inset in position 0 if desc_on == 3 (label) + if ( i || desc_on != 3) + inset->docbook(this, os); } else { + char c = par->getChar(i); string sgml_string; par->sgmlConvertChar(c, sgml_string); diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index d697ee9208..a1f43772a2 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,7 @@ +2001-11-30 José Matos + + * inseturl.[Ch]: + * insettoc.[Ch]: DocBook -> docbook. 2001-11-29 André Pönitz diff --git a/src/insets/insettoc.C b/src/insets/insettoc.C index d78ef8f37b..5c52074cfa 100644 --- a/src/insets/insettoc.C +++ b/src/insets/insettoc.C @@ -77,7 +77,7 @@ int InsetTOC::linuxdoc(Buffer const *, std::ostream & os) const } -int InsetTOC::DocBook(Buffer const *, std::ostream & os) const +int InsetTOC::docbook(Buffer const *, std::ostream & os) const { if (getCmdName() == "tableofcontents") os << ""; diff --git a/src/insets/insettoc.h b/src/insets/insettoc.h index 349cf61171..413740f486 100644 --- a/src/insets/insettoc.h +++ b/src/insets/insettoc.h @@ -46,7 +46,7 @@ public: /// int linuxdoc(Buffer const *, std::ostream &) const; /// - int DocBook(Buffer const *, std::ostream &) const; + int docbook(Buffer const *, std::ostream &) const; }; #endif diff --git a/src/insets/inseturl.C b/src/insets/inseturl.C index 0b95b22a27..2be9d6d96f 100644 --- a/src/insets/inseturl.C +++ b/src/insets/inseturl.C @@ -81,7 +81,7 @@ int InsetUrl::linuxdoc(Buffer const *, ostream & os) const } -int InsetUrl::DocBook(Buffer const *, ostream & os) const +int InsetUrl::docbook(Buffer const *, ostream & os) const { os << "" << getOptions() << ""; diff --git a/src/insets/inseturl.h b/src/insets/inseturl.h index b97913009d..d077e33dae 100644 --- a/src/insets/inseturl.h +++ b/src/insets/inseturl.h @@ -52,7 +52,7 @@ public: /// int linuxdoc(Buffer const *, std::ostream &) const; /// - int DocBook(Buffer const *, std::ostream &) const; + int docbook(Buffer const *, std::ostream &) const; }; #endif -- 2.39.2