summaryrefslogtreecommitdiff
path: root/sc/source/ui/view
diff options
context:
space:
mode:
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 )
{