Bug 32773 - LibO thinks comments separate words – which breaks spell check and word count
Summary: LibO thinks comments separate words – which breaks spell check and word count
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.3.0 RC2
Hardware: All All
: medium minor
Assignee: Muhammad Haggag
URL:
Whiteboard:
Keywords:
: 50780 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-01-01 22:42 UTC by splondike
Modified: 2015-12-10 19:01 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of the problem. (8.07 KB, image/png)
2011-01-01 22:42 UTC, splondike
Details

Note You need to log in before you can comment on or make changes to this bug.
Description splondike 2011-01-01 22:42:47 UTC
Created attachment 41561 [details]
Screenshot of the problem.

Positioning a comment within a word causes the spell check to test only the stuff before the caret, meaning words are incorrectly flagged as misspelled. 

For example, the "sen" part of "sen^tence" -^ denotes the position of the caret/comment- will be flagged, but "tence" will not. In the case of "sent^ence", nothing will be flagged (as "sent" is a valid word). The attached screenshot shows this example in action.
Comment 1 Rainer Bielefeld Retired 2011-01-02 00:00:08 UTC
[Reproducible] with "LibreOffice 3.3.0 RC2 - WIN XP German UI  [OOO330m18 (build 3.3.0.2)]".

Th comment splits the word where it is inserted ito 2 parts, please check word count before and after insertion.
I see the same effect in OOo 3.1.1. The corresponding OOo issue is
<http://qa.openoffice.org/issues/show_bug.cgi?id=78149>, fixed for 3.4-

Cédric, what can be done? Cherry picking?
Comment 2 Stefan Knorr (astron) 2012-06-28 02:02:50 UTC
*** Bug 50780 has been marked as a duplicate of this bug. ***
Comment 3 Stefan Knorr (astron) 2012-06-28 02:06:40 UTC
Changing title to better reflect the situation. Also seems to be unassigned, so setting to NEW again.
Comment 4 Muhammad Haggag 2012-07-03 11:26:32 UTC
I cannot reproduce the issue with spell-check. It works fine for me in that regard. Word count is still broken.

When a comment is added, SwTxtNode::InsertHint inserts a dummy character to mark the hint. The character is CH_TXTATR_INWORD (0x2), which breaks word count. It should not be treated as a word breaker by the word counter/breaker.

I'm working on a fix.
Comment 5 Muhammad Haggag 2012-07-30 02:50:12 UTC
This is fixed by Caolán McNamara's change: http://cgit.freedesktop.org/libreoffice/core/commit/?id=b0f170d7df9cff12535d2ecfd146b32b745a8ef8