[Libreoffice-commits] core.git: sal/osl

Tor Lillqvist tml at collabora.com
Wed Mar 16 11:39:36 UTC 2016


 sal/osl/w32/file_url.cxx |   69 -----------------------------------------------
 1 file changed, 69 deletions(-)

New commits:
commit 54a679338ee1dab29477d5a491403ff91f98b6dd
Author: Tor Lillqvist <tml at collabora.com>
Date:   Wed Mar 16 13:33:39 2016 +0200

    Remove code that has been commented-out for long
    
    Commented-out in a198aa60a9d346128043e3e65ae82bb8ff670272 in 2005.
    
    Change-Id: Id174dae6632fa8d8e9845b06b916a8515cd6acf3

diff --git a/sal/osl/w32/file_url.cxx b/sal/osl/w32/file_url.cxx
index 479c174..248529b 100644
--- a/sal/osl/w32/file_url.cxx
+++ b/sal/osl/w32/file_url.cxx
@@ -133,75 +133,6 @@ static BOOL IsValidFilePathComponent(
             lpComponentEnd = lpCurrent;
         }
 
-        /* Test whether the component specifies a device name what is not allowed */
-
-        // MT: PERFORMANCE:
-        // This is very expensive. A lot of calls to _tcsicmp.
-        // in SRC6870m71 67.000 calls of this method while empty office start result into more than 1.500.00 calls of _tcsicmp!
-        // Possible optimizations
-        // - Array should be const static
-        // - Sorted array, use binary search
-        // - More intelligent check for com1-9, lpt1-9
-        // Maybe make szComponent upper case, don't search case insensitive
-        // Talked to HRO: Could be removed. Shouldn't be used in OOo, and if used for something like a filename, it will lead to an error anyway.
-        /*
-        if ( fValid )
-        {
-            LPCWSTR alpDeviceNames[] =
-            {
-                TEXT("CON"),
-                TEXT("PRN"),
-                TEXT("AUX"),
-                TEXT("CLOCK$"),
-                TEXT("NUL"),
-                TEXT("LPT1"),
-                TEXT("LPT2"),
-                TEXT("LPT3"),
-                TEXT("LPT4"),
-                TEXT("LPT5"),
-                TEXT("LPT6"),
-                TEXT("LPT7"),
-                TEXT("LPT8"),
-                TEXT("LPT9"),
-                TEXT("COM1"),
-                TEXT("COM2"),
-                TEXT("COM3"),
-                TEXT("COM4"),
-                TEXT("COM5"),
-                TEXT("COM6"),
-                TEXT("COM7"),
-                TEXT("COM8"),
-                TEXT("COM9")
-            };
-
-            WCHAR   szComponent[MAX_PATH];
-            int     nComponentLength;
-            LPCWSTR lpDot;
-            int     i;
-
-            // A device name with an extension is also invalid
-            lpDot = _tcschr( lpComponent, '.' );
-
-            if ( !lpDot || lpDot > lpComponentEnd )
-                nComponentLength = lpComponentEnd - lpComponent;
-            else
-                nComponentLength = lpDot - lpComponent;
-
-            _tcsncpy( szComponent, lpComponent, nComponentLength );
-            szComponent[nComponentLength] = 0;
-
-            for ( i = 0; i < sizeof( alpDeviceNames ) / sizeof(LPCWSTR); i++ )
-            {
-                if ( 0 == _tcsicmp( szComponent, alpDeviceNames[i] ) )
-                {
-                    lpComponentEnd = lpComponent;
-                    fValid = FALSE;
-                    break;
-                }
-            }
-        }
-        */
-
         if ( fValid )
         {
             // Empty components are not allowed


More information about the Libreoffice-commits mailing list