Beispiel #1
0
        public bool NextBars(Bars bars, CharDef charDefBuffer)
        {
            int     num;
            uint    num2;
            uint    num3;
            CharDef charDef = charDefBuffer;

            if ((this._acText == null) || (this._acText.Length == 0))
            {
                return(false);
            }
            if (((this._spec.bdStyle & 0x400) != null) && ((this._acText2 == null) || (this._acText2.Length == 0)))
            {
                return(false);
            }
            if (((!this._bInAddOn && ((this._spec.bdStyle & 2) == null)) || ((this._spec.bdStyle2 & 2) == null)) && ((this._cPrevChars > 0) || this._bPrevSpecialChar))
            {
                this._nmPrev += this._spec.bdInterCharExt;
            }
            if (!this._bInAddOn)
            {
                num3 = 4;
                if ((this._cPrevChars == 0) && !this._bPrevSpecialChar)
                {
                    num3 |= 1;
                }
            }
            else
            {
                num3 = 8;
                if ((this._cPrevChars == 0) && !this._bPrevSpecialChar)
                {
                    num3 |= 2;
                }
            }
            if (((this._cPrevChars == 0) && ((!this._bInAddOn && ((this._spec.bdStyle & 0x1000) != null)) || (this._bInAddOn && ((this._spec.bdStyle2 & 0x1000) != null)))) && (this._bPrevSpecialChar && !this._bPrev2ndStartChar))
            {
                if (!this._bInAddOn)
                {
                    charDef = this._spec.CalcCharDef(this._spec.bdCharset, this._spec.bdCharsetSel, this._acText, -5);
                    if (((this._spec.bdStyle & 0x800) != null) && ((this._spec.bdLongBars & 1) != 0))
                    {
                        num3 |= 0x10;
                    }
                }
                else
                {
                    charDef = this._spec.CalcCharDef2(this._spec.bdCharset2, this._spec.bdCharsetSel2, this._acText2, -5);
                }
                this._bPrevSpecialChar  = true;
                this._bPrev2ndStartChar = true;
            }
            else if (((this._cPrevChars == 0) && ((!this._bInAddOn && ((this._spec.bdStyle & 8) != null)) || (this._bInAddOn && ((this._spec.bdStyle2 & 8) != null)))) && !this._bPrevSpecialChar)
            {
                if (!this._bInAddOn)
                {
                    charDef = this._spec.CalcCharDef(this._spec.bdCharset, this._spec.bdCharsetSel, this._acText, -1);
                    if (((this._spec.bdStyle & 0x800) != null) && ((this._spec.bdLongBars & 1) != 0))
                    {
                        num3 |= 0x10;
                    }
                }
                else
                {
                    charDef = this._spec.CalcCharDef2(this._spec.bdCharset2, this._spec.bdCharsetSel2, this._acText2, -1);
                }
                this._bPrevSpecialChar = true;
            }
            else if ((!this._bInAddOn && ((this._spec.bdStyle & 0x20) != null)) && ((this._cPrevChars == this._spec.bdCentralCharInd) && !this._bPrevSpecialChar))
            {
                if (!this._bInAddOn)
                {
                    charDef = this._spec.CalcCharDef(this._spec.bdCharset, this._spec.bdCharsetSel, this._acText, -2);
                    if (((this._spec.bdStyle & 0x800) != null) && ((this._spec.bdLongBars & 4) != 0))
                    {
                        num3 |= 0x10;
                    }
                }
                else
                {
                    charDef = this._spec.CalcCharDef2(this._spec.bdCharset2, this._spec.bdCharsetSel2, this._acText2, -2);
                }
                this._bPrevSpecialChar = true;
            }
            else if ((((!this._bInAddOn && ((this._spec.bdStyle & 0x10) != null)) && (this._cPrevChars == this._acText.Length)) || ((this._bInAddOn && ((this._spec.bdStyle2 & 0x10) != null)) && (this._cPrevChars == this._acText2.Length))) && !this._bPrevSpecialChar)
            {
                if (!this._bInAddOn)
                {
                    charDef = this._spec.CalcCharDef(this._spec.bdCharset, this._spec.bdCharsetSel, this._acText, -3);
                    if (((this._spec.bdStyle & 0x800) != null) && ((this._spec.bdLongBars & 2) != 0))
                    {
                        num3 |= 0x10;
                    }
                }
                else
                {
                    charDef = this._spec.CalcCharDef2(this._spec.bdCharset2, this._spec.bdCharsetSel2, this._acText2, -3);
                }
                this._bPrevSpecialChar = true;
            }
            else if (((!this._bInAddOn && ((this._spec.bdStyle & 0x40) != null)) || (this._bInAddOn && ((this._spec.bdStyle2 & 0x40) != null))) && (!this._bPrevSpecialChar && ((!this._bInAddOn && (this._cPrevChars < this._acText.Length)) || (this._bInAddOn && (this._cPrevChars < this._acText2.Length)))))
            {
                if (!this._bInAddOn)
                {
                    charDef = this._spec.CalcCharDef(this._spec.bdCharset, this._spec.bdCharsetSel, this._acText, -4);
                }
                else
                {
                    charDef = this._spec.CalcCharDef2(this._spec.bdCharset2, this._spec.bdCharsetSel2, this._acText2, -4);
                }
                this._bPrevSpecialChar = true;
            }
            else if (((!this._bInAddOn && (this._cPrevChars < this._acText.Length)) || (this._bInAddOn && (this._cPrevChars < this._acText2.Length))) && ((!this._bInAddOn && ((this._spec.bdStyle & 1) != null)) || (this._bInAddOn && ((this._spec.bdStyle2 & 1) != null))))
            {
                CharDef def2;
                CharDef def3;
                if (!this._bInAddOn)
                {
                    def2 = this._spec.CalcCharDef(this._spec.bdCharset, this._spec.bdCharsetSel, this._acText, this._cPrevChars);
                    def3 = this._spec.CalcCharDef(this._spec.bdCharset, this._spec.bdCharsetSel, this._acText, this._cPrevChars + 1);
                }
                else
                {
                    def2 = this._spec.CalcCharDef2(this._spec.bdCharset, this._spec.bdCharsetSel2, this._acText2, this._cPrevChars);
                    def3 = this._spec.CalcCharDef2(this._spec.bdCharset, this._spec.bdCharsetSel2, this._acText2, this._cPrevChars + 1);
                }
                charDef.SetCharCode(def2.GetCharCode());
                charDef._BCSETNUMSTRIPE(this._spec.bdCharBitNum << 1);
                charDef.SetStripes(0);
                for (num = 0; num < this._spec.bdCharBitNum; num++)
                {
                    num2 = CharDef._BCTURNSTRIPETOSPACE(def3.BCGETSTRIPE(num));
                    charDef._BCSETSTRIPE(num * 2, num2);
                    num2 = def2.BCGETSTRIPE(num);
                    charDef._BCSETSTRIPE((num * 2) + 1, num2);
                }
                this._cPrevChars      += 2;
                this._bPrevSpecialChar = false;
            }
            else
            {
                if ((this._bInAddOn || (this._cPrevChars >= this._acText.Length)) && (!this._bInAddOn || (this._cPrevChars >= this._acText2.Length)))
                {
                    if (!this._bInAddOn && ((this._spec.bdStyle & 0x400) != null))
                    {
                        this._bInAddOn          = true;
                        this._cPrevChars        = 0;
                        this._bPrevSpecialChar  = false;
                        this._bPrev2ndStartChar = false;
                        this._nmPrev           += this._spec.bdCentralMargin * this._spec.bdBarExt[0];
                        return(this.NextBars(bars, charDefBuffer));
                    }
                    num3 = 0;
                    return(false);
                }
                CharDef def4 = null;
                if (this._bInAddOn)
                {
                    for (num = this._cPrevChars; num < this._acText2.Length; num++)
                    {
                        def4 = this._spec.CalcCharDef2(this._spec.bdCharset2, this._spec.bdCharsetSel2, this._acText2, num);
                        if (def4 != null)
                        {
                            break;
                        }
                    }
                }
                else
                {
                    num = this._cPrevChars;
                    while (num < this._acText.Length)
                    {
                        def4 = this._spec.CalcCharDef(this._spec.bdCharset, this._spec.bdCharsetSel, this._acText, num);
                        if (def4 != null)
                        {
                            break;
                        }
                        num++;
                    }
                    if (((this._cPrevChars == 0) && ((this._spec.bdStyle & 0x800) != null)) && ((this._spec.bdLongBars & 8) != 0))
                    {
                        num3 |= 0x10;
                    }
                    else if (((num == (this._acText.Length - 1)) && ((this._spec.bdStyle & 0x800) != null)) && ((this._spec.bdLongBars & 0x10) != 0))
                    {
                        num3 |= 0x10;
                    }
                }
                if (def4 == null)
                {
                    this._cPrevChars = num;
                    return(this.NextBars(bars, charDefBuffer));
                }
                this._cPrevChars = num + 1;
                charDef          = charDefBuffer;
                charDef.CopyFrom(def4);
                charDef._BCSETNUMSTRIPE(this._spec.bdCharBitNum);
                this._bPrevSpecialChar = false;
            }
            int offset = this._nmPrev;
            int width  = 0;

            for (num = 0; num < charDef.BCGETNUMSTRIPE(); num++)
            {
                num2 = charDef.BCGETSTRIPE(num);
                if (CharDef.BCSTRIPEISBAR(num2))
                {
                    if ((this._spec.bdStyle & 0x10000) != null)
                    {
                        width += this._spec.bdBarExt[0];
                    }
                    else
                    {
                        width += this._spec.bdBarExt[CharDef.BCSTRIPEWTHIND(num2)];
                    }
                }
                else if ((this._spec.bdStyle & 0x10000) != null)
                {
                    width += this._spec.bdSpaceExt[0];
                }
                else
                {
                    width += this._spec.bdSpaceExt[CharDef.BCSTRIPEWTHIND(num2)];
                }
            }
            this._nmPrev = offset + width;
            bars.SetAll(charDef, offset, width, num3);
            return(true);
        }