Commit c77b2262 authored by keyongyu's avatar keyongyu

2.3.0.4

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