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

2012-02-23 Thread Caolán McNamara
 tools/inc/tools/string.hxx   |7 ---
 tools/source/string/strimp.cxx   |   86 ---
 tools/source/string/tstring.cxx  |   13 -
 tools/source/string/tustring.cxx |   86 +++
 unusedcode.easy  |4 -
 5 files changed, 87 insertions(+), 109 deletions(-)

New commits:
commit 67f67509ff20c0d5b6e9f3557fb1e427655601ee
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Feb 23 15:57:11 2012 +

lock in ByteString gains

diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx
index c232c07..7fe2c10 100644
--- a/tools/inc/tools/string.hxx
+++ b/tools/inc/tools/string.hxx
@@ -156,6 +156,7 @@ private:
 voidAssign(int); // not implemented; to detect misuses of
  // Assign(sal_Char)
 ByteString Assign( const sal_Char* pCharStr, xub_StrLen nLen );  
//not implemented, to detect use of removed methods without compiler making 
something to fit
+ByteString Assign( const sal_Char* pCharStr ); //not implemented, 
to detect use of removed methods without compiler making something to fit
 ByteString operator =(const sal_Char); //not implemented, to 
detect use of removed methods without compiler making something to fit
 
 ByteString Assign(sal_Char); //not implemented, to detect use of 
removed methods without compiler making something to fit
@@ -187,7 +188,6 @@ public:
 
 ByteString Assign( const ByteString rStr );
 ByteString Assign( const rtl::OString rStr );
-ByteString Assign( const sal_Char* pCharStr );
 ByteString operator =( const ByteString rStr )
 { return Assign( rStr ); }
 ByteString operator =( const rtl::OString rStr )
@@ -220,16 +220,11 @@ public:
 StringCompare   CompareIgnoreCaseToAscii( const sal_Char* pCharStr,
   xub_StrLen nLen = STRING_LEN 
) const;
 sal_BoolEquals( const sal_Char* pCharStr ) const;
-sal_BoolEqualsIgnoreCaseAscii( const sal_Char* pCharStr ) 
const;
 
 xub_StrLen  Search( sal_Char c, xub_StrLen nIndex = 0 ) const;
 xub_StrLen  Search( const ByteString rStr, xub_StrLen nIndex = 0 
) const;
 xub_StrLen  Search( const sal_Char* pCharStr, xub_StrLen nIndex = 
0 ) const;
 
-xub_StrLen  SearchAndReplace( const ByteString rStr, const 
ByteString rRepStr,
-  xub_StrLen nIndex = 0 );
-xub_StrLen  SearchAndReplace( const sal_Char* pCharStr, const 
ByteString rRepStr,
-  xub_StrLen nIndex = 0 );
 voidSearchAndReplaceAll( sal_Char c, sal_Char cRep );
 
 ByteString  GetToken( xub_StrLen nToken, sal_Char cTok = ';' ) 
const;
diff --git a/tools/source/string/strimp.cxx b/tools/source/string/strimp.cxx
index 1eef75d..dd00878 100644
--- a/tools/source/string/strimp.cxx
+++ b/tools/source/string/strimp.cxx
@@ -60,34 +60,6 @@ static sal_Int32 ImplStringCompareWithoutZero( const 
STRCODE* pStr1, const STRCO
 return nRet;
 }
 
-// ---
-
-static sal_Int32 ImplStringICompare( const STRCODE* pStr1, const STRCODE* 
pStr2 )
-{
-sal_Int32   nRet;
-STRCODE c1;
-STRCODE c2;
-do
-{
-// Ist das Zeichen zwischen 'A' und 'Z' dann umwandeln
-c1 = *pStr1;
-c2 = *pStr2;
-if ( (c1 = 65)  (c1 = 90) )
-c1 += 32;
-if ( (c2 = 65)  (c2 = 90) )
-c2 += 32;
-nRet = ((sal_Int32)((STRCODEU)c1))-((sal_Int32)((STRCODEU)c2));
-if ( nRet != 0 )
-break;
-
-++pStr1,
-++pStr2;
-}
-while ( c2 );
-
-return nRet;
-}
-
 // ===
 
 #ifdef DBG_UTIL
@@ -280,39 +252,6 @@ STRING STRING::Assign( const STRING rStr )
 
 // ---
 
