Word count for references

This commit is contained in:
Richard Kimberly Heck 2024-12-05 17:14:11 -05:00
parent 556efce34b
commit 945251a6c5
2 changed files with 12 additions and 0 deletions

View File

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

View File

@ -75,6 +75,8 @@ public:
/// ///
void updateBuffer(ParIterator const & it, UpdateType, bool const deleted = false) override; 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, void addToToc(DocIterator const & di, bool output_active,
UpdateType utype, TocBackend & backend) const override; UpdateType utype, TocBackend & backend) const override;
/// ///