[Libreoffice-commits] .: 2 commits - basic/source
Christina Rossmanith
crossmanith at kemper.freedesktop.org
Tue Mar 22 04:27:31 PDT 2011
basic/source/inc/runtime.hxx | 12 --
basic/source/runtime/iosys.cxx | 17 ----
basic/source/runtime/methods.cxx | 163 +++------------------------------------
basic/source/runtime/step0.cxx | 13 ---
4 files changed, 15 insertions(+), 190 deletions(-)
New commits:
commit 8fff5ae970e3bc69c92481b351df187769c1c537
Author: Christina Rossmanith <ChrRossmanith at web.de>
Date: Tue Mar 22 12:23:36 2011 +0100
Removed comments /commented code
diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx
index 9c6bfdf..427f4d1 100755
--- a/basic/source/inc/runtime.hxx
+++ b/basic/source/inc/runtime.hxx
@@ -293,8 +293,7 @@ class SbiRuntime
SbxArrayRef refParams; // aktuelle Prozedur-Parameter
SbxArrayRef refLocals; // lokale Variable
SbxArrayRef refArgv; // aktueller Argv
- // AB, 28.3.2000 #74254, Ein refSaveObj reicht nicht! Neu: pRefSaveList (s.u.)
- //SbxVariableRef refSaveObj; // #56368 Bei StepElem Referenz sichern
+ // #74254, Ein refSaveObj reicht nicht! Neu: pRefSaveList (s.u.)
short nArgc; // aktueller Argc
sal_Bool bRun; // sal_True: Programm ist aktiv
sal_Bool bError; // sal_True: Fehler behandeln
diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx
index d708361..003bf38 100755
--- a/basic/source/runtime/iosys.cxx
+++ b/basic/source/runtime/iosys.cxx
@@ -42,7 +42,6 @@
#ifdef _USE_UNO
-// <-- encoding
#include <sal/alloca.h>
#include <ctype.h>
@@ -51,7 +50,7 @@
#include <rtl/ustrbuf.hxx>
#include <rtl/textenc.h>
#include <rtl/ustrbuf.hxx>
-// encoding -->
+
#include <comphelper/processfactory.hxx>
#include <com/sun/star/uno/Sequence.hxx>
@@ -425,8 +424,6 @@ void OslStream::SetSize( sal_uIntPtr nSize )
maFile.setSize( (sal_uInt64)nSize );
}
-//#endif
-
#ifdef _USE_UNO
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index f7b4457..d69fb2c 100755
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -483,7 +483,7 @@ RTLFUNC(CurDir)
#endif
}
-RTLFUNC(ChDir) // JSM
+RTLFUNC(ChDir)
{
(void)pBasic;
(void)bWrite;
@@ -513,7 +513,7 @@ RTLFUNC(ChDir) // JSM
StarBASIC::Error( SbERR_BAD_ARGUMENT );
}
-RTLFUNC(ChDrive) // JSM
+RTLFUNC(ChDrive)
{
(void)pBasic;
(void)bWrite;
@@ -589,7 +589,7 @@ void implStepRenameOSL( const String& aSource, const String& aDest )
}
}
-RTLFUNC(FileCopy) // JSM
+RTLFUNC(FileCopy)
{
(void)pBasic;
(void)bWrite;
@@ -627,7 +627,7 @@ RTLFUNC(FileCopy) // JSM
StarBASIC::Error( SbERR_BAD_ARGUMENT );
}
-RTLFUNC(Kill) // JSM
+RTLFUNC(Kill)
{
(void)pBasic;
(void)bWrite;
@@ -667,7 +667,7 @@ RTLFUNC(Kill) // JSM
StarBASIC::Error( SbERR_BAD_ARGUMENT );
}
-RTLFUNC(MkDir) // JSM
+RTLFUNC(MkDir)
{
(void)pBasic;
(void)bWrite;
@@ -789,7 +789,7 @@ void implRemoveDirRecursive( const String& aDirPath )
}
-RTLFUNC(RmDir) // JSM
+RTLFUNC(RmDir)
{
(void)pBasic;
(void)bWrite;
@@ -840,7 +840,7 @@ RTLFUNC(RmDir) // JSM
StarBASIC::Error( SbERR_BAD_ARGUMENT );
}
-RTLFUNC(SendKeys) // JSM
+RTLFUNC(SendKeys)
{
(void)pBasic;
(void)bWrite;
@@ -2005,8 +2005,7 @@ RTLFUNC(DateValue)
else
fResult = ceil( fResult );
}
- // fResult += 2.0; // Anpassung StarCalcFormatter
- rPar.Get(0)->PutDate( fResult ); // JSM
+ rPar.Get(0)->PutDate( fResult );
}
else
StarBASIC::Error( SbERR_CONVERSION );
@@ -2046,7 +2045,7 @@ RTLFUNC(TimeValue)
if ( nType == NUMBERFORMAT_DATETIME )
// Tage abschneiden
fResult = fmod( fResult, 1 );
- rPar.Get(0)->PutDate( fResult ); // JSM
+ rPar.Get(0)->PutDate( fResult );
}
else
StarBASIC::Error( SbERR_CONVERSION );
@@ -3071,13 +3070,12 @@ RTLFUNC(EOF)
(void)pBasic;
(void)bWrite;
- // AB 08/16/2000: No changes for UCB
+ // No changes for UCB
if ( rPar.Count() != 2 )
StarBASIC::Error( SbERR_BAD_ARGUMENT );
else
{
sal_Int16 nChannel = rPar.Get(1)->GetInteger();
- // nChannel--; // macht MD beim Oeffnen auch nicht
SbiIoSystem* pIO = pINST->GetIoSystem();
SbiStream* pSbStrm = pIO->GetStream( nChannel );
if ( !pSbStrm )
@@ -3175,7 +3173,7 @@ RTLFUNC(Lof)
(void)pBasic;
(void)bWrite;
- // AB 08/16/2000: No changes for UCB
+ // No changes for UCB
if ( rPar.Count() != 2 )
StarBASIC::Error( SbERR_BAD_ARGUMENT );
else
@@ -4323,7 +4321,7 @@ RTLFUNC(MsgBox)
delete pBox;
}
-RTLFUNC(SetAttr) // JSM
+RTLFUNC(SetAttr)
{
(void)pBasic;
(void)bWrite;
@@ -4357,7 +4355,7 @@ RTLFUNC(SetAttr) // JSM
StarBASIC::Error( SbERR_BAD_ARGUMENT );
}
-RTLFUNC(Reset) // JSM
+RTLFUNC(Reset)
{
(void)pBasic;
(void)bWrite;
diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx
index e10d806..a9dddab 100755
--- a/basic/source/runtime/step0.cxx
+++ b/basic/source/runtime/step0.cxx
@@ -689,7 +689,6 @@ void SbiRuntime::StepVBASET()
}
-// JSM 07.10.95
void SbiRuntime::StepLSET()
{
SbxVariableRef refVal = PopVar();
@@ -725,7 +724,6 @@ void SbiRuntime::StepLSET()
}
}
-// JSM 07.10.95
void SbiRuntime::StepRSET()
{
SbxVariableRef refVal = PopVar();
commit 321b2e7300b9e41e77425434433f245a09ed79a6
Author: Christina Rossmanith <ChrRossmanith at web.de>
Date: Mon Mar 21 13:41:50 2011 +0100
Removed never defined _OLD_FILE_IMPL
diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx
index fb4f3f8..9c6bfdf 100755
--- a/basic/source/inc/runtime.hxx
+++ b/basic/source/inc/runtime.hxx
@@ -53,11 +53,6 @@ using namespace com::sun::star::lang;
using namespace com::sun::star::container;
-// Define activates old file implementation
-// (only in non UCB case)
-// #define _OLD_FILE_IMPL
-
-
namespace basicEncoder
{
@@ -141,11 +136,7 @@ class SbiRTLData
{
public:
-#ifdef _OLD_FILE_IMPL
- Dir* pDir;
-#else
::osl::Directory* pDir;
-#endif
sal_Int16 nDirFlags;
short nCurDirPos;
diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx
index cf113e6..d708361 100755
--- a/basic/source/runtime/iosys.cxx
+++ b/basic/source/runtime/iosys.cxx
@@ -338,8 +338,6 @@ sal_Bool hasUno( void )
-#ifndef _OLD_FILE_IMPL
-
class OslStream : public SvStream
{
osl::File maFile;
@@ -427,7 +425,7 @@ void OslStream::SetSize( sal_uIntPtr nSize )
maFile.setSize( (sal_uInt64)nSize );
}
-#endif
+//#endif
#ifdef _USE_UNO
@@ -658,11 +656,7 @@ SbError SbiStream::Open
#endif
if( !pStrm )
{
-#ifdef _OLD_FILE_IMPL
- pStrm = new SvFileStream( aNameStr, nStrmMode );
-#else
pStrm = new OslStream( aNameStr, nStrmMode );
-#endif
}
if( IsAppend() )
pStrm->Seek( STREAM_SEEK_TO_END );
@@ -676,12 +670,6 @@ SbError SbiStream::Close()
{
if( pStrm )
{
- if( !hasUno() )
- {
-#ifdef _OLD_FILE_IMPL
- ((SvFileStream *)pStrm)->Close();
-#endif
- }
MapError();
delete pStrm;
pStrm = NULL;
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 8d144a6..f7b4457 100755
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -616,22 +616,11 @@ RTLFUNC(FileCopy) // JSM
}
else
{
-#ifdef _OLD_FILE_IMPL
- DirEntry aSourceDirEntry(aSource);
- if (aSourceDirEntry.Exists())
- {
- if (aSourceDirEntry.CopyTo(DirEntry(aDest),FSYS_ACTION_COPYFILE) != FSYS_ERR_OK)
- StarBASIC::Error( SbERR_PATH_NOT_FOUND );
- }
- else
- StarBASIC::Error( SbERR_PATH_NOT_FOUND );
-#else
FileBase::RC nRet = File::copy( getFullPathUNC( aSource ), getFullPathUNC( aDest ) );
if( nRet != FileBase::E_None )
{
StarBASIC::Error( SbERR_PATH_NOT_FOUND );
}
-#endif
}
}
else
@@ -671,12 +660,7 @@ RTLFUNC(Kill) // JSM
}
else
{
-#ifdef _OLD_FILE_IMPL
- if(DirEntry(aFileSpec).Kill() != FSYS_ERR_OK)
- StarBASIC::Error( SbERR_PATH_NOT_FOUND );
-#else
File::remove( getFullPathUNC( aFileSpec ) );
-#endif
}
}
else
@@ -740,12 +724,7 @@ RTLFUNC(MkDir) // JSM
}
else
{
-#ifdef _OLD_FILE_IMPL
- if (!DirEntry(aPath).MakeDir())
- StarBASIC::Error( SbERR_PATH_NOT_FOUND );
-#else
Directory::create( getFullPathUNC( aPath ) );
-#endif
}
}
else
@@ -753,8 +732,6 @@ RTLFUNC(MkDir) // JSM
}
-#ifndef _OLD_FILE_IMPL
-
// In OSL only empty directories can be deleted
// so we have to delete all files recursively
void implRemoveDirRecursive( const String& aDirPath )
@@ -810,7 +787,6 @@ void implRemoveDirRecursive( const String& aDirPath )
nRet = Directory::remove( aDirPath );
}
-#endif
RTLFUNC(RmDir) // JSM
@@ -857,13 +833,7 @@ RTLFUNC(RmDir) // JSM
}
else
{
-#ifdef _OLD_FILE_IMPL
- DirEntry aDirEntry(aPath);
- if (aDirEntry.Kill() != FSYS_ERR_OK)
- StarBASIC::Error( SbERR_PATH_NOT_FOUND );
-#else
implRemoveDirRecursive( getFullPathUNC( aPath ) );
-#endif
}
}
else
@@ -924,16 +894,11 @@ RTLFUNC(FileLen)
}
else
{
-#ifdef _OLD_FILE_IMPL
- FileStat aStat = DirEntry( aStr );
- nLen = aStat.GetSize();
-#else
DirectoryItem aItem;
DirectoryItem::get( getFullPathUNC( aStr ), aItem );
FileStatus aFileStatus( FileStatusMask_FileSize );
aItem.getFileStatus( aFileStatus );
nLen = (sal_Int32)aFileStatus.getFileSize();
-#endif
}
rPar.Get(0)->PutLong( (long)nLen );
}
@@ -2831,60 +2796,6 @@ RTLFUNC(Dir)
}
else
{
-#ifdef _OLD_FILE_IMPL
- if ( nParCount >= 2 )
- {
- delete pRTLData->pDir;
- pRTLData->pDir = 0; // wg. Sonderbehandlung Sb_ATTR_VOLUME
- DirEntry aEntry( rPar.Get(1)->GetString() );
- FileStat aStat( aEntry );
- if(!aStat.GetError() && (aStat.GetKind() & FSYS_KIND_FILE))
- {
- // ah ja, ist nur ein dateiname
- // Pfad abschneiden (wg. VB4)
- rPar.Get(0)->PutString( aEntry.GetName() );
- return;
- }
- sal_uInt16 nFlags = 0;
- if ( nParCount > 2 )
- pRTLData->nDirFlags = nFlags = rPar.Get(2)->GetInteger();
- else
- pRTLData->nDirFlags = 0;
-
- // Sb_ATTR_VOLUME wird getrennt gehandelt
- if( pRTLData->nDirFlags & Sb_ATTR_VOLUME )
- aPath = aEntry.GetVolume();
- else
- {
- // Die richtige Auswahl treffen
- sal_uInt16 nMode = FSYS_KIND_FILE;
- if( nFlags & Sb_ATTR_DIRECTORY )
- nMode |= FSYS_KIND_DIR;
- if( nFlags == Sb_ATTR_DIRECTORY )
- nMode = FSYS_KIND_DIR;
- pRTLData->pDir = new Dir( aEntry, (DirEntryKind) nMode );
- pRTLData->nCurDirPos = 0;
- }
- }
-
- if( pRTLData->pDir )
- {
- for( ;; )
- {
- if( pRTLData->nCurDirPos >= pRTLData->pDir->Count() )
- {
- delete pRTLData->pDir;
- pRTLData->pDir = 0;
- aPath.Erase();
- break;
- }
- DirEntry aNextEntry=(*(pRTLData->pDir))[pRTLData->nCurDirPos++];
- aPath = aNextEntry.GetName(); //Full();
- break;
- }
- }
- rPar.Get(0)->PutString( aPath );
-#else
// TODO: OSL
if ( nParCount >= 2 )
{
@@ -2981,7 +2892,6 @@ RTLFUNC(Dir)
}
}
rPar.Get(0)->PutString( aPath );
-#endif
}
}
}
@@ -3109,12 +3019,6 @@ RTLFUNC(FileDateTime)
}
else
{
-#ifdef _OLD_FILE_IMPL
- DirEntry aEntry( aPath );
- FileStat aStat( aEntry );
- aTime = Time( aStat.TimeModified() );
- aDate = Date( aStat.DateModified() );
-#else
DirectoryItem aItem;
DirectoryItem::get( getFullPathUNC( aPath ), aItem );
FileStatus aFileStatus( FileStatusMask_ModifyTime );
@@ -3125,7 +3029,6 @@ RTLFUNC(FileDateTime)
aTime = Time( aDT.Hours, aDT.Minutes, aDT.Seconds, 10000000*aDT.NanoSeconds );
aDate = Date( aDT.Day, aDT.Month, aDT.Year );
-#endif
}
double fSerial = (double)GetDayDiff( aDate );
@@ -4449,39 +4352,6 @@ RTLFUNC(SetAttr) // JSM
}
}
}
- else
- {
-#ifdef _OLD_FILE_IMPL
- // #57064 Bei virtuellen URLs den Real-Path extrahieren
- DirEntry aEntry( aStr );
- String aFile = aEntry.GetFull();
- ByteString aByteFile( aFile, gsl_getSystemTextEncoding() );
- #ifdef WNT
- 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
- }
}
else
StarBASIC::Error( SbERR_BAD_ARGUMENT );
@@ -4550,14 +4420,9 @@ RTLFUNC(FileExists)
}
else
{
-#ifdef _OLD_FILE_IMPL
- DirEntry aEntry( aStr );
- bExists = aEntry.Exists();
-#else
DirectoryItem aItem;
FileBase::RC nRet = DirectoryItem::get( getFullPathUNC( aStr ), aItem );
bExists = (nRet == FileBase::E_None);
-#endif
}
rPar.Get(0)->PutBool( bExists );
}
diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx
index 2337fc5..e10d806 100755
--- a/basic/source/runtime/step0.cxx
+++ b/basic/source/runtime/step0.cxx
@@ -1349,18 +1349,7 @@ void SbiRuntime::StepRENAME() // Rename Tos+1 to Tos
}
else
{
-#ifdef _OLD_FILE_IMPL
- DirEntry aSourceDirEntry( aSource );
- if( aSourceDirEntry.Exists() )
- {
- if( aSourceDirEntry.MoveTo( DirEntry(aDest) ) != FSYS_ERR_OK )
- StarBASIC::Error( SbERR_PATH_NOT_FOUND );
- }
- else
- StarBASIC::Error( SbERR_PATH_NOT_FOUND );
-#else
implStepRenameOSL( aSource, aDest );
-#endif
}
}
More information about the Libreoffice-commits
mailing list