Kaydet (Commit) e89b0abf authored tarafından Michael Meeks's avatar Michael Meeks

Port binfilter crash-on-exit fix ...

üst f410283f
......@@ -29,6 +29,7 @@
#define SVX_UNOPROV_HXX
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include <svl/itemprop.hxx>
#include <tools/list.hxx>
#include "svx/svxdllapi.h"
......@@ -40,29 +41,14 @@ class SfxItemPool;
* class UHashMap *
***********************************************************************/
struct UHashMapEntry
{
::rtl::OUString aIdentifier;
UINT32 nId;
UHashMapEntry(const sal_Char * value, sal_Int32 length, UINT32 _nId) : aIdentifier(value,length,RTL_TEXTENCODING_ASCII_US), nId(_nId) { }
};
DECLARE_LIST( UHashMapEntryList, UHashMapEntry* )
#define HASHARRAYSIZE 0x10
#define UHASHMAP_NOTFOUND sal::static_int_cast< UINT32 >(~0)
class UHashMap
{
private:
UHashMapEntryList m_aHashList[HASHARRAYSIZE];
UHashMap() {}
public:
UHashMap( UHashMapEntry* pMap );
~UHashMap() {};
UINT32 getId( const ::rtl::OUString& rCompareString );
static sal_uInt32 getId( const ::rtl::OUString& rCompareString );
static rtl::OUString getNameFromId (sal_uInt32 nId);
static ::com::sun::star::uno::Sequence< rtl::OUString > getServiceNames();
};
/***********************************************************************
......@@ -119,8 +105,6 @@ const sal_Int16 OBJ_OLE2_APPLET = 100;
const sal_Int16 OBJ_OLE2_PLUGIN = 101;
extern SvxUnoPropertyMapProvider aSvxMapProvider;
extern UHashMapEntry pSdrShapeIdentifierMap[];
extern UHashMap aSdrShapeIdentifierMap;
#define E3D_INVENTOR_FLAG (0x80000000)
......
......@@ -62,8 +62,6 @@
#include <svx/svdpage.hxx>
#include <svx/unoshape.hxx>
extern UHashMapEntry pSdrShapeIdentifierMap[];
//-////////////////////////////////////////////////////////////////////
using namespace ::rtl;
......@@ -185,14 +183,14 @@ sal_Bool SvxUnoDrawMSFactory::createEvent( const SdrModel* pDoc, const SdrHint*
return sal_True;
}
uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawMSFactory::createInstance( const OUString& ServiceSpecifier )
uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawMSFactory::createInstance( const OUString& rServiceSpecifier )
throw( uno::Exception, uno::RuntimeException )
{
const OUString aDrawingPrefix( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.") );
if( ServiceSpecifier.compareTo( aDrawingPrefix, aDrawingPrefix.getLength() ) == 0 )
if( rServiceSpecifier.compareTo( aDrawingPrefix, aDrawingPrefix.getLength() ) == 0 )
{
UINT32 nType = aSdrShapeIdentifierMap.getId( ServiceSpecifier );
sal_uInt32 nType = UHashMap::getId( rServiceSpecifier );
if( nType != UHASHMAP_NOTFOUND )
{
UINT16 nT = (UINT16)(nType & ~E3D_INVENTOR_FLAG);
......@@ -202,7 +200,7 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawMSFactory::createInstance(
}
}
uno::Reference< uno::XInterface > xRet( createTextField( ServiceSpecifier ) );
uno::Reference< uno::XInterface > xRet( createTextField( rServiceSpecifier ) );
if( !xRet.is() )
throw lang::ServiceNotRegisteredException();
......@@ -223,28 +221,7 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawMSFactory::createInstanceWi
uno::Sequence< OUString > SAL_CALL SvxUnoDrawMSFactory::getAvailableServiceNames()
throw( uno::RuntimeException )
{
UHashMapEntry* pMap = pSdrShapeIdentifierMap;
UINT32 nCount = 0;
while (pMap->aIdentifier.getLength())
{
pMap++;
nCount++;
}
uno::Sequence< OUString > aSeq( nCount );
OUString* pStrings = aSeq.getArray();
pMap = pSdrShapeIdentifierMap;
UINT32 nIdx = 0;
while(pMap->aIdentifier.getLength())
{
pStrings[nIdx] = pMap->aIdentifier;
pMap++;
nIdx++;
}
return aSeq;
return UHashMap::getServiceNames();
}
uno::Sequence< OUString > SvxUnoDrawMSFactory::concatServiceNames( uno::Sequence< OUString >& rServices1, uno::Sequence< OUString >& rServices2 ) throw()
......
......@@ -650,7 +650,7 @@ SdrObject *SvxDrawPage::_CreateSdrObject( const Reference< drawing::XShape > & x
//----------------------------------------------------------------------
void SvxDrawPage::GetTypeAndInventor( sal_uInt16& rType, sal_uInt32& rInventor, const OUString& aName ) const throw()
{
sal_uInt32 nTempType = aSdrShapeIdentifierMap.getId( aName );
sal_uInt32 nTempType = UHashMap::getId( aName );
if( nTempType == UHASHMAP_NOTFOUND )
{
......
This diff is collapsed.
......@@ -1385,23 +1385,10 @@ void SAL_CALL SvxShape::setName( const ::rtl::OUString& aName ) throw(::com::sun
//----------------------------------------------------------------------
OUString SAL_CALL SvxShape::getShapeType() throw(uno::RuntimeException)
{
if( 0 == maShapeType.getLength() )
{
UHashMapEntry* pMap = pSdrShapeIdentifierMap;
while ( ( pMap->nId != mpImpl->mnObjId ) && pMap->aIdentifier.getLength() )
++pMap;
if ( pMap->aIdentifier.getLength() )
{
return pMap->aIdentifier;
}
else
{
DBG_ERROR("[CL] unknown SdrObjekt identifier");
}
}
return maShapeType;
if( !aShapeType.getLength() )
return UHashMap::getNameFromId( mpImpl->mnObjId );
else
return maShapeType;
}
// XComponent
......
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