Пример #1
0
 private void method_9(string A_0, StyleIdentifier A_1)
 {
     if (this.class422_0.method_15().Styles.InnerList.Contains(A_1))
     {
         this.class400_0.method_40(A_0, Class922.smethod_77((Style)this.class422_0.method_15().Styles[(int)A_1]));
     }
 }
Пример #2
0
    private Style method_14(int A_0)
    {
        Style           style      = null;
        int             num        = this.binaryReader_0.ReadUInt16();
        StyleIdentifier identifier = ((StyleIdentifier)num) & StyleIdentifier.Nil;
        bool            flag       = (num & 0x2000) != 0;
        bool            flag2      = (num & 0x4000) != 0;

        num = this.binaryReader_0.ReadUInt16();
        StyleType type = ((StyleType)num) & ((StyleType)15);

        if (type <= StyleType.ListStyle)
        {
            style             = Style.smethod_2(type, A_0, identifier, null, this.styleCollection_0.Document);
            style.BasedOnIstd = (num >> 4) & 0xfff;
            style.bool_7      = flag;
            style.bool_8      = flag2;
            num            = this.binaryReader_0.ReadUInt16();
            style.NextIstd = (num >> 4) & 0xfff;
            this.binaryReader_0.ReadUInt16();
            num = this.binaryReader_0.ReadUInt16();
            style.AutomaticallyUpdate = (num & 1) != 0;
            style.Hidden          = (num & 2) != 0;
            style.LidsSet         = (num & 12) != 0;
            style.PersonalCompose = (num & 0x10) != 0;
            style.PersonalReply   = (num & 0x20) != 0;
            style.Personal        = (num & 0x40) != 0;
            style.IsSemiHidden    = (num & 0x100) != 0;
            style.Locked          = (num & 0x200) != 0;
            style.bool_9          = (num & 0x400) != 0;
            style.UnhideWhenUsed  = (num & 0x800) != 0;
            style.QuickFormat     = (num & 0x1000) != 0;
        }
        return(style);
    }
Пример #3
0
    internal static int smethod_3(StyleIdentifier A_0)
    {
        int num = 0xfff;

        if (hashtable_0.Contains(A_0))
        {
            num = (int)hashtable_0[A_0];
        }
        return(num);
    }
Пример #4
0
    internal static void smethod_2(Style A_0, StyleIdentifier A_1, Style A_2, bool A_3)
    {
        A_0.method_15(A_1, A_3);
        int num = smethod_3(A_1);

        if (num != 0xfff)
        {
            A_0.method_13(num, A_3);
        }
        else if (A_2 != null)
        {
            A_0.method_13(A_2.StyleDocId, A_3);
        }
    }
Пример #5
0
    internal Class66(StyleIdentifier A_0, bool A_1, bool A_2, bool A_3, int A_4, bool A_5)
    {
        int num = 4;

        if (A_0 == StyleIdentifier.User)
        {
            throw new ArgumentOutOfRangeException(BookmarkStart.b("天堫圭尯圱紳刵崷吹䠻圽☿⭁⅃㑅", num));
        }
        this.styleIdentifier_0 = A_0;
        this.int_0             = A_4;
        this.bool_0            = A_1;
        this.bool_2            = A_3;
        this.bool_3            = A_5;
        this.bool_1            = A_2;
    }
        /// <summary>
        /// Selects heading paragraphs that must become topic starts.
        /// We can't modify them in this loop, we have to remember them in an array first.
        /// </summary>
        private ArrayList SelectTopicStarts()
        {
            NodeCollection paras           = mDoc.GetChildNodes(NodeType.Paragraph, true);
            ArrayList      topicStartParas = new ArrayList();

            foreach (Paragraph para in paras)
            {
                StyleIdentifier style = para.ParagraphFormat.StyleIdentifier;
                if (style == StyleIdentifier.Heading1)
                {
                    topicStartParas.Add(para);
                }
            }

            return(topicStartParas);
        }
Пример #7
0
 internal void method_24(Style A_0, StyleIdentifier A_1, StyleIdentifier A_2)
 {
     if (A_0.BuiltIn)
     {
         this.class656_1.method_18((int)A_1);
     }
     if (A_2 != StyleIdentifier.User)
     {
         if (this.class656_1.method_8((int)A_2))
         {
             this.class656_1.method_4((int)A_2, A_0);
         }
         else
         {
             this.class656_1.method_5((int)A_2, A_0);
         }
     }
 }
