diff options
-rw-r--r-- | svx/source/msfilter/eschesdo.cxx | 6 | ||||
-rw-r--r-- | svx/source/svdraw/svdmodel.cxx | 32 | ||||
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 32 | ||||
-rw-r--r-- | svx/source/svdraw/svdpage.cxx | 31 |
4 files changed, 92 insertions, 9 deletions
diff --git a/svx/source/msfilter/eschesdo.cxx b/svx/source/msfilter/eschesdo.cxx index 43041bb81083..93427ff99d36 100644 --- a/svx/source/msfilter/eschesdo.cxx +++ b/svx/source/msfilter/eschesdo.cxx @@ -2,9 +2,9 @@ * * $RCSfile: eschesdo.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: er $ $Date: 2000-10-11 12:17:30 $ + * last change: $Author: cl $ $Date: 2000-11-26 14:06:27 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -2517,7 +2517,7 @@ ImplEESdrObject::ImplEESdrObject( ImplEscherExSdr& rEx, { // why not declare a const parameter if the object will // not be modified? - mXShape = pSvxDrawPage->_CreateShape( (SdrObject*) &rObj ); + mXShape = uno::Reference< drawing::XShape >::query( ((SdrObject*)&rObj)->getUnoShape() );; Init( rEx ); } } diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index 7c5806d353d3..d348a5d6c398 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdmodel.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: dl $ $Date: 2000-11-21 14:20:34 $ + * last change: $Author: cl $ $Date: 2000-11-26 14:10:44 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -127,6 +127,8 @@ #include <outlobj.hxx> #endif +using namespace ::com::sun::star; + //////////////////////////////////////////////////////////////////////////////////////////////////// SdrModelInfo::SdrModelInfo(FASTBOOL bInit): @@ -2489,6 +2491,32 @@ void SdrModel::PostSave() } } +uno::Reference< uno::XInterface > SdrModel::getUnoModel() +{ + // try weak reference first + uno::Reference< uno::XInterface > xModel( mxUnoModel ); + +#ifndef SVX_LIGHT + if( !xModel.is() ) + { + // create one + xModel = createUnoModel(); + + mxUnoModel = xModel; + } +#endif + + return xModel; + +} + +uno::Reference< uno::XInterface > SdrModel::createUnoModel() +{ + DBG_ERROR( "SdrModel::createUnoModel() - base implementation should not be called!" ); + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xInt; + return xInt; +} + //////////////////////////////////////////////////////////////////////////////////////////////////// TYPEINIT1(SdrHint,SfxHint); diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index df733712eec8..a0fe908c363c 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdobj.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: aw $ $Date: 2000-11-09 09:42:57 $ + * last change: $Author: cl $ $Date: 2000-11-26 14:09:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -109,6 +109,7 @@ #include "xlntrit.hxx" #include "xfltrit.hxx" #include "xlinjoit.hxx" +#include "unopage.hxx" #ifndef _SVDPOOL_HXX #include "svdpool.hxx" @@ -118,6 +119,8 @@ #include "editeng.hxx" #endif +using namespace ::com::sun::star; + //////////////////////////////////////////////////////////////////////////////////////////////////// TYPEINIT0(SdrObjUserCall); @@ -4233,6 +4236,31 @@ void SdrObject::MigrateItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool) // Hier passiert erst was in SdrAttrObj und in SdrObjGroup } +::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SdrObject::getUnoShape() +{ + // try weak reference first + uno::Reference< uno::XInterface > xShape( mxUnoShape ); + +#ifndef SVX_LIGHT + if( !xShape.is() && pPage ) + { + uno::Reference< uno::XInterface > xPage( pPage->getUnoPage() ); + if( xPage.is() ) + { + SvxDrawPage* pDrawPage = SvxDrawPage::getImplementation(xPage); + if( pDrawPage ) + { + // create one + xShape = pDrawPage->_CreateShape( this ); + mxUnoShape = xShape; + } + } + } +#endif + + return xShape; +} + //////////////////////////////////////////////////////////////////////////////////////////////////// // // @@@@ @@@@@ @@@@@@ @@@@@ @@@@ @@@@ @@@@@@ @@@@ @@@@@ @@ @@ diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index 841a5aeea986..12afd7b3eb75 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -2,9 +2,9 @@ * * $RCSfile: svdpage.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: aw $ $Date: 2000-10-30 11:11:37 $ + * last change: $Author: cl $ $Date: 2000-11-26 14:09:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -102,6 +102,8 @@ #define CONVERT_STARIMAGE_OLE_OBJECT_TO_GRAPHIC 1 +using namespace ::com::sun::star; + DBG_NAME(SdrObjList); TYPEINIT0(SdrObjList); @@ -1741,6 +1743,31 @@ void SdrPage::SetBackgroundObj( SdrObject* pObj ) delete pBackgroundObj, pBackgroundObj = pObj; } +uno::Reference< uno::XInterface > SdrPage::getUnoPage() +{ + // try weak reference first + uno::Reference< uno::XInterface > xPage( mxUnoPage ); + +#ifndef SVX_LIGHT + if( !xPage.is() ) + { + // create one + xPage = createUnoPage(); + + mxUnoPage = xPage; + } +#endif + + return xPage; +} + +uno::Reference< uno::XInterface > SdrPage::createUnoPage() +{ + DBG_ERROR( "SdrModel::createUnoPage() - base implementation should not be called!" ); + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xInt; + return xInt; +} + #ifdef GCC // Dummy-Implementationen fuer Deklarationen in svdpage.hxx Bitmap SdrPage::GetBitmap(const SetOfByte& rVisibleLayers, FASTBOOL bTrimBorders=TRUE) const {} |