Index: xword/XWord/AddinActions.cs
===================================================================
--- xword/XWord/AddinActions.cs (revision 20155)
+++ xword/XWord/AddinActions.cs (working copy)
@@ -313,10 +313,28 @@
/// The wiki syntax of the saved page.
private void SavePage(String pageName, ref String pageContent, String syntax)
{
+ //Save user settings for grammar and spelling checking
+ bool CheckGrammarAsYouType = addin.Application.Options.CheckGrammarAsYouType;
+ bool CheckGrammarWithSpelling = addin.Application.Options.CheckGrammarWithSpelling;
+ bool CheckSpellingAsYouType = addin.Application.Options.CheckSpellingAsYouType;
+ bool ContextualSpeller = addin.Application.Options.ContextualSpeller;
+
if (!this.Client.LoggedIn)
{
Client.Login(addin.username, addin.password);
}
+ if (addin.ActiveDocumentContentRange.GrammaticalErrors.Count>0
+ ||
+ addin.ActiveDocumentContentRange.SpellingErrors.Count>0
+ )
+ {
+ //Disable grammar and spelling check
+ addin.Application.Options.CheckGrammarAsYouType = false;
+ addin.Application.Options.CheckGrammarWithSpelling = false;
+ addin.Application.Options.CheckSpellingAsYouType = false;
+ addin.Application.Options.ContextualSpeller = false;
+ }
+
if (!Client.SavePageHTML(pageName, pageContent, syntax))
{
Log.Error("Failed to save page " + pageName + "on server " + addin.serverURL);
@@ -344,6 +362,14 @@
}
}
}
+
+ //Put back user setting for grammar and spelling checks
+ addin.Application.Options.CheckGrammarAsYouType = CheckGrammarAsYouType;
+ addin.Application.Options.CheckGrammarWithSpelling = CheckGrammarWithSpelling;
+ addin.Application.Options.CheckSpellingAsYouType = CheckSpellingAsYouType;
+ addin.Application.Options.ContextualSpeller = ContextualSpeller;
+
+
}
///