-STRING STRING::Assign( const STRCODE* pCharStr )
-{
-DBG_CHKTHIS( STRING, DBGCHECKSTRING );
-DBG_ASSERT( pCharStr, String::Assign() - pCharStr is NULL );
-
-// Stringlaenge ermitteln
-xub_StrLen nLen = ImplStringLen( pCharStr );
-
-if ( !nLen )
-{
-STRING_NEW((STRING_TYPE **)mpData);
-}
-else
-{
-// Wenn String genauso lang ist, wie der String, dann direkt kopieren
-if ( (nLen == mpData-mnLen)  (mpData-mnRefCount == 1) )
-memcpy( mpData-maStr, pCharStr, nLen*sizeof( STRCODE ) );
-else
-{
-// Alte Daten loeschen
-STRING_RELEASE((STRING_TYPE *)mpData);
-
-// Daten initialisieren und String kopieren
-mpData = ImplAllocData( nLen );
-memcpy( mpData-maStr, pCharStr, 

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

2012-02-21 Thread Michael Meeks
 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 el...@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.
-
-POne 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.
-
-PIt will not redirect while redirection is disabled.
-
-PIt may block while another thread is accessing the redirector
-or another thread has disabled redirections.
-
-@param String rPathBR
-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_BoolBR
-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();
 
 StringaUniPathName( GetPath().GetFull() );
-FSysRedirector::DoRedirect( aUniPathName );
 rtl::OString aPathName(rtl::OUStringToOString(aUniPathName, 
osl_getThreadTextEncoding()));
 
 

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

2012-02-15 Thread Caolán McNamara
 tools/inc/tools/string.hxx   |   55 
 tools/source/string/strimp.cxx   |  513 ---
 tools/source/string/tstring.cxx  |   50 ---
 tools/source/string/tustring.cxx |  513 +++
 unusedcode.easy  |   19 -
 5 files changed, 526 insertions(+), 624 deletions(-)

New commits:
commit 48649cdfb8671fb49a28b33c1ba1cd71c0999a07
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Feb 15 10:05:30 2012 +

lock in those ByteString gains so there's no back-sliding

diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx
index b91170a..c232c07 100644
--- a/tools/inc/tools/string.hxx
+++ b/tools/inc/tools/string.hxx
@@ -148,26 +148,36 @@ private:
 sal_uInt32 nCvtFlags = 
UNISTRING_TO_BYTESTRING_CVTFLAGS ); //not implemented, to detect use of removed 
methods without compiler making something to fit
 ByteString( const sal_Unicode* pUniStr, xub_StrLen 
nLen,
 rtl_TextEncoding eTextEncoding,
-sal_uInt32 nCvtFlags = 
UNISTRING_TO_BYTESTRING_CVTFLAGS ); //not implemented, to detect use of removed 
methods without compiler making somethiing to fit
+sal_uInt32 nCvtFlags = 
UNISTRING_TO_BYTESTRING_CVTFLAGS ); //not implemented, to detect use of removed 
methods without compiler making something to fit
 ByteString( const UniString rUniStr,
 rtl_TextEncoding eTextEncoding,
-sal_uInt32 nCvtFlags = 
UNISTRING_TO_BYTESTRING_CVTFLAGS ); //not implemented, to detect use of removed 
methods without compiler making somethiing to fit
+sal_uInt32 nCvtFlags = 
UNISTRING_TO_BYTESTRING_CVTFLAGS ); //not implemented, to detect use of removed 
methods without compiler making something to fit
+ByteString( const sal_Char* pCharStr, xub_StrLen nLen 
); //not implemented, to detect use of removed methods without compiler making 
something to fit
 voidAssign(int); // not implemented; to detect misuses of
  // Assign(sal_Char)
+ByteString Assign( const sal_Char* pCharStr, xub_StrLen nLen );  
//not implemented, to detect use of removed methods without compiler making 
something to fit
+ByteString operator =(const sal_Char); //not implemented, to 
detect use of removed methods without compiler making something to fit
+
+ByteString Assign(sal_Char); //not implemented, to detect use of 
removed methods without compiler making something to fit
 voidoperator =(int); // not implemented; to detect misuses
  // of operator =(sal_Char)
 voidAppend(int); // not implemented; to detect misuses of
  // Append(char)
+ByteString Append( const sal_Char* pCharStr, xub_StrLen nLen ); 
// not implemented, to detect use of removed methods without compiler making 
something to fit
+ByteString operator +=(sal_Char); //not implemented, to detect 
use of removed methods without compiler making something to fit
+ByteString Append( char c ); //not implemented, to detect use of 
removed methods without compiler making something to fit
 voidoperator +=(int); // not implemented; to detect misuses
   // of operator +=(sal_Char)
 
+friend sal_Bool operator == ( const ByteString rStr1,  const 
ByteString rStr2 ); //not implemented, to detect use of removed methods 
without compiler making something to fit
+friend sal_Bool operator   ( const ByteString rStr1,  const 
ByteString rStr2 ); //not implemented, to detect use of removed methods 
without compiler making something to fit
+friend sal_Bool operator   ( const ByteString rStr1,  const 
ByteString rStr2 ); //not implemented, to detect use of removed methods 
without compiler making something to fit
 public:
 ByteString();
 ByteString( const ByteString rStr );
 ByteString( const ByteString rStr, xub_StrLen nPos, 
xub_StrLen nLen );
 ByteString( const rtl::OString rStr );
 ByteString( const sal_Char* pCharStr );
-ByteString( const sal_Char* pCharStr, xub_StrLen nLen 
);
 ~ByteString();
 
 operator rtl::OString () const
@@ -178,27 +188,19 @@ public:
 ByteString Assign( const ByteString rStr );
 ByteString Assign( const rtl::OString rStr );
 ByteString Assign( const sal_Char* pCharStr );
-ByteString Assign( const sal_Char* pCharStr, xub_StrLen nLen );
- 

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

2012-01-23 Thread Muthu Subramanian
 tools/inc/tools/fsys.hxx|4 
 tools/source/fsys/comdep.hxx|2 --
 tools/source/fsys/dirent.cxx|   22 --
 tools/source/fsys/tdir.cxx  |2 --
 tools/source/fsys/wntmsc.cxx|2 --
 tools/source/stream/strmunx.cxx |8 
 tools/source/stream/strmwnt.cxx |2 --
 7 files changed, 42 deletions(-)

New commits:
commit 7735b09b5e10e366ffb3a156790316ea0ccfa0a0
Author: Thomas Collerton tom.col...@gmail.com
Date:   Mon Jan 23 14:04:47 2012 +0530

fdo#44988: Remove obsolete BOOTSTRAP defines.

diff --git a/tools/inc/tools/fsys.hxx b/tools/inc/tools/fsys.hxx
index 3d2dfa8..3ec1799 100644
--- a/tools/inc/tools/fsys.hxx
+++ b/tools/inc/tools/fsys.hxx
@@ -425,9 +425,6 @@ public:
 DirEntry   operator []( size_t nIndex ) const;
 };
 
