Commit c77b2262 authored by keyongyu's avatar keyongyu

2.3.0.4

parent b496a883
...@@ -6,15 +6,16 @@ namespace DataEditorX.Common ...@@ -6,15 +6,16 @@ namespace DataEditorX.Common
{ {
public class StrUtil public class StrUtil
{ {
public static string AutoEnter(string str, int lineNum, string re) public static string AutoEnter(string str, int lineNum, char re)
{ {
if (str == null || str.Length == 0 || re == null || re.Length == 0) if (str == null || str.Length == 0 || re == null)
return str; return str;
str = str.Replace("\r\n", "\n");
char[] ch = str.ToCharArray(); char[] ch = str.ToCharArray();
int count = ch.Length; int count = ch.Length;
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
int i = 0; int i = 0;
foreach (char c in ch) foreach (char c in ch)
{ {
...@@ -25,8 +26,15 @@ public static string AutoEnter(string str, int lineNum, string re) ...@@ -25,8 +26,15 @@ public static string AutoEnter(string str, int lineNum, string re)
i += 1; i += 1;
sb.Append(c); sb.Append(c);
if (c == '\n' || c == '\r') if (c == '\n' || c == '\r')
{
sb.Append(re);
i = 0; i = 0;
if (i >= lineNum) }
else if(c == re)
{
i = 0;
}
else if (i >= lineNum)
{ {
sb.Append(re); sb.Append(re);
i = 0; i = 0;
......
...@@ -1548,7 +1548,7 @@ private void menuitem_saveasenter_Click(object sender, EventArgs e) ...@@ -1548,7 +1548,7 @@ private void menuitem_saveasenter_Click(object sender, EventArgs e)
int len = MyConfig.readInteger(MyConfig.TAG_AUTO_LEN, 30); int len = MyConfig.readInteger(MyConfig.TAG_AUTO_LEN, 30);
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
cards[i].desc = StrUtil.AutoEnter(cards[i].desc, len, " "); cards[i].desc = StrUtil.AutoEnter(cards[i].desc, len, ' ');
} }
DataBase.CopyDB(dlg.FileName, false, cards); DataBase.CopyDB(dlg.FileName, false, cards);
MyMsg.Show(LMSG.CopyCardsToDBIsOK); MyMsg.Show(LMSG.CopyCardsToDBIsOK);
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
System.Configuration.ConfigurationManager.AppSettings[key] System.Configuration.ConfigurationManager.AppSettings[key]
--> -->
<!-- auto enter length --> <!-- auto enter length -->
<add key="autolength" value="32" /> <add key="autolength" value="30" />
<!-- MSE language data/mse_xxx.txt --> <!-- MSE language data/mse_xxx.txt -->
<add key="mse" value="Chinese-Simplified" /> <add key="mse" value="Chinese-Simplified" />
<!-- Language data/cardinfo_xxxx.txt data/language_xxx.txt --> <!-- Language data/cardinfo_xxxx.txt data/language_xxx.txt -->
......
No preview for this file type
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
System.Configuration.ConfigurationManager.AppSettings[key] System.Configuration.ConfigurationManager.AppSettings[key]
--> -->
<!-- auto enter length --> <!-- auto enter length -->
<add key="autolength" value="32" /> <add key="autolength" value="30" />
<!-- MSE language data/mse_xxx.txt --> <!-- MSE language data/mse_xxx.txt -->
<add key="mse" value="Chinese-Simplified" /> <add key="mse" value="Chinese-Simplified" />
<!-- Language data/cardinfo_xxxx.txt data/language_xxx.txt --> <!-- Language data/cardinfo_xxxx.txt data/language_xxx.txt -->
......
No preview for this file type
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