Geändert
- 'spacePos' korrigiert: Kann nicht mehr kleiner als 0 werden. - Zeile kann jetzt auch bei '\' getrennt werden und nicht nur bei ' '.
This commit is contained in:
parent
58b6ef248e
commit
51efb5f7ac
Binary file not shown.
@ -74,12 +74,12 @@ namespace Eugen.ESystem
|
|||||||
|
|
||||||
#region DLL-Info
|
#region DLL-Info
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Contains the name of the program file
|
/// Contains the name of the dll file
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string DllName { set; get; }
|
public static string DllName { set; get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Contains the version of the program file
|
/// Contains the version of the dll file
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string DllVersion { set; get; }
|
public static string DllVersion { set; get; }
|
||||||
|
|
||||||
@ -136,7 +136,7 @@ namespace Eugen.ESystem
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (character == " ")
|
if (character == " " || character == "\\")
|
||||||
{
|
{
|
||||||
spacePos = pos + 1;
|
spacePos = pos + 1;
|
||||||
}
|
}
|
||||||
@ -144,10 +144,20 @@ namespace Eugen.ESystem
|
|||||||
pos++;
|
pos++;
|
||||||
}
|
}
|
||||||
|
|
||||||
temp = text.Remove(spacePos - 1);
|
if (spacePos - 1 > 0)
|
||||||
|
{
|
||||||
|
//temp = text.Remove(spacePos - 1);
|
||||||
|
temp = text.Remove(spacePos);
|
||||||
|
if (temp.EndsWith(" "))
|
||||||
|
{
|
||||||
|
temp = temp.Remove(spacePos - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//temp = text.Remove(spacePos - 1);
|
||||||
if (temp.EndsWith("\n") || temp.EndsWith("\r"))
|
if (temp.EndsWith("\n") || temp.EndsWith("\r"))
|
||||||
{
|
{
|
||||||
temp = temp.Remove(temp.Length - 1);// Ein schon enthaltenes '\n' oder '\r' am Ende de temporären Strings muss entfernt werden
|
temp = temp.Remove(temp.Length - 1);// Ein schon enthaltenes '\n' oder '\r' am Ende des temporären Strings muss entfernt werden
|
||||||
}
|
}
|
||||||
text = text.Remove(0, spacePos);
|
text = text.Remove(0, spacePos);
|
||||||
result = String.Concat(result, temp, "\r\n");
|
result = String.Concat(result, temp, "\r\n");
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
13
Test_FixedLineLength/Form1.Designer.cs
generated
13
Test_FixedLineLength/Form1.Designer.cs
generated
@ -43,7 +43,8 @@ namespace Test_FixedLineLength
|
|||||||
//
|
//
|
||||||
// button1
|
// button1
|
||||||
//
|
//
|
||||||
this.button1.Location = new System.Drawing.Point(12, 373);
|
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
|
this.button1.Location = new System.Drawing.Point(12, 523);
|
||||||
this.button1.Name = "button1";
|
this.button1.Name = "button1";
|
||||||
this.button1.Size = new System.Drawing.Size(776, 23);
|
this.button1.Size = new System.Drawing.Size(776, 23);
|
||||||
this.button1.TabIndex = 0;
|
this.button1.TabIndex = 0;
|
||||||
@ -55,7 +56,7 @@ namespace Test_FixedLineLength
|
|||||||
//
|
//
|
||||||
this.label1.Location = new System.Drawing.Point(13, 13);
|
this.label1.Location = new System.Drawing.Point(13, 13);
|
||||||
this.label1.Name = "label1";
|
this.label1.Name = "label1";
|
||||||
this.label1.Size = new System.Drawing.Size(775, 77);
|
this.label1.Size = new System.Drawing.Size(775, 90);
|
||||||
this.label1.TabIndex = 1;
|
this.label1.TabIndex = 1;
|
||||||
this.label1.Text = resources.GetString("label1.Text");
|
this.label1.Text = resources.GetString("label1.Text");
|
||||||
//
|
//
|
||||||
@ -70,8 +71,9 @@ namespace Test_FixedLineLength
|
|||||||
//
|
//
|
||||||
// groupBoxProgramInfo
|
// groupBoxProgramInfo
|
||||||
//
|
//
|
||||||
|
this.groupBoxProgramInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
this.groupBoxProgramInfo.Controls.Add(this.labelProgramInfo);
|
this.groupBoxProgramInfo.Controls.Add(this.labelProgramInfo);
|
||||||
this.groupBoxProgramInfo.Location = new System.Drawing.Point(12, 402);
|
this.groupBoxProgramInfo.Location = new System.Drawing.Point(12, 552);
|
||||||
this.groupBoxProgramInfo.Name = "groupBoxProgramInfo";
|
this.groupBoxProgramInfo.Name = "groupBoxProgramInfo";
|
||||||
this.groupBoxProgramInfo.Size = new System.Drawing.Size(385, 66);
|
this.groupBoxProgramInfo.Size = new System.Drawing.Size(385, 66);
|
||||||
this.groupBoxProgramInfo.TabIndex = 9;
|
this.groupBoxProgramInfo.TabIndex = 9;
|
||||||
@ -90,8 +92,9 @@ namespace Test_FixedLineLength
|
|||||||
//
|
//
|
||||||
// groupBoxDLLInfo
|
// groupBoxDLLInfo
|
||||||
//
|
//
|
||||||
|
this.groupBoxDLLInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
this.groupBoxDLLInfo.Controls.Add(this.labelDLLInfo);
|
this.groupBoxDLLInfo.Controls.Add(this.labelDLLInfo);
|
||||||
this.groupBoxDLLInfo.Location = new System.Drawing.Point(403, 402);
|
this.groupBoxDLLInfo.Location = new System.Drawing.Point(403, 552);
|
||||||
this.groupBoxDLLInfo.Name = "groupBoxDLLInfo";
|
this.groupBoxDLLInfo.Name = "groupBoxDLLInfo";
|
||||||
this.groupBoxDLLInfo.Size = new System.Drawing.Size(385, 66);
|
this.groupBoxDLLInfo.Size = new System.Drawing.Size(385, 66);
|
||||||
this.groupBoxDLLInfo.TabIndex = 10;
|
this.groupBoxDLLInfo.TabIndex = 10;
|
||||||
@ -112,7 +115,7 @@ namespace Test_FixedLineLength
|
|||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(800, 480);
|
this.ClientSize = new System.Drawing.Size(800, 630);
|
||||||
this.Controls.Add(this.groupBoxProgramInfo);
|
this.Controls.Add(this.groupBoxProgramInfo);
|
||||||
this.Controls.Add(this.groupBoxDLLInfo);
|
this.Controls.Add(this.groupBoxDLLInfo);
|
||||||
this.Controls.Add(this.labelResult);
|
this.Controls.Add(this.labelResult);
|
||||||
|
|||||||
@ -122,7 +122,7 @@ namespace Test_FixedLineLength
|
|||||||
|
|
||||||
private void button1_Click(object sender, EventArgs e)
|
private void button1_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
string text = "Das ist ein Text, der immer nach 25 Zeichen getrennt werden soll, aber nur dann wenn das Zeichen ein Leerzeichen ist. Ist das 25. Zeichen kein Leerzeichen, dann beim letzten Leerzeichen vor der 25. Stelle trennen. Dabei werden beim Trennen keine Typografischen Regeln beachtet.\nIst im Text ein Zeilenvorschub, dann wird dieser erkannt und auch im formatierten Text verwendet.";
|
string text = "Das ist ein Text, der immer nach 25 Zeichen getrennt werden soll, aber nur dann wenn das Zeichen ein Leerzeichen ist. Ist das 25. Zeichen kein Leerzeichen, dann beim letzten Leerzeichen vor der 25. Stelle trennen. Dabei werden beim Trennen keine Typografischen Regeln beachtet.\r\nIst im Text ein Zeilenvorschub, dann wird dieser erkannt und auch im formatierten Text verwendet.\r\nEs sollten auch \\ erkannt werden, damit lange Verzeichnisnamen wie z.B. C:\\das\\ist\\ein\\sehr\\sehr\\sehr\\sehr\\sehr\\langer\\Pfad\\den\\wir\\hier\\haben, getrennt werden können.";
|
||||||
int lineLength = 25;
|
int lineLength = 25;
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
|
|||||||
@ -120,6 +120,6 @@
|
|||||||
<data name="label1.Text" xml:space="preserve">
|
<data name="label1.Text" xml:space="preserve">
|
||||||
<value>Ursprünglicher Text:
|
<value>Ursprünglicher Text:
|
||||||
|
|
||||||
Das ist ein Text, der immer nach 25 Zeichen getrennt werden soll, aber nur dann wenn das Zeichen ein Leerzeichen ist. Ist das 25. Zeichen kein Leerzeichen, dann beim letzten Leerzeichen vor der 25. Stelle trennen. Dabei werden beim Trennen keine Typografischen Regeln beachtet.\nIst im Text ein Zeilenvorschub, dann wird dieser erkannt und auch im formatierten Text verwendet.</value>
|
Das ist ein Text, der immer nach 25 Zeichen getrennt werden soll, aber nur dann wenn das Zeichen ein Leerzeichen ist. Ist das 25. Zeichen kein Leerzeichen, dann beim letzten Leerzeichen vor der 25. Stelle trennen. Dabei werden beim Trennen keine Typografischen Regeln beachtet. Ist im Text ein Zeilenvorschub, dann wird dieser erkannt und auch im formatierten Text verwendet. Es sollten auch \ erkannt werden, damit lange Verzeichnisnamen wie z.B. C:\das\ist\ein\sehr\sehr\sehr\sehr\sehr\langer\Pfad\den\wir\hier\haben, getrennt werden können.</value>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@ -33,6 +33,9 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Reference Include="heffixll">
|
||||||
|
<HintPath>..\FixedLineLength\bin\Debug\heffixll.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
@ -79,11 +82,5 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="App.config" />
|
<None Include="App.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\FixedLineLength\FixedLineLength.csproj">
|
|
||||||
<Project>{17b0c08e-d3d2-4ff9-a76d-2c602bf26834}</Project>
|
|
||||||
<Name>FixedLineLength</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -16,7 +16,6 @@ H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\Test_F
|
|||||||
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\Test_FixedLineLength\bin\Debug\Test_FixedLineLength.pdb
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\Test_FixedLineLength\bin\Debug\Test_FixedLineLength.pdb
|
||||||
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\Test_FixedLineLength\bin\Debug\heffixll.dll
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\Test_FixedLineLength\bin\Debug\heffixll.dll
|
||||||
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\Test_FixedLineLength\bin\Debug\heffixll.pdb
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\Test_FixedLineLength\bin\Debug\heffixll.pdb
|
||||||
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\Test_FixedLineLength\obj\Debug\Test_FixedLineLength.csprojAssemblyReference.cache
|
|
||||||
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\Test_FixedLineLength\obj\Debug\Test_FixedLineLength.Form1.resources
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\Test_FixedLineLength\obj\Debug\Test_FixedLineLength.Form1.resources
|
||||||
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\Test_FixedLineLength\obj\Debug\Test_FixedLineLength.Properties.Resources.resources
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\Test_FixedLineLength\obj\Debug\Test_FixedLineLength.Properties.Resources.resources
|
||||||
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\Test_FixedLineLength\obj\Debug\Test_FixedLineLength.csproj.GenerateResource.cache
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\Test_FixedLineLength\obj\Debug\Test_FixedLineLength.csproj.GenerateResource.cache
|
||||||
@ -24,3 +23,4 @@ H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\Test_F
|
|||||||
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\Test_FixedLineLength\obj\Debug\Test_FixedLineLength.csproj.CopyComplete
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\Test_FixedLineLength\obj\Debug\Test_FixedLineLength.csproj.CopyComplete
|
||||||
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\Test_FixedLineLength\obj\Debug\Test_FixedLineLength.exe
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\Test_FixedLineLength\obj\Debug\Test_FixedLineLength.exe
|
||||||
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\Test_FixedLineLength\obj\Debug\Test_FixedLineLength.pdb
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\Test_FixedLineLength\obj\Debug\Test_FixedLineLength.pdb
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\Test_FixedLineLength\obj\Debug\Test_FixedLineLength.csproj.AssemblyReference.cache
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user