summaryrefslogtreecommitdiff
path: root/basic/source/runtime
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2007-09-20 14:55:04 +0000
committerVladimir Glazounov <vg@openoffice.org>2007-09-20 14:55:04 +0000
commit1241d35d8051a0120939b1a5b8647bf4048964c9 (patch)
tree46f2a93b42aafc105e034a6f9b1f57c38dbed668 /basic/source/runtime
parent60491f919d41e455b10f3ed9d854ae2639367815 (diff)
INTEGRATION: CWS os2port01 (1.70.12); FILE MERGED
2007/08/10 10:59:15 obr 1.70.12.2: RESYNC: (1.70-1.76); FILE MERGED 2006/12/28 14:32:27 ydario 1.70.12.1: OS/2 initial import
Diffstat (limited to 'basic/source/runtime')
-rw-r--r--basic/source/runtime/methods.cxx40
1 files changed, 35 insertions, 5 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index dddf72043568..2e41c85df22c 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: methods.cxx,v $
*
- * $Revision: 1.76 $
+ * $Revision: 1.77 $
*
- * last change: $Author: hr $ $Date: 2007-06-27 14:25:56 $
+ * last change: $Author: vg $ $Date: 2007-09-20 15:55:04 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -134,7 +134,7 @@ using namespace com::sun::star::io;
#include <stdlib.h>
#include <ctype.h>
-#if defined (WIN) || defined (WNT)
+#if defined (WIN) || defined (WNT) || defined (OS2)
#include <direct.h> // _getdcwd get current work directory, _chdrive
#endif
@@ -428,7 +428,7 @@ RTLFUNC(CurDir)
// zu ermitteln, dass eine virtuelle URL geliefert werden koennte.
// rPar.Get(0)->PutEmpty();
-#if defined (WIN) || defined (WNT)
+#if defined (WIN) || defined (WNT) || defined (OS2)
int nCurDir = 0; // Current dir // JSM
if ( rPar.Count() == 2 )
{
@@ -451,6 +451,10 @@ RTLFUNC(CurDir)
}
}
char* pBuffer = new char[ _MAX_PATH ];
+#ifdef OS2
+ if( !nCurDir )
+ nCurDir = _getdrive();
+#endif
if ( _getdcwd( nCurDir, pBuffer, _MAX_PATH ) != 0 )
rPar.Get(0)->PutString( String::CreateFromAscii( pBuffer ) );
else
@@ -531,7 +535,7 @@ RTLFUNC(ChDrive) // JSM
#ifndef UNX
String aPar1 = rPar.Get(1)->GetString();
-#if defined (WIN) || defined (WNT)
+#if defined (WIN) || defined (WNT) || defined (OS2)
if (aPar1.Len() > 0)
{
int nCurDrive = (int)aPar1.GetBuffer()[0]; ;
@@ -2890,6 +2894,14 @@ RTLFUNC(GetAttr)
}
else
StarBASIC::Error( SbERR_FILE_NOT_FOUND );
+ #elif defined( OS2 )
+ FILESTATUS3 aFileStatus;
+ APIRET rc = DosQueryPathInfo(aByteStrFullPath.GetBuffer(),1,
+ &aFileStatus,sizeof(FILESTATUS3));
+ if (!rc)
+ nFlags = (INT16) aFileStatus.attrFile;
+ else
+ StarBASIC::Error( SbERR_FILE_NOT_FOUND );
#else
bUseFileStat = TRUE;
#endif
@@ -4144,6 +4156,24 @@ RTLFUNC(SetAttr) // JSM
if (!SetFileAttributes (aByteFile.GetBuffer(),(DWORD)nFlags))
StarBASIC::Error(SbERR_FILE_NOT_FOUND);
#endif
+ #ifdef OS2
+ FILESTATUS3 aFileStatus;
+ APIRET rc = DosQueryPathInfo(aByteFile.GetBuffer(),1,
+ &aFileStatus,sizeof(FILESTATUS3));
+ if (!rc)
+ {
+ if (aFileStatus.attrFile != nFlags)
+ {
+ aFileStatus.attrFile = nFlags;
+ rc = DosSetPathInfo(aFile.GetStr(),1,
+ &aFileStatus,sizeof(FILESTATUS3),0);
+ if (rc)
+ StarBASIC::Error( SbERR_FILE_NOT_FOUND );
+ }
+ }
+ else
+ StarBASIC::Error( SbERR_FILE_NOT_FOUND );
+ #endif
#else
// Not implemented
#endif