On Mon, 2004-10-25 at 15:38, Josà AbÃlio Oliveira Matos wrote: > On Mon, Oct 25, 2004 at 03:25:50PM +0300, Martin Vermeer wrote: > > > > Wrong fix I think. > > > > What if style->latexparam() is non-empty, but does not contain a '#'? > > > > :-) > > I think that we need to agree on a common syntax for string substitution > and place that on openTag. :-) > > Second try, something like this? > > Index: output_docbook.C > =================================================================== > RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/output_docbook.C,v > retrieving revision 1.17 > diff -u -p -r1.17 output_docbook.C > --- output_docbook.C 25 Oct 2004 11:20:02 -0000 1.17 > +++ output_docbook.C 25 Oct 2004 12:32:53 -0000 > @@ -234,14 +234,12 @@ ParagraphList::const_iterator makeComman > string id = par->getDocbookId(); > id = id.empty()? "" : " id = \"" + id + "\""; > > - if (!bstyle->latexparam().empty()) { > + if (!bstyle->latexparam().empty() && bstyle->latexparam().find('#') != > string::npos) { > counters.step(bstyle->counter); > id = bstyle->latexparam(); > - if (id.find('#') != string::npos) { > - string el = expandLabel(buf.params().getLyXTextClass(), > - bstyle, false); > - id = subst(id, "#", el); > - } > + string el = expandLabel(buf.params().getLyXTextClass(), > + bstyle, false); > + id = subst(id, "#", el); > } > > //Open outter tag
At least this looks correct now... but can't you (referring to before this proposed patch) just place the counters thingy *inside* the second if-statement? Again, what do I miss? Like this if (!bstyle->latexparam().empty()) { id = bstyle->latexparam(); if (id.find('#') != string::npos) { counters.step(bstyle->counter); string el = expandLabel(buf.params().getLyXTextClass(), bstyle, false); id = subst(id, "#", el); } } -- Martin Vermeer <[EMAIL PROTECTED]>
signature.asc
Description: This is a digitally signed message part