mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-29 13:04:58 +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;
|
int count = 0;
|
||||||
bool inword = false;
|
bool inword = false;
|
||||||
|
|
||||||
for (DocIterator dit = from ; dit != to ; ) {
|
for (DocIterator dit = from ; dit != to ; ) {
|
||||||
if (!dit.inTexted()) {
|
if (!dit.inTexted()) {
|
||||||
dit.forwardPos();
|
dit.forwardPos();
|
||||||
@ -194,7 +195,9 @@ int countWords(DocIterator const & from, DocIterator const & to)
|
|||||||
pos_type const pos = dit.pos();
|
pos_type const pos = dit.pos();
|
||||||
|
|
||||||
// Copied and adapted from isWordSeparator() in Paragraph
|
// 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);
|
Inset const * ins = par.getInset(pos);
|
||||||
if (ins && !ins->producesOutput()) {
|
if (ins && !ins->producesOutput()) {
|
||||||
//skip this inset
|
//skip this inset
|
||||||
|
Loading…
Reference in New Issue
Block a user