summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacobo Aragunde Pérez <jaragunde@igalia.com>2014-06-19 11:27:04 +0200
committerCaolán McNamara <caolanm@redhat.com>2014-06-25 12:23:19 +0000
commit032a1ebc8082254887745e76e0be5760c73157e4 (patch)
treef43af1c37d7ea8d4ec8c8b48bcd1e9d988c8fafb
parent383135d77867d0f2c05b4c807eb17b099604eaa1 (diff)
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 (cherry picked from commit b846847121a29b8acd9d48ef1a795ea3b9d6d974) Reviewed-on: https://gerrit.libreoffice.org/9899 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/core/txtnode/txtedt.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 8ed3059f7342..dd531b85ddd6 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -47,6 +47,7 @@
#include <ndtxt.hxx>
#include <txtfrm.hxx>
#include <SwGrammarMarkUp.hxx>
+#include <rootfrm.hxx>
#include <txttypes.hxx>
#include <breakit.hxx>
@@ -1292,7 +1293,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
@@ -1374,6 +1375,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 );