summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2009-02-11 07:51:53 +0000
committerOliver Bolte <obo@openoffice.org>2009-02-11 07:51:53 +0000
commitf7fc1a3031b591ab364257dc47032419cbc2d7e2 (patch)
tree12613bf7ad57ce50ea05f46612d2047c3649c82e /basic
parent3cb976dc662e4710d73f60f76b2c5f3600f5a8ba (diff)
CWS-TOOLING: integrate CWS ab61
2009-01-29 09:39:19 +0100 jsk r267096 : #i97038 2009-01-20 12:35:31 +0100 ab r266568 : #i94994# Applied patch 2009-01-19 17:50:55 +0100 ab r266514 : #i97038# Applied patch 2009-01-13 14:47:20 +0100 ab r266226 : #i96087# Applied patch 2009-01-13 12:24:30 +0100 ab r266207 : #i95200# Applied patch 2008-12-19 16:37:32 +0100 ab r265735 : #i93214# Applied patch 2008-12-19 16:21:38 +0100 ab r265730 : #i57749# Applied patch
Diffstat (limited to 'basic')
-rw-r--r--basic/source/classes/sb.cxx3
-rw-r--r--basic/source/comp/dim.cxx5
-rw-r--r--basic/source/comp/scanner.cxx2
-rw-r--r--basic/source/inc/namecont.hxx10
-rw-r--r--basic/source/runtime/methods.cxx4
-rw-r--r--basic/source/sbx/sbxexec.cxx4
-rw-r--r--basic/source/uno/namecont.cxx23
7 files changed, 33 insertions, 18 deletions
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 576547238b..1c0f70dbb4 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -425,7 +425,8 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
SbProcedureProperty* pNewProp = new SbProcedureProperty
( pProcedureProp->GetName(), pProcedureProp->GetType() );
// ( pProcedureProp->GetName(), pProcedureProp->GetType(), this );
- pNewProp->ResetFlag( SBX_NO_BROADCAST );
+ pNewProp->SetFlags( nFlags_ ); // Copy flags
+ pNewProp->ResetFlag( SBX_NO_BROADCAST ); // except the Broadcast if it was set
pProcedureProp->SetFlags( nFlags_ );
pProps->PutDirect( pNewProp, i );
StartListening( pNewProp->GetBroadcaster(), TRUE );
diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx
index d96923b6ea..b6c95c5748 100644
--- a/basic/source/comp/dim.cxx
+++ b/basic/source/comp/dim.cxx
@@ -1,4 +1,4 @@
-/*************************************************************************
+ /*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -742,6 +742,7 @@ void SbiParser::DefEnum( BOOL bPrivate )
SbiProcDef* SbiParser::ProcDecl( BOOL bDecl )
{
BOOL bFunc = BOOL( eCurTok == FUNCTION );
+ BOOL bProp = BOOL( eCurTok == GET || eCurTok == SET || eCurTok == LET );
if( !TestSymbol() ) return NULL;
String aName( aSym );
SbxDataType eType = eScanType;
@@ -862,7 +863,7 @@ SbiProcDef* SbiParser::ProcDecl( BOOL bDecl )
// if( pDef->GetType() == SbxOBJECT )
// pDef->SetType( SbxVARIANT ),
// Error( SbERR_SYNTAX );
- if( pDef->GetType() == SbxVARIANT && !bFunc )
+ if( pDef->GetType() == SbxVARIANT && !( bFunc || bProp ) )
pDef->SetType( SbxEMPTY );
return pDef;
}
diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index a6d2071bf4..ee487baaa9 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -196,7 +196,7 @@ BOOL SbiScanner::NextSym()
}
// Leerstellen weg:
- while( *pLine && ( *pLine == ' ' ) || ( *pLine == '\t' ) || ( *pLine == '\f' ) )
+ while( *pLine && (( *pLine == ' ' ) || ( *pLine == '\t' ) || ( *pLine == '\f' )) )
pLine++, nCol++, bSpaces = TRUE;
nCol1 = nCol;
diff --git a/basic/source/inc/namecont.hxx b/basic/source/inc/namecont.hxx
index 4c2b438543..a5e52845ff 100644
--- a/basic/source/inc/namecont.hxx
+++ b/basic/source/inc/namecont.hxx
@@ -580,6 +580,9 @@ private:
*/
void impl_checkLoaded();
+private:
+ void impl_removeWithoutChecks( const ::rtl::OUString& _rElementName );
+
public:
SfxLibrary(
ModifiableHelper& _rModifiable,
@@ -651,6 +654,13 @@ public:
::com::sun::star::container::XContainerListener >& xListener )
throw (::com::sun::star::uno::RuntimeException);
+public:
+ struct LibraryContainerAccess { friend class SfxLibraryContainer; private: LibraryContainerAccess() { } };
+ void removeElementWithoutChecks( const ::rtl::OUString& _rElementName, LibraryContainerAccess )
+ {
+ impl_removeWithoutChecks( _rElementName );
+ }
+
protected:
virtual bool SAL_CALL isLibraryElementValid( ::com::sun::star::uno::Any aElement ) const = 0;
};
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index fe6014560d..5c1bae13ab 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -1786,9 +1786,9 @@ INT16 implGetDateYear( double aDate )
BOOL implDateSerial( INT16 nYear, INT16 nMonth, INT16 nDay, double& rdRet )
{
- if ( nYear < 30 )
+ if ( nYear < 30 && SbiRuntime::isVBAEnabled() )
nYear += 2000;
- if ( nYear < 100 )
+ else if ( nYear < 100 )
nYear += 1900;
Date aCurDate( nDay, nMonth, nYear );
if ((nYear < 100 || nYear > 9999) )
diff --git a/basic/source/sbx/sbxexec.cxx b/basic/source/sbx/sbxexec.cxx
index aa0de5a626..234befbff0 100644
--- a/basic/source/sbx/sbxexec.cxx
+++ b/basic/source/sbx/sbxexec.cxx
@@ -94,7 +94,7 @@ static const xub_Unicode* Symbol( const xub_Unicode* p, XubString& rSym, const S
{
rSym = p;
// Dann darf es Buchstaben, Zahlen oder Underlines enthalten
- while( *p && rCharClass.isAlphaNumeric( *p ) || *p == '_' )
+ while( *p && (rCharClass.isAlphaNumeric( *p ) || *p == '_') )
p++, nLen++;
// BASIC-Standard-Suffixe werden ignoriert
if( *p && (*p == '%' || *p == '&' || *p == '!' || *p == '#' || *p == '$' ) )
@@ -118,7 +118,7 @@ static SbxVariable* QualifiedName
{
// Element einlesen
refVar = Element( pObj, pGbl, &p, t, aCharClass );
- while( refVar.Is() && *p == '.' || *p == '!' )
+ while( refVar.Is() && (*p == '.' || *p == '!') )
{
// Es folgt noch ein Objektelement. Das aktuelle Element
// muss also ein SBX-Objekt sein oder liefern!
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 21c83f85fc..c15d937f9b 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -2155,10 +2155,9 @@ void SAL_CALL SfxLibraryContainer::removeLibrary( const OUString& Name )
Sequence< OUString > aNames = pImplLib->getElementNames();
sal_Int32 nNameCount = aNames.getLength();
const OUString* pNames = aNames.getConstArray();
- for( sal_Int32 i = 0 ; i < nNameCount ; i++ )
+ for( sal_Int32 i = 0 ; i < nNameCount ; ++i, ++pNames )
{
- OUString aElementName = pNames[ i ];
- pImplLib->removeByName( aElementName );
+ pImplLib->removeElementWithoutChecks( *pNames, SfxLibrary::LibraryContainerAccess() );
}
}
@@ -2907,20 +2906,16 @@ void SfxLibrary::insertByName( const OUString& aName, const Any& aElement )
implSetModified( sal_True );
}
-void SfxLibrary::removeByName( const OUString& Name )
- throw(NoSuchElementException, WrappedTargetException, RuntimeException)
+void SfxLibrary::impl_removeWithoutChecks( const ::rtl::OUString& _rElementName )
{
- impl_checkReadOnly();
- impl_checkLoaded();
-
- maNameContainer.removeByName( Name );
+ maNameContainer.removeByName( _rElementName );
implSetModified( sal_True );
// Remove element file
if( maStorageURL.getLength() )
{
INetURLObject aElementInetObj( maStorageURL );
- aElementInetObj.insertName( Name, sal_False,
+ aElementInetObj.insertName( _rElementName, sal_False,
INetURLObject::LAST_SEGMENT, sal_True, INetURLObject::ENCODE_ALL );
aElementInetObj.setExtension( maLibElementFileExtension );
OUString aFile = aElementInetObj.GetMainURL( INetURLObject::NO_DECODE );
@@ -2932,9 +2927,17 @@ void SfxLibrary::removeByName( const OUString& Name )
}
catch( Exception& )
{
+ DBG_UNHANDLED_EXCEPTION();
}
}
+}
+void SfxLibrary::removeByName( const OUString& Name )
+ throw(NoSuchElementException, WrappedTargetException, RuntimeException)
+{
+ impl_checkReadOnly();
+ impl_checkLoaded();
+ impl_removeWithoutChecks( Name );
}
// XTypeProvider