Exemple #1
0
        // Token: 0x0600349E RID: 13470 RVA: 0x000EA1A0 File Offset: 0x000E83A0
        internal MarkerList GetLastMarkerStyles(MarkerList mlHave, MarkerList mlWant)
        {
            MarkerList markerList = new MarkerList();

            if (mlHave.Count > 0 || mlWant.Count == 0)
            {
                return(markerList);
            }
            bool flag = true;

            for (int i = this.Count - 1; i >= 0; i--)
            {
                DocumentNode documentNode = this.EntryAt(i);
                if (documentNode.Type == DocumentNodeType.dnCell || documentNode.Type == DocumentNodeType.dnTable)
                {
                    break;
                }
                if (documentNode.Type == DocumentNodeType.dnListItem)
                {
                    DocumentNode parentOfType = documentNode.GetParentOfType(DocumentNodeType.dnCell);
                    if (parentOfType != null && !parentOfType.IsPending)
                    {
                        break;
                    }
                    DocumentNode parentOfType2 = documentNode.GetParentOfType(DocumentNodeType.dnShape);
                    if (parentOfType2 == null || parentOfType2.IsPending)
                    {
                        for (DocumentNode parent = documentNode.Parent; parent != null; parent = parent.Parent)
                        {
                            if (parent.Type == DocumentNodeType.dnList)
                            {
                                MarkerListEntry markerListEntry = new MarkerListEntry();
                                markerListEntry.Marker             = parent.FormatState.Marker;
                                markerListEntry.StartIndexOverride = parent.FormatState.StartIndex;
                                markerListEntry.StartIndexDefault  = parent.FormatState.StartIndexDefault;
                                markerListEntry.VirtualListLevel   = parent.VirtualListLevel;
                                markerListEntry.ILS = parent.FormatState.ILS;
                                markerList.Insert(0, markerListEntry);
                                if (markerListEntry.Marker != MarkerStyle.MarkerBullet)
                                {
                                    flag = false;
                                }
                            }
                        }
                        break;
                    }
                }
            }
            if (markerList.Count == 1 && flag)
            {
                markerList.RemoveRange(0, 1);
            }
            return(markerList);
        }
        internal MarkerList GetLastMarkerStyles(MarkerList mlHave, MarkerList mlWant)
        {
            MarkerList ml = new MarkerList();
            if (mlHave.Count > 0 || mlWant.Count == 0)
            {
                return ml;
            }

            bool bAllBullet = true;
            for (int i = Count - 1; i >= 0; i--)
            {
                DocumentNode dn = EntryAt(i);

                // Don't reopen a list across a table.
                if (dn.Type == DocumentNodeType.dnCell || dn.Type == DocumentNodeType.dnTable)
                {
                    break;
                }

                if (dn.Type == DocumentNodeType.dnListItem)
                {
                    // Don't open a list item in a closed table.
                    DocumentNode dnCell = dn.GetParentOfType(DocumentNodeType.dnCell);
                    if (dnCell != null && !dnCell.IsPending)
                    {
                        break;
                    }

                    // Ignore list items in shapes - note the continue since these didn't effect list continuation.
                    DocumentNode dnShape = dn.GetParentOfType(DocumentNodeType.dnShape);
                    if (dnShape != null && !dnShape.IsPending)
                    {
                        continue;
                    }

                    // OK, gather up the list structure that I'm potentially reopening.
                    for (DocumentNode dnList = dn.Parent; dnList != null; dnList = dnList.Parent)
                    {
                        // Note that I'm building this list up in the reverse order of GetOpenMarkerStyles
                        if (dnList.Type == DocumentNodeType.dnList)
                        {
                            MarkerListEntry mle = new MarkerListEntry();

                            mle.Marker = dnList.FormatState.Marker;
                            mle.StartIndexOverride = dnList.FormatState.StartIndex;
                            mle.StartIndexDefault = dnList.FormatState.StartIndexDefault;
                            mle.VirtualListLevel = dnList.VirtualListLevel;
                            mle.ILS = dnList.FormatState.ILS;
                            ml.Insert(0, mle);

                            if (mle.Marker != MarkerStyle.MarkerBullet)
                            {
                                bAllBullet = false;
                            }
                        }
                    }

                    break;
                }
            }

            // If all bullets at one level, don't do the continuation thing for simpler content generation.
            if (ml.Count == 1 && bAllBullet)
            {
                ml.RemoveRange(0, 1);
            }

            return ml;
        }