毛勇岗 wrote: > Thank you for your suggestions. > As you said I analyzed the call stack. And in the SfxMedium* > SfxApplication::InsertDocumentDialog(sfx2\source\appl\appopen.cxx), > sal_uInt32 nError = pMatcher->DetectFilter( *pMedium, &pFilter, FALSE ); > if ( nError == ERRCODE_NONE && pFilter ) > pMedium->SetFilter( pFilter ); > else > DELETEZ( pMedium ); > when insert a *.mpeg, the "nError == ERRCODE_NONE && pFilter " always is > true.Then the program crash. > If I change > sRealType = ::rtl::OUString::createFromAscii("calc_Text_txt_csv_StarCalc"); > To: > sRealType = ::rtl::OUString::createFromAscii("writer_Text_encoded"); > in TypeDetection::impl_checkResultsAndAddBestFilter(...) > (filter\source\config\cache\typedetection.cxx), The bug will be fixed. > I'm looking forward to your advice!
So Calc tries to load the the MPEG file as CSV (text) file. As far as I can see, the problems are from the display of the resulting strings in the filter options dialog. Your change would probably break the use of valid CSV files with unknown extensions in the same situation again (issue 60158). Calc's filter detection service already contains logic to reject CSV files that have null bytes in unexpected positions, but in this "workaround" case, the filter is selected without calling its detection service. Maybe that can be changed, but generally, the filter detection code can be quite fragile. I'm cc'ing the framework list. Niklas --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]