mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-14 17:39:58 +00:00
Word count for references.
This is different from the version in master, since JMarc rewrote the stats code.
This commit is contained in:
parent
480ae7f22e
commit
5041d74052
@ -5496,7 +5496,7 @@ void Buffer::Impl::updateStatistics(DocIterator & from, DocIterator & to, bool s
|
|||||||
char_count_ = 0;
|
char_count_ = 0;
|
||||||
blank_count_ = 0;
|
blank_count_ = 0;
|
||||||
|
|
||||||
for (DocIterator dit = from ; dit != to && !dit.atEnd(); ) {
|
for (DocIterator dit = from; dit != to && !dit.atEnd(); ) {
|
||||||
if (!dit.inTexted()) {
|
if (!dit.inTexted()) {
|
||||||
dit.forwardPos();
|
dit.forwardPos();
|
||||||
continue;
|
continue;
|
||||||
|
@ -668,4 +668,15 @@ docstring InsetRef::getTOCString() const
|
|||||||
return (broken_ ? _("BROKEN: ") : docstring()) + toc_string_;
|
return (broken_ ? _("BROKEN: ") : docstring()) + toc_string_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pair<int, int> InsetRef::isWords() 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);
|
||||||
|
return pair<int, int>(refstring.size(), wordCount(refstring));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace lyx
|
} // namespace lyx
|
||||||
|
@ -79,6 +79,8 @@ public:
|
|||||||
UpdateType utype, TocBackend & backend) const override;
|
UpdateType utype, TocBackend & backend) const override;
|
||||||
///
|
///
|
||||||
bool forceLTR(OutputParams const &) const override;
|
bool forceLTR(OutputParams const &) const override;
|
||||||
|
///
|
||||||
|
std::pair<int, int> isWords() const override;
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
/// \name Static public methods obligated for InsetCommand derived classes
|
/// \name Static public methods obligated for InsetCommand derived classes
|
||||||
|
@ -33,6 +33,8 @@ What's new
|
|||||||
the outliner, even of they do not have a label yet. In the latter
|
the outliner, even of they do not have a label yet. In the latter
|
||||||
case, a label is autonatically inserted.
|
case, a label is autonatically inserted.
|
||||||
|
|
||||||
|
- Approximate word count for cross-references.
|
||||||
|
|
||||||
- Document PDF settings allow color links and frames around them.
|
- Document PDF settings allow color links and frames around them.
|
||||||
These two settings are mutually exclusive by default and we signal
|
These two settings are mutually exclusive by default and we signal
|
||||||
that within UI now. Workarounds can be found our and hyperref manual.
|
that within UI now. Workarounds can be found our and hyperref manual.
|
||||||
|
Loading…
Reference in New Issue
Block a user