Kaydet (Commit) 3aeea4b9 authored tarafından Caolán McNamara's avatar Caolán McNamara

global uno::Sequences are very problematic at shutdown time

because the underlying uno infrastructure has been shutdown already,
we need to ensure their lifecycle more carefully.
üst 2479aec5
......@@ -373,9 +373,6 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText;
sal_Bool mbPortion;
protected:
static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > maTypeSequence;
public:
SvxUnoTextRange( const SvxUnoTextBase& rParent, sal_Bool bPortion = sal_False ) throw();
virtual ~SvxUnoTextRange() throw();
......@@ -406,7 +403,6 @@ class EDITENG_DLLPUBLIC SvxUnoTextBase : public SvxUnoTextRangeBase,
{
protected:
::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText;
static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > maTypeSequence;
public:
SvxUnoTextBase( ) throw();
......@@ -541,8 +537,6 @@ private:
bool mbDisposing;
protected:
static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > maTypeSequence;
using SvxUnoTextRangeBase::setPropertyValue;
using SvxUnoTextRangeBase::getPropertyValue;
......@@ -630,9 +624,6 @@ class EDITENG_DLLPUBLIC SvxUnoTextCursor : public SvxUnoTextRangeBase,
private:
::com::sun::star::uno::Reference< ::com::sun::star::text::XText > mxParentText;
protected:
static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > maTypeSequence;
public:
SvxUnoTextCursor( const SvxUnoTextBase& rText ) throw();
SvxUnoTextCursor( const SvxUnoTextCursor& rCursor ) throw();
......
......@@ -40,6 +40,7 @@
#include <svl/eitem.hxx>
#include <rtl/uuid.h>
#include <rtl/memory.h>
#include <rtl/instance.hxx>
#include <editeng/fontitem.hxx>
#include <editeng/tstpitem.hxx>
......@@ -1523,8 +1524,6 @@ sal_Int16 SAL_CALL SvxUnoTextRangeBase::compareRegionEnds( const uno::Reference<
// class SvxUnoTextRange
// ====================================================================
uno::Sequence< uno::Type > SvxUnoTextRange::maTypeSequence;
uno::Reference< uno::XInterface > SvxUnoTextRange_NewInstance()
{
SvxUnoText aText;
......@@ -1586,25 +1585,37 @@ void SAL_CALL SvxUnoTextRange::release()
// XTypeProvider
namespace
{
struct theSvxUnoTextRangeTypes :
public rtl::StaticWithInit<uno::Sequence<uno::Type>, theSvxUnoTextRangeTypes>
{
uno::Sequence<uno::Type> operator () ()
{
uno::Sequence< uno::Type > aTypeSequence;
aTypeSequence.realloc( 9 ); // !DANGER! keep this updated
uno::Type* pTypes = aTypeSequence.getArray();
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRange >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertySet >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertySet >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertyStates >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertyState >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XServiceInfo >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XTypeProvider >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XUnoTunnel >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRangeCompare >*)0);
return aTypeSequence;
}
};
}
uno::Sequence< uno::Type > SAL_CALL SvxUnoTextRange::getTypes()
throw (uno::RuntimeException)
{
if( maTypeSequence.getLength() == 0 )
{
maTypeSequence.realloc( 9 ); // !DANGER! keep this updated
uno::Type* pTypes = maTypeSequence.getArray();
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRange >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertySet >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertySet >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertyStates >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertyState >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XServiceInfo >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XTypeProvider >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XUnoTunnel >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRangeCompare >*)0);
}
return maTypeSequence;
return theSvxUnoTextRangeTypes::get();
}
uno::Sequence< sal_Int8 > SAL_CALL SvxUnoTextRange::getImplementationId()
......@@ -1637,10 +1648,6 @@ OUString SAL_CALL SvxUnoTextRange::getImplementationName()
// class SvxUnoText
// ====================================================================
// UNO3_GETIMPLEMENTATION2_IMPL( SvxUnoText, SvxUnoTextRangeBase );
uno::Sequence< uno::Type > SvxUnoTextBase::maTypeSequence;
SvxUnoTextBase::SvxUnoTextBase() throw()
: SvxUnoTextRangeBase( NULL )
{
......@@ -1732,30 +1739,41 @@ uno::Any SAL_CALL SvxUnoTextBase::queryAggregation( const uno::Type & rType )
// XTypeProvider
uno::Sequence< uno::Type > SAL_CALL SvxUnoTextBase::getStaticTypes() throw()
namespace
{
if( maTypeSequence.getLength() == 0 )
struct theSvxUnoTextBaseTypes :
public rtl::StaticWithInit<uno::Sequence<uno::Type>, theSvxUnoTextBaseTypes>
{
maTypeSequence.realloc( 15 ); // !DANGER! keep this updated
uno::Type* pTypes = maTypeSequence.getArray();
*pTypes++ = ::getCppuType(( const uno::Reference< text::XText >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< container::XEnumerationAccess >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertySet >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertySet >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertyStates >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertyState >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRangeMover >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextAppend >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextCopy >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< text::XParagraphAppend >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextPortionAppend >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XServiceInfo >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XTypeProvider >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XUnoTunnel >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRangeCompare >*)0);
}
return maTypeSequence;
uno::Sequence<uno::Type> operator () ()
{
uno::Sequence< uno::Type > aTypeSequence;
aTypeSequence.realloc( 15 ); // !DANGER! keep this updated
uno::Type* pTypes = aTypeSequence.getArray();
*pTypes++ = ::getCppuType(( const uno::Reference< text::XText >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< container::XEnumerationAccess >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertySet >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertySet >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertyStates >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertyState >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRangeMover >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextAppend >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextCopy >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< text::XParagraphAppend >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextPortionAppend >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XServiceInfo >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XTypeProvider >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XUnoTunnel >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRangeCompare >*)0);
return aTypeSequence;
}
};
}
uno::Sequence< uno::Type > SAL_CALL SvxUnoTextBase::getStaticTypes() throw()
{
return theSvxUnoTextBaseTypes::get();
}
uno::Sequence< uno::Type > SAL_CALL SvxUnoTextBase::getTypes()
......
......@@ -36,6 +36,7 @@
#include <rtl/uuid.h>
#include <rtl/memory.h>
#include <rtl/instance.hxx>
#include <editeng/eeitem.hxx>
#include <editeng/flditem.hxx>
......@@ -113,7 +114,6 @@ uno::Any SvxUnoTextContentEnumeration::nextElement(void) throw( container::NoSuc
// class SvxUnoTextContent
// ====================================================================
uno::Reference< text::XText > xDummyText;
uno::Sequence< uno::Type > SvxUnoTextContent::maTypeSequence;
static SvxUnoText* getDummyText() throw()
{
......@@ -200,27 +200,39 @@ void SAL_CALL SvxUnoTextContent::release() throw( )
// XTypeProvider
namespace
{
struct theSvxUnoTextContentTypes :
public rtl::StaticWithInit<uno::Sequence<uno::Type>, theSvxUnoTextContentTypes>
{
uno::Sequence<uno::Type> operator () ()
{
uno::Sequence< uno::Type > aTypeSequence;
aTypeSequence.realloc( 11 ); // !DANGER! keep this updated
uno::Type* pTypes = aTypeSequence.getArray();
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRange >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertySet >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertySet >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertyStates >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertyState >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRangeCompare >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextContent >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< container::XEnumerationAccess >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XServiceInfo >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XTypeProvider >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XUnoTunnel >*)0);
return aTypeSequence;
}
};
}
uno::Sequence< uno::Type > SAL_CALL SvxUnoTextContent::getTypes()
throw (uno::RuntimeException)
{
if( maTypeSequence.getLength() == 0 )
{
maTypeSequence.realloc( 11 ); // !DANGER! keep this updated
uno::Type* pTypes = maTypeSequence.getArray();
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRange >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertySet >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertySet >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertyStates >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertyState >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRangeCompare >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextContent >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< container::XEnumerationAccess >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XServiceInfo >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XTypeProvider >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XUnoTunnel >*)0);
}
return maTypeSequence;
return theSvxUnoTextContentTypes::get();
}
uno::Sequence< sal_Int8 > SAL_CALL SvxUnoTextContent::getImplementationId()
......@@ -487,8 +499,6 @@ uno::Any SAL_CALL SvxUnoTextRangeEnumeration::nextElement()
// class SvxUnoTextCursor
// ====================================================================
uno::Sequence< uno::Type > SvxUnoTextCursor::maTypeSequence;
uno::Reference< uno::XInterface > SvxUnoTextCursor_NewInstance()
{
SvxUnoText aText;
......@@ -553,27 +563,39 @@ void SAL_CALL SvxUnoTextCursor::release() throw ( )
OWeakAggObject::release();
}
namespace
{
struct theSvxUnoTextCursorTypes :
public rtl::StaticWithInit<uno::Sequence<uno::Type>, theSvxUnoTextCursorTypes>
{
uno::Sequence<uno::Type> operator () ()
{
uno::Sequence< uno::Type > aTypeSequence;
aTypeSequence.realloc( 10 ); // !DANGER! keep this updated
uno::Type* pTypes = aTypeSequence.getArray();
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRange >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextCursor >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertySet >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertySet >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertyStates >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertyState >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRangeCompare >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XServiceInfo >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XTypeProvider >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XUnoTunnel >*)0);
return aTypeSequence;
}
};
}
// XTypeProvider
uno::Sequence< uno::Type > SAL_CALL SvxUnoTextCursor::getTypes()
throw(uno::RuntimeException)
{
if( maTypeSequence.getLength() == 0 )
{
maTypeSequence.realloc( 10 ); // !DANGER! keep this updated
uno::Type* pTypes = maTypeSequence.getArray();
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRange >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextCursor >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertySet >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertySet >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XMultiPropertyStates >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< beans::XPropertyState >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< text::XTextRangeCompare >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XServiceInfo >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XTypeProvider >*)0);
*pTypes++ = ::getCppuType(( const uno::Reference< lang::XUnoTunnel >*)0);
}
return maTypeSequence;
return theSvxUnoTextCursorTypes::get();
}
uno::Sequence< sal_Int8 > SAL_CALL SvxUnoTextCursor::getImplementationId()
......
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