Compare commits

...

2 Commits

Author SHA1 Message Date
Richard Kimberly Heck
81f5fc80b5 Use buffer language 2024-12-05 17:21:40 -05:00
Richard Kimberly Heck
945251a6c5 Word count for references 2024-12-05 17:17:54 -05:00
2 changed files with 14 additions and 0 deletions

View File

@ -24,6 +24,7 @@
#include "Paragraph.h"
#include "ParIterator.h"
#include "PDFOptions.h"
#include "Statistics.h"
#include "xml.h"
#include "texstream.h"
#include "TocBackend.h"
@ -669,4 +670,15 @@ docstring InsetRef::getTOCString() const
return (broken_ ? _("BROKEN: ") : docstring()) + toc_string_;
}
void InsetRef::updateStatistics(Statistics & stats) const
{
docstring const & ref = getParam("reference");
string const & cmd = params().getCmdName();
// best we can do here
string const & lang = buffer().params().language->lang();
docstring const refstring = displayString(ref, cmd, lang);
stats.update(refstring);
}
} // namespace lyx

View File

@ -75,6 +75,8 @@ public:
///
void updateBuffer(ParIterator const & it, UpdateType, bool const deleted = false) override;
///
void updateStatistics(Statistics & stats) const override;
///
void addToToc(DocIterator const & di, bool output_active,
UpdateType utype, TocBackend & backend) const override;
///