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

Michael Meeks michael at kemper.freedesktop.org
Fri Jan 20 06:56:37 PST 2012


 tools/inc/tools/fsys.hxx     |   15 ---------------
 tools/inc/tools/stream.hxx   |   10 +++++-----
 tools/source/fsys/dirent.cxx |   26 +++++---------------------
 3 files changed, 10 insertions(+), 41 deletions(-)

New commits:
commit 9e5ad09552c8e3beba619a46d3bec6a508d877b2
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Fri Jan 20 14:55:06 2012 +0000

    cleanup: privatise SvStream's LockFile impl. and in-line Redirector bits

diff --git a/tools/inc/tools/fsys.hxx b/tools/inc/tools/fsys.hxx
index 33cb5e1..4160e19 100644
--- a/tools/inc/tools/fsys.hxx
+++ b/tools/inc/tools/fsys.hxx
@@ -453,21 +453,6 @@ class FSysRedirector
     static sal_Bool             _bEnabled;
 
 public:
-    /** This method must called with the one and only instance of the
-        subclass which implements the redirection.
-
-        <P>It must be called with 0 when the instance is destroyed.
-     */
-    static void             Register( FSysRedirector *pRedirector );
-
-    //-----------------------------------------------------------------------
-    /** This method returns the currently registererd instance of
-        a subclass which implements the redirection.
-
-        <P>If no redirector is registered, it returns 0.
-     */
-    static FSysRedirector*  Redirector();
-
     //-----------------------------------------------------------------------
     /** This method is to be used to redirect a file system path.
 
diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx
index 8c7fa0c..e8f414b 100644
--- a/tools/inc/tools/stream.hxx
+++ b/tools/inc/tools/stream.hxx
@@ -586,6 +586,11 @@ private:
     SvFileStream (const SvFileStream&);
     SvFileStream & operator= (const SvFileStream&);
 
+    sal_Bool LockRange( sal_Size nByteOffset, sal_Size nBytes );
+    sal_Bool UnlockRange( sal_Size nByteOffset, sal_Size nBytes );
+    sal_Bool LockFile();
+    sal_Bool UnlockFile();
+
 protected:
 
     virtual sal_Size    GetData( void* pData, sal_Size nSize );
@@ -602,11 +607,6 @@ public:
 
     virtual void    ResetError();
 
-    sal_Bool            LockRange( sal_Size nByteOffset, sal_Size nBytes );
-    sal_Bool            UnlockRange( sal_Size nByteOffset, sal_Size nBytes );
-    sal_Bool            LockFile();
-    sal_Bool            UnlockFile();
-
     void            Open( const String& rFileName, StreamMode eOpenMode );
     void            Close();
     sal_Bool            IsOpen() const { return bIsOpen; }
diff --git a/tools/source/fsys/dirent.cxx b/tools/source/fsys/dirent.cxx
index e52fbba..2f726d0 100644
--- a/tools/source/fsys/dirent.cxx
+++ b/tools/source/fsys/dirent.cxx
@@ -140,17 +140,6 @@ sal_Bool bInRedirection = sal_False;
 static osl::Mutex* pRedirectMutex = 0;
 
 //------------------------------------------------------------------------
-void FSysRedirector::Register( FSysRedirector *pRedirector )
-{
-        if ( pRedirector )
-            pRedirectMutex = new osl::Mutex;
-        else
-                DELETEZ( pRedirectMutex );
-        _pRedirector = pRedirector;
-}
-
-//------------------------------------------------------------------------
-
 void FSysRedirector::DoRedirect( String &rPath )
 {
         String aURL(rPath);
@@ -185,21 +174,16 @@ void FSysRedirector::DoRedirect( String &rPath )
         aURL.Insert( String("file:///", osl_getThreadTextEncoding()), 0 );
 
         // do redirection
-        Redirector();
+        if ( !_pRedirector )
+        {
+            pRedirectMutex = new osl::Mutex;
+            _pRedirector = new FSysRedirector;
+        }
 
         bInRedirection = sal_False;
         return;
 }
 
-//------------------------------------------------------------------------
-
-FSysRedirector* FSysRedirector::Redirector()
-{
-        if ( !_pRedirector )
-                Register( new FSysRedirector );
-        return _pRedirector;
-}
-
 #endif // BOOTSTRAP
 
 //--------------------------------------------------------------------


More information about the Libreoffice-commits mailing list