-// we don't need this stuff for bootstraping
-#ifndef BOOTSTRAP
-
 //
 
 /** FSysRedirector is an abstract base class for a hook to redirect
@@ -464,7 +461,6 @@ public:
 static void DoRedirect( String rPath );
 };
 
-#endif // BOOTSTRP
 
 #if defined(DBG_UTIL)
 void FSysTest();
diff --git a/tools/source/fsys/comdep.hxx b/tools/source/fsys/comdep.hxx
index 1728116..193041b 100644
--- a/tools/source/fsys/comdep.hxx
+++ b/tools/source/fsys/comdep.hxx
@@ -76,10 +76,8 @@ struct DirReader_Impl
 bReady ( sal_False ),
 bInUse( sal_False )
 {
-#ifndef BOOTSTRAP
 // Redirection
 FSysRedirector::DoRedirect( aPath );
-#endif
 
 // nur den String der Memer-Var nehmen!
 
diff --git a/tools/source/fsys/dirent.cxx b/tools/source/fsys/dirent.cxx
index a0d3d8e..38138f8 100644
--- a/tools/source/fsys/dirent.cxx
+++ b/tools/source/fsys/dirent.cxx
@@ -128,8 +128,6 @@ int Sys2SolarError_Impl( int nSysErr )
 
 //
 
-#ifndef BOOTSTRAP
-
 FSysRedirector* FSysRedirector::_pRedirector = 0;
 sal_Bool FSysRedirector::_bEnabled = sal_True;
 #ifdef UNX
@@ -184,8 +182,6 @@ void FSysRedirector::DoRedirect( String rPath )
 return;
 }
 
-#endif // BOOTSTRAP
-
 //
 
 class DirEntryStack
@@ -738,11 +734,9 @@ DirEntry::DirEntry( const String rInitName, FSysPathStyle 
eStyle )
 rtl::OString aTmpName(rtl::OUStringToOString(rInitName, 
osl_getThreadTextEncoding()));
 if (comphelper::string::matchIgnoreAsciiCaseL(aTmpName, 
RTL_CONSTASCII_STRINGPARAM(file:)))
 {
-#ifndef BOOTSTRAP
 DBG_WARNING( File URLs are not permitted but accepted );
 aTmpName = rtl::OUStringToOString(INetURLObject( rInitName 
).PathToFileName(), osl_getThreadTextEncoding());
 eStyle = FSYS_STYLE_HOST;
-#endif // BOOTSTRAP
 }
 else
 {
@@ -792,11 +786,9 @@ DirEntry::DirEntry( const rtl::OString rInitName, 
FSysPathStyle eStyle )
 rtl::OString aTmpName( rInitName );
 if (comphelper::string::matchIgnoreAsciiCaseL(aTmpName, 
RTL_CONSTASCII_STRINGPARAM(file:)))
 {
-#ifndef BOOTSTRAP
 DBG_WARNING( File URLs are not permitted but accepted );
 aTmpName = rtl::OUStringToOString(INetURLObject( rInitName 
).PathToFileName(), osl_getThreadTextEncoding());
 eStyle = FSYS_STYLE_HOST;
-#endif
 }
 #ifdef DBG_UTIL
 else
@@ -916,10 +908,8 @@ DirEntry* DirEntry::ImpChangeParent( DirEntry* pNewParent, 
sal_Bool bNormalize )
 
 sal_Bool DirEntry::Exists( FSysAccess nAccess ) const
 {
-#ifndef BOOTSTRAP
 static osl::Mutex aLocalMutex;
 osl::MutexGuard aGuard( aLocalMutex );
-#endif
 if ( !IsValid() )
 return sal_False;
 
@@ -968,9 +958,7 @@ sal_Bool DirEntry::First()
 FSysFailOnErrorImpl();
 
 StringaUniPathName( GetPath().GetFull() );
-#ifndef BOOTSTRAP
 FSysRedirector::DoRedirect( aUniPathName );
-#endif
 rtl::OString aPathName(rtl::OUStringToOString(aUniPathName, 
osl_getThreadTextEncoding()));
 
 DIR *pDir = opendir(aPathName.getStr());
@@ -1724,9 +1712,7 @@ DirEntry DirEntry::TempName( DirEntryKind eKind ) const
 // Redirect
 String aRetVal(ret_val, osl_getThreadTextEncoding());
 String aRedirected (aRetVal);
-#ifndef BOOTSTRAP
 FSysRedirector::DoRedirect( aRedirected );
-#endif
 if ( FSYS_KIND_DIR == eKind )
 {
 if (0 == 
_mkdir(rtl::OUStringToOString(aRedirected, 
osl_getThreadTextEncoding()).getStr()))
@@ -1823,9 +1809,7 @@ sal_Bool DirEntry::MakeDir( sal_Bool bSloppy ) const
 {
 FSysFailOnErrorImpl();
 String aDirName(pNewDir-GetFull());
-#ifndef BOOTSTRAP
   

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

2012-01-20 Thread Michael Meeks
 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.me...@suse.com
Date:   Fri Jan 20 14:55:06 2012 +

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.
-
-PIt 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.
-
-PIf 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_SizeGetData( void* pData, sal_Size nSize );
@@ -602,11 +607,6 @@ public:
 
 virtual voidResetError();
 
-sal_BoolLockRange( sal_Size nByteOffset, sal_Size nBytes );
-sal_BoolUnlockRange( sal_Size nByteOffset, sal_Size nBytes );
-sal_BoolLockFile();
-sal_BoolUnlockFile();
-
 voidOpen( const String rFileName, StreamMode eOpenMode );
 voidClose();
 sal_BoolIsOpen() 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
 
 //
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-01-15 Thread Takeshi Abe
 tools/inc/tools/resmgr.hxx  |2 --
 tools/source/fsys/tdir.cxx  |2 --
 tools/source/fsys/unx.hxx   |2 --
 tools/source/fsys/wntmsc.hxx|2 --
 tools/source/generic/config.cxx |2 --
 tools/source/rc/resmgr.cxx  |4 
 6 files changed, 14 deletions(-)

New commits:
commit 1074c1ab9ee4aa537ea18a3128121ef591bd803f
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Mon Jan 16 07:38:19 2012 +0900

removed unused macro

diff --git a/tools/inc/tools/resmgr.hxx b/tools/inc/tools/resmgr.hxx
index 7e7e7ce..8000e5a 100644
--- a/tools/inc/tools/resmgr.hxx
+++ b/tools/inc/tools/resmgr.hxx
@@ -37,8 +37,6 @@
 #define CREATEVERSIONRESMGR_NAME( Name )   #Name
 #define CREATEVERSIONRESMGR( Name )ResMgr::CreateResMgr( 
CREATEVERSIONRESMGR_NAME( Name ) )
 
-#define LOCALE_MAX_FALLBACK 6
-
 #include vector
 
 class SvStream;
diff --git a/tools/source/fsys/tdir.cxx b/tools/source/fsys/tdir.cxx
index eef2a03..0747c70 100644
--- a/tools/source/fsys/tdir.cxx
+++ b/tools/source/fsys/tdir.cxx
@@ -39,8 +39,6 @@
 
 DBG_NAME( Dir )
 
-#define APPEND (sal_uInt16) 65535
-
 /*
 |*
 |*Dir::InsertPointReached()
diff --git a/tools/source/fsys/unx.hxx b/tools/source/fsys/unx.hxx
index a930f83..d6e74e1 100644
--- a/tools/source/fsys/unx.hxx
+++ b/tools/source/fsys/unx.hxx
@@ -35,9 +35,7 @@
 #include sys/param.h
 #include dirent.h
 #include unistd.h
-/* #include sysent.h */
 
-#define FSYS_UNIX TRUE
 #define DRIVE_EXISTS(c) ( TRUE )
 
 #define _mkdir(p)   mkdir(p, 0777)
diff --git a/tools/source/fsys/wntmsc.hxx b/tools/source/fsys/wntmsc.hxx
index b7b3391..6cda2a1 100644
--- a/tools/source/fsys/wntmsc.hxx
+++ b/tools/source/fsys/wntmsc.hxx
@@ -45,8 +45,6 @@
 
 //
 
-#define FSYS_UNIX sal_False
-
 #define DOS_DIRECT  _A_SUBDIR
 #define DOS_VOLUMEID0x08
 #ifndef S_IFBLK
diff --git a/tools/source/generic/config.cxx b/tools/source/generic/config.cxx
index ed21da9..dc0c08b 100644
--- a/tools/source/generic/config.cxx
+++ b/tools/source/generic/config.cxx
@@ -45,8 +45,6 @@
 #include osl/security.h
 #include rtl/strbuf.hxx
 
-#define MAXBUFLEN   1024// Fuer Buffer bei VOS-Funktionen
-
 // -
 // - ImplConfigData -
 // -
diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx
index 5bc5d2c..68c8b4c 100644
--- a/tools/source/rc/resmgr.cxx
+++ b/tools/source/rc/resmgr.cxx
@@ -57,15 +57,11 @@
 #include set
 
 #ifdef UNX
