OUString ScExcelBiffDetect::detect( uno::Sequence<beans::PropertyValue>& lDescriptor )
{
MediaDescriptor aMediaDesc(lDescriptor);
OUString aType;
aMediaDesc[MediaDescriptor::PROP_TYPENAME] >>= aType; if (aType.isEmpty()) // Type is not given. We can't proceed. return OUString();
aMediaDesc.addInputStream();
uno::Reference<io::XInputStream> xInStream(aMediaDesc[MediaDescriptor::PROP_INPUTSTREAM], uno::UNO_QUERY); if (!xInStream.is()) // No input stream. return OUString();
if (aType == "calc_MS_Excel_97" || aType == "calc_MS_Excel_97_VorlageTemplate")
{ // See if this stream is an Excel 97/XP/2003 (BIFF8) stream. if (!hasStream(xInStream, u"Workbook"_ustr)) // BIFF8 is expected to contain a stream named "Workbook". return OUString();
elseif (aType == "calc_MS_Excel_95" || aType == "calc_MS_Excel_95_VorlageTemplate")
{ // See if this stream is an Excel 95 (BIFF5) stream. if (!hasStream(xInStream, u"Book"_ustr)) return OUString();
elseif (aType == "calc_MS_Excel_5095" || aType == "calc_MS_Excel_5095_VorlageTemplate")
{ // See if this stream is an Excel 5.0/95 stream. if (!hasStream(xInStream, u"Book"_ustr)) return OUString();
elseif (aType == "calc_MS_Excel_40" || aType == "calc_MS_Excel_40_VorlageTemplate")
{ // See if this stream is an Excel 4.0 stream. if (!isExcel40(xInStream)) return OUString();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.