remove copypasta

Change-Id: Ieed83781b89ff18f870ad8c64ca00d306b097aea
This commit is contained in:
Bjoern Michaelsen 2015-03-26 15:55:37 +01:00
parent 2bfc2c4a2c
commit 63fccb1101

View file

@ -3592,41 +3592,8 @@ void SwXTextEmbeddedObject::removeEventListener(const uno::Reference< lang::XEve
uno::Reference< lang::XComponent > SwXTextEmbeddedObject::getEmbeddedObject(void) throw( uno::RuntimeException, std::exception )
{
uno::Reference< lang::XComponent > xRet;
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt)
{
SwDoc* pDoc = pFmt->GetDoc();
const SwFmtCntnt* pCnt = &pFmt->GetCntnt();
OSL_ENSURE( pCnt->GetCntntIdx() &&
pDoc->GetNodes()[ pCnt->GetCntntIdx()->
GetIndex() + 1 ]->GetOLENode(), "kein OLE-Node?");
SwOLENode* pOleNode = pDoc->GetNodes()[ pCnt->GetCntntIdx()
->GetIndex() + 1 ]->GetOLENode();
uno::Reference < embed::XEmbeddedObject > xIP = pOleNode->GetOLEObj().GetOleRef();
if ( svt::EmbeddedObjectRef::TryRunningState( xIP ) )
{
// TODO/LATER: the listener registered after client creation should be able to handle scaling, after that the client is not necessary here
if ( pDoc->GetDocShell() )
pDoc->GetDocShell()->GetIPClient( svt::EmbeddedObjectRef( xIP, embed::Aspects::MSOLE_CONTENT ) );
xRet = uno::Reference < lang::XComponent >( xIP->getComponent(), uno::UNO_QUERY );
uno::Reference< util::XModifyBroadcaster > xBrdcst( xRet, uno::UNO_QUERY);
uno::Reference< frame::XModel > xModel( xRet, uno::UNO_QUERY);
if( xBrdcst.is() && xModel.is() )
{
SwXOLEListener* pListener = SwIterator<SwXOLEListener,SwFmt>( *pFmt ).First();
//create a new one if the OLE object doesn't have one already
if( !pListener )
{
uno::Reference< util::XModifyListener > xOLEListener = new SwXOLEListener(*pFmt, xModel);
xBrdcst->addModifyListener( xOLEListener );
}
}
}
}
return xRet;
uno::Reference<embed::XEmbeddedObject> xObj(getExtendedControlOverEmbeddedObject());
return xObj.is() ? uno::Reference<lang::XComponent>(xObj->getComponent(), uno::UNO_QUERY) : nullptr;
}
uno::Reference< embed::XEmbeddedObject > SAL_CALL SwXTextEmbeddedObject::getExtendedControlOverEmbeddedObject()