summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2011-12-02 23:43:23 +0100
committerMichael Stahl <mstahl@redhat.com>2011-12-03 00:48:15 +0100
commitfd95f1ab6220c6a530fd2e4e727417f504a5db51 (patch)
treeb378d6e72698a8329f41d7919016574a301016e2 /sd
parentaa59ee85a8e902aa4dc956822e9169093de6c454 (diff)
refactor SdrModel::GetDocumentStream
Remove 3 ~identical implementations of GetDocumentStream and the associated struct SdrDocumentStreamInfo.
Diffstat (limited to 'sd')
-rw-r--r--sd/inc/drawdoc.hxx1
-rw-r--r--sd/source/core/drawdoc3.cxx82
-rw-r--r--sd/source/ui/inc/DrawDocShell.hxx1
3 files changed, 0 insertions, 84 deletions
diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
index 86b2ef85fdfe..7e087f581681 100644
--- a/sd/inc/drawdoc.hxx
+++ b/sd/inc/drawdoc.hxx
@@ -229,7 +229,6 @@ public:
virtual void DisposeLoadedModels();
virtual bool IsReadOnly() const;
virtual void SetChanged(sal_Bool bFlag = sal_True);
- virtual SvStream* GetDocumentStream(SdrDocumentStreamInfo& rStreamInfo) const;
SfxItemPool& GetPool() { return( *pItemPool ); }
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index b4000157dfac..c05af4811b20 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -1242,88 +1242,6 @@ List* SdDrawDocument::GetCustomShowList(sal_Bool bCreate)
/*************************************************************************
|*
-|* Document-Stream herausgeben (fuer load-on-demand Graphiken)
-|*
-\************************************************************************/
-
-SvStream* SdDrawDocument::GetDocumentStream(SdrDocumentStreamInfo& rStreamInfo) const
-{
- uno::Reference < embed::XStorage > xStor;
- if (mpDocSh)
- xStor = mpDocSh->GetStorage();
- SvStream* pRet = NULL;
-
- if( xStor.is() )
- {
- //TODO/MBA: binary format removed, needs testing
- if( rStreamInfo.maUserData.Len() &&
- ( rStreamInfo.maUserData.GetToken( 0, ':' ) ==
- String( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.Package" ) ) ) )
- {
- const String aPicturePath( rStreamInfo.maUserData.GetToken( 1, ':' ) );
-
- // graphic from picture stream in picture storage in XML package
- if( aPicturePath.GetTokenCount( '/' ) == 2 ) try
- {
- const String aPictureStreamName( aPicturePath.GetToken( 1, '/' ) );
- const String aPictureStorageName( aPicturePath.GetToken( 0, '/' ) );
- if( xStor->isStorageElement( aPictureStorageName ) )
- {
- uno::Reference < embed::XStorage > xPictureStorage =
- xStor->openStorageElement( aPictureStorageName, embed::ElementModes::READ );
- try
- {
- if( xPictureStorage.is() && xPictureStorage->isStreamElement( aPictureStreamName ) )
- {
- uno::Reference < io::XStream > xStream = xPictureStorage->openStreamElement( aPictureStreamName, embed::ElementModes::READ );
- if( xStream.is() )
- pRet = ::utl::UcbStreamHelper::CreateStream( xStream );
- }
- }
- catch( container::NoSuchElementException& )
- {
- }
- }
- }
- catch( uno::Exception& e )
- {
- (void)e;
- OSL_FAIL(
- (rtl::OString("sd::SdDrawDocument::GetDocumentStream(), "
- "exception caught: ") +
- rtl::OUStringToOString(
- comphelper::anyToString( cppu::getCaughtException() ),
- RTL_TEXTENCODING_UTF8 ) +
- rtl::OString("\r\nATTENTION: Graphics may get lost now, please inform CL or KA!") ).getStr() );
- }
-
- rStreamInfo.mbDeleteAfterUse = ( pRet != NULL );
- }
- }
-
-#if OSL_DEBUG_LEVEL > 1
- if( pRet )
- {
- // try to get some information from stream
- const sal_uLong nStartPos = pRet->Tell();
- const sal_uLong nEndPos = pRet->Seek( STREAM_SEEK_TO_END );
- const sal_uLong nStmLen = nEndPos - nStartPos;
- sal_uChar aTestByte;
-
- // try to read one byte
- if( nStmLen )
- *pRet >> aTestByte;
-
- pRet->Seek( nStartPos );
- }
-#endif
-
- return pRet;
-}
-
-
-/*************************************************************************
-|*
|* Nicht benutzte MasterPages und Layouts entfernen
|*
\************************************************************************/
diff --git a/sd/source/ui/inc/DrawDocShell.hxx b/sd/source/ui/inc/DrawDocShell.hxx
index 02f225d20cb9..0083f53ec9bc 100644
--- a/sd/source/ui/inc/DrawDocShell.hxx
+++ b/sd/source/ui/inc/DrawDocShell.hxx
@@ -47,7 +47,6 @@ class SdDrawDocument;
class SvxItemFactory;
class SdPage;
class SfxPrinter;
-struct SdrDocumentStreamInfo;
struct SpellCallbackInfo;
class AbstractSvxNameDialog;
class SfxUndoManager;