Пример #8
0
        /// <summary>
        /// Inserts section breaks that delimit the topics.
        /// </summary>
        /// <param name="doc">The document where to insert the section breaks.</param>
        private static void InsertTopicSections(Document doc)
        {
            DocumentBuilder builder = new DocumentBuilder(doc);

            NodeCollection paras           = doc.GetChildNodes(NodeType.Paragraph, true, false);
            ArrayList      topicStartParas = new ArrayList();

            foreach (Paragraph para in paras)
            {
                StyleIdentifier style = para.ParagraphFormat.StyleIdentifier;
                if ((style >= StyleIdentifier.Heading1) && (style <= MaxTopicHeading) &&
                    (para.HasChildNodes))
                {
                    // Select heading paragraphs that must become topic starts.
                    // We can't modify them in this loop, we have to remember them in an array first.
                    topicStartParas.Add(para);
                }
                else if ((style > MaxTopicHeading) && (style <= StyleIdentifier.Heading9))
                {
                    // Pull up headings. For example: if Heading 1-4 become topics, then I want Headings 5+
                    // to become Headings 4+. Maybe I want to pull up even higher?
                    para.ParagraphFormat.StyleIdentifier = (StyleIdentifier)((int)style - 1);
                }
            }

            foreach (Paragraph para in topicStartParas)
            {
                Section section = para.ParentSection;

                // Insert section break if the paragraph is not at the beginning of a section already.
                if (para != section.Body.FirstParagraph)
                {
                    builder.MoveTo(para.FirstChild);
                    builder.InsertBreak(BreakType.SectionBreakNewPage);

                    // This is the paragraph that was inserted at the end of the now old section.
                    // We don't really need the extra paragraph, we just needed the section.
                    section.Body.LastParagraph.Remove();
                }
            }
        }
Пример #9
0
    internal static void smethod_0(string A_0, StyleCollection A_1, bool A_2, Style A_3)
    {
        Class567.smethod_19(A_0, BookmarkStart.b("就唳嬵崷", 12));
        Class567.smethod_20(A_1, BookmarkStart.b("䄱䀳伵吷弹伻", 12));
        Class567.smethod_20(A_3, BookmarkStart.b("䄱䀳伵吷弹", 12));
        StyleIdentifier user = A_2 ? StyleIdentifier.User : Class417.smethod_25(A_0);

        if (user != StyleIdentifier.User)
        {
            A_0 = Class417.smethod_27(A_0);
        }
        if (A_1.InnerList.Contains(user))
        {
            user = StyleIdentifier.User;
        }
        if (Class881.smethod_3(user) == 0xfff)
        {
            int num = A_1.method_15();
        }
        A_3.method_14(user);
        A_3.Name = A_0;
    }
Пример #10
0
    private static void smethod_2(Class582 A_0)
    {
        int      num          = 5;
        Class547 latentStyles = A_0.Interface50.imethod_0().Styles.LatentStyles;
        Class394 class3       = A_0.imethod_1();
        bool     flag         = latentStyles.method_2();
        string   str          = "";
        bool     flag2        = latentStyles.method_4();
        bool     flag3        = latentStyles.method_6();
        int      num2         = latentStyles.method_8();
        bool     flag4        = latentStyles.method_10();

        while (class3.method_19())
        {
            string str2 = class3.method_1();
            if (str2 != null)
            {
                if (!(str2 == BookmarkStart.b("䜪䈬䰮娰嘲儴", num)))
                {
                    if (str2 == BookmarkStart.b("䔪䰬䈮吰", num))
                    {
                        str = class3.method_3();
                    }
                }
                else
                {
                    flag = class3.method_63();
                }
            }
        }
        StyleIdentifier identifier = Class417.smethod_25(str);

        if (identifier != StyleIdentifier.User)
        {
            latentStyles.method_14().method_1(new Class66(identifier, flag, flag2, flag3, num2, flag4));
        }
    }
