[Libreoffice-commits] .: tools/inc tools/source

François Tigeot ftigeot at kemper.freedesktop.org
Wed Jun 15 22:39:16 PDT 2011


 tools/inc/tools/fsys.hxx     |    9 -----
 tools/source/fsys/dirent.cxx |   67 -------------------------------------------
 tools/source/fsys/unx.cxx    |   13 --------
 tools/source/fsys/wntmsc.cxx |   38 ------------------------
 4 files changed, 127 deletions(-)

New commits:
commit 8d77ac492995d9d46b5d2bbedf8cf8ff605514a4
Author: Francois Tigeot <ftigeot at wolfpond.org>
Date:   Wed Jun 15 22:24:06 2011 +0200

    Remove unused methods

diff --git a/tools/inc/tools/fsys.hxx b/tools/inc/tools/fsys.hxx
index 7428a88..567e7d1 100644
--- a/tools/inc/tools/fsys.hxx
+++ b/tools/inc/tools/fsys.hxx
@@ -215,9 +215,6 @@ public:
     static sal_uIntPtr	SetReadOnlyFlag( const DirEntry &rEntry, sal_Bool bRO = sal_True );
     static sal_Bool 	GetReadOnlyFlag( const DirEntry &rEntry );
 
-    static ErrCode	QueryDiskSpace( const String &rPath,
-                                    BigInt &rFreeBytes, BigInt &rTotalBytes );
-
     static void 	SetDateTime( const String& rFileName,
                                  const DateTime& rNewDateTime );
 };
@@ -522,12 +519,6 @@ public:
 
 #endif // BOOTSTRP
 
-//========================================================================
-
-void FSysEnableSysErrorBox( sal_Bool bEnable );
-
-//========================================================================
-
 #if defined(DBG_UTIL)
 void FSysTest();
 #endif
diff --git a/tools/source/fsys/dirent.cxx b/tools/source/fsys/dirent.cxx
index 5683b5b..a38d698 100644
--- a/tools/source/fsys/dirent.cxx
+++ b/tools/source/fsys/dirent.cxx
@@ -1842,73 +1842,6 @@ FSysError DirEntry::ImpParseUnixName( const ByteString& rPfad, FSysPathStyle eSt
     return FSYS_ERR_OK;
 }
 
-ErrCode CreateEntry_Impl( const DirEntry &rPath, DirEntryKind eKind )
-{
-    // versuchen, anzulegen (ausser bei FSYS_KIND_ALL)
-    ErrCode eErr = ERRCODE_NONE;
-    if ( FSYS_KIND_FILE == eKind )
-    {
-        SvFileStream aStream( rPath.GetFull(), STREAM_STD_WRITE );
-        aStream.WriteLine( "" );
-        eErr = aStream.GetError();
-    }
-    else if ( FSYS_KIND_ALL != eKind )
-        eErr = rPath.MakeDir() ? ERRCODE_NONE : ERRCODE_IO_UNKNOWN;
-
-    // erfolgreich?
-    if ( !rPath.Exists() )
-        eErr = ERRCODE_IO_UNKNOWN; // Doch was schiefgegangen ?
-
-    // ggf. wieder l"oschen
-    if ( FSYS_KIND_NONE == eKind )
-        rPath.Kill();
-
-    // Fehlercode zur?ckliefern
-    return eErr;
-}
-
-sal_Bool IsValidEntry_Impl( const DirEntry &rPath,
-                        const String &rLongName,
-                        DirEntryKind eKind,
-                        sal_Bool bIsShortened,
-                        sal_Bool bUseDelim )
-{
-    // Parameter-Pr"uefung
-    DBG_ASSERT( eKind == FSYS_KIND_NONE || eKind == FSYS_KIND_ALL ||
-                eKind == FSYS_KIND_FILE || eKind == FSYS_KIND_DIR,
-                "invalid entry-kind" );
-
-    // Alle von MSDOS erreichbaren FSYS_STYLES muessen den
-    // MSDOS Filenamenanforderungen genuegen. Sonst wird probiert,
-    // ob sich eine Datei des gewuenschten Names anlegen laesst.
-    FSysPathStyle eStyle = DirEntry::GetPathStyle();
-    DirEntry aPath(rPath);
-    DirEntry aName(rLongName, eStyle);
-    if ( !aName.IsValid() || aName.Level() != 1 )
-        return sal_False;
-    aPath += aName;
-    if ( 1 == aPath.Level() )
-        return sal_False;
-
-        // Pfad-Trenner sind nicht erlaubt (bei ungek"urzten auch nicht FSYS_SHORTNAME_DELIMITER)
-        char cDelim = bUseDelim == 2 ? FSYS_SHORTNAME_DELIMITER : char(0);
-    if (
-         rLongName.Search(DirEntry::GetAccessDelimiter()) != STRING_NOTFOUND ||
-         (!bIsShortened && rLongName.Search(cDelim) != STRING_NOTFOUND)
-       )
-    {
-        return sal_False;
-    }
-
-    // MI: Abfrage nach 'CON:' etc. wird jetzt in Exists() mitgemacht
-    if ( aPath.Exists() )
-        return sal_False;
-
-    return (ERRCODE_NONE == CreateEntry_Impl( aPath, eKind ));
-}
-
-//-------------------------------------------------------------------------
-
 #define MAX_EXT_MAX       250
 #define MAX_LEN_MAX       255
 #define INVALID_CHARS_DEF   "\\/\"':|^<>?*"
