summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-11-19 14:24:57 +0100
committerZolnai Tamás <tamas.zolnai@collabora.com>2014-11-21 12:13:12 +0100
commit577bfd169c0eb031aabcbb7c93f28a5c92366502 (patch)
treed64443bcafcbc29d8ad2b88a15204af535107e57
parentd2e7105fa3fa696c51965f5e186d64a91416af63 (diff)
maDocFileURLStr is always empty
Change-Id: I34c4a44d4fbe8d721a3a0bda5dbe35c68fe15c13
-rw-r--r--include/vcl/graph.hxx6
-rw-r--r--svtools/source/graphic/grfcache.cxx3
-rw-r--r--vcl/inc/impgraph.hxx7
-rw-r--r--vcl/source/gdi/graph.cxx15
-rw-r--r--vcl/source/gdi/impgraph.cxx119
5 files changed, 39 insertions, 111 deletions
diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx
index 8727b9c13e2b..1111dd46d533 100644
--- a/include/vcl/graph.hxx
+++ b/include/vcl/graph.hxx
@@ -170,12 +170,6 @@ public:
GraphicReader* GetContext();
void SetContext( GraphicReader* pReader );
-public:
-
- void SetDocFileName( const OUString& rName, sal_uLong nFilePos );
- const OUString& GetDocFileName() const;
- sal_uLong GetDocFilePos() const;
-
private:
friend class GraphicObject;
bool SwapOut();
diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx
index ca4347e5e6c5..ef025e336e5c 100644
--- a/svtools/source/graphic/grfcache.cxx
+++ b/svtools/source/graphic/grfcache.cxx
@@ -265,8 +265,6 @@ void GraphicCacheEntry::ImplFillSubstitute( Graphic& rSubstitute )
const Size aPrefSize( rSubstitute.GetPrefSize() );
const MapMode aPrefMapMode( rSubstitute.GetPrefMapMode() );
const Link aAnimationNotifyHdl( rSubstitute.GetAnimationNotifyHdl() );
- const OUString aDocFileName( rSubstitute.GetDocFileName() );
- const sal_uLong nDocFilePos = rSubstitute.GetDocFilePos();
const GraphicType eOldType = rSubstitute.GetType();
const bool bDefaultType = ( rSubstitute.GetType() == GRAPHIC_DEFAULT );
@@ -299,7 +297,6 @@ void GraphicCacheEntry::ImplFillSubstitute( Graphic& rSubstitute )
rSubstitute.SetPrefSize( aPrefSize );
rSubstitute.SetPrefMapMode( aPrefMapMode );
rSubstitute.SetAnimationNotifyHdl( aAnimationNotifyHdl );
- rSubstitute.SetDocFileName( aDocFileName, nDocFilePos );
}
if( GFX_LINK_TYPE_NONE != maGfxLink.GetType() )
diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx
index f3766037da48..29a53c5e01ba 100644
--- a/vcl/inc/impgraph.hxx
+++ b/vcl/inc/impgraph.hxx
@@ -56,8 +56,6 @@ private:
ImpSwapFile* mpSwapFile;
GfxLink* mpGfxLink;
GraphicType meType;
- OUString maDocFileURLStr;
- sal_uLong mnDocFilePos;
mutable sal_uLong mnSizeBytes;
sal_uLong mnRefCount;
bool mbSwapOut;
@@ -131,11 +129,6 @@ private:
void ImplSetContext( GraphicReader* pReader );
private:
-
- void ImplSetDocFileName( const OUString& rName, sal_uLong nFilePos );
- const OUString& ImplGetDocFileName() const;
- sal_uLong ImplGetDocFilePos() const { return mnDocFilePos;}
-
bool ImplReadEmbedded( SvStream& rIStream );
bool ImplWriteEmbedded( SvStream& rOStream );
diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx
index 2e39e5e81f94..80522e76ecdb 100644
--- a/vcl/source/gdi/graph.cxx
+++ b/vcl/source/gdi/graph.cxx
@@ -501,21 +501,6 @@ void Graphic::SetContext( GraphicReader* pReader )
mpImpGraphic->ImplSetContext( pReader );
}
-void Graphic::SetDocFileName( const OUString& rName, sal_uLong nFilePos )
-{
- mpImpGraphic->ImplSetDocFileName( rName, nFilePos );
-}
-
-const OUString& Graphic::GetDocFileName() const
-{
- return mpImpGraphic->ImplGetDocFileName();
-}
-
-sal_uLong Graphic::GetDocFilePos() const
-{
- return mpImpGraphic->ImplGetDocFilePos();
-}
-
bool Graphic::SwapOut()
{
ImplTestRefCount();
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 27bd0b97b430..bb31b81b1227 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -95,7 +95,6 @@ ImpGraphic::ImpGraphic() :
mpSwapFile ( NULL ),
mpGfxLink ( NULL ),
meType ( GRAPHIC_NONE ),
- mnDocFilePos ( 0UL ),
mnSizeBytes ( 0UL ),
mnRefCount ( 1UL ),
mbSwapOut ( false ),
@@ -109,8 +108,6 @@ ImpGraphic::ImpGraphic( const ImpGraphic& rImpGraphic ) :
mpContext ( NULL ),
mpSwapFile ( rImpGraphic.mpSwapFile ),
meType ( rImpGraphic.meType ),
- maDocFileURLStr ( rImpGraphic.maDocFileURLStr ),
- mnDocFilePos ( rImpGraphic.mnDocFilePos ),
mnSizeBytes ( rImpGraphic.mnSizeBytes ),
mnRefCount ( 1UL ),
mbSwapOut ( rImpGraphic.mbSwapOut ),
@@ -142,7 +139,6 @@ ImpGraphic::ImpGraphic( const Bitmap& rBitmap ) :
mpSwapFile ( NULL ),
mpGfxLink ( NULL ),
meType ( GRAPHIC_BITMAP ),
- mnDocFilePos ( 0UL ),
mnSizeBytes ( 0UL ),
mnRefCount ( 1UL ),
mbSwapOut ( false ),
@@ -157,7 +153,6 @@ ImpGraphic::ImpGraphic( const BitmapEx& rBitmapEx ) :
mpSwapFile ( NULL ),
mpGfxLink ( NULL ),
meType ( GRAPHIC_BITMAP ),
- mnDocFilePos ( 0UL ),
mnSizeBytes ( 0UL ),
mnRefCount ( 1UL ),
mbSwapOut ( false ),
@@ -171,7 +166,6 @@ ImpGraphic::ImpGraphic(const SvgDataPtr& rSvgDataPtr)
mpSwapFile( NULL ),
mpGfxLink( NULL ),
meType( rSvgDataPtr.get() ? GRAPHIC_BITMAP : GRAPHIC_NONE ),
- mnDocFilePos( 0UL ),
mnSizeBytes( 0UL ),
mnRefCount( 1UL ),
mbSwapOut( false ),
@@ -187,7 +181,6 @@ ImpGraphic::ImpGraphic( const Animation& rAnimation ) :
mpSwapFile ( NULL ),
mpGfxLink ( NULL ),
meType ( GRAPHIC_BITMAP ),
- mnDocFilePos ( 0UL ),
mnSizeBytes ( 0UL ),
mnRefCount ( 1UL ),
mbSwapOut ( false ),
@@ -202,7 +195,6 @@ ImpGraphic::ImpGraphic( const GDIMetaFile& rMtf ) :
mpSwapFile ( NULL ),
mpGfxLink ( NULL ),
meType ( GRAPHIC_GDIMETAFILE ),
- mnDocFilePos ( 0UL ),
mnSizeBytes ( 0UL ),
mnRefCount ( 1UL ),
mbSwapOut ( false ),
@@ -244,8 +236,6 @@ ImpGraphic& ImpGraphic::operator=( const ImpGraphic& rImpGraphic )
if( !mbSwapUnderway )
{
- maDocFileURLStr = rImpGraphic.maDocFileURLStr;
- mnDocFilePos = rImpGraphic.mnDocFilePos;
mbSwapOut = rImpGraphic.mbSwapOut;
mpSwapFile = rImpGraphic.mpSwapFile;
@@ -393,8 +383,6 @@ void ImpGraphic::ImplClear()
}
mbSwapOut = false;
- mnDocFilePos = 0UL;
- maDocFileURLStr.clear();
// cleanup
ImplClearGraphics( false );
@@ -953,22 +941,6 @@ void ImpGraphic::ImplSetContext( GraphicReader* pReader )
mpContext = pReader;
}
-void ImpGraphic::ImplSetDocFileName( const OUString& rName, sal_uLong nFilePos )
-{
- const INetURLObject aURL( rName );
-
- DBG_ASSERT( rName.isEmpty() || ( aURL.GetProtocol() != INET_PROT_NOT_VALID ), "Graphic::SetDocFileName(...): invalid URL" );
-
- maDocFileURLStr = aURL.GetMainURL( INetURLObject::NO_DECODE );
- mnDocFilePos = nFilePos;
-}
-
-const OUString& ImpGraphic::ImplGetDocFileName() const
-{
- return maDocFileURLStr;
-}
-
-
bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm )
{
MapMode aMapMode;
@@ -1184,66 +1156,58 @@ bool ImpGraphic::ImplSwapOut()
if( !ImplIsSwapOut() )
{
- if (maDocFileURLStr.isEmpty())
- {
- ::utl::TempFile aTempFile;
- const INetURLObject aTmpURL( aTempFile.GetURL() );
+ ::utl::TempFile aTempFile;
+ const INetURLObject aTmpURL( aTempFile.GetURL() );
- if( !aTmpURL.GetMainURL( INetURLObject::NO_DECODE ).isEmpty() )
+ if( !aTmpURL.GetMainURL( INetURLObject::NO_DECODE ).isEmpty() )
+ {
+ boost::scoped_ptr<SvStream> pOStm;
+ try
{
- 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& )
+ pOStm.reset(::utl::UcbStreamHelper::CreateStream( aTmpURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READWRITE | STREAM_SHARE_DENYWRITE ));
+ }
+ catch( const ::com::sun::star::uno::Exception& )
+ {
+ }
+ if( pOStm )
+ {
+ pOStm->SetVersion( SOFFICE_FILEFORMAT_50 );
+ pOStm->SetCompressMode( COMPRESSMODE_NATIVE );
+
+ if( ( bRet = ImplSwapOut( pOStm.get() ) ) )
{
+ mpSwapFile = new ImpSwapFile;
+ mpSwapFile->nRefCount = 1;
+ mpSwapFile->aSwapURL = aTmpURL;
}
- if( pOStm )
+ else
{
- pOStm->SetVersion( SOFFICE_FILEFORMAT_50 );
- pOStm->SetCompressMode( COMPRESSMODE_NATIVE );
+ pOStm.reset();
- if( ( bRet = ImplSwapOut( pOStm.get() ) ) )
+ try
{
- mpSwapFile = new ImpSwapFile;
- mpSwapFile->nRefCount = 1;
- mpSwapFile->aSwapURL = aTmpURL;
+ ::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 ) );
}
- else
+ 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& )
{
- pOStm.reset();
-
- 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
- {
- ImplClearGraphics( true );
- bRet = mbSwapOut = true;
- }
}
return bRet;
@@ -1292,8 +1256,6 @@ bool ImpGraphic::ImplSwapIn()
if( mpSwapFile )
aSwapURL = mpSwapFile->aSwapURL.GetMainURL( INetURLObject::NO_DECODE );
- else
- aSwapURL = maDocFileURLStr;
if( !aSwapURL.isEmpty() )
{
@@ -1311,9 +1273,6 @@ bool ImpGraphic::ImplSwapIn()
pIStm->SetVersion( SOFFICE_FILEFORMAT_50 );
pIStm->SetCompressMode( COMPRESSMODE_NATIVE );
- if( !mpSwapFile )
- pIStm->Seek( mnDocFilePos );
-
bRet = ImplSwapIn( pIStm.get() );
pIStm.reset();