Kaydet (Commit) 56b40400 authored tarafından Alexandre Vicenzi's avatar Alexandre Vicenzi Kaydeden (comit) Marcos Souza

fdo#54938 Convert oox and scaddins to cppu::supportsService

Change-Id: If75e6e96887d63a555094a2a9c73ca8a157fe964
Reviewed-on: https://gerrit.libreoffice.org/7836Tested-by: 's avatarLibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: 's avatarMarcos Souza <marcos.souza.org@gmail.com>
üst ff5ad7e3
...@@ -17,20 +17,21 @@ ...@@ -17,20 +17,21 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include "oox/core/filterbase.hxx"
#include <set>
#include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/task/XStatusIndicator.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp> #include <com/sun/star/task/XInteractionHandler.hpp>
#include <com/sun/star/task/XStatusIndicator.hpp>
#include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/drawing/XShape.hpp>
#include <comphelper/docpasswordhelper.hxx> #include <comphelper/docpasswordhelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <unotools/mediadescriptor.hxx> #include <unotools/mediadescriptor.hxx>
#include <osl/mutex.hxx> #include <osl/mutex.hxx>
#include <rtl/instance.hxx> #include <rtl/instance.hxx>
#include <rtl/uri.hxx> #include <rtl/uri.hxx>
#include <set>
#include "oox/core/filterbase.hxx"
#include "oox/helper/binaryinputstream.hxx" #include "oox/helper/binaryinputstream.hxx"
#include "oox/helper/binaryoutputstream.hxx" #include "oox/helper/binaryoutputstream.hxx"
#include "oox/helper/graphichelper.hxx" #include "oox/helper/graphichelper.hxx"
...@@ -41,8 +42,6 @@ ...@@ -41,8 +42,6 @@
namespace oox { namespace oox {
namespace core { namespace core {
// ============================================================================
using namespace ::com::sun::star::beans; using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::frame; using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::graphic; using namespace ::com::sun::star::graphic;
...@@ -58,8 +57,6 @@ using ::comphelper::SequenceAsHashMap; ...@@ -58,8 +57,6 @@ using ::comphelper::SequenceAsHashMap;
using ::oox::ole::OleObjectHelper; using ::oox::ole::OleObjectHelper;
using ::oox::ole::VbaProject; using ::oox::ole::VbaProject;
// ============================================================================
namespace { namespace {
struct UrlPool struct UrlPool
...@@ -70,8 +67,6 @@ struct UrlPool ...@@ -70,8 +67,6 @@ struct UrlPool
struct StaticUrlPool : public ::rtl::Static< UrlPool, StaticUrlPool > {}; struct StaticUrlPool : public ::rtl::Static< UrlPool, StaticUrlPool > {};
// ----------------------------------------------------------------------------
/** This guard prevents recursive loading/saving of the same document. */ /** This guard prevents recursive loading/saving of the same document. */
class DocumentOpenedGuard class DocumentOpenedGuard
{ {
...@@ -111,8 +106,6 @@ DocumentOpenedGuard::~DocumentOpenedGuard() ...@@ -111,8 +106,6 @@ DocumentOpenedGuard::~DocumentOpenedGuard()
} // namespace } // namespace
// ============================================================================
/** Specifies whether this filter is an import or export filter. */ /** Specifies whether this filter is an import or export filter. */
enum FilterDirection enum FilterDirection
{ {
...@@ -121,8 +114,6 @@ enum FilterDirection ...@@ -121,8 +114,6 @@ enum FilterDirection
FILTERDIRECTION_EXPORT FILTERDIRECTION_EXPORT
}; };
// ----------------------------------------------------------------------------
struct FilterBaseImpl struct FilterBaseImpl
{ {
typedef ::boost::shared_ptr< GraphicHelper > GraphicHelperRef; typedef ::boost::shared_ptr< GraphicHelper > GraphicHelperRef;
...@@ -161,8 +152,6 @@ struct FilterBaseImpl ...@@ -161,8 +152,6 @@ struct FilterBaseImpl
void initializeFilter(); void initializeFilter();
}; };
// ----------------------------------------------------------------------------
FilterBaseImpl::FilterBaseImpl( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) : FilterBaseImpl::FilterBaseImpl( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
meDirection( FILTERDIRECTION_UNKNOWN ), meDirection( FILTERDIRECTION_UNKNOWN ),
meVersion( ECMA_DIALECT ), meVersion( ECMA_DIALECT ),
...@@ -352,7 +341,7 @@ void FilterBase::commitStorage() const ...@@ -352,7 +341,7 @@ void FilterBase::commitStorage() const
mxImpl->mxStorage->commit(); mxImpl->mxStorage->commit();
} }
// helpers -------------------------------------------------------------------- // helpers
GraphicHelper& FilterBase::getGraphicHelper() const GraphicHelper& FilterBase::getGraphicHelper() const
{ {
...@@ -399,7 +388,7 @@ bool FilterBase::importBinaryData( StreamDataSequence& orDataSeq, const OUString ...@@ -399,7 +388,7 @@ bool FilterBase::importBinaryData( StreamDataSequence& orDataSeq, const OUString
return true; return true;
} }
// com.sun.star.lang.XServiceInfo interface ----------------------------------- // com.sun.star.lang.XServiceInfo interface
OUString SAL_CALL FilterBase::getImplementationName() throw( RuntimeException ) OUString SAL_CALL FilterBase::getImplementationName() throw( RuntimeException )
{ {
...@@ -408,9 +397,7 @@ OUString SAL_CALL FilterBase::getImplementationName() throw( RuntimeException ) ...@@ -408,9 +397,7 @@ OUString SAL_CALL FilterBase::getImplementationName() throw( RuntimeException )
sal_Bool SAL_CALL FilterBase::supportsService( const OUString& rServiceName ) throw( RuntimeException ) sal_Bool SAL_CALL FilterBase::supportsService( const OUString& rServiceName ) throw( RuntimeException )
{ {
return return cppu::supportsService(this, rServiceName);
(rServiceName == "com.sun.star.document.ImportFilter" ) ||
(rServiceName == "com.sun.star.document.ExportFilter" );
} }
Sequence< OUString > SAL_CALL FilterBase::getSupportedServiceNames() throw( RuntimeException ) Sequence< OUString > SAL_CALL FilterBase::getSupportedServiceNames() throw( RuntimeException )
...@@ -421,7 +408,7 @@ Sequence< OUString > SAL_CALL FilterBase::getSupportedServiceNames() throw( Runt ...@@ -421,7 +408,7 @@ Sequence< OUString > SAL_CALL FilterBase::getSupportedServiceNames() throw( Runt
return aServiceNames; return aServiceNames;
} }
// com.sun.star.lang.XInitialization interface -------------------------------- // com.sun.star.lang.XInitialization interface
void SAL_CALL FilterBase::initialize( const Sequence< Any >& rArgs ) throw( Exception, RuntimeException ) void SAL_CALL FilterBase::initialize( const Sequence< Any >& rArgs ) throw( Exception, RuntimeException )
{ {
...@@ -434,7 +421,7 @@ void SAL_CALL FilterBase::initialize( const Sequence< Any >& rArgs ) throw( Exce ...@@ -434,7 +421,7 @@ void SAL_CALL FilterBase::initialize( const Sequence< Any >& rArgs ) throw( Exce
} }
} }
// com.sun.star.document.XImporter interface ---------------------------------- // com.sun.star.document.XImporter interface
void SAL_CALL FilterBase::setTargetDocument( const Reference< XComponent >& rxDocument ) throw( IllegalArgumentException, RuntimeException ) void SAL_CALL FilterBase::setTargetDocument( const Reference< XComponent >& rxDocument ) throw( IllegalArgumentException, RuntimeException )
{ {
...@@ -442,7 +429,7 @@ void SAL_CALL FilterBase::setTargetDocument( const Reference< XComponent >& rxDo ...@@ -442,7 +429,7 @@ void SAL_CALL FilterBase::setTargetDocument( const Reference< XComponent >& rxDo
mxImpl->meDirection = FILTERDIRECTION_IMPORT; mxImpl->meDirection = FILTERDIRECTION_IMPORT;
} }
// com.sun.star.document.XExporter interface ---------------------------------- // com.sun.star.document.XExporter interface
void SAL_CALL FilterBase::setSourceDocument( const Reference< XComponent >& rxDocument ) throw( IllegalArgumentException, RuntimeException ) void SAL_CALL FilterBase::setSourceDocument( const Reference< XComponent >& rxDocument ) throw( IllegalArgumentException, RuntimeException )
{ {
...@@ -450,7 +437,7 @@ void SAL_CALL FilterBase::setSourceDocument( const Reference< XComponent >& rxDo ...@@ -450,7 +437,7 @@ void SAL_CALL FilterBase::setSourceDocument( const Reference< XComponent >& rxDo
mxImpl->meDirection = FILTERDIRECTION_EXPORT; mxImpl->meDirection = FILTERDIRECTION_EXPORT;
} }
// com.sun.star.document.XFilter interface ------------------------------------ // com.sun.star.document.XFilter interface
sal_Bool SAL_CALL FilterBase::filter( const Sequence< PropertyValue >& rMediaDescSeq ) throw( RuntimeException ) sal_Bool SAL_CALL FilterBase::filter( const Sequence< PropertyValue >& rMediaDescSeq ) throw( RuntimeException )
{ {
...@@ -491,7 +478,7 @@ void SAL_CALL FilterBase::cancel() throw( RuntimeException ) ...@@ -491,7 +478,7 @@ void SAL_CALL FilterBase::cancel() throw( RuntimeException )
{ {
} }
// protected ------------------------------------------------------------------ // protected
Reference< XInputStream > FilterBase::implGetInputStream( MediaDescriptor& rMediaDesc ) const Reference< XInputStream > FilterBase::implGetInputStream( MediaDescriptor& rMediaDesc ) const
{ {
...@@ -513,7 +500,7 @@ Reference< XStream > FilterBase::getMainDocumentStream( ) const ...@@ -513,7 +500,7 @@ Reference< XStream > FilterBase::getMainDocumentStream( ) const
return mxImpl->mxOutStream; return mxImpl->mxOutStream;
} }
// private -------------------------------------------------------------------- // private
void FilterBase::setMediaDescriptor( const Sequence< PropertyValue >& rMediaDescSeq ) void FilterBase::setMediaDescriptor( const Sequence< PropertyValue >& rMediaDescSeq )
{ {
...@@ -568,8 +555,6 @@ GraphicHelper* FilterBase::implCreateGraphicHelper() const ...@@ -568,8 +555,6 @@ GraphicHelper* FilterBase::implCreateGraphicHelper() const
return new GraphicHelper( mxImpl->mxComponentContext, mxImpl->mxTargetFrame, mxImpl->mxStorage ); return new GraphicHelper( mxImpl->mxComponentContext, mxImpl->mxTargetFrame, mxImpl->mxStorage );
} }
// ============================================================================
} // namespace core } // namespace core
} // namespace oox } // namespace oox
......
...@@ -18,19 +18,18 @@ ...@@ -18,19 +18,18 @@
*/ */
#include "analysis.hxx" #include "analysis.hxx"
#include "analysis.hrc"
#include <comphelper/processfactory.hxx> #include "bessel.hxx"
#include <cppuhelper/factory.hxx> #include <cppuhelper/factory.hxx>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <osl/diagnose.h> #include <osl/diagnose.h>
#include <rtl/ustrbuf.hxx> #include <rtl/ustrbuf.hxx>
#include <rtl/math.hxx> #include <rtl/math.hxx>
#include <sal/macros.h> #include <sal/macros.h>
#include <string.h> #include <string.h>
#include <tools/resmgr.hxx> #include <tools/resmgr.hxx>
#include <tools/rcid.h> #include <tools/rcid.h>
#include "analysis.hrc"
#include "bessel.hxx"
#define ADDIN_SERVICE "com.sun.star.sheet.AddIn" #define ADDIN_SERVICE "com.sun.star.sheet.AddIn"
#define MY_SERVICE "com.sun.star.sheet.addin.Analysis" #define MY_SERVICE "com.sun.star.sheet.addin.Analysis"
...@@ -38,7 +37,6 @@ ...@@ -38,7 +37,6 @@
using namespace ::com::sun::star; using namespace ::com::sun::star;
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL analysis_component_getFactory( extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL analysis_component_getFactory(
const sal_Char* pImplName, void* pServiceManager, void* /*pRegistryKey*/ ) const sal_Char* pImplName, void* pServiceManager, void* /*pRegistryKey*/ )
{ {
...@@ -62,14 +60,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL analysis_component_getFactory( ...@@ -62,14 +60,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL analysis_component_getFactory(
return pRet; return pRet;
} }
//------------------------------------------------------------------------
//
// "normal" service implementation
//
//------------------------------------------------------------------------
ResMgr& AnalysisAddIn::GetResMgr( void ) throw( uno::RuntimeException ) ResMgr& AnalysisAddIn::GetResMgr( void ) throw( uno::RuntimeException )
{ {
if( !pResMgr ) if( !pResMgr )
...@@ -83,13 +73,11 @@ ResMgr& AnalysisAddIn::GetResMgr( void ) throw( uno::RuntimeException ) ...@@ -83,13 +73,11 @@ ResMgr& AnalysisAddIn::GetResMgr( void ) throw( uno::RuntimeException )
return *pResMgr; return *pResMgr;
} }
OUString AnalysisAddIn::GetDisplFuncStr( sal_uInt16 nFuncNum ) throw( uno::RuntimeException ) OUString AnalysisAddIn::GetDisplFuncStr( sal_uInt16 nFuncNum ) throw( uno::RuntimeException )
{ {
return AnalysisRscStrLoader( RID_ANALYSIS_FUNCTION_NAMES, nFuncNum, GetResMgr() ).GetString(); return AnalysisRscStrLoader( RID_ANALYSIS_FUNCTION_NAMES, nFuncNum, GetResMgr() ).GetString();
} }
class AnalysisResourcePublisher : public Resource class AnalysisResourcePublisher : public Resource
{ {
public: public:
...@@ -98,14 +86,12 @@ public: ...@@ -98,14 +86,12 @@ public:
void FreeResource() { Resource::FreeResource(); } void FreeResource() { Resource::FreeResource(); }
}; };
class AnalysisFuncRes : public Resource class AnalysisFuncRes : public Resource
{ {
public: public:
AnalysisFuncRes( ResId& rRes, ResMgr& rResMgr, sal_uInt16 nInd, OUString& rRet ); AnalysisFuncRes( ResId& rRes, ResMgr& rResMgr, sal_uInt16 nInd, OUString& rRet );
}; };
AnalysisFuncRes::AnalysisFuncRes( ResId& rRes, ResMgr& rResMgr, sal_uInt16 nInd, OUString& rRet ) : Resource( rRes ) AnalysisFuncRes::AnalysisFuncRes( ResId& rRes, ResMgr& rResMgr, sal_uInt16 nInd, OUString& rRet ) : Resource( rRes )
{ {
rRet = AnalysisResId(nInd, rResMgr).toString(); rRet = AnalysisResId(nInd, rResMgr).toString();
...@@ -113,7 +99,6 @@ AnalysisFuncRes::AnalysisFuncRes( ResId& rRes, ResMgr& rResMgr, sal_uInt16 nInd, ...@@ -113,7 +99,6 @@ AnalysisFuncRes::AnalysisFuncRes( ResId& rRes, ResMgr& rResMgr, sal_uInt16 nInd,
FreeResource(); FreeResource();
} }
OUString AnalysisAddIn::GetFuncDescrStr( sal_uInt16 nResId, sal_uInt16 nStrIndex ) throw( uno::RuntimeException ) OUString AnalysisAddIn::GetFuncDescrStr( sal_uInt16 nResId, sal_uInt16 nStrIndex ) throw( uno::RuntimeException )
{ {
OUString aRet; OUString aRet;
...@@ -130,7 +115,6 @@ OUString AnalysisAddIn::GetFuncDescrStr( sal_uInt16 nResId, sal_uInt16 nStrIndex ...@@ -130,7 +115,6 @@ OUString AnalysisAddIn::GetFuncDescrStr( sal_uInt16 nResId, sal_uInt16 nStrIndex
return aRet; return aRet;
} }
void AnalysisAddIn::InitData( void ) void AnalysisAddIn::InitData( void )
{ {
if( pResMgr ) if( pResMgr )
...@@ -154,7 +138,6 @@ void AnalysisAddIn::InitData( void ) ...@@ -154,7 +138,6 @@ void AnalysisAddIn::InitData( void )
} }
} }
AnalysisAddIn::AnalysisAddIn( const uno::Reference< uno::XComponentContext >& xContext ) : AnalysisAddIn::AnalysisAddIn( const uno::Reference< uno::XComponentContext >& xContext ) :
pDefLocales( NULL ), pDefLocales( NULL ),
pFD( NULL ), pFD( NULL ),
...@@ -165,7 +148,6 @@ AnalysisAddIn::AnalysisAddIn( const uno::Reference< uno::XComponentContext >& xC ...@@ -165,7 +148,6 @@ AnalysisAddIn::AnalysisAddIn( const uno::Reference< uno::XComponentContext >& xC
{ {
} }
AnalysisAddIn::~AnalysisAddIn() AnalysisAddIn::~AnalysisAddIn()
{ {
if( pFD ) if( pFD )
...@@ -181,7 +163,6 @@ AnalysisAddIn::~AnalysisAddIn() ...@@ -181,7 +163,6 @@ AnalysisAddIn::~AnalysisAddIn()
delete[] pDefLocales; delete[] pDefLocales;
} }
sal_Int32 AnalysisAddIn::getDateMode( sal_Int32 AnalysisAddIn::getDateMode(
const uno::Reference< beans::XPropertySet >& xPropSet, const uno::Reference< beans::XPropertySet >& xPropSet,
const uno::Any& rAny ) throw( uno::RuntimeException, lang::IllegalArgumentException ) const uno::Any& rAny ) throw( uno::RuntimeException, lang::IllegalArgumentException )
...@@ -192,11 +173,6 @@ sal_Int32 AnalysisAddIn::getDateMode( ...@@ -192,11 +173,6 @@ sal_Int32 AnalysisAddIn::getDateMode(
return nMode; return nMode;
} }
//-----------------------------------------------------------------------------
#define MAXFACTDOUBLE 300 #define MAXFACTDOUBLE 300
double AnalysisAddIn::FactDouble( sal_Int32 nNum ) throw( uno::RuntimeException, lang::IllegalArgumentException ) double AnalysisAddIn::FactDouble( sal_Int32 nNum ) throw( uno::RuntimeException, lang::IllegalArgumentException )
...@@ -239,13 +215,11 @@ double AnalysisAddIn::FactDouble( sal_Int32 nNum ) throw( uno::RuntimeException, ...@@ -239,13 +215,11 @@ double AnalysisAddIn::FactDouble( sal_Int32 nNum ) throw( uno::RuntimeException,
return pFactDoubles[ nNum ]; return pFactDoubles[ nNum ];
} }
OUString AnalysisAddIn::getImplementationName_Static() OUString AnalysisAddIn::getImplementationName_Static()
{ {
return OUString( MY_IMPLNAME ); return OUString( MY_IMPLNAME );
} }
uno::Sequence< OUString > AnalysisAddIn::getSupportedServiceNames_Static() uno::Sequence< OUString > AnalysisAddIn::getSupportedServiceNames_Static()
{ {
uno::Sequence< OUString > aRet(2); uno::Sequence< OUString > aRet(2);
...@@ -255,7 +229,6 @@ uno::Sequence< OUString > AnalysisAddIn::getSupportedServiceNames_Static() ...@@ -255,7 +229,6 @@ uno::Sequence< OUString > AnalysisAddIn::getSupportedServiceNames_Static()
return aRet; return aRet;
} }
uno::Reference< uno::XInterface > SAL_CALL AnalysisAddIn_CreateInstance( uno::Reference< uno::XInterface > SAL_CALL AnalysisAddIn_CreateInstance(
const uno::Reference< lang::XMultiServiceFactory >& xServiceFact ) const uno::Reference< lang::XMultiServiceFactory >& xServiceFact )
{ {
...@@ -263,38 +236,30 @@ uno::Reference< uno::XInterface > SAL_CALL AnalysisAddIn_CreateInstance( ...@@ -263,38 +236,30 @@ uno::Reference< uno::XInterface > SAL_CALL AnalysisAddIn_CreateInstance(
return xInst; return xInst;
} }
// XServiceName // XServiceName
OUString SAL_CALL AnalysisAddIn::getServiceName() throw( uno::RuntimeException ) OUString SAL_CALL AnalysisAddIn::getServiceName() throw( uno::RuntimeException )
{ {
// name of specific AddIn service // name of specific AddIn service
return OUString( MY_SERVICE ); return OUString( MY_SERVICE );
} }
// XServiceInfo // XServiceInfo
OUString SAL_CALL AnalysisAddIn::getImplementationName() throw( uno::RuntimeException ) OUString SAL_CALL AnalysisAddIn::getImplementationName() throw( uno::RuntimeException )
{ {
return getImplementationName_Static(); return getImplementationName_Static();
} }
sal_Bool SAL_CALL AnalysisAddIn::supportsService( const OUString& aName ) throw( uno::RuntimeException ) sal_Bool SAL_CALL AnalysisAddIn::supportsService( const OUString& aName ) throw( uno::RuntimeException )
{ {
return aName.equalsAscii( ADDIN_SERVICE ) || aName.equalsAscii( MY_SERVICE ); return cppu::supportsService(this, aName);
} }
uno::Sequence< OUString > SAL_CALL AnalysisAddIn::getSupportedServiceNames() throw( uno::RuntimeException ) uno::Sequence< OUString > SAL_CALL AnalysisAddIn::getSupportedServiceNames() throw( uno::RuntimeException )
{ {
return getSupportedServiceNames_Static(); return getSupportedServiceNames_Static();
} }
// XLocalizable // XLocalizable
void SAL_CALL AnalysisAddIn::setLocale( const lang::Locale& eLocale ) throw( uno::RuntimeException ) void SAL_CALL AnalysisAddIn::setLocale( const lang::Locale& eLocale ) throw( uno::RuntimeException )
{ {
aFuncLoc = eLocale; aFuncLoc = eLocale;
...@@ -307,9 +272,7 @@ lang::Locale SAL_CALL AnalysisAddIn::getLocale() throw( uno::RuntimeException ) ...@@ -307,9 +272,7 @@ lang::Locale SAL_CALL AnalysisAddIn::getLocale() throw( uno::RuntimeException )
return aFuncLoc; return aFuncLoc;
} }
// XAddIn // XAddIn
OUString SAL_CALL AnalysisAddIn::getProgrammaticFuntionName( const OUString& ) throw( uno::RuntimeException ) OUString SAL_CALL AnalysisAddIn::getProgrammaticFuntionName( const OUString& ) throw( uno::RuntimeException )
{ {
// not used by calc // not used by calc
...@@ -318,7 +281,6 @@ OUString SAL_CALL AnalysisAddIn::getProgrammaticFuntionName( const OUString& ) t ...@@ -318,7 +281,6 @@ OUString SAL_CALL AnalysisAddIn::getProgrammaticFuntionName( const OUString& ) t
return OUString(); return OUString();
} }
OUString SAL_CALL AnalysisAddIn::getDisplayFunctionName( const OUString& aProgrammaticName ) throw( uno::RuntimeException ) OUString SAL_CALL AnalysisAddIn::getDisplayFunctionName( const OUString& aProgrammaticName ) throw( uno::RuntimeException )
{ {
OUString aRet; OUString aRet;
...@@ -338,7 +300,6 @@ OUString SAL_CALL AnalysisAddIn::getDisplayFunctionName( const OUString& aProgra ...@@ -338,7 +300,6 @@ OUString SAL_CALL AnalysisAddIn::getDisplayFunctionName( const OUString& aProgra
return aRet; return aRet;
} }
OUString SAL_CALL AnalysisAddIn::getFunctionDescription( const OUString& aProgrammaticName ) throw( uno::RuntimeException ) OUString SAL_CALL AnalysisAddIn::getFunctionDescription( const OUString& aProgrammaticName ) throw( uno::RuntimeException )
{ {
OUString aRet; OUString aRet;
...@@ -350,7 +311,6 @@ OUString SAL_CALL AnalysisAddIn::getFunctionDescription( const OUString& aProgra ...@@ -350,7 +311,6 @@ OUString SAL_CALL AnalysisAddIn::getFunctionDescription( const OUString& aProgra
return aRet; return aRet;
} }
OUString SAL_CALL AnalysisAddIn::getDisplayArgumentName( const OUString& aName, sal_Int32 nArg ) throw( uno::RuntimeException ) OUString SAL_CALL AnalysisAddIn::getDisplayArgumentName( const OUString& aName, sal_Int32 nArg ) throw( uno::RuntimeException )
{ {
OUString aRet; OUString aRet;
...@@ -368,7 +328,6 @@ OUString SAL_CALL AnalysisAddIn::getDisplayArgumentName( const OUString& aName, ...@@ -368,7 +328,6 @@ OUString SAL_CALL AnalysisAddIn::getDisplayArgumentName( const OUString& aName,
return aRet; return aRet;
} }
OUString SAL_CALL AnalysisAddIn::getArgumentDescription( const OUString& aName, sal_Int32 nArg ) throw( uno::RuntimeException ) OUString SAL_CALL AnalysisAddIn::getArgumentDescription( const OUString& aName, sal_Int32 nArg ) throw( uno::RuntimeException )
{ {
OUString aRet; OUString aRet;
...@@ -386,14 +345,12 @@ OUString SAL_CALL AnalysisAddIn::getArgumentDescription( const OUString& aName, ...@@ -386,14 +345,12 @@ OUString SAL_CALL AnalysisAddIn::getArgumentDescription( const OUString& aName,
return aRet; return aRet;
} }
static const OUString pDefCatName("Add-In"); static const OUString pDefCatName("Add-In");
OUString SAL_CALL AnalysisAddIn::getProgrammaticCategoryName( const OUString& aName ) throw( uno::RuntimeException ) OUString SAL_CALL AnalysisAddIn::getProgrammaticCategoryName( const OUString& aName ) throw( uno::RuntimeException )
{ {
// return non-translated strings // return non-translated strings
// return OUString( "Add-In" ); // return OUString( "Add-In" );
const FuncData* p = pFD->Get( aName ); const FuncData* p = pFD->Get( aName );
OUString aRet; OUString aRet;
if( p ) if( p )
...@@ -415,11 +372,10 @@ OUString SAL_CALL AnalysisAddIn::getProgrammaticCategoryName( const OUString& aN ...@@ -415,11 +372,10 @@ OUString SAL_CALL AnalysisAddIn::getProgrammaticCategoryName( const OUString& aN
return aRet; return aRet;
} }
OUString SAL_CALL AnalysisAddIn::getDisplayCategoryName( const OUString& aProgrammaticFunctionName ) throw( uno::RuntimeException ) OUString SAL_CALL AnalysisAddIn::getDisplayCategoryName( const OUString& aProgrammaticFunctionName ) throw( uno::RuntimeException )
{ {
// return translated strings, not used for predefined categories // return translated strings, not used for predefined categories
// return OUString( "Add-In" ); // return OUString( "Add-In" );
const FuncData* p = pFD->Get( aProgrammaticFunctionName ); const FuncData* p = pFD->Get( aProgrammaticFunctionName );
OUString aRet; OUString aRet;
if( p ) if( p )
...@@ -441,12 +397,10 @@ OUString SAL_CALL AnalysisAddIn::getDisplayCategoryName( const OUString& aProgra ...@@ -441,12 +397,10 @@ OUString SAL_CALL AnalysisAddIn::getDisplayCategoryName( const OUString& aProgra
return aRet; return aRet;
} }
static const sal_Char* pLang[] = { "de", "en" }; static const sal_Char* pLang[] = { "de", "en" };
static const sal_Char* pCoun[] = { "DE", "US" }; static const sal_Char* pCoun[] = { "DE", "US" };
static const sal_uInt32 nNumOfLoc = SAL_N_ELEMENTS(pLang); static const sal_uInt32 nNumOfLoc = SAL_N_ELEMENTS(pLang);
void AnalysisAddIn::InitDefLocales( void ) void AnalysisAddIn::InitDefLocales( void )
{ {
pDefLocales = new lang::Locale[ nNumOfLoc ]; pDefLocales = new lang::Locale[ nNumOfLoc ];
...@@ -458,7 +412,6 @@ void AnalysisAddIn::InitDefLocales( void ) ...@@ -458,7 +412,6 @@ void AnalysisAddIn::InitDefLocales( void )
} }
} }
inline const lang::Locale& AnalysisAddIn::GetLocale( sal_uInt32 nInd ) inline const lang::Locale& AnalysisAddIn::GetLocale( sal_uInt32 nInd )
{ {
if( !pDefLocales ) if( !pDefLocales )
...@@ -470,7 +423,6 @@ inline const lang::Locale& AnalysisAddIn::GetLocale( sal_uInt32 nInd ) ...@@ -470,7 +423,6 @@ inline const lang::Locale& AnalysisAddIn::GetLocale( sal_uInt32 nInd )
return aFuncLoc; return aFuncLoc;
} }
uno::Sequence< sheet::LocalizedName > SAL_CALL AnalysisAddIn::getCompatibilityNames( const OUString& aProgrammaticName ) throw( uno::RuntimeException ) uno::Sequence< sheet::LocalizedName > SAL_CALL AnalysisAddIn::getCompatibilityNames( const OUString& aProgrammaticName ) throw( uno::RuntimeException )
{ {
const FuncData* p = pFD->Get( aProgrammaticName ); const FuncData* p = pFD->Get( aProgrammaticName );
...@@ -493,13 +445,8 @@ uno::Sequence< sheet::LocalizedName > SAL_CALL AnalysisAddIn::getCompatibilityNa ...@@ -493,13 +445,8 @@ uno::Sequence< sheet::LocalizedName > SAL_CALL AnalysisAddIn::getCompatibilityNa
return aRet; return aRet;
} }
// XAnalysis // XAnalysis
/** Workday */
/**
* Workday
*/
sal_Int32 SAL_CALL AnalysisAddIn::getWorkday( const uno::Reference< beans::XPropertySet >& xOptions, sal_Int32 SAL_CALL AnalysisAddIn::getWorkday( const uno::Reference< beans::XPropertySet >& xOptions,
sal_Int32 nDate, sal_Int32 nDays, const uno::Any& aHDay ) throw( uno::RuntimeException, lang::IllegalArgumentException ) sal_Int32 nDate, sal_Int32 nDays, const uno::Any& aHDay ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
...@@ -556,11 +503,7 @@ sal_Int32 SAL_CALL AnalysisAddIn::getWorkday( const uno::Reference< beans::XProp ...@@ -556,11 +503,7 @@ sal_Int32 SAL_CALL AnalysisAddIn::getWorkday( const uno::Reference< beans::XProp
return nActDate - nNullDate; return nActDate - nNullDate;
} }
/** Yearfrac */
/**
* Yearfrac
*/
double SAL_CALL AnalysisAddIn::getYearfrac( const uno::Reference< beans::XPropertySet >& xOpt, double SAL_CALL AnalysisAddIn::getYearfrac( const uno::Reference< beans::XPropertySet >& xOpt,
sal_Int32 nStartDate, sal_Int32 nEndDate, const uno::Any& rMode ) throw( uno::RuntimeException, lang::IllegalArgumentException ) sal_Int32 nStartDate, sal_Int32 nEndDate, const uno::Any& rMode ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
...@@ -568,7 +511,6 @@ double SAL_CALL AnalysisAddIn::getYearfrac( const uno::Reference< beans::XProper ...@@ -568,7 +511,6 @@ double SAL_CALL AnalysisAddIn::getYearfrac( const uno::Reference< beans::XProper
RETURN_FINITE( fRet ); RETURN_FINITE( fRet );
} }
sal_Int32 SAL_CALL AnalysisAddIn::getEdate( const uno::Reference< beans::XPropertySet >& xOpt, sal_Int32 nStartDate, sal_Int32 nMonths ) throw( uno::RuntimeException, lang::IllegalArgumentException ) sal_Int32 SAL_CALL AnalysisAddIn::getEdate( const uno::Reference< beans::XPropertySet >& xOpt, sal_Int32 nStartDate, sal_Int32 nMonths ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
sal_Int32 nNullDate = GetNullDate( xOpt ); sal_Int32 nNullDate = GetNullDate( xOpt );
...@@ -577,7 +519,6 @@ sal_Int32 SAL_CALL AnalysisAddIn::getEdate( const uno::Reference< beans::XProper ...@@ -577,7 +519,6 @@ sal_Int32 SAL_CALL AnalysisAddIn::getEdate( const uno::Reference< beans::XProper
return aDate.getDate( nNullDate ); return aDate.getDate( nNullDate );
} }
sal_Int32 SAL_CALL AnalysisAddIn::getWeeknum( const uno::Reference< beans::XPropertySet >& xOpt, sal_Int32 nDate, sal_Int32 nMode ) throw( uno::RuntimeException, lang::IllegalArgumentException ) sal_Int32 SAL_CALL AnalysisAddIn::getWeeknum( const uno::Reference< beans::XPropertySet >& xOpt, sal_Int32 nDate, sal_Int32 nMode ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
nDate += GetNullDate( xOpt ); nDate += GetNullDate( xOpt );
...@@ -591,7 +532,6 @@ sal_Int32 SAL_CALL AnalysisAddIn::getWeeknum( const uno::Reference< beans::XProp ...@@ -591,7 +532,6 @@ sal_Int32 SAL_CALL AnalysisAddIn::getWeeknum( const uno::Reference< beans::XProp
return ( nDate - nFirstInYear + ( ( nMode == 1 )? ( nFirstDayInYear + 1 ) % 7 : nFirstDayInYear ) ) / 7 + 1; return ( nDate - nFirstInYear + ( ( nMode == 1 )? ( nFirstDayInYear + 1 ) % 7 : nFirstDayInYear ) ) / 7 + 1;
} }
sal_Int32 SAL_CALL AnalysisAddIn::getEomonth( const uno::Reference< beans::XPropertySet >& xOpt, sal_Int32 nDate, sal_Int32 nMonths ) throw( uno::RuntimeException, lang::IllegalArgumentException ) sal_Int32 SAL_CALL AnalysisAddIn::getEomonth( const uno::Reference< beans::XPropertySet >& xOpt, sal_Int32 nDate, sal_Int32 nMonths ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
sal_Int32 nNullDate = GetNullDate( xOpt ); sal_Int32 nNullDate = GetNullDate( xOpt );
...@@ -618,7 +558,6 @@ sal_Int32 SAL_CALL AnalysisAddIn::getEomonth( const uno::Reference< beans::XProp ...@@ -618,7 +558,6 @@ sal_Int32 SAL_CALL AnalysisAddIn::getEomonth( const uno::Reference< beans::XProp
return DateToDays( DaysInMonth( sal_uInt16( nNewMonth ), nYear ), sal_uInt16( nNewMonth ), nYear ) - nNullDate; return DateToDays( DaysInMonth( sal_uInt16( nNewMonth ), nYear ), sal_uInt16( nNewMonth ), nYear ) - nNullDate;
} }
sal_Int32 SAL_CALL AnalysisAddIn::getNetworkdays( const uno::Reference< beans::XPropertySet >& xOpt, sal_Int32 SAL_CALL AnalysisAddIn::getNetworkdays( const uno::Reference< beans::XPropertySet >& xOpt,
sal_Int32 nStartDate, sal_Int32 nEndDate, const uno::Any& aHDay ) throw( uno::RuntimeException, lang::IllegalArgumentException ) sal_Int32 nStartDate, sal_Int32 nEndDate, const uno::Any& aHDay ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
...@@ -656,13 +595,11 @@ sal_Int32 SAL_CALL AnalysisAddIn::getNetworkdays( const uno::Reference< beans::X ...@@ -656,13 +595,11 @@ sal_Int32 SAL_CALL AnalysisAddIn::getNetworkdays( const uno::Reference< beans::X
return nCnt; return nCnt;
} }
sal_Int32 SAL_CALL AnalysisAddIn::getIseven( sal_Int32 nVal ) throw( uno::RuntimeException, lang::IllegalArgumentException ) sal_Int32 SAL_CALL AnalysisAddIn::getIseven( sal_Int32 nVal ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
return ( nVal & 0x00000001 )? 0 : 1; return ( nVal & 0x00000001 )? 0 : 1;
} }
sal_Int32 SAL_CALL AnalysisAddIn::getIsodd( sal_Int32 nVal ) throw( uno::RuntimeException, lang::IllegalArgumentException ) sal_Int32 SAL_CALL AnalysisAddIn::getIsodd( sal_Int32 nVal ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
return ( nVal & 0x00000001 )? 1 : 0; return ( nVal & 0x00000001 )? 1 : 0;
...@@ -699,7 +636,6 @@ AnalysisAddIn::getMultinomial( const uno::Reference< beans::XPropertySet >& xOpt ...@@ -699,7 +636,6 @@ AnalysisAddIn::getMultinomial( const uno::Reference< beans::XPropertySet >& xOpt
RETURN_FINITE( fRet ); RETURN_FINITE( fRet );
} }
double SAL_CALL AnalysisAddIn::getSeriessum( double fX, double fN, double fM, const uno::Sequence< uno::Sequence< double > >& aCoeffList ) throw( uno::RuntimeException, lang::IllegalArgumentException ) double SAL_CALL AnalysisAddIn::getSeriessum( double fX, double fN, double fM, const uno::Sequence< uno::Sequence< double > >& aCoeffList ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
double fRet = 0.0; double fRet = 0.0;
...@@ -732,7 +668,6 @@ double SAL_CALL AnalysisAddIn::getSeriessum( double fX, double fN, double fM, co ...@@ -732,7 +668,6 @@ double SAL_CALL AnalysisAddIn::getSeriessum( double fX, double fN, double fM, co
RETURN_FINITE( fRet ); RETURN_FINITE( fRet );
} }
double SAL_CALL AnalysisAddIn::getQuotient( double fNum, double fDenom ) throw( uno::RuntimeException, lang::IllegalArgumentException ) double SAL_CALL AnalysisAddIn::getQuotient( double fNum, double fDenom ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
double fRet; double fRet;
...@@ -743,7 +678,6 @@ double SAL_CALL AnalysisAddIn::getQuotient( double fNum, double fDenom ) throw( ...@@ -743,7 +678,6 @@ double SAL_CALL AnalysisAddIn::getQuotient( double fNum, double fDenom ) throw(
RETURN_FINITE( fRet ); RETURN_FINITE( fRet );
} }
double SAL_CALL AnalysisAddIn::getMround( double fNum, double fMult ) throw( uno::RuntimeException, lang::IllegalArgumentException ) double SAL_CALL AnalysisAddIn::getMround( double fNum, double fMult ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
if( fMult == 0.0 ) if( fMult == 0.0 )
...@@ -753,14 +687,12 @@ double SAL_CALL AnalysisAddIn::getMround( double fNum, double fMult ) throw( uno ...@@ -753,14 +687,12 @@ double SAL_CALL AnalysisAddIn::getMround( double fNum, double fMult ) throw( uno
RETURN_FINITE( fRet ); RETURN_FINITE( fRet );
} }
double SAL_CALL AnalysisAddIn::getSqrtpi( double fNum ) throw( uno::RuntimeException, lang::IllegalArgumentException ) double SAL_CALL AnalysisAddIn::getSqrtpi( double fNum ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
double fRet = sqrt( fNum * PI ); double fRet = sqrt( fNum * PI );
RETURN_FINITE( fRet ); RETURN_FINITE( fRet );
} }
double SAL_CALL AnalysisAddIn::getRandbetween( double fMin, double fMax ) throw( uno::RuntimeException, lang::IllegalArgumentException ) double SAL_CALL AnalysisAddIn::getRandbetween( double fMin, double fMax ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
fMin = ::rtl::math::round( fMin, 0, rtl_math_RoundingMode_Up ); fMin = ::rtl::math::round( fMin, 0, rtl_math_RoundingMode_Up );
...@@ -777,7 +709,6 @@ double SAL_CALL AnalysisAddIn::getRandbetween( double fMin, double fMax ) throw( ...@@ -777,7 +709,6 @@ double SAL_CALL AnalysisAddIn::getRandbetween( double fMin, double fMax ) throw(
RETURN_FINITE( fRet ); RETURN_FINITE( fRet );
} }
double SAL_CALL AnalysisAddIn::getGcd( const uno::Reference< beans::XPropertySet >& xOpt, const uno::Sequence< uno::Sequence< double > >& aVLst, const uno::Sequence< uno::Any >& aOptVLst ) throw( uno::RuntimeException, lang::IllegalArgumentException ) double SAL_CALL AnalysisAddIn::getGcd( const uno::Reference< beans::XPropertySet >& xOpt, const uno::Sequence< uno::Sequence< double > >& aVLst, const uno::Sequence< uno::Any >& aOptVLst ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
ScaDoubleListGT0 aValList; ScaDoubleListGT0 aValList;
...@@ -797,7 +728,6 @@ double SAL_CALL AnalysisAddIn::getGcd( const uno::Reference< beans::XPropertySet ...@@ -797,7 +728,6 @@ double SAL_CALL AnalysisAddIn::getGcd( const uno::Reference< beans::XPropertySet
RETURN_FINITE( f ); RETURN_FINITE( f );
} }
double SAL_CALL AnalysisAddIn::getLcm( const uno::Reference< beans::XPropertySet >& xOpt, const uno::Sequence< uno::Sequence< double > >& aVLst, const uno::Sequence< uno::Any >& aOptVLst ) throw( uno::RuntimeException, lang::IllegalArgumentException ) double SAL_CALL AnalysisAddIn::getLcm( const uno::Reference< beans::XPropertySet >& xOpt, const uno::Sequence< uno::Sequence< double > >& aVLst, const uno::Sequence< uno::Any >& aOptVLst ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
ScaDoubleListGE0 aValList; ScaDoubleListGE0 aValList;
...@@ -825,21 +755,18 @@ double SAL_CALL AnalysisAddIn::getLcm( const uno::Reference< beans::XPropertySet ...@@ -825,21 +755,18 @@ double SAL_CALL AnalysisAddIn::getLcm( const uno::Reference< beans::XPropertySet
RETURN_FINITE( f ); RETURN_FINITE( f );
} }
double SAL_CALL AnalysisAddIn::getBesseli( double fNum, sal_Int32 nOrder ) throw( uno::RuntimeException, lang::IllegalArgumentException, sheet::NoConvergenceException ) double SAL_CALL AnalysisAddIn::getBesseli( double fNum, sal_Int32 nOrder ) throw( uno::RuntimeException, lang::IllegalArgumentException, sheet::NoConvergenceException )
{ {
double fRet = sca::analysis::BesselI( fNum, nOrder ); double fRet = sca::analysis::BesselI( fNum, nOrder );
RETURN_FINITE( fRet ); RETURN_FINITE( fRet );
} }
double SAL_CALL AnalysisAddIn::getBesselj( double fNum, sal_Int32 nOrder ) throw( uno::RuntimeException, lang::IllegalArgumentException, sheet::NoConvergenceException ) double SAL_CALL AnalysisAddIn::getBesselj( double fNum, sal_Int32 nOrder ) throw( uno::RuntimeException, lang::IllegalArgumentException, sheet::NoConvergenceException )
{ {
double fRet = sca::analysis::BesselJ( fNum, nOrder ); double fRet = sca::analysis::BesselJ( fNum, nOrder );
RETURN_FINITE( fRet ); RETURN_FINITE( fRet );
} }
double SAL_CALL AnalysisAddIn::getBesselk( double fNum, sal_Int32 nOrder ) throw( uno::RuntimeException, lang::IllegalArgumentException, sheet::NoConvergenceException ) double SAL_CALL AnalysisAddIn::getBesselk( double fNum, sal_Int32 nOrder ) throw( uno::RuntimeException, lang::IllegalArgumentException, sheet::NoConvergenceException )
{ {
if( nOrder < 0 || fNum <= 0.0 ) if( nOrder < 0 || fNum <= 0.0 )
...@@ -849,7 +776,6 @@ double SAL_CALL AnalysisAddIn::getBesselk( double fNum, sal_Int32 nOrder ) throw ...@@ -849,7 +776,6 @@ double SAL_CALL AnalysisAddIn::getBesselk( double fNum, sal_Int32 nOrder ) throw
RETURN_FINITE( fRet ); RETURN_FINITE( fRet );
} }
double SAL_CALL AnalysisAddIn::getBessely( double fNum, sal_Int32 nOrder ) throw( uno::RuntimeException, lang::IllegalArgumentException, sheet::NoConvergenceException ) double SAL_CALL AnalysisAddIn::getBessely( double fNum, sal_Int32 nOrder ) throw( uno::RuntimeException, lang::IllegalArgumentException, sheet::NoConvergenceException )
{ {
if( nOrder < 0 || fNum <= 0.0 ) if( nOrder < 0 || fNum <= 0.0 )
...@@ -859,7 +785,6 @@ double SAL_CALL AnalysisAddIn::getBessely( double fNum, sal_Int32 nOrder ) throw ...@@ -859,7 +785,6 @@ double SAL_CALL AnalysisAddIn::getBessely( double fNum, sal_Int32 nOrder ) throw
RETURN_FINITE( fRet ); RETURN_FINITE( fRet );
} }
const double SCA_MAX2 = 511.0; // min. val for binary numbers (9 bits + sign) const double SCA_MAX2 = 511.0; // min. val for binary numbers (9 bits + sign)
const double SCA_MIN2 = -SCA_MAX2-1.0; // min. val for binary numbers (9 bits + sign) const double SCA_MIN2 = -SCA_MAX2-1.0; // min. val for binary numbers (9 bits + sign)
const double SCA_MAX8 = 536870911.0; // max. val for octal numbers (29 bits + sign) const double SCA_MAX8 = 536870911.0; // max. val for octal numbers (29 bits + sign)
...@@ -868,7 +793,6 @@ const double SCA_MAX16 = 549755813888.0; // max. val for hexadecimal ...@@ -868,7 +793,6 @@ const double SCA_MAX16 = 549755813888.0; // max. val for hexadecimal
const double SCA_MIN16 = -SCA_MAX16-1.0; // min. val for hexadecimal numbers (39 bits + sign) const double SCA_MIN16 = -SCA_MAX16-1.0; // min. val for hexadecimal numbers (39 bits + sign)
const sal_Int32 SCA_MAXPLACES = 10; // max. number of places const sal_Int32 SCA_MAXPLACES = 10; // max. number of places
OUString SAL_CALL AnalysisAddIn::getBin2Oct( const uno::Reference< beans::XPropertySet >& xOpt, const OUString& aNum, const uno::Any& rPlaces ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getBin2Oct( const uno::Reference< beans::XPropertySet >& xOpt, const OUString& aNum, const uno::Any& rPlaces ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
double fVal = ConvertToDec( aNum, 2, SCA_MAXPLACES ); double fVal = ConvertToDec( aNum, 2, SCA_MAXPLACES );
...@@ -877,14 +801,12 @@ OUString SAL_CALL AnalysisAddIn::getBin2Oct( const uno::Reference< beans::XPrope ...@@ -877,14 +801,12 @@ OUString SAL_CALL AnalysisAddIn::getBin2Oct( const uno::Reference< beans::XPrope
return ConvertFromDec( fVal, SCA_MIN8, SCA_MAX8, 8, nPlaces, SCA_MAXPLACES, bUsePlaces ); return ConvertFromDec( fVal, SCA_MIN8, SCA_MAX8, 8, nPlaces, SCA_MAXPLACES, bUsePlaces );
} }
double SAL_CALL AnalysisAddIn::getBin2Dec( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException ) double SAL_CALL AnalysisAddIn::getBin2Dec( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
double fRet = ConvertToDec( aNum, 2, SCA_MAXPLACES ); double fRet = ConvertToDec( aNum, 2, SCA_MAXPLACES );
RETURN_FINITE( fRet ); RETURN_FINITE( fRet );
} }
OUString SAL_CALL AnalysisAddIn::getBin2Hex( const uno::Reference< beans::XPropertySet >& xOpt, const OUString& aNum, const uno::Any& rPlaces ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getBin2Hex( const uno::Reference< beans::XPropertySet >& xOpt, const OUString& aNum, const uno::Any& rPlaces ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
double fVal = ConvertToDec( aNum, 2, SCA_MAXPLACES ); double fVal = ConvertToDec( aNum, 2, SCA_MAXPLACES );
...@@ -893,7 +815,6 @@ OUString SAL_CALL AnalysisAddIn::getBin2Hex( const uno::Reference< beans::XPrope ...@@ -893,7 +815,6 @@ OUString SAL_CALL AnalysisAddIn::getBin2Hex( const uno::Reference< beans::XPrope
return ConvertFromDec( fVal, SCA_MIN16, SCA_MAX16, 16, nPlaces, SCA_MAXPLACES, bUsePlaces ); return ConvertFromDec( fVal, SCA_MIN16, SCA_MAX16, 16, nPlaces, SCA_MAXPLACES, bUsePlaces );
} }
OUString SAL_CALL AnalysisAddIn::getOct2Bin( const uno::Reference< beans::XPropertySet >& xOpt, const OUString& aNum, const uno::Any& rPlaces ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getOct2Bin( const uno::Reference< beans::XPropertySet >& xOpt, const OUString& aNum, const uno::Any& rPlaces ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
double fVal = ConvertToDec( aNum, 8, SCA_MAXPLACES ); double fVal = ConvertToDec( aNum, 8, SCA_MAXPLACES );
...@@ -902,14 +823,12 @@ OUString SAL_CALL AnalysisAddIn::getOct2Bin( const uno::Reference< beans::XPrope ...@@ -902,14 +823,12 @@ OUString SAL_CALL AnalysisAddIn::getOct2Bin( const uno::Reference< beans::XPrope
return ConvertFromDec( fVal, SCA_MIN2, SCA_MAX2, 2, nPlaces, SCA_MAXPLACES, bUsePlaces ); return ConvertFromDec( fVal, SCA_MIN2, SCA_MAX2, 2, nPlaces, SCA_MAXPLACES, bUsePlaces );
} }
double SAL_CALL AnalysisAddIn::getOct2Dec( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException ) double SAL_CALL AnalysisAddIn::getOct2Dec( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
double fRet = ConvertToDec( aNum, 8, SCA_MAXPLACES ); double fRet = ConvertToDec( aNum, 8, SCA_MAXPLACES );
RETURN_FINITE( fRet ); RETURN_FINITE( fRet );
} }
OUString SAL_CALL AnalysisAddIn::getOct2Hex( const uno::Reference< beans::XPropertySet >& xOpt, const OUString& aNum, const uno::Any& rPlaces ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getOct2Hex( const uno::Reference< beans::XPropertySet >& xOpt, const OUString& aNum, const uno::Any& rPlaces ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
double fVal = ConvertToDec( aNum, 8, SCA_MAXPLACES ); double fVal = ConvertToDec( aNum, 8, SCA_MAXPLACES );
...@@ -918,7 +837,6 @@ OUString SAL_CALL AnalysisAddIn::getOct2Hex( const uno::Reference< beans::XPrope ...@@ -918,7 +837,6 @@ OUString SAL_CALL AnalysisAddIn::getOct2Hex( const uno::Reference< beans::XPrope
return ConvertFromDec( fVal, SCA_MIN16, SCA_MAX16, 16, nPlaces, SCA_MAXPLACES, bUsePlaces ); return ConvertFromDec( fVal, SCA_MIN16, SCA_MAX16, 16, nPlaces, SCA_MAXPLACES, bUsePlaces );
} }
OUString SAL_CALL AnalysisAddIn::getDec2Bin( const uno::Reference< beans::XPropertySet >& xOpt, sal_Int32 nNum, const uno::Any& rPlaces ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getDec2Bin( const uno::Reference< beans::XPropertySet >& xOpt, sal_Int32 nNum, const uno::Any& rPlaces ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
sal_Int32 nPlaces = 0; sal_Int32 nPlaces = 0;
...@@ -926,7 +844,6 @@ OUString SAL_CALL AnalysisAddIn::getDec2Bin( const uno::Reference< beans::XPrope ...@@ -926,7 +844,6 @@ OUString SAL_CALL AnalysisAddIn::getDec2Bin( const uno::Reference< beans::XPrope
return ConvertFromDec( nNum, SCA_MIN2, SCA_MAX2, 2, nPlaces, SCA_MAXPLACES, bUsePlaces ); return ConvertFromDec( nNum, SCA_MIN2, SCA_MAX2, 2, nPlaces, SCA_MAXPLACES, bUsePlaces );
} }
OUString SAL_CALL AnalysisAddIn::getDec2Oct( const uno::Reference< beans::XPropertySet >& xOpt, sal_Int32 nNum, const uno::Any& rPlaces ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getDec2Oct( const uno::Reference< beans::XPropertySet >& xOpt, sal_Int32 nNum, const uno::Any& rPlaces ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
sal_Int32 nPlaces = 0; sal_Int32 nPlaces = 0;
...@@ -934,7 +851,6 @@ OUString SAL_CALL AnalysisAddIn::getDec2Oct( const uno::Reference< beans::XPrope ...@@ -934,7 +851,6 @@ OUString SAL_CALL AnalysisAddIn::getDec2Oct( const uno::Reference< beans::XPrope
return ConvertFromDec( nNum, SCA_MIN8, SCA_MAX8, 8, nPlaces, SCA_MAXPLACES, bUsePlaces ); return ConvertFromDec( nNum, SCA_MIN8, SCA_MAX8, 8, nPlaces, SCA_MAXPLACES, bUsePlaces );
} }
OUString SAL_CALL AnalysisAddIn::getDec2Hex( const uno::Reference< beans::XPropertySet >& xOpt, double fNum, const uno::Any& rPlaces ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getDec2Hex( const uno::Reference< beans::XPropertySet >& xOpt, double fNum, const uno::Any& rPlaces ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
sal_Int32 nPlaces = 0; sal_Int32 nPlaces = 0;
...@@ -942,7 +858,6 @@ OUString SAL_CALL AnalysisAddIn::getDec2Hex( const uno::Reference< beans::XPrope ...@@ -942,7 +858,6 @@ OUString SAL_CALL AnalysisAddIn::getDec2Hex( const uno::Reference< beans::XPrope
return ConvertFromDec( fNum, SCA_MIN16, SCA_MAX16, 16, nPlaces, SCA_MAXPLACES, bUsePlaces ); return ConvertFromDec( fNum, SCA_MIN16, SCA_MAX16, 16, nPlaces, SCA_MAXPLACES, bUsePlaces );
} }
OUString SAL_CALL AnalysisAddIn::getHex2Bin( const uno::Reference< beans::XPropertySet >& xOpt, const OUString& aNum, const uno::Any& rPlaces ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getHex2Bin( const uno::Reference< beans::XPropertySet >& xOpt, const OUString& aNum, const uno::Any& rPlaces ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
double fVal = ConvertToDec( aNum, 16, SCA_MAXPLACES ); double fVal = ConvertToDec( aNum, 16, SCA_MAXPLACES );
...@@ -951,14 +866,12 @@ OUString SAL_CALL AnalysisAddIn::getHex2Bin( const uno::Reference< beans::XPrope ...@@ -951,14 +866,12 @@ OUString SAL_CALL AnalysisAddIn::getHex2Bin( const uno::Reference< beans::XPrope
return ConvertFromDec( fVal, SCA_MIN2, SCA_MAX2, 2, nPlaces, SCA_MAXPLACES, bUsePlaces ); return ConvertFromDec( fVal, SCA_MIN2, SCA_MAX2, 2, nPlaces, SCA_MAXPLACES, bUsePlaces );
} }
double SAL_CALL AnalysisAddIn::getHex2Dec( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException ) double SAL_CALL AnalysisAddIn::getHex2Dec( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
double fRet = ConvertToDec( aNum, 16, SCA_MAXPLACES ); double fRet = ConvertToDec( aNum, 16, SCA_MAXPLACES );
RETURN_FINITE( fRet ); RETURN_FINITE( fRet );
} }
OUString SAL_CALL AnalysisAddIn::getHex2Oct( const uno::Reference< beans::XPropertySet >& xOpt, const OUString& aNum, const uno::Any& rPlaces ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getHex2Oct( const uno::Reference< beans::XPropertySet >& xOpt, const OUString& aNum, const uno::Any& rPlaces ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
double fVal = ConvertToDec( aNum, 16, SCA_MAXPLACES ); double fVal = ConvertToDec( aNum, 16, SCA_MAXPLACES );
...@@ -967,13 +880,11 @@ OUString SAL_CALL AnalysisAddIn::getHex2Oct( const uno::Reference< beans::XPrope ...@@ -967,13 +880,11 @@ OUString SAL_CALL AnalysisAddIn::getHex2Oct( const uno::Reference< beans::XPrope
return ConvertFromDec( fVal, SCA_MIN8, SCA_MAX8, 8, nPlaces, SCA_MAXPLACES, bUsePlaces ); return ConvertFromDec( fVal, SCA_MIN8, SCA_MAX8, 8, nPlaces, SCA_MAXPLACES, bUsePlaces );
} }
sal_Int32 SAL_CALL AnalysisAddIn::getDelta( const uno::Reference< beans::XPropertySet >& xOpt, double fNum1, const uno::Any& rNum2 ) throw( uno::RuntimeException, lang::IllegalArgumentException ) sal_Int32 SAL_CALL AnalysisAddIn::getDelta( const uno::Reference< beans::XPropertySet >& xOpt, double fNum1, const uno::Any& rNum2 ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
return sal_Int32(fNum1 == aAnyConv.getDouble( xOpt, rNum2, 0.0 )); return sal_Int32(fNum1 == aAnyConv.getDouble( xOpt, rNum2, 0.0 ));
} }
double SAL_CALL AnalysisAddIn::getErf( const uno::Reference< beans::XPropertySet >& xOpt, double fLL, const uno::Any& rUL ) throw( uno::RuntimeException, lang::IllegalArgumentException ) double SAL_CALL AnalysisAddIn::getErf( const uno::Reference< beans::XPropertySet >& xOpt, double fLL, const uno::Any& rUL ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
double fUL, fRet; double fUL, fRet;
...@@ -983,41 +894,35 @@ double SAL_CALL AnalysisAddIn::getErf( const uno::Reference< beans::XPropertySet ...@@ -983,41 +894,35 @@ double SAL_CALL AnalysisAddIn::getErf( const uno::Reference< beans::XPropertySet
RETURN_FINITE( fRet ); RETURN_FINITE( fRet );
} }
double SAL_CALL AnalysisAddIn::getErfc( double f ) throw( uno::RuntimeException, lang::IllegalArgumentException ) double SAL_CALL AnalysisAddIn::getErfc( double f ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
double fRet = Erfc( f ); double fRet = Erfc( f );
RETURN_FINITE( fRet ); RETURN_FINITE( fRet );
} }
sal_Int32 SAL_CALL AnalysisAddIn::getGestep( const uno::Reference< beans::XPropertySet >& xOpt, double fNum, const uno::Any& rStep ) throw( uno::RuntimeException, lang::IllegalArgumentException ) sal_Int32 SAL_CALL AnalysisAddIn::getGestep( const uno::Reference< beans::XPropertySet >& xOpt, double fNum, const uno::Any& rStep ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
return sal_Int32(fNum >= aAnyConv.getDouble( xOpt, rStep, 0.0 )); return sal_Int32(fNum >= aAnyConv.getDouble( xOpt, rStep, 0.0 ));
} }
double SAL_CALL AnalysisAddIn::getFactdouble( sal_Int32 nNum ) throw( uno::RuntimeException, lang::IllegalArgumentException ) double SAL_CALL AnalysisAddIn::getFactdouble( sal_Int32 nNum ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
double fRet = FactDouble( nNum ); double fRet = FactDouble( nNum );
RETURN_FINITE( fRet ); RETURN_FINITE( fRet );
} }
double SAL_CALL AnalysisAddIn::getImabs( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException ) double SAL_CALL AnalysisAddIn::getImabs( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
double fRet = Complex( aNum ).Abs(); double fRet = Complex( aNum ).Abs();
RETURN_FINITE( fRet ); RETURN_FINITE( fRet );
} }
double SAL_CALL AnalysisAddIn::getImaginary( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException ) double SAL_CALL AnalysisAddIn::getImaginary( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
double fRet = Complex( aNum ).Imag(); double fRet = Complex( aNum ).Imag();
RETURN_FINITE( fRet ); RETURN_FINITE( fRet );
} }
OUString SAL_CALL AnalysisAddIn::getImpower( const OUString& aNum, double f ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getImpower( const OUString& aNum, double f ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
Complex z( aNum ); Complex z( aNum );
...@@ -1027,14 +932,12 @@ OUString SAL_CALL AnalysisAddIn::getImpower( const OUString& aNum, double f ) th ...@@ -1027,14 +932,12 @@ OUString SAL_CALL AnalysisAddIn::getImpower( const OUString& aNum, double f ) th
return z.GetString(); return z.GetString();
} }
double SAL_CALL AnalysisAddIn::getImargument( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException ) double SAL_CALL AnalysisAddIn::getImargument( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
double fRet = Complex( aNum ).Arg(); double fRet = Complex( aNum ).Arg();
RETURN_FINITE( fRet ); RETURN_FINITE( fRet );
} }
OUString SAL_CALL AnalysisAddIn::getImcos( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getImcos( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
Complex z( aNum ); Complex z( aNum );
...@@ -1044,7 +947,6 @@ OUString SAL_CALL AnalysisAddIn::getImcos( const OUString& aNum ) throw( uno::Ru ...@@ -1044,7 +947,6 @@ OUString SAL_CALL AnalysisAddIn::getImcos( const OUString& aNum ) throw( uno::Ru
return z.GetString(); return z.GetString();
} }
OUString SAL_CALL AnalysisAddIn::getImdiv( const OUString& aDivid, const OUString& aDivis ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getImdiv( const OUString& aDivid, const OUString& aDivis ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
Complex z( aDivid ); Complex z( aDivid );
...@@ -1054,7 +956,6 @@ OUString SAL_CALL AnalysisAddIn::getImdiv( const OUString& aDivid, const OUStrin ...@@ -1054,7 +956,6 @@ OUString SAL_CALL AnalysisAddIn::getImdiv( const OUString& aDivid, const OUStrin
return z.GetString(); return z.GetString();
} }
OUString SAL_CALL AnalysisAddIn::getImexp( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getImexp( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
Complex z( aNum ); Complex z( aNum );
...@@ -1064,7 +965,6 @@ OUString SAL_CALL AnalysisAddIn::getImexp( const OUString& aNum ) throw( uno::Ru ...@@ -1064,7 +965,6 @@ OUString SAL_CALL AnalysisAddIn::getImexp( const OUString& aNum ) throw( uno::Ru
return z.GetString(); return z.GetString();
} }
OUString SAL_CALL AnalysisAddIn::getImconjugate( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getImconjugate( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
Complex z( aNum ); Complex z( aNum );
...@@ -1074,7 +974,6 @@ OUString SAL_CALL AnalysisAddIn::getImconjugate( const OUString& aNum ) throw( u ...@@ -1074,7 +974,6 @@ OUString SAL_CALL AnalysisAddIn::getImconjugate( const OUString& aNum ) throw( u
return z.GetString(); return z.GetString();
} }
OUString SAL_CALL AnalysisAddIn::getImln( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getImln( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
Complex z( aNum ); Complex z( aNum );
...@@ -1084,7 +983,6 @@ OUString SAL_CALL AnalysisAddIn::getImln( const OUString& aNum ) throw( uno::Run ...@@ -1084,7 +983,6 @@ OUString SAL_CALL AnalysisAddIn::getImln( const OUString& aNum ) throw( uno::Run
return z.GetString(); return z.GetString();
} }
OUString SAL_CALL AnalysisAddIn::getImlog10( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getImlog10( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
Complex z( aNum ); Complex z( aNum );
...@@ -1094,7 +992,6 @@ OUString SAL_CALL AnalysisAddIn::getImlog10( const OUString& aNum ) throw( uno:: ...@@ -1094,7 +992,6 @@ OUString SAL_CALL AnalysisAddIn::getImlog10( const OUString& aNum ) throw( uno::
return z.GetString(); return z.GetString();
} }
OUString SAL_CALL AnalysisAddIn::getImlog2( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getImlog2( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
Complex z( aNum ); Complex z( aNum );
...@@ -1104,7 +1001,6 @@ OUString SAL_CALL AnalysisAddIn::getImlog2( const OUString& aNum ) throw( uno::R ...@@ -1104,7 +1001,6 @@ OUString SAL_CALL AnalysisAddIn::getImlog2( const OUString& aNum ) throw( uno::R
return z.GetString(); return z.GetString();
} }
OUString SAL_CALL AnalysisAddIn::getImproduct( const uno::Reference< beans::XPropertySet >&, const uno::Sequence< uno::Sequence< OUString > >& aNum1, const uno::Sequence< uno::Any >& aNL ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getImproduct( const uno::Reference< beans::XPropertySet >&, const uno::Sequence< uno::Sequence< OUString > >& aNum1, const uno::Sequence< uno::Any >& aNL ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
ComplexList z_list; ComplexList z_list;
...@@ -1122,14 +1018,12 @@ OUString SAL_CALL AnalysisAddIn::getImproduct( const uno::Reference< beans::XPro ...@@ -1122,14 +1018,12 @@ OUString SAL_CALL AnalysisAddIn::getImproduct( const uno::Reference< beans::XPro
return z.GetString(); return z.GetString();
} }
double SAL_CALL AnalysisAddIn::getImreal( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException ) double SAL_CALL AnalysisAddIn::getImreal( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
double fRet = Complex( aNum ).Real(); double fRet = Complex( aNum ).Real();
RETURN_FINITE( fRet ); RETURN_FINITE( fRet );
} }
OUString SAL_CALL AnalysisAddIn::getImsin( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getImsin( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
Complex z( aNum ); Complex z( aNum );
...@@ -1139,7 +1033,6 @@ OUString SAL_CALL AnalysisAddIn::getImsin( const OUString& aNum ) throw( uno::Ru ...@@ -1139,7 +1033,6 @@ OUString SAL_CALL AnalysisAddIn::getImsin( const OUString& aNum ) throw( uno::Ru
return z.GetString(); return z.GetString();
} }
OUString SAL_CALL AnalysisAddIn::getImsub( const OUString& aNum1, const OUString& aNum2 ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getImsub( const OUString& aNum1, const OUString& aNum2 ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
Complex z( aNum1 ); Complex z( aNum1 );
...@@ -1149,7 +1042,6 @@ OUString SAL_CALL AnalysisAddIn::getImsub( const OUString& aNum1, const OUString ...@@ -1149,7 +1042,6 @@ OUString SAL_CALL AnalysisAddIn::getImsub( const OUString& aNum1, const OUString
return z.GetString(); return z.GetString();
} }
OUString SAL_CALL AnalysisAddIn::getImsum( const uno::Reference< beans::XPropertySet >&, const uno::Sequence< uno::Sequence< OUString > >& aNum1, const uno::Sequence< uno::Any >& aFollowingPars ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getImsum( const uno::Reference< beans::XPropertySet >&, const uno::Sequence< uno::Sequence< OUString > >& aNum1, const uno::Sequence< uno::Any >& aFollowingPars ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
ComplexList z_list; ComplexList z_list;
...@@ -1167,7 +1059,6 @@ OUString SAL_CALL AnalysisAddIn::getImsum( const uno::Reference< beans::XPropert ...@@ -1167,7 +1059,6 @@ OUString SAL_CALL AnalysisAddIn::getImsum( const uno::Reference< beans::XPropert
return z.GetString(); return z.GetString();
} }
OUString SAL_CALL AnalysisAddIn::getImsqrt( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getImsqrt( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
Complex z( aNum ); Complex z( aNum );
...@@ -1177,7 +1068,6 @@ OUString SAL_CALL AnalysisAddIn::getImsqrt( const OUString& aNum ) throw( uno::R ...@@ -1177,7 +1068,6 @@ OUString SAL_CALL AnalysisAddIn::getImsqrt( const OUString& aNum ) throw( uno::R
return z.GetString(); return z.GetString();
} }
OUString SAL_CALL AnalysisAddIn::getImtan( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getImtan( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
Complex z( aNum ); Complex z( aNum );
...@@ -1187,7 +1077,6 @@ OUString SAL_CALL AnalysisAddIn::getImtan( const OUString& aNum ) throw( uno::Ru ...@@ -1187,7 +1077,6 @@ OUString SAL_CALL AnalysisAddIn::getImtan( const OUString& aNum ) throw( uno::Ru
return z.GetString(); return z.GetString();
} }
OUString SAL_CALL AnalysisAddIn::getImsec( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getImsec( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
Complex z( aNum ); Complex z( aNum );
...@@ -1197,7 +1086,6 @@ OUString SAL_CALL AnalysisAddIn::getImsec( const OUString& aNum ) throw( uno::Ru ...@@ -1197,7 +1086,6 @@ OUString SAL_CALL AnalysisAddIn::getImsec( const OUString& aNum ) throw( uno::Ru
return z.GetString(); return z.GetString();
} }
OUString SAL_CALL AnalysisAddIn::getImcsc( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getImcsc( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
Complex z( aNum ); Complex z( aNum );
...@@ -1207,7 +1095,6 @@ OUString SAL_CALL AnalysisAddIn::getImcsc( const OUString& aNum ) throw( uno::Ru ...@@ -1207,7 +1095,6 @@ OUString SAL_CALL AnalysisAddIn::getImcsc( const OUString& aNum ) throw( uno::Ru
return z.GetString(); return z.GetString();
} }
OUString SAL_CALL AnalysisAddIn::getImcot( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getImcot( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
Complex z( aNum ); Complex z( aNum );
...@@ -1217,7 +1104,6 @@ OUString SAL_CALL AnalysisAddIn::getImcot( const OUString& aNum ) throw( uno::Ru ...@@ -1217,7 +1104,6 @@ OUString SAL_CALL AnalysisAddIn::getImcot( const OUString& aNum ) throw( uno::Ru
return z.GetString(); return z.GetString();
} }
OUString SAL_CALL AnalysisAddIn::getImsinh( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getImsinh( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
Complex z( aNum ); Complex z( aNum );
...@@ -1227,7 +1113,6 @@ OUString SAL_CALL AnalysisAddIn::getImsinh( const OUString& aNum ) throw( uno::R ...@@ -1227,7 +1113,6 @@ OUString SAL_CALL AnalysisAddIn::getImsinh( const OUString& aNum ) throw( uno::R
return z.GetString(); return z.GetString();
} }
OUString SAL_CALL AnalysisAddIn::getImcosh( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getImcosh( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
Complex z( aNum ); Complex z( aNum );
...@@ -1237,7 +1122,6 @@ OUString SAL_CALL AnalysisAddIn::getImcosh( const OUString& aNum ) throw( uno::R ...@@ -1237,7 +1122,6 @@ OUString SAL_CALL AnalysisAddIn::getImcosh( const OUString& aNum ) throw( uno::R
return z.GetString(); return z.GetString();
} }
OUString SAL_CALL AnalysisAddIn::getImsech( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getImsech( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
Complex z( aNum ); Complex z( aNum );
...@@ -1247,7 +1131,6 @@ OUString SAL_CALL AnalysisAddIn::getImsech( const OUString& aNum ) throw( uno::R ...@@ -1247,7 +1131,6 @@ OUString SAL_CALL AnalysisAddIn::getImsech( const OUString& aNum ) throw( uno::R
return z.GetString(); return z.GetString();
} }
OUString SAL_CALL AnalysisAddIn::getImcsch( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getImcsch( const OUString& aNum ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
Complex z( aNum ); Complex z( aNum );
...@@ -1257,7 +1140,6 @@ OUString SAL_CALL AnalysisAddIn::getImcsch( const OUString& aNum ) throw( uno::R ...@@ -1257,7 +1140,6 @@ OUString SAL_CALL AnalysisAddIn::getImcsch( const OUString& aNum ) throw( uno::R
return z.GetString(); return z.GetString();
} }
OUString SAL_CALL AnalysisAddIn::getComplex( double fR, double fI, const uno::Any& rSuff ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL AnalysisAddIn::getComplex( double fR, double fI, const uno::Any& rSuff ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
sal_Bool bi; sal_Bool bi;
...@@ -1282,7 +1164,6 @@ OUString SAL_CALL AnalysisAddIn::getComplex( double fR, double fI, const uno::An ...@@ -1282,7 +1164,6 @@ OUString SAL_CALL AnalysisAddIn::getComplex( double fR, double fI, const uno::An
return Complex( fR, fI, bi ? 'i' : 'j' ).GetString(); return Complex( fR, fI, bi ? 'i' : 'j' ).GetString();
} }
double SAL_CALL AnalysisAddIn::getConvert( double f, const OUString& aFU, const OUString& aTU ) throw( uno::RuntimeException, lang::IllegalArgumentException ) double SAL_CALL AnalysisAddIn::getConvert( double f, const OUString& aFU, const OUString& aTU ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
if( !pCDL ) if( !pCDL )
...@@ -1292,5 +1173,4 @@ double SAL_CALL AnalysisAddIn::getConvert( double f, const OUString& aFU, const ...@@ -1292,5 +1173,4 @@ double SAL_CALL AnalysisAddIn::getConvert( double f, const OUString& aFU, const
RETURN_FINITE( fRet ); RETURN_FINITE( fRet );
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -17,36 +17,25 @@ ...@@ -17,36 +17,25 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
//------------------------------------------------------------------
//
// date functions add in
//
//------------------------------------------------------------------
#include "datefunc.hxx" #include "datefunc.hxx"
#include "datefunc.hrc" #include "datefunc.hrc"
#include <com/sun/star/util/Date.hpp>
#include <cppuhelper/factory.hxx> #include <cppuhelper/factory.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <osl/diagnose.h> #include <osl/diagnose.h>
#include <rtl/ustrbuf.hxx> #include <rtl/ustrbuf.hxx>
#include <tools/resmgr.hxx>
#include <tools/rcid.h> #include <tools/rcid.h>
#include <com/sun/star/util/Date.hpp> #include <tools/resmgr.hxx>
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::rtl; using namespace ::rtl;
//------------------------------------------------------------------
#define ADDIN_SERVICE "com.sun.star.sheet.AddIn" #define ADDIN_SERVICE "com.sun.star.sheet.AddIn"
#define MY_SERVICE "com.sun.star.sheet.addin.DateFunctions" #define MY_SERVICE "com.sun.star.sheet.addin.DateFunctions"
#define MY_IMPLNAME "com.sun.star.sheet.addin.DateFunctionsImpl" #define MY_IMPLNAME "com.sun.star.sheet.addin.DateFunctionsImpl"
//------------------------------------------------------------------
#define STR_FROM_ANSI( s ) OUString( s, strlen( s ), RTL_TEXTENCODING_MS_1252 ) #define STR_FROM_ANSI( s ) OUString( s, strlen( s ), RTL_TEXTENCODING_MS_1252 )
//------------------------------------------------------------------
const sal_uInt32 ScaList::nStartSize = 16; const sal_uInt32 ScaList::nStartSize = 16;
const sal_uInt32 ScaList::nIncrSize = 16; const sal_uInt32 ScaList::nIncrSize = 16;
...@@ -74,24 +63,17 @@ void ScaList::_Grow() ...@@ -74,24 +63,17 @@ void ScaList::_Grow()
pData = pNewData; pData = pNewData;
} }
//------------------------------------------------------------------
ScaStringList::~ScaStringList() ScaStringList::~ScaStringList()
{ {
for( OUString* pStr = First(); pStr; pStr = Next() ) for( OUString* pStr = First(); pStr; pStr = Next() )
delete pStr; delete pStr;
} }
//------------------------------------------------------------------
ScaResId::ScaResId( sal_uInt16 nId, ResMgr& rResMgr ) : ScaResId::ScaResId( sal_uInt16 nId, ResMgr& rResMgr ) :
ResId( nId, rResMgr ) ResId( nId, rResMgr )
{ {
} }
//------------------------------------------------------------------
#define UNIQUE sal_False // function name does not exist in Calc #define UNIQUE sal_False // function name does not exist in Calc
#define STDPAR sal_False // all parameters are described #define STDPAR sal_False // all parameters are described
...@@ -114,9 +96,6 @@ const ScaFuncDataBase pFuncDataArr[] = ...@@ -114,9 +96,6 @@ const ScaFuncDataBase pFuncDataArr[] =
#undef FUNCDATA #undef FUNCDATA
//------------------------------------------------------------------
ScaFuncData::ScaFuncData( const ScaFuncDataBase& rBaseData, ResMgr& rResMgr ) : ScaFuncData::ScaFuncData( const ScaFuncDataBase& rBaseData, ResMgr& rResMgr ) :
aIntName( OUString::createFromAscii( rBaseData.pIntName ) ), aIntName( OUString::createFromAscii( rBaseData.pIntName ) ),
nUINameID( rBaseData.nUINameID ), nUINameID( rBaseData.nUINameID ),
...@@ -146,8 +125,6 @@ sal_uInt16 ScaFuncData::GetStrIndex( sal_uInt16 nParam ) const ...@@ -146,8 +125,6 @@ sal_uInt16 ScaFuncData::GetStrIndex( sal_uInt16 nParam ) const
} }
//------------------------------------------------------------------
ScaFuncDataList::ScaFuncDataList( ResMgr& rResMgr ) : ScaFuncDataList::ScaFuncDataList( ResMgr& rResMgr ) :
nLast( 0xFFFFFFFF ) nLast( 0xFFFFFFFF )
{ {
...@@ -179,9 +156,6 @@ const ScaFuncData* ScaFuncDataList::Get( const OUString& rProgrammaticName ) con ...@@ -179,9 +156,6 @@ const ScaFuncData* ScaFuncDataList::Get( const OUString& rProgrammaticName ) con
return NULL; return NULL;
} }
//------------------------------------------------------------------
ScaFuncRes::ScaFuncRes( ResId& rResId, ResMgr& rResMgr, sal_uInt16 nIndex, OUString& rRet ) : ScaFuncRes::ScaFuncRes( ResId& rResId, ResMgr& rResMgr, sal_uInt16 nIndex, OUString& rRet ) :
Resource( rResId ) Resource( rResId )
{ {
...@@ -189,13 +163,7 @@ ScaFuncRes::ScaFuncRes( ResId& rResId, ResMgr& rResMgr, sal_uInt16 nIndex, OUStr ...@@ -189,13 +163,7 @@ ScaFuncRes::ScaFuncRes( ResId& rResId, ResMgr& rResMgr, sal_uInt16 nIndex, OUStr
FreeResource(); FreeResource();
} }
//------------------------------------------------------------------
//
// entry points for service registration / instantiation // entry points for service registration / instantiation
//
//------------------------------------------------------------------
uno::Reference< uno::XInterface > SAL_CALL ScaDateAddIn_CreateInstance( uno::Reference< uno::XInterface > SAL_CALL ScaDateAddIn_CreateInstance(
const uno::Reference< lang::XMultiServiceFactory >& ) const uno::Reference< lang::XMultiServiceFactory >& )
{ {
...@@ -203,9 +171,6 @@ uno::Reference< uno::XInterface > SAL_CALL ScaDateAddIn_CreateInstance( ...@@ -203,9 +171,6 @@ uno::Reference< uno::XInterface > SAL_CALL ScaDateAddIn_CreateInstance(
return xInst; return xInst;
} }
//------------------------------------------------------------------------
extern "C" { extern "C" {
SAL_DLLPUBLIC_EXPORT void * SAL_CALL date_component_getFactory( SAL_DLLPUBLIC_EXPORT void * SAL_CALL date_component_getFactory(
...@@ -234,12 +199,7 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL date_component_getFactory( ...@@ -234,12 +199,7 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL date_component_getFactory(
} // extern C } // extern C
//------------------------------------------------------------------------
//
// "normal" service implementation // "normal" service implementation
//
//------------------------------------------------------------------------
ScaDateAddIn::ScaDateAddIn() : ScaDateAddIn::ScaDateAddIn() :
pDefLocales( NULL ), pDefLocales( NULL ),
pResMgr( NULL ), pResMgr( NULL ),
...@@ -331,9 +291,6 @@ OUString ScaDateAddIn::GetFuncDescrStr( sal_uInt16 nResId, sal_uInt16 nStrIndex ...@@ -331,9 +291,6 @@ OUString ScaDateAddIn::GetFuncDescrStr( sal_uInt16 nResId, sal_uInt16 nStrIndex
return aRet; return aRet;
} }
//------------------------------------------------------------------------
OUString ScaDateAddIn::getImplementationName_Static() OUString ScaDateAddIn::getImplementationName_Static()
{ {
return OUString( MY_IMPLNAME ); return OUString( MY_IMPLNAME );
...@@ -349,7 +306,6 @@ uno::Sequence< OUString > ScaDateAddIn::getSupportedServiceNames_Static() ...@@ -349,7 +306,6 @@ uno::Sequence< OUString > ScaDateAddIn::getSupportedServiceNames_Static()
} }
// XServiceName // XServiceName
OUString SAL_CALL ScaDateAddIn::getServiceName() throw( uno::RuntimeException ) OUString SAL_CALL ScaDateAddIn::getServiceName() throw( uno::RuntimeException )
{ {
// name of specific AddIn service // name of specific AddIn service
...@@ -357,7 +313,6 @@ OUString SAL_CALL ScaDateAddIn::getServiceName() throw( uno::RuntimeException ) ...@@ -357,7 +313,6 @@ OUString SAL_CALL ScaDateAddIn::getServiceName() throw( uno::RuntimeException )
} }
// XServiceInfo // XServiceInfo
OUString SAL_CALL ScaDateAddIn::getImplementationName() throw( uno::RuntimeException ) OUString SAL_CALL ScaDateAddIn::getImplementationName() throw( uno::RuntimeException )
{ {
return getImplementationName_Static(); return getImplementationName_Static();
...@@ -365,7 +320,7 @@ OUString SAL_CALL ScaDateAddIn::getImplementationName() throw( uno::RuntimeExcep ...@@ -365,7 +320,7 @@ OUString SAL_CALL ScaDateAddIn::getImplementationName() throw( uno::RuntimeExcep
sal_Bool SAL_CALL ScaDateAddIn::supportsService( const OUString& aServiceName ) throw( uno::RuntimeException ) sal_Bool SAL_CALL ScaDateAddIn::supportsService( const OUString& aServiceName ) throw( uno::RuntimeException )
{ {
return aServiceName == ADDIN_SERVICE || aServiceName == MY_SERVICE; return cppu::supportsService(this, aServiceName);
} }
uno::Sequence< OUString > SAL_CALL ScaDateAddIn::getSupportedServiceNames() throw( uno::RuntimeException ) uno::Sequence< OUString > SAL_CALL ScaDateAddIn::getSupportedServiceNames() throw( uno::RuntimeException )
...@@ -374,7 +329,6 @@ uno::Sequence< OUString > SAL_CALL ScaDateAddIn::getSupportedServiceNames() thro ...@@ -374,7 +329,6 @@ uno::Sequence< OUString > SAL_CALL ScaDateAddIn::getSupportedServiceNames() thro
} }
// XLocalizable // XLocalizable
void SAL_CALL ScaDateAddIn::setLocale( const lang::Locale& eLocale ) throw( uno::RuntimeException ) void SAL_CALL ScaDateAddIn::setLocale( const lang::Locale& eLocale ) throw( uno::RuntimeException )
{ {
aFuncLoc = eLocale; aFuncLoc = eLocale;
...@@ -386,14 +340,6 @@ lang::Locale SAL_CALL ScaDateAddIn::getLocale() throw( uno::RuntimeException ) ...@@ -386,14 +340,6 @@ lang::Locale SAL_CALL ScaDateAddIn::getLocale() throw( uno::RuntimeException )
return aFuncLoc; return aFuncLoc;
} }
//------------------------------------------------------------------
//
// function descriptions start here
//
//------------------------------------------------------------------
// XAddIn
OUString SAL_CALL ScaDateAddIn::getProgrammaticFuntionName( const OUString& ) throw( uno::RuntimeException ) OUString SAL_CALL ScaDateAddIn::getProgrammaticFuntionName( const OUString& ) throw( uno::RuntimeException )
{ {
// not used by calc // not used by calc
...@@ -500,9 +446,7 @@ OUString SAL_CALL ScaDateAddIn::getDisplayCategoryName( ...@@ -500,9 +446,7 @@ OUString SAL_CALL ScaDateAddIn::getDisplayCategoryName(
return getProgrammaticCategoryName( aProgrammaticName ); return getProgrammaticCategoryName( aProgrammaticName );
} }
// XCompatibilityNames // XCompatibilityNames
uno::Sequence< sheet::LocalizedName > SAL_CALL ScaDateAddIn::getCompatibilityNames( uno::Sequence< sheet::LocalizedName > SAL_CALL ScaDateAddIn::getCompatibilityNames(
const OUString& aProgrammaticName ) throw( uno::RuntimeException ) const OUString& aProgrammaticName ) throw( uno::RuntimeException )
{ {
...@@ -523,8 +467,8 @@ uno::Sequence< sheet::LocalizedName > SAL_CALL ScaDateAddIn::getCompatibilityNam ...@@ -523,8 +467,8 @@ uno::Sequence< sheet::LocalizedName > SAL_CALL ScaDateAddIn::getCompatibilityNam
} }
namespace { namespace {
// auxiliary functions
// auxiliary functions
sal_Bool IsLeapYear( sal_uInt16 nYear ) sal_Bool IsLeapYear( sal_uInt16 nYear )
{ {
return ((((nYear % 4) == 0) && ((nYear % 100) != 0)) || ((nYear % 400) == 0)); return ((((nYear % 4) == 0) && ((nYear % 100) != 0)) || ((nYear % 400) == 0));
...@@ -630,7 +574,6 @@ void DaysToDate( sal_Int32 nDays, ...@@ -630,7 +574,6 @@ void DaysToDate( sal_Int32 nDays,
* this function returns this internal Date value for the document null date * this function returns this internal Date value for the document null date
* *
*/ */
sal_Int32 GetNullDate( const uno::Reference< beans::XPropertySet >& xOptions ) sal_Int32 GetNullDate( const uno::Reference< beans::XPropertySet >& xOptions )
throw( uno::RuntimeException ) throw( uno::RuntimeException )
{ {
...@@ -745,7 +688,6 @@ sal_Int32 SAL_CALL ScaDateAddIn::getDiffWeeks( ...@@ -745,7 +688,6 @@ sal_Int32 SAL_CALL ScaDateAddIn::getDiffWeeks(
* *
* mode 1 is the difference in calendar month * mode 1 is the difference in calendar month
*/ */
sal_Int32 SAL_CALL ScaDateAddIn::getDiffMonths( sal_Int32 SAL_CALL ScaDateAddIn::getDiffMonths(
const uno::Reference< beans::XPropertySet >& xOptions, const uno::Reference< beans::XPropertySet >& xOptions,
sal_Int32 nStartDate, sal_Int32 nEndDate, sal_Int32 nStartDate, sal_Int32 nEndDate,
...@@ -791,7 +733,6 @@ sal_Int32 SAL_CALL ScaDateAddIn::getDiffMonths( ...@@ -791,7 +733,6 @@ sal_Int32 SAL_CALL ScaDateAddIn::getDiffMonths(
* *
* mode 1 is the difference in calendar years * mode 1 is the difference in calendar years
*/ */
sal_Int32 SAL_CALL ScaDateAddIn::getDiffYears( sal_Int32 SAL_CALL ScaDateAddIn::getDiffYears(
const uno::Reference< beans::XPropertySet >& xOptions, const uno::Reference< beans::XPropertySet >& xOptions,
sal_Int32 nStartDate, sal_Int32 nEndDate, sal_Int32 nStartDate, sal_Int32 nEndDate,
...@@ -816,7 +757,6 @@ sal_Int32 SAL_CALL ScaDateAddIn::getDiffYears( ...@@ -816,7 +757,6 @@ sal_Int32 SAL_CALL ScaDateAddIn::getDiffYears(
/** /**
* Check if a Date is in a leap year in the Gregorian calendar * Check if a Date is in a leap year in the Gregorian calendar
*/ */
sal_Int32 SAL_CALL ScaDateAddIn::getIsLeapYear( sal_Int32 SAL_CALL ScaDateAddIn::getIsLeapYear(
const uno::Reference< beans::XPropertySet >& xOptions, const uno::Reference< beans::XPropertySet >& xOptions,
sal_Int32 nDate ) throw( uno::RuntimeException, lang::IllegalArgumentException ) sal_Int32 nDate ) throw( uno::RuntimeException, lang::IllegalArgumentException )
...@@ -833,7 +773,6 @@ sal_Int32 SAL_CALL ScaDateAddIn::getIsLeapYear( ...@@ -833,7 +773,6 @@ sal_Int32 SAL_CALL ScaDateAddIn::getIsLeapYear(
/** /**
* Get the Number of Days in the month for a date * Get the Number of Days in the month for a date
*/ */
sal_Int32 SAL_CALL ScaDateAddIn::getDaysInMonth( sal_Int32 SAL_CALL ScaDateAddIn::getDaysInMonth(
const uno::Reference<beans::XPropertySet>& xOptions, const uno::Reference<beans::XPropertySet>& xOptions,
sal_Int32 nDate ) throw( uno::RuntimeException, lang::IllegalArgumentException ) sal_Int32 nDate ) throw( uno::RuntimeException, lang::IllegalArgumentException )
...@@ -850,7 +789,6 @@ sal_Int32 SAL_CALL ScaDateAddIn::getDaysInMonth( ...@@ -850,7 +789,6 @@ sal_Int32 SAL_CALL ScaDateAddIn::getDaysInMonth(
/** /**
* Get number of days in the year of a date specified * Get number of days in the year of a date specified
*/ */
sal_Int32 SAL_CALL ScaDateAddIn::getDaysInYear( sal_Int32 SAL_CALL ScaDateAddIn::getDaysInYear(
const uno::Reference< beans::XPropertySet >& xOptions, const uno::Reference< beans::XPropertySet >& xOptions,
sal_Int32 nDate ) throw( uno::RuntimeException, lang::IllegalArgumentException ) sal_Int32 nDate ) throw( uno::RuntimeException, lang::IllegalArgumentException )
...@@ -879,7 +817,6 @@ sal_Int32 SAL_CALL ScaDateAddIn::getDaysInYear( ...@@ -879,7 +817,6 @@ sal_Int32 SAL_CALL ScaDateAddIn::getDaysInYear(
* *
* @see #IsLeapYear #WeekNumber * @see #IsLeapYear #WeekNumber
*/ */
sal_Int32 SAL_CALL ScaDateAddIn::getWeeksInYear( sal_Int32 SAL_CALL ScaDateAddIn::getWeeksInYear(
const uno::Reference< beans::XPropertySet >& xOptions, const uno::Reference< beans::XPropertySet >& xOptions,
sal_Int32 nDate ) throw( uno::RuntimeException, lang::IllegalArgumentException ) sal_Int32 nDate ) throw( uno::RuntimeException, lang::IllegalArgumentException )
...@@ -909,7 +846,6 @@ sal_Int32 SAL_CALL ScaDateAddIn::getWeeksInYear( ...@@ -909,7 +846,6 @@ sal_Int32 SAL_CALL ScaDateAddIn::getWeeksInYear(
* This function rotates each character by 13 in the alphabet. * This function rotates each character by 13 in the alphabet.
* Only the characters 'a' ... 'z' and 'A' ... 'Z' are modified. * Only the characters 'a' ... 'z' and 'A' ... 'Z' are modified.
*/ */
OUString SAL_CALL ScaDateAddIn::getRot13( const OUString& aSrcString ) throw( uno::RuntimeException, lang::IllegalArgumentException ) OUString SAL_CALL ScaDateAddIn::getRot13( const OUString& aSrcString ) throw( uno::RuntimeException, lang::IllegalArgumentException )
{ {
OUStringBuffer aBuffer( aSrcString ); OUStringBuffer aBuffer( aSrcString );
...@@ -924,6 +860,4 @@ OUString SAL_CALL ScaDateAddIn::getRot13( const OUString& aSrcString ) throw( un ...@@ -924,6 +860,4 @@ OUString SAL_CALL ScaDateAddIn::getRot13( const OUString& aSrcString ) throw( un
return aBuffer.makeStringAndClear(); return aBuffer.makeStringAndClear();
} }
//------------------------------------------------------------------
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -17,43 +17,34 @@ ...@@ -17,43 +17,34 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
//------------------------------------------------------------------
//
// pricing functions add in // pricing functions add in
// //
// all of the UNO add-in technical details have been copied from // all of the UNO add-in technical details have been copied from
// ../datefunc/datefunc.cxx // ../datefunc/datefunc.cxx
//
//------------------------------------------------------------------
#include "pricing.hxx" #include "pricing.hxx"
#include "black_scholes.hxx" #include "black_scholes.hxx"
#include "pricing.hrc" #include "pricing.hrc"
#include <cppuhelper/factory.hxx> #include <cppuhelper/factory.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <iostream>
#include <osl/diagnose.h> #include <osl/diagnose.h>
#include <rtl/ustrbuf.hxx>
#include <rtl/math.hxx> #include <rtl/math.hxx>
#include <tools/resmgr.hxx> #include <rtl/ustrbuf.hxx>
#include <tools/rcid.h> #include <tools/rcid.h>
#include <tools/resmgr.hxx>
#include <iostream>
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace sca::pricing; using namespace sca::pricing;
//------------------------------------------------------------------
#define ADDIN_SERVICE "com.sun.star.sheet.AddIn" #define ADDIN_SERVICE "com.sun.star.sheet.AddIn"
#define MY_SERVICE "com.sun.star.sheet.addin.PricingFunctions" #define MY_SERVICE "com.sun.star.sheet.addin.PricingFunctions"
#define MY_IMPLNAME "com.sun.star.sheet.addin.PricingFunctionsImpl" #define MY_IMPLNAME "com.sun.star.sheet.addin.PricingFunctionsImpl"
//------------------------------------------------------------------
#define STR_FROM_ANSI( s ) OUString( s, strlen( s ), RTL_TEXTENCODING_MS_1252 ) #define STR_FROM_ANSI( s ) OUString( s, strlen( s ), RTL_TEXTENCODING_MS_1252 )
//------------------------------------------------------------------
const sal_uInt32 ScaList::nStartSize = 16; const sal_uInt32 ScaList::nStartSize = 16;
const sal_uInt32 ScaList::nIncrSize = 16; const sal_uInt32 ScaList::nIncrSize = 16;
...@@ -81,24 +72,17 @@ void ScaList::_Grow() ...@@ -81,24 +72,17 @@ void ScaList::_Grow()
pData = pNewData; pData = pNewData;
} }
//------------------------------------------------------------------
ScaStringList::~ScaStringList() ScaStringList::~ScaStringList()
{ {
for( OUString* pStr = First(); pStr; pStr = Next() ) for( OUString* pStr = First(); pStr; pStr = Next() )
delete pStr; delete pStr;
} }
//------------------------------------------------------------------
ScaResId::ScaResId( sal_uInt16 nId, ResMgr& rResMgr ) : ScaResId::ScaResId( sal_uInt16 nId, ResMgr& rResMgr ) :
ResId( nId, rResMgr ) ResId( nId, rResMgr )
{ {
} }
//------------------------------------------------------------------
#define UNIQUE sal_False // function name does not exist in Calc #define UNIQUE sal_False // function name does not exist in Calc
#define STDPAR sal_False // all parameters are described #define STDPAR sal_False // all parameters are described
...@@ -116,9 +100,6 @@ const ScaFuncDataBase pFuncDataArr[] = ...@@ -116,9 +100,6 @@ const ScaFuncDataBase pFuncDataArr[] =
#undef FUNCDATA #undef FUNCDATA
//------------------------------------------------------------------
ScaFuncData::ScaFuncData( const ScaFuncDataBase& rBaseData, ResMgr& rResMgr ) : ScaFuncData::ScaFuncData( const ScaFuncDataBase& rBaseData, ResMgr& rResMgr ) :
aIntName( OUString::createFromAscii( rBaseData.pIntName ) ), aIntName( OUString::createFromAscii( rBaseData.pIntName ) ),
nUINameID( rBaseData.nUINameID ), nUINameID( rBaseData.nUINameID ),
...@@ -147,9 +128,6 @@ sal_uInt16 ScaFuncData::GetStrIndex( sal_uInt16 nParam ) const ...@@ -147,9 +128,6 @@ sal_uInt16 ScaFuncData::GetStrIndex( sal_uInt16 nParam ) const
return (nParam > nParamCount) ? (nParamCount * 2) : (nParam * 2); return (nParam > nParamCount) ? (nParamCount * 2) : (nParam * 2);
} }
//------------------------------------------------------------------
ScaFuncDataList::ScaFuncDataList( ResMgr& rResMgr ) : ScaFuncDataList::ScaFuncDataList( ResMgr& rResMgr ) :
nLast( 0xFFFFFFFF ) nLast( 0xFFFFFFFF )
{ {
...@@ -183,7 +161,6 @@ const ScaFuncData* ScaFuncDataList::Get( const OUString& rProgrammaticName ) con ...@@ -183,7 +161,6 @@ const ScaFuncData* ScaFuncDataList::Get( const OUString& rProgrammaticName ) con
} }
//------------------------------------------------------------------
ScaFuncRes::ScaFuncRes( ResId& rResId, ResMgr& rResMgr, sal_uInt16 nIndex, OUString& rRet ) : ScaFuncRes::ScaFuncRes( ResId& rResId, ResMgr& rResMgr, sal_uInt16 nIndex, OUString& rRet ) :
Resource( rResId ) Resource( rResId )
...@@ -192,13 +169,7 @@ ScaFuncRes::ScaFuncRes( ResId& rResId, ResMgr& rResMgr, sal_uInt16 nIndex, OUStr ...@@ -192,13 +169,7 @@ ScaFuncRes::ScaFuncRes( ResId& rResId, ResMgr& rResMgr, sal_uInt16 nIndex, OUStr
FreeResource(); FreeResource();
} }
// entry points for service registration / instantiation
//------------------------------------------------------------------
//
// entry points for service registration / instantiation
//
//------------------------------------------------------------------
uno::Reference< uno::XInterface > SAL_CALL ScaPricingAddIn_CreateInstance( uno::Reference< uno::XInterface > SAL_CALL ScaPricingAddIn_CreateInstance(
const uno::Reference< lang::XMultiServiceFactory >& ) const uno::Reference< lang::XMultiServiceFactory >& )
{ {
...@@ -207,8 +178,6 @@ uno::Reference< uno::XInterface > SAL_CALL ScaPricingAddIn_CreateInstance( ...@@ -207,8 +178,6 @@ uno::Reference< uno::XInterface > SAL_CALL ScaPricingAddIn_CreateInstance(
} }
//------------------------------------------------------------------------
extern "C" { extern "C" {
SAL_DLLPUBLIC_EXPORT void * SAL_CALL pricing_component_getFactory( SAL_DLLPUBLIC_EXPORT void * SAL_CALL pricing_component_getFactory(
...@@ -237,12 +206,7 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL pricing_component_getFactory( ...@@ -237,12 +206,7 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL pricing_component_getFactory(
} // extern C } // extern C
//------------------------------------------------------------------------
//
// "normal" service implementation // "normal" service implementation
//
//------------------------------------------------------------------------
ScaPricingAddIn::ScaPricingAddIn() : ScaPricingAddIn::ScaPricingAddIn() :
pDefLocales( NULL ), pDefLocales( NULL ),
pResMgr( NULL ), pResMgr( NULL ),
...@@ -335,9 +299,6 @@ OUString ScaPricingAddIn::GetFuncDescrStr( sal_uInt16 nResId, sal_uInt16 nStrInd ...@@ -335,9 +299,6 @@ OUString ScaPricingAddIn::GetFuncDescrStr( sal_uInt16 nResId, sal_uInt16 nStrInd
return aRet; return aRet;
} }
//------------------------------------------------------------------------
OUString ScaPricingAddIn::getImplementationName_Static() OUString ScaPricingAddIn::getImplementationName_Static()
{ {
return OUString( MY_IMPLNAME ); return OUString( MY_IMPLNAME );
...@@ -353,7 +314,6 @@ uno::Sequence< OUString > ScaPricingAddIn::getSupportedServiceNames_Static() ...@@ -353,7 +314,6 @@ uno::Sequence< OUString > ScaPricingAddIn::getSupportedServiceNames_Static()
} }
// XServiceName // XServiceName
OUString SAL_CALL ScaPricingAddIn::getServiceName() throw( uno::RuntimeException ) OUString SAL_CALL ScaPricingAddIn::getServiceName() throw( uno::RuntimeException )
{ {
// name of specific AddIn service // name of specific AddIn service
...@@ -361,7 +321,6 @@ OUString SAL_CALL ScaPricingAddIn::getServiceName() throw( uno::RuntimeException ...@@ -361,7 +321,6 @@ OUString SAL_CALL ScaPricingAddIn::getServiceName() throw( uno::RuntimeException
} }
// XServiceInfo // XServiceInfo
OUString SAL_CALL ScaPricingAddIn::getImplementationName() throw( uno::RuntimeException ) OUString SAL_CALL ScaPricingAddIn::getImplementationName() throw( uno::RuntimeException )
{ {
return getImplementationName_Static(); return getImplementationName_Static();
...@@ -369,7 +328,7 @@ OUString SAL_CALL ScaPricingAddIn::getImplementationName() throw( uno::RuntimeEx ...@@ -369,7 +328,7 @@ OUString SAL_CALL ScaPricingAddIn::getImplementationName() throw( uno::RuntimeEx
sal_Bool SAL_CALL ScaPricingAddIn::supportsService( const OUString& aServiceName ) throw( uno::RuntimeException ) sal_Bool SAL_CALL ScaPricingAddIn::supportsService( const OUString& aServiceName ) throw( uno::RuntimeException )
{ {
return aServiceName == ADDIN_SERVICE || aServiceName == MY_SERVICE; return cppu::supportsService(this, aServiceName);
} }
uno::Sequence< OUString > SAL_CALL ScaPricingAddIn::getSupportedServiceNames() throw( uno::RuntimeException ) uno::Sequence< OUString > SAL_CALL ScaPricingAddIn::getSupportedServiceNames() throw( uno::RuntimeException )
...@@ -378,7 +337,6 @@ uno::Sequence< OUString > SAL_CALL ScaPricingAddIn::getSupportedServiceNames() t ...@@ -378,7 +337,6 @@ uno::Sequence< OUString > SAL_CALL ScaPricingAddIn::getSupportedServiceNames() t
} }
// XLocalizable // XLocalizable
void SAL_CALL ScaPricingAddIn::setLocale( const lang::Locale& eLocale ) throw( uno::RuntimeException ) void SAL_CALL ScaPricingAddIn::setLocale( const lang::Locale& eLocale ) throw( uno::RuntimeException )
{ {
aFuncLoc = eLocale; aFuncLoc = eLocale;
...@@ -390,12 +348,7 @@ lang::Locale SAL_CALL ScaPricingAddIn::getLocale() throw( uno::RuntimeException ...@@ -390,12 +348,7 @@ lang::Locale SAL_CALL ScaPricingAddIn::getLocale() throw( uno::RuntimeException
return aFuncLoc; return aFuncLoc;
} }
//------------------------------------------------------------------ // function descriptions start here
//
// function descriptions start here
//
//------------------------------------------------------------------
// XAddIn // XAddIn
OUString SAL_CALL ScaPricingAddIn::getProgrammaticFuntionName( const OUString& ) throw( uno::RuntimeException ) OUString SAL_CALL ScaPricingAddIn::getProgrammaticFuntionName( const OUString& ) throw( uno::RuntimeException )
{ {
...@@ -503,9 +456,7 @@ OUString SAL_CALL ScaPricingAddIn::getDisplayCategoryName( ...@@ -503,9 +456,7 @@ OUString SAL_CALL ScaPricingAddIn::getDisplayCategoryName(
return getProgrammaticCategoryName( aProgrammaticName ); return getProgrammaticCategoryName( aProgrammaticName );
} }
// XCompatibilityNames // XCompatibilityNames
uno::Sequence< sheet::LocalizedName > SAL_CALL ScaPricingAddIn::getCompatibilityNames( uno::Sequence< sheet::LocalizedName > SAL_CALL ScaPricingAddIn::getCompatibilityNames(
const OUString& aProgrammaticName ) throw( uno::RuntimeException ) const OUString& aProgrammaticName ) throw( uno::RuntimeException )
{ {
...@@ -525,13 +476,7 @@ uno::Sequence< sheet::LocalizedName > SAL_CALL ScaPricingAddIn::getCompatibility ...@@ -525,13 +476,7 @@ uno::Sequence< sheet::LocalizedName > SAL_CALL ScaPricingAddIn::getCompatibility
return aRet; return aRet;
} }
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
// actual function implementation starts here // actual function implementation starts here
//
// auxillary input handling functions // auxillary input handling functions
namespace { namespace {
...@@ -639,7 +584,6 @@ bool getinput_greek(bs::types::Greeks& greek, const uno::Any& anyval) { ...@@ -639,7 +584,6 @@ bool getinput_greek(bs::types::Greeks& greek, const uno::Any& anyval) {
} // namespace for auxillary functions } // namespace for auxillary functions
// OPT_BARRIER(...) // OPT_BARRIER(...)
double SAL_CALL ScaPricingAddIn::getOptBarrier( double spot, double vol, double SAL_CALL ScaPricingAddIn::getOptBarrier( double spot, double vol,
double r, double rf, double T, double strike, double r, double rf, double T, double strike,
...@@ -729,7 +673,4 @@ double SAL_CALL ScaPricingAddIn::getOptProbInMoney( double spot, double vol, ...@@ -729,7 +673,4 @@ double SAL_CALL ScaPricingAddIn::getOptProbInMoney( double spot, double vol,
} }
//------------------------------------------------------------------
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment