diff options
author | Vladimir Glazunov <vg@openoffice.org> | 2010-08-25 17:21:42 +0200 |
---|---|---|
committer | Vladimir Glazunov <vg@openoffice.org> | 2010-08-25 17:21:42 +0200 |
commit | a65ca79f2a3b044f8e920c191445f010e6da255d (patch) | |
tree | f93e9d18f27d4a5fe00ccddca185395cef81b24b /basic | |
parent | 6d4a9c5e7c6fcddcfdfc27371d0358495eb9e79d (diff) | |
parent | 7fcdb05e4b2166c0190869926dcb5963e920bbea (diff) |
CWS-TOOLING: integrate CWS codecleanup02
Diffstat (limited to 'basic')
-rw-r--r-- | basic/inc/basic/process.hxx | 6 | ||||
-rw-r--r-- | basic/source/app/process.cxx | 38 | ||||
-rw-r--r-- | basic/source/classes/eventatt.cxx | 2 | ||||
-rwxr-xr-x | basic/source/classes/sbunoobj.cxx | 10 | ||||
-rw-r--r-- | basic/source/runtime/methods.cxx | 83 | ||||
-rw-r--r-- | basic/source/runtime/methods1.cxx | 33 | ||||
-rw-r--r-- | basic/source/runtime/step0.cxx | 7 | ||||
-rw-r--r-- | basic/source/sbx/sbxbase.cxx | 7 | ||||
-rw-r--r-- | basic/source/sbx/sbxdate.cxx | 8 |
9 files changed, 48 insertions, 146 deletions
diff --git a/basic/inc/basic/process.hxx b/basic/inc/basic/process.hxx index 20cdbe1d4aa4..9a593322b896 100644 --- a/basic/inc/basic/process.hxx +++ b/basic/inc/basic/process.hxx @@ -39,9 +39,9 @@ typedef Environment::value_type EnvironmentVariable; class Process { // Internal members and methods - NAMESPACE_VOS(OArgumentList) *pArgumentList; - NAMESPACE_VOS(OEnvironment) *pEnvList; - NAMESPACE_VOS(OProcess) *pProcess; + vos::OArgumentList *pArgumentList; + vos::OEnvironment *pEnvList; + vos::OProcess *pProcess; BOOL ImplIsRunning(); long ImplGetExitCode(); BOOL bWasGPF; diff --git a/basic/source/app/process.cxx b/basic/source/app/process.cxx index c37af05ac8da..0eec05e1697c 100644 --- a/basic/source/app/process.cxx +++ b/basic/source/app/process.cxx @@ -72,9 +72,9 @@ BOOL Process::ImplIsRunning() { if ( pProcess && bHasBeenStarted ) { - NAMESPACE_VOS(OProcess::TProcessInfo) aProcessInfo; - pProcess->getInfo( NAMESPACE_VOS(OProcess::TData_ExitCode), &aProcessInfo ); - if ( !(aProcessInfo.Fields & NAMESPACE_VOS(OProcess::TData_ExitCode)) ) + vos::OProcess::TProcessInfo aProcessInfo; + pProcess->getInfo( vos::OProcess::TData_ExitCode, &aProcessInfo ); + if ( !(aProcessInfo.Fields & vos::OProcess::TData_ExitCode) ) return TRUE; else return FALSE; @@ -87,9 +87,9 @@ long Process::ImplGetExitCode() { if ( pProcess ) { - NAMESPACE_VOS(OProcess::TProcessInfo) aProcessInfo; - pProcess->getInfo( NAMESPACE_VOS(OProcess::TData_ExitCode), &aProcessInfo ); - if ( !(aProcessInfo.Fields & NAMESPACE_VOS(OProcess::TData_ExitCode)) ) + vos::OProcess::TProcessInfo aProcessInfo; + pProcess->getInfo( vos::OProcess::TData_ExitCode, &aProcessInfo ); + if ( !(aProcessInfo.Fields & vos::OProcess::TData_ExitCode) ) SbxBase::SetError( SbxERR_NO_ACTIVE_OBJECT ); return aProcessInfo.Code; } @@ -124,7 +124,7 @@ void Process::SetImage( const String &aAppPath, const String &aAppParams, const nParamCount++; } } - pArgumentList = new NAMESPACE_VOS(OArgumentList)( pParamList, nCount ); + pArgumentList = new vos::OArgumentList( pParamList, nCount ); ::rtl::OUString *pEnvArray = NULL; @@ -143,12 +143,12 @@ void Process::SetImage( const String &aAppPath, const String &aAppParams, const nEnvCount++; aIter++; } - pEnvList = new NAMESPACE_VOS(OEnvironment)( pEnvArray, nEnvCount ); + pEnvList = new vos::OEnvironment( pEnvArray, nEnvCount ); } ::rtl::OUString aNormalizedAppPath; osl::FileBase::getFileURLFromSystemPath( ::rtl::OUString(aAppPath), aNormalizedAppPath ); - pProcess = new NAMESPACE_VOS(OProcess)( aNormalizedAppPath ); + pProcess = new vos::OProcess( aNormalizedAppPath ); bHasBeenStarted = FALSE; delete [] pParamList; @@ -170,20 +170,20 @@ BOOL Process::Start() #endif if ( pEnvList ) { - bSuccess = pProcess->execute( (NAMESPACE_VOS(OProcess)::TProcessOption) - ( NAMESPACE_VOS(OProcess)::TOption_SearchPath - /*| NAMESPACE_VOS(OProcess)::TOption_Detached*/ - /*| NAMESPACE_VOS(OProcess)::TOption_Wait*/ ), + bSuccess = pProcess->execute( (vos::OProcess::TProcessOption) + ( vos::OProcess::TOption_SearchPath + /*| vos::OProcess::TOption_Detached*/ + /*| vos::OProcess::TOption_Wait*/ ), *pArgumentList, - *pEnvList ) == NAMESPACE_VOS(OProcess)::E_None; + *pEnvList ) == vos::OProcess::E_None; } else { - bSuccess = pProcess->execute( (NAMESPACE_VOS(OProcess)::TProcessOption) - ( NAMESPACE_VOS(OProcess)::TOption_SearchPath - /*| NAMESPACE_VOS(OProcess)::TOption_Detached*/ - /*| NAMESPACE_VOS(OProcess)::TOption_Wait*/ ), - *pArgumentList ) == NAMESPACE_VOS(OProcess)::E_None; + bSuccess = pProcess->execute( (vos::OProcess::TProcessOption) + ( vos::OProcess::TOption_SearchPath + /*| vos::OProcess::TOption_Detached*/ + /*| vos::OProcess::TOption_Wait*/ ), + *pArgumentList ) == vos::OProcess::E_None; } #ifdef WNT } diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx index 791e9fe5a8c1..78682a633fe3 100644 --- a/basic/source/classes/eventatt.cxx +++ b/basic/source/classes/eventatt.cxx @@ -255,7 +255,7 @@ Any BasicScriptListener_Impl::approveFiring( const ScriptEvent& aScriptEvent ) void BasicScriptListener_Impl::disposing(const EventObject& ) throw ( RuntimeException ) { // TODO: ??? - //NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() ); + //vos::OGuard guard( Application::GetSolarMutex() ); //xSbxObj.Clear(); } diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index df13bc7ec571..9ee07fde1413 100755 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -3762,7 +3762,7 @@ BasicAllListener_Impl::~BasicAllListener_Impl() void BasicAllListener_Impl::firing_impl( const AllEventObject& Event, Any* pRet ) { - NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() ); + vos::OGuard guard( Application::GetSolarMutex() ); if( xSbxObj.Is() ) { @@ -3827,7 +3827,7 @@ Any BasicAllListener_Impl::approveFiring( const AllEventObject& Event ) throw ( // Methoden von XEventListener void BasicAllListener_Impl ::disposing(const EventObject& ) throw ( RuntimeException ) { - NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() ); + vos::OGuard guard( Application::GetSolarMutex() ); xSbxObj.Clear(); } @@ -4201,7 +4201,7 @@ void SAL_CALL ModuleInvocationProxy::setValue( const ::rtl::OUString& rProperty, if( !m_bProxyIsClassModuleObject ) throw UnknownPropertyException(); - NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() ); + vos::OGuard guard( Application::GetSolarMutex() ); ::rtl::OUString aPropertyFunctionName( RTL_CONSTASCII_USTRINGPARAM( "Property Set ") ); aPropertyFunctionName += m_aPrefix; @@ -4242,7 +4242,7 @@ Any SAL_CALL ModuleInvocationProxy::getValue( const ::rtl::OUString& rProperty ) if( !m_bProxyIsClassModuleObject ) throw UnknownPropertyException(); - NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() ); + vos::OGuard guard( Application::GetSolarMutex() ); ::rtl::OUString aPropertyFunctionName( RTL_CONSTASCII_USTRINGPARAM( "Property Get ") ); aPropertyFunctionName += m_aPrefix; @@ -4280,7 +4280,7 @@ Any SAL_CALL ModuleInvocationProxy::invoke( const ::rtl::OUString& rFunction, Sequence< Any >& ) throw( CannotConvertException, InvocationTargetException ) { - NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() ); + vos::OGuard guard( Application::GetSolarMutex() ); Any aRet; if( !m_xScopeObj.Is() ) diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 1a60a5d79a45..97f6ed227d47 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -103,15 +103,10 @@ using namespace com::sun::star::io; #include <stdlib.h> #include <ctype.h> -#if defined (WIN) || defined (WNT) || defined (OS2) +#if defined (WNT) || defined (OS2) #include <direct.h> // _getdcwd get current work directory, _chdrive #endif -#ifdef WIN -#include <dos.h> // _dos_getfileattr -#include <errno.h> -#endif - #ifdef UNX #include <errno.h> #include <unistd.h> @@ -420,7 +415,7 @@ RTLFUNC(CurDir) // zu ermitteln, dass eine virtuelle URL geliefert werden koennte. // rPar.Get(0)->PutEmpty(); -#if defined (WIN) || defined (WNT) || defined (OS2) +#if defined (WNT) || defined (OS2) int nCurDir = 0; // Current dir // JSM if ( rPar.Count() == 2 ) { @@ -527,7 +522,7 @@ RTLFUNC(ChDrive) // JSM #ifndef UNX String aPar1 = rPar.Get(1)->GetString(); -#if defined (WIN) || defined (WNT) || defined (OS2) +#if defined (WNT) || defined (OS2) if (aPar1.Len() > 0) { int nCurDrive = (int)aPar1.GetBuffer()[0]; ; @@ -2792,11 +2787,7 @@ RTLFUNC(Dir) pRTLData->nDirFlags = nFlags = rPar.Get(2)->GetInteger(); else pRTLData->nDirFlags = 0; - // Nur diese Bitmaske ist unter Windows erlaubt - #ifdef WIN - if( nFlags & ~0x1E ) - StarBASIC::Error( SbERR_BAD_ARGUMENT ), pRTLData->nDirFlags = 0; - #endif + // Sb_ATTR_VOLUME wird getrennt gehandelt if( pRTLData->nDirFlags & Sb_ATTR_VOLUME ) aPath = aEntry.GetVolume(); @@ -2826,31 +2817,7 @@ RTLFUNC(Dir) } DirEntry aNextEntry=(*(pRTLData->pDir))[pRTLData->nCurDirPos++]; aPath = aNextEntry.GetName(); //Full(); - #ifdef WIN - aNextEntry.ToAbs(); - String sFull(aNextEntry.GetFull()); - unsigned nFlags; - - if (_dos_getfileattr( sFull.GetStr(), &nFlags )) - StarBASIC::Error( SbERR_FILE_NOT_FOUND ); - else - { - INT16 nCurFlags = pRTLData->nDirFlags; - if( (nCurFlags == Sb_ATTR_NORMAL) - && !(nFlags & ( _A_HIDDEN | _A_SYSTEM | _A_VOLID | _A_SUBDIR ) ) ) - break; - else if( (nCurFlags & Sb_ATTR_HIDDEN) && (nFlags & _A_HIDDEN) ) - break; - else if( (nCurFlags & Sb_ATTR_SYSTEM) && (nFlags & _A_SYSTEM) ) - break; - else if( (nCurFlags & Sb_ATTR_VOLUME) && (nFlags & _A_VOLID) ) - break; - else if( (nCurFlags & Sb_ATTR_DIRECTORY) && (nFlags & _A_SUBDIR) ) - break; - } - #else break; - #endif } } rPar.Get(0)->PutString( aPath ); @@ -3404,8 +3371,8 @@ RTLFUNC(Shell) } else { - USHORT nOptions = NAMESPACE_VOS(OProcess)::TOption_SearchPath| - NAMESPACE_VOS(OProcess)::TOption_Detached; + USHORT nOptions = vos::OProcess::TOption_SearchPath| + vos::OProcess::TOption_Detached; String aCmdLine = rPar.Get(1)->GetString(); // Zusaetzliche Parameter anhaengen, es muss eh alles geparsed werden if( nArgCount >= 4 ) @@ -3483,13 +3450,13 @@ RTLFUNC(Shell) switch( nWinStyle ) { case 2: - nOptions |= NAMESPACE_VOS(OProcess)::TOption_Minimized; + nOptions |= vos::OProcess::TOption_Minimized; break; case 3: - nOptions |= NAMESPACE_VOS(OProcess)::TOption_Maximized; + nOptions |= vos::OProcess::TOption_Maximized; break; case 10: - nOptions |= NAMESPACE_VOS(OProcess)::TOption_FullScreen; + nOptions |= vos::OProcess::TOption_FullScreen; break; } @@ -3497,10 +3464,10 @@ RTLFUNC(Shell) if( nArgCount >= 5 ) bSync = rPar.Get(4)->GetBool(); if( bSync ) - nOptions |= NAMESPACE_VOS(OProcess)::TOption_Wait; + nOptions |= vos::OProcess::TOption_Wait; } - NAMESPACE_VOS(OProcess)::TProcessOption eOptions = - (NAMESPACE_VOS(OProcess)::TProcessOption)nOptions; + vos::OProcess::TProcessOption eOptions = + (vos::OProcess::TProcessOption)nOptions; // #72471 Parameter aufbereiten @@ -3530,25 +3497,25 @@ RTLFUNC(Shell) } //const char* pParams = aParams.Len() ? aParams.GetStr() : 0; - NAMESPACE_VOS(OProcess)* pApp; - pApp = new NAMESPACE_VOS(OProcess)( aOUStrProgUNC ); + vos::OProcess* pApp; + pApp = new vos::OProcess( aOUStrProgUNC ); BOOL bSucc; if( nParamCount == 0 ) { - bSucc = pApp->execute( eOptions ) == NAMESPACE_VOS(OProcess)::E_None; + bSucc = pApp->execute( eOptions ) == vos::OProcess::E_None; } else { - NAMESPACE_VOS(OArgumentList) aArgList( pArgumentList, nParamCount ); - bSucc = pApp->execute( eOptions, aArgList ) == NAMESPACE_VOS(OProcess)::E_None; + vos::OArgumentList aArgList( pArgumentList, nParamCount ); + bSucc = pApp->execute( eOptions, aArgList ) == vos::OProcess::E_None; } /* if( nParamCount == 0 ) - pApp = new NAMESPACE_VOS(OProcess)( pProg ); + pApp = new vos::OProcess( pProg ); else - pApp = new NAMESPACE_VOS(OProcess)( pProg, pParamList, nParamCount ); - BOOL bSucc = pApp->execute( eOptions ) == NAMESPACE_VOS(OProcess)::E_None; + pApp = new vos::OProcess( pProg, pParamList, nParamCount ); + BOOL bSucc = pApp->execute( eOptions ) == vos::OProcess::E_None; */ delete pApp; @@ -4380,16 +4347,6 @@ RTLFUNC(SetAttr) // JSM // #57064 Bei virtuellen URLs den Real-Path extrahieren DirEntry aEntry( aStr ); String aFile = aEntry.GetFull(); - #ifdef WIN - int nErr = _dos_setfileattr( aFile.GetStr(),(unsigned ) nFlags ); - if ( nErr ) - { - if (errno == EACCES) - StarBASIC::Error( SbERR_ACCESS_DENIED ); - else - StarBASIC::Error( SbERR_FILE_NOT_FOUND ); - } - #endif ByteString aByteFile( aFile, gsl_getSystemTextEncoding() ); #ifdef WNT if (!SetFileAttributes (aByteFile.GetBuffer(),(DWORD)nFlags)) diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index 8c7da2403705..bbb3e930e012 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -28,11 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_basic.hxx" -#if defined(WIN) -#include <string.h> -#else #include <stdlib.h> // getenv -#endif #include <vcl/svapp.hxx> #include <vcl/mapmod.hxx> #include <vcl/wrkwin.hxx> @@ -52,10 +48,6 @@ #include <svpm.h> #endif -#if defined(WIN) -#include <tools/svwin.h> -#endif - #ifndef CLK_TCK #define CLK_TCK CLOCKS_PER_SEC #endif @@ -1163,31 +1155,10 @@ RTLFUNC(Environ) } String aResult; // sollte ANSI sein, aber unter Win16 in DLL nicht moeglich -#if defined(WIN) - LPSTR lpszEnv = GetDOSEnvironment(); - String aCompareStr( rPar.Get(1)->GetString() ); - aCompareStr += '='; - const char* pCompare = aCompareStr.GetStr(); - int nCompareLen = aCompareStr.Len(); - while ( *lpszEnv ) - { - // Es werden alle EnvString in der Form ENV=VAL 0-terminiert - // aneinander gehaengt. - - if ( strnicmp( pCompare, lpszEnv, nCompareLen ) == 0 ) - { - aResult = (const char*)(lpszEnv+nCompareLen); - rPar.Get(0)->PutString( aResult ); - return; - } - lpszEnv += lstrlen( lpszEnv ) + 1; // Next Enviroment-String - } -#else ByteString aByteStr( rPar.Get(1)->GetString(), gsl_getSystemTextEncoding() ); const char* pEnvStr = getenv( aByteStr.GetBuffer() ); if ( pEnvStr ) aResult = String::CreateFromAscii( pEnvStr ); -#endif rPar.Get(0)->PutString( aResult ); } @@ -1198,11 +1169,7 @@ static double GetDialogZoomFactor( BOOL bX, long nValue ) if( pDevice ) { Size aRefSize( nValue, nValue ); -#ifndef WIN Fraction aFracX( 1, 26 ); -#else - Fraction aFracX( 1, 23 ); -#endif Fraction aFracY( 1, 24 ); MapMode aMap( MAP_APPFONT, Point(), aFracX, aFracY ); Size aScaledSize = pDevice->LogicToPixel( aRefSize, aMap ); diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx index 29965c7e9da5..ea40f0c65877 100644 --- a/basic/source/runtime/step0.cxx +++ b/basic/source/runtime/step0.cxx @@ -138,7 +138,6 @@ void SbiRuntime::StepCompare( SbxOperator eOp ) } } -#ifndef WIN static SbxVariable* pTRUE = NULL; static SbxVariable* pFALSE = NULL; @@ -162,12 +161,6 @@ void SbiRuntime::StepCompare( SbxOperator eOp ) } PushVar( pFALSE ); } -#else - BOOL bRes = p2->Compare( eOp, *p1 ); - SbxVariable* pRes = new SbxVariable; - pRes->PutBool( bRes ); - PushVar( pRes ); -#endif } void SbiRuntime::StepEXP() { StepArith( SbxEXP ); } diff --git a/basic/source/sbx/sbxbase.cxx b/basic/source/sbx/sbxbase.cxx index b1815228cd99..60bb9fe505e7 100644 --- a/basic/source/sbx/sbxbase.cxx +++ b/basic/source/sbx/sbxbase.cxx @@ -48,18 +48,11 @@ TYPEINIT0(SbxBase) SbxAppData* GetSbxData_Impl() { -#ifndef DOS SbxAppData** ppData = (SbxAppData**) ::GetAppData( SHL_SBX ); SbxAppData* p = *ppData; if( !p ) p = *ppData = new SbxAppData; return p; -#else - SbxAppData** ppData; - SbxAppData* p; - p = *ppData = new SbxAppData; - return p; -#endif } SbxAppData::~SbxAppData() diff --git a/basic/source/sbx/sbxdate.cxx b/basic/source/sbx/sbxdate.cxx index ce532fed0482..8dffb2758749 100644 --- a/basic/source/sbx/sbxdate.cxx +++ b/basic/source/sbx/sbxdate.cxx @@ -90,7 +90,6 @@ double ImpGetDate( const SbxValues* p ) nRes = 0; else { -#ifndef DOS LanguageType eLangType = GetpApp()->GetSettings().GetLanguage(); SvNumberFormatter* pFormatter; @@ -141,9 +140,6 @@ double ImpGetDate( const SbxValues* p ) } delete pFormatter; -#else - SbxBase::SetError( SbxERR_CONVERSION ); nRes = 0; -#endif } break; case SbxOBJECT: @@ -246,7 +242,6 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: -#ifndef DOS { if( !p->pString ) p->pString = new XubString; @@ -301,11 +296,8 @@ start: eLangType ); pFormatter->GetOutputString( n, nIndex, *p->pString, &pColor ); delete pFormatter; -#endif break; -#ifndef DOS } -#endif case SbxOBJECT: { SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); |