summaryrefslogtreecommitdiffstats
path: root/sd/source/ui/tools/PreviewRenderer.cxx
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2015-12-15 21:23:38 +0100
committerMatteo Casalin <matteo.casalin@yahoo.com>2015-12-27 16:51:29 +0100
commit6b9fdc5860b710bd9bc864b11e7e44ca844b68c8 (patch)
treef5599a9e1485fd994bb6a792392debffe6256d1c /sd/source/ui/tools/PreviewRenderer.cxx
parentPrefer switch-case to cascaded ifs (diff)
downloadcore-6b9fdc5860b710bd9bc864b11e7e44ca844b68c8.tar.gz
core-6b9fdc5860b710bd9bc864b11e7e44ca844b68c8.zip
Bail out early (so to avoid unuseful dynamic_casts)
Change-Id: Ie1940e2178585c56cecdbbcff9c9e57aa8b05459
Diffstat (limited to 'sd/source/ui/tools/PreviewRenderer.cxx')
-rw-r--r--sd/source/ui/tools/PreviewRenderer.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx
index e2468c7630d7..fa63de954286 100644
--- a/sd/source/ui/tools/PreviewRenderer.cxx
+++ b/sd/source/ui/tools/PreviewRenderer.cxx
@@ -491,8 +491,11 @@ Image PreviewRenderer::ScaleBitmap (
void PreviewRenderer::Notify(SfxBroadcaster&, const SfxHint& rHint)
{
+ if (!mpDocShellOfView)
+ return;
+
const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
- if (pSimpleHint && mpDocShellOfView && pSimpleHint->GetId() == SFX_HINT_DYING)
+ if (pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING)
{
// The doc shell is dying. Our view uses its item pool and
// has to be destroyed as well. The next call to