[ooo-build-commit] .: 2 commits - svx/inc svx/source

Michael Meeks mmeeks at kemper.freedesktop.org
Fri Oct 1 06:48:49 PDT 2010


 svx/inc/svx/unoprov.hxx         |   26 +------
 svx/source/unodraw/unomod.cxx   |   33 +--------
 svx/source/unodraw/unopage.cxx  |    2 
 svx/source/unodraw/unoprov.cxx  |  146 +++++++++++++++++++++-------------------
 svx/source/unodraw/unoshape.cxx |   21 +----
 5 files changed, 94 insertions(+), 134 deletions(-)

New commits:
commit 2fbd515c917918fdccd68369b29d1d237682fce3
Author: Michael Meeks <michael.meeks at novell.com>
Date:   Fri Oct 1 12:01:46 2010 +0100

    cleanup UHashMap fix.

diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx
index 07582c8..d1b0a5b 100644
--- a/svx/source/unodraw/unoprov.cxx
+++ b/svx/source/unodraw/unoprov.cxx
@@ -921,55 +921,12 @@ UINT32 UHashMap::getId( const OUString& rCompareString )
         return it->second;
 }
 
-
-
-
-UHashMapEntry pSdrShapeIdentifierMap[] =
-{
-    { RTL_CONSTASCII_STRINGPARAM(""),	0 )
-};
-
-// ---------------------------------------------------------------------
-
-UHashMap aSdrShapeIdentifierMap( pSdrShapeIdentifierMap );
-
-UHashMap::UHashMap( UHashMapEntry* pMap )
-{
-    while( pMap->aIdentifier.getLength() )
-    {
-        OUString aStr( pMap->aIdentifier );
-        size_t nHash = aStr.hashCode() & (HASHARRAYSIZE-1);
-
-        m_aHashList[nHash].Insert(pMap);
-        pMap++;
-    }
-}
-
-// ---------------------------------------------------------------------
-
-UINT32 UHashMap::getId( const OUString& rCompareString )
-{
-    size_t nHash = rCompareString.hashCode() & (HASHARRAYSIZE-1);
-
-    UHashMapEntryList& rList = m_aHashList[nHash];
-
-    UHashMapEntry * pMap = rList.First();
-
-    while(pMap)
-    {
-        if( rCompareString == pMap->aIdentifier )
-            return pMap->nId;
-
-        pMap = rList.Next();
-    }
-
-    return UHASHMAP_NOTFOUND;
-}
-
 /***********************************************************************
 * class SvxUnoPropertyMapProvider                                      *
 ***********************************************************************/
 
+SvxUnoPropertyMapProvider aSvxMapProvider;
+
 EXTERN_C
 #if defined( PM2 ) && (!defined( CSET ) && !defined ( MTW ) && !defined( WTC ))
 int _stdcall
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 0a048f9..816709a 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -1385,7 +1385,7 @@ void SAL_CALL SvxShape::setName( const ::rtl::OUString& aName ) throw(::com::sun
 //----------------------------------------------------------------------
 OUString SAL_CALL SvxShape::getShapeType() throw(uno::RuntimeException)
 {
-    if( !aShapeType.getLength() )
+    if( !maShapeType.getLength() )
         return UHashMap::getNameFromId( mpImpl->mnObjId );
     else
         return maShapeType;
commit e3125cbef6876f6b567a34cc2e29ec8217bbcc69
Author: Michael Meeks <michael.meeks at novell.com>
Date:   Fri Oct 1 11:24:01 2010 +0100

    Port binfilter crash-on-exit fix ...

diff --git a/svx/inc/svx/unoprov.hxx b/svx/inc/svx/unoprov.hxx
index 06a1a7a..5bcedc4 100644
--- a/svx/inc/svx/unoprov.hxx
+++ b/svx/inc/svx/unoprov.hxx
@@ -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)
 
diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx
index 97adf44..e84292a 100644
--- a/svx/source/unodraw/unomod.cxx
+++ b/svx/source/unodraw/unomod.cxx
@@ -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()
diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx
index e62f770..7a5982b 100644
--- a/svx/source/unodraw/unopage.cxx
+++ b/svx/source/unodraw/unopage.cxx
@@ -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 )
     {
diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx
index e69d6d2..07582c8 100644
--- a/svx/source/unodraw/unoprov.cxx
+++ b/svx/source/unodraw/unoprov.cxx
@@ -39,6 +39,7 @@
 #include <com/sun/star/media/ZoomLevel.hpp>
 #include <com/sun/star/io/XInputStream.hpp>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <hash_map>
 #include <vcl/fldunit.hxx>
 #include <tools/shl.hxx>
 #include <vos/mutex.hxx>
@@ -816,7 +817,6 @@ comphelper::PropertyMapEntry* ImplGetSvxDrawingDefaultsPropertyMap()
     return aSvxDrawingDefaultsPropertyMap_Impl;
 }
 
