summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgt <gt@openoffice.org>2001-07-18 08:16:23 +0000
committergt <gt@openoffice.org>2001-07-18 08:16:23 +0000
commit16100461418cad29ed2d613f32bd759840d935f2 (patch)
tree282ec6c4bfc8ebf85c9b2b5689594af84e7aaff5
parent4541dc09ef2f33b82dd3f52d6ea6d1d1408ef2e9 (diff)
#89826# any[][] as first parameter for IMSUM and IMPRODUCT
-rw-r--r--scaddins/source/analysis/analysis.cxx36
-rw-r--r--scaddins/source/analysis/analysis.hxx8
-rw-r--r--scaddins/source/analysis/analysisadd.idl8
-rw-r--r--scaddins/source/analysis/analysishelper.cxx18
-rw-r--r--scaddins/source/analysis/analysishelper.hxx18
5 files changed, 55 insertions, 33 deletions
diff --git a/scaddins/source/analysis/analysis.cxx b/scaddins/source/analysis/analysis.cxx
index fe4a3f1c6fac..9c78e65abdc7 100644
--- a/scaddins/source/analysis/analysis.cxx
+++ b/scaddins/source/analysis/analysis.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: analysis.cxx,v $
*
- * $Revision: 1.23 $
+ * $Revision: 1.24 $
*
- * last change: $Author: gt $ $Date: 2001-07-18 06:44:16 $
+ * last change: $Author: gt $ $Date: 2001-07-18 09:16:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1195,15 +1195,21 @@ STRING SAL_CALL AnalysisAddIn::getImlog2( const STRING& aNum ) THROWDEF_RTE_IAE
}
-STRING SAL_CALL AnalysisAddIn::getImproduct( const STRING& aNum1, const SEQ( uno::Any )& aNL ) THROWDEF_RTE_IAE
+STRING SAL_CALL AnalysisAddIn::getImproduct( const SEQSEQ( STRING )& aNum1, const SEQ( uno::Any )& aNL ) THROWDEF_RTE_IAE
{
- Complex z( aNum1 );
+ ComplexList z_list;
+
+ z_list.Append( aNum1, AH_IgnoreEmpty );
+ z_list.Append( aNL, AH_IgnoreEmpty );
- ComplexList aNumList;
+ const Complex* p = z_list.First();
- aNumList.Append( aNL );
+ if( !p )
+ return Complex( 0 ).GetString();
- for( const Complex* p = aNumList.First(); p ; p = aNumList.Next() )
+ Complex z( *p );
+
+ for( p = z_list.Next() ; p ; p = z_list.Next() )
z.Mult( *p );
return z.GetString();
@@ -1236,15 +1242,21 @@ STRING SAL_CALL AnalysisAddIn::getImsub( const STRING& aNum1, const STRING& aNum
}
-STRING SAL_CALL AnalysisAddIn::getImsum( const STRING& aNum1, const SEQ( CSS::uno::Any )& aFollowingPars ) THROWDEF_RTE_IAE
+STRING SAL_CALL AnalysisAddIn::getImsum( const SEQSEQ( STRING )& aNum1, const SEQ( CSS::uno::Any )& aFollowingPars ) THROWDEF_RTE_IAE
{
- Complex z( aNum1 );
-
ComplexList z_list;
- z_list.Append( aFollowingPars );
+ z_list.Append( aNum1, AH_IgnoreEmpty );
+ z_list.Append( aFollowingPars, AH_IgnoreEmpty );
+
+ const Complex* p = z_list.First();
+
+ if( !p )
+ return Complex( 0 ).GetString();
+
+ Complex z( *p );
- for( const Complex* p = z_list.First() ; p ; p = z_list.Next() )
+ for( p = z_list.Next() ; p ; p = z_list.Next() )
z.Add( *p );
return z.GetString();
diff --git a/scaddins/source/analysis/analysis.hxx b/scaddins/source/analysis/analysis.hxx
index d90fbf3c6510..10fd6df2bea1 100644
--- a/scaddins/source/analysis/analysis.hxx
+++ b/scaddins/source/analysis/analysis.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: analysis.hxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: gt $ $Date: 2001-07-18 06:44:16 $
+ * last change: $Author: gt $ $Date: 2001-07-18 09:16:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -204,11 +204,11 @@ public:
virtual STRING SAL_CALL getImln( const STRING& aNum ) THROWDEF_RTE_IAE;
virtual STRING SAL_CALL getImlog10( const STRING& aNum ) THROWDEF_RTE_IAE;
virtual STRING SAL_CALL getImlog2( const STRING& aNum ) THROWDEF_RTE_IAE;
- virtual STRING SAL_CALL getImproduct( const STRING& aNum1, const SEQ_ANY& aNumList ) THROWDEF_RTE_IAE;
+ virtual STRING SAL_CALL getImproduct( const SEQSEQ( STRING )& aNum1, const SEQ_ANY& aNumList ) THROWDEF_RTE_IAE;
virtual double SAL_CALL getImreal( const STRING& aNum ) THROWDEF_RTE_IAE;
virtual STRING SAL_CALL getImsin( const STRING& aNum ) THROWDEF_RTE_IAE;
virtual STRING SAL_CALL getImsub( const STRING& aNum1, const STRING& aNum2 ) THROWDEF_RTE_IAE;
- virtual STRING SAL_CALL getImsum( const STRING& aNum1, const SEQ( ANY )& aFollowingPars ) THROWDEF_RTE_IAE;
+ virtual STRING SAL_CALL getImsum( const SEQSEQ( STRING )& aNum1, const SEQ( ANY )& aFollowingPars ) THROWDEF_RTE_IAE;
virtual STRING SAL_CALL getImsqrt( const STRING& aNum ) THROWDEF_RTE_IAE;
virtual STRING SAL_CALL getComplex( double fReal, double fImaginary, const ANY& rSuffix ) THROWDEF_RTE_IAE;
diff --git a/scaddins/source/analysis/analysisadd.idl b/scaddins/source/analysis/analysisadd.idl
index 110a5f245808..b45abf3804c9 100644
--- a/scaddins/source/analysis/analysisadd.idl
+++ b/scaddins/source/analysis/analysisadd.idl
@@ -2,9 +2,9 @@
*
* $RCSfile: analysisadd.idl,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: gt $ $Date: 2001-06-18 13:00:32 $
+ * last change: $Author: gt $ $Date: 2001-07-18 09:16:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -247,7 +247,7 @@ module addin
string getImlog2( [in] string Num );
/// improduct.
- string getImproduct( [in] string Num1, [in] sequence<any> NumberList );
+ string getImproduct( [in] sequence< sequence<string> > Num1, [in] sequence<any> NumberList );
/// imreal.
double getImreal( [in] string Num );
@@ -259,7 +259,7 @@ module addin
string getImsub( [in] string Num1, [in] string Num2 );
/// imsum.
- string getImsum( [in] string Num1, [in] sequence<any> OptNums );
+ string getImsum( [in] sequence< sequence<string> > Num1, [in] sequence<any> OptNums );
/// imsqrt.
string getImsqrt( [in] string Num );
diff --git a/scaddins/source/analysis/analysishelper.cxx b/scaddins/source/analysis/analysishelper.cxx
index deadc986ab9d..eea0cfcb55f4 100644
--- a/scaddins/source/analysis/analysishelper.cxx
+++ b/scaddins/source/analysis/analysishelper.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: analysishelper.cxx,v $
*
- * $Revision: 1.18 $
+ * $Revision: 1.19 $
*
- * last change: $Author: gt $ $Date: 2001-07-12 11:50:13 $
+ * last change: $Author: gt $ $Date: 2001-07-18 09:16:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -2379,11 +2379,13 @@ ComplexList::~ComplexList()
}
-void ComplexList::Append( const SEQSEQ( STRING )& r, sal_Bool bEmpty0 ) THROWDEF_RTE_IAE
+void ComplexList::Append( const SEQSEQ( STRING )& r, ComplListAppendHandl eAH ) THROWDEF_RTE_IAE
{
sal_Int32 n1, n2;
sal_Int32 nE1 = r.getLength();
sal_Int32 nE2;
+ sal_Bool bEmpty0 = eAH == AH_EmpyAs0;
+ sal_Bool bErrOnEmpty = eAH == AH_EmptyAsErr;
for( n1 = 0 ; n1 < nE1 ; n1++ )
{
@@ -2398,16 +2400,18 @@ void ComplexList::Append( const SEQSEQ( STRING )& r, sal_Bool bEmpty0 ) THROWDEF
Append( new Complex( rStr ) );
else if( bEmpty0 )
Append( new Complex( 0.0 ) );
- else
+ else if( bErrOnEmpty )
THROW_IAE;
}
}
}
-void ComplexList::Append( const SEQ( ANY )& aMultPars, sal_Bool bEmpty0 ) THROWDEF_RTE_IAE
+void ComplexList::Append( const SEQ( ANY )& aMultPars, ComplListAppendHandl eAH ) THROWDEF_RTE_IAE
{
sal_Int32 nE = aMultPars.getLength();
+ sal_Bool bEmpty0 = eAH == AH_EmpyAs0;
+ sal_Bool bErrOnEmpty = eAH == AH_EmptyAsErr;
for( sal_Int32 n = 0 ; n < nE ; n++ )
{
@@ -2423,7 +2427,7 @@ void ComplexList::Append( const SEQ( ANY )& aMultPars, sal_Bool bEmpty0 ) THROWD
Append( new Complex( *( STRING* ) r.getValue() ) );
else if( bEmpty0 )
Append( new Complex( 0.0 ) );
- else
+ else if( bErrOnEmpty )
THROW_IAE;
}
break;
@@ -2438,7 +2442,7 @@ void ComplexList::Append( const SEQ( ANY )& aMultPars, sal_Bool bEmpty0 ) THROWD
sal_Int32 nE = aValArr.getLength();
const SEQ( ANY )* pArr = aValArr.getConstArray();
for( sal_Int32 n = 0 ; n < nE ; n++ )
- Append( pArr[ n ], bEmpty0 );
+ Append( pArr[ n ], eAH );
}
else
THROW_IAE;
diff --git a/scaddins/source/analysis/analysishelper.hxx b/scaddins/source/analysis/analysishelper.hxx
index 8175b281babc..337432206919 100644
--- a/scaddins/source/analysis/analysishelper.hxx
+++ b/scaddins/source/analysis/analysishelper.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: analysishelper.hxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: gt $ $Date: 2001-07-12 11:50:13 $
+ * last change: $Author: gt $ $Date: 2001-07-18 09:16:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -492,6 +492,14 @@ public:
+enum ComplListAppendHandl
+{
+ AH_EmptyAsErr,
+ AH_EmpyAs0,
+ AH_IgnoreEmpty
+};
+
+
class ComplexList : protected MyList
{
public:
@@ -504,10 +512,8 @@ public:
MyList::Count;
inline void Append( Complex* pNew );
- void Append( const SEQSEQ( STRING )& rComplexNumList,
- sal_Bool bEmptyStringAs0 = sal_True ) THROWDEF_RTE_IAE;
- void Append( const SEQ( ANY )& aMultPars,
- sal_Bool bEmptyStringAs0 = sal_True ) THROWDEF_RTE_IAE;
+ void Append( const SEQSEQ( STRING )& rComplexNumList, ComplListAppendHandl eAH = AH_EmpyAs0 ) THROWDEF_RTE_IAE;
+ void Append( const SEQ( ANY )& aMultPars,ComplListAppendHandl eAH = AH_EmpyAs0 ) THROWDEF_RTE_IAE;
};