-#define SEARCH_PATH_DELIMITER_CHAR_STRING :
 #define SEARCH_PATH_DELIMITER ':'
 #else
-#define SEARCH_PATH_DELIMITER_CHAR_STRING ;
 #define SEARCH_PATH_DELIMITER ';'
 #endif
 
-#define SEARCH_PATH_DELIMITER_STRING ::rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( SEARCH_PATH_DELIMITER_CHAR_STRING ) )
-
 using ::rtl::OUString;
 using ::rtl::OString;
 using ::rtl::OUStringBuffer;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2011-12-22 Thread August Sodora
 tools/inc/tools/pstm.hxx  |5 +++
 tools/inc/tools/stream.hxx|1 
 tools/inc/tools/svborder.hxx  |1 
 tools/source/generic/svborder.cxx |   18 +++
 tools/source/ref/pstm.cxx |   58 ++
 tools/source/stream/strmunx.cxx   |   11 +++
 6 files changed, 94 insertions(+)

New commits:
commit a0ebf6ee3f555397205713db966aee44de80c0f9
Author: August Sodora aug...@gmail.com
Date:   Thu Dec 22 20:29:18 2011 -0500

Revert callcatcher: Remove unused code

This reverts commit bbad7057b2bdb614a5e97a945039323efe39c4ee.

diff --git a/tools/inc/tools/pstm.hxx b/tools/inc/tools/pstm.hxx
index 125875c..68b4932 100644
--- a/tools/inc/tools/pstm.hxx
+++ b/tools/inc/tools/pstm.hxx
@@ -127,6 +127,7 @@ class TOOLS_DLLPUBLIC SvPersistBaseMemberList : public 
SuperSvPersistBaseMemberL
 {
 public:
 SvPersistBaseMemberList();
+SvPersistBaseMemberList(sal_uInt16 nInitSz, sal_uInt16 nResize );
 
 void   WriteObjects( SvPersistStream , sal_Bool bOnlyStreamedObj = 
sal_False ) const;
 TOOLS_DLLPUBLIC friend SvPersistStream operator  (SvPersistStream , 
const SvPersistBaseMemberList );
@@ -216,6 +217,8 @@ public:
 
 SvPersistStream( SvClassManager , SvStream * pStream,
  sal_uInt32 nStartIdx = 1 );
+SvPersistStream( SvClassManager , SvStream * pStream,
+ const SvPersistStream  rPersStm );
 ~SvPersistStream();
 
 voidSetStream( SvStream * pStream );
@@ -244,6 +247,8 @@ public:
 // gespeichert werden.
 friend SvStream operator  ( SvStream , SvPersistStream  );
 friend SvStream operator  ( SvStream , SvPersistStream  );
+sal_uIntPtr InsertObj( SvPersistBase * );
+sal_uIntPtr RemoveObj( SvPersistBase * );
 };
 
 #endif // _PSTM_HXX
diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx
index decae49..2270eff 100644
--- a/tools/inc/tools/stream.hxx
+++ b/tools/inc/tools/stream.hxx
@@ -651,6 +651,7 @@ public:
 sal_BoolLockRange( sal_Size nByteOffset, sal_Size nBytes );
 sal_BoolUnlockRange( sal_Size nByteOffset, sal_Size nBytes );
 sal_BoolLockFile();
+sal_BoolUnlockFile();
 
 voidOpen( const String rFileName, StreamMode eOpenMode );
 voidClose();
diff --git a/tools/inc/tools/svborder.hxx b/tools/inc/tools/svborder.hxx
index 27ccdd0..86c5feb 100644
--- a/tools/inc/tools/svborder.hxx
+++ b/tools/inc/tools/svborder.hxx
@@ -40,6 +40,7 @@ public:
 { nTop = nRight = nBottom = nLeft = 0; }
 SvBorder( const Size  rSz )
 { nTop = nBottom = rSz.Height(); nRight = nLeft = rSz.Width(); }
+SvBorder( const Rectangle  rOuter, const Rectangle  rInner );
 SvBorder( long nLeftP, long nTopP, long nRightP, long nBottomP )
 { nLeft = nLeftP; nTop = nTopP; nRight = nRightP; nBottom = nBottomP; }
 sal_Booloperator == ( const SvBorder  rObj ) const
diff --git a/tools/source/generic/svborder.cxx 
b/tools/source/generic/svborder.cxx
index 6b9f0d6..0c55c95 100644
--- a/tools/source/generic/svborder.cxx
+++ b/tools/source/generic/svborder.cxx
@@ -30,6 +30,24 @@
 #include tools/svborder.hxx
 #include osl/diagnose.h
 
