From: José Matox Date: Fri, 29 Oct 2004 23:08:04 +0000 (+0000) Subject: Sanitize ids for SGML/XML. X-Git-Tag: 1.6.10~14891 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=8e27aa2fb7c0b9469ac83f0af49e1f7bc59006f7;p=features.git Sanitize ids for SGML/XML. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9142 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/ChangeLog b/src/ChangeLog index 72e7e17643..0955a93515 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,14 @@ +2004-10-29 José Matos + + * output_docbook.C (makeEnvironment): + * sgml.C (openTag): + * paragraph.[Ch] (getID): rename function, and return it enclosed in id="...". + +2004-10-29 Andreas Vox + + * sgml.[Ch] (uniqueID): returns a unique id for a given label. + (cleanID): sanitize any id. + 2004-10-29 Georg Baum * buffer.C, lyxlex_pimpl.C: diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 0bd9e7c3d0..1d3430135c 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,12 @@ +2004-10-29 José Matos + + * insetgraphics.C (uniqueID): transfered to sgml.C + +2004-10-29 Andreas Vox + + * insetlabel.C (docbook, linuxdoc): + * insetref.C (docbook, linuxdoc) sanitize id. + 2004-10-29 Georg Baum * ExternalSupport.C: s/getExtFromContents/getFormatFromContents/ diff --git a/src/insets/insetgraphics.C b/src/insets/insetgraphics.C index 956819d798..71f4a3d531 100644 --- a/src/insets/insetgraphics.C +++ b/src/insets/insetgraphics.C @@ -69,6 +69,7 @@ TODO #include "metricsinfo.h" #include "mover.h" #include "outputparams.h" +#include "sgml.h" #include "frontends/Alert.h" #include "frontends/LyXView.h" @@ -78,7 +79,6 @@ TODO #include "support/lyxlib.h" // float_equal #include "support/os.h" #include "support/systemcall.h" -#include "support/tostr.h" #include #include @@ -126,13 +126,6 @@ string const RemoveExtension(string const & filename) } -string const uniqueID() -{ - static unsigned int seed = 1000; - return "graph" + tostr(++seed); -} - - string findTargetFormat(string const & format, OutputParams const & runparams) { // Are we using latex or pdflatex? @@ -160,7 +153,7 @@ string findTargetFormat(string const & format, OutputParams const & runparams) InsetGraphics::InsetGraphics() - : graphic_label(uniqueID()), + : graphic_label(sgml::uniqueID("graph")), graphic_(new RenderGraphic(this)) {} @@ -168,7 +161,7 @@ InsetGraphics::InsetGraphics() InsetGraphics::InsetGraphics(InsetGraphics const & ig) : InsetOld(ig), boost::signals::trackable(), - graphic_label(uniqueID()), + graphic_label(sgml::uniqueID("graph")), graphic_(new RenderGraphic(*ig.graphic_, this)) { setParams(ig.params()); diff --git a/src/insets/insetlabel.C b/src/insets/insetlabel.C index 816821f9c7..c3643f5b95 100644 --- a/src/insets/insetlabel.C +++ b/src/insets/insetlabel.C @@ -20,6 +20,7 @@ #include "lyxtext.h" #include "paragraph.h" #include "pariterator.h" +#include "sgml.h" #include "frontends/LyXView.h" @@ -135,7 +136,7 @@ int InsetLabel::plaintext(Buffer const &, ostream & os, int InsetLabel::linuxdoc(Buffer const &, ostream & os, OutputParams const &) const { - os << "