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

Michael Meeks michael at kemper.freedesktop.org
Tue Feb 21 06:54:21 PST 2012


 tools/inc/tools/fsys.hxx        |   37 -----------------------
 tools/source/fsys/comdep.hxx    |    2 -
 tools/source/fsys/dirent.cxx    |   64 ----------------------------------------
 tools/source/fsys/wntmsc.cxx    |    1 
 tools/source/stream/strmunx.cxx |    1 
 tools/source/stream/strmwnt.cxx |    1 
 6 files changed, 106 deletions(-)

New commits:
commit 4cd2af27cbedc0f59f5a8a3f0a7c27b158b42fce
Author: Elton Chung <elton at layerjet.com>
Date:   Tue Feb 21 00:39:36 2012 +0800

    fdo#44993: Remove obsolete FSysRedirector

diff --git a/tools/inc/tools/fsys.hxx b/tools/inc/tools/fsys.hxx
index 42ddcab..33ac3cb 100644
--- a/tools/inc/tools/fsys.hxx
+++ b/tools/inc/tools/fsys.hxx
@@ -422,43 +422,6 @@ public:
     DirEntry&       operator []( size_t nIndex ) const;
 };
 
-//========================================================================
-
-/** FSysRedirector is an abstract base class for a hook to redirect
-    mirrored directory trees.
-
-    <P>One instance of a subclass can be instanciated and registered
-    using the method FSysRedirector::Register(FSysRedirector*).
- */
-
-class FSysRedirector
-{
-    static FSysRedirector*  _pRedirector;
-    static sal_Bool             _bEnabled;
-
-public:
-    //-----------------------------------------------------------------------
-    /** This method is to be used to redirect a file system path.
-
-        <P>It will not redirect while redirection is disabled.
-
-        <P>It may block while another thread is accessing the redirector
-        or another thread has disabled redirections.
-
-        @param String &rPath<BR>
-                This inout-argument accepts a file:-URL even as a native
-                file system path name to redirect in 'rPath'. It returns the
-                redirected (modified) path too, which can be of both formats
-                too.
-
-        @return sal_Bool<BR>
-                sal_True, if the path is redirected
-                sal_False, if the path is not redirected (unchanged)
-     */
-    static void             DoRedirect( String &rPath );
-};
-
-
 #if defined(DBG_UTIL)
 void FSysTest();
 #endif
