diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-02-04 09:14:47 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-02-04 09:30:11 +0000 |
commit | c4ac8af7da53567fa91148a8c7319eb3e6870196 (patch) | |
tree | 231eb4d5ed6520ca214f64656e72066f0671992c /sc/source/ui | |
parent | e4aa4472f84dc9fcf0acaab80ede005603a4b93c (diff) |
pItem isn't used here, its the same as result, so weird cast can go
Change-Id: Ib646fcffa3d2298b06565ef78b69873546d76b0a
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/dbgui/PivotLayoutDialog.cxx | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx b/sc/source/ui/dbgui/PivotLayoutDialog.cxx index 1ed0e93f0b66..03a8db215c91 100644 --- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx +++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx @@ -512,28 +512,23 @@ void ScPivotLayoutDialog::ApplyChanges() if (pResult != nullptr) { - const SfxBoolItem* pItem = reinterpret_cast<const SfxBoolItem*>(pResult); - - if (pItem) + // existing pivot table might have moved to a new range or a new sheet + if ( pOldDPObj != nullptr ) { - // existing pivot table might have moved to a new range or a new sheet - if ( pOldDPObj != nullptr ) - { - const ScRange& rOldRange = pOldDPObj->GetOutRange(); - - // FIXME: if the new range overlaps with the old one, the table actually doesn't move - // and shouldn't therefore be deleted - if ( ( ( rOldRange != aDestinationRange ) && !rOldRange.In( aDestinationRange ) ) - || bToNewSheet ) - { - ScDPObject *pDPObj = mpDocument->GetDPAtCursor( maPivotParameters.nCol, maPivotParameters.nRow, maPivotParameters.nTab); - ScDBDocFunc aFunc( *(mpViewData->GetDocShell() )); - aFunc.RemovePivotTable( *pDPObj, true, false); - mpViewData->GetView()->CursorPosChanged(); - } - } - return; + const ScRange& rOldRange = pOldDPObj->GetOutRange(); + + // FIXME: if the new range overlaps with the old one, the table actually doesn't move + // and shouldn't therefore be deleted + if ( ( ( rOldRange != aDestinationRange ) && !rOldRange.In( aDestinationRange ) ) + || bToNewSheet ) + { + ScDPObject *pDPObj = mpDocument->GetDPAtCursor( maPivotParameters.nCol, maPivotParameters.nRow, maPivotParameters.nTab); + ScDBDocFunc aFunc( *(mpViewData->GetDocShell() )); + aFunc.RemovePivotTable( *pDPObj, true, false); + mpViewData->GetView()->CursorPosChanged(); + } } + return; } SetDispatcherLock(true); |