#include "Encoding.h"
#include "FuncRequest.h"
#include "FuncStatus.h"
-#include "InsetIterator.h"
+#include "InsetLayout.h"
#include "InsetList.h"
#include "Language.h"
#include "LaTeXFeatures.h"
-#include "Length.h"
#include "LyX.h"
-#include "OutputParams.h"
#include "xml.h"
#include "texstream.h"
#include "TocBackend.h"
#include "support/debug.h"
#include "support/docstream.h"
#include "support/gettext.h"
+#include "support/Length.h"
#include "support/lstrings.h"
using namespace std;
/////////////////////////////////////////////////////////////////////
InsetNomencl::InsetNomencl(Buffer * buf, InsetCommandParams const & p)
- : InsetCommand(buf, p),
- nomenclature_entry_id(xml::uniqueID(from_ascii("nomen")))
+ : InsetCommand(buf, p)
{}
void InsetNomencl::docbook(XMLStream & xs, OutputParams const &) const
{
- docstring attr = "linkend=\"" + nomenclature_entry_id + "\"";
+ docstring attr = "linkend=\"" + xml::cleanID(from_ascii("nomen") + getParam("symbol")) + "\"";
xs << xml::StartTag("glossterm", attr);
xs << xml::escapeString(getParam("symbol"));
xs << xml::EndTag("glossterm");
struct NomenclEntry {
- NomenclEntry() : par(0) {}
+ NomenclEntry() : par(nullptr) {}
NomenclEntry(docstring s, docstring d, Paragraph const * p)
: symbol(s), desc(d), par(p)
{}
EntryMap::const_iterator const een = entries.end();
for (; eit != een; ++eit) {
NomenclEntry const & ne = eit->second;
- string const parid = ne.par->magicLabel();
- xs << xml::StartTag("glossentry", "xml:id=\"" + parid + "\"");
+ xs << xml::StartTag("glossentry", "xml:id=\"" + xml::cleanID(from_ascii("nomen") + ne.symbol) + "\"");
xs << xml::CR();
xs << xml::StartTag("glossterm");
xs << ne.symbol;
int w = 0;
docstring symb;
- InsetNomencl const * nomencl = 0;
+ InsetNomencl const * nomencl = nullptr;
ParagraphList::const_iterator it = buffer.paragraphs().begin();
ParagraphList::const_iterator end = buffer.paragraphs().end();
continue;
nomencl = static_cast<InsetNomencl const *>(inset);
// Use proper formatting. We do not escape makeindex chars here
- docstring const symbol = nomencl ?
+ docstring symbol = nomencl ?
nomencl->params().prepareCommand(runparams, nomencl->getParam("symbol"),
ParamInfo::HANDLING_LATEXIFY)
: docstring();
+ // strip out % characters which are used as escape in nomencl
+ // but act as comment in our context here
+ symbol = subst(symbol, from_ascii("%"), docstring());
// This is only an approximation,
// but the best we can get.
int const wx = use_gui ?