summaryrefslogtreecommitdiff
path: root/cppu/source/uno
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2003-09-04 09:53:14 +0000
committerOliver Bolte <obo@openoffice.org>2003-09-04 09:53:14 +0000
commitd65ba312a272b63f23e913d26e3f4d0570ed006d (patch)
tree1bb7e7be638e6e3fb1235bb3c4d8074e715c474e /cppu/source/uno
parent29f01fe41376ba3ebc80369a0cadd0597778815d (diff)
INTEGRATION: CWS cliuno01 (1.23.6); FILE MERGED
2003/07/24 15:19:04 dbo 1.23.6.2: - sequence reallocation fix - more code cleanup - test code 2003/07/23 16:39:22 dbo 1.23.6.1: - fixing cppu core sequence routines returning 0 handle upon memory allocation failure - C++ Sequence<> throws ::std::bad_alloc upon memory allocation failure
Diffstat (limited to 'cppu/source/uno')
-rw-r--r--cppu/source/uno/data.cxx40
1 files changed, 16 insertions, 24 deletions
diff --git a/cppu/source/uno/data.cxx b/cppu/source/uno/data.cxx
index 45e11bf5793d..2d48f806267e 100644
--- a/cppu/source/uno/data.cxx
+++ b/cppu/source/uno/data.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: data.cxx,v $
*
- * $Revision: 1.23 $
+ * $Revision: 1.24 $
*
- * last change: $Author: vg $ $Date: 2003-04-15 16:37:21 $
+ * last change: $Author: obo $ $Date: 2003-09-04 10:53:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -77,7 +77,8 @@ using namespace ::osl;
namespace cppu
{
-uno_Sequence g_emptySeq = { 1, 0, { 0 } }; // static empty sequence
+// Sequence<>() (default ctor) relies on this being static:
+uno_Sequence g_emptySeq = { 1, 0, { 0 } };
typelib_TypeDescriptionReference * g_pVoidType = 0;
//--------------------------------------------------------------------------------------------------
@@ -192,35 +193,26 @@ sal_Bool assignStruct(
{
return _assignStruct( pDest, pSource, pTypeDescr, queryInterface, acquire, release );
}
-//==================================================================================================
-void copyConstructSequence(
- uno_Sequence ** ppDest, uno_Sequence * pSource,
+
+//==============================================================================
+uno_Sequence * copyConstructSequence(
+ uno_Sequence * pSource,
typelib_TypeDescriptionReference * pElementType,
uno_AcquireFunc acquire, uno_Mapping * mapping )
- SAL_THROW( () )
{
- _copyConstructSequence( ppDest, pSource, pElementType, acquire, mapping );
+ return icopyConstructSequence( pSource, pElementType, acquire, mapping );
}
-//==================================================================================================
+
+//==============================================================================
void destructSequence(
- uno_Sequence ** ppSequence,
- typelib_TypeDescriptionReference * pElementType,
+ uno_Sequence * pSequence,
+ typelib_TypeDescriptionReference * pType,
+ typelib_TypeDescription * pTypeDescr,
uno_ReleaseFunc release )
- SAL_THROW( () )
{
- uno_Sequence * pSequence = *ppSequence;
- OSL_ASSERT( pSequence );
- if (! ::osl_decrementInterlockedCount( &pSequence->nRefCount ))
- {
- if (pSequence->nElements)
- {
- _destructElements(
- pSequence->elements, pElementType,
- 0, pSequence->nElements, release );
- }
- ::rtl_freeMemory( pSequence );
- }
+ idestructSequence( pSequence, pType, pTypeDescr, release );
}
+
//==================================================================================================
sal_Bool equalSequence(
uno_Sequence * pDest, uno_Sequence * pSource,