diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-01-27 15:55:09 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-01-27 20:48:19 +0000 |
commit | a42e8baed472933d706578916d00b672bb62dedc (patch) | |
tree | 599aad1402da1835db0443f88abbc65314d6f1e2 | |
parent | 9bf03203cdc789fb7be58e1b8bc6caa63c6dd09c (diff) |
we copy the flag for the context in the ctor, but not the context
which is worrying, copy the other missing maSwapInfo too which should be safe
to do.
in the assignment operator, we don't copy any of those three fields at all, which
is inconsistent
save and restore the context and context flags on the piece where we overwrite
ourself via *this = tempobj
Change-Id: I06a7d491f95dcb113a3c705ceeb41f576ab0a514
-rw-r--r-- | vcl/source/gdi/impgraph.cxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index a82e67a57e02..e9fcfa56d285 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -108,6 +108,8 @@ ImpGraphic::ImpGraphic() : ImpGraphic::ImpGraphic(const ImpGraphic& rImpGraphic) : maMetaFile(rImpGraphic.maMetaFile) , maEx(rImpGraphic.maEx) + , maSwapInfo(rImpGraphic.maSwapInfo) + , mpContext(rImpGraphic.mpContext) , mpSwapFile(rImpGraphic.mpSwapFile) , meType(rImpGraphic.meType) , mnSizeBytes(rImpGraphic.mnSizeBytes) @@ -187,6 +189,10 @@ ImpGraphic& ImpGraphic::operator=( const ImpGraphic& rImpGraphic ) meType = rImpGraphic.meType; mnSizeBytes = rImpGraphic.mnSizeBytes; + maSwapInfo = rImpGraphic.maSwapInfo; + mpContext = rImpGraphic.mpContext; + mbDummyContext = rImpGraphic.mbDummyContext; + mpAnimation.reset(); if ( rImpGraphic.mpAnimation ) @@ -1256,10 +1262,18 @@ bool ImpGraphic::ImplSwapIn( SvStream* xIStm ) std::shared_ptr<ImpSwapFile> xSwapFile(std::move(mpSwapFile)); assert(!mpSwapFile); + std::shared_ptr<GraphicReader> xContext(std::move(mpContext)); + assert(!mpContext); + + bool bDummyContext = mbDummyContext; + mbDummyContext = false; + bRet = ImplReadEmbedded( *xIStm ); - //restore ownership of the swap file + //restore ownership of the swap file and context mpSwapFile = std::move(xSwapFile); + mpContext = std::move(xContext); + mbDummyContext = bDummyContext; if (!bRet) { |