+SvBorder::SvBorder( const Rectangle  rOuter, const Rectangle  rInner )
+{
+Rectangle aOuter( rOuter );
+aOuter.Justify();
+Rectangle aInner( rInner );
+if( aInner.IsEmpty() )
+aInner = Rectangle( aOuter.Center(), aOuter.Center() );
+else
+aInner.Justify();
+
+OSL_ENSURE( aOuter.IsInside( aInner ),
+SvBorder::SvBorder: sal_False == aOuter.IsInside( aInner ) );
+nTop= aInner.Top()- aOuter.Top();
+nRight  = aOuter.Right()  - aInner.Right();
+nBottom = aOuter.Bottom() - aInner.Bottom();
+nLeft   = aInner.Left()   - aOuter.Left();
+}
+
 Rectangle  operator += ( Rectangle  rRect, const SvBorder  rBorder )
 {
 // wegen Empty-Rect, GetSize muss als erstes gerufen werden
diff --git a/tools/source/ref/pstm.cxx b/tools/source/ref/pstm.cxx
index 4956a6a..a91b078 100644
--- a/tools/source/ref/pstm.cxx
+++ b/tools/source/ref/pstm.cxx
@@ -62,6 +62,9 @@ TYPEINIT0( SvRttiBase );
 /** SvPersistBaseMemberList **/
 
 SvPersistBaseMemberList::SvPersistBaseMemberList(){}
+SvPersistBaseMemberList::SvPersistBaseMemberList(
+sal_uInt16 nInitSz, sal_uInt16 nResize )
+: SuperSvPersistBaseMemberList( nInitSz, nResize ){}
 
 #define PERSIST_LIST_VER(sal_uInt8)0
 #define PERSIST_LIST_DBGUTIL(sal_uInt8)0x80
@@ -197,6 +200,44 @@ SvPersistStream::SvPersistStream
 }
 
 //=
