summaryrefslogtreecommitdiff
path: root/sc/source/ui/view
diff options
context:
space:
mode:
authorGulsah Kose <gulsah.1004@gmail.com>2017-04-17 09:13:24 +0300
committerEike Rathke <erack@redhat.com>2017-04-20 15:59:19 +0200
commit38ba5bfa215231f5937abebafd075a58c227e7ca (patch)
treee4010263b6ab69bae2ddb43f6f48c408e54d57e6 /sc/source/ui/view
parente981f360c2216513469c5ff2a51350183e874436 (diff)
tdf#107143 Add delete all comments command.
Change-Id: I1375375543172146a27ed4225f584121f9945a8c Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/36623 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/source/ui/view')
-rw-r--r--sc/source/ui/view/cellsh.cxx1
-rw-r--r--sc/source/ui/view/cellsh1.cxx17
2 files changed, 18 insertions, 0 deletions
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index ca710f4376c5..b432808cbebc 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -1045,6 +1045,7 @@ void ScCellShell::GetState(SfxItemSet &rSet)
case FID_SHOW_ALL_NOTES:
case FID_HIDE_ALL_NOTES:
+ case FID_DELETE_ALL_NOTES:
{
bool bHasNotes = false;
for (auto const& rTab : rMark.GetSelectedTabs())
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index f16b182ba4b3..ee3d5b714361 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2379,6 +2379,23 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
}
break;
+ case FID_DELETE_ALL_NOTES:
+ {
+ ScViewData* pData = GetViewData();
+ ScMarkData& rMark = pData->GetMarkData();
+ ScMarkData aNewMark;
+ ScRangeList aRangeList;
+
+ for (auto const& rTab : rMark.GetSelectedTabs())
+ {
+ aRangeList.Append(ScRange(0,0,rTab,MAXCOL,MAXROW,rTab));
+ }
+
+ aNewMark.MarkFromRangeList( aRangeList, true );
+ pData->GetDocShell()->GetDocFunc().DeleteContents(aNewMark, InsertDeleteFlags::NOTE, true, false );
+ }
+ break;
+
case SID_CHARMAP:
if( pReqArgs != nullptr )
{