Kaydet (Commit) 082d4690 authored tarafından Xisco Fauli's avatar Xisco Fauli Kaydeden (comit) Noel Grandin

tdf#89329: use unique_ptr for pImpl in svdoole2

Change-Id: Ie189576336e0670102d7675b59f30e3fc357671d
Reviewed-on: https://gerrit.libreoffice.org/25942Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst a5e7c9ca
...@@ -44,7 +44,7 @@ class SdrOle2ObjImpl; ...@@ -44,7 +44,7 @@ class SdrOle2ObjImpl;
class SVX_DLLPUBLIC SdrOle2Obj : public SdrRectObj class SVX_DLLPUBLIC SdrOle2Obj : public SdrRectObj
{ {
private: private:
SdrOle2ObjImpl* mpImpl; std::unique_ptr<SdrOle2ObjImpl> mpImpl;
private: private:
SVX_DLLPRIVATE void Connect_Impl(); SVX_DLLPRIVATE void Connect_Impl();
......
...@@ -167,7 +167,6 @@ private: ...@@ -167,7 +167,6 @@ private:
virtual uno::Reference< awt::XWindow > SAL_CALL getWindow() throw ( uno::RuntimeException, std::exception ) override; virtual uno::Reference< awt::XWindow > SAL_CALL getWindow() throw ( uno::RuntimeException, std::exception ) override;
}; };
SdrLightEmbeddedClient_Impl::SdrLightEmbeddedClient_Impl( SdrOle2Obj* pObj ) SdrLightEmbeddedClient_Impl::SdrLightEmbeddedClient_Impl( SdrOle2Obj* pObj )
: mpObj( pObj ) : mpObj( pObj )
{ {
...@@ -185,7 +184,6 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::changingState( const css::lang::Event ...@@ -185,7 +184,6 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::changingState( const css::lang::Event
{ {
} }
void SdrLightEmbeddedClient_Impl::Release() void SdrLightEmbeddedClient_Impl::Release()
{ {
{ {
...@@ -196,7 +194,6 @@ void SdrLightEmbeddedClient_Impl::Release() ...@@ -196,7 +194,6 @@ void SdrLightEmbeddedClient_Impl::Release()
release(); release();
} }
void SAL_CALL SdrLightEmbeddedClient_Impl::stateChanged( const css::lang::EventObject& /*aEvent*/, ::sal_Int32 nOldState, ::sal_Int32 nNewState ) throw (css::uno::RuntimeException, std::exception) void SAL_CALL SdrLightEmbeddedClient_Impl::stateChanged( const css::lang::EventObject& /*aEvent*/, ::sal_Int32 nOldState, ::sal_Int32 nNewState ) throw (css::uno::RuntimeException, std::exception)
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
...@@ -212,7 +209,6 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::stateChanged( const css::lang::EventO ...@@ -212,7 +209,6 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::stateChanged( const css::lang::EventO
} }
} }
void SAL_CALL SdrLightEmbeddedClient_Impl::disposing( const css::lang::EventObject& /*aEvent*/ ) throw (css::uno::RuntimeException, std::exception) void SAL_CALL SdrLightEmbeddedClient_Impl::disposing( const css::lang::EventObject& /*aEvent*/ ) throw (css::uno::RuntimeException, std::exception)
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
...@@ -220,7 +216,6 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::disposing( const css::lang::EventObje ...@@ -220,7 +216,6 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::disposing( const css::lang::EventObje
GetSdrGlobalData().GetOLEObjCache().RemoveObj(mpObj); GetSdrGlobalData().GetOLEObjCache().RemoveObj(mpObj);
} }
void SAL_CALL SdrLightEmbeddedClient_Impl::notifyEvent( const document::EventObject& aEvent ) throw( uno::RuntimeException, std::exception ) void SAL_CALL SdrLightEmbeddedClient_Impl::notifyEvent( const document::EventObject& aEvent ) throw( uno::RuntimeException, std::exception )
{ {
// TODO/LATER: when writer uses this implementation the code could be shared with SfxInPlaceClient_Impl // TODO/LATER: when writer uses this implementation the code could be shared with SfxInPlaceClient_Impl
...@@ -286,7 +281,6 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::notifyEvent( const document::EventObj ...@@ -286,7 +281,6 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::notifyEvent( const document::EventObj
} }
} }
void SAL_CALL SdrLightEmbeddedClient_Impl::saveObject() void SAL_CALL SdrLightEmbeddedClient_Impl::saveObject()
throw ( embed::ObjectSaveVetoException, throw ( embed::ObjectSaveVetoException,
uno::Exception, uno::Exception,
...@@ -313,7 +307,6 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::saveObject() ...@@ -313,7 +307,6 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::saveObject()
xModifiable->setModified( true ); xModifiable->setModified( true );
} }
void SAL_CALL SdrLightEmbeddedClient_Impl::visibilityChanged( sal_Bool /*bVisible*/ ) void SAL_CALL SdrLightEmbeddedClient_Impl::visibilityChanged( sal_Bool /*bVisible*/ )
throw ( embed::WrongStateException, throw ( embed::WrongStateException,
uno::RuntimeException, std::exception ) uno::RuntimeException, std::exception )
...@@ -334,7 +327,6 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::visibilityChanged( sal_Bool /*bVisibl ...@@ -334,7 +327,6 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::visibilityChanged( sal_Bool /*bVisibl
} }
} }
uno::Reference< util::XCloseable > SAL_CALL SdrLightEmbeddedClient_Impl::getComponent() uno::Reference< util::XCloseable > SAL_CALL SdrLightEmbeddedClient_Impl::getComponent()
throw ( uno::RuntimeException, std::exception ) throw ( uno::RuntimeException, std::exception )
{ {
...@@ -364,14 +356,12 @@ sal_Bool SAL_CALL SdrLightEmbeddedClient_Impl::canInplaceActivate() ...@@ -364,14 +356,12 @@ sal_Bool SAL_CALL SdrLightEmbeddedClient_Impl::canInplaceActivate()
return bRet; return bRet;
} }
void SAL_CALL SdrLightEmbeddedClient_Impl::activatingInplace() void SAL_CALL SdrLightEmbeddedClient_Impl::activatingInplace()
throw ( embed::WrongStateException, throw ( embed::WrongStateException,
uno::RuntimeException, std::exception ) uno::RuntimeException, std::exception )
{ {
} }
void SAL_CALL SdrLightEmbeddedClient_Impl::activatingUI() void SAL_CALL SdrLightEmbeddedClient_Impl::activatingUI()
throw ( embed::WrongStateException, throw ( embed::WrongStateException,
uno::RuntimeException, std::exception ) uno::RuntimeException, std::exception )
...@@ -417,14 +407,12 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::activatingUI() ...@@ -417,14 +407,12 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::activatingUI()
} // for(sal_Int32 i = nCount-1 ; i >= 0;--i) } // for(sal_Int32 i = nCount-1 ; i >= 0;--i)
} }
void SAL_CALL SdrLightEmbeddedClient_Impl::deactivatedInplace() void SAL_CALL SdrLightEmbeddedClient_Impl::deactivatedInplace()
throw ( embed::WrongStateException, throw ( embed::WrongStateException,
uno::RuntimeException, std::exception ) uno::RuntimeException, std::exception )
{ {
} }
void SAL_CALL SdrLightEmbeddedClient_Impl::deactivatedUI() void SAL_CALL SdrLightEmbeddedClient_Impl::deactivatedUI()
throw ( embed::WrongStateException, throw ( embed::WrongStateException,
uno::RuntimeException, std::exception ) uno::RuntimeException, std::exception )
...@@ -439,7 +427,6 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::deactivatedUI() ...@@ -439,7 +427,6 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::deactivatedUI()
} }
} }
uno::Reference< css::frame::XLayoutManager > SAL_CALL SdrLightEmbeddedClient_Impl::getLayoutManager() uno::Reference< css::frame::XLayoutManager > SAL_CALL SdrLightEmbeddedClient_Impl::getLayoutManager()
throw ( embed::WrongStateException, throw ( embed::WrongStateException,
uno::RuntimeException, std::exception ) uno::RuntimeException, std::exception )
...@@ -459,7 +446,6 @@ uno::Reference< css::frame::XLayoutManager > SAL_CALL SdrLightEmbeddedClient_Imp ...@@ -459,7 +446,6 @@ uno::Reference< css::frame::XLayoutManager > SAL_CALL SdrLightEmbeddedClient_Imp
return xMan; return xMan;
} }
uno::Reference< frame::XDispatchProvider > SAL_CALL SdrLightEmbeddedClient_Impl::getInplaceDispatchProvider() uno::Reference< frame::XDispatchProvider > SAL_CALL SdrLightEmbeddedClient_Impl::getInplaceDispatchProvider()
throw ( embed::WrongStateException, throw ( embed::WrongStateException,
uno::RuntimeException, std::exception ) uno::RuntimeException, std::exception )
...@@ -468,7 +454,6 @@ uno::Reference< frame::XDispatchProvider > SAL_CALL SdrLightEmbeddedClient_Impl: ...@@ -468,7 +454,6 @@ uno::Reference< frame::XDispatchProvider > SAL_CALL SdrLightEmbeddedClient_Impl:
return uno::Reference < frame::XDispatchProvider >( lcl_getFrame_throw(mpObj), uno::UNO_QUERY_THROW ); return uno::Reference < frame::XDispatchProvider >( lcl_getFrame_throw(mpObj), uno::UNO_QUERY_THROW );
} }
awt::Rectangle SAL_CALL SdrLightEmbeddedClient_Impl::getPlacement() awt::Rectangle SAL_CALL SdrLightEmbeddedClient_Impl::getPlacement()
throw ( embed::WrongStateException, throw ( embed::WrongStateException,
uno::RuntimeException, std::exception ) uno::RuntimeException, std::exception )
...@@ -487,7 +472,6 @@ awt::Rectangle SAL_CALL SdrLightEmbeddedClient_Impl::getPlacement() ...@@ -487,7 +472,6 @@ awt::Rectangle SAL_CALL SdrLightEmbeddedClient_Impl::getPlacement()
return AWTRectangle( aLogicRect ); return AWTRectangle( aLogicRect );
} }
awt::Rectangle SAL_CALL SdrLightEmbeddedClient_Impl::getClipRectangle() awt::Rectangle SAL_CALL SdrLightEmbeddedClient_Impl::getClipRectangle()
throw ( embed::WrongStateException, throw ( embed::WrongStateException,
uno::RuntimeException, std::exception ) uno::RuntimeException, std::exception )
...@@ -495,21 +479,18 @@ awt::Rectangle SAL_CALL SdrLightEmbeddedClient_Impl::getClipRectangle() ...@@ -495,21 +479,18 @@ awt::Rectangle SAL_CALL SdrLightEmbeddedClient_Impl::getClipRectangle()
return getPlacement(); return getPlacement();
} }
void SAL_CALL SdrLightEmbeddedClient_Impl::translateAccelerators( const uno::Sequence< awt::KeyEvent >& /*aKeys*/ ) void SAL_CALL SdrLightEmbeddedClient_Impl::translateAccelerators( const uno::Sequence< awt::KeyEvent >& /*aKeys*/ )
throw ( embed::WrongStateException, throw ( embed::WrongStateException,
uno::RuntimeException, std::exception ) uno::RuntimeException, std::exception )
{ {
} }
void SAL_CALL SdrLightEmbeddedClient_Impl::scrollObject( const awt::Size& /*aOffset*/ ) void SAL_CALL SdrLightEmbeddedClient_Impl::scrollObject( const awt::Size& /*aOffset*/ )
throw ( embed::WrongStateException, throw ( embed::WrongStateException,
uno::RuntimeException, std::exception ) uno::RuntimeException, std::exception )
{ {
} }
void SAL_CALL SdrLightEmbeddedClient_Impl::changedPlacement( const awt::Rectangle& aPosRect ) void SAL_CALL SdrLightEmbeddedClient_Impl::changedPlacement( const awt::Rectangle& aPosRect )
throw ( embed::WrongStateException, throw ( embed::WrongStateException,
uno::Exception, uno::Exception,
...@@ -588,7 +569,6 @@ void SdrLightEmbeddedClient_Impl::setWindow(const uno::Reference< awt::XWindow > ...@@ -588,7 +569,6 @@ void SdrLightEmbeddedClient_Impl::setWindow(const uno::Reference< awt::XWindow >
m_xWindow = _xWindow; m_xWindow = _xWindow;
} }
class SdrEmbedObjectLink : public sfx2::SvBaseLink class SdrEmbedObjectLink : public sfx2::SvBaseLink
{ {
SdrOle2Obj* pObj; SdrOle2Obj* pObj;
...@@ -604,7 +584,6 @@ public: ...@@ -604,7 +584,6 @@ public:
bool Connect() { return GetRealObject() != nullptr; } bool Connect() { return GetRealObject() != nullptr; }
}; };
SdrEmbedObjectLink::SdrEmbedObjectLink(SdrOle2Obj* pObject): SdrEmbedObjectLink::SdrEmbedObjectLink(SdrOle2Obj* pObject):
::sfx2::SvBaseLink( ::SfxLinkUpdateMode::ONCALL, SotClipboardFormatId::SVXB ), ::sfx2::SvBaseLink( ::SfxLinkUpdateMode::ONCALL, SotClipboardFormatId::SVXB ),
pObj(pObject) pObj(pObject)
...@@ -612,12 +591,10 @@ SdrEmbedObjectLink::SdrEmbedObjectLink(SdrOle2Obj* pObject): ...@@ -612,12 +591,10 @@ SdrEmbedObjectLink::SdrEmbedObjectLink(SdrOle2Obj* pObject):
SetSynchron( false ); SetSynchron( false );
} }
SdrEmbedObjectLink::~SdrEmbedObjectLink() SdrEmbedObjectLink::~SdrEmbedObjectLink()
{ {
} }
::sfx2::SvBaseLink::UpdateResult SdrEmbedObjectLink::DataChanged( ::sfx2::SvBaseLink::UpdateResult SdrEmbedObjectLink::DataChanged(
const OUString& /*rMimeType*/, const css::uno::Any & /*rValue*/ ) const OUString& /*rMimeType*/, const css::uno::Any & /*rValue*/ )
{ {
...@@ -653,14 +630,12 @@ SdrEmbedObjectLink::~SdrEmbedObjectLink() ...@@ -653,14 +630,12 @@ SdrEmbedObjectLink::~SdrEmbedObjectLink()
return SUCCESS; return SUCCESS;
} }
void SdrEmbedObjectLink::Closed() void SdrEmbedObjectLink::Closed()
{ {
pObj->BreakFileLink_Impl(); pObj->BreakFileLink_Impl();
SvBaseLink::Closed(); SvBaseLink::Closed();
} }
class SdrOle2ObjImpl class SdrOle2ObjImpl
{ {
public: public:
...@@ -734,7 +709,6 @@ public: ...@@ -734,7 +709,6 @@ public:
} }
}; };
// Predicate determining whether the given OLE is an internal math // Predicate determining whether the given OLE is an internal math
// object // object
static bool ImplIsMathObj( const uno::Reference < embed::XEmbeddedObject >& rObjRef ) static bool ImplIsMathObj( const uno::Reference < embed::XEmbeddedObject >& rObjRef )
...@@ -757,7 +731,6 @@ static bool ImplIsMathObj( const uno::Reference < embed::XEmbeddedObject >& rObj ...@@ -757,7 +731,6 @@ static bool ImplIsMathObj( const uno::Reference < embed::XEmbeddedObject >& rObj
} }
} }
// BaseProperties section // BaseProperties section
sdr::properties::BaseProperties* SdrOle2Obj::CreateObjectSpecificProperties() sdr::properties::BaseProperties* SdrOle2Obj::CreateObjectSpecificProperties()
...@@ -765,7 +738,6 @@ sdr::properties::BaseProperties* SdrOle2Obj::CreateObjectSpecificProperties() ...@@ -765,7 +738,6 @@ sdr::properties::BaseProperties* SdrOle2Obj::CreateObjectSpecificProperties()
return new sdr::properties::OleProperties(*this); return new sdr::properties::OleProperties(*this);
} }
// DrawContact section // DrawContact section
sdr::contact::ViewContact* SdrOle2Obj::CreateObjectSpecificViewContact() sdr::contact::ViewContact* SdrOle2Obj::CreateObjectSpecificViewContact()
...@@ -773,7 +745,6 @@ sdr::contact::ViewContact* SdrOle2Obj::CreateObjectSpecificViewContact() ...@@ -773,7 +745,6 @@ sdr::contact::ViewContact* SdrOle2Obj::CreateObjectSpecificViewContact()
return new sdr::contact::ViewContactOfSdrOle2Obj(*this); return new sdr::contact::ViewContactOfSdrOle2Obj(*this);
} }
SdrOle2Obj::SdrOle2Obj( bool bFrame_ ) : SdrOle2Obj::SdrOle2Obj( bool bFrame_ ) :
mpImpl(new SdrOle2ObjImpl(bFrame_)) mpImpl(new SdrOle2ObjImpl(bFrame_))
{ {
...@@ -802,7 +773,6 @@ OUString SdrOle2Obj::GetStyleString() ...@@ -802,7 +773,6 @@ OUString SdrOle2Obj::GetStyleString()
return strStyle; return strStyle;
} }
SdrOle2Obj::~SdrOle2Obj() SdrOle2Obj::~SdrOle2Obj()
{ {
mpImpl->mbInDestruction = true; mpImpl->mbInDestruction = true;
...@@ -817,11 +787,8 @@ SdrOle2Obj::~SdrOle2Obj() ...@@ -817,11 +787,8 @@ SdrOle2Obj::~SdrOle2Obj()
mpImpl->pLightClient->Release(); mpImpl->pLightClient->Release();
mpImpl->pLightClient = nullptr; mpImpl->pLightClient = nullptr;
} }
delete mpImpl;
} }
void SdrOle2Obj::SetAspect( sal_Int64 nAspect ) void SdrOle2Obj::SetAspect( sal_Int64 nAspect )
{ {
mpImpl->mxObjRef.SetViewAspect( nAspect ); mpImpl->mxObjRef.SetViewAspect( nAspect );
...@@ -888,7 +855,6 @@ bool SdrOle2Obj::IsEmpty() const ...@@ -888,7 +855,6 @@ bool SdrOle2Obj::IsEmpty() const
return !mpImpl->mxObjRef.is(); return !mpImpl->mxObjRef.is();
} }
void SdrOle2Obj::Connect() void SdrOle2Obj::Connect()
{ {
if( IsEmptyPresObj() ) if( IsEmptyPresObj() )
...@@ -906,7 +872,6 @@ void SdrOle2Obj::Connect() ...@@ -906,7 +872,6 @@ void SdrOle2Obj::Connect()
AddListeners_Impl(); AddListeners_Impl();
} }
bool SdrOle2Obj::UpdateLinkURL_Impl() bool SdrOle2Obj::UpdateLinkURL_Impl()
{ {
bool bResult = false; bool bResult = false;
...@@ -965,7 +930,6 @@ bool SdrOle2Obj::UpdateLinkURL_Impl() ...@@ -965,7 +930,6 @@ bool SdrOle2Obj::UpdateLinkURL_Impl()
return bResult; return bResult;
} }
void SdrOle2Obj::BreakFileLink_Impl() void SdrOle2Obj::BreakFileLink_Impl()
{ {
uno::Reference<document::XStorageBasedDocument> xDoc; uno::Reference<document::XStorageBasedDocument> xDoc;
...@@ -997,7 +961,6 @@ void SdrOle2Obj::BreakFileLink_Impl() ...@@ -997,7 +961,6 @@ void SdrOle2Obj::BreakFileLink_Impl()
} }
} }
void SdrOle2Obj::DisconnectFileLink_Impl() void SdrOle2Obj::DisconnectFileLink_Impl()
{ {
sfx2::LinkManager* pLinkManager = pModel ? pModel->GetLinkManager() : nullptr; sfx2::LinkManager* pLinkManager = pModel ? pModel->GetLinkManager() : nullptr;
...@@ -1008,7 +971,6 @@ void SdrOle2Obj::DisconnectFileLink_Impl() ...@@ -1008,7 +971,6 @@ void SdrOle2Obj::DisconnectFileLink_Impl()
} }
} }
void SdrOle2Obj::CheckFileLink_Impl() void SdrOle2Obj::CheckFileLink_Impl()
{ {
if (pModel && mpImpl->mxObjRef.GetObject().is() && !mpImpl->mpObjectLink) if (pModel && mpImpl->mxObjRef.GetObject().is() && !mpImpl->mpObjectLink)
...@@ -1045,7 +1007,6 @@ void SdrOle2Obj::CheckFileLink_Impl() ...@@ -1045,7 +1007,6 @@ void SdrOle2Obj::CheckFileLink_Impl()
} }
} }
void SdrOle2Obj::Reconnect_Impl() void SdrOle2Obj::Reconnect_Impl()
{ {
DBG_ASSERT( mpImpl->mbConnected, "Assigned unconnected object?!" ); DBG_ASSERT( mpImpl->mbConnected, "Assigned unconnected object?!" );
...@@ -1169,7 +1130,6 @@ void SdrOle2Obj::AddListeners_Impl() ...@@ -1169,7 +1130,6 @@ void SdrOle2Obj::AddListeners_Impl()
} }
} }
void SdrOle2Obj::Disconnect() void SdrOle2Obj::Disconnect()
{ {
if( IsEmptyPresObj() ) if( IsEmptyPresObj() )
...@@ -1297,7 +1257,6 @@ void SdrOle2Obj::Disconnect_Impl() ...@@ -1297,7 +1257,6 @@ void SdrOle2Obj::Disconnect_Impl()
mpImpl->mbConnected = false; mpImpl->mbConnected = false;
} }
SdrObject* SdrOle2Obj::createSdrGrafObjReplacement(bool bAddText, bool /* bUseHCGraphic */) const SdrObject* SdrOle2Obj::createSdrGrafObjReplacement(bool bAddText, bool /* bUseHCGraphic */) const
{ {
const Graphic* pOLEGraphic = GetGraphic(); const Graphic* pOLEGraphic = GetGraphic();
...@@ -1374,7 +1333,6 @@ SdrObject* SdrOle2Obj::DoConvertToPolyObj(bool bBezier, bool bAddText) const ...@@ -1374,7 +1333,6 @@ SdrObject* SdrOle2Obj::DoConvertToPolyObj(bool bBezier, bool bAddText) const
return nullptr; return nullptr;
} }
void SdrOle2Obj::SetModel(SdrModel* pNewModel) void SdrOle2Obj::SetModel(SdrModel* pNewModel)
{ {
::comphelper::IEmbeddedHelper* pDestPers = pNewModel ? pNewModel->GetPersist() : nullptr; ::comphelper::IEmbeddedHelper* pDestPers = pNewModel ? pNewModel->GetPersist() : nullptr;
...@@ -1449,7 +1407,6 @@ void SdrOle2Obj::SetModel(SdrModel* pNewModel) ...@@ -1449,7 +1407,6 @@ void SdrOle2Obj::SetModel(SdrModel* pNewModel)
AddListeners_Impl(); AddListeners_Impl();
} }
void SdrOle2Obj::SetPage(SdrPage* pNewPage) void SdrOle2Obj::SetPage(SdrPage* pNewPage)
{ {
bool bRemove=pNewPage==nullptr && pPage!=nullptr; bool bRemove=pNewPage==nullptr && pPage!=nullptr;
...@@ -1484,7 +1441,6 @@ void SdrOle2Obj::SetPage(SdrPage* pNewPage) ...@@ -1484,7 +1441,6 @@ void SdrOle2Obj::SetPage(SdrPage* pNewPage)
Connect(); Connect();
} }
void SdrOle2Obj::SetObjRef( const css::uno::Reference < css::embed::XEmbeddedObject >& rNewObjRef ) void SdrOle2Obj::SetObjRef( const css::uno::Reference < css::embed::XEmbeddedObject >& rNewObjRef )
{ {
DBG_ASSERT( !rNewObjRef.is() || !mpImpl->mxObjRef.GetObject().is(), "SetObjRef called on already initialized object!"); DBG_ASSERT( !rNewObjRef.is() || !mpImpl->mxObjRef.GetObject().is(), "SetObjRef called on already initialized object!");
...@@ -1523,7 +1479,6 @@ void SdrOle2Obj::SetObjRef( const css::uno::Reference < css::embed::XEmbeddedObj ...@@ -1523,7 +1479,6 @@ void SdrOle2Obj::SetObjRef( const css::uno::Reference < css::embed::XEmbeddedObj
BroadcastObjectChange(); BroadcastObjectChange();
} }
void SdrOle2Obj::SetClosedObj( bool bIsClosed ) void SdrOle2Obj::SetClosedObj( bool bIsClosed )
{ {
// TODO/LATER: do we still need this hack? // TODO/LATER: do we still need this hack?
...@@ -1531,14 +1486,12 @@ void SdrOle2Obj::SetClosedObj( bool bIsClosed ) ...@@ -1531,14 +1486,12 @@ void SdrOle2Obj::SetClosedObj( bool bIsClosed )
bClosedObj = bIsClosed; bClosedObj = bIsClosed;
} }
SdrObject* SdrOle2Obj::getFullDragClone() const SdrObject* SdrOle2Obj::getFullDragClone() const
{ {
// #i118485# use central replacement generator // #i118485# use central replacement generator
return createSdrGrafObjReplacement(false, true); return createSdrGrafObjReplacement(false, true);
} }
void SdrOle2Obj::SetPersistName( const OUString& rPersistName ) void SdrOle2Obj::SetPersistName( const OUString& rPersistName )
{ {
DBG_ASSERT( mpImpl->aPersistName.isEmpty(), "Persist name changed!"); DBG_ASSERT( mpImpl->aPersistName.isEmpty(), "Persist name changed!");
...@@ -1557,13 +1510,11 @@ void SdrOle2Obj::AbandonObject() ...@@ -1557,13 +1510,11 @@ void SdrOle2Obj::AbandonObject()
SetObjRef(nullptr); SetObjRef(nullptr);
} }
const OUString& SdrOle2Obj::GetPersistName() const const OUString& SdrOle2Obj::GetPersistName() const
{ {
return mpImpl->aPersistName; return mpImpl->aPersistName;
} }
void SdrOle2Obj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const void SdrOle2Obj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
{ {
// #i118485# Allowing much more attributes for OLEs // #i118485# Allowing much more attributes for OLEs
...@@ -1584,13 +1535,11 @@ void SdrOle2Obj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const ...@@ -1584,13 +1535,11 @@ void SdrOle2Obj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
rInfo.bCanConvToContour = true; rInfo.bCanConvToContour = true;
} }
sal_uInt16 SdrOle2Obj::GetObjIdentifier() const sal_uInt16 SdrOle2Obj::GetObjIdentifier() const
{ {
return mpImpl->mbFrame ? sal_uInt16(OBJ_FRAME) : sal_uInt16(OBJ_OLE2); return mpImpl->mbFrame ? sal_uInt16(OBJ_FRAME) : sal_uInt16(OBJ_OLE2);
} }
OUString SdrOle2Obj::TakeObjNameSingul() const OUString SdrOle2Obj::TakeObjNameSingul() const
{ {
OUStringBuffer sName(ImpGetResStr(mpImpl->mbFrame ? STR_ObjNameSingulFrame : STR_ObjNameSingulOLE2)); OUStringBuffer sName(ImpGetResStr(mpImpl->mbFrame ? STR_ObjNameSingulFrame : STR_ObjNameSingulOLE2));
...@@ -1607,7 +1556,6 @@ OUString SdrOle2Obj::TakeObjNameSingul() const ...@@ -1607,7 +1556,6 @@ OUString SdrOle2Obj::TakeObjNameSingul() const
return sName.makeStringAndClear(); return sName.makeStringAndClear();
} }
OUString SdrOle2Obj::TakeObjNamePlural() const OUString SdrOle2Obj::TakeObjNamePlural() const
{ {
return ImpGetResStr(mpImpl->mbFrame ? STR_ObjNamePluralFrame : STR_ObjNamePluralOLE2); return ImpGetResStr(mpImpl->mbFrame ? STR_ObjNamePluralFrame : STR_ObjNamePluralOLE2);
...@@ -1816,7 +1764,6 @@ void SdrOle2Obj::ImpSetVisAreaSize() ...@@ -1816,7 +1764,6 @@ void SdrOle2Obj::ImpSetVisAreaSize()
} }
} }
void SdrOle2Obj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) void SdrOle2Obj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
{ {
if( pModel && !pModel->isLocked() ) if( pModel && !pModel->isLocked() )
...@@ -1836,7 +1783,6 @@ void SdrOle2Obj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract ...@@ -1836,7 +1783,6 @@ void SdrOle2Obj::NbcResize(const Point& rRef, const Fraction& xFact, const Fract
ImpSetVisAreaSize(); ImpSetVisAreaSize();
} }
void SdrOle2Obj::SetGeoData(const SdrObjGeoData& rGeo) void SdrOle2Obj::SetGeoData(const SdrObjGeoData& rGeo)
{ {
SdrRectObj::SetGeoData(rGeo); SdrRectObj::SetGeoData(rGeo);
...@@ -1845,7 +1791,6 @@ void SdrOle2Obj::SetGeoData(const SdrObjGeoData& rGeo) ...@@ -1845,7 +1791,6 @@ void SdrOle2Obj::SetGeoData(const SdrObjGeoData& rGeo)
ImpSetVisAreaSize(); ImpSetVisAreaSize();
} }
void SdrOle2Obj::NbcSetSnapRect(const Rectangle& rRect) void SdrOle2Obj::NbcSetSnapRect(const Rectangle& rRect)
{ {
SdrRectObj::NbcSetSnapRect(rRect); SdrRectObj::NbcSetSnapRect(rRect);
...@@ -1862,7 +1807,6 @@ void SdrOle2Obj::NbcSetSnapRect(const Rectangle& rRect) ...@@ -1862,7 +1807,6 @@ void SdrOle2Obj::NbcSetSnapRect(const Rectangle& rRect)
} }
} }
void SdrOle2Obj::NbcSetLogicRect(const Rectangle& rRect) void SdrOle2Obj::NbcSetLogicRect(const Rectangle& rRect)
{ {
SdrRectObj::NbcSetLogicRect(rRect); SdrRectObj::NbcSetLogicRect(rRect);
...@@ -1884,7 +1828,6 @@ void SdrOle2Obj::GetNewReplacement() ...@@ -1884,7 +1828,6 @@ void SdrOle2Obj::GetNewReplacement()
mpImpl->mxObjRef.UpdateReplacement(); mpImpl->mxObjRef.UpdateReplacement();
} }
Size SdrOle2Obj::GetOrigObjSize( MapMode* pTargetMapMode ) const Size SdrOle2Obj::GetOrigObjSize( MapMode* pTargetMapMode ) const
{ {
return mpImpl->mxObjRef.GetSize( pTargetMapMode ); return mpImpl->mxObjRef.GetSize( pTargetMapMode );
...@@ -1903,7 +1846,6 @@ void SdrOle2Obj::NbcMove(const Size& rSize) ...@@ -1903,7 +1846,6 @@ void SdrOle2Obj::NbcMove(const Size& rSize)
ImpSetVisAreaSize(); ImpSetVisAreaSize();
} }
bool SdrOle2Obj::CanUnloadRunningObj( const uno::Reference< embed::XEmbeddedObject >& xObj, sal_Int64 nAspect ) bool SdrOle2Obj::CanUnloadRunningObj( const uno::Reference< embed::XEmbeddedObject >& xObj, sal_Int64 nAspect )
{ {
uno::Reference<embed::XEmbedPersist2> xPersist(xObj, uno::UNO_QUERY); uno::Reference<embed::XEmbedPersist2> xPersist(xObj, uno::UNO_QUERY);
...@@ -1944,7 +1886,6 @@ bool SdrOle2Obj::CanUnloadRunningObj( const uno::Reference< embed::XEmbeddedObje ...@@ -1944,7 +1886,6 @@ bool SdrOle2Obj::CanUnloadRunningObj( const uno::Reference< embed::XEmbeddedObje
return bResult; return bResult;
} }
bool SdrOle2Obj::Unload( const uno::Reference< embed::XEmbeddedObject >& xObj, sal_Int64 nAspect ) bool SdrOle2Obj::Unload( const uno::Reference< embed::XEmbeddedObject >& xObj, sal_Int64 nAspect )
{ {
bool bResult = false; bool bResult = false;
...@@ -1970,7 +1911,6 @@ bool SdrOle2Obj::Unload( const uno::Reference< embed::XEmbeddedObject >& xObj, s ...@@ -1970,7 +1911,6 @@ bool SdrOle2Obj::Unload( const uno::Reference< embed::XEmbeddedObject >& xObj, s
return bResult; return bResult;
} }
bool SdrOle2Obj::Unload() bool SdrOle2Obj::Unload()
{ {
if (!mpImpl->mxObjRef.is()) if (!mpImpl->mxObjRef.is())
...@@ -1986,7 +1926,6 @@ bool SdrOle2Obj::Unload() ...@@ -1986,7 +1926,6 @@ bool SdrOle2Obj::Unload()
return bUnloaded; return bUnloaded;
} }
void SdrOle2Obj::GetObjRef_Impl() void SdrOle2Obj::GetObjRef_Impl()
{ {
if ( !mpImpl->mxObjRef.is() && !mpImpl->aPersistName.isEmpty() && pModel && pModel->GetPersist() ) if ( !mpImpl->mxObjRef.is() && !mpImpl->aPersistName.isEmpty() && pModel && pModel->GetPersist() )
...@@ -2077,7 +2016,6 @@ uno::Reference < embed::XEmbeddedObject > SdrOle2Obj::GetObjRef_NoInit() const ...@@ -2077,7 +2016,6 @@ uno::Reference < embed::XEmbeddedObject > SdrOle2Obj::GetObjRef_NoInit() const
return mpImpl->mxObjRef.GetObject(); return mpImpl->mxObjRef.GetObject();
} }
uno::Reference< frame::XModel > SdrOle2Obj::getXModel() const uno::Reference< frame::XModel > SdrOle2Obj::getXModel() const
{ {
GetObjRef(); GetObjRef();
...@@ -2087,7 +2025,6 @@ uno::Reference< frame::XModel > SdrOle2Obj::getXModel() const ...@@ -2087,7 +2025,6 @@ uno::Reference< frame::XModel > SdrOle2Obj::getXModel() const
return uno::Reference< frame::XModel >(); return uno::Reference< frame::XModel >();
} }
bool SdrOle2Obj::IsChart() const bool SdrOle2Obj::IsChart() const
{ {
if (!mpImpl->mbTypeAsked) if (!mpImpl->mbTypeAsked)
...@@ -2117,13 +2054,11 @@ void SdrOle2Obj::SetGraphicToObj( const Graphic& aGraphic, const OUString& aMedi ...@@ -2117,13 +2054,11 @@ void SdrOle2Obj::SetGraphicToObj( const Graphic& aGraphic, const OUString& aMedi
mpImpl->mxObjRef.SetGraphic( aGraphic, aMediaType ); mpImpl->mxObjRef.SetGraphic( aGraphic, aMediaType );
} }
void SdrOle2Obj::SetGraphicToObj( const uno::Reference< io::XInputStream >& xGrStream, const OUString& aMediaType ) void SdrOle2Obj::SetGraphicToObj( const uno::Reference< io::XInputStream >& xGrStream, const OUString& aMediaType )
{ {
mpImpl->mxObjRef.SetGraphicStream( xGrStream, aMediaType ); mpImpl->mxObjRef.SetGraphicStream( xGrStream, aMediaType );
} }
bool SdrOle2Obj::IsCalc() const bool SdrOle2Obj::IsCalc() const
{ {
if ( !mpImpl->mxObjRef.is() ) if ( !mpImpl->mxObjRef.is() )
...@@ -2152,7 +2087,6 @@ uno::Reference< frame::XModel > SdrOle2Obj::GetParentXModel() const ...@@ -2152,7 +2087,6 @@ uno::Reference< frame::XModel > SdrOle2Obj::GetParentXModel() const
return xDoc; return xDoc;
} }
bool SdrOle2Obj::CalculateNewScaling( Fraction& aScaleWidth, Fraction& aScaleHeight, Size& aObjAreaSize ) bool SdrOle2Obj::CalculateNewScaling( Fraction& aScaleWidth, Fraction& aScaleHeight, Size& aObjAreaSize )
{ {
// TODO/LEAN: to avoid rounding errors scaling always uses the VisArea. // TODO/LEAN: to avoid rounding errors scaling always uses the VisArea.
...@@ -2174,7 +2108,6 @@ bool SdrOle2Obj::CalculateNewScaling( Fraction& aScaleWidth, Fraction& aScaleHei ...@@ -2174,7 +2108,6 @@ bool SdrOle2Obj::CalculateNewScaling( Fraction& aScaleWidth, Fraction& aScaleHei
return true; return true;
} }
bool SdrOle2Obj::AddOwnLightClient() bool SdrOle2Obj::AddOwnLightClient()
{ {
// The Own Light Client must be registered in object only using this method! // The Own Light Client must be registered in object only using this method!
...@@ -2206,13 +2139,11 @@ bool SdrOle2Obj::AddOwnLightClient() ...@@ -2206,13 +2139,11 @@ bool SdrOle2Obj::AddOwnLightClient()
return true; return true;
} }
Graphic SdrOle2Obj::GetEmptyOLEReplacementGraphic() Graphic SdrOle2Obj::GetEmptyOLEReplacementGraphic()
{ {
return Graphic(BitmapEx(ResId(BMP_SVXOLEOBJ, *ImpGetResMgr()))); return Graphic(BitmapEx(ResId(BMP_SVXOLEOBJ, *ImpGetResMgr())));
} }
void SdrOle2Obj::SetWindow(const css::uno::Reference < css::awt::XWindow >& _xWindow) void SdrOle2Obj::SetWindow(const css::uno::Reference < css::awt::XWindow >& _xWindow)
{ {
if ( mpImpl->mxObjRef.is() && mpImpl->pLightClient ) if ( mpImpl->mxObjRef.is() && mpImpl->pLightClient )
......
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