ooo-build r12587 - in trunk: . patches/dev300 patches/vba
- From: pflin svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r12587 - in trunk: . patches/dev300 patches/vba
- Date: Mon, 19 May 2008 08:05:58 +0000 (UTC)
Author: pflin
Date: Mon May 19 08:05:57 2008
New Revision: 12587
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12587&view=rev
Log:
* patches/dev300/cws-npower10.diff: regenerate the patch.
* patches/dev300/cws-pflin10.diff: new the patch.
* patches/vba/basic-caller-support-dev300.diff:
* patches/vba/vba-error-object.diff: fixed some confict with
cws-pflin10.diff.
* patches/dev300/apply: apply the patch.
Added:
trunk/patches/dev300/cws-pflin10.diff
Modified:
trunk/ChangeLog
trunk/patches/dev300/apply
trunk/patches/dev300/cws-npower10.diff
trunk/patches/vba/basic-caller-support-dev300.diff
trunk/patches/vba/vba-error-object.diff
Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply (original)
+++ trunk/patches/dev300/apply Mon May 19 08:05:57 2008
@@ -283,6 +283,7 @@
[ CWSBackports ]
#basic runtime fixes
cws-npower10.diff
+cws-pflin10.diff
#api changes
cws-npower11.diff
@@ -1503,16 +1504,11 @@
# fix --disable-vba build
oovbaapi-disable-vba.diff
-# fix for n#353254
-n353254-dateserial.diff, n#353254, Fong
-# fix for n#353260
-n353260-datevalue.diff, n#353260, Fong
# fix for n#353242. missing APIs
# a set of CommandBar APIs.
vba-commandbar-bundle.diff, n#353242, Jianhua
# fix for n#365557. missing APIs of XInterior
vba-interior.diff, n#365557, Jianhua
-vba-stringtodouble.diff, n#359943, noelpwer
#fix for n#309981
vba-fixup-singlerange-sheetref.diff, n#309981, noelpwer
vba-hyperlink-service.diff, Fong
@@ -1560,8 +1556,15 @@
vba-getattr-function.diff, n#294187, Fong
# Fomat function enhancement for VBA
vba-format-function.diff, n#294187, Fong
+
+# the following patches are part of cws-pflin10
# Error function compatible with VBA
vba-error-function.diff, n#294187, Fong
+# fix for n#353254
+n353254-dateserial.diff, n#353254, Fong
+# fix for n#353260
+n353260-datevalue.diff, n#353260, Fong
+vba-stringtodouble.diff, n#359943, noelpwer
# Is function only valid for objects
#vba-is-behaviour.diff
Modified: trunk/patches/dev300/cws-npower10.diff
==============================================================================
--- trunk/patches/dev300/cws-npower10.diff (original)
+++ trunk/patches/dev300/cws-npower10.diff Mon May 19 08:05:57 2008
@@ -1,24 +1,20 @@
-cvs diff: Diffing basic
-cvs diff: Diffing basic/inc
-cvs diff: Diffing basic/inc/basic
Index: basic/inc/basic/sbmeth.hxx
===================================================================
RCS file: /cvs/script/basic/inc/basic/sbmeth.hxx,v
-retrieving revision 1.2
-retrieving revision 1.2.80.1
-diff -u -p -b -w -B -r1.2 -r1.2.80.1
---- basic/inc/basic/sbmeth.hxx 11 Apr 2007 12:52:00 -0000 1.2
-+++ basic/inc/basic/sbmeth.hxx 20 Dec 2007 21:23:01 -0000 1.2.80.1
-@@ -58,7 +58,7 @@ class SbMethod : public SbxMethod
- friend class SbIfaceMapperMethod;
-
- SbMethodImpl* mpSbMethodImpl; // Impl data
--
-+ SbxArrayRef refStatics;
- SbModule* pMod;
- USHORT nDebugFlags;
+retrieving revision 1.3
+retrieving revision 1.2.80.3
+diff -u -p -b -w -B -r1.3 -r1.2.80.3
+--- basic/inc/basic/sbmeth.hxx 11 Apr 2008 11:22:05 -0000 1.3
++++ basic/inc/basic/sbmeth.hxx 7 May 2008 07:10:04 -0000 1.2.80.3
+@@ -55,6 +54,7 @@ class SbMethod : public SbxMethod
USHORT nLine1, nLine2;
-@@ -76,6 +76,7 @@ public:
+ UINT32 nStart;
+ BOOL bInvalid;
++ SbxArrayRef refStatics;
+ SbMethod( const String&, SbxDataType, SbModule* );
+ SbMethod( const SbMethod& );
+ virtual BOOL LoadData( SvStream&, USHORT );
+@@ -67,6 +67,7 @@ public:
virtual SbxInfo* GetInfo();
SbxArray* GetLocals();
SbxArray* GetStatics();
@@ -26,69 +22,65 @@
SbModule* GetModule() { return pMod; }
UINT32 GetId() const { return nStart; }
USHORT GetDebugFlags() { return nDebugFlags; }
-cvs diff: Diffing basic/inc/pch
-cvs diff: Diffing basic/prj
-cvs diff: Diffing basic/source
-cvs diff: Diffing basic/source/app
-cvs diff: Diffing basic/source/basmgr
-cvs diff: Diffing basic/source/classes
Index: basic/source/classes/sbxmod.cxx
===================================================================
RCS file: /cvs/script/basic/source/classes/sbxmod.cxx,v
-retrieving revision 1.41
-retrieving revision 1.41.34.1
-diff -u -p -b -w -B -r1.41 -r1.41.34.1
---- basic/source/classes/sbxmod.cxx 20 Sep 2007 15:54:35 -0000 1.41
-+++ basic/source/classes/sbxmod.cxx 20 Dec 2007 21:23:01 -0000 1.41.34.1
-@@ -1969,10 +1969,17 @@ SbxArray* SbMethod::GetLocals()
+retrieving revision 1.42
+retrieving revision 1.41.34.3
+diff -u -p -b -w -B -r1.42 -r1.41.34.3
+--- basic/source/classes/sbxmod.cxx 11 Apr 2008 11:48:19 -0000 1.42
++++ basic/source/classes/sbxmod.cxx 7 May 2008 07:11:30 -0000 1.41.34.3
+@@ -1926,6 +1926,7 @@ SbMethod::SbMethod( const String& r, Sbx
+ nDebugFlags =
+ nLine1 =
+ nLine2 = 0;
++ refStatics = new SbxArray;
+ // AB: 2.7.1996: HACK wegen 'Referenz kann nicht gesichert werden'
+ SetFlag( SBX_NO_MODIFY );
+ }
+@@ -1939,6 +1940,7 @@ SbMethod::SbMethod( const SbMethod& r )
+ nDebugFlags = r.nDebugFlags;
+ nLine1 = r.nLine1;
+ nLine2 = r.nLine2;
++ refStatics = r.refStatics;
+ SetFlag( SBX_NO_MODIFY );
+ }
+
+@@ -1954,10 +1956,14 @@ SbxArray* SbMethod::GetLocals()
return NULL;
}
+void SbMethod::ClearStatics()
+{
-+ refStatics = NULL;
++ refStatics = new SbxArray;
+
+}
SbxArray* SbMethod::GetStatics()
{
- DBG_ERROR( "SbMethod::GetStatics() invalid, AB fragen" )
- return NULL;
-+
-+ if ( !refStatics.Is() )
-+ refStatics = new SbxArray;
+ return refStatics;
}
BOOL SbMethod::LoadData( SvStream& rStrm, USHORT nVer )
-cvs diff: Diffing basic/source/comp
Index: basic/source/comp/dim.cxx
===================================================================
RCS file: /cvs/script/basic/source/comp/dim.cxx,v
-retrieving revision 1.28
-retrieving revision 1.28.40.1
-diff -u -p -b -w -B -r1.28 -r1.28.40.1
---- basic/source/comp/dim.cxx 30 Aug 2007 09:59:44 -0000 1.28
-+++ basic/source/comp/dim.cxx 20 Dec 2007 21:23:01 -0000 1.28.40.1
-@@ -53,7 +53,7 @@ SbiSymDef* SbiParser::VarDecl( SbiDimLis
- if( Peek() == LPAREN )
- pDim = new SbiDimList( this );
- pDef->SetType( t );
-- if( bStatic )
-+ if( bVBASupportOn && bStatic )
- pDef->SetStatic();
- TypeDecl( *pDef );
- if( !ppDim && pDim )
-@@ -186,6 +186,9 @@ void SbiParser::TypeDecl( SbiSymDef& rDe
+retrieving revision 1.29
+retrieving revision 1.28.40.6
+diff -u -p -b -w -B -r1.29 -r1.28.40.6
+--- basic/source/comp/dim.cxx 11 Apr 2008 11:49:15 -0000 1.29
++++ basic/source/comp/dim.cxx 7 May 2008 07:10:48 -0000 1.28.40.6
+@@ -181,7 +181,7 @@ void SbiParser::TypeDecl( SbiSymDef& rDe
void SbiParser::Dim()
{
-+ if ( pProc )
-+ DefVar( _DIM, pProc->IsStatic() );
-+ else
- DefVar( _DIM, FALSE );
+- DefVar( _DIM, FALSE );
++ DefVar( _DIM, ( pProc && bVBASupportOn ) ? pProc->IsStatic() : FALSE );
}
-@@ -272,7 +275,7 @@ void SbiParser::DefVar( SbiOpcode eOp, B
+ void SbiParser::DefVar( SbiOpcode eOp, BOOL bStatic )
+@@ -267,7 +267,7 @@ void SbiParser::DefVar( SbiOpcode eOp, B
// AB 9.7.97, #40689, Statics -> Modul-Initialisierung, in Sub ueberspringen
UINT32 nEndOfStaticLbl = 0;
@@ -97,7 +89,7 @@
{
nEndOfStaticLbl = aGen.Gen( _JUMP, 0 );
aGen.Statement(); // bei static hier nachholen
-@@ -340,13 +343,11 @@ void SbiParser::DefVar( SbiOpcode eOp, B
+@@ -335,13 +335,11 @@ void SbiParser::DefVar( SbiOpcode eOp, B
goto global;
case SbPUBLIC: eOp2 = bPersistantGlobal ? _PUBLIC_P : _PUBLIC;
// AB 9.7.97, #40689, kein eigener Opcode mehr
@@ -112,12 +104,12 @@
global: aGen.BackChain( nGblChain );
nGblChain = 0;
bGblDefs = bNewGblDefs = TRUE;
-@@ -477,14 +478,14 @@ void SbiParser::DefVar( SbiOpcode eOp, B
+@@ -472,14 +470,14 @@ void SbiParser::DefVar( SbiOpcode eOp, B
// d.h. pPool muss immer am Schleifen-Ende zurueckgesetzt werden.
// auch bei break
pPool = pOldPool;
- continue; // MyBreak üingen
-+ continue; // MyBreak uberspingen
++ continue; // MyBreak Ãberspingen
MyBreak:
pPool = pOldPool;
break;
@@ -129,41 +121,50 @@
{
// globalen Chain pflegen
nGblChain = aGen.Gen( _JUMP, 0 );
-@@ -501,6 +502,9 @@ void SbiParser::DefVar( SbiOpcode eOp, B
+@@ -496,7 +494,7 @@ void SbiParser::DefVar( SbiOpcode eOp, B
void SbiParser::ReDim()
{
-+ if ( pProc )
-+ DefVar( _REDIM, pProc->IsStatic() );
-+ else
- DefVar( _REDIM, FALSE );
+- DefVar( _REDIM, FALSE );
++ DefVar( _REDIM, ( pProc && bVBASupportOn ) ? pProc->IsStatic() : FALSE );
}
-@@ -1005,11 +1009,13 @@ void SbiParser::DefProc( BOOL bStatic, B
- // Normalfall: Lokale Variable->Parameter->Globale Variable
- pProc->GetLocals().SetParent( &pProc->GetParams() );
- pPool = &pProc->GetLocals();
-+ pProc->SetStatic( FALSE );
+ // ERASE array, ...
+@@ -995,16 +993,20 @@ void SbiParser::DefProc( BOOL bStatic, B
+ // Prozedur.
+ aPublics.SetProcId( pProc->GetId() );
+ pProc->GetParams().SetParent( &aPublics );
+- if( !bStatic )
++ if( bStatic )
+ {
+- // Normalfall: Lokale Variable->Parameter->Globale Variable
+- pProc->GetLocals().SetParent( &pProc->GetParams() );
+- pPool = &pProc->GetLocals();
++ if ( bVBASupportOn )
++ pProc->SetStatic( TRUE );
++ else
++ Error( SbERR_NOT_IMPLEMENTED ); // STATIC SUB ...
}
-+ else if ( bVBASupportOn )
-+ pProc->SetStatic( TRUE );
else
-- {
- Error( SbERR_NOT_IMPLEMENTED ); // STATIC SUB ...
-- }
-+
+ {
+- Error( SbERR_NOT_IMPLEMENTED ); // STATIC SUB ...
++ pProc->SetStatic( FALSE );
+ }
++ // Normalfall: Lokale Variable->Parameter->Globale Variable
++ pProc->GetLocals().SetParent( &pProc->GetParams() );
++ pPool = &pProc->GetLocals();
pProc->Define();
OpenBlock( eExit );
Index: basic/source/comp/exprgen.cxx
===================================================================
RCS file: /cvs/script/basic/source/comp/exprgen.cxx,v
-retrieving revision 1.16
-retrieving revision 1.16.132.1
-diff -u -p -b -w -B -r1.16 -r1.16.132.1
---- basic/source/comp/exprgen.cxx 12 Oct 2006 14:26:47 -0000 1.16
-+++ basic/source/comp/exprgen.cxx 20 Dec 2007 21:23:01 -0000 1.16.132.1
-@@ -132,9 +132,17 @@ void SbiExprNode::Gen( RecursiveMode eRe
+retrieving revision 1.17
+retrieving revision 1.16.132.2
+diff -u -p -b -w -B -r1.17 -r1.16.132.2
+--- basic/source/comp/exprgen.cxx 11 Apr 2008 11:49:35 -0000 1.17
++++ basic/source/comp/exprgen.cxx 7 May 2008 07:10:52 -0000 1.16.132.2
+@@ -127,9 +127,17 @@ void SbiExprNode::Gen( RecursiveMode eRe
(aVar.pDef->IsGlobal() ? _FIND_G : _FIND);
}
@@ -186,12 +187,12 @@
Index: basic/source/comp/exprtree.cxx
===================================================================
RCS file: /cvs/script/basic/source/comp/exprtree.cxx,v
-retrieving revision 1.19
-retrieving revision 1.19.64.1
-diff -u -p -b -w -B -r1.19 -r1.19.64.1
---- basic/source/comp/exprtree.cxx 27 Jun 2007 14:20:26 -0000 1.19
-+++ basic/source/comp/exprtree.cxx 20 Dec 2007 21:23:01 -0000 1.19.64.1
-@@ -278,6 +278,11 @@ SbiExprNode* SbiExpression::Term()
+retrieving revision 1.22
+retrieving revision 1.19.64.3
+diff -u -p -b -w -B -r1.22 -r1.19.64.3
+--- basic/source/comp/exprtree.cxx 11 Apr 2008 11:50:24 -0000 1.22
++++ basic/source/comp/exprtree.cxx 7 May 2008 07:10:36 -0000 1.19.64.3
+@@ -273,6 +273,11 @@ SbiExprNode* SbiExpression::Term()
if( bObj )
eType = SbxOBJECT;
pDef = AddSym( eTok, *pParser->pPool, eCurExpr, aSym, eType, pPar );
@@ -206,12 +207,12 @@
Index: basic/source/comp/sbcomp.cxx
===================================================================
RCS file: /cvs/script/basic/source/comp/sbcomp.cxx,v
-retrieving revision 1.14
-retrieving revision 1.14.64.1
-diff -u -p -b -w -B -r1.14 -r1.14.64.1
---- basic/source/comp/sbcomp.cxx 27 Jun 2007 14:20:58 -0000 1.14
-+++ basic/source/comp/sbcomp.cxx 20 Dec 2007 21:23:01 -0000 1.14.64.1
-@@ -142,6 +142,13 @@ BOOL SbModule::Compile()
+retrieving revision 1.15
+retrieving revision 1.14.64.2
+diff -u -p -b -w -B -r1.15 -r1.14.64.2
+--- basic/source/comp/sbcomp.cxx 11 Apr 2008 11:52:01 -0000 1.15
++++ basic/source/comp/sbcomp.cxx 7 May 2008 07:10:39 -0000 1.14.64.2
+@@ -134,6 +134,13 @@ BOOL SbModule::Compile()
if( bRet )
{
pBasic->ClearAllModuleVars();
@@ -228,12 +229,12 @@
Index: basic/source/comp/symtbl.cxx
===================================================================
RCS file: /cvs/script/basic/source/comp/symtbl.cxx,v
-retrieving revision 1.18
-retrieving revision 1.18.126.1
-diff -u -p -b -w -B -r1.18 -r1.18.126.1
---- basic/source/comp/symtbl.cxx 3 Nov 2006 15:10:55 -0000 1.18
-+++ basic/source/comp/symtbl.cxx 20 Dec 2007 21:23:01 -0000 1.18.126.1
-@@ -428,6 +428,7 @@ SbiProcDef::SbiProcDef( SbiParser* pPars
+retrieving revision 1.19
+retrieving revision 1.18.126.2
+diff -u -p -b -w -B -r1.19 -r1.18.126.2
+--- basic/source/comp/symtbl.cxx 11 Apr 2008 11:52:40 -0000 1.19
++++ basic/source/comp/symtbl.cxx 7 May 2008 07:10:43 -0000 1.18.126.2
+@@ -423,6 +423,7 @@ SbiProcDef::SbiProcDef( SbiParser* pPars
mePropMode = PROPERTY_MODE_NONE;
bPublic = TRUE;
bCdecl = FALSE;
@@ -241,16 +242,15 @@
// Fuer Returnwerte ist das erste Element der Parameterliste
// immer mit dem Namen und dem Typ der Proc definiert
aParams.AddSym( aName );
-cvs diff: Diffing basic/source/inc
Index: basic/source/inc/opcodes.hxx
===================================================================
RCS file: /cvs/script/basic/source/inc/opcodes.hxx,v
-retrieving revision 1.12
-retrieving revision 1.12.40.1
-diff -u -p -b -w -B -r1.12 -r1.12.40.1
---- basic/source/inc/opcodes.hxx 30 Aug 2007 10:00:44 -0000 1.12
-+++ basic/source/inc/opcodes.hxx 20 Dec 2007 21:23:01 -0000 1.12.40.1
-@@ -167,6 +167,8 @@ enum SbiOpcode {
+retrieving revision 1.13
+retrieving revision 1.12.40.2
+diff -u -p -b -w -B -r1.13 -r1.12.40.2
+--- basic/source/inc/opcodes.hxx 11 Apr 2008 11:56:38 -0000 1.13
++++ basic/source/inc/opcodes.hxx 7 May 2008 07:10:08 -0000 1.12.40.2
+@@ -162,6 +162,8 @@ enum SbiOpcode {
_DCREATE_REDIMP, // Objekt-Array redimensionieren (+StringId+StringID)
_FIND_CM, // Search inside a class module (CM) to enable global search in time
_PUBLIC_P, // Module global Variable (persisted between calls)(+StringID+Typ)
@@ -262,20 +262,12 @@
Index: basic/source/inc/runtime.hxx
===================================================================
RCS file: /cvs/script/basic/source/inc/runtime.hxx,v
-retrieving revision 1.35
-retrieving revision 1.35.40.1
-diff -u -p -b -w -B -r1.35 -r1.35.40.1
---- basic/source/inc/runtime.hxx 30 Aug 2007 10:01:05 -0000 1.35
-+++ basic/source/inc/runtime.hxx 20 Dec 2007 21:23:01 -0000 1.35.40.1
-@@ -331,6 +331,7 @@ class SbiRuntime
- SbiInstance* pInst; // aktiver Thread
- SbModule* pMod; // aktuelles Modul
- SbMethod* pMeth; // Methoden-Instanz
-+ SbMethod* pRealMeth;
- SbiIoSystem* pIosys; // I/O-System
- const SbiImage* pImg; // Code-Image
- SbxArrayRef refExprStk; // expression stack
-@@ -392,7 +393,7 @@ class SbiRuntime
+retrieving revision 1.36
+retrieving revision 1.35.40.4
+diff -u -p -b -w -B -r1.36 -r1.35.40.4
+--- basic/source/inc/runtime.hxx 11 Apr 2008 11:57:39 -0000 1.36
++++ basic/source/inc/runtime.hxx 7 May 2008 07:10:16 -0000 1.35.40.4
+@@ -373,7 +373,7 @@ class SbiRuntime
}
SbxVariable* FindElement
@@ -284,7 +276,7 @@
void SetupArgs( SbxVariable*, UINT32 );
SbxVariable* CheckArray( SbxVariable* );
-@@ -464,16 +465,19 @@ class SbiRuntime
+@@ -445,16 +445,19 @@ class SbiRuntime
// Alle Opcodes mit zwei Operanden
void StepRTL( UINT32, UINT32 ), StepPUBLIC( UINT32, UINT32 ), StepPUBLIC_P( UINT32, UINT32 );
void StepPUBLIC_Impl( UINT32, UINT32, bool bUsedForClassModule );
@@ -304,15 +296,22 @@
public:
void SetVBAEnabled( bool bEnabled ) { bVBAEnabled = bEnabled; };
USHORT GetImageFlag( USHORT n ) const;
+@@ -541,5 +544,6 @@ inline String getFullPathUNC( const Stri
+ return getFullPath( aRelPath );
+ }
+ void implStepRenameOSL( const String& aSource, const String& aDest );
++bool IsBaseIndexOne();
+
+ #endif
Index: basic/source/inc/symtbl.hxx
===================================================================
RCS file: /cvs/script/basic/source/inc/symtbl.hxx,v
-retrieving revision 1.11
-retrieving revision 1.11.64.1
-diff -u -p -b -w -B -r1.11 -r1.11.64.1
---- basic/source/inc/symtbl.hxx 27 Jun 2007 14:24:09 -0000 1.11
-+++ basic/source/inc/symtbl.hxx 20 Dec 2007 21:23:02 -0000 1.11.64.1
-@@ -207,6 +207,7 @@ class SbiProcDef : public SbiSymDef { //
+retrieving revision 1.12
+retrieving revision 1.11.64.2
+diff -u -p -b -w -B -r1.12 -r1.11.64.2
+--- basic/source/inc/symtbl.hxx 11 Apr 2008 12:00:13 -0000 1.12
++++ basic/source/inc/symtbl.hxx 7 May 2008 07:10:12 -0000 1.11.64.2
+@@ -194,6 +194,7 @@ class SbiProcDef : public SbiSymDef { //
BOOL bCdecl : 1; // TRUE: CDECL angegeben
BOOL bPublic : 1; // TRUE: proc ist PUBLIC
BOOL mbProcDecl : 1; // TRUE: instanciated by SbiParser::ProcDecl
@@ -320,7 +319,7 @@
public:
SbiProcDef( SbiParser*, const String&, BOOL bProcDecl=false );
virtual ~SbiProcDef();
-@@ -219,6 +220,8 @@ public:
+@@ -206,6 +207,8 @@ public:
String& GetAlias() { return aAlias; }
void SetPublic( BOOL b ) { bPublic = b; }
BOOL IsPublic() const { return bPublic; }
@@ -329,16 +328,30 @@
void SetCdecl( BOOL b = TRUE) { bCdecl = b; }
BOOL IsCdecl() const { return bCdecl; }
BOOL IsUsedForProcDecl() const { return mbProcDecl; }
-cvs diff: Diffing basic/source/runtime
Index: basic/source/runtime/methods.cxx
===================================================================
RCS file: /cvs/script/basic/source/runtime/methods.cxx,v
-retrieving revision 1.77
-retrieving revision 1.77.34.6
-diff -u -p -b -w -B -r1.77 -r1.77.34.6
---- basic/source/runtime/methods.cxx 20 Sep 2007 15:55:04 -0000 1.77
-+++ basic/source/runtime/methods.cxx 29 Jan 2008 03:21:14 -0000 1.77.34.6
-@@ -1352,6 +1352,87 @@ RTLFUNC(Oct)
+retrieving revision 1.79
+retrieving revision 1.77.34.15
+diff -u -p -b -w -B -r1.79 -r1.77.34.15
+--- basic/source/runtime/methods.cxx 11 Apr 2008 12:03:12 -0000 1.79
++++ basic/source/runtime/methods.cxx 12 May 2008 03:35:52 -0000 1.77.34.15
+@@ -54,8 +54,13 @@
+
+ #include "runtime.hxx"
+ #include "sbunoobj.hxx"
+-#ifdef _OLD_FILE_IMPL
++#ifdef WNT
++#include <tools/prewin.h>
++#include "winbase.h"
++#include <tools/postwin.h>
++#ifndef _FSYS_HXX //autogen
+ #include <tools/fsys.hxx>
++#endif
+ #else
+ #include <osl/file.hxx>
+ #endif
+@@ -1319,6 +1324,87 @@ RTLFUNC(Oct)
}
}
@@ -408,260 +421,119 @@
+ aFindStr.ToUpperAscii();
+ }
+
-+ USHORT nPos = aSrcStr.Search( aFindStr, lStartPos - 1 );
++ USHORT nPos = aSrcStr.Search( aFindStr, static_cast<USHORT>( lStartPos - 1 ) );
+ USHORT nCounts = 0;
+ USHORT nReplaceLength = aReplaceStr.Len() ? aReplaceStr.Len():1;
+ while( nPos != STRING_NOTFOUND && (lCount == -1 || lCount > nCounts) )
+ {
+ aExpStr.Replace( nPos, aFindStr.Len(), aReplaceStr );
-+ nPos += nReplaceLength;
++ nPos = nPos + nReplaceLength;
+ nPos = aSrcStr.Search( aFindStr, nPos );
+ nCounts++;
+ }
+ }
-+ rPar.Get(0)->PutString( aExpStr.Copy(lStartPos - 1) );
++ rPar.Get(0)->PutString( aExpStr.Copy( static_cast<USHORT>(lStartPos - 1) ) );
+ }
+}
+
RTLFUNC(Right)
{
(void)pBasic;
-@@ -2835,8 +2916,18 @@ RTLFUNC(GetAttr)
+@@ -2802,6 +2888,32 @@ RTLFUNC(GetAttr)
{
INT16 nFlags = 0;
+ // In Windows, We want to use Windows API to get the file attributes
+ // for VBA interoperability.
-+ BOOL bUCB = TRUE;
-+ #ifdef _OLD_FILE_IMPL
-+ #if defined( WNT )
-+ if( SbiRuntime::isVBAEnabled() )
-+ bUCB = FALSE;
-+ #endif
-+ #endif
-+
- // <-- UCB
-- if( hasUno() )
-+ if( hasUno() && bUCB )
- {
- Reference< XSimpleFileAccess3 > xSFI = getFileAccess();
- if( xSFI.is() )
-@@ -3208,6 +3299,196 @@ RTLFUNC(Seek)
- }
- }
-
-+enum VbaFormatType
-+{
-+ VBA_FORMAT_TYPE_OFFSET, // standard number format
-+ VBA_FORMAT_TYPE_USERDEFINED, // user defined number format
-+ VBA_FORMAT_TYPE_NULL
-+};
-+
-+struct VbaFormatInfo
-+{
-+ VbaFormatType meType;
-+ const char* mpVbaFormat; // Format string in vba
-+ NfIndexTableOffset meOffset; // SvNumberFormatter format index, if meType = VBA_FORMAT_TYPE_OFFSET
-+ const char* mpOOoFormat; // if meType = VBA_FORMAT_TYPE_USERDEFINED
-+};
-+
-+#define VBA_FORMAT_OFFSET( pcUtf8, eOffset ) \
-+ { VBA_FORMAT_TYPE_OFFSET, pcUtf8, eOffset, 0 }
-+
-+#define VBA_FORMAT_USERDEFINED( pcUtf8, pcDefinedUtf8 ) \
-+ { VBA_FORMAT_TYPE_USERDEFINED, pcUtf8, NF_NUMBER_STANDARD, pcDefinedUtf8 }
-+
-+static VbaFormatInfo pFormatInfoTable[] =
-+{
-+ VBA_FORMAT_OFFSET( "Long Date", NF_DATE_SYSTEM_LONG ),
-+ VBA_FORMAT_USERDEFINED( "Medium Date", "DD-MMM-YYYY" ),
-+ VBA_FORMAT_OFFSET( "Short Date", NF_DATE_SYSTEM_SHORT ),
-+ VBA_FORMAT_OFFSET( "Long Time", NF_TIME_HHMMSSAMPM ),
-+ VBA_FORMAT_OFFSET( "Medium Time", NF_TIME_HHMMAMPM ),
-+ VBA_FORMAT_OFFSET( "Short Time", NF_TIME_HHMM ),
-+ VBA_FORMAT_OFFSET( "ddddd", NF_DATE_SYSTEM_SHORT ),
-+ VBA_FORMAT_OFFSET( "dddddd", NF_DATE_SYSTEM_LONG ),
-+ VBA_FORMAT_OFFSET( "ttttt", NF_TIME_HHMMSSAMPM ),
-+ VBA_FORMAT_OFFSET( "ww", NF_DATE_WW ),
-+ VBA_FORMAT_USERDEFINED( "General Number", "0.############" ),
-+ VBA_FORMAT_OFFSET( "Currency", NF_CURRENCY_1000DEC2 ),
-+ VBA_FORMAT_OFFSET( "Fixed", NF_NUMBER_DEC2 ),
-+ VBA_FORMAT_OFFSET( "Standard", NF_NUMBER_SYSTEM ),
-+ VBA_FORMAT_OFFSET( "Percent", NF_PERCENT_DEC2 ),
-+ VBA_FORMAT_OFFSET( "Scientific", NF_SCIENTIFIC_000E00 ),
-+ { VBA_FORMAT_TYPE_NULL, 0, NF_INDEX_TABLE_ENTRIES, 0 }
-+};
-+
-+VbaFormatInfo* getFormatInfo( const String& rFmt )
-+{
-+ VbaFormatInfo* pInfo = NULL;
-+ INT16 i = 0;
-+ while( (pInfo = pFormatInfoTable + i )->mpVbaFormat != NULL )
-+ {
-+ if( rFmt.EqualsIgnoreCaseAscii( pInfo->mpVbaFormat ) )
-+ break;
-+ i++;
-+ }
-+ return pInfo;
-+}
-+
-+#define VBAFORMAT_GENERALDATE "General Date"
-+#define VBAFORMAT_C "c"
-+#define VBAFORMAT_N "n"
-+#define VBAFORMAT_NN "nn"
-+#define VBAFORMAT_W "w"
-+#define VBAFORMAT_Y "y"
-+#define VBAFORMAT_YESNO "Yes/No"
-+#define VBAFORMAT_TRUEFALSE "True/False"
-+#define VBAFORMAT_ONOFF "On/Off"
-+#define VBAFORMAT_LOWERCASE "<"
-+#define VBAFORMAT_UPPERCASE ">"
-+
-+// From methods1.cxx
-+INT16 implGetWeekDay( double aDate, bool bFirstDayParam = false, INT16 nFirstDay = 0 );
-+
-+String VbaFormat( String& rStr, String& rFmt )
-+{
-+ String aRetStr;
-+
-+ // For simple text format
-+ if( rFmt.EqualsIgnoreCaseAscii( VBAFORMAT_LOWERCASE ) )
-+ return rStr.ToLowerAscii();
-+ if( rFmt.EqualsIgnoreCaseAscii( VBAFORMAT_UPPERCASE ) )
-+ return rStr.ToUpperAscii();
-+ if( rFmt.EqualsIgnoreCaseAscii( VBAFORMAT_YESNO ) )
-+ return ( rStr.ToDouble() == 0.0 ) ? aRetStr.AssignAscii( "No" ) : aRetStr.AssignAscii( "Yes" ) ;
-+ if( rFmt.EqualsIgnoreCaseAscii( VBAFORMAT_TRUEFALSE ) )
-+ return ( rStr.ToDouble() == 0.0 ) ? aRetStr.AssignAscii( "False" ) : aRetStr.AssignAscii( "True" ) ;
-+ if( rFmt.EqualsIgnoreCaseAscii( VBAFORMAT_ONOFF ) )
-+ return ( rStr.ToDouble() == 0.0 ) ? aRetStr.AssignAscii( "Off" ) : aRetStr.AssignAscii( "On" ) ;
-+
-+ SvNumberFormatter* pFormatter;
-+ com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
-+ xFactory = comphelper::getProcessServiceFactory();
-+ pFormatter = new SvNumberFormatter( xFactory, LANGUAGE_ENGLISH );
-+
-+ sal_uInt32 nIndex;
-+ xub_StrLen nCheckPos = 0;
-+ short nType;
-+ double nNumber;
-+ Color* pCol;
-+
-+ LanguageType eLangType = GetpApp()->GetSettings().GetLanguage();
-+ BOOL bSuccess = pFormatter->IsNumberFormat( rStr, nIndex, nNumber );
++ #if defined( WNT )
++ if( SbiRuntime::isVBAEnabled() )
++ {
++ DirEntry aEntry( rPar.Get(1)->GetString() );
++ aEntry.ToAbs();
+
-+ // Number format
-+ if( bSuccess )
-+ {
-+ VbaFormatInfo* pInfo = getFormatInfo( rFmt );
-+ if( pInfo && pInfo->meType != VBA_FORMAT_TYPE_NULL )
-+ {
-+ if( pInfo->meType == VBA_FORMAT_TYPE_OFFSET )
-+ {
-+ nIndex = pFormatter->GetFormatIndex( pInfo->meOffset, eLangType );
-+ }
-+ else
-+ {
-+ rFmt.AssignAscii( pInfo->mpOOoFormat );
-+ pFormatter->PutandConvertEntry( rFmt, nCheckPos, nType, nIndex, LANGUAGE_ENGLISH, eLangType );
-+ }
-+ pFormatter->GetOutputString( nNumber, nIndex, aRetStr, &pCol );
-+ }
-+ else if( rFmt.EqualsIgnoreCaseAscii( VBAFORMAT_GENERALDATE )
-+ || rFmt.EqualsIgnoreCaseAscii( VBAFORMAT_C ))
-+ {
-+ if( nNumber <=-1.0 || nNumber >= 1.0 )
-+ {
-+ // short date
-+ nIndex = pFormatter->GetFormatIndex( NF_DATE_SYSTEM_SHORT, eLangType );
-+ pFormatter->GetOutputString( nNumber, nIndex, aRetStr, &pCol );
-+
-+ // long time
-+ if( floor( nNumber ) != nNumber )
-+ {
-+ nIndex = pFormatter->GetFormatIndex( NF_TIME_HHMMSSAMPM, eLangType );
-+ String aTime;
-+ pFormatter->GetOutputString( nNumber, nIndex, aTime, &pCol );
-+ aRetStr.AppendAscii(" ");
-+ aRetStr += aTime;
-+ }
-+ }
-+ else
-+ {
-+ // long time only
-+ nIndex = pFormatter->GetFormatIndex( NF_TIME_HHMMSSAMPM, eLangType );
-+ pFormatter->GetOutputString( nNumber, nIndex, aRetStr, &pCol );
-+ }
-+ }
-+ else if( rFmt.EqualsIgnoreCaseAscii( VBAFORMAT_N )
-+ || rFmt.EqualsIgnoreCaseAscii( VBAFORMAT_NN ))
-+ {
-+ INT32 nMin = implGetMinute( nNumber );
-+ if( nMin < 10 && rFmt.EqualsIgnoreCaseAscii( VBAFORMAT_NN ) )
-+ {
-+ // Minute in two digits
-+ sal_Unicode* p = aRetStr.AllocBuffer( 2 );
-+ *p++ = '0';
-+ *p = sal_Unicode( '0' + nMin );
-+ }
-+ else
-+ {
-+ aRetStr = String::CreateFromInt32( nMin );
-+ }
-+ }
-+ else if( rFmt.EqualsIgnoreCaseAscii( VBAFORMAT_W ))
-+ {
-+ INT32 nWeekDay = implGetWeekDay( nNumber );
-+ aRetStr = String::CreateFromInt32( nWeekDay );
-+ }
-+ else if( rFmt.EqualsIgnoreCaseAscii( VBAFORMAT_Y ))
-+ {
-+ INT16 nYear = implGetDateYear( nNumber );
-+ double dBaseDate;
-+ implDateSerial( nYear, 1, 1, dBaseDate );
-+ INT32 nYear32 = 1 + INT32( nNumber - dBaseDate );
-+ aRetStr = String::CreateFromInt32( nYear32 );
-+ }
-+ else
-+ {
-+ pFormatter->PutandConvertEntry( rFmt, nCheckPos, nType, nIndex, LANGUAGE_ENGLISH, eLangType );
-+ pFormatter->GetOutputString( nNumber, nIndex, aRetStr, &pCol );
-+ }
-+ }
-+ else
-+ {
-+ // text format
-+ pFormatter->PutandConvertEntry( rFmt, nCheckPos, nType, nIndex, LANGUAGE_ENGLISH, eLangType );
-+ pFormatter->GetOutputString( rStr, nIndex, aRetStr, &pCol );
-+ }
++ // #57064 Bei virtuellen URLs den Real-Path extrahieren
++ ByteString aByteStrFullPath( aEntry.GetFull(), gsl_getSystemTextEncoding() );
++ DWORD nRealFlags = GetFileAttributes (aByteStrFullPath.GetBuffer());
++ if (nRealFlags != 0xffffffff)
++ {
++ if (nRealFlags == FILE_ATTRIBUTE_NORMAL)
++ nRealFlags = 0;
++ nFlags = (INT16) (nRealFlags);
++ }
++ else
++ StarBASIC::Error( SbERR_FILE_NOT_FOUND );
+
-+ delete pFormatter;
-+
-+ return aRetStr;
-+}
++ rPar.Get(0)->PutInteger( nFlags );
+
- RTLFUNC(Format)
- {
- (void)pBasic;
-@@ -3224,8 +3505,17 @@ RTLFUNC(Format)
++ return;
++ }
++ #endif
++
+ // <-- UCB
+ if( hasUno() )
+ {
+@@ -2839,51 +2951,6 @@ RTLFUNC(GetAttr)
else
+ // --> UCB
{
- String aFmt( rPar.Get(2)->GetString() );
-+
-+ if( SbiRuntime::isVBAEnabled() )
-+ {
-+ String aStr = rPar.Get(1)->GetString();
-+ aResult = VbaFormat( aStr, aFmt );
-+ }
-+ else
-+ {
- rPar.Get(1)->Format( aResult, &aFmt );
+-#ifdef _OLD_FILE_IMPL
+- DirEntry aEntry( rPar.Get(1)->GetString() );
+- aEntry.ToAbs();
+- BOOL bUseFileStat = FALSE;
+-
+- // #57064 Bei virtuellen URLs den Real-Path extrahieren
+- String aFile = aEntry.GetFull();
+- ByteString aByteStrFullPath( aEntry.GetFull(), gsl_getSystemTextEncoding() );
+- #if defined( WIN )
+- int nErr = _dos_getfileattr( aByteStrFullPath.GetBuffer(),(unsigned *) &nFlags );
+- if ( nErr )
+- StarBASIC::Error( SbERR_FILE_NOT_FOUND );
+- #elif defined( WNT )
+- DWORD nRealFlags = GetFileAttributes (aByteStrFullPath.GetBuffer());
+- if (nRealFlags != 0xffffffff)
+- {
+- if (nRealFlags == FILE_ATTRIBUTE_NORMAL)
+- nRealFlags = 0;
+- nFlags = (INT16) (nRealFlags);
+- }
+- 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
+- if( bUseFileStat )
+- {
+- if( FileStat::GetReadOnlyFlag( aEntry ) )
+- nFlags |= 0x0001; // ATTR_READONLY
+- FileStat aStat( aEntry );
+- DirEntryKind eKind = aStat.GetKind();
+- if( eKind & FSYS_KIND_DIR )
+- nFlags |= 0x0010; // ATTR_DIRECTORY
+- if( aEntry.GetFlag() & FSYS_FLAG_VOLUME )
+- nFlags |= 0x0008; // ATTR_VOLUME
+- }
+-#else
+ DirectoryItem aItem;
+ FileBase::RC nRet = DirectoryItem::get( getFullPathUNC( rPar.Get(1)->GetString() ), aItem );
+ FileStatus aFileStatus( FileStatusMask_Attributes | FileStatusMask_Type );
+@@ -2897,8 +2964,6 @@ RTLFUNC(GetAttr)
+ nFlags |= 0x0001; // ATTR_READONLY
+ if( bDirectory )
+ nFlags |= 0x0010; // ATTR_DIRECTORY
+-
+-#endif
}
-+ }
- rPar.Get(0)->PutString( aResult );
+ rPar.Get(0)->PutInteger( nFlags );
}
- }
-@@ -3865,21 +4155,135 @@ RTLFUNC(QBColor)
+@@ -3832,20 +3897,134 @@ RTLFUNC(QBColor)
rPar.Get(0)->PutLong( nRGB );
}
@@ -742,7 +614,7 @@
+ sal_Char* pChar = new sal_Char[nSize+1];
+ for( USHORT i=0; i < nSize; i++ )
+ {
-+ pChar[i] = i%2 ? ((*pSrc) >> 8) & 0xff : (*pSrc) & 0xff;
++ pChar[i] = static_cast< sal_Char >( i%2 ? ((*pSrc) >> 8) & 0xff : (*pSrc) & 0xff );
+ if( i%2 )
+ pSrc++;
+ }
@@ -761,7 +633,7 @@
+ // there is no concept about default codepage in unix. so it is incorrectly in unix
+ OString aOStr = OUStringToOString(aNewStr,osl_getThreadTextEncoding());
+ const sal_Char* pChar = aOStr.getStr();
-+ USHORT nArraySize = aOStr.getLength();
++ USHORT nArraySize = static_cast< USHORT >( aOStr.getLength() );
+ SbxDimArray* pArray = new SbxDimArray(SbxBYTE);
+ bool bIncIndex = (IsBaseIndexOne() && SbiRuntime::isVBAEnabled() );
+ if(nArraySize)
@@ -770,12 +642,12 @@
+ pArray->AddDim( 1, nArraySize );
+ else
+ pArray->AddDim( 0, nArraySize-1 );
-+ }
+ }
+ else
+ {
+ pArray->unoAddDim( 0, -1 );
- }
-
++ }
++
+ for( USHORT i=0; i< nArraySize; i++)
+ {
+ SbxVariable* pNew = new SbxVariable( SbxBYTE );
@@ -800,11 +672,10 @@
+ rPar.Get(0)->PutString(aNewStr);
+}
+
-+
+
RTLFUNC(Beep)
{
- (void)pBasic;
-@@ -4263,3 +4667,115 @@ RTLFUNC(FileExists)
+@@ -4230,3 +4409,82 @@ RTLFUNC(FileExists)
StarBASIC::Error( SbERR_BAD_ARGUMENT );
}
@@ -830,105 +701,72 @@
+ return;
+ }
+
-+ // define a space (' ') character and colon(:) character
-+ OUString aSpace = OUString::createFromAscii(" ");
-+ OUString aColon = OUString::createFromAscii(":");
-+
-+ OUString aBeforStart = OUString::valueOf(nStart-1);
-+ OUString aAfterStop = OUString::valueOf(nStop+1);
-+
+ // the Partition function inserts leading spaces before lowervalue and uppervalue
+ // so that they both have the same number of characters as the string
+ // representation of the value (Stop + 1). This ensures that if you use the output
+ // of the Partition function with several values of Number, the resulting text
+ // will be handled properly during any subsequent sort operation.
+
-+ // The maximun number of characters before lowervalue and uppervalue
-+ INT32 nLen1 = aBeforStart.getLength();
++ // calculate the maximun number of characters before lowervalue and uppervalue
++ OUString aBeforeStart = OUString::valueOf( nStart - 1 );
++ OUString aAfterStop = OUString::valueOf( nStop + 1 );
++ INT32 nLen1 = aBeforeStart.getLength();
+ INT32 nLen2 = aAfterStop.getLength();
+ INT32 nLen = nLen1 >= nLen2 ? nLen1:nLen2;
+
-+ OUString aRetStr;
++ OUStringBuffer aRetStr( nLen * 2 + 1);
+ OUString aLowerValue;
+ OUString aUpperValue;
-+ OUString aSpaceStr1;
-+ OUString aSpaceStr2;
-+ if( nNumber < nStart || nNumber > nStop )
++ if( nNumber < nStart )
+ {
-+ // appending the leading spaces for the lowervalue and uppervalue
-+ for( INT32 i=0; i< nLen; i++ )
-+ {
-+ aSpaceStr1 += aSpace;
-+ }
-+
-+ INT32 start = nNumber < nStart ? nLen1 : nLen2;
-+
-+ for( INT32 i=start; i<nLen; i++ )
-+ {
-+ aSpaceStr2 += aSpace;
-+ }
-+
-+ if( nNumber < nStart )
-+ {
-+ aLowerValue = aSpaceStr1;
-+ aUpperValue = aSpaceStr2 + aBeforStart;
-+ }
-+ else
-+ {
-+ aLowerValue = aSpaceStr2 + aAfterStop;
-+ aUpperValue = aSpaceStr1;
-+ }
-+
-+ aRetStr = aLowerValue + aColon + aUpperValue;
-+ rPar.Get(0)->PutString(String(aRetStr));
-+ return;
++ aUpperValue = aBeforeStart;
+ }
-+
-+ INT32 nLowerValue;
-+ INT32 nUpperValue;
-+ for( INT32 i=nStart; i<nStop; i=i+nInterval )
++ else if( nNumber > nStop )
++ {
++ aLowerValue = aAfterStop;
++ }
++ else
+ {
-+ if( nNumber < i+nInterval )
++ INT32 nLowerValue = nNumber;
++ INT32 nUpperValue = nLowerValue;
++ if( nInterval > 1 )
+ {
-+ nLowerValue = i;
-+ nUpperValue = ( i+nInterval-1 > nStop ) ? nStop : (i+nInterval-1);
-+ break;
++ nLowerValue = ((( nNumber - nStart ) / nInterval ) * nInterval ) + nStart;
++ nUpperValue = nLowerValue + nInterval - 1;
+ }
++
++ aLowerValue = OUString::valueOf( nLowerValue );
++ aUpperValue = OUString::valueOf( nUpperValue );
+ }
+
-+ aLowerValue = OUString::valueOf( nLowerValue );
-+ aUpperValue = OUString::valueOf( nUpperValue );
-+
+ nLen1 = aLowerValue.getLength();
+ nLen2 = aUpperValue.getLength();
+
-+ // appending the leading spaces for the lowervalue and uppervalue
-+ for( INT32 i=nLen1; i<nLen; i++ )
++ if( nLen > nLen1 )
+ {
-+ aSpaceStr1 += aSpace;
++ // appending the leading spaces for the lowervalue
++ for ( INT32 i= (nLen - nLen1) ; i > 0; --i )
++ aRetStr.appendAscii(" ");
+ }
-+ aLowerValue = aSpaceStr1 + aLowerValue;
-+
-+ for( INT32 i=nLen2; i<nLen; i++ )
++ aRetStr.append( aLowerValue ).appendAscii(":");
++ if( nLen > nLen2 )
+ {
-+ aSpaceStr2 += aSpace;
++ // appending the leading spaces for the uppervalue
++ for ( INT32 i= (nLen - nLen2) ; i > 0; --i )
++ aRetStr.appendAscii(" ");
+ }
-+
-+ aUpperValue = aSpaceStr2 + aUpperValue;
-+
-+ aRetStr = aLowerValue + aColon + aUpperValue;
-+
-+ rPar.Get(0)->PutString(String(aRetStr));
++ aRetStr.append( aUpperValue );
++ rPar.Get(0)->PutString( String(aRetStr.makeStringAndClear()) );
+}
Index: basic/source/runtime/rtlproto.hxx
===================================================================
RCS file: /cvs/script/basic/source/runtime/rtlproto.hxx,v
-retrieving revision 1.17
-retrieving revision 1.17.64.3
-diff -u -p -b -w -B -r1.17 -r1.17.64.3
---- basic/source/runtime/rtlproto.hxx 27 Jun 2007 14:26:27 -0000 1.17
-+++ basic/source/runtime/rtlproto.hxx 7 Jan 2008 06:47:16 -0000 1.17.64.3
-@@ -189,6 +189,7 @@ extern RTLFUNC(Log);
+retrieving revision 1.18
+retrieving revision 1.17.64.5
+diff -u -p -b -w -B -r1.18 -r1.17.64.5
+--- basic/source/runtime/rtlproto.hxx 11 Apr 2008 12:04:28 -0000 1.18
++++ basic/source/runtime/rtlproto.hxx 7 May 2008 07:11:00 -0000 1.17.64.5
+@@ -184,6 +184,7 @@ extern RTLFUNC(Log);
extern RTLFUNC(LTrim);
extern RTLFUNC(Mid);
extern RTLFUNC(Oct);
@@ -936,7 +774,7 @@
extern RTLFUNC(Right);
extern RTLFUNC(RTrim);
extern RTLFUNC(RTL);
-@@ -347,6 +348,8 @@ extern RTLFUNC(CDateFromIso);
+@@ -342,6 +343,7 @@ extern RTLFUNC(CDateFromIso);
extern RTLFUNC(CompatibilityMode);
extern RTLFUNC(CDec);
@@ -944,16 +782,15 @@
extern double Now_Impl();
extern void Wait_Impl( bool bDurationBased, SbxArray& rPar );
-+bool IsBaseIndexOne();
Index: basic/source/runtime/runtime.cxx
===================================================================
RCS file: /cvs/script/basic/source/runtime/runtime.cxx,v
-retrieving revision 1.36
-retrieving revision 1.36.40.1
-diff -u -p -b -w -B -r1.36 -r1.36.40.1
---- basic/source/runtime/runtime.cxx 30 Aug 2007 10:01:29 -0000 1.36
-+++ basic/source/runtime/runtime.cxx 20 Dec 2007 21:23:02 -0000 1.36.40.1
-@@ -212,6 +212,7 @@ SbiRuntime::pStep2 SbiRuntime::aStep2[]
+retrieving revision 1.37
+retrieving revision 1.36.40.3
+diff -u -p -b -w -B -r1.37 -r1.36.40.3
+--- basic/source/runtime/runtime.cxx 11 Apr 2008 12:04:49 -0000 1.37
++++ basic/source/runtime/runtime.cxx 7 May 2008 07:11:18 -0000 1.36.40.3
+@@ -194,6 +194,7 @@ SbiRuntime::pStep2 SbiRuntime::aStep2[]
&SbiRuntime::StepDCREATE_REDIMP, // Objekt-Array redimensionieren (+StringID+StringID)
&SbiRuntime::StepFIND_CM, // Search inside a class module (CM) to enable global search in time
&SbiRuntime::StepPUBLIC_P, // Search inside a class module (CM) to enable global search in time
@@ -961,38 +798,15 @@
};
-@@ -506,7 +507,7 @@ SbxArray* SbiInstance::GetLocals( SbMeth
-
- SbiRuntime::SbiRuntime( SbModule* pm, SbMethod* pe, UINT32 nStart )
- : rBasic( *(StarBASIC*)pm->pParent ), pInst( pINST ),
-- pMod( pm ), pMeth( pe ), pImg( pMod->pImage ), m_nLastTime(0)
-+ pMod( pm ), pMeth( pe ), pRealMeth(0), pImg( pMod->pImage ), m_nLastTime(0)
- {
- nFlags = pe ? pe->GetDebugFlags() : 0;
- pIosys = pInst->pIosys;
-@@ -542,6 +543,13 @@ SbiRuntime::SbiRuntime( SbModule* pm, Sb
- pRefSaveList = NULL;
- pItemStoreList = NULL;
- bVBAEnabled = isVBAEnabled();
-+ if ( pMeth )
-+ {
-+ SbxVariable* p = pMod->Find( pMeth->GetName(), SbxCLASS_METHOD );
-+ SbMethod* pMethod= p ? PTR_CAST(SbMethod,p) : NULL;
-+ if ( pMethod )
-+ pRealMeth = pMethod;
-+ }
- }
-
- SbiRuntime::~SbiRuntime()
Index: basic/source/runtime/stdobj.cxx
===================================================================
RCS file: /cvs/script/basic/source/runtime/stdobj.cxx,v
-retrieving revision 1.25
-retrieving revision 1.25.54.3
-diff -u -p -b -w -B -r1.25 -r1.25.54.3
---- basic/source/runtime/stdobj.cxx 3 Aug 2007 09:56:10 -0000 1.25
-+++ basic/source/runtime/stdobj.cxx 7 Jan 2008 06:47:16 -0000 1.25.54.3
-@@ -423,6 +423,12 @@ static Methods aMethods[] = {
+retrieving revision 1.26
+retrieving revision 1.25.54.5
+diff -u -p -b -w -B -r1.26 -r1.25.54.5
+--- basic/source/runtime/stdobj.cxx 11 Apr 2008 12:05:08 -0000 1.26
++++ basic/source/runtime/stdobj.cxx 7 May 2008 07:11:24 -0000 1.25.54.5
+@@ -418,6 +418,11 @@ static Methods aMethods[] = {
{ "Oct", SbxSTRING, 1 | _FUNCTION, RTLNAME(Oct),0 },
{ "number", SbxLONG, 0,NULL,0 },
@@ -1001,11 +815,10 @@
+ { "start", SbxLONG, 0,NULL,0 },
+ { "stop", SbxLONG, 0,NULL,0 },
+ { "interval", SbxLONG, 0,NULL,0 },
-+
{ "Pi", SbxDOUBLE, _CPROP, RTLNAME(PI),0 },
{ "Put", SbxNULL, 3 | _FUNCTION, RTLNAME(Put),0 },
{ "filenumber", SbxINTEGER, 0,NULL,0 },
-@@ -443,6 +449,13 @@ static Methods aMethods[] = {
+@@ -438,6 +443,13 @@ static Methods aMethods[] = {
{ "Red", SbxINTEGER, 0,NULL,0 },
{ "Green", SbxINTEGER, 0,NULL,0 },
{ "Blue", SbxINTEGER, 0,NULL,0 },
@@ -1019,7 +832,7 @@
{ "Right", SbxSTRING, 2 | _FUNCTION, RTLNAME(Right),0 },
{ "String", SbxSTRING, 0,NULL,0 },
{ "Count", SbxLONG, 0,NULL,0 },
-@@ -496,9 +509,10 @@ static Methods aMethods[] = {
+@@ -491,9 +503,10 @@ static Methods aMethods[] = {
{ "String1", SbxSTRING, 0,NULL,0 },
{ "String2", SbxSTRING, 0,NULL,0 },
{ "Compare", SbxINTEGER, _OPT, NULL,0 },
@@ -1034,12 +847,12 @@
Index: basic/source/runtime/step0.cxx
===================================================================
RCS file: /cvs/script/basic/source/runtime/step0.cxx,v
-retrieving revision 1.29
-retrieving revision 1.29.40.1
-diff -u -p -b -w -B -r1.29 -r1.29.40.1
---- basic/source/runtime/step0.cxx 30 Aug 2007 10:01:41 -0000 1.29
-+++ basic/source/runtime/step0.cxx 20 Dec 2007 21:21:52 -0000 1.29.40.1
-@@ -323,8 +323,10 @@ void SbiRuntime::StepIS()
+retrieving revision 1.30
+retrieving revision 1.29.40.2
+diff -u -p -b -w -B -r1.30 -r1.29.40.2
+--- basic/source/runtime/step0.cxx 11 Apr 2008 12:05:46 -0000 1.30
++++ basic/source/runtime/step0.cxx 7 May 2008 07:10:56 -0000 1.29.40.2
+@@ -313,8 +313,10 @@ void SbiRuntime::StepIS()
SbxVariableRef refVar2 = PopVar();
BOOL bRes = BOOL(
refVar1->GetType() == SbxOBJECT
@@ -1055,12 +868,12 @@
Index: basic/source/runtime/step2.cxx
===================================================================
RCS file: /cvs/script/basic/source/runtime/step2.cxx,v
-retrieving revision 1.32
-retrieving revision 1.32.40.1
-diff -u -p -b -w -B -r1.32 -r1.32.40.1
---- basic/source/runtime/step2.cxx 30 Aug 2007 10:09:56 -0000 1.32
-+++ basic/source/runtime/step2.cxx 20 Dec 2007 21:23:02 -0000 1.32.40.1
-@@ -117,7 +117,7 @@ SbxVariable* VBAFind( const String& rNam
+retrieving revision 1.33
+retrieving revision 1.32.40.4
+diff -u -p -b -w -B -r1.33 -r1.32.40.4
+--- basic/source/runtime/step2.cxx 11 Apr 2008 12:06:21 -0000 1.33
++++ basic/source/runtime/step2.cxx 7 May 2008 07:11:05 -0000 1.32.40.4
+@@ -112,7 +112,7 @@ SbxVariable* VBAFind( const String& rNam
// 0x8000 - Argv ist belegt
SbxVariable* SbiRuntime::FindElement
@@ -1069,7 +882,7 @@
{
bool bIsVBAInterOp = SbiRuntime::isVBAEnabled();
if( bIsVBAInterOp )
-@@ -154,9 +154,17 @@ SbxVariable* SbiRuntime::FindElement
+@@ -149,9 +149,17 @@ SbxVariable* SbiRuntime::FindElement
nOp1 = nOp1 | 0x8000; // indicate params are present
aName = String::CreateFromAscii("Evaluate");
}
@@ -1078,8 +891,8 @@
+ {
+ if ( bStatic )
+ {
-+ if ( pRealMeth )
-+ pElem = pRealMeth->GetStatics()->Find( aName, SbxCLASS_DONTCARE );
++ if ( pMeth )
++ pElem = pMeth->GetStatics()->Find( aName, SbxCLASS_DONTCARE );
+ }
+
+ if ( !pElem )
@@ -1088,7 +901,7 @@
if( !pElem )
{
// Die RTL brauchen wir nicht mehr zu durchsuchen!
-@@ -256,6 +264,10 @@ SbxVariable* SbiRuntime::FindElement
+@@ -251,6 +259,10 @@ SbxVariable* SbiRuntime::FindElement
}
else
{
@@ -1099,7 +912,7 @@
// Sonst Variable neu anlegen
pElem = new SbxVariable( t );
if( t != SbxVARIANT )
-@@ -265,6 +277,7 @@ SbxVariable* SbiRuntime::FindElement
+@@ -260,6 +272,7 @@ SbxVariable* SbiRuntime::FindElement
}
}
}
@@ -1107,7 +920,7 @@
// #39108 Args koennen schon geloescht sein!
if( !bFatalError )
SetupArgs( pElem, nOp1 );
-@@ -646,29 +659,39 @@ void SbiRuntime::StepRTL( UINT32 nOp1, U
+@@ -641,29 +654,39 @@ void SbiRuntime::StepRTL( UINT32 nOp1, U
PushVar( FindElement( rBasic.pRtl, nOp1, nOp2, SbERR_PROC_UNDEFINED, FALSE ) );
}
@@ -1153,16 +966,16 @@
// Laden eines Objekt-Elements (+StringID+Typ)
// Das Objekt liegt auf TOS
-@@ -1218,19 +1241,27 @@ void SbiRuntime::StepFIND_G( UINT32 nOp1
+@@ -1213,19 +1236,27 @@ void SbiRuntime::StepFIND_G( UINT32 nOp1
}
+SbxVariable* SbiRuntime::StepSTATIC_Impl( String& aName, SbxDataType& t )
+{
+ SbxVariable* p = NULL;
-+ if ( pRealMeth )
++ if ( pMeth )
+ {
-+ SbxArray* pStatics = pRealMeth->GetStatics();
++ SbxArray* pStatics = pMeth->GetStatics();
+ if( pStatics && ( pStatics->Find( aName, SbxCLASS_DONTCARE ) == NULL ) )
+ {
+ p = new SbxVariable( t );
@@ -1181,7 +994,8 @@
- (void)nOp1;
- (void)nOp2;
- /* AB #40689, wird nicht mehr verwendet
- String aName( pImg->GetString( nOp1 ) );
+- String aName( pImg->GetString( nOp1 ) );
++ String aName( pImg->GetString( static_cast<short>( nOp1 ) ) );
SbxDataType t = (SbxDataType) nOp2;
- SbxVariable* p = new SbxVariable( t );
- p->SetName( aName );
@@ -1191,17 +1005,15 @@
}
-
-
-cvs diff: Diffing basic/source/sample
-cvs diff: Diffing basic/source/sbx
Index: basic/source/sbx/sbxconv.hxx
===================================================================
RCS file: /cvs/script/basic/source/sbx/sbxconv.hxx,v
-retrieving revision 1.4
-retrieving revision 1.4.132.1
-diff -u -p -b -w -B -r1.4 -r1.4.132.1
---- basic/source/sbx/sbxconv.hxx 12 Oct 2006 14:32:25 -0000 1.4
-+++ basic/source/sbx/sbxconv.hxx 7 Jan 2008 06:45:49 -0000 1.4.132.1
-@@ -38,6 +38,8 @@
+retrieving revision 1.5
+retrieving revision 1.4.132.2
+diff -u -p -b -w -B -r1.5 -r1.4.132.2
+--- basic/source/sbx/sbxconv.hxx 11 Apr 2008 12:11:33 -0000 1.5
++++ basic/source/sbx/sbxconv.hxx 7 May 2008 07:10:32 -0000 1.4.132.2
+@@ -33,6 +33,8 @@
#include "sbxdec.hxx"
@@ -1210,7 +1022,7 @@
// SBXSCAN.CXX
extern void ImpCvtNum( double nNum, short nPrec, String& rRes, BOOL bCoreString=FALSE );
extern SbxError ImpScan
-@@ -150,4 +152,8 @@ void ImpPutULong( SbxValues*, UINT32
+@@ -145,4 +147,8 @@ void ImpPutULong( SbxValues*, UINT32
enum SbxBOOL ImpGetBool( const SbxValues* );
void ImpPutBool( SbxValues*, INT16 );
@@ -1219,25 +1031,238 @@
+String ByteArrayToString(SbxArray* pArr);
+
#endif
+Index: basic/source/sbx/sbxscan.cxx
+===================================================================
+RCS file: /cvs/script/basic/source/sbx/sbxscan.cxx,v
+retrieving revision 1.13
+retrieving revision 1.12.18.2
+diff -u -p -b -w -B -r1.13 -r1.12.18.2
+--- basic/source/sbx/sbxscan.cxx 11 Apr 2008 12:19:34 -0000 1.13
++++ basic/source/sbx/sbxscan.cxx 7 May 2008 07:10:28 -0000 1.12.18.2
+@@ -650,14 +650,94 @@ public:
+ };
+
+
++enum VbaFormatType
++{
++ VBA_FORMAT_TYPE_OFFSET, // standard number format
++ VBA_FORMAT_TYPE_USERDEFINED, // user defined number format
++ VBA_FORMAT_TYPE_NULL
++};
++
++struct VbaFormatInfo
++{
++ VbaFormatType meType;
++ const char* mpVbaFormat; // Format string in vba
++ NfIndexTableOffset meOffset; // SvNumberFormatter format index, if meType = VBA_FORMAT_TYPE_OFFSET
++ const char* mpOOoFormat; // if meType = VBA_FORMAT_TYPE_USERDEFINED
++};
++
++#define VBA_FORMAT_OFFSET( pcUtf8, eOffset ) \
++ { VBA_FORMAT_TYPE_OFFSET, pcUtf8, eOffset, 0 }
++
++#define VBA_FORMAT_USERDEFINED( pcUtf8, pcDefinedUtf8 ) \
++ { VBA_FORMAT_TYPE_USERDEFINED, pcUtf8, NF_NUMBER_STANDARD, pcDefinedUtf8 }
++
++static VbaFormatInfo pFormatInfoTable[] =
++{
++ VBA_FORMAT_OFFSET( "Long Date", NF_DATE_SYSTEM_LONG ),
++ VBA_FORMAT_USERDEFINED( "Medium Date", "DD-MMM-YY" ),
++ VBA_FORMAT_OFFSET( "Short Date", NF_DATE_SYSTEM_SHORT ),
++ VBA_FORMAT_USERDEFINED( "Long Time", "H:MM:SS AM/PM" ),
++ VBA_FORMAT_OFFSET( "Medium Time", NF_TIME_HHMMAMPM ),
++ VBA_FORMAT_OFFSET( "Short Time", NF_TIME_HHMM ),
++ VBA_FORMAT_OFFSET( "ddddd", NF_DATE_SYSTEM_SHORT ),
++ VBA_FORMAT_OFFSET( "dddddd", NF_DATE_SYSTEM_LONG ),
++ VBA_FORMAT_USERDEFINED( "ttttt", "H:MM:SS AM/PM" ),
++ VBA_FORMAT_OFFSET( "ww", NF_DATE_WW ),
++ { VBA_FORMAT_TYPE_NULL, 0, NF_INDEX_TABLE_ENTRIES, 0 }
++};
++
++VbaFormatInfo* getFormatInfo( const String& rFmt )
++{
++ VbaFormatInfo* pInfo = NULL;
++ INT16 i = 0;
++ while( (pInfo = pFormatInfoTable + i )->mpVbaFormat != NULL )
++ {
++ if( rFmt.EqualsIgnoreCaseAscii( pInfo->mpVbaFormat ) )
++ break;
++ i++;
++ }
++ return pInfo;
++}
++
++#define VBAFORMAT_GENERALDATE "General Date"
++#define VBAFORMAT_C "c"
++#define VBAFORMAT_N "n"
++#define VBAFORMAT_NN "nn"
++#define VBAFORMAT_W "w"
++#define VBAFORMAT_Y "y"
++#define VBAFORMAT_LOWERCASE "<"
++#define VBAFORMAT_UPPERCASE ">"
++
++// From methods1.cxx
++INT16 implGetWeekDay( double aDate, bool bFirstDayParam = false, INT16 nFirstDay = 0 );
++// from methods.cxx
++INT16 implGetMinute( double dDate );
++INT16 implGetDateYear( double aDate );
++BOOL implDateSerial( INT16 nYear, INT16 nMonth, INT16 nDay, double& rdRet );
++
+ void SbxValue::Format( XubString& rRes, const XubString* pFmt ) const
+ {
+ short nComma = 0;
+ double d = 0;
+
+- // Check for date format
++ // pflin, It is better to use SvNumberFormatter to handle the date/time/number format.
++ // the SvNumberFormatter output is mostly compatible with
++ // VBA output besides the OOo-basic output
+ if( pFmt && !SbxBasicFormater::isBasicFormat( *pFmt ) )
+ {
++ String aStr = GetString();
++
++ if( pFmt->EqualsIgnoreCaseAscii( VBAFORMAT_LOWERCASE ) )
++ {
++ rRes = aStr.ToLowerAscii();
++ return;
++ }
++ if( pFmt->EqualsIgnoreCaseAscii( VBAFORMAT_UPPERCASE ) )
++ {
++ rRes = aStr.ToUpperAscii();
++ return;
++ }
++
+ LanguageType eLangType = GetpApp()->GetSettings().GetLanguage();
+ com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
+ xFactory = comphelper::getProcessServiceFactory();
+@@ -666,22 +746,92 @@ void SbxValue::Format( XubString& rRes,
+ sal_uInt32 nIndex;
+ xub_StrLen nCheckPos = 0;
+ short nType;
++ double nNumber;
++ Color* pCol;
+
++ BOOL bSuccess = aFormatter.IsNumberFormat( aStr, nIndex, nNumber );
++
++ // number format, use SvNumberFormatter to handle it.
++ if( bSuccess )
++ {
+ String aFmtStr = *pFmt;
+- aFormatter.PutandConvertEntry( aFmtStr,
+- nCheckPos,
+- nType,
+- nIndex,
+- LANGUAGE_ENGLISH,
+- eLangType );
+-
+- if( nType == NUMBERFORMAT_DATE ||
+- nType == NUMBERFORMAT_TIME ||
+- nType == NUMBERFORMAT_DATETIME )
+- {
+- double dt = GetDate();
+- Color* pColor;
+- aFormatter.GetOutputString( dt, nIndex, rRes, &pColor );
++ VbaFormatInfo* pInfo = getFormatInfo( aFmtStr );
++ if( pInfo && pInfo->meType != VBA_FORMAT_TYPE_NULL )
++ {
++ if( pInfo->meType == VBA_FORMAT_TYPE_OFFSET )
++ {
++ nIndex = aFormatter.GetFormatIndex( pInfo->meOffset, eLangType );
++ }
++ else
++ {
++ aFmtStr.AssignAscii( pInfo->mpOOoFormat );
++ aFormatter.PutandConvertEntry( aFmtStr, nCheckPos, nType, nIndex, LANGUAGE_ENGLISH, eLangType );
++ }
++ aFormatter.GetOutputString( nNumber, nIndex, rRes, &pCol );
++ }
++ else if( aFmtStr.EqualsIgnoreCaseAscii( VBAFORMAT_GENERALDATE )
++ || aFmtStr.EqualsIgnoreCaseAscii( VBAFORMAT_C ))
++ {
++ if( nNumber <=-1.0 || nNumber >= 1.0 )
++ {
++ // short date
++ nIndex = aFormatter.GetFormatIndex( NF_DATE_SYSTEM_SHORT, eLangType );
++ aFormatter.GetOutputString( nNumber, nIndex, rRes, &pCol );
++
++ // long time
++ if( floor( nNumber ) != nNumber )
++ {
++ aFmtStr.AssignAscii( "H:MM:SS AM/PM" );
++ aFormatter.PutandConvertEntry( aFmtStr, nCheckPos, nType, nIndex, LANGUAGE_ENGLISH, eLangType );
++ String aTime;
++ aFormatter.GetOutputString( nNumber, nIndex, aTime, &pCol );
++ rRes.AppendAscii(" ");
++ rRes += aTime;
++ }
++ }
++ else
++ {
++ // long time only
++ aFmtStr.AssignAscii( "H:MM:SS AM/PM" );
++ aFormatter.PutandConvertEntry( aFmtStr, nCheckPos, nType, nIndex, LANGUAGE_ENGLISH, eLangType );
++ aFormatter.GetOutputString( nNumber, nIndex, rRes, &pCol );
++ }
++ }
++ else if( aFmtStr.EqualsIgnoreCaseAscii( VBAFORMAT_N )
++ || aFmtStr.EqualsIgnoreCaseAscii( VBAFORMAT_NN ))
++ {
++ INT32 nMin = implGetMinute( nNumber );
++ if( nMin < 10 && aFmtStr.EqualsIgnoreCaseAscii( VBAFORMAT_NN ) )
++ {
++ // Minute in two digits
++ sal_Unicode* p = rRes.AllocBuffer( 2 );
++ *p++ = '0';
++ *p = sal_Unicode( '0' + nMin );
++ }
++ else
++ {
++ rRes = String::CreateFromInt32( nMin );
++ }
++ }
++ else if( aFmtStr.EqualsIgnoreCaseAscii( VBAFORMAT_W ))
++ {
++ INT32 nWeekDay = implGetWeekDay( nNumber );
++ rRes = String::CreateFromInt32( nWeekDay );
++ }
++ else if( aFmtStr.EqualsIgnoreCaseAscii( VBAFORMAT_Y ))
++ {
++ INT16 nYear = implGetDateYear( nNumber );
++ double dBaseDate;
++ implDateSerial( nYear, 1, 1, dBaseDate );
++ INT32 nYear32 = 1 + INT32( nNumber - dBaseDate );
++ rRes = String::CreateFromInt32( nYear32 );
++ }
++ else
++ {
++ aFormatter.PutandConvertEntry( aFmtStr, nCheckPos, nType, nIndex, LANGUAGE_ENGLISH, eLangType );
++ aFormatter.GetOutputString( nNumber, nIndex, rRes, &pCol );
++ }
++
+ return;
+ }
+ }
Index: basic/source/sbx/sbxstr.cxx
===================================================================
RCS file: /cvs/script/basic/source/sbx/sbxstr.cxx,v
-retrieving revision 1.7
-retrieving revision 1.7.20.2
-diff -u -p -b -w -B -r1.7 -r1.7.20.2
---- basic/source/sbx/sbxstr.cxx 13 Nov 2007 15:24:10 -0000 1.7
-+++ basic/source/sbx/sbxstr.cxx 28 Jan 2008 09:42:55 -0000 1.7.20.2
-@@ -43,6 +43,9 @@
+retrieving revision 1.8
+retrieving revision 1.7.20.4
+diff -u -p -b -w -B -r1.8 -r1.7.20.4
+--- basic/source/sbx/sbxstr.cxx 11 Apr 2008 12:20:13 -0000 1.8
++++ basic/source/sbx/sbxstr.cxx 7 May 2008 07:10:20 -0000 1.7.20.4
+@@ -34,7 +34,10 @@
+ #include <basic/sbx.hxx>
#include "sbxconv.hxx"
#include "sbxres.hxx"
-
+-
++#include "runtime.hxx"
+#ifndef _RTL_USTRBUF_HXX_
+#include <rtl/ustrbuf.hxx>
+#endif
// AB 29.10.99 Unicode
#ifndef _USE_NO_NAMESPACE
using namespace rtl;
-@@ -102,6 +105,14 @@ XubString ImpGetString( const SbxValues*
+@@ -94,6 +97,14 @@ XubString ImpGetString( const SbxValues*
SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
if( pVal )
aRes = pVal->GetString();
@@ -1252,7 +1277,7 @@
else
SbxBase::SetError( SbxERR_NO_OBJECT );
break;
-@@ -257,3 +268,59 @@ void ImpPutString( SbxValues* p, const X
+@@ -249,3 +260,65 @@ void ImpPutString( SbxValues* p, const X
delete pTmp;
}
@@ -1262,8 +1287,14 @@
+ USHORT nArraySize = rStr.Len() * 2;
+ const sal_Unicode* pSrc = rStr.GetBuffer();
+ SbxDimArray* pArray = new SbxDimArray(SbxBYTE);
++ bool bIncIndex = ( IsBaseIndexOne() && SbiRuntime::isVBAEnabled() );
+ if( nArraySize )
-+ pArray->AddDim( 0, nArraySize-1 );
++ {
++ if( bIncIndex )
++ pArray->AddDim( 1, nArraySize );
++ else
++ pArray->AddDim( 0, nArraySize-1 );
++ }
+ else
+ {
+ pArray->unoAddDim( 0, -1 );
@@ -1272,7 +1303,7 @@
+ for( USHORT i=0; i< nArraySize; i++)
+ {
+ SbxVariable* pNew = new SbxVariable( SbxBYTE );
-+ BYTE aByte = i%2 ? ((*pSrc) >> 8) & 0xff : (*pSrc) & 0xff;
++ BYTE aByte = static_cast< BYTE >( i%2 ? ((*pSrc) >> 8) & 0xff : (*pSrc) & 0xff );
+ pNew->PutByte( aByte );
+ pNew->SetFlag( SBX_WRITE );
+ pArray->Put( pNew, i );
@@ -1288,7 +1319,7 @@
+ USHORT nCount = pArr->Count();
+ OUStringBuffer aStrBuf;
+ sal_Unicode aChar = 0;
-+ for(int i=0; i< nCount; i++)
++ for( USHORT i = 0 ; i < nCount ; i++ )
+ {
+ sal_Unicode aTempChar = pArr->Get(i)->GetByte();
+ if( i%2 )
@@ -1315,12 +1346,12 @@
Index: basic/source/sbx/sbxvalue.cxx
===================================================================
RCS file: /cvs/script/basic/source/sbx/sbxvalue.cxx,v
-retrieving revision 1.10
-retrieving revision 1.10.40.2
-diff -u -p -b -w -B -r1.10 -r1.10.40.2
---- basic/source/sbx/sbxvalue.cxx 30 Aug 2007 10:02:21 -0000 1.10
-+++ basic/source/sbx/sbxvalue.cxx 28 Jan 2008 09:42:55 -0000 1.10.40.2
-@@ -333,6 +333,30 @@ SbxValue& SbxValue::operator=( const Sbx
+retrieving revision 1.12
+retrieving revision 1.10.40.5
+diff -u -p -b -w -B -r1.12 -r1.10.40.5
+--- basic/source/sbx/sbxvalue.cxx 11 Apr 2008 12:21:27 -0000 1.12
++++ basic/source/sbx/sbxvalue.cxx 7 May 2008 07:10:24 -0000 1.10.40.5
+@@ -307,6 +307,30 @@ SbxValue& SbxValue::operator=( const Sbx
SetError( SbxERR_PROP_READONLY );
else
{
@@ -1351,9 +1382,15 @@
// Den Inhalt der Variablen auslesen
SbxValues aNew;
if( IsFixed() )
-cvs diff: Diffing basic/source/uno
-cvs diff: Diffing basic/util
-cvs diff: Diffing basic/util/defs
-cvs diff: Diffing basic/win
-cvs diff: Diffing basic/win/res
-cvs diff: Diffing basic/workben
+@@ -1434,8 +1458,10 @@ BOOL SbxValue::Compare( SbxOperator eOp,
+ ResetError();
+ if( !CanRead() || !rOp.CanRead() )
+ SetError( SbxERR_PROP_WRITEONLY );
+- else if( GetType() == SbxNULL && rOp.GetType() == SbxNULL )
++ else if( GetType() == SbxNULL && rOp.GetType() == SbxNULL && !bVBAInterop )
++ {
+ bRes = TRUE;
++ }
+ else if( GetType() == SbxEMPTY && rOp.GetType() == SbxEMPTY )
+ bRes = TRUE;
+ // Sonderregel 1: Ist ein Operand Null, ist das Ergebnis FALSE
Added: trunk/patches/dev300/cws-pflin10.diff
==============================================================================
--- (empty file)
+++ trunk/patches/dev300/cws-pflin10.diff Mon May 19 08:05:57 2008
@@ -0,0 +1,380 @@
+Index: basic/inc/basic/sberrors.hxx
+===================================================================
+RCS file: /cvs/script/basic/inc/basic/sberrors.hxx,v
+retrieving revision 1.3
+retrieving revision 1.2.100.2
+diff -u -p -b -w -B -r1.3 -r1.2.100.2
+--- basic/inc/basic/sberrors.hxx 11 Apr 2008 11:21:47 -0000 1.3
++++ basic/inc/basic/sberrors.hxx 19 May 2008 04:10:40 -0000 1.2.100.2
+@@ -277,6 +277,19 @@ typedef ULONG SbError;
+ #define ERRCODE_BASMGR_REMOVELIB (LAST_SBX_ERROR_ID+101UL) | ERRCODE_AREA_SBX
+ #define ERRCODE_BASMGR_UNLOADLIB (LAST_SBX_ERROR_ID+102UL) | ERRCODE_AREA_SBX
+
++#define ERRCODE_BASIC_ARRAY_FIX ((LAST_SBX_ERROR_ID+104UL) | ERRCODE_AREA_SBX | \
++ ERRCODE_CLASS_COMPILER) // This array is fixed
++#define ERRCODE_BASIC_STRING_OVERFLOW ((LAST_SBX_ERROR_ID+105UL) | ERRCODE_AREA_SBX | \
++ ERRCODE_CLASS_COMPILER) // Out of string space
++#define ERRCODE_BASIC_EXPR_TOO_COMPLEX ((LAST_SBX_ERROR_ID+106UL) | ERRCODE_AREA_SBX | \
++ ERRCODE_CLASS_COMPILER) // Expression too complex
++#define ERRCODE_BASIC_OPER_NOT_PERFORM ((LAST_SBX_ERROR_ID+107UL) | ERRCODE_AREA_SBX | \
++ ERRCODE_CLASS_COMPILER) // Can't perform requested operation
++#define ERRCODE_BASIC_TOO_MANY_DLL ((LAST_SBX_ERROR_ID+108UL) | ERRCODE_AREA_SBX | \
++ ERRCODE_CLASS_COMPILER) // Too many dll application clients
++#define ERRCODE_BASIC_LOOP_NOT_INIT ((LAST_SBX_ERROR_ID+109UL) | ERRCODE_AREA_SBX | \
++ ERRCODE_CLASS_COMPILER) // For loop not initialized
++
+ // Alte Codes auf neue mappen
+ #define SbERR_SYNTAX ERRCODE_BASIC_SYNTAX
+ #define SbERR_NO_GOSUB ERRCODE_BASIC_NO_GOSUB
+@@ -400,6 +413,12 @@ typedef ULONG SbError;
+ #define SbERR_PROG_TOO_LARGE ERRCODE_BASIC_PROG_TOO_LARGE
+ #define SbERR_NO_STRINGS_ARRAYS ERRCODE_BASIC_NO_STRINGS_ARRAYS
+ #define SbERR_BASIC_EXCEPTION ERRCODE_BASIC_EXCEPTION
++#define SbERR_BASIC_ARRAY_FIX ERRCODE_BASIC_ARRAY_FIX
++#define SbERR_BASIC_STRING_OVERFLOW ERRCODE_BASIC_STRING_OVERFLOW
++#define SbERR_BASIC_EXPR_TOO_COMPLEX ERRCODE_BASIC_EXPR_TOO_COMPLEX
++#define SbERR_BASIC_OPER_NOT_PERFORM ERRCODE_BASIC_OPER_NOT_PERFORM
++#define SbERR_BASIC_TOO_MANY_DLL ERRCODE_BASIC_TOO_MANY_DLL
++#define SbERR_BASIC_LOOP_NOT_INIT ERRCODE_BASIC_LOOP_NOT_INIT
+ // #define SbERR_COMPILER_END ERRCODE_BASIC_COMPILER_END
+
+ /* ALT
+Index: basic/source/classes/sb.cxx
+===================================================================
+RCS file: /cvs/script/basic/source/classes/sb.cxx,v
+retrieving revision 1.34
+retrieving revision 1.33.62.2
+diff -u -p -b -w -B -r1.34 -r1.33.62.2
+--- basic/source/classes/sb.cxx 11 Apr 2008 11:46:56 -0000 1.34
++++ basic/source/classes/sb.cxx 19 May 2008 04:11:07 -0000 1.33.62.2
+@@ -1120,6 +1120,27 @@ USHORT StarBASIC::GetVBErrorCode( SbErro
+ {
+ USHORT nRet = 0;
+
++ if( SbiRuntime::isVBAEnabled() )
++ {
++ switch( nError )
++ {
++ case SbERR_BASIC_ARRAY_FIX:
++ return 10;
++ case SbERR_BASIC_STRING_OVERFLOW:
++ return 14;
++ case SbERR_BASIC_EXPR_TOO_COMPLEX:
++ return 16;
++ case SbERR_BASIC_OPER_NOT_PERFORM:
++ return 17;
++ case SbERR_BASIC_TOO_MANY_DLL:
++ return 47;
++ case SbERR_BASIC_LOOP_NOT_INIT:
++ return 92;
++ default:
++ nRet = 0;
++ }
++ }
++
+ // Suchschleife
+ const SFX_VB_ErrorItem* pErrItem;
+ USHORT nIndex = 0;
+@@ -1141,7 +1162,33 @@ SbError StarBASIC::GetSfxFromVBError( US
+ {
+ SbError nRet = 0L;
+
+- // Suchschleife
++ if( SbiRuntime::isVBAEnabled() )
++ {
++ switch( nError )
++ {
++ case 1:
++ case 2:
++ case 4:
++ case 8:
++ case 12:
++ case 73:
++ return 0L;
++ case 10:
++ return SbERR_BASIC_ARRAY_FIX;
++ case 14:
++ return SbERR_BASIC_STRING_OVERFLOW;
++ case 16:
++ return SbERR_BASIC_EXPR_TOO_COMPLEX;
++ case 17:
++ return SbERR_BASIC_OPER_NOT_PERFORM;
++ case 47:
++ return SbERR_BASIC_TOO_MANY_DLL;
++ case 92:
++ return SbERR_BASIC_LOOP_NOT_INIT;
++ default:
++ nRet = 0L;
++ }
++ }
+ const SFX_VB_ErrorItem* pErrItem;
+ USHORT nIndex = 0;
+ do
+Index: basic/source/classes/sb.src
+===================================================================
+RCS file: /cvs/script/basic/source/classes/sb.src,v
+retrieving revision 1.48
+retrieving revision 1.47.86.2
+diff -u -p -b -w -B -r1.48 -r1.47.86.2
+--- basic/source/classes/sb.src 11 Apr 2008 11:47:22 -0000 1.48
++++ basic/source/classes/sb.src 19 May 2008 04:11:02 -0000 1.47.86.2
+@@ -567,6 +567,30 @@ Resource RID_BASIC_START
+ {
+ Text [ en-US ] = "An exception occurred $(ARG1)." ;
+ };
++ String ERRCODE_BASIC_ARRAY_FIX & ERRCODE_RES_MASK
++ {
++ Text [ en-US ] = "This array is fixed or temporarily locked." ;
++ };
++ String ERRCODE_BASIC_STRING_OVERFLOW & ERRCODE_RES_MASK
++ {
++ Text [ en-US ] = "Out of string space." ;
++ };
++ String ERRCODE_BASIC_EXPR_TOO_COMPLEX & ERRCODE_RES_MASK
++ {
++ Text [ en-US ] = "Expression Too Complex." ;
++ };
++ String ERRCODE_BASIC_OPER_NOT_PERFORM & ERRCODE_RES_MASK
++ {
++ Text [ en-US ] = "Can't perform requested operation." ;
++ };
++ String ERRCODE_BASIC_TOO_MANY_DLL & ERRCODE_RES_MASK
++ {
++ Text [ en-US ] = "Too many DLL application clients." ;
++ };
++ String ERRCODE_BASIC_LOOP_NOT_INIT & ERRCODE_RES_MASK
++ {
++ Text [ en-US ] = "For loop not initialized." ;
++ };
+ };
+ // Hinweis: IDS_SBERR_TERMINATED = IDS_SBERR_START+2000.
+ String IDS_SBERR_TERMINATED
+Index: basic/source/runtime/methods.cxx
+===================================================================
+RCS file: /cvs/script/basic/source/runtime/methods.cxx,v
+retrieving revision 1.79
+retrieving revision 1.78.20.2
+diff -u -p -b -w -B -r1.79 -r1.78.20.2
+--- basic/source/runtime/methods.cxx 11 Apr 2008 12:03:12 -0000 1.79
++++ basic/source/runtime/methods.cxx 19 May 2008 04:10:58 -0000 1.78.20.2
+@@ -1695,16 +1695,53 @@ INT16 implGetDateYear( double aDate )
+ BOOL implDateSerial( INT16 nYear, INT16 nMonth, INT16 nDay, double& rdRet )
+ {
+ if ( nYear < 100 )
+- nYear += 1900;
+- if ((nYear < 100 || nYear > 9999) ||
+- (nMonth < 1 || nMonth > 12 ) ||
++ {
++ Date now;
++ INT16 nCentury = ( now.GetYear() / 100 ) * 100;
++ nYear += nCentury;
++ }
++ Date aCurDate( nDay, nMonth, nYear );
++ if ((nYear < 100 || nYear > 9999) )
++ {
++ StarBASIC::Error( SbERR_BAD_ARGUMENT );
++ return FALSE;
++ }
++ if ( !SbiRuntime::isVBAEnabled() )
++ {
++ if ( (nMonth < 1 || nMonth > 12 )||
+ (nDay < 1 || nDay > 31 ))
+ {
+ StarBASIC::Error( SbERR_BAD_ARGUMENT );
+ return FALSE;
+ }
++ }
++ else
++ {
++ // grab the year & month
++ aCurDate = Date( 1, (( nMonth % 12 ) > 0 ) ? ( nMonth % 12 ) : 12 + ( nMonth % 12 ), nYear );
++
++ // adjust year based on month value
++ // e.g. 2000, 0, xx = 1999, 12, xx ( or December of the previous year )
++ // 2000, 13, xx = 2001, 1, xx ( or January of the following year )
++ if( ( nMonth < 1 ) || ( nMonth > 12 ) )
++ {
++ // inacurrate around leap year, don't use days to calculate,
++ // just modify the months directory
++ INT16 nYearAdj = ( nMonth /12 ); // default to positive months inputed
++ if ( nMonth <=0 )
++ nYearAdj = ( ( nMonth -12 ) / 12 );
++ aCurDate.SetYear( aCurDate.GetYear() + nYearAdj );
++ }
++
++ // adjust day value,
++ // e.g. 2000, 2, 0 = 2000, 1, 31 or the last day of the previous month
++ // 2000, 1, 32 = 2000, 2, 1 or the first day of the following month
++ if( ( nDay < 1 ) || ( nDay > aCurDate.GetDaysInMonth() ) )
++ aCurDate += nDay - 1;
++ else
++ aCurDate.SetDay( nDay );
++ }
+
+- Date aCurDate( nDay, nMonth, nYear );
+ long nDiffDays = GetDayDiff( aCurDate );
+ rdRet = (double)nDiffDays;
+ return TRUE;
+@@ -1831,6 +1868,23 @@ RTLFUNC(DateValue)
+ String aStr( rPar.Get(1)->GetString() );
+ BOOL bSuccess = pFormatter->IsNumberFormat( aStr, nIndex, fResult );
+ short nType = pFormatter->GetType( nIndex );
++
++ // DateValue("February 12, 1969") raises error if the system locale is not en_US
++ // by using SbiInstance::GetNumberFormatter.
++ // It seems that both locale number formatter and English number formatter
++ // are supported in Visual Basic.
++ LanguageType eLangType = GetpApp()->GetSettings().GetLanguage();
++ if( !bSuccess && !(eLangType & LANGUAGE_ENGLISH))
++ {
++ // Create a new SvNumberFormatter by using LANGUAGE_ENGLISH to get the date value;
++ com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
++ xFactory = comphelper::getProcessServiceFactory();
++ SvNumberFormatter* pFormatterEn = new SvNumberFormatter( xFactory, LANGUAGE_ENGLISH );
++ bSuccess = pFormatterEn->IsNumberFormat( aStr, nIndex, fResult );
++ nType = pFormatterEn->GetType( nIndex );
++ delete pFormatterEn;
++ }
++
+ if(bSuccess && (nType==NUMBERFORMAT_DATE || nType==NUMBERFORMAT_DATETIME))
+ {
+ if ( nType == NUMBERFORMAT_DATETIME )
+Index: basic/source/sbx/sbxdbl.cxx
+===================================================================
+RCS file: /cvs/script/basic/source/sbx/sbxdbl.cxx,v
+retrieving revision 1.8
+retrieving revision 1.7.46.2
+diff -u -p -b -w -B -r1.8 -r1.7.46.2
+--- basic/source/sbx/sbxdbl.cxx 11 Apr 2008 12:12:50 -0000 1.8
++++ basic/source/sbx/sbxdbl.cxx 19 May 2008 04:10:51 -0000 1.7.46.2
+@@ -33,6 +33,7 @@
+ #include <tools/errcode.hxx>
+ #include <basic/sbx.hxx>
+ #include "sbxconv.hxx"
++#include "runtime.hxx"
+
+ double ImpGetDouble( const SbxValues* p )
+ {
+@@ -79,13 +80,21 @@ double ImpGetDouble( const SbxValues* p
+ case SbxSTRING:
+ case SbxLPSTR:
+ if( !p->pString )
++ {
+ nRes = 0;
++ if ( SbiRuntime::isVBAEnabled() )// VBA only behaviour
++ SbxBase::SetError( SbxERR_CONVERSION );
++ }
+ else
+ {
+ double d;
+ SbxDataType t;
+ if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
++ {
+ nRes = 0;
++ if ( SbiRuntime::isVBAEnabled() )// VBA only behaviour
++ SbxBase::SetError( SbxERR_CONVERSION );
++ }
+ else
+ nRes = d;
+ }
+Index: basic/source/sbx/sbxscan.cxx
+===================================================================
+RCS file: /cvs/script/basic/source/sbx/sbxscan.cxx,v
+retrieving revision 1.13
+retrieving revision 1.12.22.2
+diff -u -p -b -w -B -r1.13 -r1.12.22.2
+--- basic/source/sbx/sbxscan.cxx 11 Apr 2008 12:19:34 -0000 1.13
++++ basic/source/sbx/sbxscan.cxx 19 May 2008 04:10:48 -0000 1.12.22.2
+@@ -53,6 +53,7 @@
+ #include <svtools/svtools.hrc>
+
+ #include "basrid.hxx"
++#include "runtime.hxx"
+
+ #include <svtools/zforlist.hxx>
+ #include <comphelper/processfactory.hxx>
+@@ -231,6 +232,11 @@ SbxError ImpScan( const XubString& rWSrc
+ if( l >= SbxMININT && l <= SbxMAXINT )
+ eScanType = SbxINTEGER;
+ }
++ else if ( SbiRuntime::isVBAEnabled() )
++ {
++ OSL_TRACE("Reporting error converting");
++ return SbxERR_CONVERSION;
++ }
+ if( pLen )
+ *pLen = (USHORT) ( p - pStart );
+ if( !bRes )
+Index: basic/source/sbx/sbxvalue.cxx
+===================================================================
+RCS file: /cvs/script/basic/source/sbx/sbxvalue.cxx,v
+retrieving revision 1.12
+retrieving revision 1.11.24.2
+diff -u -p -b -w -B -r1.12 -r1.11.24.2
+--- basic/source/sbx/sbxvalue.cxx 11 Apr 2008 12:21:27 -0000 1.12
++++ basic/source/sbx/sbxvalue.cxx 19 May 2008 04:10:44 -0000 1.11.24.2
+@@ -1123,7 +1123,13 @@ BOOL SbxValue::Compute( SbxOperator eOp,
+ {
+ SbxValues aL, aR;
+ bool bDecimal = false;
+- if( eThisType == SbxSTRING || eOp == SbxCAT || ( bVBAInterop && ( eOpType == SbxSTRING ) && ( eOp == SbxPLUS ) ) )
++ if( bVBAInterop && ( ( eThisType == SbxSTRING && eOpType != SbxSTRING ) ||
++ ( eThisType != SbxSTRING && eOpType == SbxSTRING ) ) &&
++ ( eOp == SbxMUL || eOp == SbxDIV || eOp == SbxPLUS || eOp == SbxMINUS ) )
++ {
++ goto Lbl_OpIsDouble;
++ }
++ else if( eThisType == SbxSTRING || eOp == SbxCAT || ( bVBAInterop && ( eOpType == SbxSTRING ) && ( eOp == SbxPLUS ) ) )
+ {
+ if( eOp == SbxCAT || eOp == SbxPLUS )
+ {
+@@ -1368,6 +1374,7 @@ BOOL SbxValue::Compute( SbxOperator eOp,
+ }
+ }
+ else
++Lbl_OpIsDouble:
+ { // Andere Operatoren
+ aL.eType = aR.eType = SbxDOUBLE;
+ if( rOp.Get( aR ) )
+Index: sc/source/ui/vba/vbarange.cxx
+===================================================================
+RCS file: /cvs/sc/sc/source/ui/vba/vbarange.cxx,v
+retrieving revision 1.8
+retrieving revision 1.7.18.2
+diff -u -p -b -w -B -r1.8 -r1.7.18.2
+--- sc/source/ui/vba/vbarange.cxx 11 Apr 2008 01:15:15 -0000 1.8
++++ sc/source/ui/vba/vbarange.cxx 19 May 2008 04:11:44 -0000 1.7.18.2
+@@ -162,6 +162,7 @@
+ // end test includes
+
+ #include <org/openoffice/excel/Range.hpp>
++#include <com/sun/star/bridge/oleautomation/Date.hpp>
+
+ using namespace ::org::openoffice;
+ using namespace ::com::sun::star;
+@@ -442,6 +443,16 @@ public:
+ return false;
+ }
+
++ bool isDateType()
++ {
++ sal_Int16 nType = getNumberFormat();
++ if(( nType & util::NumberFormat::DATETIME ))
++ {
++ return true;
++ }
++ return false;
++ }
++
+ rtl::OUString getNumberFormatString()
+ {
+ uno::Reference< uno::XInterface > xIf( mxRangeProps, uno::UNO_QUERY_THROW );
+@@ -715,6 +726,8 @@ void CellValueGetter::visitNode( sal_Int
+ NumFormatHelper cellFormat( xRange );
+ if ( cellFormat.isBooleanType() )
+ aValue = uno::makeAny( ( xCell->getValue() != 0.0 ) );
++ else if ( cellFormat.isDateType() )
++ aValue = uno::makeAny( bridge::oleautomation::Date( xCell->getValue() ) );
+ else
+ aValue <<= xCell->getValue();
+ }
Modified: trunk/patches/vba/basic-caller-support-dev300.diff
==============================================================================
--- trunk/patches/vba/basic-caller-support-dev300.diff (original)
+++ trunk/patches/vba/basic-caller-support-dev300.diff Mon May 19 08:05:57 2008
@@ -71,15 +71,16 @@
//.........................................................................
--- /data4/Latest/ooo-build/build/ooh680-m1/basic/inc/basic/sbmeth.hxx 2008-01-08 09:36:28.000000000 +0000
+++ basic/inc/basic/sbmeth.hxx 2007-12-20 09:38:21.000000000 +0000
-@@ -58,6 +58,7 @@ class SbMethod : public SbxMethod
+@@ -49,7 +49,7 @@ class SbMethod : public SbxMethod
friend class SbIfaceMapperMethod;
SbMethodImpl* mpSbMethodImpl; // Impl data
-+ SbxVariable* mCaller; // caller
- SbxArrayRef refStatics;
+-
++ SbxVariable* mCaller; // caller
SbModule* pMod;
USHORT nDebugFlags;
-@@ -84,7 +85,7 @@ public:
+ USHORT nLine1, nLine2;
+@@ -76,7 +76,7 @@ public:
void GetLineRange( USHORT&, USHORT& );
// Schnittstelle zum Ausfuehren einer Methode aus den Applikationen
@@ -90,23 +91,23 @@
--- /data4/Latest/ooo-build/build/ooh680-m1/basic/source/classes/sbxmod.cxx 2008-01-08 09:36:28.000000000 +0000
+++ basic/source/classes/sbxmod.cxx 2007-12-20 11:22:38.000000000 +0000
-@@ -1950,6 +1950,7 @@ SbMethod::SbMethod( const String& r, Sbx
- nDebugFlags =
+@@ -1936,6 +1936,7 @@ SbMethod::SbMethod( const String& r, Sbx
nLine1 =
nLine2 = 0;
-+ mCaller = 0;
+ refStatics = new SbxArray;
++ mCaller = 0;
// AB: 2.7.1996: HACK wegen 'Referenz kann nicht gesichert werden'
SetFlag( SBX_NO_MODIFY );
}
-@@ -1963,6 +1964,7 @@ SbMethod::SbMethod( const SbMethod& r )
- nDebugFlags = r.nDebugFlags;
+@@ -1950,6 +1951,7 @@ SbMethod::SbMethod( const SbMethod& r )
nLine1 = r.nLine1;
nLine2 = r.nLine2;
-+ mCaller = r.mCaller;
+ refStatics = r.refStatics;
++ mCaller = r.mCaller;
SetFlag( SBX_NO_MODIFY );
}
-@@ -2034,8 +2036,13 @@ SbxInfo* SbMethod::GetInfo()
+@@ -2018,8 +2020,13 @@ SbxInfo* SbMethod::GetInfo()
// Schnittstelle zum Ausfuehren einer Methode aus den Applikationen
// #34191# Mit speziellem RefCounting, damit das Basic nicht durch CloseDocument()
// abgeschossen werden kann. Rueckgabewert wird als String geliefert.
@@ -121,7 +122,7 @@
// RefCount vom Modul hochzaehlen
SbModule* pMod_ = (SbModule*)GetParent();
pMod_->AddRef();
-@@ -2063,7 +2070,7 @@ ErrCode SbMethod::Call( SbxValue* pRet )
+@@ -2047,7 +2054,7 @@ ErrCode SbMethod::Call( SbxValue* pRet )
// Objekte freigeben
pMod_->ReleaseRef();
pBasic->ReleaseRef();
@@ -132,16 +133,16 @@
--- /data4/Latest/ooo-build/build/ooh680-m1/basic/source/runtime/runtime.cxx 2008-01-08 09:36:28.000000000 +0000
+++ basic/source/runtime/runtime.cxx 2007-12-20 11:23:14.000000000 +0000
-@@ -509,7 +509,7 @@ SbxArray* SbiInstance::GetLocals( SbMeth
+@@ -491,7 +491,7 @@ SbxArray* SbiInstance::GetLocals( SbMeth
SbiRuntime::SbiRuntime( SbModule* pm, SbMethod* pe, UINT32 nStart )
: rBasic( *(StarBASIC*)pm->pParent ), pInst( pINST ),
-- pMod( pm ), pMeth( pe ), pRealMeth(0), pImg( pMod->pImage ), m_nLastTime(0)
-+ pMod( pm ), pMeth( pe ), pRealMeth(0), pImg( pMod->pImage ), mpExtCaller(0), m_nLastTime(0)
+- pMod( pm ), pMeth( pe ), pImg( pMod->pImage ), m_nLastTime(0)
++ pMod( pm ), pMeth( pe ), pImg( pMod->pImage ), mpExtCaller(0), m_nLastTime(0)
{
nFlags = pe ? pe->GetDebugFlags() : 0;
pIosys = pInst->pIosys;
-@@ -570,6 +570,18 @@ SbiRuntime::~SbiRuntime()
+@@ -545,6 +545,18 @@ SbiRuntime::~SbiRuntime()
}
}
@@ -382,21 +383,21 @@
//................................................................
--- /data4/Latest/ooo-build/build/ooh680-m1/scripting/source/vbaevents/eventhelper.cxx 2008-01-08 09:36:27.000000000 +0000
+++ scripting/source/vbaevents/eventhelper.cxx 2008-01-10 14:39:12.000000000 +0000
-@@ -893,7 +900,16 @@ EventListener::firing_Impl(const ScriptE
+@@ -808,7 +808,16 @@ EventListener::firing_Impl(const ScriptE
{
uno::Reference< script::provider::XScript > xScript = xScriptProvider->getScript( url );
if ( xScript.is() )
-- xScript->invoke( aArguments, aOutArgsIndex, aOutArgs );
-+ {
-+ uno::Reference< beans::XPropertySet > xProps( xScript, uno::UNO_QUERY );
-+ if ( xProps.is() )
-+ {
-+ Sequence< Any > aCallerHack(1);
-+ aCallerHack[ 0 ] = uno::makeAny( rtl::OUString::createFromAscii("Error") );
-+ xProps->setPropertyValue( rtl::OUString::createFromAscii( "Caller" ), uno::makeAny( aCallerHack ) );
-+ }
-+ xScript->invoke( aArguments, aOutArgsIndex, aOutArgs );
-+ }
+- xScript->invoke( aArguments, aOutArgsIndex, aOutArgs );
++ {
++ uno::Reference< beans::XPropertySet > xProps( xScript, uno::UNO_QUERY );
++ if ( xProps.is() )
++ {
++ Sequence< Any > aCallerHack(1);
++ aCallerHack[ 0 ] = uno::makeAny( rtl::OUString::createFromAscii("Error") );
++ xProps->setPropertyValue( rtl::OUString::createFromAscii( "Caller" ), uno::makeAny( aCallerHack ) );
++ }
++ xScript->invoke( aArguments, aOutArgsIndex, aOutArgs );
++ }
}
catch ( uno::Exception& e )
{
Modified: trunk/patches/vba/vba-error-object.diff
==============================================================================
--- trunk/patches/vba/vba-error-object.diff (original)
+++ trunk/patches/vba/vba-error-object.diff Mon May 19 08:05:57 2008
@@ -332,25 +332,25 @@
};
// Hinweis: IDS_SBERR_TERMINATED = IDS_SBERR_START+2000.
String IDS_SBERR_TERMINATED
---- basic/inc/basic/sberrors.hxx 2005-09-07 22:02:23.000000000 +0100
-+++ basic/inc/basic/sberrors.hxx 2006-12-07 15:00:01.000000000 +0000
-@@ -285,6 +285,8 @@ typedef ULONG SbError;
- #define ERRCODE_BASMGR_REMOVELIB (LAST_SBX_ERROR_ID+101UL) | ERRCODE_AREA_SBX
- #define ERRCODE_BASMGR_UNLOADLIB (LAST_SBX_ERROR_ID+102UL) | ERRCODE_AREA_SBX
+--- basic/inc/basic/sberrors.hxx 2008-05-19 13:51:47.000000000 +0800
++++ basic/inc/basic/sberrors.hxx 2008-05-19 14:14:21.000000000 +0800
+@@ -290,6 +290,8 @@ typedef ULONG SbError;
+ #define ERRCODE_BASIC_LOOP_NOT_INIT ((LAST_SBX_ERROR_ID+109UL) | ERRCODE_AREA_SBX | \
+ ERRCODE_CLASS_COMPILER) // For loop not initialized
+#define ERRCODE_BASIC_COMPAT ((LAST_SBX_ERROR_ID+103UL)| ERRCODE_AREA_SBX | ERRCODE_CLASS_RUNTIME)
+
// Alte Codes auf neue mappen
#define SbERR_SYNTAX ERRCODE_BASIC_SYNTAX
#define SbERR_NO_GOSUB ERRCODE_BASIC_NO_GOSUB
-@@ -409,6 +411,7 @@ typedef ULONG SbError;
+@@ -413,6 +415,7 @@ typedef ULONG SbError;
#define SbERR_PROG_TOO_LARGE ERRCODE_BASIC_PROG_TOO_LARGE
#define SbERR_NO_STRINGS_ARRAYS ERRCODE_BASIC_NO_STRINGS_ARRAYS
#define SbERR_BASIC_EXCEPTION ERRCODE_BASIC_EXCEPTION
+#define SbERR_BASIC_COMPAT ERRCODE_BASIC_COMPAT
- // #define SbERR_COMPILER_END ERRCODE_BASIC_COMPILER_END
-
-
+ #define SbERR_BASIC_ARRAY_FIX ERRCODE_BASIC_ARRAY_FIX
+ #define SbERR_BASIC_STRING_OVERFLOW ERRCODE_BASIC_STRING_OVERFLOW
+ #define SbERR_BASIC_EXPR_TOO_COMPLEX ERRCODE_BASIC_EXPR_TOO_COMPLEX
--- basic.orig/source/runtime/step0.cxx 2006-11-27 13:06:41.000000000 +0000
+++ basic/source/runtime/step0.cxx 2006-12-07 20:25:43.000000000 +0000
@@ -42,6 +42,7 @@
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]