From c4f1c3053a4d892b0bbc8842044133b64eee00ae Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Thu, 10 May 2012 19:05:48 +0200 Subject: resolved fdo#49639 import .xls with HTML as such, not CSV MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This restores the previous behavior for this content type, regression introduced with the fix for fdo#40021 c2a26cf9dab637c292e431d5cdf7bab5bbda571d Signed-off-by: Caolán McNamara --- sc/source/ui/unoobj/scdetect.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx index 556d54fc6e68..59ae14b6e367 100644 --- a/sc/source/ui/unoobj/scdetect.cxx +++ b/sc/source/ui/unoobj/scdetect.cxx @@ -737,12 +737,14 @@ static sal_Bool lcl_MayBeDBase( SvStream& rStream ) const sal_Size nTrySize = 80; ByteString aHeader = read_uInt8s_AsOString(rStr, nTrySize); + bool bMaybeHtml = HTMLParser::IsHTMLFormat( aHeader.GetBuffer()); + if ( aHeader.CompareTo( "{\\rtf", 5 ) == COMPARE_EQUAL ) { // 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. @@ -756,7 +758,7 @@ static sal_Bool lcl_MayBeDBase( SvStream& rStream ) pFilter = pPreselectedFilter; else if ( pPreselectedFilter->GetFilterName().EqualsAscii(pFilterAscii) && bMaybeText ) pFilter = pPreselectedFilter; - else if ( HTMLParser::IsHTMLFormat( aHeader.GetBuffer() ) ) + else if ( bMaybeHtml ) { // test for HTML -- cgit v1.2.3