[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

Caolán McNamara caolan at kemper.freedesktop.org
Fri May 11 08:56:14 PDT 2012


 sc/source/ui/unoobj/scdetect.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit c4f1c3053a4d892b0bbc8842044133b64eee00ae
Author: Eike Rathke <erack at redhat.com>
Date:   Thu May 10 19:05:48 2012 +0200

    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 c2a26cf9dab637c292e431d5cdf7bab5bbda571d
    
    Signed-off-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx
index 556d54f..59ae14b 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
 


More information about the Libreoffice-commits mailing list