diff --git a/tools/source/fsys/comdep.hxx b/tools/source/fsys/comdep.hxx
index 193041b..3a56549 100644
--- a/tools/source/fsys/comdep.hxx
+++ b/tools/source/fsys/comdep.hxx
@@ -76,8 +76,6 @@ struct DirReader_Impl
                     bReady ( sal_False ),
                     bInUse( sal_False )
                 {
-                    // Redirection
-                    FSysRedirector::DoRedirect( aPath );
 
                     // nur den String der Memer-Var nehmen!
 
diff --git a/tools/source/fsys/dirent.cxx b/tools/source/fsys/dirent.cxx
index 3018cf4..1a60e0c 100644
--- a/tools/source/fsys/dirent.cxx
+++ b/tools/source/fsys/dirent.cxx
@@ -128,62 +128,6 @@ int Sys2SolarError_Impl( int nSysErr )
 
 //--------------------------------------------------------------------
 
-FSysRedirector* FSysRedirector::_pRedirector = 0;
-sal_Bool FSysRedirector::_bEnabled = sal_True;
-#ifdef UNX
-sal_Bool bInRedirection = sal_True;
-#else
-sal_Bool bInRedirection = sal_False;
-#endif
-static osl::Mutex* pRedirectMutex = 0;
-
-//------------------------------------------------------------------------
-void FSysRedirector::DoRedirect( String &rPath )
-{
-        String aURL(rPath);
-
-        // if redirection is disabled or not even registered do nothing
-        if ( !_bEnabled || !pRedirectMutex )
-                return;
-
-        // redirect only removable or remote volumes
-        if (!IsRedirectable_Impl(rtl::OUStringToOString(aURL, osl_getThreadTextEncoding())))
-                return;
-
-        // Redirection is acessible only by one thread per time
-        // dont move the guard behind the bInRedirection check!!!
-        // think of nested calls (when called from callback)
-        osl::MutexGuard aGuard( pRedirectMutex );
-
-        // if already in redirection, dont redirect
-        if ( bInRedirection )
-                return;
-
-        // dont redirect on nested calls
-        bInRedirection = sal_True;
-
-        // convert to URL
-#ifndef UNX
-        for ( sal_Unicode *p = (sal_Unicode*)aURL.GetBuffer(); *p; ++p )
-                if ( '\\' == *p ) *p = '/';
-                else if ( ':' == *p ) *p = '|';
-#endif
-
-        aURL.Insert( String("file:///", osl_getThreadTextEncoding()), 0 );
-
-        // do redirection
-        if ( !_pRedirector )
-        {
-            pRedirectMutex = new osl::Mutex;
-            _pRedirector = new FSysRedirector;
-        }
-
-        bInRedirection = sal_False;
-        return;
-}
-
-//--------------------------------------------------------------------
-
 class DirEntryStack
 {
 private:
@@ -966,7 +910,6 @@ sal_Bool DirEntry::First()
     FSysFailOnErrorImpl();
 
         String    aUniPathName( GetPath().GetFull() );
-        FSysRedirector::DoRedirect( aUniPathName );
         rtl::OString aPathName(rtl::OUStringToOString(aUniPathName, osl_getThreadTextEncoding()));
 
         DIR *pDir = opendir(aPathName.getStr());
@@ -1667,7 +1610,6 @@ DirEntry DirEntry::TempName( DirEntryKind eKind ) const
                                 // Redirect
                 String aRetVal(ret_val, osl_getThreadTextEncoding());
                                 String aRedirected (aRetVal);
-                                FSysRedirector::DoRedirect( aRedirected );
                                 if ( FSYS_KIND_DIR == eKind )
                                 {
                                                 if (0 == _mkdir(rtl::OUStringToOString(aRedirected, osl_getThreadTextEncoding()).getStr()))
@@ -1764,7 +1706,6 @@ sal_Bool DirEntry::MakeDir( sal_Bool bSloppy ) const
                         {
                                 FSysFailOnErrorImpl();
                                 String aDirName(pNewDir->GetFull());
-                                FSysRedirector::DoRedirect( aDirName );
                                 rtl::OString bDirName(rtl::OUStringToOString(aDirName, osl_getThreadTextEncoding()));
 
 #ifdef WIN32
@@ -1850,12 +1791,8 @@ FSysError DirEntry::MoveTo( const DirEntry& rNewName ) const
         FSysFailOnErrorImpl();
         String aFrom( GetFull() );
 
-        FSysRedirector::DoRedirect(aFrom);
-
         String aTo( aDest.GetFull() );
 
-        FSysRedirector::DoRedirect(aTo);
-
         rtl::OString bFrom(rtl::OUStringToOString(aFrom, osl_getThreadTextEncoding()));
         rtl::OString bTo(rtl::OUStringToOString(aTo, osl_getThreadTextEncoding()));
 
@@ -1993,7 +1930,6 @@ FSysError DirEntry::Kill(  FSysAction nActions ) const
 
         // Name als doppelt 0-terminierter String
         String aTmpName( GetFull() );
-        FSysRedirector::DoRedirect( aTmpName );
         rtl::OString bTmpName(rtl::OUStringToOString(aTmpName, osl_getThreadTextEncoding()));
 
         char *pName = new char[bTmpName.getLength()+2];
diff --git a/tools/source/fsys/wntmsc.cxx b/tools/source/fsys/wntmsc.cxx
index 962fae3..ef7dba8 100644
--- a/tools/source/fsys/wntmsc.cxx
+++ b/tools/source/fsys/wntmsc.cxx
@@ -666,7 +666,6 @@ sal_Bool FileStat::Update( const DirEntry& rDirEntry, sal_Bool bForceAccess )
 
         // Redirect
         String aPath( rDirEntry.GetFull() );
-        FSysRedirector::DoRedirect( aPath );
         DirEntry aDirEntry( aPath );
 
         // ist ein Medium im Laufwerk?
diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx
index 3709f00..425a68f 100644
--- a/tools/source/stream/strmunx.cxx
+++ b/tools/source/stream/strmunx.cxx
@@ -687,7 +687,6 @@ void SvFileStream::Open( const String& rFilename, StreamMode nOpenMode )
 //    !!! DirEntry aDirEntry( rFilename );
 //    !!! aFilename = aDirEntry.GetFull();
     aFilename = rFilename;
-    FSysRedirector::DoRedirect( aFilename );
     rtl::OString aLocalFilename(rtl::OUStringToOString(aFilename, osl_getThreadTextEncoding()));
 
 #ifdef DBG_UTIL
diff --git a/tools/source/stream/strmwnt.cxx b/tools/source/stream/strmwnt.cxx
index c1c6f13..d0d3556 100644
--- a/tools/source/stream/strmwnt.cxx
+++ b/tools/source/stream/strmwnt.cxx
@@ -396,7 +396,6 @@ void SvFileStream::Open( const String& rFilename, StreamMode nMode )
     //    !!! aFilename = aDirEntry.GetFull();
     aFilename = aParsedFilename;
     rtl::OString aFileNameA(rtl::OUStringToOString(aFilename, osl_getThreadTextEncoding()));
-    FSysRedirector::DoRedirect( aFilename );
     SetLastError( ERROR_SUCCESS );  // ggf. durch Redirector geaendert!
 
     DWORD   nOpenAction;


More information about the Libreoffice-commits mailing list