diff --git a/tools/source/fsys/unx.cxx b/tools/source/fsys/unx.cxx
index d1c0f48..92eb913 100644
--- a/tools/source/fsys/unx.cxx
+++ b/tools/source/fsys/unx.cxx
@@ -521,17 +521,4 @@ void FileStat::SetDateTime( const String& rFileName,
     }
 }
 
-//=========================================================================
-
-ErrCode FileStat::QueryDiskSpace( const String &, BigInt &, BigInt & )
-{
-    return ERRCODE_IO_NOTSUPPORTED;
-}
-
-//=========================================================================
-
-void FSysEnableSysErrorBox( sal_Bool )
-{
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/source/fsys/wntmsc.cxx b/tools/source/fsys/wntmsc.cxx
index 6ed2ba1..ab783b4 100644
--- a/tools/source/fsys/wntmsc.cxx
+++ b/tools/source/fsys/wntmsc.cxx
@@ -872,42 +872,4 @@ const char* TempDirImpl( char *pBuf )
     return pBuf;
 }
 
-//=======================================================================
-
-ErrCode FileStat::QueryDiskSpace( const String &rPath,
-                                  BigInt &rFreeBytes, BigInt &rTotalBytes )
-{
-    DWORD nSectorsPerCluster;   /* address of sectors per cluster   */
-    DWORD nBytesPerSector;      /* address of bytes per sector  */
-    DWORD nFreeClusters;        /* address of number of free clusters   */
-    DWORD nClusters;            /* address of total number of clusters  */
-
-    ByteString aVol( DirEntry(rPath).ImpGetTopPtr()->GetName(), osl_getThreadTextEncoding());
-    bool bOK = GetDiskFreeSpace( aVol.GetBuffer(),
-                        &nSectorsPerCluster, &nBytesPerSector,
-                        &nFreeClusters, &nClusters );
-    if ( !bOK )
-        return Sys2SolarError_Impl( GetLastError() );
-
-    BigInt aBytesPerCluster( BigInt(nSectorsPerCluster) *
-                             BigInt(nBytesPerSector) );
-    rFreeBytes = aBytesPerCluster * BigInt(nFreeClusters);
-    rTotalBytes = aBytesPerCluster * BigInt(nClusters);
-    return 0;
-}
-
-//=========================================================================
-
-void FSysEnableSysErrorBox( sal_Bool bEnable )
-{   // Preserve other Bits!!
-    sal_uInt32 nErrorMode = SetErrorMode( bEnable ? 0 : SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX );
-    if ( bEnable )
-        nErrorMode &= ~(SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX);
-    else
-        nErrorMode |= (SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX);
-    SetErrorMode( nErrorMode );
-}
-
-
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list