-// OD 13.10.2003 #i18732#
 comphelper::PropertyMapEntry* ImplGetAdditionalWriterDrawingDefaultsPropertyMap()
 {
     static comphelper::PropertyMapEntry aSvxAdditionalDefaultsPropertyMap_Impl[] =
@@ -829,55 +829,110 @@ comphelper::PropertyMapEntry* ImplGetAdditionalWriterDrawingDefaultsPropertyMap(
     return aSvxAdditionalDefaultsPropertyMap_Impl;
 }
 
-// ---------------------------------------------------------------------
+/***********************************************************************
+* class UHashMap                                                       *
+***********************************************************************/
+
+typedef ::std::hash_map< rtl::OUString, sal_uInt32, rtl::OUStringHash > UHashMapImpl;
+
+namespace {
+  static const UHashMapImpl &GetUHashImpl()
+  {
+      static UHashMapImpl aImpl(63);
+      static bool bInited = false;
+      if (!bInited) {
+          struct { const char *name; sal_Int32 length; sal_uInt32 id; } aInit[] = {
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.RectangleShape"),		OBJ_RECT },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.EllipseShape"),			OBJ_CIRC },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.ControlShape"),			OBJ_UNO  },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.ConnectorShape"),		OBJ_EDGE },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.MeasureShape"),			OBJ_MEASURE },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.LineShape"),			OBJ_LINE },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.PolyPolygonShape"),		OBJ_POLY },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.PolyLineShape"),		OBJ_PLIN },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.OpenBezierShape"),		OBJ_PATHLINE },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.ClosedBezierShape"),	OBJ_PATHFILL },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.OpenFreeHandShape"),	OBJ_FREELINE },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.ClosedFreeHandShape"),	OBJ_FREEFILL },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.PolyPolygonPathShape"),	OBJ_PATHPOLY },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.PolyLinePathShape"),	OBJ_PATHPLIN },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.GraphicObjectShape"),	OBJ_GRAF },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.GroupShape"),			OBJ_GRUP },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.TextShape"),			OBJ_TEXT },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.OLE2Shape"),			OBJ_OLE2 },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.PageShape"),			OBJ_PAGE },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.CaptionShape"),			OBJ_CAPTION },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.FrameShape"),			OBJ_FRAME },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.PluginShape"),			OBJ_OLE2_PLUGIN },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.AppletShape"),			OBJ_OLE2_APPLET },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.CustomShape"),			OBJ_CUSTOMSHAPE },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.MediaShape"),			OBJ_MEDIA },
+
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DSceneObject"),	E3D_POLYSCENE_ID  | E3D_INVENTOR_FLAG },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DCubeObject"),	E3D_CUBEOBJ_ID    | E3D_INVENTOR_FLAG },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DSphereObject"),	E3D_SPHEREOBJ_ID  | E3D_INVENTOR_FLAG },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DLatheObject"),	E3D_LATHEOBJ_ID   | E3D_INVENTOR_FLAG },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DExtrudeObject"),	E3D_EXTRUDEOBJ_ID | E3D_INVENTOR_FLAG },
+              { RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DPolygonObject"),	E3D_POLYGONOBJ_ID | E3D_INVENTOR_FLAG },
+          };
+          for (sal_uInt32 i = 0; i < sizeof(aInit)/sizeof(aInit[0]); i++)
+              aImpl[rtl::OUString( aInit[i].name, aInit[i].length, RTL_TEXTENCODING_ASCII_US ) ] = aInit[i].id;
+          bInited = true;
+        }
+      return aImpl;
+  }
+}
+
+//----------------------------------------------------------------------
+rtl::OUString UHashMap::getNameFromId(sal_uInt32 nId)
+{
+    const UHashMapImpl &rMap = GetUHashImpl();
+
+    for (UHashMapImpl::const_iterator it = rMap.begin(); it != rMap.end(); it++)
+    {
+        if (it->second == nId)
+            return it->first;
+    }
+    DBG_ERROR("[CL] unknown SdrObjekt identifier");
+    return rtl::OUString();
+}
+
+uno::Sequence< OUString > UHashMap::getServiceNames()
+{
+    const UHashMapImpl &rMap = GetUHashImpl();
+
+    int i = 0;
+    uno::Sequence< OUString > aSeq( rMap.size() );
+    OUString* pStrings = aSeq.getArray();
+
+    for (UHashMapImpl::const_iterator it = rMap.begin(); it != rMap.end(); it++)
+        pStrings[i++] = it->first;
+
+    return aSeq;
+}
+
+UINT32 UHashMap::getId( const OUString& rCompareString )
+{
+    const UHashMapImpl &rMap = GetUHashImpl();
+    UHashMapImpl::const_iterator it = rMap.find( rCompareString );
+    if( it == rMap.end() )
+        return UHASHMAP_NOTFOUND;
+    else
+        return it->second;
+}
+
+
 
