Esempio n. 1
0
 protected override bool ContinueText(uint beginTextPosition, uint endTextPosition)
 {
     if (beginTextPosition != endTextPosition)
     {
         TextRun textRun = base.FormatStore.GetTextRun(beginTextPosition);
         do
         {
             int         num  = textRun.EffectiveLength;
             TextRunType type = textRun.Type;
             if (type <= TextRunType.NbSp)
             {
                 if (type != TextRunType.NonSpace)
                 {
                     if (type == TextRunType.NbSp)
                     {
                         this.lineLength += num;
                         while (num-- != 0)
                         {
                             this.output.Write(' ');
                         }
                     }
                 }
                 else
                 {
                     this.lineLength += num;
                     int num2 = 0;
                     do
                     {
                         char[] buffer;
                         int    offset;
                         int    num3;
                         textRun.GetChunk(num2, out buffer, out offset, out num3);
                         this.output.Write(buffer, offset, num3, this);
                         num2 += num3;
                     }while (num2 != num);
                 }
             }
             else if (type != TextRunType.Space)
             {
                 if (type != TextRunType.Tabulation)
                 {
                     if (type == TextRunType.NewLine)
                     {
                         if (this.insideNofill != 0)
                         {
                             while (num-- != 0)
                             {
                                 this.output.Write("\r\n");
                             }
                         }
                         else
                         {
                             if (this.lineLength != 0)
                             {
                                 this.output.Write("\r\n");
                             }
                             while (num-- != 0)
                             {
                                 this.output.Write("\r\n");
                             }
                         }
                         this.lineLength = 0;
                         this.blockEmpty = true;
                     }
                 }
                 else
                 {
                     while (num-- != 0)
                     {
                         this.output.Write('\t');
                         this.lineLength = (this.lineLength + 8) / 8 * 8;
                     }
                 }
             }
             else
             {
                 if (this.lineLength + num > 80 && this.lineLength != 0 && this.insideNofill == 0)
                 {
                     this.output.Write("\r\n");
                     num--;
                     this.lineLength = 0;
                 }
                 if (num != 0)
                 {
                     this.lineLength += num;
                     while (num-- != 0)
                     {
                         this.output.Write(' ');
                     }
                 }
             }
             textRun.MoveNext();
         }while (textRun.Position < endTextPosition);
     }
     return(true);
 }
Esempio n. 2
0
 public void ConvertShort(TextRunType type, int newEffectiveLength)
 {
     this.text.ConvertShortRun(this.position, type, newEffectiveLength);
 }