From 49b1d8a7be380ee06c0012bb8638ff7feca19a40 Mon Sep 17 00:00:00 2001 From: Marco Cecchetti Date: Wed, 5 Jul 2017 11:50:45 +0200 Subject: Fix a bit obscure pointer check. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I843b7e15e6239288359590d2c40c0e6b5f8168ea Reviewed-on: https://gerrit.libreoffice.org/39569 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sw/source/uibase/shells/grfsh.cxx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'sw') diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx index 583a234443fe..3b6eeda36108 100644 --- a/sw/source/uibase/shells/grfsh.cxx +++ b/sw/source/uibase/shells/grfsh.cxx @@ -132,11 +132,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) case SID_SAVE_GRAPHIC: { GraphicAttr aGraphicAttr; - const GraphicObject* pGraphicObj = rSh.GetGraphicObj(); - if (pGraphicObj) - { - rSh.GetGraphicAttr(aGraphicAttr); - } + rSh.GetGraphicAttr(aGraphicAttr); short nState = RET_CANCEL; if (aGraphicAttr != GraphicAttr()) // the image has been modified @@ -154,11 +150,15 @@ void SwGrfShell::Execute(SfxRequest &rReq) if (nState == RET_YES) { - Graphic aGraphic = pGraphicObj->GetTransformedGraphic(pGraphicObj->GetPrefSize(), pGraphicObj->GetPrefMapMode(), aGraphicAttr); - OUString sGrfNm; - OUString sFilterNm; - rSh.GetGrfNms( &sGrfNm, &sFilterNm ); - GraphicHelper::ExportGraphic( aGraphic, sGrfNm ); + const GraphicObject* pGraphicObj = rSh.GetGraphicObj(); + if (pGraphicObj) + { + Graphic aGraphic = pGraphicObj->GetTransformedGraphic(pGraphicObj->GetPrefSize(), pGraphicObj->GetPrefMapMode(), aGraphicAttr); + OUString sGrfNm; + OUString sFilterNm; + rSh.GetGrfNms( &sGrfNm, &sFilterNm ); + GraphicHelper::ExportGraphic( aGraphic, sGrfNm ); + } } else if (nState == RET_NO) { -- cgit