summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2012-01-20 14:55:06 +0000
committerMichael Meeks <michael.meeks@suse.com>2012-01-20 14:56:25 +0000
commit9e5ad09552c8e3beba619a46d3bec6a508d877b2 (patch)
treeb417c34ca7a3b0ba32befaa8bd8e40791cde3032 /tools
parentc82ed24c4e51492105b5d94e164ece3cf86d6d86 (diff)
cleanup: privatise SvStream's LockFile impl. and in-line Redirector bits
Diffstat (limited to 'tools')
-rw-r--r--tools/inc/tools/fsys.hxx15
-rw-r--r--tools/inc/tools/stream.hxx10
-rw-r--r--tools/source/fsys/dirent.cxx26
3 files changed, 10 insertions, 41 deletions
diff --git a/tools/inc/tools/fsys.hxx b/tools/inc/tools/fsys.hxx
index 33cb5e13ceb5..4160e190062c 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 8c7fa0c58e44..e8f414bfc987 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 e52fbba51ddc..2f726d03fe66 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
//--------------------------------------------------------------------