Kaydet (Commit) b8468471 authored tarafından Jacobo Aragunde Pérez's avatar Jacobo Aragunde Pérez

fdo#71558: Notify mispelled word to accessibility

This patch modifies the spell checking code to trigger an invalidation
of the accessible paragraph attributes when a mistake is detected, so
the 'text-attributes-changed' event is released.

Notice that 'text-spelling' is not an actual attribute of the text for
LibreOffice, that's why this didn't work in first place.

Finally, notice too that when the user disables the automatic spell
checking, no 'text-attributes-changed' event is released, and when it
is enabled again it will only release 'text-attributes-changed' events
in case some of the newly typed text is misspelled.

Change-Id: Ie792f040d84010cadcd41486d948a5e29421228f
üst 0b350e84
......@@ -47,6 +47,7 @@
#include <ndtxt.hxx>
#include <txtfrm.hxx>
#include <SwGrammarMarkUp.hxx>
#include <rootfrm.hxx>
#include <txttypes.hxx>
#include <breakit.hxx>
......@@ -1293,7 +1294,7 @@ SwRect SwTxtFrm::_AutoSpell( const SwCntntNode* pActNode, const SwViewOption& rV
bool bFresh = nBegin < nEnd;
if( nBegin < nEnd )
if( bFresh )
{
//! register listener to LinguServiceEvents now in order to get
//! notified about relevant changes in the future
......@@ -1375,6 +1376,11 @@ SwRect SwTxtFrm::_AutoSpell( const SwCntntNode* pActNode, const SwViewOption& rV
if( nChgStart < nChgEnd )
{
aRect = lcl_CalculateRepaintRect( *this, nChgStart, nChgEnd );
// fdo#71558 notify mispelled word to accessibility
SwViewShell* pViewSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0;
if( pViewSh )
pViewSh->InvalidateAccessibleParaAttrs( *this );
}
pNode->GetWrong()->SetInvalid( nInvStart, nInvEnd );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment