summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorMalte Timmermann <Malte.Timmermann@sun.com>2010-06-25 13:15:03 +0200
committerMalte Timmermann <Malte.Timmermann@sun.com>2010-06-25 13:15:03 +0200
commitbb30c0a24baa2bc671daae588b523386470984c7 (patch)
treec7da7af3d248305e12f22a5b59f89745806cd85f /basic
parent34dd33af79caf3a13ec3a4e7098616ac0b16cf50 (diff)
codecleanup02: #i112685# Removed ifdefs and code for WIN,W30,W31
Diffstat (limited to 'basic')
-rw-r--r--basic/source/runtime/dllmgr.cxx27
-rw-r--r--basic/source/runtime/methods.cxx51
-rw-r--r--basic/source/runtime/methods1.cxx33
-rw-r--r--basic/source/runtime/step0.cxx7
4 files changed, 11 insertions, 107 deletions
diff --git a/basic/source/runtime/dllmgr.cxx b/basic/source/runtime/dllmgr.cxx
index 22014763bb29..18ab61b37ef9 100644
--- a/basic/source/runtime/dllmgr.cxx
+++ b/basic/source/runtime/dllmgr.cxx
@@ -34,7 +34,7 @@
#include <svpm.h>
#endif
-#if defined( WIN ) || defined( WNT )
+#if defined( WNT )
#ifndef _SVWIN_H
#undef WB_LEFT
#undef WB_RIGHT
@@ -47,10 +47,7 @@
#include <basic/sbxvar.hxx>
#include <basic/sbx.hxx>
-#if defined(WIN)
-typedef HINSTANCE SbiDllHandle;
-typedef FARPROC SbiDllProc;
-#elif defined(WNT)
+#if defined(WNT)
typedef HMODULE SbiDllHandle;
typedef int(*SbiDllProc)();
#elif defined(OS2)
@@ -72,7 +69,7 @@ typedef void* SbiDllProc;
#endif
extern "C" {
-#if defined(INTEL) && (defined(WIN) || defined(WNT))
+#if defined(INTEL) && defined(WNT)
extern INT16 WINAPI CallINT( SbiDllProc, char *stack, short nstack);
extern INT32 WINAPI CallLNG( SbiDllProc, char *stack, short nstack);
@@ -273,7 +270,7 @@ SbError SbiDllMgr::Call( const char* pProcName, const char* pDllName,
void SbiDllMgr::CheckDllName( ByteString& rDllName )
{
-#if defined(WIN) || defined(WNT) || defined(OS2)
+#if defined(WNT) || defined(OS2)
if( rDllName.Search('.') == STRING_NOTFOUND )
rDllName += ".DLL";
#else
@@ -292,12 +289,7 @@ SbiDllHandle SbiDllMgr::CreateDllHandle( const ByteString& rDllName )
SbiDllHandle hLib;
#endif
-#if defined(WIN)
- hLib = LoadLibrary( (const char*)rDllName );
- if( (ULONG)hLib < 32 )
- hLib = 0;
-
-#elif defined(WNT)
+#if defined(WNT)
hLib = LoadLibrary( rDllName.GetBuffer() );
if( !(ULONG)hLib )
{
@@ -318,7 +310,7 @@ SbiDllHandle SbiDllMgr::CreateDllHandle( const ByteString& rDllName )
void SbiDllMgr::FreeDllHandle( SbiDllHandle hLib )
{
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
if( hLib )
FreeLibrary ((HINSTANCE) hLib);
#elif defined(OS2)
@@ -354,7 +346,7 @@ SbiDllProc SbiDllMgr::GetProcAddr(SbiDllHandle hLib, const ByteString& rProcName
strncpy( buf2, "_", sizeof(buf2)-1 );
strncat( buf2, buf1, sizeof(buf2)-1-strlen(buf2) );
-#if defined(WIN) || defined(WNT)
+#if defined(WNT)
if( nOrd > 0 )
pProc = (SbiDllProc)GetProcAddress( hLib, (char*)(long) nOrd );
else
@@ -543,12 +535,7 @@ void* SbiDllMgr::CreateStack( SbxArray* pArgs, USHORT& rSize )
char* pTop = pStack;
USHORT nCount = pArgs->Count();
// erstes Element ueberspringen
-#ifndef WIN
for( USHORT nCur = 1; nCur < nCount; nCur++ )
-#else
- // unter 16-Bit Windows anders rum (OS/2 ?????)
- for( USHORT nCur = nCount-1; nCur >= 1; nCur-- )
-#endif
{
SbxVariable* pVar = pArgs->Get( nCur );
// AB 22.1.1996, Referenz
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 36fbda5c9097..dbeb7c619b9d 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 );
@@ -4381,16 +4348,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 b25c213a493d..fae3a7d1854a 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
@@ -1152,31 +1144,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 );
}
@@ -1187,11 +1158,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 39af5ea4adc3..437145613737 100644
--- a/basic/source/runtime/step0.cxx
+++ b/basic/source/runtime/step0.cxx
@@ -135,7 +135,6 @@ void SbiRuntime::StepCompare( SbxOperator eOp )
}
}
-#ifndef WIN
static SbxVariable* pTRUE = NULL;
static SbxVariable* pFALSE = NULL;
@@ -159,12 +158,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 ); }