diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-11-28 15:20:48 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-11-29 09:49:48 +0000 |
commit | d36ca60964cf20b738ead1020c41c2f586a16660 (patch) | |
tree | bafad47f21da450089d2ea79446d551c5bdf65de /sd | |
parent | 5a13d6146e21355803b7c803ab98143dd41b8416 (diff) |
extensions,sc,sd,vcl: 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: Ia2f8209df893a8e5659ca72f4cde3d7d847574e1
Reviewed-on: https://gerrit.libreoffice.org/31332
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/filter/ppt/pptin.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/view/drawview.cxx | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 78b5e274c7cd..304194b268c7 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -725,10 +725,12 @@ bool ImplSdPPTImport::Import() } } } - SdPage* pMPage; sal_uInt16 i; - for ( i = 0; i < mpDoc->GetMasterPageCount() && ( (pMPage = static_cast<SdPage*>(mpDoc->GetMasterPage( i ))) != nullptr ); i++ ) + for (i = 0; i < mpDoc->GetMasterPageCount(); ++i) { + SdPage *const pMPage(static_cast<SdPage*>(mpDoc->GetMasterPage(i))); + if (pMPage == nullptr) + break; SetPageNum( i, PPT_MASTERPAGE ); // importing master page objects diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx index 9292cf50a08e..d91cc295a6ca 100644 --- a/sd/source/ui/view/drawview.cxx +++ b/sd/source/ui/view/drawview.cxx @@ -539,11 +539,13 @@ void DrawView::DeleteMarked() if( pObj && !pObj->IsEmptyPresObj() && pObj->GetUserCall() ) { pPage = static_cast< SdPage* >( pObj->GetPage() ); - PresObjKind ePresObjKind; - if( pPage && ((ePresObjKind = pPage->GetPresObjKind(pObj)) != PRESOBJ_NONE)) + if (pPage) { + PresObjKind ePresObjKind(pPage->GetPresObjKind(pObj)); switch( ePresObjKind ) { + case PRESOBJ_NONE: + continue; // ignore it case PRESOBJ_GRAPHIC: case PRESOBJ_OBJECT: case PRESOBJ_CHART: |