mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
detect end of paragraph and use it as word separator to correct the word count in tables - thanks, JMarc
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36659 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
1ed5b98873
commit
7f9d85e285
@ -184,6 +184,7 @@ int countWords(DocIterator const & from, DocIterator const & to)
|
||||
{
|
||||
int count = 0;
|
||||
bool inword = false;
|
||||
|
||||
for (DocIterator dit = from ; dit != to ; ) {
|
||||
if (!dit.inTexted()) {
|
||||
dit.forwardPos();
|
||||
@ -194,7 +195,9 @@ int countWords(DocIterator const & from, DocIterator const & to)
|
||||
pos_type const pos = dit.pos();
|
||||
|
||||
// Copied and adapted from isWordSeparator() in Paragraph
|
||||
if (pos != dit.lastpos() && !par.isDeleted(pos)) {
|
||||
if (pos == dit.lastpos()) {
|
||||
inword = false;
|
||||
} else if (!par.isDeleted(pos)) {
|
||||
Inset const * ins = par.getInset(pos);
|
||||
if (ins && !ins->producesOutput()) {
|
||||
//skip this inset
|
||||
|
Loading…
Reference in New Issue
Block a user