diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2017-07-05 11:50:45 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-07-05 18:07:46 +0200 |
commit | 49b1d8a7be380ee06c0012bb8638ff7feca19a40 (patch) | |
tree | e158648855b9959c7a2c2b18b6472b832a7a9f18 | |
parent | 9eed346b0b745f0598eefc572c789d58353b5e31 (diff) |
Fix a bit obscure pointer check.
Change-Id: I843b7e15e6239288359590d2c40c0e6b5f8168ea
Reviewed-on: https://gerrit.libreoffice.org/39569
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/source/uibase/shells/grfsh.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
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) { |