private void FinalizeWorksheet() { FinalizeCell(); for (int i = _currentRow.RowNumber; i < _maxRowIndex; i++) { _currentSheet.CreateRow().Height = 0.0; } _maxRowIndex = 0; foreach (MergeInfo mergedCell in _mergedCells) { _currentSheet.MergeCells(mergedCell.FirstRow, mergedCell.FirstColumn, mergedCell.RowCount, mergedCell.ColumnCount); } _mergedCells = new List <MergeInfo>(); foreach (LinkInfo hyperlink in _hyperlinks) { _currentSheet.CreateHyperlink(hyperlink.AreaFormula, hyperlink.Href, hyperlink.Label); } _hyperlinks.Clear(); for (int num = _bookmarkLinks.Count - 1; num >= 0; num--) { if (_bookmarkTargets.TryGetValue(_bookmarkLinks[num].Href, out BookmarkTargetInfo value)) { _currentSheet.CreateHyperlink(_bookmarkLinks[num].AreaFormula, GetCellBookmarkLink(value), _bookmarkLinks[num].Label); _bookmarkLinks.RemoveAt(num); } } if (_bookmarkLinks.Count == 0) { _currentSheet.Cleanup(); } else { _unresolvedStreamsheets.Add(new UnresolvedStreamsheet(_currentSheet, _bookmarkLinks)); _bookmarkLinks = new List <LinkInfo>(); } _picturesStartingOnCurrentRow.Clear(); _picturesToUpdateByEndColumn.Clear(); _picturesToUpdateByEndRow.Clear(); _picturesToUpdateByStartColumn.Clear(); }
public bool ResolveTarget(string label, string target) { for (int num = _bookmarks.Count - 1; num >= 0; num--) { if (_bookmarks[num].Href == label) { _streamsheet.CreateHyperlink(_bookmarks[num].AreaFormula, target, _bookmarks[num].Label); _bookmarks.RemoveAt(num); } } if (_bookmarks.Count == 0) { _streamsheet.Cleanup(); return(true); } return(false); }