From 29413c3ae9dfe99048580710f0b1d95c9663d508 Mon Sep 17 00:00:00 2001 From: Zolnai Tamás Date: Sun, 19 Oct 2014 18:25:23 +0200 Subject: Avoid using null pointer as a special indicator When ImpGraphic::ImplSwapOut() is called with null pointer it was assumed that it is becase the graphic is a link and so we don't need to swap out it actually (we can load it anytime using the link), only clear the graphic's internal data. The problem with that it can happen that ImplSwapOut() is called with null pointer accidentally on a non-link graphic object which leads to that we loose the graphic. Seems more robust to use an explicit indicator (GRFMGR_AUTOSWAPSTREAM_LINK) for links swapout. indicator Change-Id: Icf31524a192c7866278ba6a13eb85648aa69f554 --- vcl/inc/impgraph.hxx | 1 + 1 file changed, 1 insertion(+) (limited to 'vcl/inc/impgraph.hxx') diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx index 2242b44ea574..513074d1d286 100644 --- a/vcl/inc/impgraph.hxx +++ b/vcl/inc/impgraph.hxx @@ -143,6 +143,7 @@ private: bool ImplSwapIn( SvStream* pIStm ); bool ImplSwapOut(); + void ImplSwapOutAsLink(); bool ImplSwapOut( SvStream* pOStm ); bool ImplIsSwapOut() const { return mbSwapOut;} -- cgit