[LyX/master] Improved character count statistics for letter based insets (e.g. the LyX logo).

Stephan Witt switt at lyx.org
Sun Aug 16 14:41:19 UTC 2020


commit 2dae4ab4f35458f3caa4f85f8c0e64e5fe9065d1
Author: Stephan Witt <switt at lyx.org>
Date:   Sun Aug 16 17:07:04 2020 +0200

    Improved character count statistics for letter based insets (e.g. the LyX logo).
---
 src/Buffer.cpp |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index dff7fae..97a6cfb 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -5362,8 +5362,11 @@ void Buffer::Impl::updateStatistics(DocIterator & from, DocIterator & to, bool s
 					++word_count_;
 					inword = true;
 				}
-				if (ins && ins->isLetter())
-					++char_count_;
+				if (ins && ins->isLetter()) {
+					odocstringstream os;
+					ins->toString(os);
+					char_count_ += os.str().length();
+				}
 				else if (ins && ins->isSpace())
 					++blank_count_;
 				else {


More information about the lyx-cvs mailing list