diff options
Diffstat (limited to 'binfilter/bf_sc/source/core/inc')
-rw-r--r-- | binfilter/bf_sc/source/core/inc/addinhelpid.hxx | 63 | ||||
-rw-r--r-- | binfilter/bf_sc/source/core/inc/addinlis.hxx | 105 | ||||
-rw-r--r-- | binfilter/bf_sc/source/core/inc/adiasync.hxx | 95 | ||||
-rw-r--r-- | binfilter/bf_sc/source/core/inc/ansitab.hxx | 585 | ||||
-rw-r--r-- | binfilter/bf_sc/source/core/inc/bcaslot.hxx | 158 | ||||
-rw-r--r-- | binfilter/bf_sc/source/core/inc/ddelink.hxx | 91 | ||||
-rw-r--r-- | binfilter/bf_sc/source/core/inc/interpre.hxx | 723 | ||||
-rw-r--r-- | binfilter/bf_sc/source/core/inc/poolhelp.hxx | 70 | ||||
-rw-r--r-- | binfilter/bf_sc/source/core/inc/refupdat.hxx | 77 | ||||
-rw-r--r-- | binfilter/bf_sc/source/core/inc/scmatrix.hxx | 184 | ||||
-rw-r--r-- | binfilter/bf_sc/source/core/inc/scrdata.hxx | 53 |
11 files changed, 2204 insertions, 0 deletions
diff --git a/binfilter/bf_sc/source/core/inc/addinhelpid.hxx b/binfilter/bf_sc/source/core/inc/addinhelpid.hxx new file mode 100644 index 000000000000..ca78d9b16725 --- /dev/null +++ b/binfilter/bf_sc/source/core/inc/addinhelpid.hxx @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 SC_ADDINHELPID_HXX +#define SC_ADDINHELPID_HXX + +#include <rtl/ustring.hxx> +namespace binfilter { + + +// ============================================================================ + +struct ScUnoAddInHelpId; + +/** Generates help IDs for standard Calc AddIns. */ +class ScUnoAddInHelpIdGenerator +{ +private: + const ScUnoAddInHelpId* pCurrHelpIds; /// Array of function names and help IDs. + sal_uInt32 nArrayCount; /// Count of array entries. + +public: + ScUnoAddInHelpIdGenerator( const ::rtl::OUString& rServiceName ); + + /** Sets service name of the AddIn. Has to be done before requesting help IDs. */ + void SetServiceName( const ::rtl::OUString& rServiceName ); + + /** @return The help ID of the function with given built-in name or 0 if not found. */ + sal_uInt16 GetHelpId( const ::rtl::OUString& rFuncName ) const; +}; + + +// ============================================================================ + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sc/source/core/inc/addinlis.hxx b/binfilter/bf_sc/source/core/inc/addinlis.hxx new file mode 100644 index 000000000000..0ff0734d18a5 --- /dev/null +++ b/binfilter/bf_sc/source/core/inc/addinlis.hxx @@ -0,0 +1,105 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 SC_ADDINLIS_HXX +#define SC_ADDINLIS_HXX + +#include "adiasync.hxx" // for ScAddInDocs PtrArr + +#include <com/sun/star/sheet/XResultListener.hpp> + +#include <com/sun/star/sheet/XVolatileResult.hpp> + +#include <com/sun/star/lang/XServiceInfo.hpp> + +#include <cppuhelper/implbase2.hxx> +namespace binfilter { + + + +class ScDocument; + + +class ScAddInListener : public cppu::WeakImplHelper2< + ::com::sun::star::sheet::XResultListener, + ::com::sun::star::lang::XServiceInfo >, + public SfxBroadcaster +{ +private: + ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XVolatileResult> xVolRes; + ::com::sun::star::uno::Any aResult; + ScAddInDocs* pDocs; // documents where this is used + + static List aAllListeners; + + // always allocated via CreateListener + ScAddInListener( + ::com::sun::star::uno::Reference< + ::com::sun::star::sheet::XVolatileResult> xVR, + ScDocument* pD ); + +public: + virtual ~ScAddInListener(); + + // create Listener and put it into global list + static ScAddInListener* CreateListener( + ::com::sun::star::uno::Reference< + ::com::sun::star::sheet::XVolatileResult> xVR, + ScDocument* pDoc ); + + static ScAddInListener* Get( ::com::sun::star::uno::Reference< + ::com::sun::star::sheet::XVolatileResult> xVR ); + static void RemoveDocument( ScDocument* pDocument ); + + BOOL HasDocument( ScDocument* pDoc ) const { return pDocs->Seek_Entry( pDoc ); } + void AddDocument( ScDocument* pDoc ) { pDocs->Insert( pDoc ); } + const ::com::sun::star::uno::Any& GetResult() const { return aResult; } + + + // XResultListener + virtual void SAL_CALL modified( const ::com::sun::star::sheet::ResultEvent& aEvent ) + throw(::com::sun::star::uno::RuntimeException); + + // XEventListener + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) + throw(::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName( ) + throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) + throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) + throw(::com::sun::star::uno::RuntimeException); +}; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sc/source/core/inc/adiasync.hxx b/binfilter/bf_sc/source/core/inc/adiasync.hxx new file mode 100644 index 000000000000..2214d2fe6860 --- /dev/null +++ b/binfilter/bf_sc/source/core/inc/adiasync.hxx @@ -0,0 +1,95 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 _SC_ADIASYNC_HXX +#define _SC_ADIASYNC_HXX + +#include <bf_svtools/brdcst.hxx> + +#include "callform.hxx" +class String; +namespace binfilter { + +extern "C" { +void CALLTYPE ScAddInAsyncCallBack( double& nHandle, void* pData ); +} + + +class ScAddInAsync; +typedef ScAddInAsync* ScAddInAsyncPtr; +SV_DECL_PTRARR_SORT( ScAddInAsyncs, ScAddInAsyncPtr, 4, 4 )//STRIP008 ; +extern ScAddInAsyncs theAddInAsyncTbl; // in adiasync.cxx + +class ScDocument; +typedef ScDocument* ScAddInDocPtr; +SV_DECL_PTRARR_SORT( ScAddInDocs, ScAddInDocPtr, 1, 1 )//STRIP008 ; + + +class ScAddInAsync : public SfxBroadcaster +{ +private: + union + { + double nVal; // aktueller Wert + String* pStr; + }; + ScAddInDocs* pDocs; // Liste der benutzenden Dokumente + FuncData* pFuncData; // Zeiger auf die Daten in der Collection + ULONG nHandle; // wird von double auf ULONG gecasted + ParamType eType; // PTR_DOUBLE oder PTR_STRING Ergebnis + BOOL bValid; // ob Wert gueltig + +public: + // cTor nur wenn ScAddInAsync::Get fehlschlaegt! + // nIndex: Index aus der FunctionCollection + ScAddInAsync( ULONG nHandle, USHORT nIndex, + ScDocument* pDoc ); + // default-cTor nur fuer das eine globale aSeekObj !!! + ScAddInAsync(); + virtual ~ScAddInAsync(); + static ScAddInAsync* Get( ULONG nHandle ); + static void RemoveDocument( ScDocument* pDocument ); + BOOL IsValid() const { return bValid; } + ParamType GetType() const { return eType; } + double GetValue() const { return nVal; } + const String& GetString() const { return *pStr; } + BOOL HasDocument( ScDocument* pDoc ) const + { return pDocs->Seek_Entry( pDoc ); } + void AddDocument( ScDocument* pDoc ) { pDocs->Insert( pDoc ); } + + // Vergleichsoperatoren fuer PtrArrSort + BOOL operator < ( const ScAddInAsync& r ) { return nHandle < r.nHandle; } + BOOL operator ==( const ScAddInAsync& r ) { return nHandle == r.nHandle; } +}; + + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sc/source/core/inc/ansitab.hxx b/binfilter/bf_sc/source/core/inc/ansitab.hxx new file mode 100644 index 000000000000..afa5f9e1219b --- /dev/null +++ b/binfilter/bf_sc/source/core/inc/ansitab.hxx @@ -0,0 +1,585 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 SC_ANSITAB_HXX +#define SC_ANSITAB_HXX + +#include <tools/solar.h> +namespace binfilter { + +#define C_ILLEGAL 0x0000 +#define C_CHAR 0x0001 +#define C_CHAR_BOOL 0x0002 +#define C_CHAR_WORD 0x0004 +#define C_CHAR_VALUE 0x0008 +#define C_CHAR_STRING 0x0010 +#define C_CHAR_DONTCARE 0x0020 +#define C_BOOL 0x0040 +#define C_WORD 0x0080 +#define C_WORD_SEP 0x0100 +#define C_VALUE 0x0200 +#define C_VALUE_SEP 0x0400 +#define C_VALUE_EXP 0x0800 +#define C_VALUE_SIGN 0x1000 +#define C_VALUE_VALUE 0x2000 +#define C_STRING_SEP 0x4000 + +#ifdef OS2 +USHORT CharTable[256] = +{ + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_CHAR_DONTCARE | C_WORD_SEP | C_VALUE_SEP, // 32 = " " + C_CHAR | C_WORD_SEP | C_VALUE_SEP, // 33 = "!" + C_CHAR_STRING | C_STRING_SEP, + C_ILLEGAL, + C_CHAR_WORD | C_WORD, + C_VALUE, + C_CHAR | C_WORD_SEP | C_VALUE_SEP, // 38 = "&" + C_ILLEGAL, + C_CHAR | C_WORD_SEP | C_VALUE_SEP, // 40 = "(" + C_CHAR | C_WORD_SEP | C_VALUE_SEP, + C_CHAR | C_WORD_SEP | C_VALUE_SEP, + C_CHAR | C_WORD_SEP | C_VALUE_EXP | C_VALUE_SIGN, + C_VALUE, + C_CHAR | C_WORD_SEP | C_VALUE_EXP | C_VALUE_SIGN, + C_WORD | C_VALUE, + C_CHAR | C_WORD_SEP | C_VALUE_SEP, + C_CHAR_VALUE | C_WORD | C_VALUE | C_VALUE_EXP | C_VALUE_VALUE, + C_CHAR_VALUE | C_WORD | C_VALUE | C_VALUE_EXP | C_VALUE_VALUE, + C_CHAR_VALUE | C_WORD | C_VALUE | C_VALUE_EXP | C_VALUE_VALUE, // 50 = "2" + C_CHAR_VALUE | C_WORD | C_VALUE | C_VALUE_EXP | C_VALUE_VALUE, + C_CHAR_VALUE | C_WORD | C_VALUE | C_VALUE_EXP | C_VALUE_VALUE, + C_CHAR_VALUE | C_WORD | C_VALUE | C_VALUE_EXP | C_VALUE_VALUE, + C_CHAR_VALUE | C_WORD | C_VALUE | C_VALUE_EXP | C_VALUE_VALUE, + C_CHAR_VALUE | C_WORD | C_VALUE | C_VALUE_EXP | C_VALUE_VALUE, + C_CHAR_VALUE | C_WORD | C_VALUE | C_VALUE_EXP | C_VALUE_VALUE, + C_CHAR_VALUE | C_WORD | C_VALUE | C_VALUE_EXP | C_VALUE_VALUE, + C_WORD, + C_CHAR | C_WORD_SEP | C_VALUE_SEP, + C_CHAR_BOOL | C_WORD_SEP | C_VALUE_SEP, // 60 = "<" + C_CHAR | C_BOOL | C_WORD_SEP | C_VALUE_SEP, + C_CHAR_BOOL | C_BOOL | C_WORD_SEP | C_VALUE_SEP, + C_ILLEGAL, + C_ILLEGAL, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, // 70 = "F" + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, // 80 = "P" + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, // 90 = "Z" + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_CHAR | C_WORD_SEP | C_VALUE_SEP, + C_WORD, + C_ILLEGAL, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, // 100 = "d" + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, // 110 = "n" + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, // 120 = "x" + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_ILLEGAL, + C_ILLEGAL, // 124 = "|" + C_ILLEGAL, + C_ILLEGAL, // 126 = "~" + C_ILLEGAL, // 127 + C_ILLEGAL, + C_CHAR_WORD | C_WORD, + C_ILLEGAL, // 130 + C_ILLEGAL, + C_CHAR_WORD | C_WORD, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, // 140 + C_ILLEGAL, + C_CHAR_WORD | C_WORD, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_CHAR_WORD | C_WORD, + C_ILLEGAL, + C_ILLEGAL, // 150 + C_ILLEGAL, + C_ILLEGAL, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, // 160 + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, // 170 + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, // 180 + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, // 190 + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, // 200 + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, // 210 + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL , // 220 + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_CHAR_WORD | C_WORD, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, // 230 + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, // 240 + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, // 250 + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL // 255 +}; + +//#elif defined MAC +//#elif defined UNIX +// +#else + +USHORT CharTable[256] = +{ + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_CHAR_DONTCARE | C_WORD_SEP | C_VALUE_SEP, // 32 = " " + C_CHAR | C_WORD_SEP | C_VALUE_SEP, // 33 = "!" + C_CHAR_STRING | C_STRING_SEP, + C_ILLEGAL, + C_CHAR_WORD | C_WORD, + C_VALUE, + C_CHAR | C_WORD_SEP | C_VALUE_SEP, // 38 = "&" + C_ILLEGAL, + C_CHAR | C_WORD_SEP | C_VALUE_SEP, // 40 = "(" + C_CHAR | C_WORD_SEP | C_VALUE_SEP, + C_CHAR | C_WORD_SEP | C_VALUE_SEP, + C_CHAR | C_WORD_SEP | C_VALUE_EXP | C_VALUE_SIGN, + C_VALUE, + C_CHAR | C_WORD_SEP | C_VALUE_EXP | C_VALUE_SIGN, + C_WORD | C_VALUE, + C_CHAR | C_WORD_SEP | C_VALUE_SEP, + C_CHAR_VALUE | C_WORD | C_VALUE | C_VALUE_EXP | C_VALUE_VALUE, + C_CHAR_VALUE | C_WORD | C_VALUE | C_VALUE_EXP | C_VALUE_VALUE, + C_CHAR_VALUE | C_WORD | C_VALUE | C_VALUE_EXP | C_VALUE_VALUE, // 50 = "2" + C_CHAR_VALUE | C_WORD | C_VALUE | C_VALUE_EXP | C_VALUE_VALUE, + C_CHAR_VALUE | C_WORD | C_VALUE | C_VALUE_EXP | C_VALUE_VALUE, + C_CHAR_VALUE | C_WORD | C_VALUE | C_VALUE_EXP | C_VALUE_VALUE, + C_CHAR_VALUE | C_WORD | C_VALUE | C_VALUE_EXP | C_VALUE_VALUE, + C_CHAR_VALUE | C_WORD | C_VALUE | C_VALUE_EXP | C_VALUE_VALUE, + C_CHAR_VALUE | C_WORD | C_VALUE | C_VALUE_EXP | C_VALUE_VALUE, + C_CHAR_VALUE | C_WORD | C_VALUE | C_VALUE_EXP | C_VALUE_VALUE, + C_WORD, + C_CHAR | C_WORD_SEP | C_VALUE_SEP, + C_CHAR_BOOL | C_WORD_SEP | C_VALUE_SEP, // 60 = "<" + C_CHAR | C_BOOL | C_WORD_SEP | C_VALUE_SEP, + C_CHAR_BOOL | C_BOOL | C_WORD_SEP | C_VALUE_SEP, + C_ILLEGAL, + C_ILLEGAL, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, // 70 = "F" + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, // 80 = "P" + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, // 90 = "Z" + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_CHAR | C_WORD_SEP | C_VALUE_SEP, + C_WORD, + C_ILLEGAL, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, // 100 = "d" + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, // 110 = "n" + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, // 120 = "x" + C_CHAR_WORD | C_WORD, + C_CHAR_WORD | C_WORD, + C_ILLEGAL, + C_ILLEGAL, // 124 = "|" + C_ILLEGAL, + C_ILLEGAL, // 126 = "~" + C_ILLEGAL, // 127 + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, // 130 + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, // 140 + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, // 150 + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, // 160 + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, // 170 + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, // 180 + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, // 190 + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_CHAR_WORD | C_WORD, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, // 200 + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, // 210 + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_CHAR_WORD | C_WORD, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_CHAR_WORD | C_WORD, // 220 + C_ILLEGAL, + C_ILLEGAL, + C_CHAR_WORD | C_WORD, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_CHAR_WORD | C_WORD, + C_ILLEGAL, + C_ILLEGAL, // 230 + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, // 240 + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_CHAR_WORD | C_WORD, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL, // 250 + C_ILLEGAL, + C_CHAR_WORD | C_WORD, + C_ILLEGAL, + C_ILLEGAL, + C_ILLEGAL // 255 +}; + +#endif + + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sc/source/core/inc/bcaslot.hxx b/binfilter/bf_sc/source/core/inc/bcaslot.hxx new file mode 100644 index 000000000000..7fb8710f8cb0 --- /dev/null +++ b/binfilter/bf_sc/source/core/inc/bcaslot.hxx @@ -0,0 +1,158 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 _SC_BCASLOT_HXX +#define _SC_BCASLOT_HXX + +#include <bf_svtools/brdcst.hxx> +#include <bf_svtools/svarray.hxx> + +#include "global.hxx" +#include "brdcst.hxx" +namespace binfilter { + +class ScBroadcastArea; +class ScBroadcastAreaList; + +#define BCA_INITGROWSIZE 16 +typedef ScBroadcastArea* ScBroadcastAreaPtr; +SV_DECL_PTRARR_SORT( ScBroadcastAreas, ScBroadcastAreaPtr, + BCA_INITGROWSIZE, BCA_INITGROWSIZE )//STRIP008 ; + +// wird in einem nach Objekten sortierten SV_PTRARR_SORT benutzt +class ScBroadcastArea : public ScRange, public SfxBroadcaster +{ +private: + ScBroadcastArea* pUpdateChainNext; + USHORT nRefCount; + BOOL bInUpdateChain; + +public: + ScBroadcastArea( const ScRange& rRange ) + : ScRange( rRange ), SfxBroadcaster(), pUpdateChainNext( NULL ), + nRefCount( 0 ), bInUpdateChain( FALSE ) {} + inline void UpdateRange( const ScRange& rNewRange ) + { aStart = rNewRange.aStart; aEnd = rNewRange.aEnd; } + inline ScAddress GetStart() const { return aStart; } + inline ScAddress GetEnd() const { return aEnd; } + inline void IncRef() { ++nRefCount; } + inline USHORT DecRef() { return --nRefCount; } + inline ScBroadcastArea* GetUpdateChainNext() const { return pUpdateChainNext; } + inline void SetUpdateChainNext( ScBroadcastArea* p ) { pUpdateChainNext = p; } + inline BOOL IsInUpdateChain() const { return bInUpdateChain; } + inline void SetInUpdateChain( BOOL b ) { bInUpdateChain = b; } + + // zur Sortierung wird die linke obere Ecke herangezogen, + // ist diese gleich, zaehlt auch die rechte untere Ecke + BOOL operator < ( const ScBroadcastArea& rArea ) const + { return aStart < rArea.aStart || + (aStart == rArea.aStart && aEnd < rArea.aEnd) ; } + BOOL operator ==( const ScBroadcastArea& rArea ) const + { return aStart == rArea.aStart && aEnd == rArea.aEnd; } +}; +class ScBroadcastAreaSlotMachine; + +// Sammlung von BroadcastAreas +class ScBroadcastAreaSlot +{ +private: + ScBroadcastAreas* pBroadcastAreaTbl; + ScBroadcastArea* pTmpSeekBroadcastArea; // fuer Seek_Entry + ScDocument* pDoc; + ScBroadcastAreaSlotMachine* pBASM; + + USHORT FindBroadcastArea( const ScRange& rRange ) const; + ScBroadcastArea* GetBroadcastArea( const ScRange& rRange ) const; + +public: + ScBroadcastAreaSlot( ScDocument* pDoc, + ScBroadcastAreaSlotMachine* pBASM ); + ~ScBroadcastAreaSlot(); + const ScBroadcastAreas& GetBroadcastAreas() const + { return *pBroadcastAreaTbl; } + void StartListeningArea( const ScRange& rRange, + SfxListener* pListener, + ScBroadcastArea*& rpArea ); + void EndListeningArea( const ScRange& rRange, + SfxListener* pListener, + ScBroadcastArea*& rpArea ); + BOOL AreaBroadcast( const ScHint& rHint ) const; + // return: mindestens ein Broadcast gewesen + BOOL AreaBroadcastInRange( const ScRange& rRange, + const ScHint& rHint ) const; +/*N*/ void DelBroadcastAreasInRange( const ScRange& rRange ); +}; + + +/* + BroadcastAreaSlots und deren Verwaltung, einmal je Dokument + + +---+---+ + | 0 | 2 | Anordnung Cols/Rows + +---+---+ + | 1 | 3 | + +---+---+ + */ + +class ScBroadcastAreaSlotMachine +{ +private: + ScBroadcastAreaSlot** ppSlots; + ScDocument* pDoc; + ScBroadcastAreaList* pBCAlwaysList; // fuer den RC_ALWAYS Spezialbereich + ScBroadcastArea* pUpdateChain; + ScBroadcastArea* pEOUpdateChain; + + inline USHORT ComputeSlotOffset( const ScAddress& rAddress ) const; + void ComputeAreaPoints( const ScRange& rRange, + USHORT& nStart, USHORT& nEnd, + USHORT& nRowBreak ) const; + +public: + ScBroadcastAreaSlotMachine( ScDocument* pDoc ); + ~ScBroadcastAreaSlotMachine(); + void StartListeningArea( const ScRange& rRange, + SfxListener* pListener ); + void EndListeningArea( const ScRange& rRange, + SfxListener* pListener ); + BOOL AreaBroadcast( const ScHint& rHint ) const; + // return: mindestens ein Broadcast gewesen + BOOL AreaBroadcastInRange( const ScRange& rRange, const ScHint& rHint ) const; +/*N*/ void DelBroadcastAreasInRange( const ScRange& rRange ); + inline ScBroadcastArea* GetUpdateChain() const { return pUpdateChain; } + inline void SetUpdateChain( ScBroadcastArea* p ) { pUpdateChain = p; } + inline ScBroadcastArea* GetEOUpdateChain() const { return pEOUpdateChain; } + inline void SetEOUpdateChain( ScBroadcastArea* p ) { pEOUpdateChain = p; } +}; + + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sc/source/core/inc/ddelink.hxx b/binfilter/bf_sc/source/core/inc/ddelink.hxx new file mode 100644 index 000000000000..54cafbfa67d9 --- /dev/null +++ b/binfilter/bf_sc/source/core/inc/ddelink.hxx @@ -0,0 +1,91 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 SC_DDELINK_HXX +#define SC_DDELINK_HXX + +#include <bf_so3/lnkbase.hxx> +#include <bf_svtools/brdcst.hxx> +namespace binfilter { + +class ScDocument; +class ScMatrix; +class ScMultipleReadHeader; +class ScMultipleWriteHeader; + +class ScDdeLink : public ::binfilter::SvBaseLink, public SfxBroadcaster +{ +private: +static BOOL bIsInUpdate; + + ScDocument* pDoc; + + String aAppl; // Verbindungsdaten + String aTopic; + String aItem; + BYTE nMode; // Zahlformat-Modus + + BOOL bNeedUpdate; // wird gesetzt, wenn Update nicht moeglich war + + ScMatrix* pResult; // Ergebnis + +public: + TYPEINFO(); + + ScDdeLink( ScDocument* pD, + const String& rA, const String& rT, const String& rI, + BYTE nM ); + ScDdeLink( ScDocument* pD, SvStream& rStream, ScMultipleReadHeader& rHdr ); + virtual ~ScDdeLink(); + + void Store( SvStream& rStream, ScMultipleWriteHeader& rHdr ) const; + + // von SvBaseLink ueberladen: + virtual void DataChanged( const String& rMimeType, + const ::com::sun::star::uno::Any & rValue ); + + // von SfxBroadcaster ueberladen: + + // fuer Interpreter: + + const ScMatrix* GetResult() const { return pResult; } + ScMatrix* GetResult() {return pResult; } + + const String& GetAppl() const { return aAppl; } + const String& GetTopic() const { return aTopic; } + const String& GetItem() const { return aItem; } + BYTE GetMode() const { return nMode; } + + void TryUpdate(); +}; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sc/source/core/inc/interpre.hxx b/binfilter/bf_sc/source/core/inc/interpre.hxx new file mode 100644 index 000000000000..cc11ccc3d5ec --- /dev/null +++ b/binfilter/bf_sc/source/core/inc/interpre.hxx @@ -0,0 +1,723 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 SC_INTERPRE_HXX +#define SC_INTERPRE_HXX + +#define SC_SPEW_ENABLED 0 + +#include <math.h> + +#include <rtl/math.hxx> + +#include "compiler.hxx" +#include "cell.hxx" +#include "scdll.hxx" +#include "document.hxx" + +#if SC_SPEW_ENABLED +#include "scspew.hxx" +#endif +class SbxVariable; +namespace binfilter { + +class SvNumberFormatter; +class ScDocument; +class ScMatrix; +class ScBaseCell; +class ScFormulaCell; + +#define MAX_ANZ_MAT 150 + // Maximale Anzahl fuer Zwischenergebnis + // Matrizen + // Maximum ca. 85 wird bei Invertierung + // von 128 x 128 benoetigt! + + +#ifndef MSC + #include <setjmp.h> +#else + extern "C" + { + #define _JBLEN 9 /* bp, di, si, sp, ret addr, ds */ + typedef int jmp_buf[_JBLEN]; + #define _JMP_BUF_DEFINED + #define setjmp _setjmp + int __cdecl _setjmp(jmp_buf); + void __cdecl longjmp(jmp_buf, int); + }; +#endif + + +struct ScCompare +{ + double nVal[2]; + String* pVal[2]; + BOOL bVal[2]; + BOOL bEmpty[2]; + ScCompare( String* p1, String* p2 ) + { + pVal[ 0 ] = p1; + pVal[ 1 ] = p2; + bEmpty[0] = FALSE; + bEmpty[1] = FALSE; + } +}; + +class ScToken; + +#define MAXSTACK (4096 / sizeof(ScToken*)) + +class ScTokenStack +{ +public: + DECL_FIXEDMEMPOOL_NEWDEL( ScTokenStack ) + ScToken* pPointer[ MAXSTACK ]; +}; + +class ScErrorStack +{ +public: + DECL_FIXEDMEMPOOL_NEWDEL( ScErrorStack ) + USHORT pPointer[ MAXSTACK ]; +}; + +enum ScIterFunc { + ifSUM, // Aufsummieren + ifSUMSQ, // Quadratsummen + ifPRODUCT, // Multiplizieren + ifAVERAGE, // Durchschnitt + ifCOUNT, // Anzahl Werte + ifCOUNT2, // Anzahl Werte (nichtleer) + ifMIN, // Minimum + ifMAX // Maximum +}; + +class ScInterpreter +{ + // distibution function objects need the GetxxxDist methods + friend class ScGammaDistFunction; + friend class ScBetaDistFunction; + friend class ScTDistFunction; + friend class ScFDistFunction; + friend class ScChiDistFunction; + +public: + DECL_FIXEDMEMPOOL_NEWDEL( ScInterpreter ) + static USHORT nGlobalError; // globale Fehlervariable +#if SC_SPEW_ENABLED + static ScSpew theSpew; +#endif + + static void GlobalExit(); // aus ScGlobal::Clear() gerufen + + /// Could string be a regular expression? + /// If pDoc!=NULL the document options are taken into account and if + /// RegularExpressions are disabled the function returns FALSE regardless + /// of the string content. + static BOOL MayBeRegExp( const String& rStr, const ScDocument* pDoc ); + +private: + static ScTokenStack* pGlobalStack; + static ScErrorStack* pGlobalErrorStack; + static BOOL bGlobalStackInUse; + + ScTokenIterator aCode; + ScAddress aPos; + ScTokenArray& rArr; + String aResult; + ScDocument* pDok; // Pointer aufs Dokument + double nResult; + ScMatrix* pResult; + ScFormulaCell* pMyFormulaCell; // die Zelle mit der Formel + SvNumberFormatter* pFormatter; + StackVar eResult; + + USHORT nGlobError; // lokale Kopie + const ScToken* pCur; // aktuelles Token + String aTempStr; // fuer GetString() + ScTokenStack* pStackObj; // enthaelt den Stack + ScToken** pStack; // der Stack + ScErrorStack* pErrorStackObj; // enthaelt den ErrorStack + USHORT* pErrorStack; // der ErrorStack + USHORT sp; // der Stackpointer + USHORT maxsp; // der maximale StackPointer + double** ppGlobSortArray; // Pointer auf Array zum Sortieren + ScMatrix** ppTempMatArray; // Array fuer temporaere Matrizen + USHORT nMatCount; // dazugehoeriger Zaehler + BOOL bMatDel; // und Kontrollvariable + USHORT nRetMat; // Index der Return-Matrix + ULONG nFuncFmtIndex; // NumberFormatIndex einer Funktion + ULONG nCurFmtIndex; // aktueller NumberFormatIndex + ULONG nRetFmtIndex; // ggbf. NumberFormatIndex des Ausdrucks + short nFuncFmtType; // NumberFormatTyp einer Funktion + short nCurFmtType; // aktueller NumberFormatTyp + short nRetFmtType; // NumberFormatTyp des Ausdrucks + BOOL glSubTotal; // Flag fuer Subtotalfunktionen + BYTE cPar; // aktuelle Anzahl Parameter + BOOL bCalcAsShown; // Genauigkeit wie angezeigt + BOOL bMatrixFormula; // Formelzelle ist Matrixformel + +//---------------------------------Funktionen in interpre.cxx--------- +// nMust <= nAct <= nMax ? ok : SetError, PushInt +inline BOOL MustHaveParamCount( BYTE nAct, BYTE nMust ); +inline BOOL MustHaveParamCount( BYTE nAct, BYTE nMust, BYTE nMax ); +inline BOOL MustHaveParamCountMin( BYTE nAct, BYTE nMin ); +void SetParameterExpected(); +void SetIllegalParameter(); +void SetIllegalArgument(); +void SetNoValue(); +void SetNV(); +//------------------------------------------------------------------------- +// Funktionen für den Zugriff auf das Document +//------------------------------------------------------------------------- +void ReplaceCell( ScAddress& ); // for TableOp +void ReplaceCell( USHORT& rCol, USHORT& rRow, USHORT& rTab ); // for TableOp +BOOL IsTableOpInRange( const ScRange& ); +ULONG GetCellNumberFormat( const ScAddress&, const ScBaseCell* ); +double GetCellValue( const ScAddress&, const ScBaseCell* ); +double GetCellValueOrZero( const ScAddress&, const ScBaseCell* ); +double GetValueCellValue( const ScAddress&, const ScValueCell* ); +ScBaseCell* GetCell( const ScAddress& rPos ) + { return pDok->GetCell( rPos ); } +void GetCellString( String& rStr, const ScBaseCell* pCell ); +USHORT GetCellErrCode( const ScBaseCell* pCell ); +inline CellType GetCellType( const ScBaseCell* pCell ) + { return pCell ? pCell->GetCellType() : CELLTYPE_NONE; } +inline BOOL HasCellValueData( const ScBaseCell* pCell ) + { return pCell ? pCell->HasValueData() : FALSE; } +inline BOOL HasCellStringData( const ScBaseCell* pCell ) + { return pCell ? pCell->HasStringData() : FALSE; } +BOOL CreateDoubleArr(USHORT nCol1, USHORT nRow1, USHORT nTab1, + USHORT nCol2, USHORT nRow2, USHORT nTab2, BYTE* pCellArr); +BOOL CreateStringArr(USHORT nCol1, USHORT nRow1, USHORT nTab1, + USHORT nCol2, USHORT nRow2, USHORT nTab2, BYTE* pCellArr); +BOOL CreateCellArr(USHORT nCol1, USHORT nRow1, USHORT nTab1, + USHORT nCol2, USHORT nRow2, USHORT nTab2, BYTE* pCellArr); +//----------------------------------------------------------------------------- +// Stackoperationen +//----------------------------------------------------------------------------- +void Push( ScToken& r ); +void PushTempToken( const ScToken& ); +void PushTempToken( ScToken* ); //! see warnings in interpr4.cxx +void Pop(); +void PopError(); +BYTE PopByte(); +double PopDouble(); +const String& PopString(); +void PopSingleRef( ScAddress& ); +void PopSingleRef(USHORT& rCol, USHORT &rRow, USHORT& rTab); +void PopDoubleRef( ScRange&, BOOL bDontCheckForTableOp = FALSE ); +void PopDoubleRef(USHORT& rCol1, USHORT &rRow1, USHORT& rTab1, + USHORT& rCol2, USHORT &rRow2, USHORT& rTab2, + BOOL bDontCheckForTableOp = FALSE ); +BOOL PopDoubleRefOrSingleRef( ScAddress& rAdr ); +void PopDoubleRefPushMatrix(); +inline void MatrixDoubleRefToMatrix(); // wenn MatrixFormula: PopDoubleRefPushMatrix +ScMatrix* PopMatrix(); +//void PushByte(BYTE nVal); +void PushDouble(double nVal); +void PushInt( int nVal ); +void PushStringBuffer( const sal_Unicode* pString ); +void PushString( const String& rString ); +void PushSingleRef(USHORT nCol, USHORT nRow, USHORT nTab); +void PushDoubleRef(USHORT nCol1, USHORT nRow1, USHORT nTab1, + USHORT nCol2, USHORT nRow2, USHORT nTab2); +void PushMatrix(ScMatrix* pMat); +StackVar GetStackType(); +// peek StackType of Parameter, Parameter 1 == TOS, 2 == TOS-1, ... +StackVar GetStackType( BYTE nParam ); +BYTE GetByte() { return cPar; } +/* +short GetShort(); +double GetLong(); +*/ +// generiert aus DoubleRef positionsabhaengige SingleRef +BOOL DoubleRefToPosSingleRef( const ScRange& rRange, ScAddress& rAdr ); +double GetDouble(); +BOOL GetBool() { return GetDouble() != 0.0; } +const String& GetString(); +ScMatrix* GetMatrix(USHORT& nMatInd); // in interpr2.cxx +void ScTableOp(); // Mehrfachoperatione; +void ScErrCell(); // Sonderbehandlung + +//-----------------------------allgemeine Hilfsfunktionen +void SetMaxIterationCount(USHORT n); +inline void CurFmtToFuncFmt() + { nFuncFmtType = nCurFmtType; nFuncFmtIndex = nCurFmtIndex; } +// Check for String overflow of rResult+rAdd and set error and erase rResult +// if so. Return TRUE if ok, FALSE if overflow +inline BOOL CheckStringResultLen( String& rResult, const String& rAdd ); +//---------------------------------Funktionen in interpr1.cxx--------- +//-----------------------------Textfunktionen +void ScIfJump(); +void ScChoseJump(); +short CompareFunc( const ScCompare& rComp ); +short Compare(); +ScMatrix* CompareMat(); +void ScEqual(); +void ScNotEqual(); +void ScLess(); +void ScGreater(); +void ScLessEqual(); +void ScGreaterEqual(); +void ScAnd(); +void ScOr(); +void ScNot(); +void ScNeg(); +void ScPercentSign(); +void ScIntersect(); +void ScPi(); +void ScRandom(); +void ScTrue(); +void ScFalse(); +void ScDeg(); +void ScRad(); +void ScSin(); +void ScCos(); +void ScTan(); +void ScCot(); +void ScArcSin(); +void ScArcCos(); +void ScArcTan(); +void ScArcCot(); +void ScSinHyp(); +void ScCosHyp(); +void ScTanHyp(); +void ScCotHyp(); +void ScArcSinHyp(); +void ScArcCosHyp(); +void ScArcTanHyp(); +void ScArcCotHyp(); +void ScExp(); +void ScLn(); +void ScLog10(); +void ScSqrt(); +void ScIsEmpty(); +short IsString(); +void ScIsString(); +void ScIsNonString(); +void ScIsLogical(UINT16 aOldNumType); +void ScType(); +void ScCell(); +void ScIsRef(); +void ScIsValue(); +void ScIsFormula(); +void ScFormula(); +void ScRoman(); +void ScArabic(); +void ScIsNV(); +void ScIsErr(); +void ScIsError(); +short IsEven(); +void ScIsEven(); +void ScIsOdd(); +void ScN(); +void ScCode(); +void ScTrim(); +void ScUpper(); +void ScPropper(); +void ScLower(); +void ScLen(); +void ScT(); +void ScValue(); +void ScClean(); +void ScChar(); +void ScMin( BOOL bTextAsZero = FALSE ); +void ScMax( BOOL bTextAsZero = FALSE ); +double IterateParameters( ScIterFunc, BOOL bTextAsZero = FALSE ); +void ScSumSQ(); +void ScSum(); +void ScProduct(); +void ScAverage( BOOL bTextAsZero = FALSE ); +void ScCount(); +void ScCount2(); +void GetStVarParams( double& rVal, double& rValCount, BOOL bTextAsZero = FALSE ); +void ScVar( BOOL bTextAsZero = FALSE ); +void ScVarP( BOOL bTextAsZero = FALSE ); +void ScStDev( BOOL bTextAsZero = FALSE ); +void ScStDevP( BOOL bTextAsZero = FALSE ); +void ScColumns(); +void ScRows(); +void ScTables(); +void ScColumn(); +void ScRow(); +void ScTable(); +void ScMatch(); +void ScCountIf(); +void ScSumIf(); +void ScCountEmptyCells(); +void ScLookup(); +void ScHLookup(); +void ScVLookup(); +void ScSubTotal(); + +// If upon call rMissingField==TRUE then the database field parameter may be +// missing (Xcl DCOUNT() syntax), or may be faked as missing by having the +// value 0.0 or being exactly the entire database range reference (old SO +// compatibility). If this was the case then rMissingField is set to TRUE upon +// return. If rMissingField==FALSE upon call all "missing cases" are considered +// to be an error. +BOOL GetDBParams( USHORT& rTab, ScQueryParam& rParam, BOOL& rMissingField ); + +void DBIterator( ScIterFunc ); +void ScDBSum(); +void ScDBCount(); +void ScDBCount2(); +void ScDBAverage(); +void ScDBGet(); +void ScDBMax(); +void ScDBMin(); +void ScDBProduct(); +void GetDBStVarParams( double& rVal, double& rValCount ); +void ScDBStdDev(); +void ScDBStdDevP(); +void ScDBVar(); +void ScDBVarP(); +void ScIndirect(); +void ScAdress(); +void ScOffset(); +void ScIndex(); +void ScMultiArea(); +void ScAreas(); +void ScCurrency(); +void ScReplace(); +void ScFixed(); +void ScFind(); +void ScExact(); +void ScLeft(); +void ScRight(); +void ScSearch(); +void ScMid(); +void ScText(); +void ScSubstitute(); +void ScRept(); +void ScConcat(); +void ScExternal(); +void ScMissing(); +void ScMacro(); +BOOL SetSbxVariable( SbxVariable* pVar, const ScAddress& ); +BOOL SetSbxVariable( SbxVariable* pVar, USHORT nCol, USHORT nRow, USHORT nTab ); +void ScErrorType(); +void ScDBArea(); +void ScColRowNameAuto(); +void ScCalcTeam(); +void ScAnswer(); +void ScTTT(); +void ScSpewFunc(); +void ScGame(){DBG_BF_ASSERT(0, "STRIP");} //STRIP001 void ScGame(); + +//----------------Funktionen in interpr2.cxx--------------- +double GetDate(INT16 nYear, INT16 nMonth, INT16 nDay); +void ScGetActDate(); +void ScGetActTime(); +void ScGetYear(); +void ScGetMonth(); +void ScGetDay(); +void ScGetDayOfWeek(); +void ScGetWeekOfYear(); +void ScEasterSunday(); +void ScGetHour(); +void ScGetMin(); +void ScGetSec(); +void ScPlusMinus(); +void ScAbs(); +void ScInt(); +void ScEven(); +void ScOdd(); +void ScCeil(); +void ScFloor(); +void RoundNumber( rtl_math_RoundingMode eMode ); +void ScRound(); +void ScRoundUp(); +void ScRoundDown(); +void ScGetDateValue(); +void ScGetTimeValue(); +void ScArcTan2(); +void ScLog(); +void ScGetDate(); +void ScGetTime(); +void ScGetDiffDate(); +void ScGetDiffDate360(); +void ScPower(); +void ScAmpersand(); +void ScAdd(); +void ScSub(); +void ScMul(); +void ScDiv(); +void ScPow(); +void ScCurrent(); +void ScStyle(); +void ScDde(); +void ScBase(); +void ScDecimal(); +void ScConvert(); + +//----------------------- Finanzfunktionen ------------------------------------ +void ScNBW(); +void ScIKV(); +void ScMIRR(); +void ScISPMT(); + +double ScGetBw(double fZins, double fZzr, double fRmz, + double fZw, double fF); +void ScBW(); +void ScDIA(); +double ScGetGDA(double fWert, double fRest, double fDauer, + double fPeriode, double fFaktor); +void ScGDA(); +void ScGDA2(); +double ScInterVDB(double fWert,double fRest,double fDauer,double fDauer1, + double fPeriode,double fFaktor); +void ScVDB(); +void ScLaufz(); +void ScLIA(); +double ScGetRmz(double fZins, double fZzr, double fBw, + double fZw, double fF); +void ScRMZ(); +void ScZGZ(); +double ScGetZw(double fZins, double fZzr, double fRmz, + double fBw, double fF); +void ScZW(); +void ScZZR(); +double GetZinsIterationEps(double fZzr, double fRmz, double fBw, double fZw, + double fF, double& fSchaetzwert); +void ScZins(); +double ScGetZinsZ(double fZins, double fZr, double fZzr, double fBw, + double fZw, double fF, double& fRmz); +void ScZinsZ(); +void ScKapz(); +void ScKumZinsZ(); +void ScKumKapZ(); +void ScEffektiv(); +void ScNominal(); +void ScMod(); +void ScBackSolver(); +void ScIntercept(); +//-------------------------Funktionen in interpr5.cxx-------------------------- +double ScGetGGT(double fx, double fy); +void ScGGT(); +void ScKGV(); +//-------------------------- Matrixfunktionen --------------------------------- +ScMatrix* GetNewMat(USHORT nC, USHORT nR, USHORT& nMatInd); +void ResetNewMat(USHORT nIndex); +void ScMatValue(); +void MEMat(ScMatrix* mM, USHORT n); +void MFastMult(ScMatrix* pA, ScMatrix* pB, ScMatrix* pR, USHORT n, USHORT m, USHORT l); +void MFastSub(ScMatrix* pA, ScMatrix* pB, ScMatrix* pR, USHORT n, USHORT m); +void MFastTrans(ScMatrix* pA, ScMatrix* pR, USHORT n, USHORT m); +BOOL MFastBackSubst(ScMatrix* pA, ScMatrix* pR, USHORT n, BOOL bIsUpper); +BOOL ScMatLUP(ScMatrix* mA, USHORT m, USHORT p, + ScMatrix* mL, ScMatrix* mU, ScMatrix* mP, + ULONG& rPermutCounter, BOOL& bIsInvertable); +void ScMatDet(); +void ScMatInv(); +void ScMatMult(); +void ScMatTrans(); +void ScEMat(); +void ScMatRef(); +ScMatrix* MatAdd(ScMatrix* pMat1, ScMatrix* pMat2); +ScMatrix* MatSub(ScMatrix* pMat1, ScMatrix* pMat2); +ScMatrix* MatMul(ScMatrix* pMat1, ScMatrix* pMat2); +ScMatrix* MatDiv(ScMatrix* pMat1, ScMatrix* pMat2); +ScMatrix* MatPow(ScMatrix* pMat1, ScMatrix* pMat2); +ScMatrix* MatConcat(ScMatrix* pMat1, ScMatrix* pMat2); +void ScSumProduct(); +void ScSumX2MY2(); +void ScSumX2DY2(); +void ScSumXMY2(); +void ScGrowth(); +// multiple Regression: Varianzen der Koeffizienten +BOOL RGetVariances( ScMatrix* pV, ScMatrix* pX, USHORT nC, USHORT nR, + BOOL bSwapColRow, BOOL bZeroConstant ); +void ScRGP(); +void ScRKP(); +void ScForecast(); +//-------------------------------------------------------------------------------- +// Funktionen in interpr3.cxx +// Statistik: +void ScNoName(); +double phi(double x); +double taylor(double* pPolynom, USHORT nMax, double x); +double gauss(double x); +double gaussinv(double x); +double GetGammaDist(double x, double alpha, double beta); +double GetBetaDist(double x, double alpha, double beta); +double GetChiDist(double fChi, double fDF); +double GetFDist(double x, double fF1, double fF2); +double GetTDist(double T, double fDF); +double Fakultaet(double x); +double BinomKoeff(double n, double k); +double GammaHelp(double& x, BOOL& bReflect); +double GetGamma(double x); +double GetLogGamma(double x); +void ScLogGamma(); +void ScPhi(); +void ScGauss(); +void ScStdNormDist(); +void ScFisher(); +void ScFisherInv(); +void ScFact(); +void ScNormDist(); +void ScGammaDist(); +void ScGammaInv(); +void ScExpDist(); +void ScBinomDist(); +void ScPoissonDist(); +void ScKombin(); +void ScKombin2(); +void ScVariationen(); +void ScVariationen2(); +void ScB(); +void ScHypGeomDist(); +void ScLogNormDist(); +void ScLogNormInv(); +void ScTDist(); +void ScFDist(); +void ScChiDist(); +void ScWeibull(); +void ScBetaDist(); +void ScFInv(); +void ScTInv(); +void ScChiInv(); +void ScBetaInv(); +void ScCritBinom(); +void ScNegBinomDist(); +void ScKurt(); +void ScHarMean(); +void ScGeoMean(); +void ScStandard(); +void ScSkew(); +void ScMedian(); +void GetSortArray(BYTE nParamCount, double** ppSortArray, ULONG& nSize); +void QuickSort(long nLo, long nHi, double* pSortArr); +void ScModalValue(); +void ScAveDev(); +void ScDevSq(); +void ScZTest(); +void ScTTest(); +void ScFTest(); +void ScChiTest(); +void ScRank(); +void ScPercentile(); +void ScPercentrank(); +void ScLarge(); +void ScSmall(); +void ScFrequency(); +void ScQuartile(); +void ScNormInv(); +void ScSNormInv(); +void ScConfidence(); +void ScTrimMean(); +void ScProbability(); +void ScCorrel(); +void ScCovar(); +void ScPearson(); +void ScRSQ(); +void ScSTEXY(); +void ScSlope(); +void ScTrend(); + + +public: + ScInterpreter( ScFormulaCell* pCell, ScDocument* pDoc, + const ScAddress&, ScTokenArray& ); + ~ScInterpreter(); + + StackVar Interpret(); + + static void SetError(USHORT nError) + { if (nError && !nGlobalError) nGlobalError = nError; } + + static USHORT GetError() { return nGlobalError; } + + const String& GetStringResult() { return aResult; } + double GetNumResult() { return nResult; } + ScMatrix* GetMatrixResult() { return pResult; } + StackVar GetResultType() { return eResult; } + short GetRetFormatType() { return nRetFmtType; } + ULONG GetRetFormatIndex() { return nRetFmtIndex; } + BOOL HadMatrix() const { return bMatDel; } +}; + + +inline void ScInterpreter::MatrixDoubleRefToMatrix() +{ + if ( bMatrixFormula && GetStackType() == svDoubleRef ) + PopDoubleRefPushMatrix(); +} + + +inline BOOL ScInterpreter::MustHaveParamCount( BYTE nAct, BYTE nMust ) +{ + if ( nAct == nMust ) + return TRUE; + if ( nAct < nMust ) + SetParameterExpected(); + else + SetIllegalParameter(); + return FALSE; +} + + +inline BOOL ScInterpreter::MustHaveParamCount( BYTE nAct, BYTE nMust, BYTE nMax ) +{ + if ( nMust <= nAct && nAct <= nMax ) + return TRUE; + if ( nAct < nMust ) + SetParameterExpected(); + else + SetIllegalParameter(); + return FALSE; +} + + +inline BOOL ScInterpreter::MustHaveParamCountMin( BYTE nAct, BYTE nMin ) +{ + if ( nAct >= nMin ) + return TRUE; + SetParameterExpected(); + return FALSE; +} + + +inline BOOL ScInterpreter::CheckStringResultLen( String& rResult, const String& rAdd ) +{ + if ( (ULONG) rResult.Len() + rAdd.Len() > STRING_MAXLEN ) + { + SetError( errStringOverflow ); + rResult.Erase(); + return FALSE; + } + return TRUE; +} + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sc/source/core/inc/poolhelp.hxx b/binfilter/bf_sc/source/core/inc/poolhelp.hxx new file mode 100644 index 000000000000..20d30254e922 --- /dev/null +++ b/binfilter/bf_sc/source/core/inc/poolhelp.hxx @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 SC_POOLHELP_HXX +#define SC_POOLHELP_HXX + +#include <salhelper/simplereferenceobject.hxx> + +namespace binfilter { + +class SvNumberFormatter; +class SfxItemPool; +class ScDocument; +class ScDocumentPool; +class ScStyleSheetPool; + + +class ScPoolHelper : public salhelper::SimpleReferenceObject +{ +private: + ScDocumentPool* pDocPool; + ScStyleSheetPool* pStylePool; + SvNumberFormatter* pFormTable; + SfxItemPool* pEditPool; // EditTextObjectPool + SfxItemPool* pEnginePool; // EditEnginePool + +public: + ScPoolHelper( ScDocument* pSourceDoc ); + virtual ~ScPoolHelper(); + + // called in dtor of main document + void SourceDocumentGone(); + + // access to pointers (are never 0): + ScDocumentPool* GetDocPool() const { return pDocPool; } + ScStyleSheetPool* GetStylePool() const { return pStylePool; } + SvNumberFormatter* GetFormTable() const { return pFormTable; } + SfxItemPool* GetEditPool() const { return pEditPool; } + SfxItemPool* GetEnginePool() const { return pEnginePool; } +}; + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sc/source/core/inc/refupdat.hxx b/binfilter/bf_sc/source/core/inc/refupdat.hxx new file mode 100644 index 000000000000..46324660039c --- /dev/null +++ b/binfilter/bf_sc/source/core/inc/refupdat.hxx @@ -0,0 +1,77 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 SC_REFUPDAT_HXX +#define SC_REFUPDAT_HXX + +#include "global.hxx" +namespace binfilter { + +class ScDocument; +class ScBigRange; +struct ComplRefData; + +enum ScRefUpdateRes { + UR_NOTHING = 0, // keine Anpassungen + UR_UPDATED = 1, // Anpassungen erfolgt + UR_INVALID = 2 // Referenz wurde ungueltig +}; + +class ScRefUpdate +{ +public: + static ScRefUpdateRes Update + ( ScDocument* pDoc, UpdateRefMode eUpdateRefMode, + USHORT nCol1, USHORT nRow1, USHORT nTab1, + USHORT nCol2, USHORT nRow2, USHORT nTab2, + short nDx, short nDy, short nDz, + USHORT& theCol1, USHORT& theRow1, USHORT& theTab1, + USHORT& theCol2, USHORT& theRow2, USHORT& theTab2 ); + + static ScRefUpdateRes Update( UpdateRefMode eUpdateRefMode, + const ScBigRange& rWhere, + INT32 nDx, INT32 nDy, INT32 nDz, + ScBigRange& rWhat ); + + static ScRefUpdateRes Update( ScDocument* pDoc, + UpdateRefMode eUpdateRefMode, + const ScAddress& rPos, const ScRange& rRange, + short nDx, short nDy, short nDz, + ComplRefData& rRef ); + static ScRefUpdateRes Move( ScDocument* pDoc, const ScAddress& rPos, + short nDx, short nDy, short nDz, + ComplRefData& rRef, BOOL bWrap, BOOL bAbsolute ); + static void MoveRelWrap( ScDocument* pDoc, const ScAddress& rPos, + ComplRefData& rRef ); +}; + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sc/source/core/inc/scmatrix.hxx b/binfilter/bf_sc/source/core/inc/scmatrix.hxx new file mode 100644 index 000000000000..9155d8badd8d --- /dev/null +++ b/binfilter/bf_sc/source/core/inc/scmatrix.hxx @@ -0,0 +1,184 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 SC_MATRIX_HXX +#define SC_MATRIX_HXX + +#include "global.hxx" + +#include <tools/string.hxx> +class SvStream; +namespace binfilter { + +#define SC_MATVAL_STRING 0x01 +#define SC_MATVAL_EMPTY 0x03 // EMPTY is empty string plus flag + +union MatValue +{ + double fVal; + String* pS; + + /// Only valid if ScMatrix methods indicate so! + const String& GetString() const { return pS ? *pS : EMPTY_STRING; } +}; + +/** Matrix representation of double values and strings. + + @ATTENTION: optimized for speed and double values. + + Matrix elements are not initialized after construction. + + All methods using an ULONG nIndex parameter and all Is... methods don't + check the range for validity! However, the Put... and Get... methods using + USHORT nCol/nRow parameters do check the range. <p> + + GetString( ULONG nIndex ) does not check if there really is a string, do + this with IsString() first. GetString( USHORT nC, USHORT nR ) does check + it and returns and empty string if there is no string. Both GetDouble() + methods don't check for a string, do this with IsNumeric() or IsString() + or IsValue() first. <p> + + PutDouble() does not reset an eventual string! Use + PutDoubleAndResetString() if that is wanted. Also the FillDouble...() + methods don't reset strings. As a consequence memory leaks may occur if + used wrong. + */ +class ScMatrix +{ + USHORT nAnzCol; + USHORT nAnzRow; + MatValue* pMat; + BYTE* bIsString; + + void ResetIsString(); + void DeleteIsString(); + void CreateMatrix(USHORT nC, USHORT nR); + + // pStr may be NULL, bFlag MUST NOT be 0 + void PutStringEntry( const String* pStr, BYTE bFlag, ULONG nIndex ); + +public: + + /// The maximum number of elements a matrix may have at runtime + inline static ULONG GetElementsMax() + { + const size_t nMemMax = (((size_t)(~0))-64) / sizeof(MatValue); + const ULONG nArbitraryLimit = 0x80000; // 512k elements ~= 4MB memory + return nMemMax < nArbitraryLimit ? nMemMax : nArbitraryLimit; + } + + ScMatrix(USHORT nC, USHORT nR) { CreateMatrix(nC, nR); } + ~ScMatrix(); + ScMatrix* Clone() const; + BOOL HasMat() const { return pMat != NULL; } + + ScMatrix(SvStream& rStream); + void Store(SvStream& rStream) const; + + void GetDimensions(USHORT& rC, USHORT& rR) const { rC = nAnzCol; rR = nAnzRow; }; + ULONG GetElementCount() const { return (ULONG) nAnzCol * nAnzRow; } + void PutDouble(double fVal, USHORT nC, USHORT nR); + void PutDouble(double fVal, ULONG nIndex) { pMat[nIndex].fVal = fVal; } + void PutString(const String& rStr, USHORT nC, USHORT nR); + void PutString(const String& rStr, ULONG nIndex); + void PutEmpty(USHORT nC, USHORT nR); + void PutEmpty(ULONG nIndex); + void FillDouble( double fVal, USHORT nC1, USHORT nR1, USHORT nC2, USHORT nR2 ); + void FillDoubleLowerLeft( double fVal, USHORT nC2 ); // lower left triangle + /// @return 0.0 if empty + double GetDouble(USHORT nC, USHORT nR) const; + /// @return 0.0 if empty + double GetDouble(ULONG nIndex) const { return pMat[nIndex].fVal; } + const String& GetString(USHORT nC, USHORT nR) const; + const String& GetString(ULONG nIndex) const + { return pMat[nIndex].GetString(); } + + /// @ATTENTION: If bString the MatValue->pS may still be NULL to indicate + /// an empty string! + const MatValue* Get(USHORT nC, USHORT nR, BOOL& bString) const; + + /// @return <TRUE/> if string or empty + BOOL IsString( ULONG nIndex ) const + { return bIsString && bIsString[nIndex]; } + /// @return <TRUE/> if string or empty + BOOL IsString( USHORT nC, USHORT nR ) const + { return bIsString && bIsString[ (ULONG) nC * nAnzRow + nR ]; } + BOOL IsEmpty( ULONG nIndex ) const + { return bIsString && bIsString[nIndex] == SC_MATVAL_EMPTY; } + BOOL IsEmpty( USHORT nC, USHORT nR ) const + { return bIsString && bIsString[ (ULONG) nC * nAnzRow + nR ] == SC_MATVAL_EMPTY; } + BOOL IsValue( ULONG nIndex ) const + { return !bIsString || !bIsString[nIndex]; } + BOOL IsValue( USHORT nC, USHORT nR ) const + { return !bIsString || !bIsString[ (ULONG) nC * nAnzRow + nR ]; } + BOOL IsValueOrEmpty( ULONG nIndex ) const + { return !bIsString || !bIsString[nIndex] || bIsString[nIndex] == SC_MATVAL_EMPTY; } + BOOL IsValueOrEmpty( USHORT nC, USHORT nR ) const + { return !bIsString || !bIsString[ (ULONG) nC * nAnzRow + nR ] + || bIsString[ (ULONG) nC * nAnzRow + nR ] == SC_MATVAL_EMPTY; } + + /// @return <TRUE/> if entire matrix is numeric and no strings are contained + BOOL IsNumeric() const { return bIsString == NULL; } + + void MatTrans(ScMatrix& mRes) const; + void MatCopy (ScMatrix& mRes) const; + /// Copy upper left of this matrix to mRes matrix. + /// This matrix dimensions must be greater than mRes matrix dimensions. + + // Convert ScInterpreter::CompareMat values (-1,0,1) to boolean values + void CompareEqual(); + void CompareNotEqual(); + void CompareLess(); + void CompareGreater(); + void CompareLessEqual(); + void CompareGreaterEqual(); + + BOOL And(); // logical AND of all matrix values + BOOL Or(); // logical OR of all matrix values + + // All other matrix functions MatMult, MInv, ... are in ScInterpreter + // to be numerically safe. +}; + + +// Old values as used up to SO52. +// The overall elements count had to be <= SC_MAX_MAT_DIM * SC_MAX_MAT_DIM. +// Don't use except maybe for file format compatibility. +// In any other case use ScMatrix::GetElementsMax() instead. +#ifdef WIN +#define SC_OLD_MAX_MAT_DIM 64 +#else +#define SC_OLD_MAX_MAT_DIM 128 +#endif +#define SC_OLD_MAX_MAT_ELEMENTS ((SC_OLD_MAX_MAT_DIM) * (SC_OLD_MAX_MAT_DIM)) + + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sc/source/core/inc/scrdata.hxx b/binfilter/bf_sc/source/core/inc/scrdata.hxx new file mode 100644 index 000000000000..92d8feef4eae --- /dev/null +++ b/binfilter/bf_sc/source/core/inc/scrdata.hxx @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * 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 SC_SCRDATA_HXX +#define SC_SCRDATA_HXX + +#include <com/sun/star/uno/Reference.hxx> + +namespace com { namespace sun { namespace star { namespace i18n { + class XBreakIterator; +} } } } + +namespace binfilter { + +class ScScriptTypeData +{ +public: + ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > xBreakIter; + + ScScriptTypeData() {} + ~ScScriptTypeData() {} +}; + +} //namespace binfilter +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |