示例#1
0
void ExcelDOMStripper::RestoreHiddenWorksheets()
{
	Excel::SheetsPtr pWorksheets = m_spWorkbook->Worksheets;
	const long count = pWorksheets->Count;
	for (long index = 1; index <= count; ++index)
	{
		std::vector<long>::iterator position = std::find(m_hiddenWorksheets.begin(), m_hiddenWorksheets.end(), index);
		if (position != m_hiddenWorksheets.end())
		{
			Excel::_WorksheetPtr spWorksheet = pWorksheets->Item[index];
			spWorksheet->PutVisible(LocaleHelper::GetLocaleIDForInstalledExcel(m_spWorkbook), Excel::xlSheetHidden);
		}
	}
}
示例#2
0
void ExcelDOMStripper::UnhideWorksheets()
{
	Excel::SheetsPtr pWorksheets = m_spWorkbook->Worksheets;
	const long count = pWorksheets->Count;
	for (long index = 1; index <= count; ++index)
	{
		Excel::_WorksheetPtr spWorksheet = pWorksheets->Item[index];
		if (!spWorksheet->Visible)
		{
			m_hiddenWorksheets.push_back(index);
			spWorksheet->PutVisible(LocaleHelper::GetLocaleIDForInstalledExcel(m_spWorkbook), Excel::xlSheetVisible);
		}
	}
}