+SvPersistStream::SvPersistStream
+(
+SvClassManager  rMgr,  /* Alle Factorys, deren Objekt geladen und
+  

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

2011-12-14 Thread Caolán McNamara
 tools/inc/tools/string.hxx |6 +++---
 tools/source/string/strcvt.cxx |   13 -
 2 files changed, 3 insertions(+), 16 deletions(-)

New commits:
commit f356303302630f1d1d4a99189fc0c26f7f338911
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Dec 14 13:39:14 2011 +

strip ByteClass down some more

diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx
index 527062d..8f3be40 100644
--- a/tools/inc/tools/string.hxx
+++ b/tools/inc/tools/string.hxx
@@ -163,6 +163,9 @@ private:
 ByteString( const sal_Unicode* pUniStr, xub_StrLen 
nLen,
 rtl_TextEncoding eTextEncoding,
 sal_uInt32 nCvtFlags = 
UNISTRING_TO_BYTESTRING_CVTFLAGS ); //not implemented, to detect use of removed 
methods without compiler making somethiing to fit
+ByteString( const UniString rUniStr,
+rtl_TextEncoding eTextEncoding,
+sal_uInt32 nCvtFlags = 
UNISTRING_TO_BYTESTRING_CVTFLAGS ); //not implemented, to detect use of removed 
methods without compiler making somethiing to fit
 voidAssign(int); // not implemented; to detect misuses of
  // Assign(sal_Char)
 voidoperator =(int); // not implemented; to detect misuses
@@ -179,9 +182,6 @@ public:
 ByteString( const rtl::OString rStr );
 ByteString( const sal_Char* pCharStr );
 ByteString( const sal_Char* pCharStr, xub_StrLen nLen 
);
-ByteString( const UniString rUniStr,
-rtl_TextEncoding eTextEncoding,
-sal_uInt32 nCvtFlags = 
UNISTRING_TO_BYTESTRING_CVTFLAGS );
 ~ByteString();
 
 operator rtl::OString () const
diff --git a/tools/source/string/strcvt.cxx b/tools/source/string/strcvt.cxx
index 75f1934..0f4a145 100644
--- a/tools/source/string/strcvt.cxx
+++ b/tools/source/string/strcvt.cxx
@@ -29,19 +29,6 @@
 
 // ===
 
-ByteString::ByteString( const UniString rUniStr, rtl_TextEncoding 
eTextEncoding, sal_uInt32 nCvtFlags )
-{
-DBG_CTOR( ByteString, DbgCheckByteString );
-DBG_CHKOBJ( rUniStr, UniString, DbgCheckUniString );
-
-mpData = NULL;
-rtl_uString2String( (rtl_String **)(mpData),
-rUniStr.mpData-maStr, rUniStr.mpData-mnLen,
-eTextEncoding, nCvtFlags );
-}
-
-// ===
-
 ByteString::ByteString( const rtl::OString rStr )
 : mpData(NULL)
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2011-11-21 Thread Caolán McNamara
 tools/inc/tools/fsys.hxx   |   28 +--
 tools/source/fsys/comdep.hxx   |6 
 tools/source/fsys/dirent.cxx   |  341 -
 tools/source/fsys/filecopy.cxx |   10 -
 tools/source/fsys/fstat.cxx|   17 --
 tools/source/fsys/tdir.cxx |   13 -
 tools/source/fsys/wntmsc.cxx   |8 
 tools/source/fsys/wntmsc.hxx   |2 
 8 files changed, 213 insertions(+), 212 deletions(-)

New commits:
commit 2a2fbbecc04b1364216a5180f722fb72ed00d42d
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Nov 21 15:12:34 2011 +

ByteString-rtl::OString

diff --git a/tools/inc/tools/fsys.hxx b/tools/inc/tools/fsys.hxx
index ee64c7f..f4d01cd 100644
--- a/tools/inc/tools/fsys.hxx
+++ b/tools/inc/tools/fsys.hxx
@@ -223,13 +223,13 @@ friend class FileCopier;
 #ifdef FEAT_FSYS_DOUBLESPEED
 FileStat*   pStat;  // optional
 #endif
-ByteString  aName;
+rtl::OStringaName;
 DirEntry*   pParent;
 sal_uIntPtr nError;
 DirEntryFlageFlag;
 
 private:
-TOOLS_DLLPRIVATEDirEntry( const ByteString rInitName,
+TOOLS_DLLPRIVATEDirEntry( const rtl::OString rInitName,
   DirEntryFlag aDirFlag,
   FSysPathStyle eStyle );
 
@@ -237,13 +237,13 @@ private:
 friend class FileStat;
 friend const char* ImpCheckDirEntry( const void* p );
 
-TOOLS_DLLPRIVATE FSysError  ImpParseName( const ByteString 
rIntiName,
+TOOLS_DLLPRIVATE FSysError  ImpParseName( const rtl::OString 
rIntiName,
   FSysPathStyle eParser );
 #if defined(WNT)
-TOOLS_DLLPRIVATE FSysError  ImpParseOs2Name( const ByteString 
rPfad,
+TOOLS_DLLPRIVATE FSysError  ImpParseOs2Name( const rtl::OString 
rPfad,
  FSysPathStyle eStyle );
 #else
-TOOLS_DLLPRIVATE FSysError  ImpParseUnixName( const ByteString 
rPfad,
+TOOLS_DLLPRIVATE FSysError  ImpParseUnixName( const rtl::OString 
rPfad,
   FSysPathStyle eStyle );
 #endif
 TOOLS_DLLPRIVATE const DirEntry*ImpGetTopPtr() const;
@@ -251,7 +251,7 @@ private:
 
 protected:
 voidImpTrim( FSysPathStyle eStyle );
-const ByteString   ImpTheName() const;
+const rtl::OString ImpTheName() const;
 DirEntryFlagImpTheFlag() const { return eFlag; };
 DirEntry*   ImpChangeParent( DirEntry* pNewParent, sal_Bool 
bNormalize = sal_True );
 DirEntry*   ImpGetParent() { return pParent; }
@@ -266,7 +266,7 @@ protected:
 public:
 DirEntry( DirEntryFlag aDirFlag = FSYS_FLAG_CURRENT );
 DirEntry( const DirEntry rEntry );
-DirEntry( const ByteString rInitName,
+DirEntry( const rtl::OString rInitName,
FSysPathStyle eParser = FSYS_STYLE_HOST );
 DirEntry( const String rInitName,
FSysPathStyle eParser = FSYS_STYLE_HOST );
@@ -323,16 +323,16 @@ public:
 sal_Booloperator !=( const DirEntry rAnotherDir ) const
 { return !(DirEntry::operator==( rAnotherDir )); }
 
-inline StringCompare NameCompareDirect( const DirEntry rWith ) const
-{
+inline sal_Int32 NameCompareDirect( const DirEntry rWith ) const
+{
 #ifdef UNX
-return rWith.aName.CompareTo( aName );
+return rWith.aName.compareTo(aName);
 #else
-rtl::OString 
aThis(rtl::OString(aName).toAsciiLowerCase());
-rtl::OString 
aWith(rtl::OString(rWith.aName).toAsciiLowerCase());
-return 
static_castStringCompare(aWith.compareTo(aThis));
+rtl::OString aThis(rtl::OString(aName).toAsciiLowerCase());
+rtl::OString aWith(rtl::OString(rWith.aName).toAsciiLowerCase());
+return aWith.compareTo(aThis);
 #endif
-}
+}
 
 static String   GetAccessDelimiter( FSysPathStyle eFormatter = 
FSYS_STYLE_HOST );
 static String   GetSearchDelimiter( FSysPathStyle eFormatter = 
FSYS_STYLE_HOST );
diff --git a/tools/source/fsys/comdep.hxx b/tools/source/fsys/comdep.hxx
index 94dfdff..1728116 100644
--- a/tools/source/fsys/comdep.hxx
+++ b/tools/source/fsys/comdep.hxx
@@ -64,7 +64,7 @@ struct DirReader_Impl
 dirent* pDosEntry;
 DirEntry*   pParent;
 String  aPath;
-ByteString  aBypass;
+rtl::OString aBypass;
 sal_BoolbReady;
 sal_BoolbInUse;
 
@@ -86,8 +86,8 @@ struct DirReader_Impl
 #if defined(UNX)//for further eplanation see DirReader_Impl::Read() in 
unx.cxx
 pDosDir = NULL;
 #else
-aBypass = ByteString(aPath, 

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

2011-10-20 Thread Ivan Timofeev
 tools/inc/tools/multisel.hxx   |3 
 tools/source/memtools/multisel.cxx |  158 -
 2 files changed, 161 deletions(-)

New commits:
commit d72701bba66817fbd0ddcb8dea969aea49f8426a
Author: Ivan Timofeev timofeev@gmail.com
Date:   Thu Oct 20 23:11:17 2011 +0400

bye-bye old range parser

diff --git a/tools/inc/tools/multisel.hxx b/tools/inc/tools/multisel.hxx
index 6d3c3de..a979c23 100644
--- a/tools/inc/tools/multisel.hxx
+++ b/tools/inc/tools/multisel.hxx
@@ -71,9 +71,6 @@ public:
 MultiSelection();
 MultiSelection( const MultiSelection rOrig );
 MultiSelection( const Range rRange );
-MultiSelection( const UniString rString,
-sal_Unicode cRange = '-',
-sal_Unicode cSep = ';' );
 ~MultiSelection();
 
 MultiSelection operator= ( const MultiSelection rOrig );
diff --git a/tools/source/memtools/multisel.cxx 
b/tools/source/memtools/multisel.cxx
index 1a21f0a..4d6d577 100644
--- a/tools/source/memtools/multisel.cxx
+++ b/tools/source/memtools/multisel.cxx
@@ -137,164 +137,6 @@ MultiSelection::MultiSelection():
 
 // ---
 
-MultiSelection::MultiSelection( const UniString rString, sal_Unicode cRange, 
sal_Unicode cSep ):
-aTotRange(0,RANGE_MAX),
-nCurSubSel(0),
-nSelCount(0),
-bCurValid(sal_False),
-bSelectNew(sal_False)
-{
-// Dies ist nur ein Schnellschuss und sollte bald optimiert,
-// an die verschiedenen Systeme (UNIX etc.)
-// und die gewuenschte Eingabe-Syntax angepasst werden.
-
-UniString   aStr( rString );
-sal_Unicode*pStr   = aStr.GetBufferAccess();
-sal_Unicode*pOld = pStr;
-sal_BoolbReady = sal_False;
-sal_BoolbUntil = sal_False;
-xub_StrLen  nCut   = 0;
-
-// Hier normieren wir den String, sodass nur Ziffern,
-// Semikola als Trenn- und Minus als VonBis-Zeichen
-// uebrigbleiben, z.B. 99-117;55;34;-17;37-43
-while ( *pOld )
-{
-switch( *pOld )
-{
-case '0':
-case '1':
-case '2':
-case '3':
-case '4':
-case '5':
-case '6':
-case '7':
-case '8':
-case '9':
-DBG_ASSERT( *pOld != cRange, digit for range char not 
allowed );
-DBG_ASSERT( *pOld != cSep, digit for separator not allowed );
-if( bReady )
-{
-*pStr++ = ';';
-nCut++;
-bReady = sal_False;
-}
-*pStr++ = *pOld;
-nCut++;
-bUntil = sal_False;
-break;
-
-case '-':
-case ':':
-case '/':
-if ( *pOld != cSep )
-{
-if ( !bUntil )
-{
-*pStr++ = '-';
-nCut++;
-bUntil = sal_True;
-}
-bReady = sal_False;
-}
-else
-bReady = sal_True;
-break;
-
-case ' ':
-DBG_ASSERT( *pOld != cRange, SPACE for range char not 
allowed );
-DBG_ASSERT( *pOld != cSep, SPACE for separator not allowed );
-bReady = !bUntil;
-break;
-
-default:
-if ( *pOld == cRange )
-{
-if ( !bUntil )
-{
-*pStr++ = '-';
-nCut++;
-bUntil = sal_True;
-}
-bReady = sal_False;
-}
-else
-bReady = sal_True;
-break;
-}
-
-pOld++;
-}
-aStr.ReleaseBufferAccess( nCut );
-
-// Jetzt wird der normierte String ausgewertet ..
-UniString   aNumStr;
-Range   aRg( 1, RANGE_MAX );
-const sal_Unicode*  pCStr = aStr.GetBuffer();
-longnPage = 1;
-longnNum  = 1;
-bUntil = sal_False;
-while ( *pCStr )
-{
-switch ( *pCStr )
-{
-case '0':
-case '1':
-case '2':
-case '3':
-case '4':
-case '5':
-case '6':
-case '7':
-case '8':
-case '9':
-aNumStr += *pCStr;
-break;
-case ';':
-nNum = aNumStr.ToInt32();
-if ( bUntil )
-{
-if ( !aNumStr.Len() )
-nNum = RANGE_MAX;
-