Kaydet (Commit) b07e38b2 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Remove dead code from SfxFilter ctor

In fd069bee "initial import" the code was:

+void SfxFilter::InitMembers_Impl()
+{
+    String aExts = GetWildcard()();
+    String aShort, aLong;
+    String aRet;
+    sal_uInt16 nMaxLength =
+#if defined( WIN ) || defined( OS2 )
+        3
+#else
+        USHRT_MAX
+#endif
+        ;
+    String aTest;
+    sal_uInt16 nPos = 0;
+    while( ( aRet = aExts.GetToken( nPos++, ';' ) ).Len() )
+    {
+        aTest = aRet;
+        aTest.SearchAndReplace( DEFINE_CONST_UNICODE( "*." ), String() );
+        if( aTest.Len() <= nMaxLength )
+        {
+            if( aShort.Len() ) aShort += ';';
+            aShort += aRet;
+        }
+        else
+        {
+            if( aLong.Len() ) aLong += ';';
+            aLong += aRet;
+        }
+    }
+    if( aShort.Len() && aLong.Len() )
+    {
+        aShort += ';';
+        aShort += aLong;
+    }
+    aWildCard = aShort;
+
+    nVersion = SOFFICE_FILEFORMAT_NOW;
+    bPlugDataSearched = 0;
+    pPlugData = 0;
+
+    aName = pContainer->GetName();
+    aName += DEFINE_CONST_UNICODE( ": " );
+    aName += aFilterName;
+
+    aUIName = aFilterName;
+}

where USHRT_MAX apparently effectively meant "arbitrarily large".  But when
b7c59605 "INTEGRATION: CWS sfxcleanup" removed
the WIN/OS2 special case it didn't remove all the other code that was now
effectively useless.

Change-Id: I883759f13e0267a189ad176c2ffcc1c78680b0a5
Reviewed-on: https://gerrit.libreoffice.org/48336Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 57991f88
......@@ -67,33 +67,16 @@ SfxFilter::SfxFilter( const OUString &rName,
lFormat(lFmt)
{
OUString aExts = GetWildcard().getGlob();
OUString aShort, aLong;
OUString glob;
OUString aRet;
OUString aTest;
sal_uInt16 nPos = 0;
while (!(aRet = aExts.getToken(nPos++, ';')).isEmpty() )
{
aTest = aRet;
aTest = aTest.replaceFirst( "*." , "" );
if( aTest.getLength() <= USHRT_MAX )
{
if (!aShort.isEmpty())
aShort += ";";
aShort += aRet;
}
else
{
if (!aLong.isEmpty())
aLong += ";";
aLong += aRet;
}
}
if (!aShort.isEmpty() && !aLong.isEmpty())
{
aShort += ";";
aShort += aLong;
if (!glob.isEmpty())
glob += ";";
glob += aRet;
}
aWildCard.setGlob(aShort);
aWildCard.setGlob(glob);
}
SfxFilter::~SfxFilter()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment