diff options
author | Eike Rathke <erack@redhat.com> | 2012-05-10 19:07:47 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2012-05-10 19:07:47 +0200 |
commit | aeb1451dff06ad00b1719f9bc45a2c8bdfa904f8 (patch) | |
tree | cc4e622d9f6d4290f6d60c413bd37979e9491ea6 /sc/source/ui/unoobj | |
parent | 5df9e10d27a071f878ed160f99129a7f3c34f5ed (diff) |
resolved fdo#49639 import .xls with HTML as such, not CSV
This restores the previous behavior for this content type, regression
introduced with the fix for fdo#40021 a5eadc6aaafec92df23c57e258882a2c98ece0ad
Diffstat (limited to 'sc/source/ui/unoobj')
-rw-r--r-- | sc/source/ui/unoobj/scdetect.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx index 6ef14291107c..7fe787da7d02 100644 --- a/sc/source/ui/unoobj/scdetect.cxx +++ b/sc/source/ui/unoobj/scdetect.cxx @@ -441,14 +441,13 @@ static sal_Bool lcl_MayBeDBase( SvStream& rStream ) } else { - bool bIsXLS = false; SvStream* pStream = aMedium.GetInStream(); const SfxFilter* pPreselectedFilter = pFilter; - bool bCsvSelected = (pPreselectedFilter ? - pPreselectedFilter->GetFilterName().EqualsAscii( pFilterAscii ) : false); - if ( pPreselectedFilter && ( ( pPreselectedFilter->GetName().SearchAscii("Excel") != STRING_NOTFOUND ) || - ( !aPreselectedFilterName.Len() && bCsvSelected ) ) ) - bIsXLS = true; + bool bCsvSelected = (pPreselectedFilter && + pPreselectedFilter->GetFilterName().EqualsAscii( pFilterAscii )); + bool bExcelSelected = (pPreselectedFilter && + (pPreselectedFilter->GetName().SearchAscii("Excel") != STRING_NOTFOUND)); + bool bIsXLS = (bExcelSelected || (bCsvSelected && !aPreselectedFilterName.Len())); pFilter = 0; if ( pStream ) { @@ -750,12 +749,14 @@ static sal_Bool lcl_MayBeDBase( SvStream& rStream ) const sal_Size nTrySize = 80; rtl::OString aHeader = read_uInt8s_ToOString(rStr, nTrySize); + bool bMaybeHtml = HTMLParser::IsHTMLFormat( aHeader.getStr()); + if ( aHeader.copy(0, 5).equalsL("{\\rtf", 5) ) { // test for RTF pFilter = aMatcher.GetFilter4FilterName( String::CreateFromAscii(pFilterRtf) ); } - else if ( bIsXLS && bMaybeText ) + else if ( bIsXLS && (bMaybeText && !bMaybeHtml) ) { aHeader = comphelper::string::stripStart(aHeader, ' '); // Detect Excel 2003 XML here only if XLS was preselected. @@ -769,7 +770,7 @@ static sal_Bool lcl_MayBeDBase( SvStream& rStream ) pFilter = pPreselectedFilter; else if ( bCsvSelected && bMaybeText ) pFilter = pPreselectedFilter; - else if ( HTMLParser::IsHTMLFormat(aHeader.getStr()) ) + else if ( bMaybeHtml ) { // test for HTML |