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

fdo#58399 - revert attempts to untangle and accelerate this mess.

Reverts commits:
    76350361
    67f899e1
    1d77d4ea
    1d16f590

The bug has a great series of linked bugs and stack-traces; the
weakref / mixed tools & UNO lifecycle here is simply hideous.
üst 355c3078
...@@ -92,12 +92,10 @@ public: ...@@ -92,12 +92,10 @@ public:
com::sun::star::uno::Reference< com::sun::star::drawing::XShape > mXRenderedCustomShape; com::sun::star::uno::Reference< com::sun::star::drawing::XShape > mXRenderedCustomShape;
mutable com::sun::star::uno::Reference< com::sun::star::drawing::XCustomShapeEngine > mxCustomShapeEngine;
// #i37011# render geometry shadow // #i37011# render geometry shadow
SdrObject* mpLastShadowGeometry; SdrObject* mpLastShadowGeometry;
com::sun::star::uno::Reference< com::sun::star::drawing::XCustomShapeEngine > GetCustomShapeEngine() const; static com::sun::star::uno::Reference< com::sun::star::drawing::XCustomShapeEngine > GetCustomShapeEngine( const SdrObjCustomShape* pCustomShape );
// SVX_DLLPRIVATE com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::drawing::XCustomShapeHandle > > // SVX_DLLPRIVATE com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::drawing::XCustomShapeHandle > >
// SdrObjCustomShape::GetInteraction( const SdrObjCustomShape* pCustomShape ) const; // SdrObjCustomShape::GetInteraction( const SdrObjCustomShape* pCustomShape ) const;
......
...@@ -87,6 +87,7 @@ using namespace ::com::sun::star::lang; ...@@ -87,6 +87,7 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans; using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::drawing; using namespace ::com::sun::star::drawing;
static void lcl_ShapeSegmentFromBinary( EnhancedCustomShapeSegment& rSegInfo, sal_uInt16 nSDat ) static void lcl_ShapeSegmentFromBinary( EnhancedCustomShapeSegment& rSegInfo, sal_uInt16 nSDat )
{ {
switch( nSDat >> 8 ) switch( nSDat >> 8 )
...@@ -389,18 +390,16 @@ SdrObject* ImpCreateShadowObjectClone(const SdrObject& rOriginal, const SfxItemS ...@@ -389,18 +390,16 @@ SdrObject* ImpCreateShadowObjectClone(const SdrObject& rOriginal, const SfxItemS
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
Reference< XCustomShapeEngine > SdrObjCustomShape::GetCustomShapeEngine() const Reference< XCustomShapeEngine > SdrObjCustomShape::GetCustomShapeEngine( const SdrObjCustomShape* pCustomShape )
{ {
if (mxCustomShapeEngine.is()) Reference< XCustomShapeEngine > xCustomShapeEngine;
return mxCustomShapeEngine; String aEngine(((SdrCustomShapeEngineItem&)pCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_ENGINE )).GetValue());
String aEngine(((SdrCustomShapeEngineItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_ENGINE )).GetValue());
if ( !aEngine.Len() ) if ( !aEngine.Len() )
aEngine = String( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.drawing.EnhancedCustomShapeEngine" ) ); aEngine = String( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.drawing.EnhancedCustomShapeEngine" ) );
Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
Reference< XShape > aXShape = GetXShapeForSdrObject(const_cast<SdrObjCustomShape*>(this)); Reference< XShape > aXShape = GetXShapeForSdrObject( (SdrObjCustomShape*)pCustomShape );
if ( aXShape.is() ) if ( aXShape.is() )
{ {
if ( aEngine.Len() && xFactory.is() ) if ( aEngine.Len() && xFactory.is() )
...@@ -412,18 +411,16 @@ Reference< XCustomShapeEngine > SdrObjCustomShape::GetCustomShapeEngine() const ...@@ -412,18 +411,16 @@ Reference< XCustomShapeEngine > SdrObjCustomShape::GetCustomShapeEngine() const
aArgument[ 0 ] <<= aPropValues; aArgument[ 0 ] <<= aPropValues;
Reference< XInterface > xInterface( xFactory->createInstanceWithArguments( aEngine, aArgument ) ); Reference< XInterface > xInterface( xFactory->createInstanceWithArguments( aEngine, aArgument ) );
if ( xInterface.is() ) if ( xInterface.is() )
mxCustomShapeEngine = Reference< XCustomShapeEngine >( xInterface, UNO_QUERY ); xCustomShapeEngine = Reference< XCustomShapeEngine >( xInterface, UNO_QUERY );
} }
} }
return xCustomShapeEngine;
return mxCustomShapeEngine;
} }
const SdrObject* SdrObjCustomShape::GetSdrObjectFromCustomShape() const const SdrObject* SdrObjCustomShape::GetSdrObjectFromCustomShape() const
{ {
if ( !mXRenderedCustomShape.is() ) if ( !mXRenderedCustomShape.is() )
{ {
Reference< XCustomShapeEngine > xCustomShapeEngine( GetCustomShapeEngine() ); Reference< XCustomShapeEngine > xCustomShapeEngine( GetCustomShapeEngine( this ) );
if ( xCustomShapeEngine.is() ) if ( xCustomShapeEngine.is() )
((SdrObjCustomShape*)this)->mXRenderedCustomShape = xCustomShapeEngine->render(); ((SdrObjCustomShape*)this)->mXRenderedCustomShape = xCustomShapeEngine->render();
} }
...@@ -550,12 +547,10 @@ double SdrObjCustomShape::GetExtraTextRotation( const bool bPreRotation ) const ...@@ -550,12 +547,10 @@ double SdrObjCustomShape::GetExtraTextRotation( const bool bPreRotation ) const
*pAny >>= fExtraTextRotateAngle; *pAny >>= fExtraTextRotateAngle;
return fExtraTextRotateAngle; return fExtraTextRotateAngle;
} }
sal_Bool SdrObjCustomShape::GetTextBounds( Rectangle& rTextBound ) const sal_Bool SdrObjCustomShape::GetTextBounds( Rectangle& rTextBound ) const
{ {
sal_Bool bRet = sal_False; sal_Bool bRet = sal_False;
Reference< XCustomShapeEngine > xCustomShapeEngine( GetCustomShapeEngine( this ) ); // a candidate for being cached
Reference< XCustomShapeEngine > xCustomShapeEngine( GetCustomShapeEngine() );
if ( xCustomShapeEngine.is() ) if ( xCustomShapeEngine.is() )
{ {
awt::Rectangle aR( xCustomShapeEngine->getTextBounds() ); awt::Rectangle aR( xCustomShapeEngine->getTextBounds() );
...@@ -570,7 +565,7 @@ sal_Bool SdrObjCustomShape::GetTextBounds( Rectangle& rTextBound ) const ...@@ -570,7 +565,7 @@ sal_Bool SdrObjCustomShape::GetTextBounds( Rectangle& rTextBound ) const
basegfx::B2DPolyPolygon SdrObjCustomShape::GetLineGeometry( const SdrObjCustomShape* pCustomShape, const sal_Bool bBezierAllowed ) basegfx::B2DPolyPolygon SdrObjCustomShape::GetLineGeometry( const SdrObjCustomShape* pCustomShape, const sal_Bool bBezierAllowed )
{ {
basegfx::B2DPolyPolygon aRetval; basegfx::B2DPolyPolygon aRetval;
Reference< XCustomShapeEngine > xCustomShapeEngine( pCustomShape->GetCustomShapeEngine() ); Reference< XCustomShapeEngine > xCustomShapeEngine( GetCustomShapeEngine( pCustomShape ) );
if ( xCustomShapeEngine.is() ) if ( xCustomShapeEngine.is() )
{ {
com::sun::star::drawing::PolyPolygonBezierCoords aBezierCoords = xCustomShapeEngine->getLineGeometry(); com::sun::star::drawing::PolyPolygonBezierCoords aBezierCoords = xCustomShapeEngine->getLineGeometry();
...@@ -594,7 +589,7 @@ std::vector< SdrCustomShapeInteraction > SdrObjCustomShape::GetInteractionHandle ...@@ -594,7 +589,7 @@ std::vector< SdrCustomShapeInteraction > SdrObjCustomShape::GetInteractionHandle
std::vector< SdrCustomShapeInteraction > xRet; std::vector< SdrCustomShapeInteraction > xRet;
try try
{ {
Reference< XCustomShapeEngine > xCustomShapeEngine( pCustomShape->GetCustomShapeEngine() ); Reference< XCustomShapeEngine > xCustomShapeEngine( GetCustomShapeEngine( pCustomShape ) );
if ( xCustomShapeEngine.is() ) if ( xCustomShapeEngine.is() )
{ {
int i; int i;
...@@ -3211,7 +3206,6 @@ bool SdrObjCustomShape::doConstructOrthogonal(const ::rtl::OUString& rName) ...@@ -3211,7 +3206,6 @@ bool SdrObjCustomShape::doConstructOrthogonal(const ::rtl::OUString& rName)
void SdrObjCustomShape::InvalidateRenderGeometry() void SdrObjCustomShape::InvalidateRenderGeometry()
{ {
mXRenderedCustomShape = 0L; mXRenderedCustomShape = 0L;
mxCustomShapeEngine = 0L;
SdrObject::Free( mpLastShadowGeometry ); SdrObject::Free( mpLastShadowGeometry );
mpLastShadowGeometry = 0L; mpLastShadowGeometry = 0L;
} }
......
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