summaryrefslogtreecommitdiff
path: root/sc/source/ui/docshell/docsh4.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-07-29 16:13:56 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-07-30 08:27:52 +0200
commit5f646281f777019a4e91c467f1d6f8a7f2083ffd (patch)
tree742667b0a19517c75f1397df86ba45dd7e18b231 /sc/source/ui/docshell/docsh4.cxx
parenta5be8e97b7699c7d12fa3ae5404af7b2eb50fafb (diff)
loplugin:flatten in sc/ui
Change-Id: I4e12da123924b1036c1348ad1b04eef1826ae26a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99703 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/docshell/docsh4.cxx')
-rw-r--r--sc/source/ui/docshell/docsh4.cxx110
1 files changed, 55 insertions, 55 deletions
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index ffb31aaeaa5f..dab72363ce3f 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1436,31 +1436,31 @@ void ScDocShell::DoRecalc( bool bApi )
pSh->UpdateInputHandler();
}
}
- if (!bDone) // otherwise re-calculate document
+ if (bDone) // otherwise re-calculate document
+ return;
+
+ weld::WaitObject aWaitObj( GetActiveDialogParent() );
+ if ( pHdl )
{
- weld::WaitObject aWaitObj( GetActiveDialogParent() );
- if ( pHdl )
- {
- // tdf97897 set current cell to Dirty to force recalculation of cell
- ScFormulaCell* pFC = m_aDocument.GetFormulaCell( pHdl->GetCursorPos());
- if (pFC)
- pFC->SetDirty();
- }
- m_aDocument.CalcFormulaTree();
- if ( pSh )
- pSh->UpdateCharts(true);
+ // tdf97897 set current cell to Dirty to force recalculation of cell
+ ScFormulaCell* pFC = m_aDocument.GetFormulaCell( pHdl->GetCursorPos());
+ if (pFC)
+ pFC->SetDirty();
+ }
+ m_aDocument.CalcFormulaTree();
+ if ( pSh )
+ pSh->UpdateCharts(true);
- m_aDocument.BroadcastUno( SfxHint( SfxHintId::DataChanged ) );
+ m_aDocument.BroadcastUno( SfxHint( SfxHintId::DataChanged ) );
- // If there are charts, then paint everything, so that PostDataChanged
- // and the charts do not come one after the other and parts are painted twice.
+ // If there are charts, then paint everything, so that PostDataChanged
+ // and the charts do not come one after the other and parts are painted twice.
- ScChartListenerCollection* pCharts = m_aDocument.GetChartListenerCollection();
- if ( pCharts && pCharts->hasListeners() )
- PostPaintGridAll();
- else
- PostDataChanged();
- }
+ ScChartListenerCollection* pCharts = m_aDocument.GetChartListenerCollection();
+ if ( pCharts && pCharts->hasListeners() )
+ PostPaintGridAll();
+ else
+ PostDataChanged();
}
void ScDocShell::DoHardRecalc()
@@ -1509,19 +1509,19 @@ void ScDocShell::DoAutoStyle( const ScRange& rRange, const OUString& rStyle )
if (!pStyleSheet)
pStyleSheet = static_cast<ScStyleSheet*>(
pStylePool->Find( ScResId(STR_STYLENAME_STANDARD_CELL), SfxStyleFamily::Para ));
- if (pStyleSheet)
- {
- OSL_ENSURE(rRange.aStart.Tab() == rRange.aEnd.Tab(),
- "DoAutoStyle with several tables");
- SCTAB nTab = rRange.aStart.Tab();
- SCCOL nStartCol = rRange.aStart.Col();
- SCROW nStartRow = rRange.aStart.Row();
- SCCOL nEndCol = rRange.aEnd.Col();
- SCROW nEndRow = rRange.aEnd.Row();
- m_aDocument.ApplyStyleAreaTab( nStartCol, nStartRow, nEndCol, nEndRow, nTab, *pStyleSheet );
- m_aDocument.ExtendMerge( nStartCol, nStartRow, nEndCol, nEndRow, nTab );
- PostPaint( nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab, PaintPartFlags::Grid );
- }
+ if (!pStyleSheet)
+ return;
+
+ OSL_ENSURE(rRange.aStart.Tab() == rRange.aEnd.Tab(),
+ "DoAutoStyle with several tables");
+ SCTAB nTab = rRange.aStart.Tab();
+ SCCOL nStartCol = rRange.aStart.Col();
+ SCROW nStartRow = rRange.aStart.Row();
+ SCCOL nEndCol = rRange.aEnd.Col();
+ SCROW nEndRow = rRange.aEnd.Row();
+ m_aDocument.ApplyStyleAreaTab( nStartCol, nStartRow, nEndCol, nEndRow, nTab, *pStyleSheet );
+ m_aDocument.ExtendMerge( nStartCol, nStartRow, nEndCol, nEndRow, nTab );
+ PostPaint( nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab, PaintPartFlags::Grid );
}
void ScDocShell::NotifyStyle( const SfxStyleSheetHint& rHint )
@@ -1604,31 +1604,31 @@ void ScDocShell::SetPrintZoom( SCTAB nTab, sal_uInt16 nScale, sal_uInt16 nPages
ScStyleSheetPool* pStylePool = m_aDocument.GetStyleSheetPool();
SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aStyleName, SfxStyleFamily::Page );
OSL_ENSURE( pStyleSheet, "PageStyle not found" );
- if ( pStyleSheet )
- {
- ScDocShellModificator aModificator( *this );
+ if ( !pStyleSheet )
+ return;
- SfxItemSet& rSet = pStyleSheet->GetItemSet();
- const bool bUndo(m_aDocument.IsUndoEnabled());
- if (bUndo)
- {
- sal_uInt16 nOldScale = rSet.Get(ATTR_PAGE_SCALE).GetValue();
- sal_uInt16 nOldPages = rSet.Get(ATTR_PAGE_SCALETOPAGES).GetValue();
- GetUndoManager()->AddUndoAction( std::make_unique<ScUndoPrintZoom>(
- this, nTab, nOldScale, nOldPages, nScale, nPages ) );
- }
+ ScDocShellModificator aModificator( *this );
- rSet.Put( SfxUInt16Item( ATTR_PAGE_SCALE, nScale ) );
- rSet.Put( SfxUInt16Item( ATTR_PAGE_SCALETOPAGES, nPages ) );
+ SfxItemSet& rSet = pStyleSheet->GetItemSet();
+ const bool bUndo(m_aDocument.IsUndoEnabled());
+ if (bUndo)
+ {
+ sal_uInt16 nOldScale = rSet.Get(ATTR_PAGE_SCALE).GetValue();
+ sal_uInt16 nOldPages = rSet.Get(ATTR_PAGE_SCALETOPAGES).GetValue();
+ GetUndoManager()->AddUndoAction( std::make_unique<ScUndoPrintZoom>(
+ this, nTab, nOldScale, nOldPages, nScale, nPages ) );
+ }
- ScPrintFunc aPrintFunc( this, GetPrinter(), nTab );
- aPrintFunc.UpdatePages();
- aModificator.SetDocumentModified();
+ rSet.Put( SfxUInt16Item( ATTR_PAGE_SCALE, nScale ) );
+ rSet.Put( SfxUInt16Item( ATTR_PAGE_SCALETOPAGES, nPages ) );
- SfxBindings* pBindings = GetViewBindings();
- if (pBindings)
- pBindings->Invalidate( FID_RESET_PRINTZOOM );
- }
+ ScPrintFunc aPrintFunc( this, GetPrinter(), nTab );
+ aPrintFunc.UpdatePages();
+ aModificator.SetDocumentModified();
+
+ SfxBindings* pBindings = GetViewBindings();
+ if (pBindings)
+ pBindings->Invalidate( FID_RESET_PRINTZOOM );
}
bool ScDocShell::AdjustPrintZoom( const ScRange& rRange )