Пример #11
0
        /// <summary>
        /// Parses the bytes to retrieve a StyleSheetDescription
        /// </summary>
        /// <param name="bytes">The bytes</param>
        /// <param name="cbStdBase"></param>
        /// <param name="dataStream">The "Data" stream (optional, can be null)</param>
        public StyleSheetDescription(byte[] bytes, int cbStdBase, VirtualStream dataStream)
        {
            BitArray bits = new BitArray(bytes);

            //parsing the base (fix part)

            if (cbStdBase >= 2)
            {
                //sti
                BitArray stiBits = Utils.BitArrayCopy(bits, 0, 12);
                this.sti = (StyleIdentifier)Utils.BitArrayToUInt32(stiBits);
                //flags
                this.fScratch     = bits[12];
                this.fInvalHeight = bits[13];
                this.fHasUpe      = bits[14];
                this.fMassCopy    = bits[15];
            }
            if (cbStdBase >= 4)
            {
                //stk
                BitArray stkBits = Utils.BitArrayCopy(bits, 16, 4);
                this.stk = (StyleKind)Utils.BitArrayToUInt32(stkBits);
                //istdBase
                BitArray istdBits = Utils.BitArrayCopy(bits, 20, 12);
                this.istdBase = (UInt32)Utils.BitArrayToUInt32(istdBits);
            }
            if (cbStdBase >= 6)
            {
                //cupx
                BitArray cupxBits = Utils.BitArrayCopy(bits, 32, 4);
                this.cupx = (UInt16)Utils.BitArrayToUInt32(cupxBits);
                //istdNext
                BitArray istdNextBits = Utils.BitArrayCopy(bits, 36, 12);
                this.istdNext = (UInt32)Utils.BitArrayToUInt32(istdNextBits);
            }
            if (cbStdBase >= 8)
            {
                //bchUpe
                BitArray bchBits = Utils.BitArrayCopy(bits, 48, 16);
                this.bchUpe = (UInt16)Utils.BitArrayToUInt32(bchBits);
            }
            if (cbStdBase >= 10)
            {
                //flags
                this.fAutoRedef       = bits[64];
                this.fHidden          = bits[65];
                this.f97LidsSet       = bits[66];
                this.fCopyLang        = bits[67];
                this.fPersonalCompose = bits[68];
                this.fPersonalReply   = bits[69];
                this.fPersonal        = bits[70];
                this.fNoHtmlExport    = bits[71];
                this.fSemiHidden      = bits[72];
                this.fLocked          = bits[73];
                this.fInternalUse     = bits[74];
            }
            if (cbStdBase >= 12)
            {
                //istdLink
                BitArray istdLinkBits = Utils.BitArrayCopy(bits, 80, 12);
                this.istdLink = (UInt32)Utils.BitArrayToUInt32(istdLinkBits);
                //fHasOriginalStyle
                this.fHasOriginalStyle = bits[92];
            }
            if (cbStdBase >= 16)
            {
                //rsid
                BitArray rsidBits = Utils.BitArrayCopy(bits, 96, 32);
                this.rsid = Utils.BitArrayToUInt32(rsidBits);
            }

            //parsing the variable part

            //xstz
            byte characterCount = bytes[cbStdBase];

            //characters are zero-terminated, so 1 char has 2 bytes:
            byte[] name = new byte[characterCount * 2];
            Array.Copy(bytes, cbStdBase + 2, name, 0, name.Length);
            //remove zero-termination
            this.xstzName = Encoding.Unicode.GetString(name);

            //parse the UPX structs
            int upxOffset = cbStdBase + 1 + (characterCount * 2) + 2;

            for (int i = 0; i < this.cupx; i++)
            {
                //find the next even byte border
                if (upxOffset % 2 != 0)
                {
                    upxOffset++;
                }

                //get the count of bytes for UPX
                UInt16 cbUPX = System.BitConverter.ToUInt16(bytes, upxOffset);

                if (cbUPX > 0)
                {
                    //copy the bytes
                    byte[] upxBytes = new byte[cbUPX];
                    Array.Copy(bytes, upxOffset + 2, upxBytes, 0, upxBytes.Length);

                    if (this.stk == StyleKind.table)
                    {
                        //first upx is TAPX; second PAPX, third CHPX
                        switch (i)
                        {
                        case 0:
                            this.tapx = new TablePropertyExceptions(upxBytes);
                            break;

                        case 1:
                            this.papx = new ParagraphPropertyExceptions(upxBytes, dataStream);
                            break;

                        case 2:
                            this.chpx = new CharacterPropertyExceptions(upxBytes);
                            break;
                        }
                    }
                    else if (this.stk == StyleKind.paragraph)
                    {
                        //first upx is PAPX, second CHPX
                        switch (i)
                        {
                        case 0:
                            this.papx = new ParagraphPropertyExceptions(upxBytes, dataStream);
                            break;

                        case 1:
                            this.chpx = new CharacterPropertyExceptions(upxBytes);
                            break;
                        }
                    }
                    else if (this.stk == StyleKind.list)
                    {
                        //list styles have only one PAPX
                        switch (i)
                        {
                        case 0: this.papx = new ParagraphPropertyExceptions(upxBytes, dataStream); break;
                        }
                    }
                    else if (this.stk == StyleKind.character)
                    {
                        //character styles have only one CHPX
                        switch (i)
                        {
                        case 0: this.chpx = new CharacterPropertyExceptions(upxBytes); break;
                        }
                    }
                }

                //increase the offset for the next run
                upxOffset += (2 + cbUPX);
            }
        }
Пример #12
0
        /// <summary>
        /// Get a document builder to insert a clause numbered by an autonum legal field
        /// </summary>
        private void InsertNumberedClause(DocumentBuilder builder, string heading, string contents, StyleIdentifier headingStyle)
        {
            // This legal field will automatically number our clauses, taking heading style level into account
            builder.InsertField(FieldType.FieldAutoNumLegal, true);
            builder.CurrentParagraph.ParagraphFormat.StyleIdentifier = headingStyle;
            builder.Writeln(heading);

            // This text will belong to the auto num legal field above it
            // It will collapse when the arrow next to the corresponding autonum legal field is clicked in MS Word
            builder.CurrentParagraph.ParagraphFormat.StyleIdentifier = StyleIdentifier.BodyText;
            builder.Writeln(contents);
        }
Пример #13
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="name"></param>
 /// <param name="style"></param>
 /// <param name="pageNumber"></param>
 public NavigationPaneItem(string name, StyleIdentifier style, int pageNumber)
 {
     this.name       = name;
     this.style      = style;
     this.pageNumber = pageNumber;
 }
Пример #14
0
 internal Class66 method_3(StyleIdentifier A_0)
 {
     return((Class66)this.class656_0.method_3((int)A_0));
 }
Пример #15
0
 private void method_18(StyleIdentifier A_0, int A_1, bool A_2, bool A_3, bool A_4)
 {
     this.class776_0.method_1(new Class66(A_0, false, A_4, A_2, A_1, A_3));
 }