diff options
author | Kai Ahrens <ka@openoffice.org> | 2001-06-15 09:40:52 +0000 |
---|---|---|
committer | Kai Ahrens <ka@openoffice.org> | 2001-06-15 09:40:52 +0000 |
commit | d57cc29c9b7b52336ed5bd47d330365aa33a42c8 (patch) | |
tree | e8381dc5468c2c4a1dedc3f5fdce9b3504e5e834 /svx | |
parent | 89a0387a4e421c49ad4159ef99032371fbe6ac16 (diff) |
#87313#: added new ::Create method
Diffstat (limited to 'svx')
-rw-r--r-- | svx/inc/xmlgrhlp.hxx | 6 | ||||
-rw-r--r-- | svx/source/xml/xmlgrhlp.cxx | 24 |
2 files changed, 22 insertions, 8 deletions
diff --git a/svx/inc/xmlgrhlp.hxx b/svx/inc/xmlgrhlp.hxx index 5893768e15aa..ba81ec61fe45 100644 --- a/svx/inc/xmlgrhlp.hxx +++ b/svx/inc/xmlgrhlp.hxx @@ -2,7 +2,7 @@ * * $RCSfile: xmlgrhlp.hxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * * last change: $Author: ka $ * @@ -152,7 +152,7 @@ protected: SvXMLGraphicHelper(); ~SvXMLGraphicHelper(); - void Init( SotStorage& rXMLStorage, + void Init( SotStorage* pXMLStorage, SvXMLGraphicHelperMode eCreateMode, BOOL bDirect ); @@ -161,6 +161,8 @@ public: static SvXMLGraphicHelper* Create( SotStorage& rXMLStorage, SvXMLGraphicHelperMode eCreateMode, BOOL bDirect = TRUE ); + static SvXMLGraphicHelper* Create( SvXMLGraphicHelperMode eCreateMode ); + static void Destroy( SvXMLGraphicHelper* pSvXMLGraphicHelper ); void Flush(); diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index 69622e241178..ced387ec751b 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmlgrhlp.cxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: rt $ + * last change: $Author: ka $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -403,7 +403,7 @@ sal_Bool SvXMLGraphicHelper::ImplGetStreamNames( const ::rtl::OUString& rURLStr, SotStorageRef SvXMLGraphicHelper::ImplGetGraphicStorage( const ::rtl::OUString& rStorageName ) { - if( !mxGraphicStorage.Is() || ( rStorageName != maCurStorageName ) ) + if( mpRootStorage && ( !mxGraphicStorage.Is() || ( rStorageName != maCurStorageName ) ) ) { if( mxGraphicStorage.Is() && GRAPHICHELPER_MODE_WRITE == meCreateMode ) mxGraphicStorage->Commit(); @@ -649,11 +649,11 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, s // ----------------------------------------------------------------------------- -void SvXMLGraphicHelper::Init( SotStorage& rXMLStorage, +void SvXMLGraphicHelper::Init( SotStorage* pXMLStorage, SvXMLGraphicHelperMode eCreateMode, BOOL bDirect ) { - mpRootStorage = &rXMLStorage; + mpRootStorage = pXMLStorage; meCreateMode = eCreateMode; mbDirect = bDirect; } @@ -667,7 +667,19 @@ SvXMLGraphicHelper* SvXMLGraphicHelper::Create( SotStorage& rXMLStorage, SvXMLGraphicHelper* pThis = new SvXMLGraphicHelper; pThis->acquire(); - pThis->Init( rXMLStorage, eCreateMode, bDirect ); + pThis->Init( &rXMLStorage, eCreateMode, bDirect ); + + return pThis; +} + +// ----------------------------------------------------------------------------- + +SvXMLGraphicHelper* SvXMLGraphicHelper::Create( SvXMLGraphicHelperMode eCreateMode ) +{ + SvXMLGraphicHelper* pThis = new SvXMLGraphicHelper; + + pThis->acquire(); + pThis->Init( NULL, eCreateMode, sal_False ); return pThis; } |