[Libreoffice-commits] .: Branch 'distro/suse/suse-3.6' - 3 commits - sw/inc sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Dec 13 01:15:54 PST 2012


 sw/inc/iodetect.hxx                  |    3 +--
 sw/source/filter/basflt/iodetect.cxx |   15 ++++++++-------
 sw/source/ui/uno/swdet2.cxx          |    2 +-
 3 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 4a60855a3bb42e6f7f9474314d496e8fe8188c90
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 29 09:48:24 2012 +0000

    .dot files sometimes rejected by writer, bnc#793422
    
    because CWW8 appears twice, once for normal .doc and once for .dot. So a .dot
    files is tested twice if it's supported by the WW8 filter. Depending on the
    (effectively arbitrary) order they appear in the list .dots may fail the "is a
    normal non template .doc" test after the "is a template .dot" test and get
    rejected as a CWW8 candidate.
    
    Change-Id: I88aec29fdd5f9ec4dd4ad2813ff3c6b8fa5c5461
    Signed-off-by: Tor Lillqvist <tlillqvist at suse.com>

diff --git a/sw/source/filter/basflt/iodetect.cxx b/sw/source/filter/basflt/iodetect.cxx
index b99d57c..f32fa1c 100644
--- a/sw/source/filter/basflt/iodetect.cxx
+++ b/sw/source/filter/basflt/iodetect.cxx
@@ -266,6 +266,12 @@ sal_Bool SwIoSystem::IsFileFilter(SfxMedium& rMedium, const String& rFmtName)
                     }
                 }
             }
+            //The same underlying filter can appear multiple times in the
+            //filter list, e.g. CWW8 filter twice, once for .doc and once for
+            //.dot.  We just care here if its either, not enforce that it's
+            //both which would be a bit of an odd requirement
+            if (bRet)
+                break;
         }
 
         pFltr = aIter.Next();
commit 20938c1b7a1f3a536c045d8e4fad6b04e1371c27
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 29 09:29:19 2012 +0000

    optional ppFlt argument never used
    
    Change-Id: Ib2c68091f14d04818ae5e7db0ad7b8a1ec151f4f
    Signed-off-by: Tor Lillqvist <tlillqvist at suse.com>

diff --git a/sw/inc/iodetect.hxx b/sw/inc/iodetect.hxx
index cc58b29..f8ff622 100644
--- a/sw/inc/iodetect.hxx
+++ b/sw/inc/iodetect.hxx
@@ -111,8 +111,7 @@ public:
 
     // Detect whether the given file is in the given format.
     // For now, only our own filters are supported!
-    static sal_Bool IsFileFilter( SfxMedium& rMedium, const String& rFmtName,
-            const SfxFilter** ppFlt = 0 );
+    static sal_Bool IsFileFilter(SfxMedium& rMedium, const String& rFmtName);
 
     static sal_Bool IsValidStgFilter( SotStorage& , const SfxFilter& );
     static sal_Bool IsValidStgFilter( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& rStg, const SfxFilter& rFilter);
diff --git a/sw/source/filter/basflt/iodetect.cxx b/sw/source/filter/basflt/iodetect.cxx
index 7a72a6f..b99d57c 100644
--- a/sw/source/filter/basflt/iodetect.cxx
+++ b/sw/source/filter/basflt/iodetect.cxx
@@ -211,8 +211,7 @@ void TerminateBuffer(sal_Char *pBuffer, sal_uLong nBytesRead, sal_uLong nBufferL
 
 /* Feststellen ob das File in dem entsprechenden Format vorliegt. */
 /* Z.z werden nur unsere eigene Filter unterstuetzt               */
-sal_Bool SwIoSystem::IsFileFilter( SfxMedium& rMedium, const String& rFmtName,
-        const SfxFilter** ppFilter )
+sal_Bool SwIoSystem::IsFileFilter(SfxMedium& rMedium, const String& rFmtName)
 {
     sal_Bool bRet = sal_False;
 
@@ -267,9 +266,6 @@ sal_Bool SwIoSystem::IsFileFilter( SfxMedium& rMedium, const String& rFmtName,
                     }
                 }
             }
-
-            if( bRet && ppFilter  )
-                *ppFilter = pFltr;
         }
 
         pFltr = aIter.Next();
diff --git a/sw/source/ui/uno/swdet2.cxx b/sw/source/ui/uno/swdet2.cxx
index 40e4be5..5594438 100644
--- a/sw/source/ui/uno/swdet2.cxx
+++ b/sw/source/ui/uno/swdet2.cxx
@@ -65,7 +65,7 @@ sal_uLong SwFilterDetect::DetectFilter( SfxMedium& rMedium, const SfxFilter** pp
         String aPrefFlt = (*ppFilter)->GetUserData();
 
         // detection for TextFilter needs an additional checking
-        sal_Bool bDetected = SwIoSystem::IsFileFilter( rMedium, aPrefFlt );
+        sal_Bool bDetected = SwIoSystem::IsFileFilter(rMedium, aPrefFlt);
         return bDetected ? nRet : ERRCODE_ABORT;
     }
 
commit 9e16b4766a76b48bcb38c7d816975a3aae89ce2c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 29 09:23:37 2012 +0000

    Simplify SwIoSystem::IsFileFilter
    
    bRet = bRet && (pFltr->GetUserData().equals(rFmtName)); is already inside an if
    bRet = bRet && (pFltr->GetUserData().equals(rFmtName)); condition
    
    bRet = xStg.Is() && IsValidStgFilter( *xStg, *pFltr ); is already inside an
    if ( xStg.Is() ) condition
    
    Change-Id: I2115041d99b6fcbae7a829557c37627d03b5ee24
    Signed-off-by: Tor Lillqvist <tlillqvist at suse.com>

diff --git a/sw/source/filter/basflt/iodetect.cxx b/sw/source/filter/basflt/iodetect.cxx
index 41adf67..7a72a6f 100644
--- a/sw/source/filter/basflt/iodetect.cxx
+++ b/sw/source/filter/basflt/iodetect.cxx
@@ -244,8 +244,7 @@ sal_Bool SwIoSystem::IsFileFilter( SfxMedium& rMedium, const String& rFmtName,
                 if ( xStor.is() )
                     bRet = IsValidStgFilter( xStor, *pFltr );
                 else if ( xStg.Is() )
-                    bRet = xStg.Is() && IsValidStgFilter( *xStg, *pFltr );
-                bRet = bRet && (pFltr->GetUserData() == rFmtName);
+                    bRet = IsValidStgFilter( *xStg, *pFltr );
             }
             else if( !xStg.Is() && !xStor.is() )
             {


More information about the Libreoffice-commits mailing list