-SvxUnoPropertyMapProvider aSvxMapProvider;
 
 UHashMapEntry pSdrShapeIdentifierMap[] =
 {
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.RectangleShape"),		OBJ_RECT ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.EllipseShape"),			OBJ_CIRC ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.ControlShape"),			OBJ_UNO  ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.ConnectorShape"),		OBJ_EDGE ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.MeasureShape"),			OBJ_MEASURE ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.LineShape"),			OBJ_LINE ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.PolyPolygonShape"),		OBJ_POLY ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.PolyLineShape"),		OBJ_PLIN ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.OpenBezierShape"),		OBJ_PATHLINE ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.ClosedBezierShape"),	OBJ_PATHFILL ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.OpenFreeHandShape"),	OBJ_FREELINE ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.ClosedFreeHandShape"),	OBJ_FREEFILL ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.PolyPolygonPathShape"),	OBJ_PATHPOLY ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.PolyLinePathShape"),	OBJ_PATHPLIN ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.GraphicObjectShape"),	OBJ_GRAF ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.GroupShape"),			OBJ_GRUP ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.TextShape"),			OBJ_TEXT ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.OLE2Shape"),			OBJ_OLE2 ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.PageShape"),			OBJ_PAGE ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.CaptionShape"),			OBJ_CAPTION ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.FrameShape"),			OBJ_FRAME ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.PluginShape"),			OBJ_OLE2_PLUGIN ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.AppletShape"),			OBJ_OLE2_APPLET ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.CustomShape"),			OBJ_CUSTOMSHAPE ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.MediaShape"),			OBJ_MEDIA ),
-
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DSceneObject"),	E3D_POLYSCENE_ID  | E3D_INVENTOR_FLAG ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DCubeObject"),	E3D_CUBEOBJ_ID    | E3D_INVENTOR_FLAG ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DSphereObject"),	E3D_SPHEREOBJ_ID  | E3D_INVENTOR_FLAG ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DLatheObject"),	E3D_LATHEOBJ_ID   | E3D_INVENTOR_FLAG ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DExtrudeObject"),	E3D_EXTRUDEOBJ_ID | E3D_INVENTOR_FLAG ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Shape3DPolygonObject"),	E3D_POLYGONOBJ_ID | E3D_INVENTOR_FLAG ),
-    UHashMapEntry (RTL_CONSTASCII_STRINGPARAM(""),	0 )
+    { RTL_CONSTASCII_STRINGPARAM(""),	0 )
 };
 
 // ---------------------------------------------------------------------
 
 UHashMap aSdrShapeIdentifierMap( pSdrShapeIdentifierMap );
 
-/***********************************************************************
-* class UHashMap                                                       *
-***********************************************************************/
-
 UHashMap::UHashMap( UHashMapEntry* pMap )
 {
     while( pMap->aIdentifier.getLength() )
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 8b50043..0a048f9 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -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


More information about the ooo-build-commit mailing list