From 309c766d99cc7efc11fc439d119ba1944f2d710a Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Sun, 1 Sep 2013 13:57:52 -0400 Subject: Separate misspelled ranges when entering a new cell value. And store them at appropriate locations. Change-Id: Iaf38c0cd01e9b3dc9dc98f7ccc1951d572a422e9 --- editeng/source/editeng/editdoc.cxx | 13 +++++++++++++ editeng/source/editeng/editdoc.hxx | 2 ++ editeng/source/editeng/editeng.cxx | 5 +++++ editeng/source/editeng/impedit.hxx | 1 + editeng/source/editeng/impedit4.cxx | 5 +++++ 5 files changed, 26 insertions(+) (limited to 'editeng') diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index 8cd17b787c68..3fefacbccaa5 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -1893,6 +1893,14 @@ public: } }; +struct ClearSpellErrorsHandler : std::unary_function +{ + void operator() (ContentNode& rNode) + { + rNode.DestroyWrongList(); + } +}; + } void EditDoc::ImplDestroyContents() @@ -2215,6 +2223,11 @@ EditPaM EditDoc::Clear() return aPaM; } +void EditDoc::ClearSpellErrors() +{ + std::for_each(maContents.begin(), maContents.end(), ClearSpellErrorsHandler()); +} + void EditDoc::SetModified( bool b ) { bModified = b; diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx index 1a6d1d0fd1fd..b2928a60f5aa 100644 --- a/editeng/source/editeng/editdoc.hxx +++ b/editeng/source/editeng/editdoc.hxx @@ -750,6 +750,8 @@ public: EditDoc( SfxItemPool* pItemPool ); ~EditDoc(); + void ClearSpellErrors(); + bool IsModified() const { return bModified; } void SetModified( bool b ); diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 4e3407145044..e3309d407d1a 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -2327,6 +2327,11 @@ EESpellState EditEngine::HasSpellErrors() return pImpEditEngine->HasSpellErrors(); } +void EditEngine::ClearSpellErrors() +{ + pImpEditEngine->ClearSpellErrors(); +} + void EditEngine::StartSpelling(EditView& rEditView, sal_Bool bMultipleDoc) { DBG_CHKTHIS( EditEngine, 0 ); diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index b62bc0277b97..34075afb389f 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -907,6 +907,7 @@ public: void DoOnlineSpelling( ContentNode* pThisNodeOnly = 0, bool bSpellAtCursorPos = false, bool bInteruptable = true ); EESpellState Spell( EditView* pEditView, sal_Bool bMultipleDoc ); EESpellState HasSpellErrors(); + void ClearSpellErrors(); EESpellState StartThesaurus( EditView* pEditView ); ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSpellAlternatives > diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 99a9101610b8..72bfa8959491 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -2484,6 +2484,11 @@ EESpellState ImpEditEngine::HasSpellErrors() return EE_SPELL_ERRORFOUND; } +void ImpEditEngine::ClearSpellErrors() +{ + aEditDoc.ClearSpellErrors(); +} + EESpellState ImpEditEngine::StartThesaurus( EditView* pEditView ) { EditSelection aCurSel( pEditView->pImpEditView->GetEditSelection() ); -- cgit