[ooo-build-commit] .: patches/dev300
Muthu Subramanian
sumuthu at kemper.freedesktop.org
Thu Aug 26 03:43:39 PDT 2010
patches/dev300/sc-xml-with-xls-ext.diff | 101 ++++++++++++++++++++++++++++----
1 file changed, 89 insertions(+), 12 deletions(-)
New commits:
commit 36075f14ed49629a5c0b310a7072dbfd7f73ee38
Author: Muthu Subramanian K <sumuthu at novell.com>
Date: Thu Aug 26 16:01:51 2010 +0530
Changed Ascii filter priority. n#631993
diff --git a/patches/dev300/sc-xml-with-xls-ext.diff b/patches/dev300/sc-xml-with-xls-ext.diff
index 1415c3e..b6d2539 100644
--- a/patches/dev300/sc-xml-with-xls-ext.diff
+++ b/patches/dev300/sc-xml-with-xls-ext.diff
@@ -1,5 +1,5 @@
---- sc/source/ui/unoobj/scdetect.cxx 2010-07-16 21:20:23.000000000 +0530
-+++ sc/source/ui/unoobj/scdetect.cxx 2010-07-29 19:15:55.000000000 +0530
+--- sc/source/ui/unoobj/scdetect.cxx 2010-08-26 15:57:06.000000000 +0530
++++ sc/source/ui/unoobj/scdetect.cxx 2010-08-26 15:56:30.000000000 +0530
@@ -117,6 +117,7 @@ static const sal_Char __FAR_DATA pFilter
static const sal_Char __FAR_DATA pFilterEx95Temp[] = "MS Excel 95 Vorlage/Template";
static const sal_Char __FAR_DATA pFilterExcel97[] = "MS Excel 97";
@@ -8,16 +8,93 @@
static const sal_Char __FAR_DATA pFilterDBase[] = "dBase";
static const sal_Char __FAR_DATA pFilterDif[] = "DIF";
static const sal_Char __FAR_DATA pFilterSylk[] = "SYLK";
-@@ -758,7 +759,11 @@ static BOOL lcl_IsAnyXMLFilter( const Sf
+@@ -723,52 +724,51 @@ static BOOL lcl_IsAnyXMLFilter( const Sf
+ // without the preselection other filters (Writer) take precedence
+ // DBase can't be detected reliably, so it also needs preselection
+ bool bMaybeText = lcl_MayBeAscii( rStr );
+- if ( pPreselectedFilter->GetFilterName().EqualsAscii(pFilterAscii) && bMaybeText )
+- {
+- // Text filter is accepted if preselected
+- pFilter = pPreselectedFilter;
++
++ // get file header
++ rStr.Seek( 0 );
++ const int nTrySize = 80;
++ ByteString aHeader;
++ for ( int j = 0; j < nTrySize && !rStr.IsEof(); j++ )
++ {
++ sal_Char c;
++ rStr >> c;
++ aHeader += c;
+ }
+- else
++ aHeader += '\0';
++
++ if ( HTMLParser::IsHTMLFormat( aHeader.GetBuffer() ) )
+ {
+- // get file header
+- rStr.Seek( 0 );
+- const int nTrySize = 80;
+- ByteString aHeader;
+- for ( int j = 0; j < nTrySize && !rStr.IsEof(); j++ )
++ // test for HTML
++ if ( pPreselectedFilter->GetName().EqualsAscii(pFilterHtml) )
+ {
+- sal_Char c;
+- rStr >> c;
+- aHeader += c;
++ pFilter = pPreselectedFilter;
}
- else if ( bIsXLS && bMaybeText )
+- aHeader += '\0';
+-
+- if ( HTMLParser::IsHTMLFormat( aHeader.GetBuffer() ) )
++ else
{
-- pFilter = aMatcher.GetFilter4FilterName( String::CreateFromAscii(pFilterAscii) );
-+ aHeader.EraseLeadingChars();
-+ if( aHeader.CompareTo( "<?xml", 5 ) == COMPARE_EQUAL )
-+ pFilter = aMatcher.GetFilter4FilterName( String::CreateFromAscii(pFilter2003XML) );
-+ else
-+ pFilter = aMatcher.GetFilter4FilterName( String::CreateFromAscii(pFilterAscii) );
- bFakeXLS = true;
+- // test for HTML
+- if ( pPreselectedFilter->GetName().EqualsAscii(pFilterHtml) )
+- {
+- pFilter = pPreselectedFilter;
+- }
+- else
+- {
+- pFilter = aMatcher.GetFilter4FilterName( String::CreateFromAscii(pFilterHtmlWeb) );
+- if ( bIsXLS )
+- bFakeXLS = true;
+- }
++ pFilter = aMatcher.GetFilter4FilterName( String::CreateFromAscii(pFilterHtmlWeb) );
++ if ( bIsXLS )
++ bFakeXLS = true;
}
- else if ( aHeader.CompareTo( "{\\rtf", 5 ) == COMPARE_EQUAL )
+- else if ( bIsXLS && bMaybeText )
+- {
++ }
++ else if ( bIsXLS && bMaybeText )
++ {
++ aHeader.EraseLeadingChars();
++ if( aHeader.CompareTo( "<?xml", 5 ) == COMPARE_EQUAL )
++ pFilter = aMatcher.GetFilter4FilterName( String::CreateFromAscii(pFilter2003XML) );
++ else
+ pFilter = aMatcher.GetFilter4FilterName( String::CreateFromAscii(pFilterAscii) );
+- bFakeXLS = true;
+- }
+- else if ( aHeader.CompareTo( "{\\rtf", 5 ) == COMPARE_EQUAL )
+- {
+- // test for RTF
+- pFilter = aMatcher.GetFilter4FilterName( String::CreateFromAscii(pFilterRtf) );
+- }
+- else if ( pPreselectedFilter->GetName().EqualsAscii(pFilterDBase) && lcl_MayBeDBase( rStr ) )
+- pFilter = pPreselectedFilter;
++ bFakeXLS = true;
++ }
++ else if ( aHeader.CompareTo( "{\\rtf", 5 ) == COMPARE_EQUAL )
++ {
++ // test for RTF
++ pFilter = aMatcher.GetFilter4FilterName( String::CreateFromAscii(pFilterRtf) );
+ }
++ else if ( pPreselectedFilter->GetName().EqualsAscii(pFilterDBase) && lcl_MayBeDBase( rStr ) )
++ pFilter = pPreselectedFilter;
++ else if ( pPreselectedFilter->GetFilterName().EqualsAscii(pFilterAscii) && bMaybeText )
++ pFilter = pPreselectedFilter;
+ }
+ }
+ }
More information about the ooo-build-commit
mailing list