diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2020-08-18 15:41:25 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2020-09-25 19:14:02 +0200 |
commit | fdf9b8600a634ed824220d14d9b246337ad08f9f (patch) | |
tree | 6195374389488ed0be5f76ca3543ea0ac62b0659 /vcl/source/gdi | |
parent | e81b9ab5a3ef742bbe674323cc1b035be2380f9c (diff) |
ImpGraphic: rename Impl{Read,Write}Embedded - used only in swapping
ImplReadEmbedded and ImplWriteEmbedded are used when swapping only
so rename it to swapInContent and swapOutContent.
In addition change the swapInFromStream to accept SvStream by
reference and not pointer.
Change-Id: I2c555c436fe5eb6583d83382a2da278f4890ee08
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103400
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r-- | vcl/source/gdi/impgraph.cxx | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 70609d0b31f8..8c608e4ec301 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -1133,7 +1133,7 @@ void ImpGraphic::ImplSetContext( const std::shared_ptr<GraphicReader>& pReader ) mbDummyContext = false; } -bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm ) +bool ImpGraphic::swapInContent(SvStream& rIStm) { ensureAvailable(); @@ -1275,7 +1275,7 @@ bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm ) return bRet; } -bool ImpGraphic::ImplWriteEmbedded( SvStream& rOStm ) +bool ImpGraphic::swapOutContent(SvStream& rOStm) { ensureAvailable(); @@ -1381,7 +1381,7 @@ bool ImpGraphic::swapOut() xOutputStream->SetCompressMode(SvStreamCompressFlags::NATIVE); xOutputStream->SetBufferSize(GRAPHIC_STREAMBUFSIZE); - if (!xOutputStream->GetError() && ImplWriteEmbedded(*xOutputStream)) + if (!xOutputStream->GetError() && swapOutContent(*xOutputStream)) { xOutputStream->Flush(); bResult = !xOutputStream->GetError(); @@ -1473,7 +1473,7 @@ bool ImpGraphic::swapIn() xIStm->SetVersion( SOFFICE_FILEFORMAT_50 ); xIStm->SetCompressMode( SvStreamCompressFlags::NATIVE ); - bRet = swapInFromStream(xIStm.get()); + bRet = swapInFromStream(*xIStm); xIStm.reset(); if (mpSwapFile) setOriginURL(mpSwapFile->getOriginURL()); @@ -1488,16 +1488,13 @@ bool ImpGraphic::swapIn() return bRet; } -bool ImpGraphic::swapInFromStream(SvStream* xIStm) +bool ImpGraphic::swapInFromStream(SvStream& rStream) { bool bRet = false; - if( !xIStm ) - return false; - - xIStm->SetBufferSize( GRAPHIC_STREAMBUFSIZE ); + rStream.SetBufferSize(GRAPHIC_STREAMBUFSIZE); - if( xIStm->GetError() ) + if (rStream.GetError()) return false; //keep the swap file alive, because its quite possibly the backing storage @@ -1511,7 +1508,7 @@ bool ImpGraphic::swapInFromStream(SvStream* xIStm) bool bDummyContext = mbDummyContext; mbDummyContext = false; - bRet = ImplReadEmbedded( *xIStm ); + bRet = swapInContent(rStream); //restore ownership of the swap file and context mpSwapFile = std::move(xSwapFile); |