summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/impgraph.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-01-27 15:55:09 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-01-27 20:48:19 +0000
commita42e8baed472933d706578916d00b672bb62dedc (patch)
tree599aad1402da1835db0443f88abbc65314d6f1e2 /vcl/source/gdi/impgraph.cxx
parent9bf03203cdc789fb7be58e1b8bc6caa63c6dd09c (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
Diffstat (limited to 'vcl/source/gdi/impgraph.cxx')
-rw-r--r--vcl/source/gdi/impgraph.cxx16
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)
{