Compare commits

..

No commits in common. "90fc77b258bf1d3f06a0d926631f427a11781d32" and "22095404e01ac151b13ce3be35499467d53b6f74" have entirely different histories.

7 changed files with 12 additions and 27 deletions

1
.gitignore vendored
View File

@ -3,7 +3,6 @@ bin
packages packages
TestConsoleApp TestConsoleApp
.vs .vs
obj
**/obj/Debug/** **/obj/Debug/**
**/obj/Release/** **/obj/Release/**
**/obj/Test/** **/obj/Test/**

View File

@ -25,11 +25,11 @@ namespace AIProofread
/// <summary> /// <summary>
/// 网页访问地址 /// 网页访问地址
/// </summary> /// </summary>
public static string WEB_PATH = "http://gm2-plugin.zverse.group/"; //pre-gm-plugin.gachafun.com localhost:5173 gm2-plugin.zverse.group public static string WEB_PATH = "http://gm2-plugin.zverse.group/"; //pre-gm-plugin.gachafun.com 192.168.0.231:5137 192.168.10.100:5173 gm2-plugin.zverse.group
public static bool RUN_IN_DEBUG = true; public static bool RUN_IN_DEBUG = true;
public static AppEnvironment APP_ENV = AppEnvironment.Dev; public static AppEnvironment APP_ENV = AppEnvironment.Dev;
#else #else
public static string WEB_PATH = "https://pre-gm-plugin.gachafun.com/"; // gm-plugin.gachafun.com public static string WEB_PATH = "https://pre-gm-plugin.gachafun.com/";
public static bool RUN_IN_DEBUG = false; public static bool RUN_IN_DEBUG = false;
public static AppEnvironment APP_ENV = AppEnvironment.Prod; public static AppEnvironment APP_ENV = AppEnvironment.Prod;
#endif #endif

View File

@ -841,13 +841,7 @@ namespace AIProofread.Model
public void Save() public void Save()
{ {
try CurrentDocument.Save();
{
CurrentDocument.Save();
}catch (Exception ex)
{
Logger.Log(ex);
}
} }
public void FocusToPanel() public void FocusToPanel()
{ {

View File

@ -67,11 +67,10 @@ namespace AIProofread.Model
// 单纯删除空格 // 单纯删除空格
if (it.Tag == "d" && it.Origin.Trim().Length == 0) continue; if (it.Tag == "d" && it.Origin.Trim().Length == 0) continue;
var range = item.Value.mark.Range.Duplicate; var range = item.Value.mark.Range;
range.End = item.Value.mark.Start;
// 获取书签在文档的页码数 // 获取书签在文档的页码数
var pageNumber = range.get_Information(WdInformation.wdActiveEndPageNumber); // wdActiveEndPageNumber var pageNumber = range.get_Information(WdInformation.wdActiveEndPageNumber);
// 获取书签在当前页面的行数 // 获取书签在当前页面的行数
var lineNumber = range.get_Information(WdInformation.wdFirstCharacterLineNumber); var lineNumber = range.get_Information(WdInformation.wdFirstCharacterLineNumber);
list.Add(new ExportDataItem(it, pageNumber, lineNumber,GetSentence(item.Value))); list.Add(new ExportDataItem(it, pageNumber, lineNumber,GetSentence(item.Value)));

View File

@ -144,7 +144,7 @@ namespace AIProofread
this.menuSencenDect.Items.Add(this.btnDetectionAll); this.menuSencenDect.Items.Add(this.btnDetectionAll);
this.menuSencenDect.Items.Add(this.btnDetectionParagraph); this.menuSencenDect.Items.Add(this.btnDetectionParagraph);
this.menuSencenDect.Items.Add(this.btnDetectionHistory); this.menuSencenDect.Items.Add(this.btnDetectionHistory);
this.menuSencenDect.Label = "常识性检测\r\n"; this.menuSencenDect.Label = "校对助手\r\n";
this.menuSencenDect.Name = "menuSencenDect"; this.menuSencenDect.Name = "menuSencenDect";
this.menuSencenDect.ShowImage = true; this.menuSencenDect.ShowImage = true;
// //

View File

@ -519,8 +519,7 @@ namespace AIProofread
//Globals.ThisAddIn.Application. //Globals.ThisAddIn.Application.
var app = Globals.ThisAddIn.Application; var app = Globals.ThisAddIn.Application;
var selection = app.Selection; var selection = app.Selection;
var range = selection.Range.Duplicate; var range = selection.Range;
range.End = selection.Start;
// 获取所在页 // 获取所在页
var pageNumber = GetIndexPageNumber(range); var pageNumber = GetIndexPageNumber(range);
// 获取所在行 // 获取所在行
@ -602,10 +601,10 @@ namespace AIProofread
btnDetectionAll.Enabled = r.Start == r.End; btnDetectionAll.Enabled = r.Start == r.End;
} }
public void SetDetectionBtnStatus(bool allStatus,bool rangeStatus) public void SetDetectionBtnStatus(bool status)
{ {
btnDetectionAll.Enabled = allStatus; btnDetectionAll.Enabled = status;
btnDetectionParagraph.Enabled = rangeStatus; btnDetectionParagraph.Enabled = status;
} }
} }
} }

View File

@ -64,7 +64,7 @@ namespace AIProofread.core
this.checkingKey = checkingKey; this.checkingKey = checkingKey;
this.checkingSummary = checkingSummary; this.checkingSummary = checkingSummary;
this.checkingLocation = checkingLocation; this.checkingLocation = checkingLocation;
Globals.ThisAddIn.ribbon.SetDetectionBtnStatus(false,false); Globals.ThisAddIn.ribbon.SetDetectionBtnStatus(false);
} }
else else
{ {
@ -72,8 +72,7 @@ namespace AIProofread.core
this.checkingKey = null; this.checkingKey = null;
this.checkingSummary = null; this.checkingSummary = null;
this.checkingLocation = null; this.checkingLocation = null;
var enableAll = string.IsNullOrEmpty(checkingSummary); Globals.ThisAddIn.ribbon.SetDetectionBtnStatus(true);
Globals.ThisAddIn.ribbon.SetDetectionBtnStatus(enableAll,!enableAll);
} }
} }
@ -99,11 +98,6 @@ namespace AIProofread.core
public void Close() public void Close()
{ {
if (isChecking)
{
Globals.ThisAddIn.formCommonsenseDetection.Hide();
return;
}
Globals.ThisAddIn.HideDetection(); Globals.ThisAddIn.HideDetection();
} }
} }