summaryrefslogtreecommitdiff
path: root/sw/source/uibase/shells/grfsh.cxx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-11-28 15:16:49 +0100
committerMichael Stahl <mstahl@redhat.com>2016-11-29 09:49:24 +0000
commit5a13d6146e21355803b7c803ab98143dd41b8416 (patch)
treead1810446efa184741bd270e57b760707e0e8cea /sw/source/uibase/shells/grfsh.cxx
parent199e687c12de402f51f86c6b81bb9bdcd514337c (diff)
sw ui: de-obfuscate assignments in conditions to help GCC
GCC 6.2.1 with -Og produces spurious -Werror=maybe-uninitialized on variables that are assigned in conditions; perhaps it's better to de-obfuscate the code if even GCC is confused about it. Change-Id: I5276f35be773f8e7a6d27f970085f0cd00cea0aa Reviewed-on: https://gerrit.libreoffice.org/31331 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sw/source/uibase/shells/grfsh.cxx')
-rw-r--r--sw/source/uibase/shells/grfsh.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx
index 6d9b706ad0b3..7b51f393c291 100644
--- a/sw/source/uibase/shells/grfsh.cxx
+++ b/sw/source/uibase/shells/grfsh.cxx
@@ -495,10 +495,11 @@ void SwGrfShell::Execute(SfxRequest &rReq)
void SwGrfShell::ExecAttr( SfxRequest &rReq )
{
- GraphicType nGrfType;
- if( CNT_GRF == GetShell().GetCntType() &&
- ( GraphicType::Bitmap == ( nGrfType = GetShell().GetGraphicType()) ||
- GraphicType::GdiMetafile == nGrfType ))
+ GraphicType nGrfType = GraphicType::NONE;
+ if (CNT_GRF == GetShell().GetCntType())
+ nGrfType = GetShell().GetGraphicType();
+ if (GraphicType::Bitmap == nGrfType ||
+ GraphicType::GdiMetafile == nGrfType)
{
SfxItemSet aGrfSet( GetShell().GetAttrPool(), RES_GRFATR_BEGIN,
RES_GRFATR_END -1 );