diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-22 08:50:20 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-22 13:48:25 +0200 |
commit | a7ce8404befaf59df5f1a476c8dd414633bbf823 (patch) | |
tree | dc617344e2ac5a1b144614421a87d27a17ee0f36 /sc/source/ui/unoobj/dapiuno.cxx | |
parent | 5c54b6523f74db4f79540361fc1630aaee06bcd5 (diff) |
loplugin:flatten in pyuno..sc
Change-Id: I7ddc0b76532d26910f78642200750459508c2861
Reviewed-on: https://gerrit.libreoffice.org/42617
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/unoobj/dapiuno.cxx')
-rw-r--r-- | sc/source/ui/unoobj/dapiuno.cxx | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index d6eb02a1eb4d..3cf9a3261cd9 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -442,13 +442,12 @@ void SAL_CALL ScDataPilotTablesObj::removeByName( const OUString& aName ) { SolarMutexGuard aGuard; ScDPObject* pDPObj = lcl_GetDPObject( pDocShell, nTab, aName ); - if (pDPObj && pDocShell) - { - ScDBDocFunc aFunc(*pDocShell); - aFunc.RemovePivotTable(*pDPObj, true, true); // remove - incl. undo etc. - } - else + if (!pDPObj || !pDocShell) throw RuntimeException(); // no other exceptions specified + + ScDBDocFunc aFunc(*pDocShell); + aFunc.RemovePivotTable(*pDPObj, true, true); // remove - incl. undo etc. + } // XEnumerationAccess @@ -3379,14 +3378,13 @@ void SAL_CALL ScDataPilotItemObj::setPropertyValue( const OUString& aPropertyNam else if ( aPropertyName == SC_UNONAME_POS ) { sal_Int32 nNewPos = 0; - if ( ( aValue >>= nNewPos ) && nNewPos >= 0 && nNewPos < nCount ) - { - pDim->SetMemberPosition( sName, nNewPos ); - // get new effective index (depends on sorting mode, which isn't modified) - bGetNewIndex = true; - } - else + if ( !( aValue >>= nNewPos ) || nNewPos < 0 || nNewPos >= nCount ) throw IllegalArgumentException(); + + pDim->SetMemberPosition( sName, nNewPos ); + // get new effective index (depends on sorting mode, which isn't modified) + bGetNewIndex = true; + } SetDPObject( pDPObj ); |