summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/cellsh1.cxx
diff options
context:
space:
mode:
authorGulsah Kose <gulsah.1004@gmail.com>2017-03-09 21:41:17 +0300
committerEike Rathke <erack@redhat.com>2017-04-11 13:49:06 +0200
commitec25d34fa3ac900950ff24fcb224f7e827352803 (patch)
tree45a415a68cb3f7b699784e51a013be2c3d57888b /sc/source/ui/view/cellsh1.cxx
parent9e8598c42a1a6f2fbd88711aa9bea5961eaf7b4a (diff)
tdf#84837 Add Show/Hide all comments commands to Calc.
Change-Id: I1e38335ff1269d0d464f03d23bfc5eba6e3b1532 Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/35020 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/source/ui/view/cellsh1.cxx')
-rw-r--r--sc/source/ui/view/cellsh1.cxx33
1 files changed, 33 insertions, 0 deletions
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 81b63f69678c..1903df9fda74 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2324,6 +2324,39 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
else
rReq.Ignore();
}
+
+ }
+ break;
+
+ case FID_SHOW_ALL_NOTES:
+ case FID_HIDE_ALL_NOTES:
+ {
+ bool bShowNote = nSlot == FID_SHOW_ALL_NOTES;
+ ScViewData* pData = GetViewData();
+ ScMarkData& rMark = pData->GetMarkData();
+ ScDocument* pDoc = pData->GetDocument();
+ std::vector<sc::NoteEntry> aNotes;
+
+ OUString aUndo = ScGlobal::GetRscString( bShowNote ? STR_UNDO_SHOWALLNOTES : STR_UNDO_HIDEALLNOTES );
+ pData->GetDocShell()->GetUndoManager()->EnterListAction( aUndo, aUndo, 0, pData->GetViewShell()->GetViewShellId() );
+
+ SCTAB nFirstSelected = rMark.GetFirstSelected();
+ SCTAB nLastSelected = rMark.GetLastSelected();
+
+ for( SCTAB aTab = nFirstSelected; aTab<=nLastSelected; aTab++ )
+ {
+ if (rMark.GetTableSelect(aTab))
+ pDoc->GetAllNoteEntries(aTab, aNotes);
+ }
+
+ for(std::vector<sc::NoteEntry>::const_iterator itr = aNotes.begin(),
+ itrEnd = aNotes.end(); itr != itrEnd; ++itr)
+ {
+ const ScAddress& rAdr = itr->maPos;
+ pData->GetDocShell()->GetDocFunc().ShowNote( rAdr, bShowNote );
+ }
+
+ pData->GetDocShell()->GetUndoManager()->LeaveListAction();
}
break;