Пример #1
0
        internal TShapePropertiesList GetShapes(int Row1, int Col1, int Row2, int Col2)
        {
            int MinR = (Row1 - Top) / RowsPerPage; if (MinR < 0)
            {
                MinR = 0;
            }
            int MaxR = (Row2 - Top) / RowsPerPage; if (MaxR >= Pages.GetLength(0))
            {
                MaxR = Pages.GetLength(0) - 1;
            }
            int MinC = (Col1 - Left) / ColsPerPage; if (MinC < 0)
            {
                MinC = 0;
            }
            int MaxC = (Col2 - Left) / ColsPerPage; if (MaxC >= Pages.GetLength(1))
            {
                MaxC = Pages.GetLength(1) - 1;
            }

            TShapePropertiesList Result = new TShapePropertiesList();

            for (int r = MinR; r <= MaxR; r++)
            {
                for (int c = MinC; c <= MaxC; c++)
                {
                    if (Pages[r, c] == null)
                    {
                        continue;
                    }
                    for (int i = Pages[r, c].Count - 1; i >= 0; i--)
                    {
                        TClientAnchor Anchor = Pages[r, c][i].NestedAnchor;
                        if (Anchor.Row1 > Row2 || Anchor.Row2 < Row1 || Anchor.Col1 > Col2 || Anchor.Col2 < Col1)
                        {
                            continue;
                        }

                        int Index = Result.BinarySearch(Pages[r, c][i], ZOrderComparerMethod);
                        if (Index < 0)
                        {
                            Index = ~Index;
                            Result.Insert(Index, Pages[r, c][i]);
                        }
                    }
                }
            }
            return(Result);
        }
Пример #2
0
        internal void Fill(ExcelFile Workbook)
        {
            for (int i = Workbook.ObjectCount; i >= 1; i--)
            {
                TShapeProperties ShProp = Workbook.GetObjectProperties(i, true);
                if (!ShProp.Print || !ShProp.Visible || ShProp.ObjectType == TObjectType.Comment)
                {
                    continue;
                }
                TClientAnchor Anchor = ShProp.NestedAnchor;
                if (Anchor == null)
                {
                    continue;
                }

                int MinR = (Anchor.Row1 - Top) / RowsPerPage; if (MinR < 0)
                {
                    MinR = 0;
                }
                int MaxR = (Anchor.Row2 - Top) / RowsPerPage; if (MaxR >= Pages.GetLength(0))
                {
                    MaxR = Pages.GetLength(0) - 1;
                }
                int MinC = (Anchor.Col1 - Left) / ColsPerPage; if (MinC < 0)
                {
                    MinC = 0;
                }
                int MaxC = (Anchor.Col2 - Left) / ColsPerPage; if (MaxC >= Pages.GetLength(1))
                {
                    MaxC = Pages.GetLength(1) - 1;
                }



                for (int r = MinR; r <= MaxR; r++)
                {
                    for (int c = MinC; c <= MaxC; c++)
                    {
                        ShProp.zOrder = i;
                        if (Pages[r, c] == null)
                        {
                            Pages[r, c] = new TShapePropertiesList();
                        }
                        Pages[r, c].Add(ShProp);
                    }
                }
            }
        }