示例#1
0
        public TFlxFormat GetCellVisibleFormatDef(ExcelFile Workbook, int row, int col, bool Merged)
        {
            int XF = Workbook.DefaultFormatId;

            UpdateRowBiggerThan0(Workbook, row, col);

            bool CacheValid = Merged || (LastCachedRowBiggerThan0 && LastCachedColBiggerThan0);

            if (CacheValid)
            {
                if (PageFormatCache != null && PageFormatCache.IsValid(row, col))
                {
                    return(PageFormatCache.GetFormat(row, col));
                }

                XF = Workbook.GetCellVisibleFormat(row, col);
            }

            TFlxFormat Result;

            if (!FlxFormatCache.TryGetValue(XF, out Result))
            {
                Result             = Workbook.GetFormat(XF);
                FlxFormatCache[XF] = Result;
            }

            TFlxFormat Result2 = Workbook.ConditionallyModifyFormat(Result, row, col);

            if (Result2 != null)
            {
                if (PageFormatCache != null && CacheValid)
                {
                    PageFormatCache.SetFormat(row, col, Result2);
                }
                return(Result2);
            }

            if (PageFormatCache != null && CacheValid)
            {
                PageFormatCache.SetFormat(row, col, Result);
            }
            return(Result);
        }