Check for NULL, to avoid crashes.

This commit is contained in:
Kohei Yoshida 2011-03-30 17:25:37 -04:00
parent 1075b6b48d
commit 7ba8ca9aa1
2 changed files with 8 additions and 0 deletions

View file

@ -612,6 +612,10 @@ void ScXMLExportDatabaseRanges::WriteDatabaseRanges(const com::sun::star::uno::R
pDBCollection->SearchName(sDatabaseRangeName, nIndex);
pDBData = (*pDBCollection)[nIndex];
}
if (!pDBData)
continue;
if (pDBData->HasImportSelection())
rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_IS_SELECTION, XML_TRUE);
if (pDBData->HasAutoFilter())

View file

@ -370,6 +370,10 @@ void ScXMLDatabaseRangeContext::EndElement()
pDBCollection->SearchName(sDatabaseRangeName, nIndex);
pDBData = (*pDBCollection)[nIndex];
}
if (!pDBData)
return;
pDBData->SetImportSelection(bIsSelection);
pDBData->SetAutoFilter(bAutoFilter);
if (bAutoFilter)