summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-11-19 11:09:44 +0100
committerMatúš Kukan <matus.kukan@collabora.com>2014-11-19 11:28:56 +0100
commitb62e70ef6f352c61d50eca36388e9aa8d3f5e412 (patch)
tree7ff3bbf0cf8a4af48862b22240b5b456c8d54ba1 /vcl
parent8f317cd32e3a0ae7b6dfd28cd3a3f5aa9f5da6ec (diff)
ImpGraphic::ImplReadEmbedded: bSwap is false; remove dead code
Change-Id: Ie5b6b593e178d3752ebf7421af8aee4b50f75819
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/impgraph.hxx2
-rw-r--r--vcl/source/gdi/impgraph.cxx91
2 files changed, 3 insertions, 90 deletions
diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx
index 513074d1d286..f3766037da48 100644
--- a/vcl/inc/impgraph.hxx
+++ b/vcl/inc/impgraph.hxx
@@ -136,7 +136,7 @@ private:
const OUString& ImplGetDocFileName() const;
sal_uLong ImplGetDocFilePos() const { return mnDocFilePos;}
- bool ImplReadEmbedded( SvStream& rIStream, bool bSwap = false );
+ bool ImplReadEmbedded( SvStream& rIStream );
bool ImplWriteEmbedded( SvStream& rOStream );
bool ImplSwapIn();
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index b41ecd8d4f51..eafd6c3a821e 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -40,7 +40,6 @@
#include <vcl/dibtools.hxx>
#include <boost/scoped_ptr.hpp>
-#define GRAPHIC_MAXPARTLEN 256000L
#define GRAPHIC_MTFTOBMP_MAXEXT 2048
#define GRAPHIC_STREAMBUFSIZE 8192UL
@@ -970,7 +969,7 @@ const OUString& ImpGraphic::ImplGetDocFileName() const
}
-bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm, bool bSwap )
+bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm )
{
MapMode aMapMode;
Size aSize;
@@ -1071,93 +1070,7 @@ bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm, bool bSwap )
maMetaFile.SetPrefSize( aSize );
}
- if( bSwap )
- {
- if (!maDocFileURLStr.isEmpty())
- {
- rIStm.Seek( nStartPos + nHeaderLen + nLen );
- bRet = mbSwapOut = true;
- }
- else
- {
- ::utl::TempFile aTempFile;
- const INetURLObject aTmpURL( aTempFile.GetURL() );
-
- if( !aTmpURL.GetMainURL( INetURLObject::NO_DECODE ).isEmpty() )
- {
- boost::scoped_ptr<SvStream> pOStm;
- try
- {
- pOStm.reset(::utl::UcbStreamHelper::CreateStream( aTmpURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READWRITE | STREAM_SHARE_DENYWRITE ));
- }
- catch( const ::com::sun::star::uno::Exception& )
- {
- }
-
- if( pOStm )
- {
- sal_uLong nFullLen = nHeaderLen + nLen;
- sal_uLong nPartLen = std::min( nFullLen, (sal_uLong) GRAPHIC_MAXPARTLEN );
- sal_uInt8* pBuffer = (sal_uInt8*) rtl_allocateMemory( nPartLen );
-
- pOStm->SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
-
- if( pBuffer )
- {
- rIStm.Seek( nStartPos );
-
- while( nFullLen )
- {
- rIStm.Read( (char*) pBuffer, nPartLen );
- pOStm->Write( (char*) pBuffer, nPartLen );
-
- nFullLen -= nPartLen;
-
- if( nFullLen < GRAPHIC_MAXPARTLEN )
- nPartLen = nFullLen;
- }
-
- rtl_freeMemory( pBuffer );
- sal_uLong nReadErr = rIStm.GetError(), nWriteErr = pOStm->GetError();
- pOStm.reset();
-
- if( !nReadErr && !nWriteErr )
- {
- bRet = mbSwapOut = true;
- mpSwapFile = new ImpSwapFile;
- mpSwapFile->nRefCount = 1;
- mpSwapFile->aSwapURL = aTmpURL;
- }
- else
- {
- try
- {
- ::ucbhelper::Content aCnt( aTmpURL.GetMainURL( INetURLObject::NO_DECODE ),
- ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >(),
- comphelper::getProcessComponentContext() );
-
- aCnt.executeCommand( OUString("delete"),
- ::com::sun::star::uno::makeAny( true ) );
- }
- catch( const ::com::sun::star::ucb::ContentCreationException& )
- {
- }
- catch( const ::com::sun::star::uno::RuntimeException& )
- {
- }
- catch( const ::com::sun::star::ucb::CommandAbortedException& )
- {
- }
- catch( const ::com::sun::star::uno::Exception& )
- {
- }
- }
- }
- }
- }
- }
- }
- else if( meType == GRAPHIC_BITMAP || meType == GRAPHIC_GDIMETAFILE )
+ if( meType == GRAPHIC_BITMAP || meType == GRAPHIC_GDIMETAFILE )
{
ReadImpGraphic( rIStm, *this );
bRet = ( rIStm.GetError() == 0UL );