summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorChristian Lippka <cl@openoffice.org>2001-07-10 06:53:54 +0000
committerChristian Lippka <cl@openoffice.org>2001-07-10 06:53:54 +0000
commitc9dd9d73592a7b5ac92fb9adb563002cb500f91f (patch)
tree2098a0580cfe9d3276025b5544eb23be70d8d611 /svx/source
parent03f4310740a9eeee2b42704b9202aba4ea51b511 (diff)
#89061# optimized api for xml
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/unodraw/shapeimpl.hxx6
-rw-r--r--svx/source/unodraw/unopage.cxx12
-rw-r--r--svx/source/unodraw/unoshap2.cxx91
-rw-r--r--svx/source/unodraw/unoshap3.cxx16
-rw-r--r--svx/source/unodraw/unoshape.cxx560
5 files changed, 404 insertions, 281 deletions
diff --git a/svx/source/unodraw/shapeimpl.hxx b/svx/source/unodraw/shapeimpl.hxx
index a18d31f48a51..30ba1a4edc10 100644
--- a/svx/source/unodraw/shapeimpl.hxx
+++ b/svx/source/unodraw/shapeimpl.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: shapeimpl.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: cl $ $Date: 2001-05-07 14:25:20 $
+ * last change: $Author: cl $ $Date: 2001-07-10 07:49:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -69,7 +69,7 @@ class SvGlobalName;
* *
***********************************************************************/
-class SvxShapeCaption : public SvxShape
+class SvxShapeCaption : public SvxShapeText
{
public:
SvxShapeCaption( SdrObject* pObj ) throw();
diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx
index 1f32d13eacd5..821600ebca84 100644
--- a/svx/source/unodraw/unopage.cxx
+++ b/svx/source/unodraw/unopage.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unopage.cxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: aw $ $Date: 2001-06-12 13:20:39 $
+ * last change: $Author: cl $ $Date: 2001-07-10 07:49:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -239,10 +239,6 @@ void SAL_CALL SvxDrawPage::add( const Reference< drawing::XShape >& xShape )
pObj->SetModel(pModel);
pPage->InsertObject( pObj );
}
- else
- {
- return;
- }
if(pObj == NULL)
return;
@@ -652,7 +648,7 @@ SvxShape* SvxDrawPage::CreateShapeByTypeAndInventor( sal_uInt16 nType, sal_uInt3
pRet = new SvxShapeCaption( pObj );
break;
case OBJ_TEXT:
- pRet = new SvxShape( pObj );
+ pRet = new SvxShapeText( pObj );
break;
case OBJ_GRAF:
pRet = new SvxGraphicObject( pObj );
@@ -731,7 +727,7 @@ SvxShape* SvxDrawPage::CreateShapeByTypeAndInventor( sal_uInt16 nType, sal_uInt3
break;
default: // unbekanntes 2D-Objekt auf der Page
DBG_ERROR("Nicht implementierter Starone-Shape erzeugt! [CL]");
- pRet = new SvxShape( pObj );
+ pRet = new SvxShapeText( pObj );
break;
}
break;
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index 8a10bab6d443..1c1b0a9a66a0 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unoshap2.cxx,v $
*
- * $Revision: 1.31 $
+ * $Revision: 1.32 $
*
- * last change: $Author: fs $ $Date: 2001-06-07 12:21:39 $
+ * last change: $Author: cl $ $Date: 2001-07-10 07:49:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -165,9 +165,10 @@ void SvxShapeGroup::Create( SdrObject* pNewObj, SvxDrawPage* pNewPage ) throw()
}
//----------------------------------------------------------------------
-uno::Any SAL_CALL SvxShapeGroup::queryInterface( const uno::Type & rType ) throw(uno::RuntimeException)
+uno::Any SAL_CALL SvxShapeGroup::queryInterface( const uno::Type & rType )
+ throw(uno::RuntimeException)
{
- return OWeakAggObject::queryInterface( rType );
+ return SvxShape::queryInterface( rType );
}
uno::Any SAL_CALL SvxShapeGroup::queryAggregation( const uno::Type & rType )
@@ -187,12 +188,12 @@ uno::Any SAL_CALL SvxShapeGroup::queryAggregation( const uno::Type & rType )
void SAL_CALL SvxShapeGroup::acquire() throw(uno::RuntimeException)
{
- OWeakAggObject::acquire();
+ SvxShape::acquire();
}
void SAL_CALL SvxShapeGroup::release() throw(uno::RuntimeException)
{
- OWeakAggObject::release();
+ SvxShape::release();
}
uno::Sequence< uno::Type > SAL_CALL SvxShapeGroup::getTypes()
@@ -433,7 +434,7 @@ uno::Sequence< OUString > SAL_CALL SvxShapeGroup::getSupportedServiceNames()
uno::Sequence< uno::Type > SvxShapeConnector::maTypeSequence;
SvxShapeConnector::SvxShapeConnector( SdrObject* pObj ) throw() :
- SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_CONNECTOR) )
+ SvxShapeText( pObj, aSvxMapProvider.GetMap(SVXMAP_CONNECTOR) )
{
}
@@ -443,9 +444,11 @@ SvxShapeConnector::~SvxShapeConnector() throw()
}
//----------------------------------------------------------------------
-uno::Any SAL_CALL SvxShapeConnector::queryInterface( const uno::Type & rType ) throw(uno::RuntimeException)
+
+uno::Any SAL_CALL SvxShapeConnector::queryInterface( const uno::Type & rType )
+ throw(uno::RuntimeException)
{
- return OWeakAggObject::queryInterface( rType );
+ return SvxShapeText::queryInterface( rType );
}
uno::Any SAL_CALL SvxShapeConnector::queryAggregation( const uno::Type & rType )
@@ -455,19 +458,19 @@ uno::Any SAL_CALL SvxShapeConnector::queryAggregation( const uno::Type & rType )
QUERYINT( drawing::XConnectorShape );
else
- return SvxShape::queryAggregation( rType );
+ return SvxShapeText::queryAggregation( rType );
return aAny;
}
void SAL_CALL SvxShapeConnector::acquire() throw(uno::RuntimeException)
{
- OWeakAggObject::acquire();
+ SvxShapeText::acquire();
}
void SAL_CALL SvxShapeConnector::release() throw(uno::RuntimeException)
{
- OWeakAggObject::release();
+ SvxShapeText::release();
}
// XTypeProvider
@@ -476,7 +479,7 @@ uno::Sequence< uno::Type > SAL_CALL SvxShapeConnector::getTypes()
{
if( maTypeSequence.getLength() == 0 )
{
- const uno::Sequence< uno::Type > aBaseTypes( SvxShape::getTypes() );
+ const uno::Sequence< uno::Type > aBaseTypes( SvxShapeText::getTypes() );
const uno::Type* pBaseTypes = aBaseTypes.getConstArray();
const sal_Int32 nBaseTypes = aBaseTypes.getLength();
const sal_Int32 nOwnTypes = 1; // !DANGER! Keep this updated!
@@ -510,33 +513,33 @@ uno::Sequence< sal_Int8 > SAL_CALL SvxShapeConnector::getImplementationId()
OUString SAL_CALL SvxShapeConnector::getShapeType()
throw( uno::RuntimeException )
{
- return SvxShape::getShapeType();
+ return SvxShapeText::getShapeType();
}
//------------------------------------------------------------------1----
awt::Point SAL_CALL SvxShapeConnector::getPosition() throw(uno::RuntimeException)
{
- return SvxShape::getPosition();
+ return SvxShapeText::getPosition();
}
//----------------------------------------------------------------------
void SAL_CALL SvxShapeConnector::setPosition( const awt::Point& Position ) throw(uno::RuntimeException)
{
- SvxShape::setPosition(aPosition);
+ SvxShapeText::setPosition(aPosition);
}
//----------------------------------------------------------------------
awt::Size SAL_CALL SvxShapeConnector::getSize() throw(uno::RuntimeException)
{
- return SvxShape::getSize();
+ return SvxShapeText::getSize();
}
//----------------------------------------------------------------------
void SAL_CALL SvxShapeConnector::setSize( const awt::Size& rSize )
throw(beans::PropertyVetoException, uno::RuntimeException)
{
- SvxShape::setSize( rSize );
+ SvxShapeText::setSize( rSize );
}
//----------------------------------------------------------------------
@@ -604,7 +607,7 @@ void SAL_CALL SvxShapeConnector::disconnectEnd( const uno::Reference< drawing::X
//----------------------------------------------------------------------
uno::Sequence< OUString > SAL_CALL SvxShapeConnector::getSupportedServiceNames() throw( uno::RuntimeException )
{
- return SvxShape::getSupportedServiceNames();
+ return SvxShapeText::getSupportedServiceNames();
}
/***********************************************************************
@@ -614,7 +617,7 @@ uno::Sequence< OUString > SAL_CALL SvxShapeConnector::getSupportedServiceNames()
uno::Sequence< uno::Type > SvxShapeControl::maTypeSequence;
SvxShapeControl::SvxShapeControl( SdrObject* pObj ) throw() :
- SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_CONTROL) )
+ SvxShapeText( pObj, aSvxMapProvider.GetMap(SVXMAP_CONTROL) )
{
}
@@ -624,9 +627,10 @@ SvxShapeControl::~SvxShapeControl() throw()
}
//----------------------------------------------------------------------
-uno::Any SAL_CALL SvxShapeControl::queryInterface( const uno::Type & rType ) throw(uno::RuntimeException)
+uno::Any SAL_CALL SvxShapeControl::queryInterface( const uno::Type & rType )
+ throw(uno::RuntimeException)
{
- return OWeakAggObject::queryInterface( rType );
+ return SvxShapeText::queryInterface( rType );
}
uno::Any SAL_CALL SvxShapeControl::queryAggregation( const uno::Type & rType )
@@ -636,19 +640,19 @@ uno::Any SAL_CALL SvxShapeControl::queryAggregation( const uno::Type & rType )
QUERYINT( drawing::XControlShape );
else
- return SvxShape::queryAggregation( rType );
+ return SvxShapeText::queryAggregation( rType );
return aAny;
}
void SAL_CALL SvxShapeControl::acquire() throw(uno::RuntimeException)
{
- OWeakAggObject::acquire();
+ SvxShapeText::acquire();
}
void SAL_CALL SvxShapeControl::release() throw(uno::RuntimeException)
{
- OWeakAggObject::release();
+ SvxShapeText::release();
}
// XTypeProvider
@@ -657,7 +661,7 @@ uno::Sequence< uno::Type > SAL_CALL SvxShapeControl::getTypes()
{
if( maTypeSequence.getLength() == 0 )
{
- const uno::Sequence< uno::Type > aBaseTypes( SvxShape::getTypes() );
+ const uno::Sequence< uno::Type > aBaseTypes( SvxShapeText::getTypes() );
const uno::Type* pBaseTypes = aBaseTypes.getConstArray();
const sal_Int32 nBaseTypes = aBaseTypes.getLength();
const sal_Int32 nOwnTypes = 1; // !DANGER! Keep this updated!
@@ -691,33 +695,33 @@ uno::Sequence< sal_Int8 > SAL_CALL SvxShapeControl::getImplementationId()
OUString SAL_CALL SvxShapeControl::getShapeType()
throw( uno::RuntimeException )
{
- return SvxShape::getShapeType();
+ return SvxShapeText::getShapeType();
}
//------------------------------------------------------------------1----
awt::Point SAL_CALL SvxShapeControl::getPosition() throw(uno::RuntimeException)
{
- return SvxShape::getPosition();
+ return SvxShapeText::getPosition();
}
//----------------------------------------------------------------------
void SAL_CALL SvxShapeControl::setPosition( const awt::Point& Position ) throw(uno::RuntimeException)
{
- SvxShape::setPosition(Position);
+ SvxShapeText::setPosition(Position);
}
//----------------------------------------------------------------------
awt::Size SAL_CALL SvxShapeControl::getSize() throw(uno::RuntimeException)
{
- return SvxShape::getSize();
+ return SvxShapeText::getSize();
}
//----------------------------------------------------------------------
void SAL_CALL SvxShapeControl::setSize( const awt::Size& rSize )
throw(beans::PropertyVetoException, uno::RuntimeException)
{
- SvxShape::setSize( rSize );
+ SvxShapeText::setSize( rSize );
}
//----------------------------------------------------------------------
@@ -754,7 +758,7 @@ void SAL_CALL SvxShapeControl::setControl( const Reference< awt::XControlModel >
// XServiceInfo
uno::Sequence< OUString > SAL_CALL SvxShapeControl::getSupportedServiceNames() throw( uno::RuntimeException )
{
- return SvxShape::getSupportedServiceNames();
+ return SvxShapeText::getSupportedServiceNames();
}
static struct
@@ -975,7 +979,7 @@ uno::Any SAL_CALL SvxShapeControl::getPropertyDefault( const ::rtl::OUString& aP
//----------------------------------------------------------------------
SvxShapeDimensioning::SvxShapeDimensioning( SdrObject* pObj ) throw()
-: SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_DIMENSIONING) )
+: SvxShapeText( pObj, aSvxMapProvider.GetMap(SVXMAP_DIMENSIONING) )
{
}
@@ -987,7 +991,7 @@ SvxShapeDimensioning::~SvxShapeDimensioning() throw()
// ::com::sun::star::lang::XServiceInfo
uno::Sequence< OUString > SAL_CALL SvxShapeDimensioning::getSupportedServiceNames() throw( uno::RuntimeException )
{
- return SvxShape::getSupportedServiceNames();
+ return SvxShapeText::getSupportedServiceNames();
}
/***********************************************************************
@@ -996,7 +1000,7 @@ uno::Sequence< OUString > SAL_CALL SvxShapeDimensioning::getSupportedServiceName
//----------------------------------------------------------------------
SvxShapeCircle::SvxShapeCircle( SdrObject* pObj ) throw()
-: SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_CIRCLE) )
+: SvxShapeText( pObj, aSvxMapProvider.GetMap(SVXMAP_CIRCLE) )
{
}
@@ -1009,7 +1013,7 @@ SvxShapeCircle::~SvxShapeCircle() throw()
// XServiceInfo
uno::Sequence< OUString > SAL_CALL SvxShapeCircle::getSupportedServiceNames() throw( uno::RuntimeException )
{
- return SvxShape::getSupportedServiceNames();
+ return SvxShapeText::getSupportedServiceNames();
}
/***********************************************************************
@@ -1020,7 +1024,8 @@ uno::Sequence< OUString > SAL_CALL SvxShapeCircle::getSupportedServiceNames() th
//----------------------------------------------------------------------
SvxShapePolyPolygon::SvxShapePolyPolygon( SdrObject* pObj , drawing::PolygonKind eNew )
- throw( com::sun::star::beans::PropertyVetoException, com::sun::star::lang::IllegalArgumentException) : SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_POLYPOLYGON) ),
+ throw( com::sun::star::beans::PropertyVetoException, com::sun::star::lang::IllegalArgumentException)
+: SvxShapeText( pObj, aSvxMapProvider.GetMap(SVXMAP_POLYPOLYGON) ),
ePolygonKind( eNew )
{
}
@@ -1262,7 +1267,7 @@ const XPolyPolygon& SvxShapePolyPolygon::GetPolygon() const throw()
// ::com::sun::star::lang::XServiceInfo
uno::Sequence< OUString > SAL_CALL SvxShapePolyPolygon::getSupportedServiceNames() throw( uno::RuntimeException )
{
- return SvxShape::getSupportedServiceNames();
+ return SvxShapeText::getSupportedServiceNames();
}
/***********************************************************************
@@ -1277,7 +1282,7 @@ uno::Sequence< OUString > SAL_CALL SvxShapePolyPolygon::getSupportedServiceNames
#endif
//----------------------------------------------------------------------
SvxShapePolyPolygonBezier::SvxShapePolyPolygonBezier( SdrObject* pObj , drawing::PolygonKind eNew ) throw()
-: SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_POLYPOLYGONBEZIER) ),
+: SvxShapeText( pObj, aSvxMapProvider.GetMap(SVXMAP_POLYPOLYGONBEZIER) ),
ePolygonKind( eNew )
{
}
@@ -1545,7 +1550,7 @@ const XPolyPolygon& SvxShapePolyPolygonBezier::GetPolygon() const throw()
// ::com::sun::star::lang::XServiceInfo
uno::Sequence< OUString > SAL_CALL SvxShapePolyPolygonBezier::getSupportedServiceNames() throw( uno::RuntimeException )
{
- return SvxShape::getSupportedServiceNames();
+ return SvxShapeText::getSupportedServiceNames();
}
/***********************************************************************
@@ -1577,7 +1582,7 @@ uno::Sequence< OUString > SAL_CALL SvxShapePolyPolygonBezier::getSupportedServic
//----------------------------------------------------------------------
SvxGraphicObject::SvxGraphicObject( SdrObject* pObj ) throw()
-: SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_GRAPHICOBJECT) )
+: SvxShapeText( pObj, aSvxMapProvider.GetMap(SVXMAP_GRAPHICOBJECT) )
{
}
@@ -1760,7 +1765,7 @@ uno::Any SAL_CALL SvxGraphicObject::getPropertyValue( const OUString& aPropertyN
uno::Sequence< OUString > SAL_CALL SvxGraphicObject::getSupportedServiceNames()
throw( uno::RuntimeException )
{
- return SvxShape::getSupportedServiceNames();
+ return SvxShapeText::getSupportedServiceNames();
}
@@ -1820,7 +1825,7 @@ void SvxConvertXPolygonToPolyPolygonBezier( const XPolygon& rPolygon, drawing::P
///////////////////////////////////////////////////////////////////////
SvxShapeCaption::SvxShapeCaption( SdrObject* pObj ) throw()
-: SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_CAPTION) )
+: SvxShapeText( pObj, aSvxMapProvider.GetMap(SVXMAP_CAPTION) )
{
}
diff --git a/svx/source/unodraw/unoshap3.cxx b/svx/source/unodraw/unoshap3.cxx
index 1e20cab5968e..84fac03b957c 100644
--- a/svx/source/unodraw/unoshap3.cxx
+++ b/svx/source/unodraw/unoshap3.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unoshap3.cxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: aw $ $Date: 2001-05-04 13:31:52 $
+ * last change: $Author: cl $ $Date: 2001-07-10 07:49:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -533,7 +533,7 @@ uno::Sequence< OUString > SAL_CALL Svx3DSceneObject::getSupportedServiceNames()
throw(uno::RuntimeException)
{
uno::Sequence< OUString > aSeq( SvxShape::getSupportedServiceNames() );
- addToSequence( aSeq, 1, "com.sun.star.drawing.Shape3DScene" );
+ SvxServiceInfoHelper::addToSequence( aSeq, 1, "com.sun.star.drawing.Shape3DScene" );
return aSeq;
}
@@ -650,7 +650,7 @@ uno::Sequence< OUString > SAL_CALL Svx3DCubeObject::getSupportedServiceNames()
throw(uno::RuntimeException)
{
uno::Sequence< OUString > aSeq( SvxShape::getSupportedServiceNames() );
- addToSequence( aSeq, 2, "com.sun.star.drawing.Shape3D",
+ SvxServiceInfoHelper::addToSequence( aSeq, 2, "com.sun.star.drawing.Shape3D",
"com.sun.star.drawing.Shape3DCube");
return aSeq;
}
@@ -753,7 +753,7 @@ uno::Sequence< OUString > SAL_CALL Svx3DSphereObject::getSupportedServiceNames()
throw(uno::RuntimeException)
{
uno::Sequence< OUString > aSeq( SvxShape::getSupportedServiceNames() );
- addToSequence( aSeq, 2, "com.sun.star.drawing.Shape3D",
+ SvxServiceInfoHelper::addToSequence( aSeq, 2, "com.sun.star.drawing.Shape3D",
"com.sun.star.drawing.Shape3DSphere");
return aSeq;
}
@@ -948,7 +948,7 @@ uno::Sequence< OUString > SAL_CALL Svx3DLatheObject::getSupportedServiceNames()
throw(uno::RuntimeException)
{
uno::Sequence< OUString > aSeq( SvxShape::getSupportedServiceNames() );
- addToSequence( aSeq, 2, "com.sun.star.drawing.Shape3D",
+ SvxServiceInfoHelper::addToSequence( aSeq, 2, "com.sun.star.drawing.Shape3D",
"com.sun.star.drawing.Shape3DLathe");
return aSeq;
}
@@ -1061,7 +1061,7 @@ uno::Sequence< OUString > SAL_CALL Svx3DExtrudeObject::getSupportedServiceNames(
throw(uno::RuntimeException)
{
uno::Sequence< OUString > aSeq( SvxShape::getSupportedServiceNames() );
- addToSequence( aSeq, 2, "com.sun.star.drawing.Shape3D",
+ SvxServiceInfoHelper::addToSequence( aSeq, 2, "com.sun.star.drawing.Shape3D",
"com.sun.star.drawing.Shape3DExtrude");
return aSeq;
}
@@ -1180,7 +1180,7 @@ uno::Sequence< OUString > SAL_CALL Svx3DPolygonObject::getSupportedServiceNames(
throw(uno::RuntimeException)
{
Sequence< OUString > aSeq( SvxShape::getSupportedServiceNames() );
- addToSequence( aSeq, 2, "com.sun.star.drawing.Shape3D",
+ SvxServiceInfoHelper::addToSequence( aSeq, 2, "com.sun.star.drawing.Shape3D",
"com.sun.star.drawing.Shape3DPolygon");
return aSeq;
}
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index b0dce1f39876..fffec7986d6f 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unoshape.cxx,v $
*
- * $Revision: 1.56 $
+ * $Revision: 1.57 $
*
- * last change: $Author: aw $ $Date: 2001-06-25 10:39:12 $
+ * last change: $Author: cl $ $Date: 2001-07-10 07:49:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -274,7 +274,7 @@ SvxShape::SvxShape( SdrObject* pObject ) throw()
bDisposing( sal_False ),
pModel(NULL),
aSize(100,100),
- aDisposeListeners( aDisposeContainerMutex )
+ aDisposeListeners( maMutex )
{
Init();
}
@@ -286,7 +286,7 @@ SvxShape::SvxShape( SdrObject* pObject, const SfxItemPropertyMap* pPropertyMap )
pObj (pObject),
pModel(NULL),
aSize(100,100),
- aDisposeListeners( aDisposeContainerMutex )
+ aDisposeListeners( maMutex )
{
Init();
@@ -299,7 +299,7 @@ SvxShape::SvxShape() throw()
pObj (NULL),
pModel(NULL),
aSize(100,100),
- aDisposeListeners( aDisposeContainerMutex )
+ aDisposeListeners( maMutex )
{
Init();
@@ -308,16 +308,10 @@ SvxShape::SvxShape() throw()
//----------------------------------------------------------------------
SvxShape::~SvxShape() throw()
{
- if (xTextAgg.is())
- xTextAgg->setDelegator( Reference< uno::XInterface >() );
-
- xTextAgg = NULL;
+ OGuard aGuard( Application::GetSolarMutex() );
if( pModel )
EndListening( *pModel );
-
-
- OGuard aGuard( Application::GetSolarMutex() );
}
//----------------------------------------------------------------------
@@ -350,27 +344,14 @@ SvxShape* SvxShape::getImplementation( uno::Reference< uno::XInterface > xInt )
//----------------------------------------------------------------------
sal_Int64 SAL_CALL SvxShape::getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw(::com::sun::star::uno::RuntimeException) \
{
- if( rId.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
- rId.getConstArray(), 16 ) )
+ if( rId.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) )
{
return (sal_Int64)this;
}
else
{
- if( !xTextAgg.is() )
- queryAggregation( ::getCppuType((const Reference< text::XText >*)0));
-
- if( xTextAgg.is() )
- {
- uno::Any aAny( xTextAgg->queryAggregation( ::getCppuType((const Reference< lang::XUnoTunnel >*)0) ) );
- uno::Reference< lang::XUnoTunnel > xUT;
- aAny >>= xUT;
- if( xUT.is() )
- return xUT->getSomething(rId );
- }
+ return NULL;
}
-
- return NULL;
}
//----------------------------------------------------------------------
@@ -382,9 +363,13 @@ SvxShape* SvxShape::GetShapeForSdrObj( SdrObject* pObj ) throw()
//----------------------------------------------------------------------
void SvxShape::Init() throw()
{
- if(pObj == NULL) // ab hier nur nocht mit Objekt
+ // only init if we already have an object
+ // if we get an object later Init() will
+ // be called again
+ if(pObj == NULL)
return;
+ // no model? this should not be
if(!pObj->GetModel())
return;
@@ -394,15 +379,16 @@ void SvxShape::Init() throw()
const sal_uInt32 nInventor = pObj->GetObjInventor();
- if( nInventor == SdrInventor ||
- nInventor == E3dInventor ||
- nInventor == FmFormInventor )
+ // is it one of ours (svx) ?
+ if( nInventor == SdrInventor || nInventor == E3dInventor || nInventor == FmFormInventor )
{
UHashMapEntry* pMap = pSdrShapeIdentifierMap;
sal_uInt32 nObjId;
if(nInventor == FmFormInventor)
+ {
nObjId = OBJ_UNO;
+ }
else
{
nObjId = pObj->GetObjIdentifier();
@@ -442,27 +428,30 @@ void SvxShape::Init() throw()
//----------------------------------------------------------------------
void SvxShape::Create( SdrObject* pNewObj, SvxDrawPage* pNewPage ) throw()
{
- DBG_ASSERT( !pObj || pObj == pNewObj, "SvxShape::Create was called twice!" );
+ if( pObj != pNewObj )
+ {
+ pObj = pNewObj;
- pObj = pNewObj;
+ Init();
- Init();
+ ObtainSettingsFromPropertySet( aPropSet );
- ObtainSettingsFromPropertySet( aPropSet );
+ // save user call
+ SdrObjUserCall* pUser = pObj->GetUserCall();
+ pObj->SetUserCall(NULL);
- // save user call
- SdrObjUserCall* pUser = pObj->GetUserCall();
- pObj->SetUserCall(NULL);
+ setPosition( aPosition );
+ setSize( aSize );
- setPosition( aPosition );
- setSize( aSize );
+ // restore user call after we set the initial size
+ pObj->SetUserCall( pUser );
- pObj->SetUserCall( pUser );
-
- if( aShapeName.getLength() )
- {
- pObj->SetName( aShapeName );
- aShapeName = OUString();
+ // if this shape was already named, use this name
+ if( aShapeName.getLength() )
+ {
+ pObj->SetName( aShapeName );
+ aShapeName = OUString();
+ }
}
}
@@ -522,23 +511,16 @@ void SvxShape::ObtainSettingsFromPropertySet(SvxItemPropertySet& rPropSet) throw
{
if(pObj && rPropSet.AreThereOwnUsrAnys())
{
- SfxItemSet aSet( pModel->GetItemPool(),
- SDRATTR_START, SDRATTR_END,
-//-/ SID_ATTR_3D_START, SID_ATTR_3D_END,
- 0);
-
+ SfxItemSet aSet( pModel->GetItemPool(), SDRATTR_START, SDRATTR_END, 0);
Reference< beans::XPropertySet > xShape( (OWeakObject*)this, UNO_QUERY );
aPropSet.ObtainSettingsFromPropertySet(rPropSet, aSet, xShape);
-
-//-/ pObj->SetAttributes( aSet, sal_False );
-//-/ SdrBroadcastItemChange aItemChange(*pObj);
pObj->SetItemSetAndBroadcast(aSet);
-//-/ pObj->BroadcastItemChange(aItemChange);
-
pObj->ApplyNotPersistAttr( aSet );
}
}
+//----------------------------------------------------------------------
+
uno::Any SvxShape::GetBitmap( sal_Bool bMetaFile /* = sal_False */ ) const throw()
{
uno::Any aAny;
@@ -586,84 +568,7 @@ uno::Any SvxShape::GetBitmap( sal_Bool bMetaFile /* = sal_False */ ) const throw
return aAny;
}
-// UserAggObject
-
//----------------------------------------------------------------------
-uno::Any SAL_CALL SvxShape::queryInterface( const uno::Type & rType ) throw(uno::RuntimeException)
-{
- return OWeakAggObject::queryInterface( rType );
-}
-
-uno::Any SAL_CALL SvxShape::queryAggregation( const uno::Type & rType ) throw(uno::RuntimeException)
-{
- uno::Any aAny;
-
- if( rType == ::getCppuType((const Reference< beans::XPropertySet >*)0))
- aAny <<= Reference< beans::XPropertySet >(this);
- else if( rType == ::getCppuType((const Reference< drawing::XShape >*)0))
- aAny <<= Reference< drawing::XShape >(this);
- else if( rType == ::getCppuType((const Reference< lang::XComponent >*)0))
- aAny <<= Reference< lang::XComponent>(this);
- else if( rType == ::getCppuType((const Reference< drawing::XShapeDescriptor >*)0))
- aAny <<= Reference< drawing::XShapeDescriptor>(this);
- else if( rType == ::getCppuType((const Reference< beans::XPropertyState >*)0))
- aAny <<= Reference<beans::XPropertyState>(this);
- else if( rType == ::getCppuType((const Reference< lang::XTypeProvider >*)0))
- aAny <<= Reference<lang::XTypeProvider>(this);
- else if( rType == ::getCppuType((const Reference< XServiceInfo >*)0))
- aAny <<= Reference<XServiceInfo>(this);
- else if( rType == ::getCppuType((const Reference< XUnoTunnel >*)0))
- aAny <<= Reference<XUnoTunnel>(this);
- else if( rType == ::getCppuType((const Reference< drawing::XGluePointsSupplier >*)0))
- aAny <<= Reference<drawing::XGluePointsSupplier>(this);
- else if( rType == ::getCppuType((const Reference< container::XChild >*)0))
- aAny <<= Reference<container::XChild >(this);
- else if( rType == ::getCppuType((const Reference< container::XNamed >*)0))
- aAny <<= Reference<container::XNamed>(this);
- else
- aAny <<= OWeakAggObject::queryAggregation( rType );
-
- if( !aAny.hasValue() && pObj && pObj->GetModel() )
- {
- if( !xTextAgg.is() )
- {
- SvxTextEditSource aSvxTextEditSource( pObj );
-
- {
- Reference< ::com::sun::star::text::XText > xTextParent;
- Reference< ::com::sun::star::text::XText > xText =
- new SvxUnoText( &aSvxTextEditSource, ImplGetSvxUnoOutlinerTextCursorPropertyMap(), xTextParent );
- if(xText.is())
- {
- Reference< uno::XAggregation > xAgg( xText, UNO_QUERY );
- xTextAgg = xAgg;
- }
- }
-
- if(xTextAgg.is())
- {
- Reference< uno::XInterface > xDelegator( (OWeakObject*)this, UNO_QUERY );
- xTextAgg->setDelegator(xDelegator);
- }
- else
- return uno::Any();
- }
-
- aAny <<= xTextAgg->queryAggregation( rType );
- }
-
- return aAny;
-}
-
-void SAL_CALL SvxShape::acquire() throw(uno::RuntimeException)
-{
- OWeakAggObject::acquire();
-}
-
-void SAL_CALL SvxShape::release() throw(uno::RuntimeException)
-{
- OWeakAggObject::release();
-}
void SvxShape::addStaticTypes( sal_Int16 nNewTypes, /* uno::Type* */ ... ) throw()
{
@@ -680,44 +585,59 @@ void SvxShape::addStaticTypes( sal_Int16 nNewTypes, /* uno::Type* */ ... ) throw
va_end( marker );
}
+//----------------------------------------------------------------------
+
uno::Sequence< uno::Type > SAL_CALL SvxShape::getTypes()
throw (uno::RuntimeException)
{
if( maTypeSequence.getLength() == 0 )
{
- const uno::Sequence< uno::Type > aBaseTypes( SvxUnoText::getStaticTypes() );
- const uno::Type* pBaseTypes = aBaseTypes.getConstArray();
- const sal_Int32 nBaseTypes = aBaseTypes.getLength();
- const sal_Int32 nOwnTypes = 8; // !DANGER! Keep this updated!
-
- maTypeSequence.realloc( nBaseTypes + nOwnTypes );
- uno::Type* pTypes = maTypeSequence.getArray();
-
- *pTypes++ = ::getCppuType((const uno::Reference< drawing::XShape >*)0);
- *pTypes++ = ::getCppuType((const uno::Reference< lang::XComponent >*)0);
- *pTypes++ = ::getCppuType((const uno::Reference< beans::XPropertySet >*)0);
- *pTypes++ = ::getCppuType((const uno::Reference< beans::XPropertyState >*)0);
- *pTypes++ = ::getCppuType((const uno::Reference< drawing::XGluePointsSupplier >*)0);
- *pTypes++ = ::getCppuType((const uno::Reference< container::XChild >*)0);
- *pTypes++ = ::getCppuType((const uno::Reference< lang::XServiceInfo >*)0);
- *pTypes++ = ::getCppuType((const uno::Reference< container::XNamed >*)0);
-
- for( sal_Int32 nType = 0; nType < nBaseTypes; nType++ )
- *pTypes++ = *pBaseTypes++;
+ // Ready for multithreading; get global mutex for first call of this method only! see before
+ MutexGuard aGuard( osl::Mutex::getGlobalMutex() ) ;
+
+ // Control these pointer again ... it can be, that another instance will be faster then these!
+ if( maTypeSequence.getLength() == 0 )
+ {
+ static ::cppu::OTypeCollection aSvxShapeTypeCollection(
+ ::getCppuType((const uno::Reference< drawing::XShape >*)0),
+ ::getCppuType((const uno::Reference< lang::XComponent >*)0),
+ ::getCppuType((const uno::Reference< beans::XPropertySet >*)0),
+ ::getCppuType((const uno::Reference< beans::XMultiPropertySet >*)0),
+ ::getCppuType((const uno::Reference< beans::XPropertyState >*)0),
+ ::getCppuType((const uno::Reference< drawing::XGluePointsSupplier >*)0),
+ ::getCppuType((const uno::Reference< container::XChild >*)0),
+ ::getCppuType((const uno::Reference< lang::XServiceInfo >*)0),
+ ::getCppuType((const uno::Reference< container::XNamed >*)0) );
+
+ maTypeSequence = aSvxShapeTypeCollection.getTypes();
+ }
}
return maTypeSequence;
}
+//----------------------------------------------------------------------
+
uno::Sequence< sal_Int8 > SAL_CALL SvxShape::getImplementationId()
throw (uno::RuntimeException)
{
- static uno::Sequence< sal_Int8 > aId;
- if( aId.getLength() == 0 )
+ static ::cppu::OImplementationId* pID = NULL ;
+
+ if ( pID == NULL )
{
- aId.realloc( 16 );
- rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True );
+ // Ready for multithreading; get global mutex for first call of this method only! see before
+ MutexGuard aGuard( osl::Mutex::getGlobalMutex() ) ;
+
+ // Control these pointer again ... it can be, that another instance will be faster then these!
+ if ( pID == NULL )
+ {
+ // Create a new static ID ...
+ static ::cppu::OImplementationId aID( sal_False ) ;
+ // ... and set his address to static pointer!
+ pID = &aID ;
+ }
}
- return aId;
+
+ return pID->getImplementationId() ;
}
//----------------------------------------------------------------------
@@ -825,8 +745,7 @@ awt::Point SAL_CALL SvxShape::getPosition() throw(uno::RuntimeException)
Rectangle aRect( getLogicRectHack(pObj) );
Point aPt( aRect.Left(), aRect.Top() );
- // Position ist relativ zum Anker, in absolute Position
- // umrechnen
+ // Position is relativ to anchor, so recalc to absolut position
aPt -= pObj->GetAnchorPos();
ForceMetricTo100th_mm(aPt);
@@ -912,6 +831,7 @@ void SAL_CALL SvxShape::setSize( const awt::Size& rSize )
aSize = rSize;
}
+//----------------------------------------------------------------------
// XNamed
OUString SAL_CALL SvxShape::getName( ) throw(::com::sun::star::uno::RuntimeException)
@@ -926,6 +846,8 @@ OUString SAL_CALL SvxShape::getName( ) throw(::com::sun::star::uno::RuntimeExce
}
}
+//----------------------------------------------------------------------
+
void SAL_CALL SvxShape::setName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException)
{
if( pObj )
@@ -981,6 +903,7 @@ void SAL_CALL SvxShape::dispose() throw(uno::RuntimeException)
}
//----------------------------------------------------------------------
+
void SAL_CALL SvxShape::addEventListener( const Reference< lang::XEventListener >& xListener )
throw(uno::RuntimeException)
{
@@ -988,6 +911,7 @@ void SAL_CALL SvxShape::addEventListener( const Reference< lang::XEventListener
}
//----------------------------------------------------------------------
+
void SAL_CALL SvxShape::removeEventListener( const Reference< lang::XEventListener >& aListener ) throw(uno::RuntimeException)
{
aDisposeListeners.removeInterface(aListener);
@@ -996,6 +920,7 @@ void SAL_CALL SvxShape::removeEventListener( const Reference< lang::XEventListen
// XPropertySet
//----------------------------------------------------------------------
+
Reference< beans::XPropertySetInfo > SAL_CALL
SvxShape::getPropertySetInfo() throw(uno::RuntimeException)
{
@@ -1009,6 +934,8 @@ void SAL_CALL SvxShape::removePropertyChangeListener( const OUString& aPropertyN
void SAL_CALL SvxShape::addVetoableChangeListener( const OUString& PropertyName, const Reference< beans::XVetoableChangeListener >& aListener ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) {}
void SAL_CALL SvxShape::removeVetoableChangeListener( const OUString& PropertyName, const Reference< beans::XVetoableChangeListener >& aListener ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) {}
+//----------------------------------------------------------------------
+
sal_Bool SAL_CALL SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rName )
{
SfxItemSet aSet( pModel->GetItemPool(), (USHORT)nWID, (USHORT)nWID );
@@ -1024,6 +951,8 @@ sal_Bool SAL_CALL SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rN
}
}
+//----------------------------------------------------------------------
+
sal_Bool SAL_CALL SvxShape::SetFillAttribute( sal_Int32 nWID, const ::rtl::OUString& rName, SfxItemSet& rSet, SdrModel* pModel )
{
// check if an item with the given name and which id is inside the models
@@ -1134,6 +1063,8 @@ sal_Bool SAL_CALL SvxShape::SetFillAttribute( sal_Int32 nWID, const ::rtl::OUStr
return sal_True;
}
+//----------------------------------------------------------------------
+
sal_Bool SAL_CALL SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rName, SfxItemSet& rSet )
{
String aName;
@@ -1189,12 +1120,9 @@ sal_Bool SAL_CALL SvxShape::SetFillAttribute( sal_Int32 nWID, const OUString& rN
}
//----------------------------------------------------------------------
+
void SAL_CALL SvxShape::setPropertyValue( const OUString& rPropertyName, const uno::Any& rVal )
- throw(beans::UnknownPropertyException,
- beans::PropertyVetoException,
- lang::IllegalArgumentException,
- lang::WrappedTargetException,
- uno::RuntimeException)
+ throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
{
OGuard aGuard( Application::GetSolarMutex() );
@@ -1628,7 +1556,6 @@ void SAL_CALL SvxShape::setPropertyValue( const OUString& rPropertyName, const u
DBG_ASSERT( pMap->nWID < OWN_ATTR_VALUE_START || pMap->nWID > OWN_ATTR_VALUE_END, "Not item property not handled!" );
SfxItemSet aSet( pModel->GetItemPool(), pMap->nWID, pMap->nWID);
-//-/ pObj->TakeAttributes( aSet, sal_False, sal_False );
aSet.Put(pObj->GetItem(pMap->nWID));
if( SvxUnoTextRangeBase::SetPropertyValueHelper( aSet, pMap, rVal, aSet ))
@@ -1645,19 +1572,9 @@ void SAL_CALL SvxShape::setPropertyValue( const OUString& rPropertyName, const u
if(!aSet.Count())
{
-//-/ if(pMap->nWID >= SID_ATTR_3D_START && pMap->nWID <= SID_ATTR_3D_END)
-//-/ {
-//-/ // 3D-Attribut, eigenen Default
-//-/ // Diese sollten IMMER gesetzt sein, da TakeAttributes an
-//-/ // 3D-Objekten alle Items erzeugt und eintraegt
-//-/ DBG_ERROR("AW: Got NO default item from group SID_ATTR_3D_");
-//-/ }
-//-/ else
-//-/ {
// Default aus ItemPool holen
if(pModel->GetItemPool().IsWhich(pMap->nWID))
aSet.Put(pModel->GetItemPool().GetDefaultItem(pMap->nWID));
-//-/ }
}
if(aSet.Count())
@@ -1702,10 +1619,7 @@ void SAL_CALL SvxShape::setPropertyValue( const OUString& rPropertyName, const u
}
else
{
-//-/ pObj->SetAttributes( aSet, sal_False );
-//-/ SdrBroadcastItemChange aItemChange(*pObj);
pObj->SetItemSetAndBroadcast(aSet);
-//-/ pObj->BroadcastItemChange(aItemChange);
}
}
return;
@@ -1732,10 +1646,9 @@ void SAL_CALL SvxShape::setPropertyValue( const OUString& rPropertyName, const u
}
//----------------------------------------------------------------------
+
uno::Any SAL_CALL SvxShape::getPropertyValue( const OUString& PropertyName )
- throw(beans::UnknownPropertyException,
- lang::WrappedTargetException,
- uno::RuntimeException)
+ throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
OGuard aGuard( Application::GetSolarMutex() );
@@ -2102,8 +2015,6 @@ uno::Any SAL_CALL SvxShape::getPropertyValue( const OUString& PropertyName )
DBG_ASSERT( pMap->nWID < OWN_ATTR_VALUE_START || pMap->nWID > OWN_ATTR_VALUE_END, "Not item property not handled!" );
SfxItemSet aSet( pModel->GetItemPool(), pMap->nWID, pMap->nWID);
-//-/ pObj->TakeAttributes( aSet, sal_False, sal_False );
-//-/ aSet.Put(pObj->GetItemSet());
aSet.Put(pObj->GetItem(pMap->nWID));
if(SvxUnoTextRangeBase::GetPropertyValueHelper( aSet, pMap, aAny ))
@@ -2120,19 +2031,9 @@ uno::Any SAL_CALL SvxShape::getPropertyValue( const OUString& PropertyName )
if(!aSet.Count())
{
-//-/ if(pMap->nWID >= SID_ATTR_3D_START && pMap->nWID <= SID_ATTR_3D_END)
-//-/ {
-//-/ // 3D-Attribut, eigenen Default
-//-/ // Diese sollten IMMER gesetzt sein, da TakeAttributes an
-//-/ // 3D-Objekten alle Items erzeugt und eintraegt
-//-/ DBG_ERROR("AW: Got NO default item from group SID_ATTR_3D_");
-//-/ }
-//-/ else
-//-/ {
// Default aus ItemPool holen
if(pModel->GetItemPool().IsWhich(pMap->nWID))
aSet.Put(pModel->GetItemPool().GetDefaultItem(pMap->nWID));
-//-/ }
}
if(aSet.Count())
@@ -2153,6 +2054,46 @@ uno::Any SAL_CALL SvxShape::getPropertyValue( const OUString& PropertyName )
return aAny;
}
+// XMultiPropertySet
+void SAL_CALL SvxShape::setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
+{
+ const sal_Int32 nCount = aPropertyNames.getLength();
+ const OUString* pNames = aPropertyNames.getConstArray();
+
+ const uno::Any* pValues = aValues.getConstArray();
+
+ for( sal_Int32 nIdx = 0; nIdx < nCount; nIdx++ )
+ setPropertyValue( *pNames++, *pValues++ );
+}
+
+::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL SvxShape::getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException)
+{
+ const sal_Int32 nCount = aPropertyNames.getLength();
+ const OUString* pNames = aPropertyNames.getConstArray();
+
+ uno::Sequence< uno::Any > aRet( nCount );
+ uno::Any* pValue = aRet.getArray();;
+
+ for( sal_Int32 nIdx = 0; nIdx < nCount; nIdx++ )
+ *pValue++ = getPropertyValue( *pNames++ );
+
+ return aRet;
+}
+
+void SAL_CALL SvxShape::addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
+{
+}
+
+void SAL_CALL SvxShape::removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
+{
+}
+
+void SAL_CALL SvxShape::firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
+{
+}
+
+//----------------------------------------------------------------------
+
uno::Any SvxShape::GetAnyForItem( SfxItemSet& aSet, const SfxItemPropertyMap* pMap ) const
{
uno::Any aAny;
@@ -2254,6 +2195,8 @@ uno::Any SvxShape::GetAnyForItem( SfxItemSet& aSet, const SfxItemPropertyMap* pM
return aAny;
}
+//----------------------------------------------------------------------
+
// XPropertyState
beans::PropertyState SAL_CALL SvxShape::getPropertyState( const OUString& PropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException)
@@ -2304,6 +2247,8 @@ beans::PropertyState SAL_CALL SvxShape::getPropertyState( const OUString& Proper
}
}
+//----------------------------------------------------------------------
+
uno::Sequence< beans::PropertyState > SAL_CALL SvxShape::getPropertyStates( const uno::Sequence< OUString >& aPropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
@@ -2319,6 +2264,8 @@ uno::Sequence< beans::PropertyState > SAL_CALL SvxShape::getPropertyStates( cons
return aRet;
}
+//----------------------------------------------------------------------
+
void SAL_CALL SvxShape::setPropertyToDefault( const OUString& PropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
@@ -2347,6 +2294,8 @@ void SAL_CALL SvxShape::setPropertyToDefault( const OUString& PropertyName )
pModel->SetChanged();
}
+//----------------------------------------------------------------------
+
uno::Any SAL_CALL SvxShape::getPropertyDefault( const OUString& aPropertyName )
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
@@ -2376,12 +2325,15 @@ uno::Any SAL_CALL SvxShape::getPropertyDefault( const OUString& aPropertyName )
}
//----------------------------------------------------------------------
+
+//----------------------------------------------------------------------
// XServiceInfo
//----------------------------------------------------------------------
OUString SAL_CALL SvxShape::getImplementationName()
throw(uno::RuntimeException)
{
- return OUString( RTL_CONSTASCII_USTRINGPARAM("SvxShape") );
+ static OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM("SvxShape") );
+ return aServiceName;
}
#define STAR_NAMESPACE "com.sun.star."
@@ -2427,10 +2379,7 @@ uno::Sequence< OUString > SAL_CALL SvxShape::getSupportedServiceNames()
{
uno::Sequence< OUString > aSeq;
- GET_TEXT_INTERFACE( XServiceInfo, xInfo );
-
- if( xInfo.is() )
- aSeq = xInfo->getSupportedServiceNames();
+// aSeq = xInfo->getSupportedServiceNames();
if( pObj && pObj->GetObjInventor() == SdrInventor)
{
@@ -2439,12 +2388,12 @@ uno::Sequence< OUString > SAL_CALL SvxShape::getSupportedServiceNames()
switch(nIdent)
{
case OBJ_GRUP:
- addToSequence( aSeq, 2, sUNO_service_drawing_GroupShape,
+ SvxServiceInfoHelper::addToSequence( aSeq, 2, sUNO_service_drawing_GroupShape,
sUNO_service_drawing_Shape );
break;
case OBJ_LINE:
- addToSequence( aSeq,10, sUNO_service_drawing_LineShape,
+ SvxServiceInfoHelper::addToSequence( aSeq,10, sUNO_service_drawing_LineShape,
sUNO_service_drawing_Shape,
sUNO_service_drawing_LineProperties,
@@ -2460,7 +2409,7 @@ uno::Sequence< OUString > SAL_CALL SvxShape::getSupportedServiceNames()
break;
case OBJ_RECT:
- addToSequence( aSeq,10, sUNO_service_drawing_RectangleShape,
+ SvxServiceInfoHelper::addToSequence( aSeq,10, sUNO_service_drawing_RectangleShape,
sUNO_service_drawing_Shape,
sUNO_service_drawing_FillProperties,
@@ -2479,7 +2428,7 @@ uno::Sequence< OUString > SAL_CALL SvxShape::getSupportedServiceNames()
case OBJ_SECT:
case OBJ_CARC:
case OBJ_CCUT:
- addToSequence( aSeq,10, sUNO_service_drawing_EllipseShape,
+ SvxServiceInfoHelper::addToSequence( aSeq,10, sUNO_service_drawing_EllipseShape,
sUNO_service_drawing_Shape,
sUNO_service_drawing_FillProperties,
@@ -2496,7 +2445,7 @@ uno::Sequence< OUString > SAL_CALL SvxShape::getSupportedServiceNames()
case OBJ_PATHPLIN:
case OBJ_PLIN:
- addToSequence( aSeq,10, sUNO_service_drawing_PolyLineShape,
+ SvxServiceInfoHelper::addToSequence( aSeq,10, sUNO_service_drawing_PolyLineShape,
sUNO_service_drawing_Shape,
sUNO_service_drawing_LineProperties,
@@ -2514,7 +2463,7 @@ uno::Sequence< OUString > SAL_CALL SvxShape::getSupportedServiceNames()
case OBJ_PATHPOLY:
case OBJ_POLY:
- addToSequence( aSeq,11, sUNO_service_drawing_PolyPolygonShape,
+ SvxServiceInfoHelper::addToSequence( aSeq,11, sUNO_service_drawing_PolyPolygonShape,
sUNO_service_drawing_Shape,
sUNO_service_drawing_LineProperties,
@@ -2533,7 +2482,7 @@ uno::Sequence< OUString > SAL_CALL SvxShape::getSupportedServiceNames()
case OBJ_FREELINE:
case OBJ_PATHLINE:
- addToSequence( aSeq,11, sUNO_service_drawing_OpenBezierShape,
+ SvxServiceInfoHelper::addToSequence( aSeq,11, sUNO_service_drawing_OpenBezierShape,
sUNO_service_drawing_Shape,
sUNO_service_drawing_LineProperties,
@@ -2552,7 +2501,7 @@ uno::Sequence< OUString > SAL_CALL SvxShape::getSupportedServiceNames()
case OBJ_FREEFILL:
case OBJ_PATHFILL:
- addToSequence( aSeq,11, sUNO_service_drawing_ClosedBezierShape,
+ SvxServiceInfoHelper::addToSequence( aSeq,11, sUNO_service_drawing_ClosedBezierShape,
sUNO_service_drawing_Shape,
sUNO_service_drawing_LineProperties,
@@ -2572,7 +2521,7 @@ uno::Sequence< OUString > SAL_CALL SvxShape::getSupportedServiceNames()
case OBJ_OUTLINETEXT:
case OBJ_TITLETEXT:
case OBJ_TEXT:
- addToSequence( aSeq,10, sUNO_service_drawing_TextShape,
+ SvxServiceInfoHelper::addToSequence( aSeq,10, sUNO_service_drawing_TextShape,
sUNO_service_drawing_Shape,
sUNO_service_drawing_FillProperties,
@@ -2588,7 +2537,7 @@ uno::Sequence< OUString > SAL_CALL SvxShape::getSupportedServiceNames()
break;
case OBJ_GRAF:
- addToSequence( aSeq, 8, sUNO_service_drawing_GraphicObjectShape,
+ SvxServiceInfoHelper::addToSequence( aSeq, 8, sUNO_service_drawing_GraphicObjectShape,
sUNO_service_drawing_Shape,
@@ -2602,12 +2551,12 @@ uno::Sequence< OUString > SAL_CALL SvxShape::getSupportedServiceNames()
break;
case OBJ_OLE2:
- addToSequence( aSeq, 2, sUNO_service_drawing_OLE2Shape,
+ SvxServiceInfoHelper::addToSequence( aSeq, 2, sUNO_service_drawing_OLE2Shape,
sUNO_service_drawing_Shape);
break;
case OBJ_CAPTION:
- addToSequence( aSeq,10, sUNO_service_drawing_CaptionShape,
+ SvxServiceInfoHelper::addToSequence( aSeq,10, sUNO_service_drawing_CaptionShape,
sUNO_service_drawing_Shape,
sUNO_service_drawing_FillProperties,
@@ -2623,12 +2572,12 @@ uno::Sequence< OUString > SAL_CALL SvxShape::getSupportedServiceNames()
break;
case OBJ_PAGE:
- addToSequence( aSeq, 2, sUNO_service_drawing_PageShape,
+ SvxServiceInfoHelper::addToSequence( aSeq, 2, sUNO_service_drawing_PageShape,
sUNO_service_drawing_Shape );
break;
case OBJ_MEASURE:
- addToSequence( aSeq,11, sUNO_service_drawing_MeasureShape,
+ SvxServiceInfoHelper::addToSequence( aSeq,11, sUNO_service_drawing_MeasureShape,
sUNO_service_drawing_MeasureProperties,
@@ -2646,16 +2595,16 @@ uno::Sequence< OUString > SAL_CALL SvxShape::getSupportedServiceNames()
break;
case OBJ_FRAME:
- addToSequence( aSeq, 2, sUNO_service_drawing_FrameShape,
+ SvxServiceInfoHelper::addToSequence( aSeq, 2, sUNO_service_drawing_FrameShape,
sUNO_service_drawing_Shape );
break;
case OBJ_UNO:
- addToSequence( aSeq, 2, sUNO_service_drawing_ControlShape,
+ SvxServiceInfoHelper::addToSequence( aSeq, 2, sUNO_service_drawing_ControlShape,
sUNO_service_drawing_Shape );
break;
case OBJ_EDGE:
- addToSequence( aSeq,11, sUNO_service_drawing_ConnectorShape,
+ SvxServiceInfoHelper::addToSequence( aSeq,11, sUNO_service_drawing_ConnectorShape,
sUNO_service_drawing_ConnectorProperties,
@@ -2680,6 +2629,19 @@ uno::Sequence< OUString > SAL_CALL SvxShape::getSupportedServiceNames()
return aSeq;
}
+//----------------------------------------------------------------------
+sal_Bool SAL_CALL SvxShape::supportsService( const OUString& ServiceName ) throw ( uno::RuntimeException )
+{
+ const uno::Sequence< OUString > SupportedServices( getSupportedServiceNames() );
+ const ::rtl::OUString * pArray = SupportedServices.getConstArray();
+ for( INT32 i = 0; i < SupportedServices.getLength(); i++ )
+ if( pArray[i] == ServiceName )
+ return TRUE;
+ return FALSE;
+}
+
+//----------------------------------------------------------------------
+
// XGluePointsSupplier
uno::Reference< container::XIndexContainer > SAL_CALL SvxShape::getGluePoints()
throw(uno::RuntimeException)
@@ -2695,6 +2657,8 @@ uno::Reference< container::XIndexContainer > SAL_CALL SvxShape::getGluePoints()
return xGluePoints;
}
+//----------------------------------------------------------------------
+
// XChild
uno::Reference< uno::XInterface > SAL_CALL SvxShape::getParent( )
throw(uno::RuntimeException)
@@ -2725,17 +2689,175 @@ uno::Reference< uno::XInterface > SAL_CALL SvxShape::getParent( )
return xParent;
}
+//----------------------------------------------------------------------
+
void SAL_CALL SvxShape::setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent )
throw(lang::NoSupportException, uno::RuntimeException)
{
throw lang::NoSupportException();
}
-/************6***********************************************************
+/***********************************************************************
+* class SvxShapeText *
+***********************************************************************/
+SvxShapeText::SvxShapeText() throw ()
+: SvxShape(), SvxUnoTextBase( ImplGetSvxUnoOutlinerTextCursorPropertyMap() )
+{
+}
+
+//----------------------------------------------------------------------
+SvxShapeText::SvxShapeText( SdrObject* pObject ) throw ()
+: SvxShape( pObject ), SvxUnoTextBase( ImplGetSvxUnoOutlinerTextCursorPropertyMap() )
+{
+ if( pObject )
+ SetEditSource( new SvxTextEditSource( pObject ) );
+}
+
+//----------------------------------------------------------------------
+SvxShapeText::SvxShapeText( SdrObject* pObject, const SfxItemPropertyMap* pPropertySet ) throw ()
+: SvxShape( pObject, pPropertySet ), SvxUnoTextBase( ImplGetSvxUnoOutlinerTextCursorPropertyMap() )
+{
+ if( pObject )
+ SetEditSource( new SvxTextEditSource( pObject ) );
+}
+
+//----------------------------------------------------------------------
+SvxShapeText::~SvxShapeText() throw ()
+{
+}
+
+void SvxShapeText::Create( SdrObject* pNewObj, SvxDrawPage* pNewPage ) throw ()
+{
+ if( pNewObj && (NULL == GetEditSource()))
+ SetEditSource( new SvxTextEditSource( pNewObj ) );
+
+ SvxShape::Create( pNewObj, pNewPage );
+}
+
+// XInterface
+//----------------------------------------------------------------------
+uno::Any SAL_CALL SvxShapeText::queryInterface( const uno::Type & rType )
+ throw( uno::RuntimeException )
+{
+ return SvxShape::queryInterface( rType );
+}
+
+uno::Any SAL_CALL SvxShapeText::queryAggregation( const uno::Type & rType )
+ throw( uno::RuntimeException )
+{
+ uno::Any aAny( SvxShape::queryAggregation( rType ) );
+ if( !aAny.hasValue() )
+ aAny = SvxUnoTextBase::queryAggregation( rType );
+
+ return aAny;
+}
+
+//----------------------------------------------------------------------
+void SAL_CALL SvxShapeText::acquire() throw( uno::RuntimeException )
+{
+ SvxShape::acquire();
+}
+
+//----------------------------------------------------------------------
+void SAL_CALL SvxShapeText::release() throw( uno::RuntimeException )
+{
+ SvxShape::release();
+}
+
+// XServiceInfo
+//----------------------------------------------------------------------
+OUString SAL_CALL SvxShapeText::getImplementationName() throw( uno::RuntimeException )
+{
+ static OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM("SvxShapeText") );
+ return aServiceName;
+}
+
+//----------------------------------------------------------------------
+uno::Sequence< OUString > SAL_CALL SvxShapeText::getSupportedServiceNames() throw( uno::RuntimeException )
+{
+ return SvxShape::getSupportedServiceNames();
+}
+
+//----------------------------------------------------------------------
+sal_Bool SAL_CALL SvxShapeText::supportsService( const OUString& ServiceName ) throw ( uno::RuntimeException )
+{
+ return SvxShape::supportsService(ServiceName);
+}
+
+ // XTypeProvider
+//----------------------------------------------------------------------
+uno::Sequence< uno::Type > SAL_CALL SvxShapeText::getTypes()
+ throw( uno::RuntimeException )
+{
+ if( SvxShape::maTypeSequence.getLength() == 0 )
+ {
+ // Ready for multithreading; get global mutex for first call of this method only! see before
+ MutexGuard aGuard( osl::Mutex::getGlobalMutex() ) ;
+
+ // Control these pointer again ... it can be, that another instance will be faster then these!
+ if( SvxShape::maTypeSequence.getLength() == 0 )
+ {
+ // initialize base types
+ SvxShape::getTypes();
+
+ const int nOwnCount = SvxShape::maTypeSequence.getLength();
+
+ uno::Sequence< uno::Type > aTextTypes( SvxUnoTextBase::getTypes() );
+
+ const int nTextCount = aTextTypes.getLength();
+
+ SvxShape::maTypeSequence.realloc( nOwnCount + nTextCount );
+
+ uno::Type* pTypes = SvxShape::maTypeSequence.getArray();
+ pTypes = &(pTypes[nOwnCount]);
+
+ uno::Type* pTextTypes = aTextTypes.getArray();
+
+ for( int i = 0; i < nTextCount; i++ )
+ *pTypes++ = *pTextTypes++;
+ }
+ }
+ return SvxShape::maTypeSequence;
+}
+
+sal_Int64 SAL_CALL SvxShapeText::getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw(::com::sun::star::uno::RuntimeException) \
+{
+ const sal_Int64 nReturn = SvxShape::getSomething( rId );
+ if( nReturn )
+ return nReturn;
+
+ return SvxUnoTextBase::getSomething( rId );
+}
+
+//----------------------------------------------------------------------
+uno::Sequence< sal_Int8 > SAL_CALL SvxShapeText::getImplementationId()
+ throw( uno::RuntimeException )
+{
+ static ::cppu::OImplementationId* pID = NULL ;
+
+ if ( pID == NULL )
+ {
+ // Ready for multithreading; get global mutex for first call of this method only! see before
+ MutexGuard aGuard( osl::Mutex::getGlobalMutex() ) ;
+
+ // Control these pointer again ... it can be, that another instance will be faster then these!
+ if ( pID == NULL )
+ {
+ // Create a new static ID ...
+ static ::cppu::OImplementationId aID( sal_False ) ;
+ // ... and set his address to static pointer!
+ pID = &aID ;
+ }
+ }
+
+ return pID->getImplementationId() ;
+}
+
+/***********************************************************************
* class SvxShapeRect *
***********************************************************************/
SvxShapeRect::SvxShapeRect( SdrObject* pObj ) throw()
-: SvxShape( pObj, aSvxMapProvider.GetMap(SVXMAP_SHAPE) )
+: SvxShapeText( pObj, aSvxMapProvider.GetMap(SVXMAP_SHAPE) )
{
}
@@ -2746,12 +2868,12 @@ SvxShapeRect::~SvxShapeRect() throw()
uno::Any SAL_CALL SvxShapeRect::queryInterface( const uno::Type & rType ) throw(uno::RuntimeException)
{
- return OWeakAggObject::queryInterface( rType );
+ return SvxShapeText::queryInterface( rType );
}
uno::Any SAL_CALL SvxShapeRect::queryAggregation( const uno::Type & rType ) throw(uno::RuntimeException)
{
- return SvxShape::queryAggregation( rType );
+ return SvxShapeText::queryAggregation( rType );
}
void SAL_CALL SvxShapeRect::acquire() throw(uno::RuntimeException)