summaryrefslogtreecommitdiffstats
path: root/sc/source/ui/undo
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-12-08 10:26:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-12-08 12:35:09 +0000
commita66731982e93cdcc5beaa5b0586a7f12a7fc0ef6 (patch)
tree19064090be4d97781c16aa6e79a4f7a09d561ae9 /sc/source/ui/undo
parentRetire the --disable-export option (diff)
downloadcore-a66731982e93cdcc5beaa5b0586a7f12a7fc0ef6.tar.gz
core-a66731982e93cdcc5beaa5b0586a7f12a7fc0ef6.zip
convert SFX_HINT to scoped enum
Notes (*) In SC, BULK_DATACHANGED was or'ed into the hint id. Replaced with a dynamic_cast check. (*) In SC, removed the hint id field from ScIndexHint, no point in storing the hint id twice (*) Fold the SfxStyleSheetHintId enum into the new SfxHintId enum, no point in storing two different hint ids (*) In some cases, multiple #define's used to map to the same SFX_HINT value (notably the SFX_HINT_USER* values). I made all of those separate values. Change-Id: I990e2fb587335ebc51c9005588c6a44f768d9de5 Reviewed-on: https://gerrit.libreoffice.org/31751 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/undo')
-rw-r--r--sc/source/ui/undo/undobase.cxx4
-rw-r--r--sc/source/ui/undo/undoblk.cxx20
-rw-r--r--sc/source/ui/undo/undoblk3.cxx10
-rw-r--r--sc/source/ui/undo/undocell.cxx2
-rw-r--r--sc/source/ui/undo/undoconvert.cxx2
-rw-r--r--sc/source/ui/undo/undodat.cxx8
-rw-r--r--sc/source/ui/undo/undorangename.cxx6
-rw-r--r--sc/source/ui/undo/undosort.cxx2
-rw-r--r--sc/source/ui/undo/undotab.cxx32
9 files changed, 43 insertions, 43 deletions
diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx
index 795270d77557..5ac882779ec3 100644
--- a/sc/source/ui/undo/undobase.cxx
+++ b/sc/source/ui/undo/undobase.cxx
@@ -181,7 +181,7 @@ void ScSimpleUndo::EndRedo()
void ScSimpleUndo::BroadcastChanges( const ScRange& rRange )
{
ScDocument& rDoc = pDocShell->GetDocument();
- rDoc.BroadcastCells(rRange, SC_HINT_DATACHANGED);
+ rDoc.BroadcastCells(rRange, SfxHintId::ScDataChanged);
}
namespace {
@@ -207,7 +207,7 @@ public:
return;
ScRange aRange(mnCurCol, nRow1, mnCurTab, mnCurCol, nRow2, mnCurTab);
- mrDoc.BroadcastCells(aRange, SC_HINT_DATACHANGED);
+ mrDoc.BroadcastCells(aRange, SfxHintId::ScDataChanged);
};
};
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index 46b2ba31db27..4a693e4a2c45 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -501,7 +501,7 @@ void ScUndoDeleteCells::Undo()
BeginUndo();
DoChange( true );
EndUndo();
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_AREALINKS_CHANGED ) );
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScAreaLinksChanged ) );
// Selection not until EndUndo
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
@@ -524,7 +524,7 @@ void ScUndoDeleteCells::Redo()
BeginRedo();
DoChange( false);
EndRedo();
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_AREALINKS_CHANGED ) );
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScAreaLinksChanged ) );
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
@@ -683,7 +683,7 @@ void ScUndoDeleteMulti::Undo()
//! since no data for selection exist
EndUndo();
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_AREALINKS_CHANGED ) );
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScAreaLinksChanged ) );
}
void ScUndoDeleteMulti::Redo()
@@ -710,7 +710,7 @@ void ScUndoDeleteMulti::Redo()
DoChange();
EndRedo();
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_AREALINKS_CHANGED ) );
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScAreaLinksChanged ) );
}
void ScUndoDeleteMulti::Repeat(SfxRepeatTarget& rTarget)
@@ -943,7 +943,7 @@ void ScUndoPaste::DoChange(bool bUndo)
aMarkData.MarkToMulti();
rDoc.DeleteSelection(nUndoFlags, aMarkData, false); // no broadcasting here
for (size_t i = 0, n = maBlockRanges.size(); i < n; ++i)
- rDoc.BroadcastCells(*maBlockRanges[i], SC_HINT_DATACHANGED);
+ rDoc.BroadcastCells(*maBlockRanges[i], SfxHintId::ScDataChanged);
aMarkData.MarkToSimple();
@@ -1062,7 +1062,7 @@ void ScUndoPaste::Undo()
if (!maBlockRanges.empty())
ShowTable(*maBlockRanges.front());
EndUndo();
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_AREALINKS_CHANGED ) );
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScAreaLinksChanged ) );
}
void ScUndoPaste::Redo()
@@ -1073,7 +1073,7 @@ void ScUndoPaste::Redo()
DoChange( false );
EnableDrawAdjust( &rDoc, true ); //! include in ScBlockUndo?
EndRedo();
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_AREALINKS_CHANGED ) );
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScAreaLinksChanged ) );
}
void ScUndoPaste::Repeat(SfxRepeatTarget& rTarget)
@@ -1251,7 +1251,7 @@ class DataChangeNotifier : public std::unary_function<SvtListener*, void>
{
ScHint maHint;
public:
- DataChangeNotifier() : maHint(SC_HINT_DATACHANGED, ScAddress()) {}
+ DataChangeNotifier() : maHint(SfxHintId::ScDataChanged, ScAddress()) {}
void operator() ( SvtListener* p )
{
@@ -1335,7 +1335,7 @@ void ScUndoDragDrop::Undo()
}
EndUndo();
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_AREALINKS_CHANGED ) );
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScAreaLinksChanged ) );
}
void ScUndoDragDrop::Redo()
@@ -1419,7 +1419,7 @@ void ScUndoDragDrop::Redo()
EnableDrawAdjust( &rDoc, true ); //! include in ScBlockUndo?
EndRedo();
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_AREALINKS_CHANGED ) );
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScAreaLinksChanged ) );
}
void ScUndoDragDrop::Repeat(SfxRepeatTarget& /* rTarget */)
diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index 7d1f2d97eb82..1d3d707bbaa5 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -728,7 +728,7 @@ void ScUndoMerge::DoChange( bool bUndo ) const
if (!bDidPaint)
ScUndoUtil::PaintMore(pDocShell, aRange);
- rDoc.BroadcastCells(aRange, SC_HINT_DATACHANGED);
+ rDoc.BroadcastCells(aRange, SfxHintId::ScDataChanged);
}
ShowTable(aCurRange);
@@ -1518,7 +1518,7 @@ void ScUndoInsertAreaLink::Undo()
if (pLink)
pLinkManager->Remove( pLink );
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_AREALINKS_CHANGED ) ); // Navigator
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScAreaLinksChanged ) ); // Navigator
}
void ScUndoInsertAreaLink::Redo()
@@ -1534,7 +1534,7 @@ void ScUndoInsertAreaLink::Redo()
pLink->Update();
pLink->SetInCreate( false );
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_AREALINKS_CHANGED ) ); // Navigator
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScAreaLinksChanged ) ); // Navigator
}
void ScUndoInsertAreaLink::Repeat(SfxRepeatTarget& /* rTarget */)
@@ -1583,7 +1583,7 @@ void ScUndoRemoveAreaLink::Undo()
pLink->Update();
pLink->SetInCreate( false );
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_AREALINKS_CHANGED ) ); // Navigator
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScAreaLinksChanged ) ); // Navigator
}
void ScUndoRemoveAreaLink::Redo()
@@ -1596,7 +1596,7 @@ void ScUndoRemoveAreaLink::Redo()
if (pLink)
pLinkManager->Remove( pLink );
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_AREALINKS_CHANGED ) ); // Navigator
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScAreaLinksChanged ) ); // Navigator
}
void ScUndoRemoveAreaLink::Repeat(SfxRepeatTarget& /* rTarget */)
diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx
index f9d082f0f902..8c3555b14440 100644
--- a/sc/source/ui/undo/undocell.cxx
+++ b/sc/source/ui/undo/undocell.cxx
@@ -986,7 +986,7 @@ void ScUndoRangeNames::DoChange( bool bUndo )
rDoc.CompileHybridFormula();
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_AREAS_CHANGED ) );
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScAreasChanged ) );
}
void ScUndoRangeNames::Undo()
diff --git a/sc/source/ui/undo/undoconvert.cxx b/sc/source/ui/undo/undoconvert.cxx
index b23465b93a65..7778b2b745d5 100644
--- a/sc/source/ui/undo/undoconvert.cxx
+++ b/sc/source/ui/undo/undoconvert.cxx
@@ -43,7 +43,7 @@ void UndoFormulaToValue::Execute()
pDocShell->PostPaint(maUndoValues.getRange(), PaintPartFlags::Grid);
pDocShell->PostDataChanged();
- rDoc.BroadcastCells(maUndoValues.getRange(), SC_HINT_DATACHANGED);
+ rDoc.BroadcastCells(maUndoValues.getRange(), SfxHintId::ScDataChanged);
}
}
diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx
index 1595bf118e74..e78330161810 100644
--- a/sc/source/ui/undo/undodat.cxx
+++ b/sc/source/ui/undo/undodat.cxx
@@ -1002,7 +1002,7 @@ void ScUndoDBData::Undo()
rDoc.CompileHybridFormula();
rDoc.SetAutoCalc( bOldAutoCalc );
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_DBAREAS_CHANGED ) );
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScDbAreasChanged ) );
EndUndo();
}
@@ -1020,7 +1020,7 @@ void ScUndoDBData::Redo()
rDoc.CompileHybridFormula();
rDoc.SetAutoCalc( bOldAutoCalc );
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_DBAREAS_CHANGED ) );
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScDbAreasChanged ) );
EndRedo();
}
@@ -1842,7 +1842,7 @@ void ScUndoDataForm::Undo()
DoChange( true );
ShowTable( aBlockRange );
EndUndo();
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_AREALINKS_CHANGED ) );
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScAreaLinksChanged ) );
}
void ScUndoDataForm::Redo()
@@ -1853,7 +1853,7 @@ void ScUndoDataForm::Redo()
DoChange( false );
EnableDrawAdjust( &rDoc, true ); //! include in ScBlockUndo?
EndRedo();
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_AREALINKS_CHANGED ) );
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScAreaLinksChanged ) );
}
void ScUndoDataForm::Repeat(SfxRepeatTarget& /*rTarget*/)
diff --git a/sc/source/ui/undo/undorangename.cxx b/sc/source/ui/undo/undorangename.cxx
index 5ed0df811f6f..16624c901a6e 100644
--- a/sc/source/ui/undo/undorangename.cxx
+++ b/sc/source/ui/undo/undorangename.cxx
@@ -74,7 +74,7 @@ void ScUndoAllRangeNames::DoChange(const std::map<OUString, std::unique_ptr<ScRa
rDoc.SetAllRangeNames(rNames);
rDoc.CompileHybridFormula();
- SfxGetpApp()->Broadcast(SfxHint(SC_HINT_AREAS_CHANGED));
+ SfxGetpApp()->Broadcast(SfxHint(SfxHintId::ScAreasChanged));
}
ScUndoAddRangeData::ScUndoAddRangeData(ScDocShell* pDocSh, ScRangeData* pRangeData, SCTAB nTab) :
@@ -103,7 +103,7 @@ void ScUndoAddRangeData::Undo()
pRangeName = rDoc.GetRangeName( mnTab );
}
pRangeName->erase(*mpRangeData);
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_AREAS_CHANGED ) );
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScAreasChanged ) );
}
@@ -120,7 +120,7 @@ void ScUndoAddRangeData::Redo()
pRangeName = rDoc.GetRangeName( mnTab );
}
pRangeName->insert(new ScRangeData(*mpRangeData));
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_AREAS_CHANGED ) );
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScAreasChanged ) );
}
void ScUndoAddRangeData::Repeat(SfxRepeatTarget& /*rTarget*/)
diff --git a/sc/source/ui/undo/undosort.cxx b/sc/source/ui/undo/undosort.cxx
index f8d12664225f..4b1ec6bab60b 100644
--- a/sc/source/ui/undo/undosort.cxx
+++ b/sc/source/ui/undo/undosort.cxx
@@ -66,7 +66,7 @@ void UndoSort::Execute( bool bUndo )
rDoc.SetDirty(maParam.maSortRange, true);
if (!aParam.mbUpdateRefs)
- rDoc.BroadcastCells(aParam.maSortRange, SC_HINT_DATACHANGED);
+ rDoc.BroadcastCells(aParam.maSortRange, SfxHintId::ScDataChanged);
pDocShell->PostPaint(maParam.maSortRange, PaintPartFlags::Grid);
pDocShell->PostDataChanged();
diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx
index 7245cc99a1f6..5ace37ef7dff 100644
--- a/sc/source/ui/undo/undotab.cxx
+++ b/sc/source/ui/undo/undotab.cxx
@@ -116,7 +116,7 @@ void ScUndoInsertTab::Undo()
pChangeTrack->Undo( nEndChangeAction, nEndChangeAction );
// SetTabNo(...,sal_True) for all views to sync with drawing layer pages
- pDocShell->Broadcast( SfxHint( SC_HINT_FORCESETTAB ) );
+ pDocShell->Broadcast( SfxHint( SfxHintId::ScForceSetTab ) );
}
void ScUndoInsertTab::Redo()
@@ -215,7 +215,7 @@ void ScUndoInsertTables::Undo()
pChangeTrack->Undo( nStartChangeAction, nEndChangeAction );
// SetTabNo(...,sal_True) for all views to sync with drawing layer pages
- pDocShell->Broadcast( SfxHint( SC_HINT_FORCESETTAB ) );
+ pDocShell->Broadcast( SfxHint( SfxHintId::ScForceSetTab ) );
}
void ScUndoInsertTables::Redo()
@@ -362,9 +362,9 @@ void ScUndoDeleteTab::Undo()
pDocShell->Broadcast( ScTablesHint( SC_TAB_INSERTED, theTabs[i]) );
}
SfxApplication* pSfxApp = SfxGetpApp(); // Navigator
- pSfxApp->Broadcast( SfxHint( SC_HINT_TABLES_CHANGED ) );
- pSfxApp->Broadcast( SfxHint( SC_HINT_DBAREAS_CHANGED ) );
- pSfxApp->Broadcast( SfxHint( SC_HINT_AREALINKS_CHANGED ) );
+ pSfxApp->Broadcast( SfxHint( SfxHintId::ScTablesChanged ) );
+ pSfxApp->Broadcast( SfxHint( SfxHintId::ScDbAreasChanged ) );
+ pSfxApp->Broadcast( SfxHint( SfxHintId::ScAreaLinksChanged ) );
pDocShell->PostPaint(0,0,0, MAXCOL,MAXROW,MAXTAB, PaintPartFlags::All ); // incl. extras
@@ -390,7 +390,7 @@ void ScUndoDeleteTab::Redo()
SetChangeTrack();
// SetTabNo(...,sal_True) for all views to sync with drawing layer pages
- pDocShell->Broadcast( SfxHint( SC_HINT_FORCESETTAB ) );
+ pDocShell->Broadcast( SfxHint( SfxHintId::ScForceSetTab ) );
}
void ScUndoDeleteTab::Repeat(SfxRepeatTarget& rTarget)
@@ -432,7 +432,7 @@ void ScUndoRenameTab::DoChange( SCTAB nTabP, const OUString& rName ) const
ScDocument& rDoc = pDocShell->GetDocument();
rDoc.RenameTab( nTabP, rName );
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_TABLES_CHANGED ) ); // Navigator
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScTablesChanged ) ); // Navigator
pDocShell->PostPaintGridAll();
pDocShell->PostPaintExtras();
@@ -540,7 +540,7 @@ void ScUndoMoveTab::DoChange( bool bUndo ) const
}
}
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_TABLES_CHANGED ) ); // Navigator
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScTablesChanged ) ); // Navigator
pDocShell->PostPaintGridAll();
pDocShell->PostPaintExtras();
@@ -601,7 +601,7 @@ void ScUndoCopyTab::DoChange() const
if (pViewShell)
pViewShell->SetTabNo((*mpOldTabs)[0],true);
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_TABLES_CHANGED ) ); // Navigator
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScTablesChanged ) ); // Navigator
pDocShell->PostPaintGridAll();
pDocShell->PostPaintExtras();
@@ -820,10 +820,10 @@ void ScUndoMakeScenario::Undo()
if (pViewShell)
pViewShell->SetTabNo( nSrcTab, true );
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_TABLES_CHANGED ) );
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScTablesChanged ) );
// SetTabNo(...,sal_True) for all views to sync with drawing layer pages
- pDocShell->Broadcast( SfxHint( SC_HINT_FORCESETTAB ) );
+ pDocShell->Broadcast( SfxHint( SfxHintId::ScForceSetTab ) );
}
void ScUndoMakeScenario::Redo()
@@ -844,7 +844,7 @@ void ScUndoMakeScenario::Redo()
if (pViewShell)
pViewShell->SetTabNo( nDestTab, true );
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_TABLES_CHANGED ) );
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScTablesChanged ) );
}
void ScUndoMakeScenario::Repeat(SfxRepeatTarget& rTarget)
@@ -899,7 +899,7 @@ void ScUndoImportTab::DoChange() const
}
}
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_TABLES_CHANGED ) ); // Navigator
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScTablesChanged ) ); // Navigator
pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB,
PaintPartFlags::Grid | PaintPartFlags::Top | PaintPartFlags::Left | PaintPartFlags::Extras );
}
@@ -1123,7 +1123,7 @@ void ScUndoShowHideTab::DoChange( bool bShowP ) const
pViewShell->SetTabNo(nTab,true);
}
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_TABLES_CHANGED ) );
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScTablesChanged ) );
pDocShell->SetDocumentModified();
}
@@ -1400,7 +1400,7 @@ void ScUndoScenarioFlags::Undo()
pViewShell->UpdateInputHandler();
if ( aOldName != aNewName )
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_TABLES_CHANGED ) );
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScTablesChanged ) );
}
void ScUndoScenarioFlags::Redo()
@@ -1417,7 +1417,7 @@ void ScUndoScenarioFlags::Redo()
pViewShell->UpdateInputHandler();
if ( aOldName != aNewName )
- SfxGetpApp()->Broadcast( SfxHint( SC_HINT_TABLES_CHANGED ) );
+ SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScTablesChanged ) );
}
void ScUndoScenarioFlags::Repeat(SfxRepeatTarget& /* rTarget */)