summaryrefslogtreecommitdiff
path: root/idl
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-06-19 12:24:29 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-06-19 12:24:29 +0200
commit92667c8edbaee9a252b1d5d221eb62849f76697c (patch)
tree8f1d329f2259b7d5bff054bc14d0965637df6961 /idl
parentbaecdfb578cb7bc992944857ad4d8882ef7e842c (diff)
parent48b4a99ce2451f1ddf2e8e128bbfcd6683072999 (diff)
Merge branch 'master' into feature/gnumake4
Conflicts: connectivity/source/cpool/Zregistration.cxx connectivity/source/drivers/evoab/LCatalog.cxx connectivity/source/drivers/evoab/LColumnAlias.cxx connectivity/source/drivers/evoab/LColumnAlias.hxx connectivity/source/drivers/evoab/LColumns.cxx connectivity/source/drivers/evoab/LColumns.hxx connectivity/source/drivers/evoab/LConfigAccess.cxx connectivity/source/drivers/evoab/LConfigAccess.hxx connectivity/source/drivers/evoab/LConnection.cxx connectivity/source/drivers/evoab/LConnection.hxx connectivity/source/drivers/evoab/LDatabaseMetaData.cxx connectivity/source/drivers/evoab/LDatabaseMetaData.hxx connectivity/source/drivers/evoab/LDriver.cxx connectivity/source/drivers/evoab/LDriver.hxx connectivity/source/drivers/evoab/LFolderList.cxx connectivity/source/drivers/evoab/LFolderList.hxx connectivity/source/drivers/evoab/LNoException.cxx connectivity/source/drivers/evoab/LPreparedStatement.cxx connectivity/source/drivers/evoab/LPreparedStatement.hxx connectivity/source/drivers/evoab/LResultSet.cxx connectivity/source/drivers/evoab/LResultSet.hxx connectivity/source/drivers/evoab/LServices.cxx connectivity/source/drivers/evoab/LStatement.cxx connectivity/source/drivers/evoab/LStatement.hxx connectivity/source/drivers/evoab/LTable.cxx connectivity/source/drivers/evoab/LTable.hxx connectivity/source/drivers/evoab/LTables.cxx connectivity/source/drivers/evoab/LTables.hxx connectivity/source/drivers/evoab/evoab.xml connectivity/source/drivers/evoab/makefile.mk editeng/Library_editeng.mk framework/Library_fwe.mk framework/test/test.cxx idl/prj/d.lst idl/util/idlpch.cxx linguistic/Makefile linguistic/Module_linguistic.mk linguistic/inc/linguistic/lngdllapi.h linguistic/inc/linguistic/lngprophelp.hxx linguistic/inc/linguistic/misc.hxx linguistic/prj/build.lst linguistic/prj/d.lst linguistic/qa/unoapi/Test.java linguistic/source/grammarchecker.cxx linguistic/source/grammarchecker.hxx linguistic/source/hyphdta.cxx linguistic/source/lngprophelp.cxx linguistic/source/makefile.mk linguistic/source/spelldta.cxx sfx2/Library_qstart.mk sfx2/Library_sfx.mk sfx2/inc/sfx2/qswin32.h sfx2/prj/build.lst sfx2/qa/cppunit/makefile.mk xmlscript/inc/xmlscript/xcrdllapi.h xmlscript/prj/d.lst xmlscript/util/makefile.mk
Diffstat (limited to 'idl')
-rw-r--r--idl/inc/attrib.hxx77
-rw-r--r--[-rwxr-xr-x]idl/inc/basobj.hxx37
-rw-r--r--[-rwxr-xr-x]idl/inc/bastype.hxx17
-rw-r--r--idl/inc/char.hxx4
-rw-r--r--[-rwxr-xr-x]idl/inc/command.hxx10
-rw-r--r--[-rwxr-xr-x]idl/inc/database.hxx12
-rw-r--r--idl/inc/globals.hxx2
-rw-r--r--[-rwxr-xr-x]idl/inc/hash.hxx17
-rw-r--r--[-rwxr-xr-x]idl/inc/lex.hxx123
-rw-r--r--[-rwxr-xr-x]idl/inc/module.hxx7
-rw-r--r--[-rwxr-xr-x]idl/inc/object.hxx25
-rw-r--r--idl/inc/pch/precompiled_idl.cxx2
-rw-r--r--idl/inc/pch/precompiled_idl.hxx2
-rw-r--r--[-rwxr-xr-x]idl/inc/slot.hxx18
-rw-r--r--[-rwxr-xr-x]idl/inc/types.hxx25
-rwxr-xr-x[-rw-r--r--]idl/prj/makefile.mk0
-rw-r--r--[-rwxr-xr-x]idl/source/cmptools/char.cxx11
-rw-r--r--[-rwxr-xr-x]idl/source/cmptools/hash.cxx134
-rw-r--r--[-rwxr-xr-x]idl/source/cmptools/lex.cxx145
-rw-r--r--[-rwxr-xr-x]idl/source/objects/basobj.cxx233
-rw-r--r--[-rwxr-xr-x]idl/source/objects/bastype.cxx189
-rw-r--r--[-rwxr-xr-x]idl/source/objects/module.cxx191
-rw-r--r--[-rwxr-xr-x]idl/source/objects/object.cxx489
-rw-r--r--[-rwxr-xr-x]idl/source/objects/slot.cxx301
-rw-r--r--[-rwxr-xr-x]idl/source/objects/types.cxx738
-rw-r--r--[-rwxr-xr-x]idl/source/prj/command.cxx142
-rw-r--r--[-rwxr-xr-x]idl/source/prj/database.cxx304
-rw-r--r--[-rwxr-xr-x]idl/source/prj/globals.cxx17
-rwxr-xr-x[-rw-r--r--]idl/source/prj/makefile.mk0
-rw-r--r--[-rwxr-xr-x]idl/source/prj/svidl.cxx93
-rwxr-xr-x[-rw-r--r--]idl/source/svidl.datbin204 -> 204 bytes
-rwxr-xr-x[-rw-r--r--]idl/util/makefile.mk0
32 files changed, 542 insertions, 2823 deletions
diff --git a/idl/inc/attrib.hxx b/idl/inc/attrib.hxx
deleted file mode 100644
index 1dfbaea7f4bb..000000000000
--- a/idl/inc/attrib.hxx
+++ /dev/null
@@ -1,77 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _ATTRIB_HXX
-#define _ATTRIB_HXX
-
-#ifdef IDL_COMPILER
-#include <hash.hxx>
-#include <object.hxx>
-
-/******************** class SvAttribute **********************************/
-class SvAttribute
-{
- SvStringHashEntryRef aName;
- CreateMetaObjectType pCreateMethod;
- SvMetaObjectRef aTmpClass;
-public:
- SvAttribute( SvStringHashEntry * pAttribName,
- CreateMetaObjectType pMethod )
- : aName( pAttribName ),
- pCreateMethod( pMethod ) {}
-
- SvMetaObjectRef CreateClass()
- {
- if( aTmpClass.Is() )
- {
- SvMetaObjectRef aTmp( aTmpClass );
- aTmpClass.Clear();
- return aTmp;
- }
- return pCreateMethod();
- }
-};
-
-#define SV_ATTRIBUTE( AttributeName, PostfixClassName ) \
- SvAttribute( SvHash_##AttributeName(), \
- SvMeta##PostfixClassName::Create )
-
-/******************** class SvAttributeList ******************************/
-DECLARE_LIST(SvAttributeListImpl,SvAttribute*)
-class SvAttributeList : public SvAttributeListImpl
-{
-public:
- SvAttributeList() : SvAttributeListImpl() {}
-
- void Append( SvAttribute * pObj )
- { Insert( pObj, LIST_APPEND ); }
-};
-
-
-#endif // IDL_COMPILER
-#endif // _ATTRIB_HXX
-
diff --git a/idl/inc/basobj.hxx b/idl/inc/basobj.hxx
index 32a05d2a4c6b..ff1d7b48b569 100755..100644
--- a/idl/inc/basobj.hxx
+++ b/idl/inc/basobj.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -58,45 +59,20 @@ enum
};
typedef int WriteAttribute;
-/******************** Meta Factory **************************************/
-#ifdef IDL_COMPILER
-
-#define PRV_SV_DECL_META_FACTORY( Class ) \
- static SvAttributeList * pAttribList; \
- static SvMetaObject * Create() { return new Class; } \
- static const char * GetClassName() { return #Class; }
-
-#define PRV_SV_IMPL_META_FACTORY( Class ) \
- SvAttributeList * Class::pAttribList = NULL;
-
-#else
-
-#define PRV_SV_DECL_META_FACTORY( Class )
-
-#define PRV_SV_IMPL_META_FACTORY( Class )
-
-#endif // IDL_COMPILER
-
#define SV_DECL_META_FACTORY( Class, CLASS_ID ) \
- SV_DECL_PERSIST( Class, CLASS_ID ) \
- PRV_SV_DECL_META_FACTORY( Class )
+ SV_DECL_PERSIST( Class, CLASS_ID )
#define SV_DECL_META_FACTORY1( Class, Super1, CLASS_ID ) \
- SV_DECL_PERSIST1( Class, Super1, CLASS_ID ) \
- PRV_SV_DECL_META_FACTORY( Class )
+ SV_DECL_PERSIST1( Class, Super1, CLASS_ID )
#define SV_IMPL_META_FACTORY( Class ) \
- PRV_SV_IMPL_META_FACTORY( Class ) \
SV_IMPL_PERSIST( Class )
#define SV_IMPL_META_FACTORY1( Class, Super1 ) \
- PRV_SV_IMPL_META_FACTORY( Class ) \
SV_IMPL_PERSIST1( Class, Super1 )
-
-/******************** class SvMetaObject ********************************/
class SvMetaObject : public SvPersistBase
{
public:
@@ -120,7 +96,6 @@ public:
#endif
};
SV_DECL_IMPL_REF(SvMetaObject)
-//SV_DECL_IMPL_PERSIST_LIST(SvMetaObject,SvMetaObject *)
SV_DECL_PERSIST_LIST(SvMetaObject,SvMetaObject *)
SV_IMPL_PERSIST_LIST(SvMetaObject,SvMetaObject *)
@@ -151,7 +126,6 @@ public:
}
};
-/******************** class SvMetaName **********************************/
class SvMetaName : public SvMetaObject
{
SvString aName;
@@ -203,7 +177,6 @@ SV_DECL_IMPL_REF(SvMetaName)
SV_DECL_IMPL_PERSIST_LIST(SvMetaName,SvMetaName *)
-/******************** class SvMetaReference *****************************/
SV_DECL_REF(SvMetaReference)
class SvMetaReference : public SvMetaName
{
@@ -252,11 +225,10 @@ SV_IMPL_REF(SvMetaReference)
SV_DECL_IMPL_PERSIST_LIST(SvMetaReference,SvMetaReference *)
-/******************** class SvMetaExtern *********************************/
class SvMetaModule;
class SvMetaExtern : public SvMetaReference
{
- SvMetaModule * pModule; // in welchem Modul enthalten
+ SvMetaModule * pModule; // included in which module
SvUUId aUUId;
SvVersion aVersion;
@@ -292,3 +264,4 @@ SV_DECL_IMPL_PERSIST_LIST(SvMetaExtern,SvMetaExtern *)
#endif // _BASOBJ_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/inc/bastype.hxx b/idl/inc/bastype.hxx
index 0fe59e2c86eb..a95114954eab 100755..100644
--- a/idl/inc/bastype.hxx
+++ b/idl/inc/bastype.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,7 +40,6 @@ class SvStringHashEntry;
class SvIdlDataBase;
class SvTokenStream;
-/******************** class SvUINT32 **********************************/
class SvUINT32
{
sal_uInt32 nVal;
@@ -60,7 +60,6 @@ public:
};
-/******************** class SvINT16 **********************************/
class SvINT16
{
short nVal;
@@ -78,7 +77,6 @@ public:
};
-/******************** class SvUINT16 **********************************/
class SvUINT16
{
sal_uInt16 nVal;
@@ -96,7 +94,6 @@ public:
};
-/******************** class SvINT32 **********************************/
class SvINT32
{
sal_Int32 nVal;
@@ -114,7 +111,6 @@ public:
};
-/******************** class Svint **********************************/
class Svint
{
int nVal;
@@ -135,7 +131,6 @@ public:
};
-/******************** class SvBOOL **********************************/
class SvBOOL
{
sal_Bool nVal:1,
@@ -164,7 +159,6 @@ public:
};
-/******************** class SvIdentifier **********************************/
class SvIdentifier : public ByteString
{
public:
@@ -183,11 +177,10 @@ public:
};
-/******************** class SvIdentifier **********************************/
class SvNumberIdentifier : public SvIdentifier
{
sal_uInt32 nValue;
- // darf nicht benutzt werden
+ // must not be used
sal_Bool ReadSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm );
public:
SvNumberIdentifier() : nValue( 0 ) {};
@@ -208,7 +201,6 @@ public:
};
-/******************** class SvString **********************************/
class SvString : public ByteString
{
public:
@@ -227,7 +219,6 @@ public:
};
-/******************** class SvHelpText **********************************/
class SvHelpText : public SvString
{
public:
@@ -240,12 +231,10 @@ public:
};
-/******************** class SvHelpContext *******************************/
class SvHelpContext : public SvNumberIdentifier
{
};
-/******************** class SvUUId *************************************/
class SvUUId : public SvGlobalName
{
public:
@@ -257,7 +246,6 @@ public:
};
-/******************** class SvVersion **********************************/
class SvVersion
{
sal_uInt16 nMajorVersion;
@@ -288,3 +276,4 @@ public:
#endif // _BASTYPE_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/inc/char.hxx b/idl/inc/char.hxx
index fc8045f0ba54..0c0528d08a98 100644
--- a/idl/inc/char.hxx
+++ b/idl/inc/char.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,7 +31,6 @@
#include <tools/string.hxx>
-/******************* T y p e s *******************************************/
class SvChar
{
public:
@@ -39,3 +39,5 @@ public:
#endif // _CHAR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/inc/command.hxx b/idl/inc/command.hxx
index 5a9577178193..f8ea98a5e63f 100755..100644
--- a/idl/inc/command.hxx
+++ b/idl/inc/command.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,18 +29,16 @@
#ifndef _COMMAND_HXX
#define _COMMAND_HXX
-
-#include <tools/list.hxx>
#include <tools/string.hxx>
+#include <vector>
#ifndef STRING_LIST
#define STRING_LIST
-DECLARE_LIST( StringList, String * )
+typedef ::std::vector< String* > StringList;
#endif
-DECLARE_LIST( ByteStringList, ByteString* )
+typedef ::std::vector< ByteString* > ByteStringList;
-/******************** class SvCommand ************************************/
class SvCommand
{
public:
@@ -76,3 +75,4 @@ void DeInit();
#endif // _COMMAND_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/inc/database.hxx b/idl/inc/database.hxx
index b3f9ca5b154f..74ccbd575354 100755..100644
--- a/idl/inc/database.hxx
+++ b/idl/inc/database.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,13 +34,10 @@
#include <lex.hxx>
#include <tools/pstm.hxx>
-/*************************************************************************
-*************************************************************************/
-
class SvCommand;
#ifdef IDL_COMPILER
-/******************** class SvIdlError ***********************************/
+
class SvIdlError
{
ByteString aText;
@@ -63,7 +61,6 @@ public:
};
#endif
-/******************** class SvIdlDataBase ********************************/
class SvIdlDataBase
{
sal_Bool bExport;
@@ -81,7 +78,7 @@ class SvIdlDataBase
SvMetaClassMemberList aClassList;
SvMetaModuleMemberList aModuleList;
SvMetaAttributeMemberList aAttrList;
- SvMetaTypeMemberList aTmpTypeList; // nicht Persistent
+ SvMetaTypeMemberList aTmpTypeList; // not persistent
protected:
#ifdef IDL_COMPILER
@@ -110,7 +107,7 @@ public:
SvMetaModuleMemberList & GetModuleList() { return aModuleList; }
SvMetaModule * GetModule( const ByteString & rName );
- // Liste der benutzten Typen beim Schreiben
+ // list of used types while writing
SvMetaTypeMemberList aUsedTypes;
ByteString aIFaceName;
SvNumberIdentifier aStructSlotId;
@@ -180,3 +177,4 @@ public:
#endif // _DATABASE_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/inc/globals.hxx b/idl/inc/globals.hxx
index c3e841df05d6..525c2a9e27e2 100644
--- a/idl/inc/globals.hxx
+++ b/idl/inc/globals.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -240,3 +241,4 @@ HASH_INLINE(UnoName)
#endif // IDL_COMPILER
#endif // _GLOBALS_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/inc/hash.hxx b/idl/inc/hash.hxx
index ec97a12a8fce..6449dfd7b9e6 100755..100644
--- a/idl/inc/hash.hxx
+++ b/idl/inc/hash.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,18 +29,16 @@
#ifndef _HASH_HXX
#define _HASH_HXX
-
-
#include <tools/ref.hxx>
#include <tools/string.hxx>
+#include <vector>
-/****************** H a s h - T a b l e **********************************/
class SvHashTable
{
sal_uInt32 nMax; // size of hash-tabel
sal_uInt32 nFill; // elements in hash-tabel
- sal_uInt32 lAsk; // Anzahl der Anfragen
- sal_uInt32 lTry; // Anzahl der Versuche
+ sal_uInt32 lAsk; // number of requests
+ sal_uInt32 lTry; // number of tries
protected:
sal_Bool Test_Insert( const void *, sal_Bool bInsert, sal_uInt32 * pInsertPos );
@@ -56,7 +55,6 @@ public:
virtual sal_Bool IsEntry( sal_uInt32 ) const = 0;
};
-/************** S t r i n g H a s h T a b l e E n t r y ******************/
class SvStringHashTable;
class SvStringHashEntry : public SvRefBase
{
@@ -97,12 +95,11 @@ public:
SV_DECL_IMPL_REF(SvStringHashEntry)
-/****************** S t r i n g H a s h T a b l e ************************/
-DECLARE_LIST(SvStringHashList,SvStringHashEntry *)
+typedef ::std::vector< SvStringHashEntry* > SvStringHashList;
class SvStringHashTable : public SvHashTable
{
- SvStringHashEntry * pEntries;
+ SvStringHashEntry* pEntries;
protected:
virtual sal_uInt32 HashFunc( const void * pElement ) const;
virtual StringCompare Compare( const void * pElement, sal_uInt32 nIndex ) const;
@@ -123,3 +120,5 @@ public:
};
#endif // _RSCHASH_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/inc/lex.hxx b/idl/inc/lex.hxx
index 9c7ecdd95f3a..3aa22139a4dd 100755..100644
--- a/idl/inc/lex.hxx
+++ b/idl/inc/lex.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,18 +29,18 @@
#ifndef _LEX_HXX
#define _LEX_HXX
+#include <boost/ptr_container/ptr_vector.hpp>
+
#include <hash.hxx>
#include <tools/gen.hxx>
#include <tools/stream.hxx>
-/******************** enum ***********************************************/
enum SVTOKEN_ENUM { SVTOKEN_EMPTY, SVTOKEN_COMMENT,
SVTOKEN_INTEGER, SVTOKEN_STRING,
SVTOKEN_BOOL, SVTOKEN_IDENTIFIER,
SVTOKEN_CHAR, SVTOKEN_RTTIBASE,
SVTOKEN_EOF, SVTOKEN_HASHID };
-/******************** class SvToken **************************************/
class BigInt;
class SvToken
{
@@ -52,7 +53,6 @@ friend class SvTokenStream;
sal_uLong nLong;
sal_Bool bBool;
char cChar;
-// SvRttiBase * pComplexObj;
SvStringHashEntry * pHash;
};
public:
@@ -62,7 +62,6 @@ public:
SvToken( SVTOKEN_ENUM nTypeP, sal_Bool b );
SvToken( char c );
SvToken( SVTOKEN_ENUM nTypeP, const ByteString & rStr );
-// SvToken( SvRttiBase * pComplexObj );
SvToken( SVTOKEN_ENUM nTypeP );
SvToken & operator = ( const SvToken & rObj );
@@ -101,7 +100,6 @@ public:
sal_uLong GetNumber() const { return nLong; }
sal_Bool GetBool() const { return bBool; }
char GetChar() const { return cChar; }
-// SvRttiBase *GetObject() const { return pComplexObj; }
void SetHash( SvStringHashEntry * pHashP )
{ pHash = pHashP; nType = SVTOKEN_HASHID; }
@@ -127,26 +125,17 @@ inline SvToken::SvToken( char c )
inline SvToken::SvToken( SVTOKEN_ENUM nTypeP, const ByteString & rStr )
: nType( nTypeP ), aString( rStr ) {}
-/*
-inline SvToken::SvToken( SvRttiBase * pObj )
- : nType( SVTOKEN_RTTIBASE ), pComplexObj( pObj )
- { pObj->AddRef(); }
-*/
-
inline SvToken::SvToken( SVTOKEN_ENUM nTypeP )
: nType( nTypeP ) {}
-DECLARE_LIST( SvTokenList, SvToken * )
-
-/******************** class SvTokenStream ********************************/
class SvTokenStream
{
sal_uLong nLine, nColumn;
int nBufPos;
- int c; // naechstes Zeichen
+ int c; // next character
CharSet nCharSet;
- char * pCharTab; // Zeiger auf die Konverierungstabelle
- sal_uInt16 nTabSize; // Tabulator Laenge
+ char * pCharTab; // pointer to conversion table
+ sal_uInt16 nTabSize; // length of tabulator
ByteString aStrTrue;
ByteString aStrFalse;
sal_uLong nMaxPos;
@@ -154,8 +143,8 @@ class SvTokenStream
SvFileStream * pInStream;
SvStream & rInStream;
String aFileName;
- SvTokenList aTokList;
- SvToken * pCurToken;
+ boost::ptr_vector<SvToken> aTokList;
+ boost::ptr_vector<SvToken>::iterator pCurToken;
void InitCtor();
@@ -178,7 +167,7 @@ class SvTokenStream
}
void CalcColumn()
{
- // wenn Zeilenende berechnung sparen
+ // if end of line spare calculation
if( 0 != c )
{
sal_uInt16 n = 0;
@@ -202,30 +191,37 @@ public:
{ nTabSize = nTabSizeP; }
sal_uInt16 GetTabSize() const { return nTabSize; }
- SvToken * GetToken_PrevAll()
- {
- SvToken * pRetToken = pCurToken;
- if( NULL == (pCurToken = aTokList.Prev()) )
- // Current Zeiger nie Null
- pCurToken = pRetToken;
+ SvToken* GetToken_PrevAll()
+ {
+ boost::ptr_vector<SvToken>::iterator pRetToken = pCurToken;
+
+ // current iterator always valid
+ if(pCurToken != aTokList.begin())
+ --pCurToken;
+
+ return &(*pRetToken);
+ }
+
+ SvToken* GetToken_NextAll()
+ {
+ boost::ptr_vector<SvToken>::iterator pRetToken = pCurToken++;
+
+ if (pCurToken == aTokList.end())
+ pCurToken = pRetToken;
+
+ SetMax();
+
+ return &(*pRetToken);
+ }
+
+ SvToken* GetToken_Next()
+ {
+ // comments get removed initially
+ return GetToken_NextAll();
+ }
+
+ SvToken* GetToken() const { return &(*pCurToken); }
- return pRetToken;
- }
- SvToken * GetToken_NextAll()
- {
- SvToken * pRetToken = pCurToken;
- if( NULL == (pCurToken = aTokList.Next()) )
- // Current Zeiger nie Null
- pCurToken = pRetToken;
- SetMax();
- return pRetToken;
- }
- SvToken * GetToken_Next()
- {
- // Kommentare werden initial entfernt
- return GetToken_NextAll();
- }
- SvToken * GetToken() const { return pCurToken; }
sal_Bool Read( char cChar )
{
if( pCurToken->IsChar()
@@ -237,6 +233,7 @@ public:
else
return sal_False;
}
+
void ReadDelemiter()
{
if( pCurToken->IsChar()
@@ -247,25 +244,33 @@ public:
}
}
- sal_uInt32 Tell() const
- { return aTokList.GetCurPos(); }
- void Seek( sal_uInt32 nPos )
- {
- pCurToken = aTokList.Seek( nPos );
- SetMax();
- }
- void SeekRel( sal_Int32 nRelPos )
- {
- pCurToken = aTokList.Seek( Tell() + nRelPos );
- SetMax();
- }
- void SeekEnd()
- {
- pCurToken = aTokList.Seek( nMaxPos );
- }
+ sal_uInt32 Tell() const { return pCurToken-aTokList.begin(); }
+
+ void Seek( sal_uInt32 nPos )
+ {
+ pCurToken = aTokList.begin() + nPos;
+ SetMax();
+ }
+
+ void SeekRel( sal_uInt32 nRelPos )
+ {
+ sal_uInt32 relIdx = Tell() + nRelPos;
+
+ if ( relIdx < aTokList.size())
+ {
+ pCurToken = aTokList.begin()+ (Tell() + nRelPos );
+ SetMax();
+ }
+ }
+
+ void SeekEnd()
+ {
+ pCurToken = aTokList.begin()+nMaxPos;
+ }
};
#endif // _LEX_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/inc/module.hxx b/idl/inc/module.hxx
index 5ffd670d6202..964cf148b87a 100755..100644
--- a/idl/inc/module.hxx
+++ b/idl/inc/module.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,15 +40,13 @@ struct SvNamePos
: aUUId( rName )
, nStmPos( nPos ) {}
};
-DECLARE_LIST( SvNamePosList, SvNamePos *)
-/******************** class SvMetaModule *********************************/
class SvMetaModule : public SvMetaExtern
{
SvMetaClassMemberList aClassList;
SvMetaTypeMemberList aTypeList;
SvMetaAttributeMemberList aAttrList;
-// Browser
+// browser
String aIdlFileName;
SvString aHelpFileName;
SvString aSlotIdFile;
@@ -96,7 +95,6 @@ public:
virtual void WriteAttributes( SvIdlDataBase & rBase,
SvStream & rOutStm, sal_uInt16 nTab,
WriteType, WriteAttribute = 0 );
-// virtual void WriteSbx( SvIdlDataBase & rBase, SvStream & rOutStm, SvNamePosList & rList );
virtual void Write( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab,
WriteType, WriteAttribute = 0 );
virtual void WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm );
@@ -115,3 +113,4 @@ SV_DECL_IMPL_PERSIST_LIST(SvMetaModule,SvMetaModule *)
#endif // _MODULE_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/inc/object.hxx b/idl/inc/object.hxx
index 5f4b44c8d7fb..a39c7e917d60 100755..100644
--- a/idl/inc/object.hxx
+++ b/idl/inc/object.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,9 @@
#define _OBJECT_HXX
#define _SVSTDARR_ULONGS
-//#include <svtools/svstdarr.hxx>
#include <types.hxx>
#include <slot.hxx>
+#include <vector>
struct SvSlotElement
{
@@ -42,19 +43,11 @@ struct SvSlotElement
, aPrefix( rPrefix )
{}
};
-DECLARE_LIST( SvSlotElementList, SvSlotElement* )
-class SvMetaClass;
-DECLARE_LIST( SvMetaClassList, SvMetaClass* )
+typedef std::vector< SvSlotElement* > SvSlotElementList;
-class SvULongs : public List
-{
-public:
- void Insert( sal_uLong& rId, sal_uLong nPos ) { sal_uLong nId(rId ); List::Insert( (void*) nId, nPos ); }
- void Remove( sal_uLong& rId ){ sal_uLong nId(rId ); List::Remove( (void*) nId ); }
- sal_uLong GetObject( sal_uLong nPos ){ return (sal_uLong) List::GetObject( nPos ); }
-};
+class SvMetaClass;
+typedef ::std::vector< SvMetaClass* > SvMetaClassList;
-/******************** class SvClassElement *******************************/
SV_DECL_REF(SvMetaClass)
class SvClassElement : public SvPersistBase
{
@@ -84,7 +77,6 @@ public:
SV_DECL_IMPL_REF(SvClassElement)
SV_DECL_IMPL_PERSIST_LIST(SvClassElement,SvClassElement *)
-/******************** class SvMetaClass *********************************/
class SvMetaModule;
SV_DECL_PERSIST_LIST(SvMetaClass,SvMetaClass *)
class SvMetaClass : public SvMetaType
@@ -95,9 +87,6 @@ class SvMetaClass : public SvMetaType
SvBOOL aAutomation;
SvMetaClassRef xAutomationInterface;
-// void FillSbxMemberObject( SvIdlDataBase & rBase,
-// SbxObject *, StringList &,
-// sal_Bool bVariable );
sal_Bool TestAttribute( SvIdlDataBase & rBase, SvTokenStream & rInStm,
SvMetaAttribute & rAttr ) const;
#ifdef IDL_COMPILER
@@ -113,7 +102,7 @@ class SvMetaClass : public SvMetaType
SvIdlDataBase & rBase,
SvStream & rOutStm );
- void InsertSlots( SvSlotElementList& rList, SvULongs& rSuperList,
+ void InsertSlots( SvSlotElementList& rList, std::vector<sal_uLong>& rSuperList,
SvMetaClassList & rClassList,
const ByteString & rPrefix, SvIdlDataBase& rBase );
@@ -141,7 +130,6 @@ public:
{ return aSuperClass; }
void FillClasses( SvMetaClassList & rList );
-// virtual void FillSbxObject( SvIdlDataBase & rBase, SbxObject * );
const SvClassElementMemberList&
GetClassList() const
@@ -168,3 +156,4 @@ SV_IMPL_PERSIST_LIST(SvMetaClass,SvMetaClass *)
#endif // _OBJECT_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/inc/pch/precompiled_idl.cxx b/idl/inc/pch/precompiled_idl.cxx
index 7ab1f99c4750..7515c4ededbc 100644
--- a/idl/inc/pch/precompiled_idl.cxx
+++ b/idl/inc/pch/precompiled_idl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,3 +28,4 @@
#include "precompiled_idl.hxx"
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/inc/pch/precompiled_idl.hxx b/idl/inc/pch/precompiled_idl.hxx
index 3f2ba013434e..977fd5d3b09e 100644
--- a/idl/inc/pch/precompiled_idl.hxx
+++ b/idl/inc/pch/precompiled_idl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,3 +31,4 @@
#ifdef PRECOMPILED_HEADERS
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/inc/slot.hxx b/idl/inc/slot.hxx
index 95d4051026be..b4036ea2ff2d 100755..100644
--- a/idl/inc/slot.hxx
+++ b/idl/inc/slot.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,8 +32,6 @@
#include <types.hxx>
#include <command.hxx>
-/******************** class SvMetaSlot **********************************/
-//class SbxObject;
class SvMetaSlotMemberList;
class SvMetaSlot : public SvMetaAttribute
{
@@ -48,15 +47,15 @@ class SvMetaSlot : public SvMetaAttribute
SvBOOL aGet;
SvBOOL aSet;
- SvBOOL aCachable; // exclusiv
+ SvBOOL aCachable; // exclusive
SvBOOL aVolatile;
SvBOOL aToggle;
SvBOOL aAutoUpdate;
- SvBOOL aSynchron; // exclusiv
+ SvBOOL aSynchron; // exclusive
SvBOOL aAsynchron;
- SvBOOL aRecordPerItem;// exclusiv
+ SvBOOL aRecordPerItem;// exclusive
SvBOOL aRecordPerSet;
SvBOOL aRecordManual;
SvBOOL aNoRecord;
@@ -83,6 +82,7 @@ class SvMetaSlot : public SvMetaAttribute
void WriteSlot( const ByteString & rShellName,
sal_uInt16 nCount, const ByteString & rSlotId,
SvSlotElementList &rList,
+ size_t nStart,
const ByteString & rPrefix,
SvIdlDataBase & rBase, SvStream & rOutStm );
virtual void Write( SvIdlDataBase & rBase,
@@ -201,10 +201,6 @@ public:
const ByteString & GetDefault() const;
const ByteString & GetDisableFlags() const;
sal_Bool GetPseudoSlots() const;
- /*
- sal_Bool GetGet() const;
- sal_Bool GetSet() const;
- */
sal_Bool GetCachable() const;
sal_Bool GetVolatile() const;
sal_Bool GetToggle() const;
@@ -241,7 +237,6 @@ public:
void ResetSlotPointer()
{ pNextSlot = pLinkedSlot = 0; }
-// void FillSbxObject( SvIdlDataBase & rBase, SbxObject *, sal_Bool bProp );
#ifdef IDL_COMPILER
SvMetaEnumValue* GetEnumValue() const
{ return pEnumValue; }
@@ -261,6 +256,7 @@ public:
sal_uInt16 WriteSlotMap( const ByteString & rShellName,
sal_uInt16 nCount,
SvSlotElementList&,
+ size_t nStart,
const ByteString &,
SvIdlDataBase & rBase,
SvStream & rOutStm );
@@ -277,3 +273,5 @@ SV_DECL_IMPL_REF(SvMetaSlot)
SV_DECL_IMPL_PERSIST_LIST(SvMetaSlot,SvMetaSlot *)
#endif // _SLOT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/inc/types.hxx b/idl/inc/types.hxx
index bb12b9291b27..e4f405d9e693 100755..100644
--- a/idl/inc/types.hxx
+++ b/idl/inc/types.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,10 +32,9 @@
#include <tools/ref.hxx>
#include <basobj.hxx>
-class SvSlotElementList;
struct SvSlotElement;
+typedef std::vector< SvSlotElement* > SvSlotElementList;
-/******************** class SvMetaAttribute *****************************/
SV_DECL_REF(SvMetaType)
SV_DECL_REF(SvMetaAttribute)
SV_DECL_PERSIST_LIST(SvMetaAttribute,SvMetaAttribute *)
@@ -104,8 +104,6 @@ public:
virtual sal_Bool IsVariable() const;
virtual ByteString GetMangleName( sal_Bool bVariable ) const;
-// void FillSbxObject( SbxInfo * pInfo, sal_uInt16 nSbxFlags = 0 );
-// virtual void FillSbxObject( SvIdlDataBase & rBase, SbxObject * pObj, sal_Bool bVariable );
#ifdef IDL_COMPILER
virtual sal_Bool Test( SvIdlDataBase &, SvTokenStream & rInStm );
@@ -134,14 +132,13 @@ SV_IMPL_REF(SvMetaAttribute)
SV_IMPL_PERSIST_LIST(SvMetaAttribute,SvMetaAttribute *)
-/******************** class SvType *********************************/
enum { CALL_VALUE, CALL_POINTER, CALL_REFERENCE };
enum { TYPE_METHOD, TYPE_STRUCT, TYPE_BASE, TYPE_ENUM, TYPE_UNION,
TYPE_CLASS, TYPE_POINTER };
class SvMetaType : public SvMetaExtern
{
- SvBOOL aIn; // Eingangsparameter
- SvBOOL aOut; // Returnparameter
+ SvBOOL aIn; // input parameter
+ SvBOOL aOut; // return parameter
Svint aCall0, aCall1;
Svint aSbxDataType;
SvIdentifier aSvName;
@@ -185,7 +182,7 @@ public:
SvMetaType( const ByteString & rTypeName, const ByteString & rSbxName,
const ByteString & rOdlName, char cParserChar,
const ByteString & rCName, const ByteString & rBasicName,
- const ByteString & rBasicPostfix/*, SbxDataType nT = SbxEMPTY */);
+ const ByteString & rBasicPostfix );
SvMetaAttributeMemberList & GetAttrList() const;
sal_uLong GetAttrCount() const
@@ -204,10 +201,6 @@ public:
sal_Bool IsItem() const { return bIsItem; }
sal_Bool IsShell() const { return bIsShell; }
-// void SetSbxDataType( SbxDataType nT )
-// { aSbxDataType = (int)nT; }
-// SbxDataType GetSbxDataType() const;
-
void SetIn( sal_Bool b ) { aIn = b; }
sal_Bool GetIn() const;
@@ -233,7 +226,6 @@ public:
virtual sal_Bool SetName( const ByteString & rName, SvIdlDataBase * = NULL );
-// void FillSbxObject( SbxVariable * pObj, sal_Bool bVariable );
#ifdef IDL_COMPILER
virtual sal_Bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
@@ -248,7 +240,6 @@ public:
sal_uLong MakeSfx( ByteString * pAtrrArray );
virtual void WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm );
- //sal_Bool ReadTypePrefix( SvIdlDataBase &, SvTokenStream & rInStm );
sal_Bool ReadMethodArgs( SvIdlDataBase & rBase,
SvTokenStream & rInStm );
void WriteTypePrefix( SvIdlDataBase & rBase, SvStream & rOutStm, sal_uInt16 nTab, WriteType );
@@ -260,11 +251,9 @@ public:
#endif
};
SV_IMPL_REF(SvMetaType)
-DECLARE_LIST(SvMetaTypeList,SvMetaType *)
SV_DECL_IMPL_PERSIST_LIST(SvMetaType,SvMetaType *)
-/******************** class SvTypeString *********************************/
class SvMetaTypeString : public SvMetaType
{
public:
@@ -275,7 +264,6 @@ SV_DECL_IMPL_REF(SvMetaTypeString)
SV_DECL_IMPL_PERSIST_LIST(SvMetaTypeString,SvMetaTypeString *)
-/******************** class SvMetaEnumValue **********************************/
class SvMetaEnumValue : public SvMetaName
{
ByteString aEnumValue;
@@ -294,7 +282,6 @@ SV_DECL_IMPL_REF(SvMetaEnumValue)
SV_DECL_IMPL_PERSIST_LIST(SvMetaEnumValue,SvMetaEnumValue *)
-/******************** class SvTypeEnum *********************************/
class SvMetaTypeEnum : public SvMetaType
{
SvMetaEnumValueMemberList aEnumValueList;
@@ -330,7 +317,6 @@ SV_DECL_IMPL_REF(SvMetaTypeEnum)
SV_DECL_IMPL_PERSIST_LIST(SvMetaTypeEnum,SvMetaTypeEnum *)
-/******************** class SvTypeVoid ***********************************/
class SvMetaTypevoid : public SvMetaType
{
public:
@@ -343,3 +329,4 @@ SV_DECL_IMPL_PERSIST_LIST(SvMetaTypevoid,SvMetaTypevoid *)
#endif // _TYPES_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/prj/makefile.mk b/idl/prj/makefile.mk
index 88cd9dfe08b8..88cd9dfe08b8 100644..100755
--- a/idl/prj/makefile.mk
+++ b/idl/prj/makefile.mk
diff --git a/idl/source/cmptools/char.cxx b/idl/source/cmptools/char.cxx
index 6e0049240bbb..19848ffa96d4 100755..100644
--- a/idl/source/cmptools/char.cxx
+++ b/idl/source/cmptools/char.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,17 +29,13 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_idl.hxx"
-/****************** I N C L U D E S **************************************/
#include <ctype.h>
#include <string.h>
-#ifndef _TABLE_HXX //autogen
#include <tools/table.hxx>
-#endif
#include <char.hxx>
-/****************** D A T E N ********************************************/
static unsigned char EqualTab[ 256 ] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
@@ -72,10 +69,6 @@ static unsigned char EqualTab[ 256 ] = {
|*
|* RscChar::GetTable()
|*
-|* Beschreibung
-|* Ersterstellung MM 08.08.91
-|* Letzte Aenderung MM 08.08.91
-|*
*************************************************************************/
Table * pCharTable = NULL;
unsigned char * pChange = EqualTab;
@@ -105,3 +98,5 @@ char * SvChar::GetTable( CharSet nSource , CharSet nDest )
return (char *)pSet;
};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/source/cmptools/hash.cxx b/idl/source/cmptools/hash.cxx
index f919a1074efa..6ddc5a618bce 100755..100644
--- a/idl/source/cmptools/hash.cxx
+++ b/idl/source/cmptools/hash.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,33 +29,17 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_idl.hxx"
-/****************** I N C L U D E S **************************************/
-// C and C++ Includes.
+// C and C++ includes
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
-// Programmabh�ngige Includes.
+// program-sensitive includes
#include <hash.hxx>
#include <tools/debug.hxx>
-/****************** C O D E **********************************************/
-/*************************************************************************
-|*
-|* SvStringHashEntry::~SvStringHashEntry()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
SvStringHashEntry::~SvStringHashEntry() { };
-/*************************************************************************
-|*
-|* SvHashTable::SvHashTable()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
SvHashTable::SvHashTable( sal_uInt32 nMaxEntries )
{
nMax = nMaxEntries; // set max entries
@@ -63,30 +48,10 @@ SvHashTable::SvHashTable( sal_uInt32 nMaxEntries )
lAsk = 0;
}
-/*************************************************************************
-|*
-|* SvHashTable::~SvHashTable()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
SvHashTable::~SvHashTable()
{
-#ifdef DOS_NIE
- printf( "Maximum: %ld, F�llung: %ld\n", (sal_uLong)nMax, (sal_uLong)nFill );
- printf( "Anfragen: %ld, Versuche: %ld", (sal_uLong)lAsk, (sal_uLong)lTry );
- if( lTry != 0 )
- printf( ", V/E = %ld\n", lTry / lAsk );
-#endif
}
-/*************************************************************************
-|*
-|* SvHashTable::Test_Insert()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
sal_Bool SvHashTable::Test_Insert( const void * pElement, sal_Bool bInsert,
sal_uInt32 * pInsertPos )
{
@@ -100,9 +65,6 @@ sal_Bool SvHashTable::Test_Insert( const void * pElement, sal_Bool bInsert,
nHash = HashFunc( pElement );
nIndex = nHash % nMax;
-// const char* s = ((ByteString*) pElement)->GetStr();
-// fprintf(stderr,"### Hash: %lu , Name: %s\n",nIndex,s );
-
nLoop = 0; // divide to range
while( (nMax != nLoop) && IsEntry( nIndex ) )
{ // is place occupied
@@ -130,20 +92,12 @@ sal_Bool SvHashTable::Test_Insert( const void * pElement, sal_Bool bInsert,
return( sal_False );
}
-/************************************************************************/
-/*************************************************************************
-|*
-|* SvStringHashTable::SvStringHashTable()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
SvStringHashTable::SvStringHashTable( sal_uInt32 nMaxEntries )
: SvHashTable( nMaxEntries )
{
pEntries = new SvStringHashEntry[ nMaxEntries ];
- // RefCount auf eins setzen
+ // set RefCount to one
SvStringHashEntry * pPos, *pEnd;
pPos = pEntries;
pEnd = pEntries + nMaxEntries;
@@ -154,20 +108,13 @@ SvStringHashTable::SvStringHashTable( sal_uInt32 nMaxEntries )
}
}
-/*************************************************************************
-|*
-|* ~SvStringHashTable::SvStringHashTable()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
SvStringHashTable::~SvStringHashTable()
{
- // RefCount auf eins setzen
+#ifdef DBG_UTIL
+ // set RefCount to one
SvStringHashEntry * pPos, *pEnd;
pPos = pEntries;
pEnd = pEntries + GetMax();
-#ifdef DBG_UTIL
while( pPos != pEnd )
{
DBG_ASSERT( pPos->GetRefCount() == 1, "Reference count != 1" );
@@ -175,23 +122,9 @@ SvStringHashTable::~SvStringHashTable()
}
#endif
-#ifdef MPW
- // der MPW-Compiler ruft sonst keine Dtoren!
- for ( sal_uInt16 n = 0; n < GetMax(); ++n )
- (pEntries+n)->SvStringHashEntry::~SvStringHashEntry();
- delete (void*) pEntries;
-#else
delete [] pEntries;
-#endif
}
-/*************************************************************************
-|*
-|* SvStringHashTable::HashFunc()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
sal_uInt32 SvStringHashTable::HashFunc( const void * pElement ) const
{
sal_uInt32 nHash = 0; // hash value
@@ -213,13 +146,6 @@ sal_uInt32 SvStringHashTable::HashFunc( const void * pElement ) const
return( nHash );
}
-/*************************************************************************
-|*
-|* SvStringHashTable::GetNearString()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
ByteString SvStringHashTable::GetNearString( const ByteString & rName ) const
{
for( sal_uInt32 i = 0; i < GetMax(); i++ )
@@ -234,13 +160,6 @@ ByteString SvStringHashTable::GetNearString( const ByteString & rName ) const
return ByteString();
}
-/*************************************************************************
-|*
-|* SvStringHashTable::IsEntry()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
sal_Bool SvStringHashTable::IsEntry( sal_uInt32 nIndex ) const
{
if( nIndex >= GetMax() )
@@ -248,13 +167,6 @@ sal_Bool SvStringHashTable::IsEntry( sal_uInt32 nIndex ) const
return pEntries[ nIndex ].HasId();
}
-/*************************************************************************
-|*
-|* SvStringHashTable::Insert()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
sal_Bool SvStringHashTable::Insert( const ByteString & rName, sal_uInt32 * pIndex )
{
sal_uInt32 nIndex;
@@ -269,26 +181,12 @@ sal_Bool SvStringHashTable::Insert( const ByteString & rName, sal_uInt32 * pInde
return sal_True;
}
-/*************************************************************************
-|*
-|* SvStringHashTable::Test()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
sal_Bool SvStringHashTable::Test( const ByteString & rName, sal_uInt32 * pPos ) const
{
return ((SvStringHashTable *)this)->SvHashTable::
Test_Insert( &rName, sal_False, pPos );
}
-/*************************************************************************
-|*
-|* SvStringHashTable::Get()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
SvStringHashEntry * SvStringHashTable::Get( sal_uInt32 nIndex ) const
{
if( IsEntry( nIndex ) )
@@ -296,32 +194,20 @@ SvStringHashEntry * SvStringHashTable::Get( sal_uInt32 nIndex ) const
return( NULL );
}
-/*************************************************************************
-|*
-|* SvStringHashTable::Get()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
StringCompare SvStringHashTable::Compare( const void * pElement,
sal_uInt32 nIndex ) const
{
return ((const ByteString *)pElement)->CompareTo( pEntries[ nIndex ].GetName() );
}
-/*************************************************************************
-|*
-|* SvStringHashTable::FillHashList()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
void SvStringHashTable::FillHashList( SvStringHashList * pList ) const
{
for( sal_uInt32 n = 0; n < GetMax(); n++ )
{
if( IsEntry( n ) )
- pList->Insert( Get( n ), LIST_APPEND );
+ pList->push_back( Get( n ) );
}
- // Hash Reihenfolge, jetzt sortieren
+ // hash order, sort now
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/source/cmptools/lex.cxx b/idl/source/cmptools/lex.cxx
index 24991489841c..04281e3fcff7 100755..100644
--- a/idl/source/cmptools/lex.cxx
+++ b/idl/source/cmptools/lex.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,14 +39,6 @@
#include <globals.hxx>
#include <tools/bigint.hxx>
-/****************** SvToken **********************************************/
-/*************************************************************************
-|*
-|* SvToken::Print()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
ByteString SvToken::GetTokenAsString() const
{
ByteString aStr;
@@ -72,7 +65,7 @@ ByteString SvToken::GetTokenAsString() const
aStr = cChar;
break;
case SVTOKEN_RTTIBASE:
- aStr = "RTTIBASE";//(ULONG)pComplexObj;
+ aStr = "RTTIBASE";
break;
case SVTOKEN_EOF:
case SVTOKEN_HASHID:
@@ -82,68 +75,28 @@ ByteString SvToken::GetTokenAsString() const
return aStr;
}
-/*************************************************************************
-|*
-|* SvToken::SvToken()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
SvToken::SvToken( const SvToken & rObj )
{
nLine = rObj.nLine;
nColumn = rObj.nColumn;
nType = rObj.nType;
aString = rObj.aString;
-/*
- if( SVTOKEN_RTTIBASE = nType )
- {
- pComplexObj = rObj.pComplexObj;
- pComplexObj->AddRef();
- }
- else
-*/
- nLong = rObj.nLong;
+ nLong = rObj.nLong;
}
-/*************************************************************************
-|*
-|* SvToken::operator = ()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
SvToken & SvToken::operator = ( const SvToken & rObj )
{
if( this != &rObj )
{
-/*
- if( SVTOKEN_RTTIBASE = nType )
- pComplexObj->ReleaseRef();
-*/
nLine = rObj.nLine;
nColumn = rObj.nColumn;
nType = rObj.nType;
aString = rObj.aString;
-/*
- if( SVTOKEN_RTTIBASE = nType )
- {
- pComplexObj = rObj.pComplexObj;
- pComplexObj->AddRef();
- }
- else
-*/
- nLong = rObj.nLong;
+ nLong = rObj.nLong;
}
return *this;
}
-/****************** SvTokenStream ****************************************/
-/*************************************************************************
-|* SvTokenStream::InitCtor()
-|*
-|* Beschreibung
-*************************************************************************/
void SvTokenStream::InitCtor()
{
SetCharSet( gsl_getSystemTextEncoding() );
@@ -152,75 +105,47 @@ void SvTokenStream::InitCtor()
nLine = nColumn = 0;
nBufPos = 0;
nTabSize = 4;
- pCurToken = NULL;
nMaxPos = 0;
c = GetNextChar();
FillTokenList();
}
-/*************************************************************************
-|* SvTokenStream::SvTokenStream()
-|*
-|* Beschreibung
-*************************************************************************/
SvTokenStream::SvTokenStream( const String & rFileName )
: pInStream( new SvFileStream( rFileName, STREAM_STD_READ | STREAM_NOCREATE ) )
, rInStream( *pInStream )
, aFileName( rFileName )
- , aTokList( 0x8000, 0x8000 )
{
InitCtor();
}
-/*************************************************************************
-|* SvTokenStream::SvTokenStream()
-|*
-|* Beschreibung
-*************************************************************************/
SvTokenStream::SvTokenStream( SvStream & rStream, const String & rFileName )
: pInStream( NULL )
, rInStream( rStream )
, aFileName( rFileName )
- , aTokList( 0x8000, 0x8000 )
{
InitCtor();
}
-/*************************************************************************
-|* SvTokenStream::~SvTokenStream()
-|*
-|* Beschreibung
-*************************************************************************/
SvTokenStream::~SvTokenStream()
{
delete pInStream;
- SvToken * pTok = aTokList.Last();
- while( pTok )
- {
- delete pTok;
- pTok = aTokList.Prev();
- }
}
-/*************************************************************************
-|* SvTokenStream::FillTokenList()
-|*
-|* Beschreibung
-*************************************************************************/
void SvTokenStream::FillTokenList()
{
SvToken * pToken = new SvToken();
- aTokList.Insert( pToken, LIST_APPEND );
+ aTokList.push_back(pToken);
do
{
if( !MakeToken( *pToken ) )
{
- SvToken * p = aTokList.Prev();
- *pToken = SvToken();
- if( p )
+ if (!aTokList.empty())
{
- pToken->SetLine( p->GetLine() );
- pToken->SetColumn( p->GetColumn() );
+ *pToken = SvToken();
+ boost::ptr_vector<SvToken>::const_iterator it = aTokList.begin();
+
+ pToken->SetLine(it->GetLine());
+ pToken->SetColumn(it->GetColumn());
}
break;
}
@@ -231,30 +156,19 @@ void SvTokenStream::FillTokenList()
else
{
pToken = new SvToken();
- aTokList.Insert( pToken, LIST_APPEND );
+ aTokList.push_back(pToken);
}
}
while( !pToken->IsEof() );
- pCurToken = aTokList.First();
+ pCurToken = aTokList.begin();
}
-/*************************************************************************
-|* SvTokenStrem::SetCharSet()
-|*
-|* Beschreibung
-*************************************************************************/
void SvTokenStream::SetCharSet( CharSet nSet )
{
nCharSet = nSet;
-
pCharTab = SvChar::GetTable( nSet, gsl_getSystemTextEncoding() );
}
-/*************************************************************************
-|* SvTokeStream::GetNextChar()
-|*
-|* Beschreibung
-*************************************************************************/
int SvTokenStream::GetNextChar()
{
int nChar;
@@ -279,11 +193,6 @@ int SvTokenStream::GetNextChar()
return nChar;
}
-/*************************************************************************
-|* SvTokenStrem::GetNumber()
-|*
-|* Beschreibung
-*************************************************************************/
sal_uLong SvTokenStream::GetNumber()
{
sal_uLong l = 0;
@@ -322,21 +231,13 @@ sal_uLong SvTokenStream::GetNumber()
return( l );
}
-/*************************************************************************
-|* SvTokenStream::MakeToken()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvTokenStream::MakeToken( SvToken & rToken )
{
- int c1;
- sal_uInt16 i;
-
do
{
if( 0 == c )
c = GetNextChar();
- // Leerzeichen ueberlesen
+ // skip whitespace
while( isspace( c ) || 26 == c )
{
c = GetFastNextChar();
@@ -347,31 +248,26 @@ sal_Bool SvTokenStream::MakeToken( SvToken & rToken )
sal_uLong nLastLine = nLine;
sal_uLong nLastColumn = nColumn;
- // Kommentar
+ // comment
if( '/' == c )
{
- // Zeit Optimierung, keine Kommentare
- //ByteString aComment( (char)c );
- c1 = c;
+ // time optimization, no comments
+ int c1 = c;
c = GetFastNextChar();
if( '/' == c )
{
while( '\0' != c )
{
- //aComment += (char)c;
c = GetFastNextChar();
}
c = GetNextChar();
rToken.nType = SVTOKEN_COMMENT;
- //rToken.aString = aComment;
}
else if( '*' == c )
{
- //aComment += (char)c;
c = GetFastNextChar();
do
{
- //aComment += (char)c;
while( '*' != c )
{
if( '\0' == c )
@@ -382,17 +278,14 @@ sal_Bool SvTokenStream::MakeToken( SvToken & rToken )
}
else
c = GetFastNextChar();
- //aComment += (char)c;
}
c = GetFastNextChar();
}
while( '/' != c && !IsEof() && ( SVSTREAM_OK == rInStream.GetError() ) );
if( IsEof() || ( SVSTREAM_OK != rInStream.GetError() ) )
return sal_False;
- //aComment += (char)c;
c = GetNextChar();
rToken.nType = SVTOKEN_COMMENT;
- //rToken.aString = aComment;
CalcColumn();
}
else
@@ -404,14 +297,13 @@ sal_Bool SvTokenStream::MakeToken( SvToken & rToken )
else if( c == '"' )
{
ByteString aStr;
- i = 0;
sal_Bool bDone = sal_False;
while( !bDone && !IsEof() && c )
{
c = GetFastNextChar();
if( '\0' == c )
{
- // Strings auch "uber das Zeilenende hinauslesen
+ // read strings beyond end of line
aStr += '\n';
c = GetNextChar();
if( IsEof() )
@@ -501,3 +393,4 @@ sal_Bool SvTokenStream::MakeToken( SvToken & rToken )
return rInStream.GetError() == SVSTREAM_OK;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/source/objects/basobj.cxx b/idl/source/objects/basobj.cxx
index 09b9a317e07a..7a284999e6eb 100755..100644
--- a/idl/source/objects/basobj.cxx
+++ b/idl/source/objects/basobj.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,19 +34,12 @@
#include <tools/debug.hxx>
-#include <attrib.hxx>
#include <basobj.hxx>
#include <module.hxx>
#include <globals.hxx>
#include <database.hxx>
-/****************** SvMetaObject *****************************************/
SV_IMPL_META_FACTORY1( SvMetaObject, SvRttiBase )
-/*************************************************************************
-|* SvMetaObject::SvMetaObject()
-|*
-|* Beschreibung
-*************************************************************************/
SvMetaObject::SvMetaObject()
{
}
@@ -58,24 +52,13 @@ void SvMetaObject::Save( SvPersistStream & )
{
}
-/*************************************************************************
-|* SvMetaObject::WriteTab()
-|*
-|* Beschreibung
-*************************************************************************/
#ifdef IDL_COMPILER
void SvMetaObject::WriteTab( SvStream & rOutStm, sal_uInt16 nTab )
{
while( nTab-- )
rOutStm << " ";
-// rOutStm << '\t';
}
-/*************************************************************************
-|* SvMetaObject::WriteStart()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaObject::WriteStars( SvStream & rOutStm )
{
rOutStm << '/';
@@ -84,14 +67,9 @@ void SvMetaObject::WriteStars( SvStream & rOutStm )
rOutStm << '/' << endl;
}
-/*************************************************************************
-|* SvMetaObject::TestAndSeekSpaceOnly()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaObject::TestAndSeekSpaceOnly( SvStream & rOutStm, sal_uLong nBegPos )
{
- // keine leeren Klammern schreiben
+ // write no empty brackets
sal_uLong nPos = rOutStm.Tell();
rOutStm.Seek( nBegPos );
sal_Bool bOnlySpace = sal_True;
@@ -103,21 +81,16 @@ sal_Bool SvMetaObject::TestAndSeekSpaceOnly( SvStream & rOutStm, sal_uLong nBegP
bOnlySpace = sal_False;
}
if( bOnlySpace )
- // nichts geschrieben
+ // nothing written
rOutStm.Seek( nBegPos );
else
rOutStm.Seek( nPos );
return bOnlySpace;
}
-/*************************************************************************
-|* SvMetaObject::Back2Delemitter()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaObject::Back2Delemitter( SvStream & rOutStm )
{
- // keine leeren Klammern schreiben
+ // write no empty brackets
sal_uLong nPos = rOutStm.Tell();
rOutStm.SeekRel( -1 );
char c = 0;
@@ -135,62 +108,31 @@ void SvMetaObject::Back2Delemitter( SvStream & rOutStm )
rOutStm.Seek( nPos );
}
-/*************************************************************************
-|* SvMetaObject::ReadSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaObject::ReadSvIdl( SvIdlDataBase &, SvTokenStream & )
{
return sal_False;
}
-/*************************************************************************
-|* SvMetaObject::WriteSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaObject::WriteSvIdl( SvIdlDataBase &, SvStream &, sal_uInt16 /*nTab */ )
{
}
-/*************************************************************************
-|* SvMetaObject::Write()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaObject::Write( SvIdlDataBase &, SvStream &, sal_uInt16 /*nTab */,
WriteType, WriteAttribute )
{
}
-/*************************************************************************
-|* SvMetaObject::WriteCxx()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaObject::WriteCxx( SvIdlDataBase &, SvStream &, sal_uInt16 /*nTab */ )
{
}
-/*************************************************************************
-|* SvMetaObject::WriteHxx()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaObject::WriteHxx( SvIdlDataBase &, SvStream &, sal_uInt16 /*nTab */ )
{
}
#endif
-/****************** SvMetaName *****************************************/
SV_IMPL_META_FACTORY1( SvMetaName, SvMetaObject );
-/*************************************************************************
-|* SvMetaName::SvMetaName()
-|*
-|* Beschreibung
-*************************************************************************/
SvMetaName::SvMetaName()
{
}
@@ -204,7 +146,7 @@ void SvMetaName::Load( SvPersistStream & rStm )
if( nMask >= 0x20 )
{
rStm.SetError( SVSTREAM_FILEFORMAT_ERROR );
- DBG_ERROR( "wrong format" );
+ OSL_FAIL( "wrong format" );
return;
}
if( nMask & 0x01 ) rStm >> aName;
@@ -232,11 +174,6 @@ void SvMetaName::Save( SvPersistStream & rStm )
if( nMask & 0x10 ) rStm << aDescription;
}
-/*************************************************************************
-|*
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaName::SetName( const ByteString & rName, SvIdlDataBase * )
{
aName = rName;
@@ -244,18 +181,13 @@ sal_Bool SvMetaName::SetName( const ByteString & rName, SvIdlDataBase * )
}
#ifdef IDL_COMPILER
-/*************************************************************************
-|* SvMetaName::ReadNameSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaName::ReadNameSvIdl( SvIdlDataBase & rBase,
SvTokenStream & rInStm )
{
sal_uInt32 nTokPos = rInStm.Tell();
SvToken * pTok = rInStm.GetToken_Next();
- // Modulnamen lesen
+ // read module name
if( pTok->IsIdentifier() )
if( SetName( pTok->GetString(), &rBase ) )
return sal_True;
@@ -264,11 +196,6 @@ sal_Bool SvMetaName::ReadNameSvIdl( SvIdlDataBase & rBase,
return sal_False;
}
-/*************************************************************************
-|* SvMetaName::ReadSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaName::ReadAttributesSvIdl( SvIdlDataBase & rBase,
SvTokenStream & rInStm )
{
@@ -282,21 +209,12 @@ void SvMetaName::ReadAttributesSvIdl( SvIdlDataBase & rBase,
aHelpText.ReadSvIdl( rBase, rInStm );
aConfigName.ReadSvIdl( SvHash_ConfigName(), rInStm );
aDescription.ReadSvIdl( SvHash_Description(), rInStm );
-/*
- aHelpContext.ReadSvIdl( GetModule()->GetInfo()->GetHelpContextContainer(),
- rInStm );
-*/
}
-/*************************************************************************
-|* SvMetaName::DoReadContextSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaName::DoReadContextSvIdl( SvIdlDataBase & rBase,
SvTokenStream & rInStm, char cDel )
{
- sal_uInt32 nBeginPos = 0; // kann mit Tell nicht vorkommen
+ sal_uInt32 nBeginPos = 0; // can not happen with Tell
while( nBeginPos != rInStm.Tell() )
{
nBeginPos = rInStm.Tell();
@@ -308,39 +226,19 @@ void SvMetaName::DoReadContextSvIdl( SvIdlDataBase & rBase,
}
}
-/*************************************************************************
-|* SvMetaName::ReadSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaName::ReadContextSvIdl( SvIdlDataBase &, SvTokenStream & )
{
}
-/*************************************************************************
-|* SvMetaName::Test()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaName::Test( SvIdlDataBase &, SvTokenStream & )
{
return sal_True;
}
-/*************************************************************************
-|* SvMetaName::WriteContextSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaName::WriteContextSvIdl( SvIdlDataBase &, SvStream &, sal_uInt16 )
{
}
-/*************************************************************************
-|* SvMetaName::WriteDescription()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaName::WriteDescription( SvStream & rOutStm )
{
rOutStm << "<DESCRIPTION>" << endl;
@@ -357,11 +255,6 @@ void SvMetaName::WriteDescription( SvStream & rOutStm )
rOutStm << aDesc.GetBuffer() << endl << "</DESCRIPTION>" << endl;
}
-/*************************************************************************
-|* SvMetaName::WriteAttributesIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaName::WriteAttributesSvIdl( SvIdlDataBase & rBase,
SvStream & rOutStm,
sal_uInt16 nTab )
@@ -391,18 +284,13 @@ void SvMetaName::WriteAttributesSvIdl( SvIdlDataBase & rBase,
}
}
-/*************************************************************************
-|* SvMetaName::ReadSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaName::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
{
sal_uInt32 nTokPos = rInStm.Tell();
sal_Bool bOk = sal_True;
if( rInStm.Read( '[' ) )
{
- sal_uInt32 nBeginPos = 0; // kann mit Tell nicht vorkommen
+ sal_uInt32 nBeginPos = 0; // can not happen with Tell
while( nBeginPos != rInStm.Tell() )
{
nBeginPos = rInStm.Tell();
@@ -426,11 +314,6 @@ sal_Bool SvMetaName::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
return bOk;
}
-/*************************************************************************
-|* SvMetaName::WriteSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaName::WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm,
sal_uInt16 nTab )
{
@@ -440,9 +323,9 @@ void SvMetaName::WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm,
sal_uLong nOldPos = rOutStm.Tell();
WriteAttributesSvIdl( rBase, rOutStm, nTab +1 );
- // keine leeren Klammern schreiben
+ // write no empty brackets
if( TestAndSeekSpaceOnly( rOutStm, nOldPos ) )
- // nichts geschrieben
+ // nothing written
rOutStm.Seek( nBeginPos );
else
{
@@ -457,9 +340,9 @@ void SvMetaName::WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm,
nOldPos = rOutStm.Tell();
WriteContextSvIdl( rBase, rOutStm, nTab +1 );
- // keine leeren Klammern schreiben
+ // write no empty brackets
if( TestAndSeekSpaceOnly( rOutStm, nOldPos ) )
- // nichts geschrieben
+ // nothing written
rOutStm.Seek( nBeginPos );
else
{
@@ -468,11 +351,6 @@ void SvMetaName::WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm,
}
}
-/*************************************************************************
-|* SvMetaName::Write()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaName::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
sal_uInt16 nTab,
WriteType nT, WriteAttribute nA )
@@ -483,7 +361,7 @@ void SvMetaName::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
sal_uLong nOldPos = rOutStm.Tell();
WriteAttributes( rBase, rOutStm, nTab +1, nT, nA );
- // keine leeren Klammern schreiben
+ // write no empty brackets
sal_uLong nPos = rOutStm.Tell();
rOutStm.Seek( nOldPos );
sal_Bool bOnlySpace = sal_True;
@@ -495,7 +373,7 @@ void SvMetaName::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
bOnlySpace = sal_False;
}
if( bOnlySpace )
- // nichts geschrieben
+ // nothing written
rOutStm.Seek( nBeginPos );
else
{
@@ -505,11 +383,6 @@ void SvMetaName::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
}
}
-/*************************************************************************
-|* SvMetaName::WriteAttributes()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaName::WriteAttributes( SvIdlDataBase &, SvStream & rOutStm,
sal_uInt16 nTab,
WriteType, WriteAttribute )
@@ -534,11 +407,6 @@ void SvMetaName::WriteAttributes( SvIdlDataBase &, SvStream & rOutStm,
}
}
-/*************************************************************************
-|* SvMetaName::WriteContext()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaName::WriteContext( SvIdlDataBase &, SvStream &,
sal_uInt16,
WriteType, WriteAttribute )
@@ -546,14 +414,8 @@ void SvMetaName::WriteContext( SvIdlDataBase &, SvStream &,
}
#endif // IDL_COMPILER
-/****************** SvMetaReference *****************************************/
SV_IMPL_META_FACTORY1( SvMetaReference, SvMetaName );
-/*************************************************************************
-|* SvMetaReference::SvMetaReference()
-|*
-|* Beschreibung
-*************************************************************************/
SvMetaReference::SvMetaReference()
{
}
@@ -567,7 +429,7 @@ void SvMetaReference::Load( SvPersistStream & rStm )
if( nMask >= 0x2 )
{
rStm.SetError( SVSTREAM_FILEFORMAT_ERROR );
- DBG_ERROR( "wrong format" );
+ OSL_FAIL( "wrong format" );
return;
}
if( nMask & 0x01 )
@@ -582,25 +444,18 @@ void SvMetaReference::Save( SvPersistStream & rStm )
{
SvMetaName::Save( rStm );
- // Maske erstellen
+ // create mask
sal_uInt8 nMask = 0;
if( aRef.Is() )
nMask |= 0x01;
- // Daten schreiben
+ // write data
rStm << nMask;
if( nMask & 0x01 ) rStm << aRef;
}
-/**************************************************************************/
-/****************** SvMetaExtern ******************************************/
SV_IMPL_META_FACTORY1( SvMetaExtern, SvMetaReference );
-/*************************************************************************
-|* SvMetaExtern::SvMetaExtern()
-|*
-|* Beschreibung
-*************************************************************************/
SvMetaExtern::SvMetaExtern()
: pModule( NULL )
, bReadUUId( sal_False )
@@ -617,7 +472,7 @@ void SvMetaExtern::Load( SvPersistStream & rStm )
if( nMask >= 0x20 )
{
rStm.SetError( SVSTREAM_FILEFORMAT_ERROR );
- DBG_ERROR( "wrong format" );
+ OSL_FAIL( "wrong format" );
return;
}
if( nMask & 0x01 ) rStm >> pModule;
@@ -631,7 +486,7 @@ void SvMetaExtern::Save( SvPersistStream & rStm )
{
SvMetaReference::Save( rStm );
- // Maske erstellen
+ // create mask
sal_uInt8 nMask = 0;
if( pModule ) nMask |= 0x01;
if( aUUId != SvGlobalName() ) nMask |= 0x02;
@@ -639,29 +494,19 @@ void SvMetaExtern::Save( SvPersistStream & rStm )
if( bReadUUId ) nMask |= 0x08;
if( bReadVersion ) nMask |= 0x10;
- // Daten schreiben
+ // write data
rStm << nMask;
if( nMask & 0x01 ) rStm << pModule;
if( nMask & 0x02 ) rStm << aUUId;
if( nMask & 0x04 ) rStm << aVersion;
}
-/*************************************************************************
-|* SvMetaExtern::GetModule()
-|*
-|* Beschreibung
-*************************************************************************/
SvMetaModule * SvMetaExtern::GetModule() const
{
DBG_ASSERT( pModule != NULL, "module not set" );
return pModule;
}
-/*************************************************************************
-|* SvMetaExtern::GetUUId()
-|*
-|* Beschreibung
-*************************************************************************/
const SvGlobalName & SvMetaExtern::GetUUId() const
{
#ifdef IDL_COMPILER
@@ -672,21 +517,11 @@ const SvGlobalName & SvMetaExtern::GetUUId() const
}
#ifdef IDL_COMPILER
-/*************************************************************************
-|* SvMetaExtern::SetModule()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaExtern::SetModule( SvIdlDataBase & rBase )
{
pModule = (SvMetaModule *)rBase.GetStack().Get( TYPE( SvMetaModule ) );
}
-/*************************************************************************
-|* SvMetaExtern::ReadAttributesSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaExtern::ReadAttributesSvIdl( SvIdlDataBase & rBase,
SvTokenStream & rInStm )
{
@@ -697,11 +532,6 @@ void SvMetaExtern::ReadAttributesSvIdl( SvIdlDataBase & rBase,
bReadVersion = sal_True;
}
-/*************************************************************************
-|* SvMetaExtern::WriteAttributesSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaExtern::WriteAttributesSvIdl( SvIdlDataBase & rBase,
SvStream & rOutStm, sal_uInt16 nTab )
{
@@ -726,34 +556,19 @@ void SvMetaExtern::WriteAttributesSvIdl( SvIdlDataBase & rBase,
}
}
-/*************************************************************************
-|* SvMetaExtern::ReadSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaExtern::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
{
SetModule( rBase );
- GetUUId(); // Id wird angelegt
+ GetUUId(); // id gets created
return SvMetaReference::ReadSvIdl( rBase, rInStm );
}
-/*************************************************************************
-|* SvMetaExtern::WriteSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaExtern::WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm,
sal_uInt16 nTab )
{
SvMetaReference::WriteSvIdl( rBase, rOutStm, nTab );
}
-/*************************************************************************
-|* SvMetaExtern::Write()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaExtern::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
sal_uInt16 nTab,
WriteType nT, WriteAttribute nA )
@@ -761,11 +576,6 @@ void SvMetaExtern::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
SvMetaReference::Write( rBase, rOutStm, nTab, nT, nA );
}
-/*************************************************************************
-|* SvMetaExtern::WriteAttributes()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaExtern::WriteAttributes( SvIdlDataBase & rBase, SvStream & rOutStm,
sal_uInt16 nTab,
WriteType nT, WriteAttribute nA )
@@ -784,3 +594,4 @@ void SvMetaExtern::WriteAttributes( SvIdlDataBase & rBase, SvStream & rOutStm,
#endif // IDL_COMPILER
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/source/objects/bastype.cxx b/idl/source/objects/bastype.cxx
index 19df1c0967b2..5556da3ad4b5 100755..100644
--- a/idl/source/objects/bastype.cxx
+++ b/idl/source/objects/bastype.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,7 +40,6 @@
#include <database.hxx>
#ifdef IDL_COMPILER
-/************************************************************************/
static sal_Bool ReadRangeSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm,
sal_uLong nMin, sal_uLong nMax, sal_uLong* pValue )
{
@@ -71,16 +71,6 @@ static sal_Bool ReadRangeSvIdl( SvStringHashEntry * pName, SvTokenStream & rInSt
}
#endif
-/*************************************************************************
-|*
-|* SvUINT32::Read()
-|* SvUINT32::Write()
-|*
-|* Beschreibung
-|* Ersterstellung MM 12.12.94
-|* Letzte Aenderung MM 12.12.94
-|*
-*************************************************************************/
sal_uInt32 SvUINT32::Read( SvStream & rStm )
{
return SvPersistStream::ReadCompressed( rStm );
@@ -91,16 +81,6 @@ void SvUINT32::Write( SvStream & rStm, sal_uInt32 nVal )
SvPersistStream::WriteCompressed( rStm, nVal );
}
-/*************************************************************************
-|*
-|* SvStream& operator << ( SvBOOL )
-|* SvStream& operator >> ( SvBOOL )
-|*
-|* Beschreibung
-|* Ersterstellung MM 12.12.94
-|* Letzte Aenderung MM 12.12.94
-|*
-*************************************************************************/
SvStream& operator << (SvStream & rStm, const SvBOOL & rb )
{
sal_uInt8 n = rb.nVal;
@@ -118,28 +98,18 @@ SvStream& operator >> (SvStream & rStm, SvBOOL & rb )
if( n & ~0x03 )
{
rStm.SetError( SVSTREAM_FILEFORMAT_ERROR );
- DBG_ERROR( "format error" );
+ OSL_FAIL( "format error" );
}
return rStm;
}
-/*************************************************************************
-|*
-|* SvStream& operator << ( SvVersion )
-|* SvStream& operator >> ( SvVersion )
-|*
-|* Beschreibung
-|* Ersterstellung MM 12.12.94
-|* Letzte Aenderung MM 12.12.94
-|*
-*************************************************************************/
SvStream& operator << (SvStream & rStm, const SvVersion & r )
{
if( (r.GetMajorVersion() || r.GetMinorVersion())
&& r.GetMajorVersion() <= 0x0F && r.GetMinorVersion() <= 0x0F )
- { // Versionsnummer in 1 Byte komprimieren
- // Format 4 Bit fuer Major, dann 4 Bit fuer Minor.
- // 0.0 wird nicht komprimiert
+ { // compress version number in 1 byte
+ // format first 4 bit for major, then 4 bit for minor
+ // 0.0 gets not compressed
int n = r.GetMajorVersion() << 4;
n |= r.GetMinorVersion();
@@ -159,12 +129,12 @@ SvStream& operator >> (SvStream & rStm, SvVersion & r )
sal_uInt8 n;
rStm >> n;
if( n == 0 )
- { // nicht komprimiert
+ { // not compressed
rStm >> r.nMajorVersion;
rStm >> r.nMinorVersion;
}
else
- { // komprimiert
+ { // compressed
r.nMajorVersion = (n >> 4) & 0x0F;
r.nMinorVersion = n & 0x0F;
}
@@ -173,17 +143,6 @@ SvStream& operator >> (SvStream & rStm, SvVersion & r )
#ifdef IDL_COMPILER
-/************************************************************************/
-
-/*************************************************************************
-|*
-|* SvBOOL::ReadSvIdl()
-|*
-|* Beschreibung
-|* Ersterstellung MM 12.12.94
-|* Letzte Aenderung MM 12.12.94
-|*
-*************************************************************************/
sal_Bool SvBOOL::ReadSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm )
{
sal_uInt32 nTokPos = rInStm.Tell();
@@ -206,7 +165,7 @@ sal_Bool SvBOOL::ReadSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm )
bOk = rInStm.Read( ')' );
}
else
- *this = sal_True; //Defaultaktion ist auf sal_True setzen
+ *this = sal_True; //default action set to TRUE
if( bOk )
return sal_True;
}
@@ -214,13 +173,6 @@ sal_Bool SvBOOL::ReadSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm )
return sal_False;
}
-/*************************************************************************
-|*
-|* SvBOOL::WriteSvIdl()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
sal_Bool SvBOOL::WriteSvIdl( SvStringHashEntry * pName, SvStream & rOutStm )
{
if( nVal )
@@ -230,13 +182,6 @@ sal_Bool SvBOOL::WriteSvIdl( SvStringHashEntry * pName, SvStream & rOutStm )
return sal_True;
}
-/*************************************************************************
-|*
-|* SvBOOL::WriteSvIdl()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
ByteString SvBOOL::GetSvIdlString( SvStringHashEntry * pName )
{
if( nVal )
@@ -250,14 +195,6 @@ ByteString SvBOOL::GetSvIdlString( SvStringHashEntry * pName )
}
-/************************************************************************/
-/*************************************************************************
-|*
-|* SvIdentifier::ReadSvIdl()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
sal_Bool SvIdentifier::ReadSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm )
{
sal_uInt32 nTokPos = rInStm.Tell();
@@ -285,13 +222,6 @@ sal_Bool SvIdentifier::ReadSvIdl( SvStringHashEntry * pName, SvTokenStream & rIn
return sal_False;
}
-/*************************************************************************
-|*
-|* SvIdentifier::WriteSvIdl()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
sal_Bool SvIdentifier::WriteSvIdl( SvStringHashEntry * pName,
SvStream & rOutStm,
sal_uInt16 /*nTab */ )
@@ -314,14 +244,6 @@ SvStream& operator >> (SvStream & rStm, SvIdentifier & r )
}
-/************************************************************************/
-/*************************************************************************
-|*
-|* SvNumberIdentifier::ReadSvIdl()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
sal_Bool SvNumberIdentifier::ReadSvIdl( SvIdlDataBase & rBase,
SvStringHashEntry * pName,
SvTokenStream & rInStm )
@@ -346,13 +268,6 @@ sal_Bool SvNumberIdentifier::ReadSvIdl( SvIdlDataBase & rBase,
return sal_False;
}
-/*************************************************************************
-|*
-|* SvNumberIdentifier::ReadSvIdl()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
sal_Bool SvNumberIdentifier::ReadSvIdl( SvIdlDataBase & rBase,
SvTokenStream & rInStm )
{
@@ -381,16 +296,6 @@ sal_Bool SvNumberIdentifier::ReadSvIdl( SvIdlDataBase & rBase,
return sal_False;
}
-/*************************************************************************
-|*
-|* SvStream& operator << ( SvNumberIdentifier )
-|* SvStream& operator >> ( SvNumberIdentifier )
-|*
-|* Beschreibung
-|* Ersterstellung MM 12.12.94
-|* Letzte Aenderung MM 12.12.94
-|*
-*************************************************************************/
SvStream& operator << (SvStream & rStm, const SvNumberIdentifier & r )
{
rStm << (SvIdentifier &)r;
@@ -406,16 +311,6 @@ SvStream& operator >> (SvStream & rStm, SvNumberIdentifier & r )
}
-/************************************************************************/
-/*************************************************************************
-|*
-|* SvString::ReadSvIdl()
-|*
-|* Beschreibung
-|* Ersterstellung MM 12.12.94
-|* Letzte Aenderung MM 12.12.94
-|*
-*************************************************************************/
sal_Bool SvString::ReadSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm )
{
sal_uInt32 nTokPos = rInStm.Tell();
@@ -443,15 +338,6 @@ sal_Bool SvString::ReadSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm
return sal_False;
}
-/*************************************************************************
-|*
-|* SvString::WriteSvIdl()
-|*
-|* Beschreibung
-|* Ersterstellung MM 12.12.94
-|* Letzte Aenderung MM 12.12.94
-|*
-*************************************************************************/
sal_Bool SvString::WriteSvIdl( SvStringHashEntry * pName, SvStream & rOutStm,
sal_uInt16 /*nTab */ )
{
@@ -473,44 +359,16 @@ SvStream& operator >> (SvStream & rStm, SvString & r )
}
-/*************************************************************************
-|*
-|* SvHelpText::ReadSvIdl()
-|*
-|* Beschreibung
-|* Ersterstellung MM 12.12.94
-|* Letzte Aenderung MM 12.12.94
-|*
-*************************************************************************/
sal_Bool SvHelpText::ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm )
{
return SvString::ReadSvIdl( SvHash_HelpText(), rInStm );
}
-/*************************************************************************
-|*
-|* SvHelpText::WriteSvIdl()
-|*
-|* Beschreibung
-|* Ersterstellung MM 12.12.94
-|* Letzte Aenderung MM 12.12.94
-|*
-*************************************************************************/
sal_Bool SvHelpText::WriteSvIdl( SvIdlDataBase &, SvStream & rOutStm, sal_uInt16 nTab )
{
return SvString::WriteSvIdl( SvHash_HelpText(), rOutStm, nTab );
}
-/************************************************************************/
-/*************************************************************************
-|*
-|* SvUUId::ReadSvIdl()
-|*
-|* Beschreibung
-|* Ersterstellung MM 12.12.94
-|* Letzte Aenderung MM 12.12.94
-|*
-*************************************************************************/
sal_Bool SvUUId::ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm )
{
sal_uInt32 nTokPos = rInStm.Tell();
@@ -538,34 +396,15 @@ sal_Bool SvUUId::ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm )
return sal_False;
}
-/*************************************************************************
-|*
-|* SvMetaObject::WriteSvIdl()
-|*
-|* Beschreibung
-|* Ersterstellung MM 12.12.94
-|* Letzte Aenderung MM 12.12.94
-|*
-*************************************************************************/
sal_Bool SvUUId::WriteSvIdl( SvStream & rOutStm )
{
- // Global Id schreiben
+ // write global id
rOutStm << SvHash_uuid()->GetName().GetBuffer() << "(\"";
rOutStm << ByteString( GetHexName(), RTL_TEXTENCODING_UTF8 ).GetBuffer() << "\")";
return sal_True;
}
-/************************************************************************/
-/*************************************************************************
-|*
-|* SvVersion::ReadSvIdl()
-|*
-|* Beschreibung
-|* Ersterstellung MM 12.12.94
-|* Letzte Aenderung MM 12.12.94
-|*
-*************************************************************************/
sal_Bool SvVersion::ReadSvIdl( SvTokenStream & rInStm )
{
sal_uLong n = 0;
@@ -590,15 +429,6 @@ sal_Bool SvVersion::ReadSvIdl( SvTokenStream & rInStm )
return sal_False;
}
-/*************************************************************************
-|*
-|* SvVersion::WriteSvIdl()
-|*
-|* Beschreibung
-|* Ersterstellung MM 12.12.94
-|* Letzte Aenderung MM 12.12.94
-|*
-*************************************************************************/
sal_Bool SvVersion::WriteSvIdl( SvStream & rOutStm )
{
rOutStm << SvHash_Version()->GetName().GetBuffer() << '('
@@ -609,3 +439,4 @@ sal_Bool SvVersion::WriteSvIdl( SvStream & rOutStm )
#endif //IDL_COMPILER
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/source/objects/module.cxx b/idl/source/objects/module.cxx
index f8d68dabbbf6..1ee58edc41ff 100755..100644
--- a/idl/source/objects/module.cxx
+++ b/idl/source/objects/module.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,25 +32,14 @@
#include <ctype.h>
#include <stdio.h>
-#include <attrib.hxx>
#include <module.hxx>
#include <globals.hxx>
#include <database.hxx>
#include <tools/fsys.hxx>
#include <tools/debug.hxx>
-/****************** SvMetaModule ******************************************/
SV_IMPL_META_FACTORY1( SvMetaModule, SvMetaExtern );
-/*************************************************************************
-|*
-|* SvMetaModule::SvMetaModule()
-|*
-|* Beschreibung
-|* Ersterstellung MM 12.12.94
-|* Letzte Aenderung MM 12.12.94
-|*
-*************************************************************************/
SvMetaModule::SvMetaModule()
#ifdef IDL_COMPILER
: bImported( sal_False )
@@ -66,36 +56,27 @@ SvMetaModule::SvMetaModule( const String & rIdlFileName, sal_Bool bImp )
}
#endif
-/*************************************************************************
-|*
-|* SvMetaModule::Load()
-|*
-|* Beschreibung
-|* Ersterstellung MM 12.12.94
-|* Letzte Aenderung MM 12.12.94
-|*
-*************************************************************************/
#define MODULE_VER 0x0001
void SvMetaModule::Load( SvPersistStream & rStm )
{
- bImported = sal_True; // immer importiert
+ bImported = sal_True; // import always
SvMetaExtern::Load( rStm );
sal_uInt16 nVer;
- rStm >> nVer; // Version
+ rStm >> nVer; // version
DBG_ASSERT( (nVer & ~IDL_WRITE_MASK) == MODULE_VER, "false version" );
rStm >> aClassList;
rStm >> aTypeList;
rStm >> aAttrList;
- // Browser
+ // browser
rStm.ReadByteString( aIdlFileName );
rStm.ReadByteString( aHelpFileName );
rStm.ReadByteString( aSlotIdFile );
rStm.ReadByteString( aModulePrefix );
- // Compiler Daten lesen
+ // read compiler data
sal_uInt16 nCmpLen;
rStm >> nCmpLen;
#ifdef IDL_COMPILER
@@ -109,15 +90,6 @@ void SvMetaModule::Load( SvPersistStream & rStm )
#endif
}
-/*************************************************************************
-|*
-|* SvMetaModule::Save()
-|*
-|* Beschreibung
-|* Ersterstellung MM 12.12.94
-|* Letzte Aenderung MM 12.12.94
-|*
-*************************************************************************/
void SvMetaModule::Save( SvPersistStream & rStm )
{
SvMetaExtern::Save( rStm );
@@ -127,13 +99,13 @@ void SvMetaModule::Save( SvPersistStream & rStm )
rStm << aClassList;
rStm << aTypeList;
rStm << aAttrList;
- // Browser
+ // browser
rStm.WriteByteString( aIdlFileName );
rStm.WriteByteString( aHelpFileName );
rStm.WriteByteString( aSlotIdFile );
rStm.WriteByteString( aModulePrefix );
- // Compiler Daten schreiben
+ // write compiler data
sal_uInt16 nCmpLen = 0;
sal_uLong nLenPos = rStm.Tell();
rStm << nCmpLen;
@@ -141,7 +113,7 @@ void SvMetaModule::Save( SvPersistStream & rStm )
rStm << aBeginName;
rStm << aEndName;
rStm << aNextName;
- // Laenge der Compiler Daten schreiben
+ // write length of compiler data
sal_uLong nPos = rStm.Tell();
rStm.Seek( nLenPos );
rStm << (sal_uInt16)( nPos - nLenPos - sizeof( sal_uInt16 ) );
@@ -149,15 +121,6 @@ void SvMetaModule::Save( SvPersistStream & rStm )
#endif
}
-/*************************************************************************
-|*
-|* SvMetaModule::SetName()
-|*
-|* Beschreibung
-|* Ersterstellung MM 12.12.94
-|* Letzte Aenderung MM 12.12.94
-|*
-*************************************************************************/
sal_Bool SvMetaModule::SetName( const ByteString & rName, SvIdlDataBase * pBase )
{
if( pBase )
@@ -169,11 +132,6 @@ sal_Bool SvMetaModule::SetName( const ByteString & rName, SvIdlDataBase * pBase
}
#ifdef IDL_COMPILER
-/*************************************************************************
-|* SvMetaModule::GetNextName()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaModule::FillNextName( SvGlobalName * pName )
{
*pName = aNextName;
@@ -187,11 +145,6 @@ sal_Bool SvMetaModule::FillNextName( SvGlobalName * pName )
return sal_False;
}
-/*************************************************************************
-|* SvMetaModule::ReadSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaModule::ReadAttributesSvIdl( SvIdlDataBase & rBase,
SvTokenStream & rInStm )
{
@@ -215,11 +168,6 @@ void SvMetaModule::ReadAttributesSvIdl( SvIdlDataBase & rBase,
aModulePrefix.ReadSvIdl( SvHash_ModulePrefix(), rInStm );
}
-/*************************************************************************
-|* SvMetaModule::WriteAttributesSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaModule::WriteAttributesSvIdl( SvIdlDataBase & rBase,
SvStream & rOutStm,
sal_uInt16 nTab )
@@ -248,11 +196,6 @@ void SvMetaModule::WriteAttributesSvIdl( SvIdlDataBase & rBase,
}
}
-/*************************************************************************
-|* SvMetaModule::ReadContextSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaModule::ReadContextSvIdl( SvIdlDataBase & rBase,
SvTokenStream & rInStm )
{
@@ -264,7 +207,7 @@ void SvMetaModule::ReadContextSvIdl( SvIdlDataBase & rBase,
if( aClass->ReadSvIdl( rBase, rInStm ) )
{
aClassList.Append( aClass );
- // Global bekanntgeben
+ // announce globally
rBase.GetClassList().Append( aClass );
}
}
@@ -274,9 +217,9 @@ void SvMetaModule::ReadContextSvIdl( SvIdlDataBase & rBase,
if( aEnum->ReadSvIdl( rBase, rInStm ) )
{
- // Im Modul deklariert
+ // declared in module
aTypeList.Append( aEnum );
- // Global bekanntgeben
+ // announce globally
rBase.GetTypeList().Append( aEnum );
}
}
@@ -288,9 +231,9 @@ void SvMetaModule::ReadContextSvIdl( SvIdlDataBase & rBase,
if( xItem->ReadSvIdl( rBase, rInStm ) )
{
- // Im Modul deklariert
+ // declared in module
aTypeList.Append( xItem );
- // Global bekanntgeben
+ // announce globally
rBase.GetTypeList().Append( xItem );
}
}
@@ -308,12 +251,12 @@ void SvMetaModule::ReadContextSvIdl( SvIdlDataBase & rBase,
SvTokenStream aTokStm( aFullName.GetFull() );
if( SVSTREAM_OK == aTokStm.GetStream().GetError() )
{
- // Fehler aus alter Datei retten
+ // rescue error from old file
SvIdlError aOldErr = rBase.GetError();
- // Fehler zuruecksetzen
+ // reset error
rBase.SetError( SvIdlError() );
- sal_uInt32 nBeginPos = 0xFFFFFFFF; // kann mit Tell nicht vorkommen
+ sal_uInt32 nBeginPos = 0xFFFFFFFF; // can not happen with Tell
while( nBeginPos != aTokStm.Tell() )
{
nBeginPos = aTokStm.Tell();
@@ -325,7 +268,7 @@ void SvMetaModule::ReadContextSvIdl( SvIdlDataBase & rBase,
{
rBase.WriteError( aTokStm );
}
- // Fehler aus alter Datei wieder herstellen
+ // recover error from old file
rBase.SetError( aOldErr );
}
else
@@ -353,20 +296,15 @@ void SvMetaModule::ReadContextSvIdl( SvIdlDataBase & rBase,
{
if( xSlot->Test( rBase, rInStm ) )
{
- // Im Modul deklariert
+ // declared in module
aAttrList.Append( xSlot );
- // Global bekanntgeben
+ // announce globally
rBase.AppendAttr( xSlot );
}
}
}
}
-/*************************************************************************
-|* SvMetaModule::WriteContextSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaModule::WriteContextSvIdl( SvIdlDataBase & rBase,
SvStream & rOutStm,
sal_uInt16 nTab )
@@ -392,16 +330,9 @@ void SvMetaModule::WriteContextSvIdl( SvIdlDataBase & rBase,
}
}
-/*************************************************************************
-|*
-|* SvMetaModule::ReadSvIdl()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
sal_Bool SvMetaModule::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
{
- bIsModified = sal_True; // bisher immer wenn Compiler laueft
+ bIsModified = sal_True; // up to now always when compiler running
sal_uInt32 nTokPos = rInStm.Tell();
SvToken * pTok = rInStm.GetToken_Next();
@@ -425,28 +356,21 @@ sal_Bool SvMetaModule::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm
{
aNextName = aBeginName;
- rBase.Push( this ); // auf den Context Stack
+ rBase.Push( this ); // onto the context stack
if( ReadNameSvIdl( rBase, rInStm ) )
{
- // Zeiger auf sich selbst setzen
+ // set pointer to itself
SetModule( rBase );
bOk = SvMetaName::ReadSvIdl( rBase, rInStm );
}
- rBase.GetStack().Pop(); // und runter
+ rBase.GetStack().Pop(); // remove from stack
}
if( !bOk )
rInStm.Seek( nTokPos );
return bOk;
}
-/*************************************************************************
-|*
-|* SvMetaModule::WriteSvIdl()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
void SvMetaModule::WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm,
sal_uInt16 nTab )
{
@@ -459,9 +383,6 @@ void SvMetaModule::WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm,
SvMetaExtern::WriteSvIdl( rBase, rOutStm, nTab );
}
-/*************************************************************************
-|* SvMetaModule::WriteSfx()
-*************************************************************************/
void SvMetaModule::WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm )
{
for( sal_uLong n = 0; n < aClassList.Count(); n++ )
@@ -481,9 +402,6 @@ void SvMetaModule::WriteHelpIds( SvIdlDataBase & rBase, SvStream & rOutStm,
}
}
-/*************************************************************************
-|* SvMetaModule::WriteAttributes()
-*************************************************************************/
void SvMetaModule::WriteAttributes( SvIdlDataBase & rBase,
SvStream & rOutStm,
sal_uInt16 nTab,
@@ -499,31 +417,6 @@ void SvMetaModule::WriteAttributes( SvIdlDataBase & rBase,
}
}
-/*************************************************************************
-|* SvMetaModule::WriteSbx()
-*************************************************************************/
-/*
-void SvMetaModule::WriteSbx( SvIdlDataBase & rBase, SvStream & rOutStm,
- SvNamePosList & rList )
-{
- for( sal_uLong n = 0; n < aClassList.Count(); n++ )
- {
- SvMetaClass * pClass = aClassList.GetObject( n );
- if( !pClass->IsShell() && pClass->GetAutomation() )
- {
- rList.Insert( new SvNamePos( pClass->GetUUId(), rOutStm.Tell() ),
- LIST_APPEND );
- SbxObjectRef xSbxObj = new SbxObject( pClass->GetName() );
- pClass->FillSbxObject( rBase, xSbxObj );
- xSbxObj->Store( rOutStm );
- }
- }
-}
- */
-
-/*************************************************************************
-|* SvMetaModule::Write()
-*************************************************************************/
void SvMetaModule::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
sal_uInt16 nTab,
WriteType nT, WriteAttribute nA )
@@ -546,27 +439,6 @@ void SvMetaModule::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
WriteTab( rOutStm, nTab );
rOutStm << "importlib(\"STDOLE.TLB\");" << endl;
- /*
- for( sal_uLong n = 0; n < aTypeList.Count(); n++ )
- {
- SvMetaType * pType = aTypeList.GetObject( n );
- if( !pType ->Write( rBase, rOutStm, nTab +1, nT, nA ) )
- return sal_False;
- }
- */
- /*
- for( sal_uLong n = 0; n < rBase.GetModuleList().Count(); n++ )
- {
- SvMetaModule * pModule = rBase.GetModuleList().GetObject( n );
- const SvMetaTypeMemberList &rTypeList = pModule->GetTypeList();
- for( sal_uLong n = 0; n < rTypeList.Count(); n++ )
- {
- SvMetaType * pType = rTypeList.GetObject( n );
- pType->Write( rBase, rOutStm, nTab +1, nT, nA );
- }
- }
- */
-
for( sal_uLong n = 0; n < aClassList.Count(); n++ )
{
SvMetaClass * pClass = aClassList.GetObject( n );
@@ -601,7 +473,7 @@ void SvMetaModule::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
if( pSC )
rOutStm << " : " << pSC->GetName().GetBuffer();
- // Importierte Klassen
+ // imported classes
const SvClassElementMemberList& rClassList = pClass->GetClassList();
if ( rClassList.Count() )
{
@@ -623,7 +495,7 @@ void SvMetaModule::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
}
}
rOutStm << "</CLASSES>" << endl << endl;
- // kein Break!
+ // no break!
}
case WRITE_C_SOURCE:
@@ -632,7 +504,7 @@ void SvMetaModule::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
for( sal_uLong n = 0; n < aClassList.Count(); n++ )
{
SvMetaClass * pClass = aClassList.GetObject( n );
- if( !pClass->IsShell() /* && pClass->GetAutomation() */ )
+ if( !pClass->IsShell() )
pClass->Write( rBase, rOutStm, nTab, nT, nA );
}
}
@@ -643,13 +515,9 @@ void SvMetaModule::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
}
}
-/*************************************************************************
-|* SvMetaModule::WriteSrc()
-*************************************************************************/
void SvMetaModule::WriteSrc( SvIdlDataBase & rBase, SvStream & rOutStm,
Table * pTable )
{
-// rOutStm << "#pragma CHARSET IBMPC" << endl;
if( aSlotIdFile.Len() )
rOutStm << "//#include <" << aSlotIdFile.GetBuffer() << '>' << endl;
for( sal_uLong n = 0; n < aClassList.Count(); n++ )
@@ -658,9 +526,6 @@ void SvMetaModule::WriteSrc( SvIdlDataBase & rBase, SvStream & rOutStm,
}
}
-/*************************************************************************
-|* SvMetaModule::WriteHxx()
-*************************************************************************/
void SvMetaModule::WriteHxx( SvIdlDataBase & rBase, SvStream & rOutStm,
sal_uInt16 nTab )
{
@@ -671,9 +536,6 @@ void SvMetaModule::WriteHxx( SvIdlDataBase & rBase, SvStream & rOutStm,
}
}
-/*************************************************************************
-|* SvMetaModule::WriteCxx()
-*************************************************************************/
void SvMetaModule::WriteCxx( SvIdlDataBase & rBase, SvStream & rOutStm,
sal_uInt16 nTab )
{
@@ -686,3 +548,4 @@ void SvMetaModule::WriteCxx( SvIdlDataBase & rBase, SvStream & rOutStm,
#endif // IDL_COMPILER
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/source/objects/object.cxx b/idl/source/objects/object.cxx
index e9bddda61f9a..7344eba7fd64 100755..100644
--- a/idl/source/objects/object.cxx
+++ b/idl/source/objects/object.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,28 +34,16 @@
#include <tools/debug.hxx>
-#include <attrib.hxx>
#include <object.hxx>
#include <globals.hxx>
#include <database.hxx>
-/******************** class SvClassElement *******************************/
SV_IMPL_PERSIST1( SvClassElement, SvPersistBase );
-/*************************************************************************
-|* SvClassElement::SvClassElement()
-|*
-|* Beschreibung
-*************************************************************************/
SvClassElement::SvClassElement()
{
};
-/*************************************************************************
-|* SvClassElement::Load()
-|*
-|* Beschreibung
-*************************************************************************/
void SvClassElement::Load( SvPersistStream & rStm )
{
sal_uInt8 nMask;
@@ -62,7 +51,7 @@ void SvClassElement::Load( SvPersistStream & rStm )
if( nMask >= 0x08 )
{
rStm.SetError( SVSTREAM_FILEFORMAT_ERROR );
- DBG_ERROR( "wrong format" );
+ OSL_FAIL( "wrong format" );
return;
}
if( nMask & 0x01 ) rStm >> aAutomation;
@@ -75,43 +64,27 @@ void SvClassElement::Load( SvPersistStream & rStm )
}
}
-/*************************************************************************
-|* SvClassElement::Save()
-|*
-|* Beschreibung
-*************************************************************************/
void SvClassElement::Save( SvPersistStream & rStm )
{
- // Maske erstellen
+ // create mask
sal_uInt8 nMask = 0;
if( aAutomation.IsSet() ) nMask |= 0x1;
if( aPrefix.Len() ) nMask |= 0x2;
if( xClass.Is() ) nMask |= 0x4;
- // Daten schreiben
+ // write data
rStm << nMask;
if( nMask & 0x01 ) rStm << aAutomation;
if( nMask & 0x02 ) rStm.WriteByteString( aPrefix );
if( nMask & 0x04 ) rStm << xClass;
}
-/****************** SvMetaClass ******************************************/
SV_IMPL_META_FACTORY1( SvMetaClass, SvMetaType );
-/*************************************************************************
-|* SvMetaClass::SvMetaClass()
-|*
-|* Beschreibung
-*************************************************************************/
SvMetaClass::SvMetaClass()
: aAutomation( sal_True, sal_False )
{
}
-/*************************************************************************
-|* SvMetaClass::Load()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaClass::Load( SvPersistStream & rStm )
{
SvMetaType::Load( rStm );
@@ -121,7 +94,7 @@ void SvMetaClass::Load( SvPersistStream & rStm )
if( nMask >= 0x20 )
{
rStm.SetError( SVSTREAM_FILEFORMAT_ERROR );
- DBG_ERROR( "wrong format" );
+ OSL_FAIL( "wrong format" );
return;
}
if( nMask & 0x01 ) rStm >> aAttrList;
@@ -141,16 +114,11 @@ void SvMetaClass::Load( SvPersistStream & rStm )
if( nMask & 0x10 ) rStm >> aAutomation;
}
-/*************************************************************************
-|* SvMetaClass::Save()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaClass::Save( SvPersistStream & rStm )
{
SvMetaType::Save( rStm );
- // Maske erstellen
+ // create mask
sal_uInt8 nMask = 0;
if( aAttrList.Count() ) nMask |= 0x1;
if( aSuperClass.Is() ) nMask |= 0x2;
@@ -158,7 +126,7 @@ void SvMetaClass::Save( SvPersistStream & rStm )
if( xAutomationInterface.Is() ) nMask |= 0x8;
if( aAutomation.IsSet() ) nMask |= 0x10;
- // Daten schreiben
+ // write data
rStm << nMask;
if( nMask & 0x01 ) rStm << aAttrList;
if( nMask & 0x02 ) rStm << aSuperClass;
@@ -167,79 +135,7 @@ void SvMetaClass::Save( SvPersistStream & rStm )
if( nMask & 0x10 ) rStm << aAutomation;
}
-/*************************************************************************
-|* SvMetaClass::FillSbxObject()
-|*
-|* Beschreibung
-*************************************************************************/
-/*
-void SvMetaClass::FillSbxMemberObject( SvIdlDataBase & rBase,
- SbxObject * pObj,
- StringList & rSuperList,
- sal_Bool bVariable )
-{
- // alle Attribute der Klasse schreiben
- sal_uLong n ;
- for( n = 0; n < aAttrList.Count(); n++ )
- {
- SvMetaAttribute * pAttr = aAttrList.GetObject( n );
-
- ByteString aMangleName = pAttr->GetMangleName( bVariable );
- ByteString * pS = SvIdlDataBase::FindName( aMangleName, rSuperList );
-
- if( !pS && pAttr->GetExport() )
- {
- // nicht doppelt
- if( bVariable && pAttr->IsVariable() )
- {
- rSuperList.Insert( new ByteString( aMangleName ), LIST_APPEND );
- pAttr->FillSbxObject( rBase, pObj, bVariable );
- }
- else if( !bVariable && pAttr->IsMethod() )
- {
- rSuperList.Insert( new ByteString( aMangleName ), LIST_APPEND );
- pAttr->FillSbxObject( rBase, pObj, bVariable );
- }
- }
- }
- // alle Attribute der importierten Klassen schreiben
- for( n = 0; n < aClassList.Count(); n++ )
- {
- SvClassElement * pEle = aClassList.GetObject( n );
- SvMetaClass * pClass = pEle->GetClass();
- pClass->FillSbxMemberObject( rBase, pObj, rSuperList, bVariable );
- }
- // alle Attribute der Superklassen schreiben
- if( aSuperClass.Is() )
- aSuperClass->FillSbxMemberObject( rBase, pObj, rSuperList, bVariable );
-}
-*/
-/*************************************************************************
-|* SvMetaClass::FillSbxObject()
-|*
-|* Beschreibung
-*************************************************************************/
-/*
-void SvMetaClass::FillSbxObject( SvIdlDataBase & rBase, SbxObject * pObj )
-{
- StringList aSuperList;
- FillSbxMemberObject( rBase, pObj, aSuperList, sal_True );
- FillSbxMemberObject( rBase, pObj, aSuperList, sal_False );
-
- ByteString * pStr = aSuperList.First();
- while( pStr )
- {
- delete pStr;
- pStr = aSuperList.Next();
- }
-}
- */
#ifdef IDL_COMPILER
-/*************************************************************************
-|* SvMetaClass::ReadAttributesSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaClass::ReadAttributesSvIdl( SvIdlDataBase & rBase,
SvTokenStream & rInStm )
{
@@ -247,11 +143,6 @@ void SvMetaClass::ReadAttributesSvIdl( SvIdlDataBase & rBase,
aAutomation.ReadSvIdl( SvHash_Automation(), rInStm );
}
-/*************************************************************************
-|* SvMetaClass::WriteAttributesSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaClass::WriteAttributesSvIdl( SvIdlDataBase & rBase,
SvStream & rOutStm, sal_uInt16 nTab )
{
@@ -270,11 +161,6 @@ void SvMetaClass::WriteAttributesSvIdl( SvIdlDataBase & rBase,
}
}
-/*************************************************************************
-|* SvMetaClass::ReadContextSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaClass::ReadContextSvIdl( SvIdlDataBase & rBase,
SvTokenStream & rInStm )
{
@@ -299,7 +185,7 @@ void SvMetaClass::ReadContextSvIdl( SvIdlDataBase & rBase,
{
if( xAutomationInterface.Is() )
{
- // Fehler setzen
+ // set error
rBase.SetError( "Automation allready set",
rInStm.GetToken() );
rBase.WriteError( rInStm );
@@ -309,14 +195,14 @@ void SvMetaClass::ReadContextSvIdl( SvIdlDataBase & rBase,
}
else
{
- // Fehler setzen
+ // set error
rBase.SetError( "missing ]", rInStm.GetToken() );
rBase.WriteError( rInStm );
}
}
else
{
- // Fehler setzen
+ // set error
rBase.SetError( "only attribute Automation allowed",
rInStm.GetToken() );
rBase.WriteError( rInStm );
@@ -332,7 +218,7 @@ void SvMetaClass::ReadContextSvIdl( SvIdlDataBase & rBase,
}
else
{
- // Fehler setzen
+ // set error
rBase.SetError( "unknown imported interface", rInStm.GetToken() );
rBase.WriteError( rInStm );
}
@@ -374,11 +260,6 @@ void SvMetaClass::ReadContextSvIdl( SvIdlDataBase & rBase,
rInStm.Seek( nTokPos );
}
-/*************************************************************************
-|* SvMetaClass::WriteContextSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaClass::WriteContextSvIdl
(
SvIdlDataBase & rBase,
@@ -386,7 +267,6 @@ void SvMetaClass::WriteContextSvIdl
sal_uInt16 nTab
)
{
- //SvMetaType::WriteContextSvIdl( rBase, rOutStm, nTab );
sal_uLong n;
for( n = 0; n < aAttrList.Count(); n++ )
{
@@ -409,11 +289,6 @@ void SvMetaClass::WriteContextSvIdl
}
}
-/*************************************************************************
-|* SvMetaClass::ReadSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaClass::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
{
sal_uLong nTokPos = rInStm.Tell();
@@ -426,7 +301,7 @@ sal_Bool SvMetaClass::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
bOk = aSuperClass.Is();
if( !bOk )
{
- // Fehler setzen
+ // set error
rBase.SetError( "unknown super class",
rInStm.GetToken() );
rBase.WriteError( rInStm );
@@ -444,18 +319,13 @@ sal_Bool SvMetaClass::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
return sal_False;
}
-/*************************************************************************
-|* SvMetaClass::TestAttribute()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaClass::TestAttribute( SvIdlDataBase & rBase, SvTokenStream & rInStm,
SvMetaAttribute & rAttr ) const
{
if ( !rAttr.GetRef() && rAttr.IsA( TYPE( SvMetaSlot ) ) )
{
- DBG_ERROR( "Neuer Slot : " );
- DBG_ERROR( rAttr.GetSlotId().GetBuffer() );
+ OSL_FAIL( "Neuer Slot : " );
+ OSL_FAIL( rAttr.GetSlotId().GetBuffer() );
}
for( sal_uLong n = 0; n < aAttrList.Count(); n++ )
@@ -463,13 +333,13 @@ sal_Bool SvMetaClass::TestAttribute( SvIdlDataBase & rBase, SvTokenStream & rInS
SvMetaAttribute * pS = aAttrList.GetObject( n );
if( pS->GetName() == rAttr.GetName() )
{
- // Werte muessen uebereinstimmen
+ // values have to match
if( pS->GetSlotId().GetValue() != rAttr.GetSlotId().GetValue() )
{
- DBG_ERROR( "Gleicher Name in MetaClass : " );
- DBG_ERROR( pS->GetName().GetBuffer() );
- DBG_ERROR( pS->GetSlotId().GetBuffer() );
- DBG_ERROR( rAttr.GetSlotId().GetBuffer() );
+ OSL_FAIL( "Gleicher Name in MetaClass : " );
+ OSL_FAIL( pS->GetName().GetBuffer() );
+ OSL_FAIL( pS->GetSlotId().GetBuffer() );
+ OSL_FAIL( rAttr.GetSlotId().GetBuffer() );
ByteString aStr( "Attribute's " );
aStr += pS->GetName();
@@ -483,12 +353,12 @@ sal_Bool SvMetaClass::TestAttribute( SvIdlDataBase & rBase, SvTokenStream & rInS
{
sal_uInt32 nId1 = pS->GetSlotId().GetValue();
sal_uInt32 nId2 = rAttr.GetSlotId().GetValue();
- if( nId1 == nId2 && nId1 != 0 /*&& nId2 != 0 ist ueberfluessig*/ )
+ if( nId1 == nId2 && nId1 != 0 )
{
- DBG_ERROR( "Gleiche Id in MetaClass : " );
- DBG_ERROR( ByteString::CreateFromInt32( pS->GetSlotId().GetValue() ).GetBuffer() );
- DBG_ERROR( pS->GetSlotId().GetBuffer() );
- DBG_ERROR( rAttr.GetSlotId().GetBuffer() );
+ OSL_FAIL( "Gleiche Id in MetaClass : " );
+ OSL_FAIL( ByteString::CreateFromInt32( pS->GetSlotId().GetValue() ).GetBuffer() );
+ OSL_FAIL( pS->GetSlotId().GetBuffer() );
+ OSL_FAIL( rAttr.GetSlotId().GetBuffer() );
ByteString aStr( "Attribute " );
aStr += pS->GetName();
@@ -507,11 +377,6 @@ sal_Bool SvMetaClass::TestAttribute( SvIdlDataBase & rBase, SvTokenStream & rInS
return sal_True;
}
-/*************************************************************************
-|* SvMetaClass::WriteSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaClass::WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm,
sal_uInt16 nTab )
{
@@ -523,68 +388,6 @@ void SvMetaClass::WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm,
rOutStm << endl;
}
-/*************************************************************************
-|* SvMetaClass::WriteOdlMember()
-|*
-|* Beschreibung
-*************************************************************************/
-/*
-void SvMetaClass::WriteOdlMembers( ByteStringList & rSuperList,
- sal_Bool bVariable, sal_Bool bWriteTab,
- SvIdlDataBase & rBase,
- SvStream & rOutStm, sal_uInt16 nTab )
-{
- // alle Attribute schreiben
- sal_uLong n;
- for( n = 0; n < aAttrList.Count(); n++ )
- {
- SvMetaAttribute * pAttr = aAttrList.GetObject( n );
-
- ByteString aMangleName = pAttr->GetMangleName( bVariable );
- ByteString * pS = rBase.FindName( aMangleName, rSuperList );
-
- if( !pS && pAttr->GetExport() )
- {
- // nicht doppelt
- if( bVariable && pAttr->IsVariable() )
- {
- rSuperList.Insert( new ByteString( aMangleName ), LIST_APPEND );
- pAttr->Write( rBase, rOutStm, nTab +1, WRITE_ODL,
- WA_VARIABLE );
- rOutStm << ';' << endl;
- }
- else if( !bVariable && pAttr->IsMethod() )
- {
- rSuperList.Insert( new ByteString( aMangleName ), LIST_APPEND );
- pAttr->Write( rBase, rOutStm, nTab +1, WRITE_ODL,
- WA_METHOD );
- rOutStm << ';' << endl;
- }
- }
- else
- continue;
- }
- // alle Attribute der importierten Klassen schreiben
- for( n = 0; n < aClassList.Count(); n++ )
- {
- SvClassElement * pEle = aClassList.GetObject( n );
- SvMetaClass * pCl = pEle->GetClass();
- pCl->WriteOdlMembers( rSuperList, bVariable, bWriteTab,
- rBase, rOutStm, nTab );
- }
- // alle Attribute der Superklassen schreiben
- SvMetaClass * pSC = aSuperClass;
- if( pSC )
- pSC->WriteOdlMembers( rSuperList, bVariable, bWriteTab,
- rBase, rOutStm, nTab );
-}
- */
-
-/*************************************************************************
-|* SvMetaClass::Write()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaClass::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
sal_uInt16 nTab,
WriteType nT, WriteAttribute )
@@ -594,54 +397,13 @@ void SvMetaClass::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
{
case WRITE_ODL:
{
- DBG_ERROR( "Not supported anymore!" );
-/*
- // Schreibt die Attribute
- SvMetaName::Write( rBase, rOutStm, nTab, nT, nA );
-
- WriteTab( rOutStm, nTab );
- rOutStm << "dispinterface " << GetName().GetBuffer() << endl;
- WriteTab( rOutStm, nTab );
- rOutStm << '{' << endl;
-
- WriteTab( rOutStm, nTab );
- rOutStm << "properties:";
- rOutStm << endl;
-
- StringList aSuperList;
- WriteOdlMembers( aSuperList, sal_True, sal_True, rBase, rOutStm, nTab );
-
- WriteTab( rOutStm, nTab );
- rOutStm << "methods:";
- rOutStm << endl;
-
- WriteOdlMembers( aSuperList, sal_False, sal_True, rBase, rOutStm, nTab );
-
- ByteString * pStr = aSuperList.First();
- while( pStr )
- {
- delete pStr;
- pStr = aSuperList.Next();
- }
-
- WriteTab( rOutStm, 1 );
- rOutStm << '}' << endl;
- */
+ OSL_FAIL( "Not supported anymore!" );
break;
}
case WRITE_C_SOURCE:
case WRITE_C_HEADER:
{
- DBG_ERROR( "Not supported anymore!" );
-/*
- StringList aSuperList;
- if( nT == WRITE_C_SOURCE )
- {
- rOutStm << "#pragma code_seg (\"" << GetName().GetBuffer()
- << "\",\"CODE\")" << endl;
- }
- WriteCFunctions( aSuperList, rBase, rOutStm, nTab, nT );
- */
+ OSL_FAIL( "Not supported anymore!" );
break;
}
case WRITE_DOCU:
@@ -654,7 +416,7 @@ void SvMetaClass::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
WriteDescription( rOutStm );
rOutStm << "</INTERFACE>" << endl << endl;
- // alle Attribute schreiben
+ // write all attributes
sal_uLong n;
for( n = 0; n < aAttrList.Count(); n++ )
{
@@ -676,19 +438,14 @@ void SvMetaClass::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
}
}
-/*************************************************************************
-|* SvMetaClass::WriteSlotParamArray()
-|*
-|* Beschreibung
-*************************************************************************/
sal_uInt16 SvMetaClass::WriteSlotParamArray( SvIdlDataBase & rBase,
SvSlotElementList & rSlotList,
SvStream & rOutStm )
{
sal_uInt16 nCount = 0;
- for( sal_uLong n = 0; n < rSlotList.Count(); n++ )
+ for ( size_t i = 0, n = rSlotList.size(); i < n; ++i )
{
- SvSlotElement *pEle = rSlotList.GetObject( n );
+ SvSlotElement *pEle = rSlotList[ i ];
SvMetaSlot *pAttr = pEle->xSlot;
nCount = nCount + pAttr->WriteSlotParamArray( rBase, rOutStm );
}
@@ -696,77 +453,64 @@ sal_uInt16 SvMetaClass::WriteSlotParamArray( SvIdlDataBase & rBase,
return nCount;
}
-/*************************************************************************
-|* SvMetaClass::WriteSlots()
-|*
-|* Beschreibung
-*************************************************************************/
sal_uInt16 SvMetaClass::WriteSlots( const ByteString & rShellName,
sal_uInt16 nCount, SvSlotElementList & rSlotList,
SvIdlDataBase & rBase,
SvStream & rOutStm )
{
sal_uInt16 nSCount = 0;
- for( sal_uLong n = 0; n < rSlotList.Count(); n++ )
+ for ( size_t i = 0, n = rSlotList.size(); i < n; ++i )
{
- rSlotList.Seek(n);
- SvSlotElement * pEle = rSlotList.GetCurObject();
+ SvSlotElement * pEle = rSlotList[ i ];
SvMetaSlot * pAttr = pEle->xSlot;
nSCount = nSCount + pAttr->WriteSlotMap( rShellName, nCount + nSCount,
- rSlotList, pEle->aPrefix, rBase,
+ rSlotList, i, pEle->aPrefix, rBase,
rOutStm );
}
return nSCount;
}
-/*************************************************************************
-|* SvMetaClass::InsertSlots()
-|*
-|* Beschreibung
-*************************************************************************/
-void SvMetaClass::InsertSlots( SvSlotElementList& rList, SvULongs& rSuperList,
+void SvMetaClass::InsertSlots( SvSlotElementList& rList, std::vector<sal_uLong>& rSuperList,
SvMetaClassList &rClassList,
const ByteString & rPrefix, SvIdlDataBase& rBase)
{
- // Wurde diese Klasse schon geschrieben ?
- if ( rClassList.GetPos(this) != LIST_ENTRY_NOTFOUND )
- return;
+ // was this class already written?
+ for ( size_t i = 0, n = rClassList.size(); i < n ; ++i )
+ if ( rClassList[ i ] == this )
+ return;
- rClassList.Insert(this, LIST_APPEND);
+ rClassList.push_back( this );
- // alle direkten Attribute schreiben
+ // write all direct attributes
sal_uLong n;
for( n = 0; n < aAttrList.Count(); n++ )
{
SvMetaAttribute * pAttr = aAttrList.GetObject( n );
sal_uLong nId = pAttr->GetSlotId().GetValue();
- sal_uInt16 nPos;
- for ( nPos=0; nPos < rSuperList.Count(); nPos++ )
- {
- if ( rSuperList.GetObject(nPos) == nId )
- break;
- }
- if( nPos == rSuperList.Count() )
+ std::vector<sal_uLong>::iterator iter = std::find(rSuperList.begin(),
+ rSuperList.end(),nId);
+
+ if( iter == rSuperList.end() )
{
- // nur schreiben, wenn nicht schon bei SubClass oder
- // importiertem Interface geschrieben
- rSuperList.Insert( nId, nPos );
+ // Write only if not already written by subclass or
+ // imported interface.
+ rSuperList.push_back(nId);
pAttr->Insert(rList, rPrefix, rBase);
}
}
- // Alle schon von SuperShells importierten Interfaces sollen nicht
- // mehr geschrieben werden
- // Es ist also verboten, da\s Shell und SuperShell die gleiche Klasse
- // direkt importieren !
+ // All Interfaces already imported by SuperShells should not be
+ // written any more.
+ // It is prohibited that Shell and SuperShell directly import the same
+ //class.
if( IsShell() && aSuperClass.Is() )
aSuperClass->FillClasses( rClassList );
- // alle Attribute der importierten Klassen schreiben, sofern diese nicht
- // schon von der Superklasse importiert wurden
+ // Write all attributes of the imported classes, as long as they have
+ // not already been imported by the superclass.
for( n = 0; n < aClassList.Count(); n++ )
{
SvClassElement * pEle = aClassList.GetObject( n );
@@ -776,123 +520,93 @@ void SvMetaClass::InsertSlots( SvSlotElementList& rList, SvULongs& rSuperList,
rPre += '.';
rPre += pEle->GetPrefix();
- // Zun"achst die direkt importierten Interfaces schreiben
+ // first of all write direct imported interfaces
pCl->InsertSlots( rList, rSuperList, rClassList, rPre, rBase );
}
- // Superklassen nur schreiben, wenn keine Shell und nicht in der Liste
+ // only write superclass if no shell and not in the list
if( !IsShell() && aSuperClass.Is() )
{
aSuperClass->InsertSlots( rList, rSuperList, rClassList, rPrefix, rBase );
}
}
-/*************************************************************************
-|* SvMetaClass::FillClasses()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaClass::FillClasses( SvMetaClassList & rList )
{
- // Bin ich noch nicht drin ?
- if ( rList.GetPos(this) == LIST_ENTRY_NOTFOUND )
- {
- rList.Insert(this, LIST_APPEND);
+ // Am I not yet in?
+ for ( size_t i = 0, n = rList.size(); i < n; ++i )
+ if ( rList[ i ] == this )
+ return;
- // Meine Imports
- for( sal_uLong n = 0; n < aClassList.Count(); n++ )
- {
- SvClassElement * pEle = aClassList.GetObject( n );
- SvMetaClass * pCl = pEle->GetClass();
- pCl->FillClasses( rList );
- }
+ rList.push_back( this );
- // Meine Superklasse
- if( aSuperClass.Is() )
- aSuperClass->FillClasses( rList );
+ // my imports
+ for( sal_uInt32 n = 0; n < aClassList.Count(); n++ )
+ {
+ SvClassElement * pEle = aClassList.GetObject( n );
+ SvMetaClass * pCl = pEle->GetClass();
+ pCl->FillClasses( rList );
}
+
+ // my superclass
+ if( aSuperClass.Is() )
+ aSuperClass->FillClasses( rList );
}
-/*************************************************************************
-|* SvMetaClass::WriteSlotStubs()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaClass::WriteSlotStubs( const ByteString & rShellName,
SvSlotElementList & rSlotList,
ByteStringList & rList,
SvStream & rOutStm )
{
- // alle Attribute schreiben
- for( sal_uLong n = 0; n < rSlotList.Count(); n++ )
+ // write all attributes
+ for ( size_t i = 0, n = rSlotList.size(); i < n; ++i )
{
- SvSlotElement *pEle = rSlotList.GetObject( n );
+ SvSlotElement *pEle = rSlotList[ i ];
SvMetaSlot *pAttr = pEle->xSlot;
pAttr->WriteSlotStubs( rShellName, rList, rOutStm );
}
}
-/*************************************************************************
-|* SvMetaClass::WriteSfx()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaClass::WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm )
{
WriteStars( rOutStm );
- // Klasse definieren
+ // define class
rOutStm << "#ifdef " << GetName().GetBuffer() << endl;
rOutStm << "#undef ShellClass" << endl;
rOutStm << "#undef " << GetName().GetBuffer() << endl;
rOutStm << "#define ShellClass " << GetName().GetBuffer() << endl;
-// rOutStm << "SFX_TYPELIB(" << GetName().GetBuffer() << ',' << endl
-// << "\t/* library type */"
-// << '"' << ByteString( GetModule()->GetUUId().GetHexName(), RTL_TEXTENCODING_UTF8 ).GetBuffer() << "\"," << endl
-// << "\t\"" << GetModule()->GetTypeLibFileName().GetBuffer() << "\","
-// << ByteString::CreateFromInt32( GetModule()->GetVersion().GetMajorVersion() ).GetBuffer() << ','
-// << ByteString::CreateFromInt32( GetModule()->GetVersion().GetMinorVersion() ).GetBuffer() << ',' << endl
-// << "\t/* shell type */"
-// << '"';
-// if( xAutomationInterface.Is() )
-// rOutStm << ByteString( xAutomationInterface->GetUUId().GetHexName(), RTL_TEXTENCODING_UTF8 ).GetBuffer();
-// else
-// rOutStm << ByteString( GetUUId().GetHexName(), RTL_TEXTENCODING_UTF8 ).GetBuffer();
-// rOutStm << "\");" << endl << endl;
-
- // Fuer Interfaces werden kein Slotmaps geschrieben
+ // no slotmaps get written for interfaces
if( !IsShell() )
{
rOutStm << "#endif" << endl << endl;
return;
}
- // Parameter Array schreiben
- //rOutStm << "SfxArgList " << GetName().GetBuffer() << "ArgMap[] = {" << endl;
+ // write parameter array
rOutStm << "SFX_ARGUMENTMAP(" << GetName().GetBuffer() << ')' << endl
<< '{' << endl;
- SvULongs aSuperList;
+ std::vector<sal_uLong> aSuperList;
SvMetaClassList classList;
SvSlotElementList aSlotList;
InsertSlots(aSlotList, aSuperList, classList, ByteString(), rBase);
- sal_uLong n;
- for ( n=0; n<aSlotList.Count(); n++ )
+ for ( size_t i = 0, n = aSlotList.size(); i < n; ++i )
{
- SvSlotElement *pEle = aSlotList.GetObject( n );
+ SvSlotElement *pEle = aSlotList[ i ];
SvMetaSlot *pSlot = pEle->xSlot;
- pSlot->SetListPos(n);
+ pSlot->SetListPos( i );
}
- sal_uLong nSlotCount = aSlotList.Count();
+ size_t nSlotCount = aSlotList.size();
- // alle Attribute schreiben
+ // write all attributes
sal_uInt16 nArgCount = WriteSlotParamArray( rBase, aSlotList, rOutStm );
if( nArgCount )
Back2Delemitter( rOutStm );
else
{
- // mindestens einen dummy
+ // at leaast one dummy
WriteTab( rOutStm, 1 );
rOutStm << "SFX_ARGUMENT( 0, 0, SfxVoidItem )" << endl;
}
@@ -900,26 +614,23 @@ void SvMetaClass::WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm )
ByteStringList aStringList;
WriteSlotStubs( GetName(), aSlotList, aStringList, rOutStm );
- ByteString * pStr = aStringList.First();
- while( pStr )
- {
- delete pStr;
- pStr = aStringList.Next();
- }
+ for ( size_t i = 0, n = aStringList.size(); i < n; ++i )
+ delete aStringList[ i ];
+ aStringList.clear();
rOutStm << endl;
- // Slotmap schreiben
+ // write slotmap
rOutStm << "SFX_SLOTMAP_ARG(" << GetName().GetBuffer() << ')' << endl
<< '{' << endl;
- // alle Attribute schreiben
+ // write all attributes
WriteSlots( GetName(), 0, aSlotList, rBase, rOutStm );
if( nSlotCount )
Back2Delemitter( rOutStm );
else
{
- // mindestens einen dummy
+ // at least one dummy
WriteTab( rOutStm, 1 );
rOutStm << "SFX_SLOT_ARG(" << GetName().GetBuffer()
<< ", 0, 0, "
@@ -929,16 +640,16 @@ void SvMetaClass::WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm )
}
rOutStm << endl << "};" << endl << "#endif" << endl << endl;
- for( n=0; n<aSlotList.Count(); n++ )
+ for( size_t i = 0, n = aSlotList.size(); i < n; ++i )
{
- aSlotList.Seek(n);
- SvSlotElement* pEle = aSlotList.GetCurObject();
+ SvSlotElement* pEle = aSlotList[ i ];
SvMetaSlot* pAttr = pEle->xSlot;
pAttr->ResetSlotPointer();
}
- for ( n=0; n<aSlotList.Count(); n++ )
- delete aSlotList.GetObject(n);
+ for( size_t i = 0, n = aSlotList.size(); i < n; ++i )
+ delete aSlotList[ i ];
+ aSlotList.clear();
}
void SvMetaClass::WriteHelpIds( SvIdlDataBase & rBase, SvStream & rOutStm,
@@ -951,9 +662,6 @@ void SvMetaClass::WriteHelpIds( SvIdlDataBase & rBase, SvStream & rOutStm,
}
}
-/*************************************************************************
-|* SvMetaShell::WriteSrc()
-*************************************************************************/
void SvMetaClass::WriteSrc( SvIdlDataBase & rBase, SvStream & rOutStm,
Table * pTable )
{
@@ -964,11 +672,6 @@ void SvMetaClass::WriteSrc( SvIdlDataBase & rBase, SvStream & rOutStm,
}
}
-/*************************************************************************
-|* SvMetaClass::WriteHxx()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaClass::WriteHxx( SvIdlDataBase &, SvStream & rOutStm, sal_uInt16 )
{
ByteString aSuperName( "SvDispatch" );
@@ -994,11 +697,6 @@ void SvMetaClass::WriteHxx( SvIdlDataBase &, SvStream & rOutStm, sal_uInt16 )
<< "};" << endl;
}
-/*************************************************************************
-|* SvMetaClass::WriteCxx()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaClass::WriteCxx( SvIdlDataBase &, SvStream & rOutStm, sal_uInt16 )
{
ByteString aSuperName( "SvDispatch" );
@@ -1045,3 +743,4 @@ void SvMetaClass::WriteCxx( SvIdlDataBase &, SvStream & rOutStm, sal_uInt16 )
#endif // IDL_COMPILER
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/source/objects/slot.cxx b/idl/source/objects/slot.cxx
index 6c7018959a9d..746fa741af25 100755..100644
--- a/idl/source/objects/slot.cxx
+++ b/idl/source/objects/slot.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,12 +32,10 @@
#include <ctype.h>
#include <stdio.h>
#include <tools/debug.hxx>
-#include <attrib.hxx>
#include <slot.hxx>
#include <globals.hxx>
#include <database.hxx>
-/****************** SvMetaSlot *****************************************/
SV_IMPL_META_FACTORY1( SvMetaSlot, SvMetaAttribute );
SvMetaObject *SvMetaSlot::MakeClone() const
@@ -44,12 +43,6 @@ SvMetaObject *SvMetaSlot::MakeClone() const
return new SvMetaSlot( *this );
}
-/*************************************************************************
-|* SvMetaSlot::SvMetaSlot()
-|*
-|* Beschreibung Zweites sal_False bei den SvBOOL-Objekten bedeutet,
-|* IsSet() liefert sal_False (Defaultinitialisierung).
-*************************************************************************/
SvMetaSlot::SvMetaSlot()
: aCachable( sal_True, sal_False )
, aSynchron( sal_True, sal_False )
@@ -73,17 +66,6 @@ SvMetaSlot::SvMetaSlot( SvMetaType * pType )
{
}
-/*
-#define TEST_READ \
-{ \
- sal_uInt32 nPos; \
- rStm >> nPos; \
- DBG_ASSERT( nPos +4 == rStm.Tell(), "stream pos error" ); \
-}
-
-#define TEST_WRITE \
- rStm << (sal_uInt32)rStm.Tell();
-*/
#define TEST_READ
#define TEST_WRITE
@@ -188,7 +170,7 @@ void SvMetaSlot::Save( SvPersistStream & rStm )
{
SvMetaAttribute::Save( rStm );
- // Maske erstellen
+ // create mask
sal_uInt16 nMask = 0;
if( aMethod.Is() ) nMask |= 0x0001;
if( aGroupId.Len() ) nMask |= 0x0002;
@@ -207,7 +189,7 @@ void SvMetaSlot::Save( SvPersistStream & rStm )
if( aSynchron.IsSet() ) nMask |= 0x4000;
if( aAsynchron.IsSet() ) nMask |= 0x8000;
- // Daten schreiben
+ // write data
rStm << nMask;
TEST_WRITE
if( nMask & 0x0001 ) rStm << aMethod;
@@ -242,8 +224,8 @@ void SvMetaSlot::Save( SvPersistStream & rStm )
TEST_WRITE
if( nMask & 0x8000 ) rStm << aAsynchron;
- // naechste Fuhre schreiben
- // Maske erstellen
+ // write next bunch
+ // create mask
nMask = 0;
if( aRecordPerItem.IsSet() ) nMask |= 0x0001;
if( aRecordManual.IsSet() ) nMask |= 0x0002;
@@ -262,7 +244,7 @@ void SvMetaSlot::Save( SvPersistStream & rStm )
if( aRecordAbsolute.IsSet() ) nMask |= 0x4000;
if( aImageRotation.IsSet() ) nMask |= 0x8000;
- // Daten schreiben
+ // write data
rStm << nMask;
TEST_WRITE
if( nMask & 0x0001 ) rStm << aRecordPerItem;
@@ -307,21 +289,11 @@ void SvMetaSlot::Save( SvPersistStream & rStm )
if( nMask & 0x0002 ) rStm << aImageReflection;
}
-/*************************************************************************
-|* SvMetaSlot::IsVariable()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaSlot::IsVariable() const
{
return SvMetaAttribute::IsVariable();
}
-/*************************************************************************
-|* SvMetaSlot::IsMethod()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaSlot::IsMethod() const
{
sal_Bool b = SvMetaAttribute::IsMethod();
@@ -329,11 +301,6 @@ sal_Bool SvMetaSlot::IsMethod() const
return b;
}
-/*************************************************************************
-|* SvMetaSlot::HasMethods()
-|*
-|* Beschreibung
-*************************************************************************/
ByteString SvMetaSlot::GetMangleName( sal_Bool bVariable ) const
{
if( !bVariable )
@@ -346,12 +313,12 @@ ByteString SvMetaSlot::GetMangleName( sal_Bool bVariable ) const
}
/*************************************************************************
-|* Referenz
+|* reference
|*
-|* Beschreibung Zweites sal_False bei den SvBOOL-Objekten bedeutet,
-|* IsSet() liefert sal_False (Defaultinitialisierung).
+|* description Second FALSE in the SvBOOL-Objects means
+|* IsSet() provides FALSE (default initialization).
*************************************************************************/
-/** Referenz Aufloesung **/
+/** reference disbandment **/
SvMetaType * SvMetaSlot::GetSlotType() const
{
if( aSlotType.Is() || !GetRef() ) return aSlotType;
@@ -402,28 +369,16 @@ sal_Bool SvMetaSlot::GetPseudoSlots() const
if( aPseudoSlots.IsSet() || !GetRef() ) return aPseudoSlots;
return ((SvMetaSlot *)GetRef())->GetPseudoSlots();
}
-/*
-sal_Bool SvMetaSlot::GetGet() const
-{
- if( aGet.IsSet() || !GetRef() ) return aGet;
- return ((SvMetaSlot *)GetRef())->GetGet();
-}
-sal_Bool SvMetaSlot::GetSet() const
-{
- if( aSet.IsSet() || !GetRef() ) return aSet;
- return ((SvMetaSlot *)GetRef())->GetSet();
-}
-*/
sal_Bool SvMetaSlot::GetCachable() const
{
- // Cachable und Volatile sind exclusiv
+ // Cachable and Volatile are exclusive
if( !GetRef() || aCachable.IsSet() || aVolatile.IsSet() )
return aCachable;
return ((SvMetaSlot *)GetRef())->GetCachable();
}
sal_Bool SvMetaSlot::GetVolatile() const
{
- // Cachable und Volatile sind exclusiv
+ // Cachable and Volatile are exclusive
if( !GetRef() || aVolatile.IsSet() || aCachable.IsSet() )
return aVolatile;
return ((SvMetaSlot *)GetRef())->GetVolatile();
@@ -440,21 +395,21 @@ sal_Bool SvMetaSlot::GetAutoUpdate() const
}
sal_Bool SvMetaSlot::GetSynchron() const
{
- // Synchron und Asynchron sind exclusiv
+ // Synchron and Asynchron are exclusive
if( !GetRef() || aSynchron.IsSet() || aAsynchron.IsSet() )
return aSynchron;
return ((SvMetaSlot *)GetRef())->GetSynchron();
}
sal_Bool SvMetaSlot::GetAsynchron() const
{
- // Synchron und Asynchron sind exclusiv
+ // Synchron and Asynchron are exclusive
if( !GetRef() || aAsynchron.IsSet() || aSynchron.IsSet() )
return aAsynchron;
return ((SvMetaSlot *)GetRef())->GetAsynchron();
}
sal_Bool SvMetaSlot::GetRecordPerItem() const
{
- // Record- PerItem, No, PerSet und Manual sind exclusiv
+ // Record- PerItem, No, PerSet and Manual are exclusive
if( !GetRef() || aRecordPerItem.IsSet() || aNoRecord.IsSet()
|| aRecordPerSet.IsSet() || aRecordManual.IsSet() )
return aRecordPerItem;
@@ -462,7 +417,7 @@ sal_Bool SvMetaSlot::GetRecordPerItem() const
}
sal_Bool SvMetaSlot::GetRecordPerSet() const
{
- // Record- PerItem, No, PerSet und Manual sind exclusiv
+ // Record- PerItem, No, PerSet and Manual are exclusive
if( !GetRef() || aRecordPerItem.IsSet() || aNoRecord.IsSet()
|| aRecordPerSet.IsSet() || aRecordManual.IsSet() )
return aRecordPerSet;
@@ -470,7 +425,7 @@ sal_Bool SvMetaSlot::GetRecordPerSet() const
}
sal_Bool SvMetaSlot::GetRecordManual() const
{
- // Record- PerItem, No, PerSet und Manual sind exclusiv
+ // Record- PerItem, No, PerSet and Manual are exclusive
if( !GetRef() || aRecordPerItem.IsSet() || aNoRecord.IsSet()
|| aRecordPerSet.IsSet() || aRecordManual.IsSet() )
return aRecordManual;
@@ -478,7 +433,7 @@ sal_Bool SvMetaSlot::GetRecordManual() const
}
sal_Bool SvMetaSlot::GetNoRecord() const
{
- // Record- PerItem, No, PerSet und Manual sind exclusiv
+ // Record- PerItem, No, PerSet and Manual are exclusive
if( !GetRef() || aRecordPerItem.IsSet() || aNoRecord.IsSet()
|| aRecordPerSet.IsSet() || aRecordManual.IsSet() )
return aNoRecord;
@@ -549,48 +504,7 @@ const ByteString& SvMetaSlot::GetUnoName() const
return ((SvMetaSlot *)GetRef())->GetUnoName();
}
-/*************************************************************************
-|* SvMetaSlot::FillSbxObject()
-|*
-|* Beschreibung
-*************************************************************************/
-/*
-void SvMetaSlot::FillSbxObject( SvIdlDataBase & rBase, SbxObject * pObj,
- sal_Bool bVariable )
-{
- // keine Attribut fuer Automation
- if( !GetAutomation() || !GetExport() )
- return;
-
- if( !bVariable )
- {
- SvMetaAttributeRef xM = GetMethod();
- if( xM.Is() )
- {
- SvMetaType * pType = xM->GetType();
- SvMetaType * pRetBaseType = pType->GetReturnType()->GetBaseType();
- ByteString aName = xM->GetName();
-
- SbxMethodRef xMeth = new SbxMethod( aName,
- pRetBaseType->GetSbxDataType() );
- pType->FillSbxObject( xMeth, bVariable );
- xMeth->SetUserData( MakeSlotValue(rBase, sal_False) );
-
- pObj->Insert( &xMeth );
- return;
- }
- }
-
- SvMetaAttribute::FillSbxObject( rBase, pObj, bVariable );
-}
- */
-
#ifdef IDL_COMPILER
-/*************************************************************************
-|* SvMetaSlot::ReadAttributesSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaSlot::ReadAttributesSvIdl( SvIdlDataBase & rBase,
SvTokenStream & rInStm )
{
@@ -717,11 +631,6 @@ void SvMetaSlot::ReadAttributesSvIdl( SvIdlDataBase & rBase,
}
}
-/*************************************************************************
-|* SvMetaSlot::WriteAttributesSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaSlot::WriteAttributesSvIdl( SvIdlDataBase & rBase,
SvStream & rOutStm,
sal_uInt16 nTab )
@@ -800,7 +709,7 @@ void SvMetaSlot::WriteAttributesSvIdl( SvIdlDataBase & rBase,
if( aVolatile )
aOut += aVolatile.GetSvIdlString( SvHash_Volatile() );
else if( !aCachable )
- // wegen Default == sal_True, nur wenn kein anderer gesetzt
+ // because of Default == TRUE, only when no other is set
aOut += aCachable.GetSvIdlString( SvHash_Cachable() );
else
aDel.Erase();
@@ -820,7 +729,7 @@ void SvMetaSlot::WriteAttributesSvIdl( SvIdlDataBase & rBase,
if( aAsynchron )
( aOut += aDel ) += aAsynchron.GetSvIdlString( SvHash_Asynchron() );
else if( !aSynchron )
- // wegen Default == sal_True, nur wenn kein anderer gesetzt
+ // because of Default == TRUE, only when no other is set
( aOut += aDel ) += aSynchron.GetSvIdlString( SvHash_Synchron() );
else
aDel1 = aDel;
@@ -831,7 +740,7 @@ void SvMetaSlot::WriteAttributesSvIdl( SvIdlDataBase & rBase,
else if( aNoRecord )
( aOut += aDel1 ) += aNoRecord.GetSvIdlString( SvHash_NoRecord() );
else if( !aRecordPerSet )
- // wegen Default == sal_True, nur wenn kein anderer gesetzt
+ // because of Default == TRUE, only when no other is set
( aOut += aDel1 ) += aRecordPerSet.GetSvIdlString( SvHash_RecordPerSet() );
else if( aRecordPerItem )
( aOut += aDel1 ) += aRecordPerItem.GetSvIdlString( SvHash_RecordPerItem() );
@@ -898,11 +807,6 @@ void SvMetaSlot::WriteAttributesSvIdl( SvIdlDataBase & rBase,
}
-/*************************************************************************
-|* SvMetaSlot::Test()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaSlot::Test( SvIdlDataBase & rBase, SvTokenStream & rInStm )
{
sal_Bool bOk = SvMetaAttribute::Test( rBase, rInStm );
@@ -922,11 +826,6 @@ sal_Bool SvMetaSlot::Test( SvIdlDataBase & rBase, SvTokenStream & rInStm )
return bOk;
}
-/*************************************************************************
-|* SvMetaSlot::ReadSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaSlot::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
{
sal_uInt32 nTokPos = rInStm.Tell();
@@ -935,7 +834,7 @@ sal_Bool SvMetaSlot::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
SvMetaAttribute * pAttr = rBase.ReadKnownAttr( rInStm, GetType() );
if( pAttr )
{
- // F"ur Testzwecke: Referenz bei Kurz-Syntax
+ // c
SvMetaSlot * pKnownSlot = PTR_CAST( SvMetaSlot, pAttr );
if( pKnownSlot )
{
@@ -960,16 +859,16 @@ sal_Bool SvMetaSlot::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
SvMetaAttribute *pAttr2 = rBase.SearchKnownAttr( GetSlotId() );
if( pAttr2 )
{
- // F"ur Testzwecke: Referenz bei kompletter Definition
+ // for testing purposes: reference in case of complete definition
SvMetaSlot * pKnownSlot = PTR_CAST( SvMetaSlot, pAttr2 );
if( pKnownSlot )
{
SetRef( pKnownSlot );
- // Namen d"urfen abweichen, da mit angegeben
+ // names may differ, because explicitly given
if ( pKnownSlot->GetName() != GetName() )
{
- DBG_ERROR("Illegal definition!");
+ OSL_FAIL("Illegal definition!");
rInStm.Seek( nTokPos );
return sal_False;
}
@@ -994,22 +893,12 @@ sal_Bool SvMetaSlot::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
return bOk;
}
-/*************************************************************************
-|* SvMetaSlot::WriteSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaSlot::WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm,
sal_uInt16 nTab )
{
SvMetaAttribute::WriteSvIdl( rBase, rOutStm, nTab );
}
-/*************************************************************************
-|* SvMetaSlot::Write()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaSlot::Write( SvIdlDataBase & rBase,
SvStream & rOutStm, sal_uInt16 nTab,
WriteType nT, WriteAttribute nA )
@@ -1021,7 +910,7 @@ void SvMetaSlot::Write( SvIdlDataBase & rBase,
}
else
{
- // keine Attribut fuer Automation
+ // no attribute for Automation
if( !GetAutomation() || !GetExport() )
return;
}
@@ -1045,16 +934,16 @@ void SvMetaSlot::Write( SvIdlDataBase & rBase,
void SvMetaSlot::Insert( SvSlotElementList& rList, const ByteString & rPrefix,
SvIdlDataBase& rBase)
{
- // Einf"ugeposition durch bin"are Suche in der SlotListe ermitteln
+ // get insert position through binary search in slotlist
sal_uInt16 nId = (sal_uInt16) GetSlotId().GetValue();
- sal_uInt16 nListCount = (sal_uInt16) rList.Count();
+ sal_uInt16 nListCount = (sal_uInt16) rList.size();
sal_uInt16 nPos;
sal_uLong m; // for inner "for" loop
if ( !nListCount )
nPos = 0;
else if ( nListCount == 1 )
- nPos = rList.GetObject(0)->xSlot->GetSlotId().GetValue() >= nId ? 0 : 1;
+ nPos = rList[ 0 ]->xSlot->GetSlotId().GetValue() >= nId ? 0 : 1;
else
{
sal_uInt16 nMid = 0, nLow = 0;
@@ -1064,7 +953,7 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const ByteString & rPrefix,
{
nMid = (nLow + nHigh) >> 1;
DBG_ASSERT( nMid < nListCount, "bsearch ist buggy" );
- int nDiff = (int) nId - (int) rList.GetObject(nMid)->xSlot->GetSlotId().GetValue();
+ int nDiff = (int) nId - (int) rList[ nMid ]->xSlot->GetSlotId().GetValue();
if ( nDiff < 0)
{
if ( nMid == 0 )
@@ -1088,29 +977,38 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const ByteString & rPrefix,
DBG_ASSERT( nPos <= nListCount,
"nPos too large" );
DBG_ASSERT( nPos == nListCount || nId <=
- (sal_uInt16) rList.GetObject(nPos)->xSlot->GetSlotId().GetValue(),
+ (sal_uInt16) rList[ nPos ]->xSlot->GetSlotId().GetValue(),
"Successor has lower SlotId" );
DBG_ASSERT( nPos == 0 || nId >
- (sal_uInt16) rList.GetObject(nPos-1)->xSlot->GetSlotId().GetValue(),
+ (sal_uInt16) rList[ nPos-1 ]->xSlot->GetSlotId().GetValue(),
"Predecessor has higher SlotId" );
DBG_ASSERT( nPos+1 >= nListCount || nId <
- (sal_uInt16) rList.GetObject(nPos+1)->xSlot->GetSlotId().GetValue(),
+ (sal_uInt16) rList[ nPos+1 ]->xSlot->GetSlotId().GetValue(),
"Successor has lower SlotId" );
- rList.Insert( new SvSlotElement( this, rPrefix ), nPos );
+ if ( nPos < rList.size() )
+ {
+ SvSlotElementList::iterator it = rList.begin();
+ std::advance( it, nPos );
+ rList.insert( it, new SvSlotElement( this, rPrefix ) );
+ }
+ else
+ {
+ rList.push_back( new SvSlotElement( this, rPrefix ) );
+ }
- // EnumSlots plattklopfen
+ // iron out EnumSlots
SvMetaTypeEnum * pEnum = NULL;
SvMetaType * pBType = GetType()->GetBaseType();
pEnum = PTR_CAST( SvMetaTypeEnum, pBType );
if( GetPseudoSlots() && pEnum && pEnum->Count() )
{
- // Den MasterSlot clonen
+ // clone the MasterSlot
SvMetaSlotRef xEnumSlot;
SvMetaSlot *pFirstEnumSlot = NULL;
for( sal_uLong n = 0; n < pEnum->Count(); n++ )
{
- // Die SlotId erzeugen
+ // create SlotId
SvMetaEnumValue *enumValue = pEnum->GetObject(n);
ByteString aValName = enumValue->GetName();
ByteString aSId( GetSlotId() );
@@ -1133,7 +1031,7 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const ByteString & rPrefix,
if ( m == rBase.GetAttrList().Count() )
{
- DBG_ERROR("Invalid EnumSlot!");
+ OSL_FAIL("Invalid EnumSlot!");
xEnumSlot = Clone();
sal_uLong nValue;
if ( rBase.FindId(aSId , &nValue) )
@@ -1145,30 +1043,30 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const ByteString & rPrefix,
}
}
- // Die Slaves sind kein Master !
+ // The slaves are no master!
xEnumSlot->aPseudoSlots = sal_False;
xEnumSlot->SetEnumValue(enumValue);
if ( !pFirstEnumSlot || xEnumSlot->GetSlotId().GetValue() < pFirstEnumSlot->GetSlotId().GetValue() )
pFirstEnumSlot = xEnumSlot;
- // Den erzeugten Slave ebenfalls einf"ugen
+ // insert the created slave as well
xEnumSlot->Insert( rList, rPrefix, rBase);
- // Die EnumSlots mit dem Master verketten
+ // concatenate the EnumSlots with the master
xEnumSlot->pLinkedSlot = this;
}
- // Master zeigt auf den ersten Slave
+ // master points to the first slave
pLinkedSlot = pFirstEnumSlot;
- // Slaves untereinander verketten
- rList.Seek((sal_uLong)0);
+ // concatenate slaves among themselves
xEnumSlot = pFirstEnumSlot;
+ size_t i = 0;
SvSlotElement *pEle;
do
{
- pEle = rList.Next();
+ pEle = ( ++i < rList.size() ) ? rList[ i ] : NULL;
if ( pEle && pEle->xSlot->pLinkedSlot == this )
{
xEnumSlot->pNextSlot = pEle->xSlot;
@@ -1181,11 +1079,6 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const ByteString & rPrefix,
}
-/*************************************************************************
-|* SvMetaSlot::WriteSlotMap()
-|*
-|* Beschreibung
-*************************************************************************/
static ByteString MakeSlotName( SvStringHashEntry * pEntry )
{
ByteString aName( "SFX_SLOT_" );
@@ -1197,18 +1090,6 @@ void SvMetaSlot::WriteSlotStubs( const ByteString & rShellName,
ByteStringList & rList,
SvStream & rOutStm )
{
-/*
- ByteString aName = GetName();
- SvMetaAttribute * pAttr = rAttrList.First();
- while( pAttr )
- {
- if( pAttr->GetName() == aName )
- break;
- pAttr = rAttrList.Next();
- }
- if( pAttr )
- return;
-*/
if ( !GetExport() && !GetHidden() )
return;
@@ -1216,9 +1097,9 @@ void SvMetaSlot::WriteSlotStubs( const ByteString & rShellName,
if ( aMethodName.Len() && aMethodName != "NoExec" )
{
sal_Bool bIn = sal_False;
- for( sal_uInt16 n = 0; n < rList.Count(); n++ )
+ for( size_t n = 0; n < rList.size(); n++ )
{
- if( *(rList.GetObject(n)) == aMethodName )
+ if( *(rList[ n ]) == aMethodName )
{
bIn=sal_True;
break;
@@ -1227,7 +1108,7 @@ void SvMetaSlot::WriteSlotStubs( const ByteString & rShellName,
if ( !bIn )
{
- rList.Insert( new ByteString(aMethodName), LIST_APPEND );
+ rList.push_back( new ByteString(aMethodName) );
rOutStm << "SFX_EXEC_STUB("
<< rShellName.GetBuffer()
<< ','
@@ -1240,9 +1121,9 @@ void SvMetaSlot::WriteSlotStubs( const ByteString & rShellName,
if ( aMethodName.Len() && aMethodName != "NoState" )
{
sal_Bool bIn = sal_False;
- for ( sal_uInt16 n=0; n < rList.Count(); n++ )
+ for ( size_t n=0; n < rList.size(); n++ )
{
- if ( *(rList.GetObject(n)) == aMethodName )
+ if ( *(rList[ n ]) == aMethodName )
{
bIn=sal_True;
break;
@@ -1251,7 +1132,7 @@ void SvMetaSlot::WriteSlotStubs( const ByteString & rShellName,
if ( !bIn )
{
- rList.Insert( new ByteString(aMethodName), LIST_APPEND );
+ rList.push_back( new ByteString(aMethodName) );
rOutStm << "SFX_STATE_STUB("
<< rShellName.GetBuffer()
<< ','
@@ -1264,13 +1145,13 @@ void SvMetaSlot::WriteSlotStubs( const ByteString & rShellName,
void SvMetaSlot::WriteSlot( const ByteString & rShellName, sal_uInt16 nCount,
const ByteString & rSlotId,
SvSlotElementList& rSlotList,
+ size_t nStart,
const ByteString & rPrefix,
SvIdlDataBase & rBase, SvStream & rOutStm )
{
if ( !GetExport() && !GetHidden() )
return;
-// sal_Bool bIsEnumSlot = 0 != rValueName.Len();
sal_Bool bIsEnumSlot = 0 != pEnumValue;
rOutStm << "// Slot Nr. " << ByteString::CreateFromInt32(nListPos).GetBuffer() << " : ";
@@ -1319,32 +1200,35 @@ void SvMetaSlot::WriteSlot( const ByteString & rShellName, sal_uInt16 nCount,
}
else
{
- // Den n"achsten Slot suchen, der die gleiche StateMethod hat wie ich
- // Die SlotList ist auf den aktuellen Slot geseekt
- SvSlotElement * pEle = rSlotList.Next();
+ // look for the next slot with the same StateMethod like me
+ // the slotlist is set to the current slot
+ size_t i = nStart;
+ SvSlotElement* pEle = ( ++i < rSlotList.size() ) ? rSlotList[ i ] : NULL;
pNextSlot = pEle ? &pEle->xSlot : NULL;
while ( pNextSlot )
{
if ( !pNextSlot->pNextSlot &&
- pNextSlot->GetStateMethod() == GetStateMethod() )
+ pNextSlot->GetStateMethod() == GetStateMethod()
+ ) {
break;
- pEle = rSlotList.Next();
+ }
+ pEle = ( ++i < rSlotList.size() ) ? rSlotList[ i ] : NULL;
pNextSlot = pEle ? &pEle->xSlot : NULL;
}
if ( !pNextSlot )
{
- // Es gibt nach mir keinen Slot mehr, der die gleiche ExecMethode
- // hat. Also suche ich den ersten Slot, der diese hatte (das
- // k"onnte auch ich selbst sein)
- pEle = rSlotList.First();
+ // There is no slot behind me that has the same ExecMethod.
+ // So I search for the first slot with it (could be myself).
+ i = 0;
+ pEle = rSlotList.empty() ? NULL : rSlotList[ i ];
pNextSlot = pEle ? &pEle->xSlot : NULL;
while ( pNextSlot != this )
{
if ( !pNextSlot->pEnumValue &&
pNextSlot->GetStateMethod() == GetStateMethod() )
break;
- pEle = rSlotList.Next();
+ pEle = ( ++i < rSlotList.size() ) ? rSlotList[ i ] : NULL;
pNextSlot = pEle ? &pEle->xSlot : NULL;
}
}
@@ -1367,7 +1251,7 @@ void SvMetaSlot::WriteSlot( const ByteString & rShellName, sal_uInt16 nCount,
WriteTab( rOutStm, 4 );
- // ExecMethod schreiben, wenn nicht angegeben, standard Namen
+ // write ExecMethod, with standard name if not specified
if( GetExecMethod().Len() && GetExecMethod() != "NoExec")
rOutStm << "SFX_STUB_PTR(" << rShellName.GetBuffer() << ','
<< GetExecMethod().GetBuffer() << ')';
@@ -1375,7 +1259,7 @@ void SvMetaSlot::WriteSlot( const ByteString & rShellName, sal_uInt16 nCount,
rOutStm << "SFX_STUB_PTR_EXEC_NONE";
rOutStm << ',';
- // StateMethod schreiben, wenn nicht angegeben, standard Namen
+ // write StateMethod, with standard name if not specified
if( GetStateMethod().Len() && GetStateMethod() != "NoState")
rOutStm << "SFX_STUB_PTR(" << rShellName.GetBuffer() << ','
<< GetStateMethod().GetBuffer() << ')';
@@ -1385,7 +1269,7 @@ void SvMetaSlot::WriteSlot( const ByteString & rShellName, sal_uInt16 nCount,
rOutStm << ',' << endl;
WriteTab( rOutStm, 4 );
- // Flags schreiben
+ // write flags
if( GetHasCoreId() )
rOutStm << MakeSlotName( SvHash_HasCoreId() ).GetBuffer() << '|';
if( GetCachable() )
@@ -1439,7 +1323,7 @@ void SvMetaSlot::WriteSlot( const ByteString & rShellName, sal_uInt16 nCount,
else
rOutStm << GetDisableFlags().GetBuffer();
- // Attribut Typ schreiben
+ // write attribute type
if( !bIsEnumSlot )
{
rOutStm << ',' << endl;
@@ -1489,7 +1373,7 @@ void SvMetaSlot::WriteSlot( const ByteString & rShellName, sal_uInt16 nCount,
else
rOutStm << '0';
- // Name f"urs Recording
+ // name for recording
if ( GetExport() )
{
rOutStm << ",\"";
@@ -1504,7 +1388,7 @@ void SvMetaSlot::WriteSlot( const ByteString & rShellName, sal_uInt16 nCount,
else
rOutStm << ", 0, ";
- // Method/Property Flags
+ // Method/Property flags
if( IsMethod() )
rOutStm << "SFX_SLOT_METHOD|";
if( IsVariable() )
@@ -1517,15 +1401,11 @@ void SvMetaSlot::WriteSlot( const ByteString & rShellName, sal_uInt16 nCount,
rOutStm << '0';
}
-// if ( GetUnoName().Len() )
{
rOutStm << ",\"";
rOutStm << GetMangleName( sal_False ).GetBuffer();
- //rOutStm << GetUnoName().GetBuffer();
rOutStm << "\"";
}
-// else
-// rOutStm << ", 0";
rOutStm << " )," << endl;
}
@@ -1556,9 +1436,9 @@ sal_uInt16 SvMetaSlot::WriteSlotParamArray( SvIdlDataBase & rBase, SvStream & rO
WriteTab( rOutStm, 1 );
rOutStm << "SFX_ARGUMENT("
<< pPar->GetSlotId().GetBuffer() << ',' // SlodId
- // Parameter Name
+ // parameter name
<< "\"" << pPar->GetName().GetBuffer() << "\","
- // Item Name
+ // item name
<< pPType->GetName().GetBuffer() << ")," << endl;
if( !rBase.FindType( pPType, rBase.aUsedTypes ) )
rBase.aUsedTypes.Append( pPType );
@@ -1570,11 +1450,12 @@ sal_uInt16 SvMetaSlot::WriteSlotParamArray( SvIdlDataBase & rBase, SvStream & rO
sal_uInt16 SvMetaSlot::WriteSlotMap( const ByteString & rShellName, sal_uInt16 nCount,
SvSlotElementList& rSlotList,
+ size_t nStart,
const ByteString & rPrefix,
SvIdlDataBase & rBase,
SvStream & rOutStm )
{
- // SlotId, wenn nicht angegeben, aus Namen generieren
+ // SlotId, if not specified generate from name
ByteString slotId = GetSlotId();
sal_uInt16 nSCount = 0;
@@ -1590,13 +1471,10 @@ sal_uInt16 SvMetaSlot::WriteSlotMap( const ByteString & rShellName, sal_uInt16 n
nSCount = (sal_uInt16)pType->GetAttrCount();
}
- WriteSlot( rShellName, nCount, slotId, rSlotList, rPrefix, rBase, rOutStm );
+ WriteSlot( rShellName, nCount, slotId, rSlotList, nStart, rPrefix, rBase, rOutStm );
return nSCount;
}
-/*************************************************************************
-|* SvMetaSlot::WriteSrc()
-*************************************************************************/
void SvMetaSlot::WriteSrc( SvIdlDataBase & rBase, SvStream & rOutStm,
Table * pTable )
{
@@ -1647,7 +1525,7 @@ void SvMetaSlot::WriteSrc( SvIdlDataBase & rBase, SvStream & rOutStm,
bIdOk = sal_True;
}
- // wenn Id nicht gefunden, immer schreiben
+ // if id not found, write always
if( !bIdOk || !pTable->IsKeyValid( nSId2 ) )
{
pTable->Insert( nSId2, this );
@@ -1699,7 +1577,7 @@ void SvMetaSlot::WriteHelpId( SvIdlDataBase & rBase, SvStream & rOutStm,
bIdOk = sal_True;
}
- // wenn Id nicht gefunden, immer schreiben
+ // if id not found, write always
if( !bIdOk || !pTable->IsKeyValid( nSId2 ) )
{
pTable->Insert( nSId2, this );
@@ -1714,9 +1592,9 @@ void SvMetaSlot::WriteHelpId( SvIdlDataBase & rBase, SvStream & rOutStm,
void WriteBool( sal_Bool bSet, SvStream& rStream )
{
if ( bSet )
- rStream << "sal_True" << ',';
+ rStream << "TRUE" << ',';
else
- rStream << "sal_False" << ',';
+ rStream << "FALSE" << ',';
}
void SvMetaSlot::WriteCSV( SvIdlDataBase& rBase, SvStream& rStrm )
@@ -1818,3 +1696,4 @@ void SvMetaSlot::WriteCSV( SvIdlDataBase& rBase, SvStream& rStrm )
#endif // IDL_COMPILER
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx
index 48b08da96962..7a006f2f8428 100755..100644
--- a/idl/source/objects/types.cxx
+++ b/idl/source/objects/types.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,19 +34,11 @@
#include <tools/debug.hxx>
-#include <attrib.hxx>
#include <types.hxx>
#include <globals.hxx>
#include <database.hxx>
-/****************** SvMetaAttribute *************************************/
-/************************************************************************/
SV_IMPL_META_FACTORY1( SvMetaAttribute, SvMetaReference );
-/*************************************************************************
-|* SvMetaAttribute::SvMetaAttribute()
-|*
-|* Beschreibung
-*************************************************************************/
SvMetaAttribute::SvMetaAttribute()
: aAutomation( sal_True, sal_False )
, aExport( sal_True, sal_False )
@@ -67,12 +60,6 @@ SvMetaAttribute::SvMetaAttribute( SvMetaType * pType )
{
}
-/*************************************************************************
-|* SvMetaAttribute::Load()
-|* SvMetaAttribute::Save()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaAttribute::Load( SvPersistStream & rStm )
{
SvMetaReference::Load( rStm );
@@ -98,7 +85,7 @@ void SvMetaAttribute::Save( SvPersistStream & rStm )
{
SvMetaReference::Save( rStm );
- // Maske erstellen
+ // create mask
sal_uInt8 nMask = 0;
if( aType.Is() ) nMask |= 0x1;
if( aSlotId.IsSet() ) nMask |= 0x2;
@@ -109,7 +96,7 @@ void SvMetaAttribute::Save( SvPersistStream & rStm )
if( aReadOnlyDoc.IsSet() ) nMask |= 0x40;
if( aHidden.IsSet() ) nMask |= 0x80;
- // Daten schreiben
+ // write data
rStm << nMask;
if( nMask & 0x1 ) rStm << aType;
if( nMask & 0x2 ) rStm << aSlotId;
@@ -121,59 +108,33 @@ void SvMetaAttribute::Save( SvPersistStream & rStm )
if( nMask & 0x80 ) rStm << aHidden;
}
-/*************************************************************************
-|* SvMetaAttribute::GetType()
-|*
-|* Beschreibung
-*************************************************************************/
SvMetaType * SvMetaAttribute::GetType() const
{
if( aType.Is() || !GetRef() ) return aType;
return ((SvMetaAttribute *)GetRef())->GetType();
}
-/*************************************************************************
-|* SvMetaAttribute::GetSlotId()
-|*
-|* Beschreibung
-*************************************************************************/
const SvNumberIdentifier & SvMetaAttribute::GetSlotId() const
{
if( aSlotId.IsSet() || !GetRef() ) return aSlotId;
return ((SvMetaAttribute *)GetRef())->GetSlotId();
}
-/*************************************************************************
-|* SvMetaAttribute::GetReadonly()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaAttribute::GetReadonly() const
{
if( aReadonly.IsSet() || !GetRef() ) return aReadonly;
return ((SvMetaAttribute *)GetRef())->GetReadonly();
}
-/*************************************************************************
-|* SvMetaAttribute::GetExport()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaAttribute::GetExport() const
{
if( aExport.IsSet() || !GetRef() ) return aExport;
return ((SvMetaAttribute *)GetRef())->GetExport();
}
-/*************************************************************************
-|* SvMetaAttribute::GetHidden()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaAttribute::GetHidden() const
{
- // Wenn Export gesetzt wurde, aber Hidden nicht, gilt der Default
- // aHidden = !aExport
+ // when export is set, but hidden is not the default is used
if ( aExport.IsSet() && !aHidden.IsSet() )
return !aExport;
else if( aHidden.IsSet() || !GetRef() )
@@ -182,11 +143,6 @@ sal_Bool SvMetaAttribute::GetHidden() const
return ((SvMetaAttribute *)GetRef())->GetHidden();
}
-/*************************************************************************
-|* SvMetaAttribute::GetAutomation()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaAttribute::GetAutomation() const
{
if( aAutomation.IsSet() || !GetRef() ) return aAutomation;
@@ -216,13 +172,6 @@ sal_Bool SvMetaAttribute::GetReadOnlyDoc() const
return ((SvMetaSlot *)GetRef())->GetReadOnlyDoc();
}
-/*************************************************************************
-|* SvMetaAttribute::IsMethod()
-|* SvMetaAttribute::IsVariable()
-|* SvMetaAttribute::GetMangleName()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaAttribute::IsMethod() const
{
SvMetaType * pType = GetType();
@@ -241,105 +190,7 @@ ByteString SvMetaAttribute::GetMangleName( sal_Bool ) const
return GetName();
}
-/*************************************************************************
-|* SvMetaAttribute::FillSbxObject()
-|*
-|* Beschreibung
-*************************************************************************/
-/*
-void SvMetaAttribute::FillSbxObject( SbxInfo * pInfo, sal_uInt16 nSbxFlags )
-{
- SvMetaType * pType = GetType();
- DBG_ASSERT( pType, "no type for attribute" );
- if( !nSbxFlags )
- { // Flags koennen vom Aufrufer ueberschrieben werden
- if( pType->GetOut() )
- {
- nSbxFlags |= SBX_WRITE;
- if( pType->GetIn() )
- nSbxFlags |= SBX_READ;
- }
- else
- nSbxFlags |= SBX_READ;
- }
- SvMetaType * pBaseType = pType->GetBaseType();
- DBG_ASSERT( pBaseType, "no base type for attribute" );
- if( pBaseType->GetType() == TYPE_STRUCT )
- {
- const SvMetaAttributeMemberList & rList = pBaseType->GetAttrList();
- sal_uLong nCount = rList.Count();
- for( sal_uLong i = 0; i < nCount; i++ )
- rList.GetObject( i )->FillSbxObject( pInfo, nSbxFlags );
- }
- else
- //MI: pInfo->AddParam( GetName(), pBaseType->GetSbxDataType(), nSbxFlags );
- pInfo->AddParam( GetName(), SbxVARIANT, nSbxFlags );
-}
-*/
-
-/*************************************************************************
-|* SvMetaAttribute::FillSbxObject()
-|*
-|* Beschreibung
-*************************************************************************/
-/*
-void SvMetaAttribute::FillSbxObject( SvIdlDataBase & rBase,
- SbxObject * pObj, sal_Bool bVariable )
-{
- // keine Attribut fuer Automation
- if( !GetAutomation() || !GetExport() )
- return;
-
- if( bVariable && IsVariable() )
- {
- SvMetaType * pType = GetType();
- DBG_ASSERT( pType, "no type for attribute" );
- SvMetaType * pBaseType = pType->GetBaseType();
- DBG_ASSERT( pBaseType, "no base type for attribute" );
-
- if( pBaseType->GetType() == TYPE_STRUCT )
- {
- SvNumberIdentifier aSlotId = rBase.aStructSlotId;
- if ( GetSlotId().Len() )
- rBase.aStructSlotId = GetSlotId();
- const SvMetaAttributeMemberList & rList = pBaseType->GetAttrList();
- sal_uLong nCount = rList.Count();
- for( sal_uLong i = 0; i < nCount; i++ )
- rList.GetObject( i )->FillSbxObject( rBase, pObj, bVariable );
- rBase.aStructSlotId = aSlotId;
- }
- else
- {
- SbxPropertyRef xProp = new SbxProperty( GetName(), SbxVARIANT );
- //MI: pBaseType->GetSbxDataType() );
- if ( GetReadonly() || IsMethod() )
- xProp->ResetFlag( SBX_WRITE );
- xProp->SetUserData( MakeSlotValue( rBase, sal_True ) );
- pType->FillSbxObject( xProp, bVariable );
-
- pObj->Insert( &xProp );
- }
- }
- else if( !bVariable && IsMethod() )
- {
- SvMetaType * pType = GetType();
- SvMetaType * pRetBaseType = GetType()->GetReturnType()->GetBaseType();
- SbxMethodRef xMeth = new SbxMethod( GetName(),
- pRetBaseType->GetSbxDataType() );
- xMeth->ResetFlag( SBX_WRITE );
- xMeth->SetUserData( MakeSlotValue( rBase, sal_False ) );
- pType->FillSbxObject( xMeth, bVariable );
-
- pObj->Insert( &xMeth );
- }
-}
-*/
#ifdef IDL_COMPILER
-/*************************************************************************
-|* SvMetaAttribute::Test()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaAttribute::Test( SvIdlDataBase & rBase,
SvTokenStream & rInStm )
{
@@ -350,28 +201,15 @@ sal_Bool SvMetaAttribute::Test( SvIdlDataBase & rBase,
rBase.WriteError( rInStm );
bOk = sal_False;
}
- /*
- if( !GetType()->IsItem() && GetSlotId().IsSet() )
- {
- rBase.SetError( "slot without item declared", rInStm.GetToken() );
- rBase.WriteError( rInStm );
- bOk = sal_False;
- }
- */
return bOk;
}
-/*************************************************************************
-|* SvMetaAttribute::ReadSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaAttribute::ReadSvIdl( SvIdlDataBase & rBase,
SvTokenStream & rInStm )
{
sal_uInt32 nTokPos = rInStm.Tell();
if( !GetType() )
- // Es wurde kein Typ im ctor mitgegeben
+ // no type in ctor passed on
aType = rBase.ReadKnownType( rInStm );
sal_Bool bOk = sal_False;
if( GetType() )
@@ -399,11 +237,6 @@ sal_Bool SvMetaAttribute::ReadSvIdl( SvIdlDataBase & rBase,
return bOk;
}
-/*************************************************************************
-|* SvMetaAttribute::WriteSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaAttribute::WriteSvIdl
(
SvIdlDataBase & rBase,
@@ -424,11 +257,6 @@ void SvMetaAttribute::WriteSvIdl
TestAndSeekSpaceOnly( rOutStm, nPos );
}
-/*************************************************************************
-|* SvMetaAttribute::ReadAttributesSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaAttribute::ReadAttributesSvIdl( SvIdlDataBase & rBase,
SvTokenStream & rInStm )
{
@@ -443,18 +271,13 @@ void SvMetaAttribute::ReadAttributesSvIdl( SvIdlDataBase & rBase,
{
if( GetType()->GetType() == TYPE_METHOD )
{
- // Fehler setzen
+ // set error
rBase.SetError( "Readonly in function attribute", rInStm.GetToken() );
rBase.WriteError( rInStm );
}
}
}
-/*************************************************************************
-|* SvMetaAttribute::WriteAttributesSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaAttribute::WriteAttributesSvIdl
(
SvIdlDataBase & rBase,
@@ -464,7 +287,6 @@ void SvMetaAttribute::WriteAttributesSvIdl
{
SvMetaReference::WriteAttributesSvIdl( rBase, rOutStm, nTab );
- //aSlotId.WriteSvIdl( SvHash_SlotId(), rOutStm, nTab );
if( !aExport || !aAutomation || aReadonly )
{
WriteTab( rOutStm, nTab );
@@ -508,11 +330,6 @@ void SvMetaAttribute::WriteAttributesSvIdl
}
}
-/*************************************************************************
-|* SvMetaAttribute::WriteParam()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaAttribute::WriteParam( SvIdlDataBase & rBase,
SvStream & rOutStm,
sal_uInt16 nTab,
@@ -535,10 +352,7 @@ void SvMetaAttribute::WriteParam( SvIdlDataBase & rBase,
rList.GetObject( i )->WriteParam( rBase, rOutStm, nTab, nT );
if( i+1<nCount )
{
-// if ( nT == WRITE_DOCU )
rOutStm << ',';
-// else
-// rOutStm << ',' << endl;
}
}
}
@@ -562,28 +376,15 @@ void SvMetaAttribute::WriteParam( SvIdlDataBase & rBase,
pBaseType->GetType() == TYPE_STRUCT ||
pBaseType->GetType() == TYPE_ENUM )
{
- DBG_ERROR( "Falscher Parametertyp!" );
+ OSL_FAIL( "Falscher Parametertyp!" );
}
else
rOutStm << pBaseType->GetBasicPostfix().GetBuffer();
}
}
}
-/*
- else if( nT == WRITE_C_HEADER || nT == WRITE_C_SOURCE )
- {
- pBaseType->WriteTypePrefix( rBase, rOutStm, nTab, nT );
- rOutStm << ' ';
- rOutStm << GetName().GetBuffer();
- }
-*/
}
-/*************************************************************************
-|* SvMetaSlot::WriteSlotId()
-|*
-|* Beschreibung
-*************************************************************************/
sal_uLong SvMetaAttribute::MakeSlotValue( SvIdlDataBase & rBase, sal_Bool bVar ) const
{
const SvNumberIdentifier & rId = GetSlotId();
@@ -602,11 +403,6 @@ sal_uLong SvMetaAttribute::MakeSlotValue( SvIdlDataBase & rBase, sal_Bool bVar )
return n;
}
-/*************************************************************************
-|* SvMetaSlot::WriteAttributes()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaAttribute::WriteAttributes( SvIdlDataBase & rBase, SvStream & rOutStm,
sal_uInt16 nTab,
WriteType nT, WriteAttribute nA )
@@ -641,11 +437,6 @@ void SvMetaAttribute::WriteAttributes( SvIdlDataBase & rBase, SvStream & rOutStm
}
}
-/*************************************************************************
-|* SvMetaAttribute::WriteCSource()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaAttribute::WriteCSource( SvIdlDataBase & rBase, SvStream & rOutStm,
sal_Bool bSet )
{
@@ -653,18 +444,14 @@ void SvMetaAttribute::WriteCSource( SvIdlDataBase & rBase, SvStream & rOutStm,
SvMetaType * pType = GetType();
SvMetaType * pBaseType = pType->GetBaseType();
- // Bei Set ist der Return immer void
+ // for Set the return is always void
sal_Bool bVoid = bSet;
if( pBaseType->GetType() == TYPE_METHOD )
bVoid = pBaseType->GetReturnType()->GetBaseType()->GetName() == "void";
- // Methoden/Funktions-Body ausgeben
+ // emit methods/functions body
rOutStm << '{' << endl;
WriteTab( rOutStm, 1 );
-// rOutStm << "if( SvIPCIsConnected() )" << endl;
-// WriteTab( rOutStm, 1 );
-// rOutStm << '{' << endl;
-// WriteTab( rOutStm, 2 );
if( !bVoid )
{
@@ -716,28 +503,15 @@ void SvMetaAttribute::WriteCSource( SvIdlDataBase & rBase, SvStream & rOutStm,
{
rOutStm << ", ";
if( IsMethod() )
- // void SetPosSize( C_Object *, C_Rectangle * pRect );
pBaseType->WriteParamNames( rBase, rOutStm, ByteString() );
else if( bSet )
pBaseType->WriteParamNames( rBase, rOutStm, GetName() );
}
rOutStm << " );" << endl;
-// WriteTab( rOutStm, 1 );
-// rOutStm << '}' << endl;
-// if( !bVoid )
-// {
-// WriteTab( rOutStm, 1 );
-// rOutStm << "return 0;" << endl;
-// }
rOutStm << '}' << endl;
}
-/*************************************************************************
-|* SvMetaAttribute::WriteRecursiv_Impl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaAttribute::WriteRecursiv_Impl( SvIdlDataBase & rBase,
SvStream & rOutStm, sal_uInt16 nTab,
WriteType nT, WriteAttribute nA )
@@ -749,8 +523,7 @@ void SvMetaAttribute::WriteRecursiv_Impl( SvIdlDataBase & rBase,
if ( GetSlotId().Len() )
rBase.aStructSlotId = GetSlotId();
- // Offizielle Hack-Schnittstelle von MM: spezielle Schalter werden "uber
- // die WriteAttribute "ubergeben
+ // offial hack interface by MM: special controls get passed with the WriteAttribute
if ( GetReadonly() )
nA |= WA_READONLY;
@@ -767,16 +540,11 @@ void SvMetaAttribute::WriteRecursiv_Impl( SvIdlDataBase & rBase,
rBase.aStructSlotId = slotId;
}
-/*************************************************************************
-|* SvMetaAttribute::Write()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaAttribute::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
sal_uInt16 nTab,
WriteType nT, WriteAttribute nA )
{
- // keine Attribut fuer Automation
+ // no attributes for automation
if( nT == WRITE_DOCU )
{
if ( GetHidden() )
@@ -825,15 +593,12 @@ void SvMetaAttribute::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
{
if( !bVariable && IsMethod() )
{
- ByteString name; // (rBase.GetActModulePrefix());
+ ByteString name;
name += rBase.aIFaceName;
name += GetName();
const char * pName = name.GetBuffer();
- // Beispiel
- // void SetPosSize( C_Object *, C_Rectangle * );
WriteTab( rOutStm, nTab );
pBaseType->WriteTypePrefix( rBase, rOutStm, nTab, nT );
-// rOutStm << " SYSCALL";
rOutStm << ' ' << pName;
pType->WriteMethodArgs( rBase, rOutStm, nTab, nT );
if( nT == WRITE_C_HEADER )
@@ -845,26 +610,21 @@ void SvMetaAttribute::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
{
if( nBType == TYPE_STRUCT )
{
- // Zur Hilfe den Namen des Properties als Kommentar ausgeben
+ // for assistance emit the name of the property as acomment
rOutStm << "/* " << GetName().GetBuffer() << " */" << endl;
WriteRecursiv_Impl( rBase, rOutStm, nTab, nT, nA );
}
else
{
- // Beispiel
- // void SetValue( C_Object *, sal_uInt16 n );
ByteString name = GetName();
sal_Bool bReadonly = GetReadonly() || ( nA & WA_READONLY );
if ( !bReadonly && !IsMethod() )
{
- // Zuweisung
+ // allocation
WriteTab( rOutStm, nTab );
rOutStm << "void ";
-// rOutStm << "SYSCALL ";
-// if ( rBase.GetActModulePrefix().Len() )
-// rOutStm << rBase.GetActModulePrefix().GetBuffer();
rOutStm << rBase.aIFaceName.GetBuffer()
<< "Set" << name.GetBuffer() << "( " << C_PREF
<< "Object h" << rBase.aIFaceName.GetBuffer() << ", " << endl;
@@ -877,13 +637,10 @@ void SvMetaAttribute::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
WriteCSource( rBase, rOutStm, sal_True );
}
- // Zugriff
+ // access
WriteTab( rOutStm, nTab );
pBaseType->WriteTypePrefix( rBase, rOutStm, nTab, nT );
rOutStm << ' ';
-// rOutStm << "SYSCALL ";
-// if ( rBase.GetActModulePrefix().Len() )
-// rOutStm << rBase.GetActModulePrefix().GetBuffer();
rOutStm << rBase.aIFaceName.GetBuffer()
<< "Get" << name.GetBuffer() << "( " << C_PREF
<< "Object h" << rBase.aIFaceName.GetBuffer() << " )";
@@ -903,7 +660,7 @@ void SvMetaAttribute::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
<< GetName().GetBuffer() << endl
<< endl; // readonly
- // Returntype
+ // return type
SvMetaType* pType2 = GetType();
SvMetaType* pBaseType2 = pType2->GetBaseType();
rOutStm << pBaseType2->GetReturnType()->GetBaseType()->GetBasicName().GetBuffer() << endl;
@@ -911,20 +668,20 @@ void SvMetaAttribute::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
DBG_ASSERT( pBaseType2->GetReturnType()->GetBaseType()->GetBasicName().Len(),
"Leerer BasicName" );
- // Syntax
+ // syntax
rOutStm << GetName().GetBuffer();
pType2->WriteMethodArgs( rBase, rOutStm, nTab, nT );
- // C-Returntype
+ // C return type
pBaseType2->WriteTypePrefix( rBase, rOutStm, 0, WRITE_C_HEADER );
rOutStm << endl;
- // Bei Methoden auch C-Syntax
+ // for methods also C syntax
rOutStm << "<C-SYNTAX>" << endl;
Write( rBase, rOutStm, 0, WRITE_C_HEADER, nA );
rOutStm << "</C-SYNTAX>" << endl;
- // Description
+ // description
WriteDescription( rOutStm );
rOutStm << "</METHOD>" << endl << endl;
}
@@ -944,20 +701,20 @@ void SvMetaAttribute::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
else
rOutStm << endl;
- // Bei properties Type anstelle des return value
+ // for properties type instead of the return value
rOutStm << pBaseType->GetBasicName().GetBuffer() << endl;
DBG_ASSERT( pBaseType->GetBasicName().Len(),
"Leerer BasicName" );
- // Bei properties keine Syntax
+ // for properties no syntax
rOutStm << endl;
- // C-Returntype
+ // C return type
pBaseType->WriteTypePrefix( rBase, rOutStm, 0, WRITE_C_HEADER );
rOutStm << endl;
- // Description
+ // description
WriteDescription( rOutStm );
rOutStm << "</PROPERTY>" << endl << endl;
}
@@ -965,11 +722,6 @@ void SvMetaAttribute::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
}
}
-/*************************************************************************
-|* SvMetaAttribute::MakeSfx()
-|*
-|* Beschreibung
-*************************************************************************/
sal_uLong SvMetaAttribute::MakeSfx( ByteString * pAttrArray )
{
SvMetaType * pType = GetType();
@@ -993,11 +745,6 @@ void SvMetaAttribute::Insert (SvSlotElementList&, const ByteString &, SvIdlDataB
{
}
-/*************************************************************************
-|* SvMetaAttribute::WriteSrc()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaAttribute::WriteSrc( SvIdlDataBase &, SvStream &, Table * )
{
}
@@ -1008,14 +755,7 @@ void SvMetaAttribute::WriteHelpId( SvIdlDataBase &, SvStream &, Table * )
#endif // IDL_COMPILER
-/****************** SvMetaType *************************************/
-/************************************************************************/
SV_IMPL_META_FACTORY1( SvMetaType, SvMetaExtern );
-/*************************************************************************
-|* SvMetaType::SvMetaType()
-|*
-|* Beschreibung
-*************************************************************************/
#define CTOR \
: aCall0( CALL_VALUE, sal_False ) \
, aCall1( CALL_VALUE, sal_False ) \
@@ -1049,7 +789,6 @@ SvMetaType::SvMetaType( const ByteString & rName,
const ByteString & rBasicPostfix )
CTOR
{
-// aSbxDataType = (int)nT;
SetName( rName );
aSbxName = rSbxName;
aOdlName = rOdlName;
@@ -1092,7 +831,7 @@ void SvMetaType::Save( SvPersistStream & rStm )
{
SvMetaExtern::Save( rStm );
- // Maske erstellen
+ // create mask
sal_uInt16 nMask = 0;
if( aIn.IsSet() ) nMask |= 0x0001;
if( aOut.IsSet() ) nMask |= 0x0002;
@@ -1111,7 +850,7 @@ void SvMetaType::Save( SvPersistStream & rStm )
if( aBasicName.IsSet() ) nMask |= 0x4000;
if( aBasicPostfix.IsSet() ) nMask |= 0x8000;
- // Daten schreiben
+ // write data
rStm << nMask;
if( nMask & 0x0001 ) rStm << aIn;
if( nMask & 0x0002 ) rStm << aOut;
@@ -1129,11 +868,6 @@ void SvMetaType::Save( SvPersistStream & rStm )
if( nMask & 0x8000 ) rStm << aBasicPostfix;
}
-/*************************************************************************
-|* SvMetaType::GetAttrList()
-|*
-|* Beschreibung
-*************************************************************************/
SvMetaAttributeMemberList & SvMetaType::GetAttrList() const
{
if( !pAttrList )
@@ -1141,18 +875,12 @@ SvMetaAttributeMemberList & SvMetaType::GetAttrList() const
return *pAttrList;
}
-/*************************************************************************
-|* SvMetaType::SetType()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaType::SetType( int nT )
{
nType = nT;
if( nType == TYPE_ENUM )
{
aOdlName = "short";
-// aSbxDataType = SbxINTEGER;
}
else if( nType == TYPE_CLASS )
{
@@ -1161,11 +889,6 @@ void SvMetaType::SetType( int nT )
}
}
-/*************************************************************************
-|* SvMetaType::GetBaseType()
-|*
-|* Beschreibung
-*************************************************************************/
SvMetaType * SvMetaType::GetBaseType() const
{
if( GetRef() && GetType() == TYPE_BASE )
@@ -1173,11 +896,6 @@ SvMetaType * SvMetaType::GetBaseType() const
return (SvMetaType *)this;
}
-/*************************************************************************
-|* SvMetaType::GetReturnType()
-|*
-|* Beschreibung
-*************************************************************************/
SvMetaType * SvMetaType::GetReturnType() const
{
DBG_ASSERT( GetType() == TYPE_METHOD, "no method" );
@@ -1185,25 +903,6 @@ SvMetaType * SvMetaType::GetReturnType() const
return (SvMetaType *)GetRef();
}
-/*************************************************************************
-|* SvMetaType::GetSbxDataType()
-|*
-|* Beschreibung
-*************************************************************************/
-/*
-SbxDataType SvMetaType::GetSbxDataType() const
-{
- if( aSbxDataType.IsSet() || !GetRef() )
- return (SbxDataType)(int)aSbxDataType;
- else
- return ((SvMetaType *)GetRef())->GetSbxDataType();
-}
-*/
-/*************************************************************************
-|* SvMetaType::GetBasicName()
-|*
-|* Beschreibung
-*************************************************************************/
const ByteString& SvMetaType::GetBasicName() const
{
if( aBasicName.IsSet() || !GetRef() )
@@ -1212,25 +911,12 @@ const ByteString& SvMetaType::GetBasicName() const
return ((SvMetaType*)GetRef())->GetBasicName();
}
-/*************************************************************************
-|* SvMetaType::GetBasicPostfix()
-|*
-|* Beschreibung
-*************************************************************************/
ByteString SvMetaType::GetBasicPostfix() const
{
ByteString aRet;
- // MBN und Co wollen immer "As xxx"
-/*
- if( aBasicPostfix.IsSet() || !GetRef() )
- aRet = aBasicPostfix;
- else
- aRet = ((SvMetaType*)GetRef())->GetBasicPostfix();
-
- if ( !aRet.Len() && GetBasicName().Len() )
-*/
+ // MBN and Co always want "As xxx"
{
aRet = " As ";
@@ -1240,11 +926,6 @@ ByteString SvMetaType::GetBasicPostfix() const
return aRet;
}
-/*************************************************************************
-|* SvMetaType::GetIn()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaType::GetIn() const
{
if( aIn.IsSet() || !GetRef() )
@@ -1253,11 +934,6 @@ sal_Bool SvMetaType::GetIn() const
return ((SvMetaType *)GetRef())->GetIn();
}
-/*************************************************************************
-|* SvMetaType::GetOut()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaType::GetOut() const
{
if( aOut.IsSet() || !GetRef() )
@@ -1266,11 +942,6 @@ sal_Bool SvMetaType::GetOut() const
return ((SvMetaType *)GetRef())->GetOut();
}
-/*************************************************************************
-|* SvMetaType::SetCall0()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaType::SetCall0( int e )
{
aCall0 = (int)e;
@@ -1287,11 +958,6 @@ void SvMetaType::SetCall0( int e )
}
}
-/*************************************************************************
-|* SvMetaType::GetCall0()
-|*
-|* Beschreibung
-*************************************************************************/
int SvMetaType::GetCall0() const
{
if( aCall0.IsSet() || !GetRef() )
@@ -1300,11 +966,6 @@ int SvMetaType::GetCall0() const
return ((SvMetaType *)GetRef())->GetCall0();
}
-/*************************************************************************
-|* SvMetaType::SetCall1()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaType::SetCall1( int e )
{
aCall1 = (int)e;
@@ -1321,11 +982,6 @@ void SvMetaType::SetCall1( int e )
}
}
-/*************************************************************************
-|* SvMetaType::GetCall1()
-|*
-|* Beschreibung
-*************************************************************************/
int SvMetaType::GetCall1() const
{
if( aCall1.IsSet() || !GetRef() )
@@ -1334,11 +990,6 @@ int SvMetaType::GetCall1() const
return ((SvMetaType *)GetRef())->GetCall1();
}
-/*************************************************************************
-|* SvMetaType::GetSvName()
-|*
-|* Beschreibung
-*************************************************************************/
const ByteString & SvMetaType::GetSvName() const
{
if( aSvName.IsSet() || !GetRef() )
@@ -1347,11 +998,6 @@ const ByteString & SvMetaType::GetSvName() const
return ((SvMetaType *)GetRef())->GetSvName();
}
-/*************************************************************************
-|* SvMetaType::GetSbxName()
-|*
-|* Beschreibung
-*************************************************************************/
const ByteString & SvMetaType::GetSbxName() const
{
if( aSbxName.IsSet() || !GetRef() )
@@ -1360,11 +1006,6 @@ const ByteString & SvMetaType::GetSbxName() const
return ((SvMetaType *)GetRef())->GetSbxName();
}
-/*************************************************************************
-|* SvMetaType::GetOdlName()
-|*
-|* Beschreibung
-*************************************************************************/
const ByteString & SvMetaType::GetOdlName() const
{
if( aOdlName.IsSet() || !GetRef() )
@@ -1373,11 +1014,6 @@ const ByteString & SvMetaType::GetOdlName() const
return ((SvMetaType *)GetRef())->GetOdlName();
}
-/*************************************************************************
-|* SvMetaType::GetCName()
-|*
-|* Beschreibung
-*************************************************************************/
const ByteString & SvMetaType::GetCName() const
{
if( aCName.IsSet() || !GetRef() )
@@ -1386,11 +1022,6 @@ const ByteString & SvMetaType::GetCName() const
return ((SvMetaType *)GetRef())->GetCName();
}
-/*************************************************************************
-|* SvMetaType::SetName()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaType::SetName( const ByteString & rName, SvIdlDataBase * pBase )
{
aSvName = rName;
@@ -1401,40 +1032,7 @@ sal_Bool SvMetaType::SetName( const ByteString & rName, SvIdlDataBase * pBase )
return SvMetaReference::SetName( rName, pBase );
}
-/*************************************************************************
-|* SvMetaType::FillSbxObject()
-|*
-|* Beschreibung
-*************************************************************************/
-/*
-void SvMetaType::FillSbxObject( SbxVariable * pObj, sal_Bool bVariable )
-{
- if( PTR_CAST( SbxMethod, pObj ) )
- {
- if( GetType() == TYPE_METHOD )
- {
- sal_uLong nCount = GetAttrCount();
- if( nCount )
- {
- SbxInfoRef xInfo = pObj->GetInfo();
- if( !xInfo.Is() )
- {
- xInfo = new SbxInfo();
- pObj->SetInfo( xInfo );
- }
- for( sal_uLong n = nCount; n > 0; n-- )
- pAttrList->GetObject( n -1 )->FillSbxObject( xInfo );
- }
- }
- }
-}
-*/
#ifdef IDL_COMPILER
-/*************************************************************************
-|* SvMetaType::GetString()
-|*
-|* Beschreibung
-*************************************************************************/
ByteString SvMetaType::GetCString() const
{
ByteString out( GetSvName() );
@@ -1449,11 +1047,6 @@ ByteString SvMetaType::GetCString() const
return out;
}
-/*************************************************************************
-|* SvMetaType::ReadHeaderSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaType::ReadHeaderSvIdl( SvIdlDataBase & rBase,
SvTokenStream & rInStm )
{
@@ -1498,12 +1091,8 @@ sal_Bool SvMetaType::ReadHeaderSvIdl( SvIdlDataBase & rBase,
SetRef( pType );
if( ReadNameSvIdl( rBase, rInStm ) )
{
- /* // um aufwaertskompatibel zu bleiben
- aOdlName = pType->GetOdlName();
- */
if( rInStm.Read( '(' ) )
{
- //DoReadContextSvIdl( rBase, rInStm, ',' );
DoReadContextSvIdl( rBase, rInStm );
if( rInStm.Read( ')' ) )
{
@@ -1531,11 +1120,6 @@ sal_Bool SvMetaType::ReadHeaderSvIdl( SvIdlDataBase & rBase,
return bOk;
}
-/*************************************************************************
-|* SvMetaType::ReadSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaType::ReadSvIdl( SvIdlDataBase & rBase,
SvTokenStream & rInStm )
{
@@ -1547,11 +1131,6 @@ sal_Bool SvMetaType::ReadSvIdl( SvIdlDataBase & rBase,
return sal_False;
}
-/*************************************************************************
-|* SvMetaType::WriteSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaType::WriteSvIdl
(
SvIdlDataBase & rBase,
@@ -1567,16 +1146,11 @@ void SvMetaType::WriteSvIdl
rOutStm << endl;
SvMetaExtern::WriteSvIdl( rBase, rOutStm, nTab );
if( TestAndSeekSpaceOnly( rOutStm, nOldPos ) )
- // nichts geschrieben
+ // nothin written
rOutStm.Seek( nOldPos );
rOutStm << ';' << endl;
}
-/*************************************************************************
-|* SvMetaType::WriteContext()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaType::WriteContext( SvIdlDataBase & rBase, SvStream & rOutStm,
sal_uInt16 nTab,
WriteType nT, WriteAttribute nA )
@@ -1596,17 +1170,12 @@ void SvMetaType::WriteContext( SvIdlDataBase & rBase, SvStream & rOutStm,
}
}
-/*************************************************************************
-|* SvMetaType::Write()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaType::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
sal_uInt16 nTab,
WriteType nT, WriteAttribute nA )
{
if( nT == WRITE_C_HEADER && nType != TYPE_ENUM )
- // nur enum schreiben
+ // write only enum
return;
ByteString name = GetName();
@@ -1681,44 +1250,14 @@ void SvMetaType::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
}
}
-/*************************************************************************
-|* SvMetaType::ReadNamesSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaType::ReadNamesSvIdl( SvIdlDataBase & rBase,
SvTokenStream & rInStm )
{
sal_Bool bOk = ReadNameSvIdl( rBase, rInStm );
-/*
- if( bOk )
- {
- sal_uInt32 nTokPos = rInStm.Tell();
- SvToken * pTok = rInStm.GetToken_Next();
- if( pTok->IsIdentifier() )
- {
- aSbxName = pTok->GetString();
-
- nTokPos = rInStm.Tell();
- pTok = rInStm.GetToken_Next();
- if( pTok->IsIdentifier() )
- {
- aItemName = pTok->GetString();
- nTokPos = rInStm.Tell();
- }
- }
- rInStm.Seek( nTokPos );
- }
-*/
return bOk;
}
-/*************************************************************************
-|* SvMetaType::WriteHeaderSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaType::WriteHeaderSvIdl( SvIdlDataBase & rBase,
SvStream & rOutStm,
sal_uInt16 nTab )
@@ -1779,11 +1318,6 @@ void SvMetaType::WriteHeaderSvIdl( SvIdlDataBase & rBase,
}
}
-/*************************************************************************
-|* SvMetaType::ReadAttributesSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaType::ReadAttributesSvIdl( SvIdlDataBase & rBase,
SvTokenStream & rInStm )
{
@@ -1793,11 +1327,6 @@ void SvMetaType::ReadAttributesSvIdl( SvIdlDataBase & rBase,
aOdlName.ReadSvIdl( SvHash_OdlName(), rInStm );
}
-/*************************************************************************
-|* SvMetaType::WriteAttributesSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaType::WriteAttributesSvIdl( SvIdlDataBase & rBase,
SvStream & rOutStm,
sal_uInt16 nTab )
@@ -1829,11 +1358,6 @@ void SvMetaType::WriteAttributesSvIdl( SvIdlDataBase & rBase,
}
}
-/*************************************************************************
-|* SvMetaType::ReadContextSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaType::ReadContextSvIdl( SvIdlDataBase & rBase,
SvTokenStream & rInStm )
{
@@ -1845,11 +1369,6 @@ void SvMetaType::ReadContextSvIdl( SvIdlDataBase & rBase,
}
}
-/*************************************************************************
-|* SvMetaType::WriteContextSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaType::WriteContextSvIdl
(
SvIdlDataBase & rBase,
@@ -1873,11 +1392,6 @@ void SvMetaType::WriteContextSvIdl
}
}
-/*************************************************************************
-|* SvMetaType::WriteAttributes()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaType::WriteAttributes( SvIdlDataBase & rBase, SvStream & rOutStm,
sal_uInt16 nTab,
WriteType nT, WriteAttribute nA )
@@ -1885,11 +1399,6 @@ void SvMetaType::WriteAttributes( SvIdlDataBase & rBase, SvStream & rOutStm,
SvMetaExtern::WriteAttributes( rBase, rOutStm, nTab, nT, nA );
}
-/*************************************************************************
-|* SvMetaType::MakeSfx()
-|*
-|* Beschreibung
-*************************************************************************/
sal_uLong SvMetaType::MakeSfx( ByteString * pAttrArray )
{
sal_uLong nC = 0;
@@ -1897,7 +1406,7 @@ sal_uLong SvMetaType::MakeSfx( ByteString * pAttrArray )
if( GetBaseType()->GetType() == TYPE_STRUCT )
{
sal_uLong nAttrCount = GetAttrCount();
- // Die einzelnen Attribute schreiben
+ // write the single attributes
for( sal_uLong n = 0; n < nAttrCount; n++ )
{
nC += pAttrList->GetObject( n )->MakeSfx( pAttrArray );
@@ -1919,14 +1428,13 @@ void SvMetaType::WriteSfxItem(
ByteString aTypeName = "SfxType";
ByteString aAttrArray;
sal_uLong nAttrCount = MakeSfx( &aAttrArray );
- //sal_uLong nAttrCount = GetAttrCount();
ByteString aAttrCount( ByteString::CreateFromInt32( nAttrCount ) );
aTypeName += aAttrCount;
rOutStm << "extern " << aTypeName.GetBuffer()
<< aVarName.GetBuffer() << ';' << endl;
- // Den Implementationsteil schreiben
+ // write the implementation part
rOutStm << "#ifdef SFX_TYPEMAP" << endl
<< aTypeName.GetBuffer() << aVarName.GetBuffer()
<< " = " << endl;
@@ -1936,7 +1444,7 @@ void SvMetaType::WriteSfxItem(
if( nAttrCount )
{
rOutStm << ", { ";
- // Die einzelnen Attribute schreiben
+ // write the single attributes
rOutStm << aAttrArray.GetBuffer();
rOutStm << " }";
}
@@ -1944,11 +1452,6 @@ void SvMetaType::WriteSfxItem(
<< "#endif" << endl << endl;
}
-/*************************************************************************
-|* SvMetaType::WriteSfx()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaType::WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm )
{
if( IsItem() )
@@ -1960,18 +1463,12 @@ void SvMetaType::WriteSfx( SvIdlDataBase & rBase, SvStream & rOutStm )
}
}
-/*************************************************************************
-|* SvMetaType::ReadMethodArgs()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvMetaType::ReadMethodArgs( SvIdlDataBase & rBase,
SvTokenStream & rInStm )
{
sal_uInt32 nTokPos = rInStm.Tell();
if( rInStm.Read( '(' ) )
{
- //DoReadContextSvIdl( rBase, rInStm, ',' );
DoReadContextSvIdl( rBase, rInStm );
if( rInStm.Read( ')' ) )
{
@@ -1983,11 +1480,6 @@ sal_Bool SvMetaType::ReadMethodArgs( SvIdlDataBase & rBase,
return sal_False;
}
-/*************************************************************************
-|* SvMetaType::WriteMethodArgs()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaType::WriteMethodArgs
(
SvIdlDataBase & rBase,
@@ -2086,11 +1578,6 @@ void SvMetaType::WriteMethodArgs
}
}
-/*************************************************************************
-|* SvMetaType::WriteTypePrefix()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaType::WriteTypePrefix( SvIdlDataBase & rBase, SvStream & rOutStm,
sal_uInt16 nTab, WriteType nT )
{
@@ -2203,11 +1690,6 @@ void SvMetaType::WriteTypePrefix( SvIdlDataBase & rBase, SvStream & rOutStm,
}
}
-/*************************************************************************
-|* SvMetaType::WriteTheType()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaType::WriteTheType( SvIdlDataBase & rBase, SvStream & rOutStm,
sal_uInt16 nTab, WriteType nT )
{
@@ -2216,11 +1698,6 @@ void SvMetaType::WriteTheType( SvIdlDataBase & rBase, SvStream & rOutStm,
WriteMethodArgs( rBase, rOutStm, nTab +2, nT );
}
-/*************************************************************************
-|* SvMetaType::GetParserString()
-|*
-|* Beschreibung
-*************************************************************************/
ByteString SvMetaType::GetParserString() const
{
SvMetaType * pBT = GetBaseType();
@@ -2233,7 +1710,7 @@ ByteString SvMetaType::GetParserString() const
if( TYPE_METHOD == type || TYPE_STRUCT == type )
{
sal_uLong nAttrCount = GetAttrCount();
- // Die einzelnen Attribute schreiben
+ // write the single attributes
for( sal_uLong n = 0; n < nAttrCount; n++ )
{
SvMetaAttribute * pT = pAttrList->GetObject( n );
@@ -2245,11 +1722,6 @@ ByteString SvMetaType::GetParserString() const
return aPStr;
}
-/*************************************************************************
-|* SvMetaType::WriteParamNames()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaType::WriteParamNames( SvIdlDataBase & rBase,
SvStream & rOutStm,
const ByteString & rChief )
@@ -2265,15 +1737,11 @@ void SvMetaType::WriteParamNames( SvIdlDataBase & rBase,
if( TYPE_METHOD == type || TYPE_STRUCT == type )
{
sal_uLong nAttrCount = GetAttrCount();
- // Die einzelnen Attribute schreiben
+ // write the single attributes
for( sal_uLong n = 0; n < nAttrCount; n++ )
{
SvMetaAttribute * pA = pAttrList->GetObject( n );
- // Fuer Methoden ist rChief immer ""
- ByteString aStr = /*rChief;
- if( aStr.Len() )
- aStr += "->";
- aStr += */pA->GetName();
+ ByteString aStr = pA->GetName();
pA->GetType()->WriteParamNames( rBase, rOutStm, aStr );
if( n +1 < nAttrCount )
rOutStm << ", ";
@@ -2286,16 +1754,7 @@ void SvMetaType::WriteParamNames( SvIdlDataBase & rBase,
#endif // IDL_COMPILER
-/************************************************************************/
-/************************************************************************/
SV_IMPL_META_FACTORY1( SvMetaTypeString, SvMetaType );
-/*************************************************************************
-|*
-|* SvMetaTypeString::SvMetaTypeString()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
SvMetaTypeString::SvMetaTypeString()
: SvMetaType( "String", "SbxSTRING", "BSTR", 's', "char *", "String", "$" )
{
@@ -2311,16 +1770,7 @@ void SvMetaTypeString::Save( SvPersistStream & rStm )
SvMetaType::Save( rStm );
}
-/************************************************************************/
-/************************************************************************/
SV_IMPL_META_FACTORY1( SvMetaEnumValue, SvMetaName );
-/*************************************************************************
-|*
-|* SvMetaEnumValue::SvMetaEnumValue()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
SvMetaEnumValue::SvMetaEnumValue()
{
}
@@ -2334,7 +1784,7 @@ void SvMetaEnumValue::Load( SvPersistStream & rStm )
if( nMask >= 0x02 )
{
rStm.SetError( SVSTREAM_FILEFORMAT_ERROR );
- DBG_ERROR( "wrong format" );
+ OSL_FAIL( "wrong format" );
return;
}
if( nMask & 0x01 ) rStm.ReadByteString( aEnumValue );
@@ -2344,23 +1794,16 @@ void SvMetaEnumValue::Save( SvPersistStream & rStm )
{
SvMetaName::Save( rStm );
- // Maske erstellen
+ // create mask
sal_uInt8 nMask = 0;
if( aEnumValue.Len() ) nMask |= 0x01;
- // Daten schreiben
+ // write data
rStm << nMask;
if( nMask & 0x01 ) rStm.WriteByteString( aEnumValue );
}
#ifdef IDL_COMPILER
-/*************************************************************************
-|*
-|* SvMetaEnumValue::ReadSvIdl()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
sal_Bool SvMetaEnumValue::ReadSvIdl( SvIdlDataBase & rBase,
SvTokenStream & rInStm )
{
@@ -2369,25 +1812,11 @@ sal_Bool SvMetaEnumValue::ReadSvIdl( SvIdlDataBase & rBase,
return sal_True;
}
-/*************************************************************************
-|*
-|* SvMetaEnumValue::WriteSvIdl()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
void SvMetaEnumValue::WriteSvIdl( SvIdlDataBase &, SvStream & rOutStm, sal_uInt16 )
{
rOutStm << GetName().GetBuffer();
}
-/*************************************************************************
-|*
-|* SvMetaEnumValue::Write()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
void SvMetaEnumValue::Write( SvIdlDataBase &, SvStream & rOutStm, sal_uInt16,
WriteType nT, WriteAttribute )
{
@@ -2398,16 +1827,7 @@ void SvMetaEnumValue::Write( SvIdlDataBase &, SvStream & rOutStm, sal_uInt16,
}
#endif // IDL_COMPILER
-/************************************************************************/
-/************************************************************************/
SV_IMPL_META_FACTORY1( SvMetaTypeEnum, SvMetaType );
-/*************************************************************************
-|*
-|* SvMetaTypeEnum::SvMetaTypeEnum()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
SvMetaTypeEnum::SvMetaTypeEnum()
{
SetBasicName( "Integer" );
@@ -2422,7 +1842,7 @@ void SvMetaTypeEnum::Load( SvPersistStream & rStm )
if( nMask >= 0x04 )
{
rStm.SetError( SVSTREAM_FILEFORMAT_ERROR );
- DBG_ERROR( "wrong format" );
+ OSL_FAIL( "wrong format" );
return;
}
if( nMask & 0x01 ) rStm >> aEnumValueList;
@@ -2433,46 +1853,18 @@ void SvMetaTypeEnum::Save( SvPersistStream & rStm )
{
SvMetaType::Save( rStm );
- // Maske erstellen
+ // create mask
sal_uInt8 nMask = 0;
if( aEnumValueList.Count() ) nMask |= 0x01;
if( aPrefix.Len() ) nMask |= 0x02;
- // Daten schreiben
+ // write data
rStm << nMask;
if( nMask & 0x01 ) rStm << aEnumValueList;
if( nMask & 0x02 ) rStm.WriteByteString( aPrefix );
}
-/*************************************************************************
-|*
-|* SvMetaTypeEnum::GetMaxValue()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
-/*
-sal_uInt16 SvMetaTypeEnum::GetMaxValue() const
-{
- sal_uInt16 nMax = 0;
- for( sal_uLong n = 0; n < aEnumValueList.Count(); n++ )
- {
- SvMetaEnumValue * pObj = aEnumValueList.GetObject( n );
- if( nMax < pObj->GetValue() )
- nMax = pObj->GetValue();
- }
- return nMax;
-}
-*/
-
#ifdef IDL_COMPILER
-/*************************************************************************
-|*
-|* SvMetaTypeEnum::ReadContextSvIdl()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
void SvMetaTypeEnum::ReadContextSvIdl( SvIdlDataBase & rBase,
SvTokenStream & rInStm )
{
@@ -2483,7 +1875,7 @@ void SvMetaTypeEnum::ReadContextSvIdl( SvIdlDataBase & rBase,
if( bOk )
{
if( 0 == aEnumValueList.Count() )
- // der Erste
+ // the first
aPrefix = aEnumVal->GetName();
else
{
@@ -2497,13 +1889,6 @@ void SvMetaTypeEnum::ReadContextSvIdl( SvIdlDataBase & rBase,
rInStm.Seek( nTokPos );
}
-/*************************************************************************
-|*
-|* SvMetaTypeEnum::WriteSvIdl()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
void SvMetaTypeEnum::WriteContextSvIdl( SvIdlDataBase & rBase,
SvStream & rOutStm,
sal_uInt16 nTab )
@@ -2519,13 +1904,6 @@ void SvMetaTypeEnum::WriteContextSvIdl( SvIdlDataBase & rBase,
}
}
-/*************************************************************************
-|*
-|* SvMetaTypeEnum::ReadSvIdl()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
sal_Bool SvMetaTypeEnum::ReadSvIdl( SvIdlDataBase & rBase,
SvTokenStream & rInStm )
{
@@ -2540,13 +1918,6 @@ sal_Bool SvMetaTypeEnum::ReadSvIdl( SvIdlDataBase & rBase,
return sal_False;
}
-/*************************************************************************
-|*
-|* SvMetaTypeEnum::WriteSvIdl()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
void SvMetaTypeEnum::WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm,
sal_uInt16 nTab )
{
@@ -2556,13 +1927,6 @@ void SvMetaTypeEnum::WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm,
rOutStm << endl;
}
-/*************************************************************************
-|*
-|* SvMetaTypeEnum::Write()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
void SvMetaTypeEnum::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
sal_uInt16 nTab,
WriteType nT, WriteAttribute nA )
@@ -2570,11 +1934,6 @@ void SvMetaTypeEnum::Write( SvIdlDataBase & rBase, SvStream & rOutStm,
SvMetaType::Write( rBase, rOutStm, nTab, nT, nA );
}
-/*************************************************************************
-|* SvMetaTypeEnum::WriteContext()
-|*
-|* Beschreibung
-*************************************************************************/
void SvMetaTypeEnum::WriteContext( SvIdlDataBase & rBase, SvStream & rOutStm,
sal_uInt16 nTab,
WriteType nT, WriteAttribute nA )
@@ -2602,16 +1961,7 @@ void SvMetaTypeEnum::WriteContext( SvIdlDataBase & rBase, SvStream & rOutStm,
#endif // IDL_COMPILER
-/************************************************************************/
-/************************************************************************/
SV_IMPL_META_FACTORY1( SvMetaTypevoid, SvMetaType );
-/*************************************************************************
-|*
-|* SvMetaTypevoid::SvMetaTypevoid()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
SvMetaTypevoid::SvMetaTypevoid()
: SvMetaType( "void", "SbxVOID", "void", 'v', "void", "", "" )
{
@@ -2635,8 +1985,7 @@ ByteString SvMetaAttribute::Compare( SvMetaAttribute* pAttr )
{
if ( aType->GetType() == TYPE_METHOD )
{
- // Nur testen, wenn das Attribut eine Methode ist, nicht wenn es
- // eine hat !!
+ // Test only when the attribute is a method not if it has one!
if ( !pAttr->GetType()->GetType() == TYPE_METHOD )
aStr += " IsMethod\n";
else if ( aType->GetReturnType() &&
@@ -2697,3 +2046,4 @@ void SvMetaAttribute::WriteCSV( SvIdlDataBase&, SvStream& rStrm )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/source/prj/command.cxx b/idl/source/prj/command.cxx
index 616ed98d182a..a112e3b93f83 100755..100644
--- a/idl/source/prj/command.cxx
+++ b/idl/source/prj/command.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,11 +39,6 @@
#include <database.hxx>
#include <tools/fsys.hxx>
-/*************************************************************************
-|*
-|* Syntaxbeschreibung
-|*
-*************************************************************************/
char const * SyntaxStrings[] = {
"basic-type:",
"\tvoid| char| int| float| double|",
@@ -90,7 +86,6 @@ char const * SyntaxStrings[] = {
"\t\tAccelConfig, MenuConfig, StatusBarConfig, ToolbarConfig",
"\t\tAutomation*",
"\t\tAutoUpdate",
-// "\t\tCachable*, Volatile",
"\t\tContainer",
"\t\tDefault = Identifier",
"\t\tExecMethod = Identifier",
@@ -133,15 +128,6 @@ char CommandLineSyntax[] =
"-help, ? @<file> response file\n"
" <filenames>\n";
-/*************************************************************************
-|*
-|* Init()
-|*
-|* Beschreibung
-|* Ersterstellung MM 15.12.94
-|* Letzte Aenderung MM 15.12.94
-|*
-*************************************************************************/
void Init()
{
if( !IDLAPP->pHashTable )
@@ -150,30 +136,16 @@ void Init()
IDLAPP->pGlobalNames = new SvGlobalHashNames();
}
-/*************************************************************************
-|*
-|* DeInit()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
void DeInit()
{
delete IDLAPP;
}
-/*************************************************************************
-|*
-|* DeInit()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
sal_Bool ReadIdl( SvIdlWorkingBase * pDataBase, const SvCommand & rCommand )
{
- for( sal_uInt16 n = 0; n < rCommand.aInFileList.Count(); n++ )
+ for( size_t n = 0; n < rCommand.aInFileList.size(); ++n )
{
- String aFileName ( *rCommand.aInFileList.GetObject( n ) );
+ String aFileName ( *rCommand.aInFileList[ n ] );
SvFileStream aStm( aFileName, STREAM_STD_READ | STREAM_NOCREATE );
if( aStm.GetError() == SVSTREAM_OK )
{
@@ -211,21 +183,14 @@ sal_Bool ReadIdl( SvIdlWorkingBase * pDataBase, const SvCommand & rCommand )
return sal_True;
}
-/*************************************************************************
-|*
-|* SvCommand::SvCommand()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
static sal_Bool ResponseFile( StringList * pList, int argc, char ** argv )
{
- // Programmname
- pList->Insert( new String( String::CreateFromAscii(*argv) ), LIST_APPEND );
+ // program name
+ pList->push_back( new String( String::CreateFromAscii(*argv) ) );
for( int i = 1; i < argc; i++ )
{
if( '@' == **(argv +i) )
- { // wenn @, dann Response-Datei
+ { // when @, then response file
SvFileStream aStm( String::CreateFromAscii((*(argv +i)) +1), STREAM_STD_READ | STREAM_NOCREATE );
if( aStm.GetError() != SVSTREAM_OK )
return sal_False;
@@ -243,30 +208,25 @@ static sal_Bool ResponseFile( StringList * pList, int argc, char ** argv )
while( aStr.GetChar(n) && !isspace( aStr.GetChar(n) ) )
n++;
if( n != nPos )
- pList->Insert( new String( String::CreateFromAscii( aStr.Copy( nPos, n - nPos ).GetBuffer() ) ), LIST_APPEND );
+ pList->push_back( new String( String::CreateFromAscii( aStr.Copy( nPos, n - nPos ).GetBuffer() ) ) );
}
}
}
else if( argv[ i ] )
- pList->Insert( new String( String::CreateFromAscii( argv[ i ] ) ), LIST_APPEND );
+ pList->push_back( new String( String::CreateFromAscii( argv[ i ] ) ) );
}
return sal_True;
}
-/*************************************************************************
-|* SvCommand::SvCommand()
-|*
-|* Beschreibung
-*************************************************************************/
SvCommand::SvCommand( int argc, char ** argv )
: nVerbosity(1), nFlags( 0 )
{
StringList aList;
if( ResponseFile( &aList, argc, argv ) )
- for( sal_uLong i = 1; i < aList.Count(); i++ )
+ for( size_t i = 1; i < aList.size(); i++ )
{
- String aParam( *aList.GetObject( i ) );
+ String aParam( *aList[ i ] );
sal_Unicode aFirstChar( aParam.GetChar(0) );
if( '-' == aFirstChar )
{
@@ -278,67 +238,58 @@ SvCommand::SvCommand( int argc, char ** argv )
aFirstChar = aParam.GetChar(0);
String aName( aParam.Copy( 1 ) );
if( 's' == aFirstChar )
- { // Name der Slot-Ausgabe
+ { // name of slot output
aSlotMapFile = aName;
}
else if( 'l' == aFirstChar )
- { // Name der Listing
+ { // name of listing
aListFile = aName;
}
else if( 'i' == aFirstChar )
- { // Name der Item-Datei
-// aSfxItemFile = aName;
+ {
}
else if( 'o' == aFirstChar )
- { // Name der ODL-Datei
-// aODLFile = aName;
+ {
}
else if( 'd' == aFirstChar )
- { // Name der Datenbasis-Datei
+ { // name of data set file
aDataBaseFile = aName;
}
else if( 'D' == aFirstChar )
- { // Name der Docu-Datei f"ur das API
-// aDocuFile = aName;
+ {
}
else if( 'C' == aFirstChar )
- { // Name der cxx-Datei
-// aCxxFile = aName;
+ {
}
else if( 'H' == aFirstChar )
- { // Name der hxx-Datei
-// aHxxFile = aName;
+ {
}
else if( 'c' == aFirstChar )
- { // Name der C-Header-Datei
-// aCSourceFile = aName;
+ {
}
else if( 'h' == aFirstChar )
- { // Name der C-Header-Datei
-// aCHeaderFile = aName;
+ {
}
else if( 't' == aFirstChar )
- { // Name der Info-Datei
-// aCallingFile = aName;
+ {
}
else if( 'm' == aFirstChar )
- { // Name der Info-Datei
+ { // name of info file
aTargetFile = aName;
}
else if( 'r' == aFirstChar )
- { // Name der Resource-Datei
-// aSrcFile = aName;
+ {
}
else if( 'z' == aFirstChar )
- { // Name der HelpId-Datei
+ { // name of HelpId file
aHelpIdFile = aName;
}
else if( 'y' == aFirstChar )
- { // Name der CSV-Datei
+ { // name of CSV file
aCSVFile = aName;
}
else if( 'x' == aFirstChar )
- { // Name der IDL-Datei fuer die CSV-Datei
+ { // name of IDL file for the CSV file
aExportFile = aName;
}
else
@@ -351,7 +302,7 @@ SvCommand::SvCommand( int argc, char ** argv )
}
}
else if( aParam.EqualsIgnoreCaseAscii( "help" ) || aParam.EqualsIgnoreCaseAscii( "?" ) )
- { // Hilfe
+ { // help
printf( "%s", CommandLineSyntax );
}
else if( aParam.EqualsIgnoreCaseAscii( "quiet" ) )
@@ -363,23 +314,23 @@ SvCommand::SvCommand( int argc, char ** argv )
nVerbosity = 2;
}
else if( aParam.EqualsIgnoreCaseAscii( "syntax" ) )
- { // Hilfe
+ { // help
int j = 0;
while(SyntaxStrings[j])
printf("%s\n",SyntaxStrings[j++]);
}
else if( aParam.EqualsIgnoreCaseAscii( "i", 0, 1 ) )
- { // Include-Pfade definieren
+ { // define include paths
String aName( aParam.Copy( 1 ) );
if( aPath.Len() )
aPath += DirEntry::GetSearchDelimiter();
aPath += aName;
}
else if( aParam.EqualsIgnoreCaseAscii( "rsc", 0, 3 ) )
- { // erste Zeile im *.srs File
- if( aList.GetObject( i +1 ) )
+ { // first line in *.srs file
+ if( aList[ i + 1 ] )
{
- aSrsLine = ByteString( *aList.GetObject( i +1 ), RTL_TEXTENCODING_UTF8 );
+ aSrsLine = ByteString( *aList[ i +1 ], RTL_TEXTENCODING_UTF8 );
i++;
}
}
@@ -395,7 +346,7 @@ SvCommand::SvCommand( int argc, char ** argv )
}
else
{
- aInFileList.Insert( new String( aParam ), LIST_APPEND );
+ aInFileList.push_back( new String( aParam ) );
}
}
else
@@ -403,15 +354,12 @@ SvCommand::SvCommand( int argc, char ** argv )
printf( "%s", CommandLineSyntax );
}
- String * pStr = aList.First();
- while( pStr )
- {
- delete pStr;
- pStr = aList.Next();
- }
+ for ( size_t i = 0, n = aList.size(); i < n; ++i )
+ delete aList[ i ];
+ aList.clear();
ByteString aInc( getenv( "INCLUDE" ) );
- // Include Environmentvariable anhaengen
+ // append include environment variable
if( aInc.Len() )
{
if( aPath.Len() )
@@ -420,18 +368,12 @@ SvCommand::SvCommand( int argc, char ** argv )
}
}
-/*************************************************************************
-|*
-|* SvCommand::~SvCommand()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
SvCommand::~SvCommand()
{
- // ByteString Liste freigeben
- String * pStr;
- while( NULL != (pStr = aInFileList.Remove()) )
- delete pStr;
+ // release ByteString list
+ for ( size_t i = 0, n = aInFileList.size(); i < n; ++i )
+ delete aInFileList[ i ];
+ aInFileList.clear();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/source/prj/database.cxx b/idl/source/prj/database.cxx
index dd199ea4261d..40831709fe65 100755..100644
--- a/idl/source/prj/database.cxx
+++ b/idl/source/prj/database.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,25 +37,6 @@
#include <database.hxx>
#include <globals.hxx>
-/****************** SvIdlDataBase ****************************************/
-/*************************************************************************
-|* SvIdlDataBase::SvIdlDataBase()
-|*
-|* Beschreibung
-*************************************************************************/
-/*
-void PrimeNumber(){
- sal_uInt16 i, n;
- for( i = 5001; i < 5500; i += 2 ){
- for( n = 2; n < i && ((i % n) != 0); n++ );
- if( n == i ){
- printf( "\nPrimzahl: %d\n", i );
- return;
- }
- }
-}
-*/
-
SvIdlDataBase::SvIdlDataBase( const SvCommand& rCmd )
: bExport( sal_False )
, nUniqueId( 0 )
@@ -63,30 +45,17 @@ SvIdlDataBase::SvIdlDataBase( const SvCommand& rCmd )
, aPersStream( *IDLAPP->pClassMgr, NULL )
, pIdTable( NULL )
{
- //PrimeNumber();
}
-/*************************************************************************
-|* SvIdlDataBase::~SvIdlDataBase()
-|*
-|* Beschreibung
-*************************************************************************/
SvIdlDataBase::~SvIdlDataBase()
{
- String * pStr = aIdFileList.First();
- while( pStr )
- {
- delete pStr;
- pStr = aIdFileList.Next();
- }
+ for ( size_t i = 0, n = aIdFileList.size(); i < n; ++i )
+ delete aIdFileList[ i ];
+ aIdFileList.clear();
+
delete pIdTable;
}
-/*************************************************************************
-|* SvIdlDataBase::GetTypeList()
-|*
-|* Beschreibung
-*************************************************************************/
#define ADD_TYPE( Name, OdlName, ParserChar, CName, BasName, BasPost ) \
aTypeList.Append( new SvMetaType( SvHash_##Name()->GetName(), \
BasName, OdlName, ParserChar, CName, BasName, BasPost ) );
@@ -94,11 +63,11 @@ SvIdlDataBase::~SvIdlDataBase()
SvMetaTypeMemberList & SvIdlDataBase::GetTypeList()
{
if( aTypeList.Count() == 0 )
- { // Initial fuellen
+ { // fill initially
aTypeList.Append( new SvMetaTypeString() );
aTypeList.Append( new SvMetaTypevoid() );
- // MI: IDispatch::Invoke kann keine unsigned
+ // MI: IDispatch::Invoke can not unsigned
ADD_TYPE( UINT16, "long", 'h', "unsigned short", "Long", "&" );
ADD_TYPE( INT16, "short", 'h', "short", "Integer", "%" );
ADD_TYPE( UINT32, "long", 'l', "unsigned long", "Long", "&" );
@@ -111,32 +80,12 @@ SvMetaTypeMemberList & SvIdlDataBase::GetTypeList()
ADD_TYPE( double, "double", 'F', "double", "Double", "#" );
ADD_TYPE( SbxObject, "VARIANT", 'o', "C_Object", "Object", "" );
+ // Attention! When adding types all binary data bases get incompatible
- // A c h t u n g !!!, bei hinzufuegen von Typen werden alle
- // bin�ren Datenbasen inkompatibel
-
- /*
- // So tun als ob die Init-Daten auf einem Stream gelesen wurden
- SvMemoryStream aStm;
- aPersStream.SetStream( &aStm );
- // Alle Init-Daten Streamen
- aPersStream << aTypeList;
- // Nur die Id-Zuordnung merken
- aPersStream.SetStream( NULL );
- */
}
return aTypeList;
}
-/*************************************************************************
-|*
-|* SvIdlDataBase::GetModuleInfo()
-|*
-|* Beschreibung
-|* Ersterstellung MM 13.12.94
-|* Letzte Aenderung MM 13.12.94
-|*
-*************************************************************************/
SvMetaModule * SvIdlDataBase::GetModule( const ByteString & rName )
{
for( sal_uLong n = 0; n < aModuleList.Count(); n++ )
@@ -145,13 +94,6 @@ SvMetaModule * SvIdlDataBase::GetModule( const ByteString & rName )
return NULL;
}
-/*************************************************************************
-|*
-|* SvIdlDataBase::IsBinaryFormat()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
#define DATABASE_SIGNATURE (sal_uInt32)0x13B799F2
#define DATABASE_VER 0x0006
sal_Bool SvIdlDataBase::IsBinaryFormat( SvStream & rStm )
@@ -164,13 +106,6 @@ sal_Bool SvIdlDataBase::IsBinaryFormat( SvStream & rStm )
return nSig == DATABASE_SIGNATURE;
}
-/*************************************************************************
-|*
-|* SvIdlDataBase::Load()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
void SvIdlDataBase::Load( SvStream & rStm )
{
DBG_ASSERT( aTypeList.Count() == 0, "type list already initialized" );
@@ -201,11 +136,6 @@ void SvIdlDataBase::Load( SvStream & rStm )
aPStm.SetError( SVSTREAM_GENERALERROR );
}
-/*************************************************************************
-|* SvIdlDataBase::Save()
-|*
-|* Beschreibung
-*************************************************************************/
void SvIdlDataBase::Save( SvStream & rStm, sal_uInt32 nFlags )
{
SvPersistStream aPStm( *IDLAPP->pClassMgr, &rStm );
@@ -232,18 +162,12 @@ void SvIdlDataBase::Save( SvStream & rStm, sal_uInt32 nFlags )
else
aPStm << aClassList;
- //aClassList.WriteObjects( aPStm, bOnlyStreamedObjs );
aTypeList.WriteObjects( aPStm, bOnlyStreamedObjs );
aAttrList.WriteObjects( aPStm, bOnlyStreamedObjs );
aModuleList.WriteObjects( aPStm, bOnlyStreamedObjs );
aPStm << nUniqueId;
}
-/*************************************************************************
-|* SvIdlDataBase::SetError()
-|*
-|* Beschreibung
-*************************************************************************/
void SvIdlDataBase::SetError( const ByteString & rError, SvToken * pTok )
{
if( pTok->GetLine() > 10000 )
@@ -257,24 +181,12 @@ void SvIdlDataBase::SetError( const ByteString & rError, SvToken * pTok )
}
}
-/*************************************************************************
-|* SvIdlDataBase::Push()
-|*
-|* Beschreibung
-*************************************************************************/
void SvIdlDataBase::Push( SvMetaObject * pObj )
{
GetStack().Push( pObj );
}
#ifdef IDL_COMPILER
-/*************************************************************************
-|*
-|* SvIdlDataBase::FindId()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
sal_Bool SvIdlDataBase::FindId( const ByteString & rIdName, sal_uLong * pVal )
{
if( pIdTable )
@@ -289,13 +201,6 @@ sal_Bool SvIdlDataBase::FindId( const ByteString & rIdName, sal_uLong * pVal )
return sal_False;
}
-/*************************************************************************
-|*
-|* SvIdlDataBase::InsertId()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
sal_Bool SvIdlDataBase::InsertId( const ByteString & rIdName, sal_uLong nVal )
{
if( !pIdTable )
@@ -310,25 +215,16 @@ sal_Bool SvIdlDataBase::InsertId( const ByteString & rIdName, sal_uLong nVal )
return sal_False;
}
-/*************************************************************************
-|* SvIdlDataBase::ReadIdFile()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvIdlDataBase::ReadIdFile( const String & rFileName )
{
DirEntry aFullName( rFileName );
aFullName.Find( GetPath() );
- String * pIdFile = aIdFileList.First();
- while( pIdFile )
- {
- if( *pIdFile == rFileName )
- return sal_True; // schon eingelesen
- pIdFile = aIdFileList.Next();
- }
+ for ( size_t i = 0, n = aIdFileList.size(); i < n; ++i )
+ if ( *aIdFileList[ i ] == rFileName )
+ return sal_True;
- aIdFileList.Insert( new String( rFileName ), LIST_APPEND );
+ aIdFileList.push_back( new String( rFileName ) );
SvTokenStream aTokStm( aFullName.GetFull() );
if( aTokStm.GetStream().GetError() == SVSTREAM_OK )
@@ -349,7 +245,7 @@ sal_Bool SvIdlDataBase::ReadIdFile( const String & rFileName )
else
{
ByteString aStr( "unexpected token after define" );
- // Fehler setzen
+ // set error
SetError( aStr, pTok );
WriteError( aTokStm );
return sal_False;
@@ -381,7 +277,7 @@ sal_Bool SvIdlDataBase::ReadIdFile( const String & rFileName )
ByteString aStr( "unknown operator '" );
aStr += pTok->GetChar();
aStr += "'in define";
- // Fehler setzen
+ // set error
SetError( aStr, pTok );
WriteError( aTokStm );
return sal_False;
@@ -389,8 +285,8 @@ sal_Bool SvIdlDataBase::ReadIdFile( const String & rFileName )
if( pTok->GetChar() != '+'
&& pTok->GetChar() != '('
&& pTok->GetChar() != ')' )
- // nur + erlaubt, Klammern spielen kein Rolle,
- // da + komutativ ist
+ // only + is allowed, parentheses are immaterial
+ // because + is commutative
break;
}
else if( pTok->IsInteger() )
@@ -429,7 +325,7 @@ sal_Bool SvIdlDataBase::ReadIdFile( const String & rFileName )
if( pTok->IsEof() )
{
ByteString aStr( "unexpected eof in #include" );
- // Fehler setzen
+ // set error
SetError( aStr, pTok );
WriteError( aTokStm );
return sal_False;
@@ -454,11 +350,6 @@ sal_Bool SvIdlDataBase::ReadIdFile( const String & rFileName )
return sal_True;
}
-/*************************************************************************
-|* SvIdlDataBase::FindType()
-|*
-|* Beschreibung
-*************************************************************************/
SvMetaType * SvIdlDataBase::FindType( const SvMetaType * pPType,
SvMetaTypeMemberList & rList )
{
@@ -476,25 +367,20 @@ SvMetaType * SvIdlDataBase::FindType( const ByteString & rName )
return pType;
}
-/*************************************************************************
-|* SvIdlDataBase::ReadKnownType()
-|*
-|* Beschreibung
-*************************************************************************/
SvMetaType * SvIdlDataBase::ReadKnownType( SvTokenStream & rInStm )
{
sal_Bool bIn = sal_False;
sal_Bool bOut = sal_False;
int nCall0 = CALL_VALUE;
int nCall1 = CALL_VALUE;
- sal_Bool bSet = sal_False; //irgent ein Attribut gesetzt
+ sal_Bool bSet = sal_False; // any attribute set
sal_uInt32 nTokPos = rInStm.Tell();
SvToken * pTok = rInStm.GetToken_Next();
if( pTok->HasHash() )
{
- sal_uInt32 nBeginPos = 0; // kann mit Tell nicht vorkommen
+ sal_uInt32 nBeginPos = 0; // can not happen with Tell
while( nBeginPos != rInStm.Tell() )
{
nBeginPos = rInStm.Tell();
@@ -519,10 +405,7 @@ SvMetaType * SvIdlDataBase::ReadKnownType( SvTokenStream & rInStm )
}
}
}
-/*
- SvMetaTypeList aTmpTypeList;
- if( FillTypeList( aTmpTypeList, pTok ) )
-*/
+
if( pTok->IsIdentifier() )
{
ByteString aName = pTok->GetString();
@@ -554,23 +437,9 @@ SvMetaType * SvIdlDataBase::ReadKnownType( SvTokenStream & rInStm )
bSet = sal_True;
}
}
- /*
- SvMetaType * pMetaType = aTmpTypeList.First();
- while( pMetaType )
- {
- if( pMetaType->GetIn() == bIn
- && pMetaType->GetOut() == bOut
- && pMetaType->GetCall0() == nCall0
- && pMetaType->GetCall1() == nCall1 )
- {
- return pMetaType;
- }
- pMetaType = aTmpTypeList.Next();
- }
- */
- //SvMetaType * pType = aTmpTypeList.First();
+
if( !bSet )
- // Ist genau dieser Typ
+ // is exactly this type
return pType;
DBG_ASSERT( aTmpTypeList.First(), "mindestens ein Element" );
@@ -589,18 +458,11 @@ SvMetaType * SvIdlDataBase::ReadKnownType( SvTokenStream & rInStm )
return NULL;
}
-/*************************************************************************
-|*
-|* SvIdlDataBase::ReadKnownAttr()
-|*
-|* Beschreibung
-|*
-*************************************************************************/
SvMetaAttribute * SvIdlDataBase::ReadKnownAttr
(
SvTokenStream & rInStm,
- SvMetaType * pType /* Wenn der pType == NULL, dann muss der Typ
- noch gelesen werden. */
+ SvMetaType * pType /* If pType == NULL, then the type has
+ still to be read. */
)
{
sal_uInt32 nTokPos = rInStm.Tell();
@@ -608,24 +470,9 @@ SvMetaAttribute * SvIdlDataBase::ReadKnownAttr
if( !pType )
pType = ReadKnownType( rInStm );
- if( pType )
- {
- // Wenn wir Slots auf die Wiese stellen, d"urfen wir nicht voraussetzen,
- // da\s jeder Slot einen anderen Namen hat!
-/*
- SvToken * pTok = rInStm.GetToken_Next();
- if( pTok->IsIdentifier() )
- for( sal_uLong n = 0; n < aAttrList.Count(); n++ )
- {
- SvMetaAttribute * pAttr = aAttrList.GetObject( n );
- if( pAttr->GetName() == pTok->GetString() )
- return pAttr;
- }
-*/
- }
- else
+ if( !pType )
{
- // sonst SlotId?
+ // otherwise SlotId?
SvToken * pTok = rInStm.GetToken_Next();
if( pTok->IsIdentifier() )
{
@@ -642,7 +489,7 @@ SvMetaAttribute * SvIdlDataBase::ReadKnownAttr
ByteString aStr( "Nicht gefunden : " );
aStr += pTok->GetString();
- DBG_ERROR( aStr.GetBuffer() );
+ OSL_FAIL( aStr.GetBuffer() );
}
}
@@ -669,11 +516,6 @@ SvMetaAttribute* SvIdlDataBase::SearchKnownAttr
return NULL;
}
-/*************************************************************************
-|* SvIdlDataBase::ReadKnownClass()
-|*
-|* Beschreibung
-*************************************************************************/
SvMetaClass * SvIdlDataBase::ReadKnownClass( SvTokenStream & rInStm )
{
sal_uInt32 nTokPos = rInStm.Tell();
@@ -691,45 +533,30 @@ SvMetaClass * SvIdlDataBase::ReadKnownClass( SvTokenStream & rInStm )
return NULL;
}
-/*************************************************************************
-|* SvIdlDataBase::Write()
-|*
-|* Beschreibung
-*************************************************************************/
void SvIdlDataBase::Write( const ByteString & rText )
{
if( nVerbosity != 0 )
fprintf( stdout, "%s", rText.GetBuffer() );
}
-/*************************************************************************
-|* SvIdlDataBase::WriteError()
-|*
-|* Beschreibung
-*************************************************************************/
void SvIdlDataBase::WriteError( const ByteString & rErrWrn,
const ByteString & rFileName,
const ByteString & rErrorText,
sal_uLong nRow, sal_uLong nColumn ) const
{
- //Fehlerbehandlung
+ // error treatment
fprintf( stderr, "\n%s --- %s: ( %ld, %ld )\n",
rFileName.GetBuffer(), rErrWrn.GetBuffer(), nRow, nColumn );
if( rErrorText.Len() )
- { // Fehler gesetzt
+ { // error set
fprintf( stderr, "\t%s\n", rErrorText.GetBuffer() );
}
}
-/*************************************************************************
-|* SvIdlDataBase::WriteError()
-|*
-|* Beschreibung
-*************************************************************************/
void SvIdlDataBase::WriteError( SvTokenStream & rInStm )
{
- //Fehlerbehandlung
+ // error treatment
String aFileName( rInStm.GetFileName() );
ByteString aErrorText;
sal_uLong nRow = 0, nColumn = 0;
@@ -737,14 +564,14 @@ void SvIdlDataBase::WriteError( SvTokenStream & rInStm )
rInStm.SeekEnd();
SvToken *pTok = rInStm.GetToken();
- // Fehlerposition
+ // error position
nRow = pTok->GetLine();
nColumn = pTok->GetColumn();
if( aError.IsError() )
- { // Fehler gesetzt
- // Fehler Token suchen
- // Fehlertext
+ { // error set
+ // search error token
+ // error text
if( aError.GetText().Len() )
{
aErrorText = "may be <";
@@ -760,14 +587,14 @@ void SvIdlDataBase::WriteError( SvTokenStream & rInStm )
pTok = rInStm.GetToken_PrevAll();
}
- // Fehlerposition
+ // error position
aErrorText += "> at ( ";
aErrorText += ByteString::CreateFromInt64(aError.nLine);
aErrorText += ", ";
aErrorText += ByteString::CreateFromInt64(aError.nColumn);
aErrorText += " )";
- // Fehler zuruecksetzen
+ // reset error
aError = SvIdlError();
}
@@ -777,7 +604,7 @@ void SvIdlDataBase::WriteError( SvTokenStream & rInStm )
if( !pTok )
return;
- // Identifier in der Naehe suchen
+ // look for identifier close by
if( !pTok->IsIdentifier() )
{
rInStm.GetToken_PrevAll();
@@ -791,28 +618,17 @@ void SvIdlDataBase::WriteError( SvTokenStream & rInStm )
}
}
-/****************** SvIdlWorkingBase ****************************************/
-/*************************************************************************
-|* SvIdlWorkingBase::SvIdlWorkingBase()
-|*
-|* Beschreibung
-*************************************************************************/
SvIdlWorkingBase::SvIdlWorkingBase(const SvCommand& rCmd) : SvIdlDataBase(rCmd)
{
}
-/*************************************************************************
-|* SvIdlWorkingBase::ReadSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvIdlWorkingBase::ReadSvIdl( SvTokenStream & rInStm, sal_Bool bImported, const String & rPath )
{
- aPath = rPath; // nur fuer den durchlauf gueltig
+ aPath = rPath; // only valid for this iteration
SvToken * pTok;
sal_Bool bOk = sal_True;
pTok = rInStm.GetToken();
- // nur ein import ganz am Anfang
+ // only one import at the very beginning
if( pTok->Is( SvHash_import() ) )
{
rInStm.GetToken_Next();
@@ -852,7 +668,7 @@ sal_Bool SvIdlWorkingBase::ReadSvIdl( SvTokenStream & rInStm, sal_Bool bImported
bOk = sal_False;
}
- sal_uInt32 nBeginPos = 0xFFFFFFFF; // kann mit Tell nicht vorkommen
+ sal_uInt32 nBeginPos = 0xFFFFFFFF; // can not happen with Tell
while( bOk && nBeginPos != rInStm.Tell() )
{
@@ -863,8 +679,8 @@ sal_Bool SvIdlWorkingBase::ReadSvIdl( SvTokenStream & rInStm, sal_Bool bImported
if( pTok->IsEmpty() )
bOk = sal_False;
- // nur ein import ganz am Anfang
- /*else */if( pTok->Is( SvHash_module() ) )
+ // only one import at the very beginning
+ if( pTok->Is( SvHash_module() ) )
{
SvMetaModuleRef aModule = new SvMetaModule( rInStm.GetFileName(), bImported );
if( aModule->ReadSvIdl( *this, rInStm ) )
@@ -877,18 +693,13 @@ sal_Bool SvIdlWorkingBase::ReadSvIdl( SvTokenStream & rInStm, sal_Bool bImported
}
if( !bOk || !pTok->IsEof() )
{
- //Fehlerbehandlung
+ // error treatment
WriteError( rInStm );
return sal_False;
}
return sal_True;
}
-/*************************************************************************
-|* SvIdlWorkingBase::WriteSvIdl()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvIdlWorkingBase::WriteSvIdl( SvStream & rOutStm )
{
if( rOutStm.GetError() != SVSTREAM_OK )
@@ -898,38 +709,31 @@ sal_Bool SvIdlWorkingBase::WriteSvIdl( SvStream & rOutStm )
if( GetIdTable() )
{
GetIdTable()->FillHashList( &aList );
- SvStringHashEntry * pEntry = aList.First();
- while( pEntry )
+ for ( size_t i = 0, n = aList.size(); i < n; ++i )
{
+ SvStringHashEntry* pEntry = aList[ i ];
rOutStm << "#define " << pEntry->GetName().GetBuffer()
<< '\t'
<< ByteString::CreateFromInt64(
pEntry->GetValue() ).GetBuffer()
<< endl;
- pEntry = aList.Next();
}
}
for( sal_uLong n = 0; n < GetModuleList().Count(); n++ )
{
SvMetaModule * pModule = GetModuleList().GetObject( n );
- //if( !pModule->IsImported() )
- pModule->WriteSvIdl( *this, rOutStm, 0 );
+ pModule->WriteSvIdl( *this, rOutStm, 0 );
}
return sal_True;
}
-/*************************************************************************
-|* SvIdlWorkingBase::WriteSfx()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvIdlWorkingBase::WriteSfx( SvStream & rOutStm )
{
if( rOutStm.GetError() != SVSTREAM_OK )
return sal_False;
- // alle Tmp-Variablen fuer das Schreiben zuruecksetzen
+ // reset all tmp variables for writing
WriteReset();
SvMemoryStream aTmpStm( 256000, 256000 );
sal_uLong n;
@@ -960,8 +764,7 @@ sal_Bool SvIdlWorkingBase::WriteHelpIds( SvStream& rOutStm )
for( n = 0; n < GetModuleList().Count(); n++ )
{
SvMetaModule * pModule = GetModuleList().GetObject( n );
- //if( !pModule->IsImported() )
- pModule->WriteHelpIds( *this, rOutStm, &aIdTable );
+ pModule->WriteHelpIds( *this, rOutStm, &aIdTable );
}
const SvMetaAttributeMemberList & rAttrList = GetAttrList();
@@ -974,11 +777,6 @@ sal_Bool SvIdlWorkingBase::WriteHelpIds( SvStream& rOutStm )
return sal_True;
}
-/*************************************************************************
-|* SvIdlWorkingBase::WriteSfxItem()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvIdlWorkingBase::WriteSfxItem( SvStream & )
{
return sal_False;
@@ -1014,11 +812,6 @@ sal_Bool SvIdlWorkingBase::WriteCSV( SvStream& rStrm )
return sal_True;
}
-/*************************************************************************
-|* SvIdlWorkingBase::WriteDocumentation()
-|*
-|* Beschreibung
-*************************************************************************/
sal_Bool SvIdlWorkingBase::WriteDocumentation( SvStream & rOutStm )
{
if( rOutStm.GetError() != SVSTREAM_OK )
@@ -1037,3 +830,4 @@ sal_Bool SvIdlWorkingBase::WriteDocumentation( SvStream & rOutStm )
#endif // IDL_COMPILER
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/source/prj/globals.cxx b/idl/source/prj/globals.cxx
index d213fc06b16a..cf79f7c02296 100755..100644
--- a/idl/source/prj/globals.cxx
+++ b/idl/source/prj/globals.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,21 +29,16 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_idl.hxx"
-/****************** I N C L U D E S **************************************/
#include <tools/shl.hxx>
#include <globals.hxx>
#include <database.hxx>
-/****************** G L O B A L S ****************************************/
IdlDll * GetIdlApp()
{
if( !(*(IdlDll**)GetAppData(SHL_IDL)) )
{
(*(IdlDll**)GetAppData(SHL_IDL)) = new IdlDll();
- // Temporaer, sonst nur wenn Compiler
- //GetIdlApp()->pHashTable = new SvStringHashTable( 2801 );
- //GetIdlApp()->pGlobalNames = new SvGlobalHashNames();
}
return (*(IdlDll**)GetAppData(SHL_IDL));
}
@@ -82,15 +78,6 @@ IdlDll::~IdlDll()
delete pHashTable;
}
-/*************************************************************************
-|*
-|* SvGlobalHashNames::SvGlobalHashNames()
-|*
-|* Beschreibung
-|* Ersterstellung MM 08.08.91
-|* Letzte Aenderung MM 08.08.91
-|*
-*************************************************************************/
inline SvStringHashEntry * INS( const ByteString & rName )
{
sal_uInt32 nIdx;
@@ -119,7 +106,6 @@ SvGlobalHashNames::SvGlobalHashNames()
, MM_SlotId( INS( "SlotId" ) )
, MM_HasCoreId( INS( "HasCoreId" ) )
, MM_Cachable( INS( "Cachable" ) )
-// , MM_Volatile( INS( "Volatile" ) )
, MM_Toggle( INS( "Toggle" ) )
, MM_AutoUpdate( INS( "AutoUpdate" ) )
, MM_Synchron( INS( "Synchron" ) )
@@ -187,3 +173,4 @@ SvGlobalHashNames::SvGlobalHashNames()
A_ENTRY(UnoName)
{}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/source/prj/makefile.mk b/idl/source/prj/makefile.mk
index c33d2e9f3d7a..c33d2e9f3d7a 100644..100755
--- a/idl/source/prj/makefile.mk
+++ b/idl/source/prj/makefile.mk
diff --git a/idl/source/prj/svidl.cxx b/idl/source/prj/svidl.cxx
index d2884464b5a7..0c7a66e7aa70 100755..100644
--- a/idl/source/prj/svidl.cxx
+++ b/idl/source/prj/svidl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -73,35 +74,23 @@ sal_Bool FileMove_Impl( const String & rFile1, const String & rFile2, sal_Bool b
}
DirEntry aF2( rFile2 );
if( nC1 != nC2 )
- {// es hat sich etwas geaendert
+ {// something has changed
DirEntry aF1( rFile1 );
aF1.Kill();
- // Datei verschieben
+ // move file
if( aF2.MoveTo( aF1 ) )
{
- // Beide Dateien loeschen
+ // delete both files
aF1.Kill();
aF2.Kill();
return sal_False;
}
-/*
- else
- {
- printf( "%s to %s moved\n",
- rFile2.GetStr(), rFile1.GetStr() );
- }
-*/
return sal_True;
}
return 0 == aF2.Kill();
}
-/*************************************************************************
-|* main()
-|*
-|* Beschreibung
-*************************************************************************/
-#if defined( UNX ) || (defined( PM2 ) && defined( CSET )) || defined (WTC) || defined (MTW) || defined (__MINGW32__) || defined( OS2 )
+#if defined( UNX ) || defined (__MINGW32__)
int main ( int argc, char ** argv)
{
#else
@@ -109,15 +98,6 @@ int cdecl main ( int argc, char ** argv)
{
#endif
-/*
- pStr = ::ResponseFile( &aCmdLine, argv, argc );
- if( pStr )
- {
- printf( "Cannot open response file <%s>\n", pStr );
- return( 1 );
- };
-*/
-
String aTmpListFile;
String aTmpSlotMapFile;
String aTmpSfxItemFile;
@@ -246,66 +226,6 @@ int cdecl main ( int argc, char ** argv)
fprintf( stderr, "%s\n", aStr.GetBuffer() );
}
}
-/*
- if( nExit == 0 && aCommand.aCallingFile.Len() )
- {
- DirEntry aDE( aCommand.aCallingFile );
- aDE.ToAbs();
- aTmpCallingFile = aDE.GetPath().TempName().GetFull();
- SvFileStream aOutStm( aTmpCallingFile, STREAM_READWRITE | STREAM_TRUNC );
- pDataBase->WriteSbx( aOutStm );
- //pDataBase->Save( aOutStm, aCommand.nFlags | IDL_WRITE_CALLING );
- if( aOutStm.GetError() != SVSTREAM_OK )
- {
- nExit = -1;
- ByteString aStr = "cannot write calling file: ";
- aStr += aCommand.aCallingFile;
- fprintf( stderr, "%s\n", aStr.GetStr() );
- }
- }
- if( nExit == 0 && aCommand.aCxxFile.Len() )
- {
- DirEntry aDE( aCommand.aCxxFile );
- aDE.ToAbs();
- aTmpCxxFile = aDE.GetPath().TempName().GetFull();
- SvFileStream aOutStm( aTmpCxxFile, STREAM_READWRITE | STREAM_TRUNC );
-
- aOutStm << "#pragma hdrstop" << endl;
- aOutStm << "#include <";
- if( aCommand.aHxxFile.Len() )
- aOutStm << DirEntry(aCommand.aHxxFile).GetName().GetBuffer();
- else
- {
- DirEntry aDE( aCommand.aCxxFile );
- aDE.SetExtension( "hxx" );
- aOutStm << aDE.GetName().GetBuffer);
- }
- aOutStm << '>' << endl;
- if( !pDataBase->WriteCxx( aOutStm ) )
- {
- nExit = -1;
- ByteString aStr = "cannot write cxx file: ";
- aStr += ByteString( aCommand.aCxxFile, RTL_TEXTENCODING_UTF8 );
- fprintf( stderr, "%s\n", aStr.GetBuffer() );
- }
- }
- if( nExit == 0 && aCommand.aHxxFile.Len() )
- {
- DirEntry aDE( aCommand.aHxxFile );
- aDE.ToAbs();
- aTmpHxxFile = aDE.GetPath().TempName().GetFull();
- SvFileStream aOutStm( aTmpHxxFile, STREAM_READWRITE | STREAM_TRUNC );
-
- aOutStm << "#include <somisc.hxx>" << endl;
- if( !pDataBase->WriteHxx( aOutStm ) )
- {
- nExit = -1;
- ByteString aStr = "cannot write cxx file: ";
- aStr += ByteString( aCommand.aHxxFile, RTL_TEXTENCODING_UTF8 );
- fprintf( stderr, "%s\n", aStr.GetBuffer() );
- }
- }
- */
}
else
nExit = -1;
@@ -413,7 +333,7 @@ int cdecl main ( int argc, char ** argv)
DirEntry aT(aCommand.aTargetFile);
aT.Kill();
#endif
- // Datei stempeln, da idl korrekt durchlaufen wurde
+ // stamp file, because idl passed through correctly
SvFileStream aOutStm( aCommand.aTargetFile,
STREAM_READWRITE | STREAM_TRUNC );
}
@@ -445,3 +365,4 @@ int cdecl main ( int argc, char ** argv)
return nExit;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/idl/source/svidl.dat b/idl/source/svidl.dat
index 4750475c7462..4750475c7462 100644..100755
--- a/idl/source/svidl.dat
+++ b/idl/source/svidl.dat
Binary files differ
diff --git a/idl/util/makefile.mk b/idl/util/makefile.mk
index 27cc52ef276e..27cc52ef276e 100644..100755
--- a/idl/util/makefile.mk
+++ b/idl/util/makefile.mk