Esempio n. 1
0
        public override Boolean IsEmpty(XLCellsUsedOptions options)
        {
            if (options.HasFlag(XLCellsUsedOptions.NormalFormats) &&
                !StyleValue.Equals(Worksheet.StyleValue))
            {
                return(false);
            }

            return(base.IsEmpty(options));
        }
Esempio n. 2
0
        private IEnumerable <XLSheetPoint> GetUsedCellsCandidates(XLWorksheet worksheet)
        {
            var candidates = Enumerable.Empty <XLSheetPoint>();

            if (_options.HasFlag(XLCellsUsedOptions.MergedRanges))
            {
                candidates = candidates.Union(
                    worksheet.Internals.MergedRanges.SelectMany(r => GetAllCellsInRange(r.RangeAddress)));
            }

            if (_options.HasFlag(XLCellsUsedOptions.ConditionalFormats))
            {
                candidates = candidates.Union(
                    worksheet.ConditionalFormats.SelectMany(cf => cf.Ranges.SelectMany(r => GetAllCellsInRange(r.RangeAddress))));
            }

            if (_options.HasFlag(XLCellsUsedOptions.DataValidation))
            {
                candidates = candidates.Union(
                    worksheet.DataValidations.SelectMany(dv => dv.Ranges.SelectMany(r => GetAllCellsInRange(r.RangeAddress))));
            }

            return(candidates.Distinct());
        }