Implement code for DontResetIndentOnNewline for BGE
This commit is contained in:
parent
98dc16f69b
commit
f3b7e9138f
@ -481,19 +481,31 @@ namespace Volian.Controls.Library
|
|||||||
|
|
||||||
// this line of code was moved before the find for the indent so that
|
// this line of code was moved before the find for the indent so that
|
||||||
// the window gets resized if the indent changes the height, i.e. more line(s) in window.
|
// the window gets resized if the indent changes the height, i.e. more line(s) in window.
|
||||||
AddEventHandlers();
|
AddEventHandlers();
|
||||||
|
if (MyItemInfo.InList(186722)) Console.WriteLine("here");
|
||||||
while ((indchar = Find(indentToken, indchar, RichTextBoxFinds.None)) >= 0)
|
if ((indchar = Find(indentToken, indchar, RichTextBoxFinds.None)) >= 0)
|
||||||
{
|
{
|
||||||
Point indent = GetPositionFromCharIndex(indchar);
|
int nindents = 0;
|
||||||
SelectionHangingIndent = indent.X;
|
while ((indchar = Find(indentToken, indchar, RichTextBoxFinds.None)) >= 0)
|
||||||
// RHM 02/20/2013
|
{
|
||||||
// The following line attempts to remove the indent character for display purposes.
|
nindents++;
|
||||||
// However, if the indent is followed immediately by an RO or Transition the
|
Point indent = GetPositionFromCharIndex(indchar);
|
||||||
// RichTextBox will not allow the character to be removed this way and the RichTextBox
|
SelectionHangingIndent = indent.X;
|
||||||
// will beep. So, to keep from going in an infintie loop, the value of indchar is incremented.
|
|
||||||
SelectedRtf = SelectedRtf.Replace(@"\'05","");
|
// RHM 02/20/2013
|
||||||
indchar ++;// Don't so the same one twice.
|
// The following line attempts to remove the indent character for display purposes.
|
||||||
|
// However, if the indent is followed immediately by an RO or Transition the
|
||||||
|
// RichTextBox will not allow the character to be removed this way and the RichTextBox
|
||||||
|
// will beep. So, to keep from going in an infintie loop, the value of indchar is incremented.
|
||||||
|
SelectedRtf = SelectedRtf.Replace(@"\'05", "");
|
||||||
|
indchar++;// Don't so the same one twice.
|
||||||
|
}
|
||||||
|
if (MyItemInfo != null && MyItemInfo.ActiveFormat != null
|
||||||
|
&& MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.DontResetIndentOnNewline)
|
||||||
|
{
|
||||||
|
if (nindents == 1) Rtf = Rtf.Replace("\\par\r\n", @"\line ");
|
||||||
|
Rtf = Rtf.Replace(@"\line\pard", @"\line");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
OrigRTF = Rtf;
|
OrigRTF = Rtf;
|
||||||
|
@ -89,6 +89,12 @@ namespace Volian.Print.Library
|
|||||||
}
|
}
|
||||||
public class Rtf2iTextSharp : RtfVisualVisitorBase
|
public class Rtf2iTextSharp : RtfVisualVisitorBase
|
||||||
{
|
{
|
||||||
|
private bool _HasIndent = false;
|
||||||
|
public bool HasIndent
|
||||||
|
{
|
||||||
|
get { return _HasIndent; }
|
||||||
|
set { _HasIndent = value; }
|
||||||
|
}
|
||||||
private static bool _DoingComparison = false;
|
private static bool _DoingComparison = false;
|
||||||
public static bool DoingComparison
|
public static bool DoingComparison
|
||||||
{
|
{
|
||||||
@ -122,12 +128,14 @@ namespace Volian.Print.Library
|
|||||||
switch (visualBreak.BreakKind)
|
switch (visualBreak.BreakKind)
|
||||||
{
|
{
|
||||||
case RtfVisualBreakKind.Line:
|
case RtfVisualBreakKind.Line:
|
||||||
_MyParagraph.Add(Chunk.NEWLINE);
|
Chunk ck = HasIndent ? new Chunk("".PadLeft(200)) : Chunk.NEWLINE;
|
||||||
|
_MyParagraph.Add(ck);
|
||||||
break;
|
break;
|
||||||
case RtfVisualBreakKind.Page:
|
case RtfVisualBreakKind.Page:
|
||||||
break;
|
break;
|
||||||
case RtfVisualBreakKind.Paragraph:
|
case RtfVisualBreakKind.Paragraph:
|
||||||
_MyParagraph.Add(Chunk.NEWLINE);
|
Chunk ck1 = HasIndent ? new Chunk("".PadLeft(200)) : Chunk.NEWLINE;
|
||||||
|
_MyParagraph.Add(ck1);
|
||||||
break;
|
break;
|
||||||
case RtfVisualBreakKind.Section:
|
case RtfVisualBreakKind.Section:
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user