summaryrefslogtreecommitdiff
path: root/sc
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
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')
-rw-r--r--sc/inc/sc.hrc1
-rw-r--r--sc/sdi/cellsh.sdi1
-rw-r--r--sc/sdi/scalc.sdi18
-rw-r--r--sc/source/ui/view/cellsh.cxx1
-rw-r--r--sc/source/ui/view/cellsh1.cxx17
-rw-r--r--sc/uiconfig/scalc/menubar/menubar.xml1
6 files changed, 39 insertions, 0 deletions
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index 83852ab497f8..aa32f3c66a42 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -643,6 +643,7 @@
#define FID_HIDE_NOTE (SID_NEW_SLOTS+101)
#define FID_SHOW_ALL_NOTES (SID_NEW_SLOTS+102)
#define FID_HIDE_ALL_NOTES (SID_NEW_SLOTS+103)
+#define FID_DELETE_ALL_NOTES (SID_NEW_SLOTS+104)
// idl parameter
diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi
index 96186e65fe15..8e80db555901 100644
--- a/sc/sdi/cellsh.sdi
+++ b/sc/sdi/cellsh.sdi
@@ -211,6 +211,7 @@ interface CellSelection
FID_SHOW_NOTE [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
FID_HIDE_ALL_NOTES [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
FID_SHOW_ALL_NOTES [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
+ FID_DELETE_ALL_NOTES [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
SID_DELETE_NOTE [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
SID_DEC_INDENT [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
SID_INC_INDENT [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi
index 1b3f90105ae6..f2737bffb9a2 100644
--- a/sc/sdi/scalc.sdi
+++ b/sc/sdi/scalc.sdi
@@ -3634,6 +3634,24 @@ SfxVoidItem HideAllNotes FID_HIDE_ALL_NOTES
GroupId = GID_VIEW;
]
+SfxVoidItem DeleteAllNotes FID_DELETE_ALL_NOTES
+
+[
+ AutoUpdate = FALSE,
+ FastCall = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
SfxVoidItem DeleteNote SID_DELETE_NOTE
(SvxPostItIdItem Id SID_ATTR_POSTIT_ID)
[
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 )
{
diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml
index 647c87db3c8f..afb04b77c26b 100644
--- a/sc/uiconfig/scalc/menubar/menubar.xml
+++ b/sc/uiconfig/scalc/menubar/menubar.xml
@@ -546,6 +546,7 @@
<menu:menuitem menu:id=".uno:HideAllNotes"/>
<menu:menuitem menu:id=".uno:ShowAllNotes"/>
<menu:menuitem menu:id=".uno:DeleteNote"/>
+ <menu:menuitem menu:id=".uno:DeleteAllNotes"/>
</menu:menupopup>
</menu:menu>
<menu:menuitem menu:id=".uno:Delete"/>