diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-22 15:54:01 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-23 17:21:48 +0100 |
commit | b07e38b2028a5ebc7dd078f7282c0bd3274c897e (patch) | |
tree | a1f0805475f9289f220be10d385ed532c8f9c396 /sfx2 | |
parent | 57991f885e60d04e93bf5004d4fdceee7d29f3d8 (diff) |
Remove dead code from SfxFilter ctor
In fd069bee7e57ad529c3c0974559fd2d84ec3151a "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
b7c596059dfa9a808f587af9f30b01489e75fb0e "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/48336
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/docfilt.cxx | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/sfx2/source/doc/docfilt.cxx b/sfx2/source/doc/docfilt.cxx index 7dddb700e60d..b3d931124f4c 100644 --- a/sfx2/source/doc/docfilt.cxx +++ b/sfx2/source/doc/docfilt.cxx @@ -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() |