summaryrefslogtreecommitdiff
path: root/extensions/test
diff options
context:
space:
mode:
authorJoachim Lingner <jl@openoffice.org>2001-12-06 07:35:16 +0000
committerJoachim Lingner <jl@openoffice.org>2001-12-06 07:35:16 +0000
commit2574c30c6ed9840fef1624d8e1e746c2251fc677 (patch)
treea999eb612497f8e84315f5ea81f1582c53394cb4 /extensions/test
parent73b8453b95472d2ebe8ad56fa9f3df0e57873615 (diff)
*** empty log message ***
Diffstat (limited to 'extensions/test')
-rw-r--r--extensions/test/ole/cppToUno/testcppuno.cxx26
1 files changed, 22 insertions, 4 deletions
diff --git a/extensions/test/ole/cppToUno/testcppuno.cxx b/extensions/test/ole/cppToUno/testcppuno.cxx
index 3ae5f603016f..8c3047cfe31d 100644
--- a/extensions/test/ole/cppToUno/testcppuno.cxx
+++ b/extensions/test/ole/cppToUno/testcppuno.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: testcppuno.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: jl $ $Date: 2000-10-24 09:34:19 $
+ * last change: $Author: jl $ $Date: 2001-12-06 08:35:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -159,12 +159,18 @@ HRESULT doTest()
// two dimensional array
SAFEARRAYBOUND bounds[2];
+ // least significant dimension first, Dimension 1
bounds[0].cElements= 3;
bounds[0].lLbound= 0;
+ // Dimension 2
bounds[1].cElements= 2;
bounds[1].lLbound= 0;
par= SafeArrayCreate( VT_I4, 2, bounds );
+ long uBound1;
+ long uBound2;
+ hr= SafeArrayGetUBound( par, 1, &uBound1);
+ hr= SafeArrayGetUBound( par, 2, &uBound2);
long index2[2];
memset( index2, 0, 2 * sizeof( long) );
@@ -174,9 +180,21 @@ HRESULT doTest()
do
{
data= index2[1] * 3 + index2[0] +1;
- SafeArrayPutElement( par, index2, &data);
+ hr= SafeArrayPutElement( par, index2, &data);
}while( incrementMultidimensionalIndex( 2, dimLengths, index2) );
+ long* pdata;
+ long (*dataL)[2][3];
+ hr= SafeArrayAccessData( par, (void**)&pdata);
+ dataL= (long(*)[2][3])pdata;
+
+ for (long i= 0; i < 2; i ++)
+ {
+ for(long j= 0; j < 3; j++)
+ data= (*dataL)[i][j];
+ }
+ hr= SafeArrayUnaccessData(par);
+
result.Clear();
param1.vt= VT_ARRAY | VT_I4;
param1.byref= par;
@@ -242,4 +260,4 @@ bool incrementMultidimensionalIndex(sal_Int32 dimensions,
}
}
return ret;
-} \ No newline at end of file
+}