[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore' - vcl/inc vcl/source
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Tue Aug 18 13:47:26 UTC 2020
vcl/inc/impgraph.hxx | 11 ++++++-----
vcl/source/gdi/impgraph.cxx | 19 ++++++++-----------
2 files changed, 14 insertions(+), 16 deletions(-)
New commits:
commit b7cceae9a87b1ec0f1d919fa6344ddf18cf87e1d
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue Aug 18 15:41:25 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Tue Aug 18 15:41:25 2020 +0200
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
diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx
index 8b3cc14b7f2d..a581f48b47f6 100644
--- a/vcl/inc/impgraph.hxx
+++ b/vcl/inc/impgraph.hxx
@@ -167,15 +167,16 @@ private:
sal_uInt32 ImplGetAnimationLoopCount() const;
private:
+ // swapping methods
+ bool swapInFromStream(SvStream& rStream);
+
+ bool swapInContent(SvStream& rStream);
+ bool swapOutContent(SvStream& rStream);
+ // end swapping
std::shared_ptr<GraphicReader>& ImplGetContext() { return mpContext;}
void ImplSetContext( const std::shared_ptr<GraphicReader>& pReader );
void ImplSetDummyContext( bool value ) { mbDummyContext = value; }
- bool ImplReadEmbedded( SvStream& rIStream );
- bool ImplWriteEmbedded( SvStream& rOStream );
-
- bool swapInFromStream(SvStream* pIStm);
-
bool ImplIsDummyContext() const { return mbDummyContext; }
void ImplSetLink( const std::shared_ptr<GfxLink>& );
std::shared_ptr<GfxLink> ImplGetSharedGfxLink() const;
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index c40a344ba1da..f1e25248b2f3 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -1129,7 +1129,7 @@ void ImpGraphic::ImplSetContext( const std::shared_ptr<GraphicReader>& pReader )
mbDummyContext = false;
}
-bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm )
+bool ImpGraphic::swapInContent(SvStream& rIStm)
{
ensureAvailable();
@@ -1263,7 +1263,7 @@ bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm )
return bRet;
}
-bool ImpGraphic::ImplWriteEmbedded( SvStream& rOStm )
+bool ImpGraphic::swapOutContent(SvStream& rOStm)
{
ensureAvailable();
@@ -1366,7 +1366,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();
@@ -1458,7 +1458,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());
@@ -1473,16 +1473,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
@@ -1496,7 +1493,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);
More information about the Libreoffice-commits
mailing list