[Libreoffice-commits] core.git: officecfg/registry sfx2/source sw/inc sw/sdi sw/source sw/uiconfig

Scott Clarke (via logerrit) logerrit at kemper.freedesktop.org
Wed Aug 7 07:44:44 UTC 2019


 officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu |    8 ++++
 sfx2/source/control/unoctitm.cxx                                     |    1 
 sw/inc/cmdid.h                                                       |    1 
 sw/sdi/_annotsh.sdi                                                  |    6 +++
 sw/sdi/_textsh.sdi                                                   |    5 ++
 sw/sdi/swriter.sdi                                                   |   17 ++++++++++
 sw/source/uibase/docvw/AnnotationMenuButton.cxx                      |    6 +++
 sw/source/uibase/docvw/AnnotationWin2.cxx                            |    8 ++++
 sw/source/uibase/shells/annotsh.cxx                                  |   16 ++++++++-
 sw/source/uibase/shells/textfld.cxx                                  |    9 +++++
 sw/uiconfig/sglobal/menubar/menubar.xml                              |    1 
 sw/uiconfig/sglobal/popupmenu/annotation.xml                         |    1 
 sw/uiconfig/swriter/menubar/menubar.xml                              |    1 
 sw/uiconfig/swriter/popupmenu/annotation.xml                         |    1 
 sw/uiconfig/swriter/ui/annotationmenu.ui                             |   16 +++++++++
 sw/uiconfig/swriter/ui/notebookbar_groupedbar_full.ui                |    7 ++++
 16 files changed, 102 insertions(+), 2 deletions(-)

New commits:
commit 6986ebd4a0020e515a115acbe7f1f738a4fd83f4
Author:     Scott Clarke <scott.clarke at codethink.co.uk>
AuthorDate: Wed Jun 19 16:29:54 2019 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Aug 7 09:44:10 2019 +0200

    tdf#119228 Add UI elements to resolve and unresolve comments
    
    Change-Id: I22403299d034a638724077744070b3add64cacf2
    Co-authored-by: Jim MacArthur <jim.macarthur at codethink.co.uk>
    Reviewed-on: https://gerrit.libreoffice.org/75861
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index d3f803d91024..0dd6c5173768 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -6352,6 +6352,14 @@
           <value>1</value>
         </prop>
       </node>
+      <node oor:name=".uno:ResolveComment" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Resolved</value>
+        </prop>
+        <prop oor:name="Properties" oor:type="xs:int">
+          <value>1</value>
+        </prop>
+      </node>
       <node oor:name=".uno:CellVertTop" oor:op="replace">
         <prop oor:name="Label" oor:type="xs:string">
           <value xml:lang="en-US">Top</value>
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index a321248cdc9b..9588ff61d551 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1058,6 +1058,7 @@ static void InterceptLOKStateChangeEvent(const SfxViewFrame* pViewFrame, const c
              aEvent.FeatureURL.Path == "SelectAll" ||
              aEvent.FeatureURL.Path == "InsertAnnotation" ||
              aEvent.FeatureURL.Path == "DeleteAnnotation" ||
+             aEvent.FeatureURL.Path == "ResolveAnnotation" ||
              aEvent.FeatureURL.Path == "InsertRowsBefore" ||
              aEvent.FeatureURL.Path == "InsertRowsAfter" ||
              aEvent.FeatureURL.Path == "InsertColumnsBefore" ||
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index e442239e8fd2..e45451022819 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -729,6 +729,7 @@
 #define FN_DELETE_COMMENT           (FN_NOTES+6)
 #define FN_REPLY                    (FN_NOTES+7)
 #define FN_FORMAT_ALL_NOTES         (FN_NOTES+8)
+#define FN_RESOLVE_NOTE             (FN_NOTES+9)
 
 // Region: Parameter
 #define FN_PARAM_MOVE_COUNT         (FN_PARAM+2)
diff --git a/sw/sdi/_annotsh.sdi b/sw/sdi/_annotsh.sdi
index 323d5d06b8b1..84f3aed0b007 100644
--- a/sw/sdi/_annotsh.sdi
+++ b/sw/sdi/_annotsh.sdi
@@ -60,6 +60,12 @@ interface _Annotation
         StateMethod = GetNoteState ;
     ]
 
+    FN_RESOLVE_NOTE
+    [
+        ExecMethod = NoteExec ;
+        StateMethod = GetNoteState ;
+    ]
+
     FN_POSTIT
         [
                 ExecMethod = NoteExec ;
diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi
index 9abad60e8197..3d7bbd56b32e 100644
--- a/sw/sdi/_textsh.sdi
+++ b/sw/sdi/_textsh.sdi
@@ -957,6 +957,11 @@ interface BaseText
         ExecMethod = ExecField ;
         StateMethod = StateField;
     ]
+    FN_RESOLVE_NOTE
+    [
+        ExecMethod = ExecField ;
+        StateMethod = StateField;
+    ]
     FN_DELETE_NOTE_AUTHOR
     [
         ExecMethod = ExecField ;
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 02bdbd961d4c..bb5d67ce161b 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -7066,6 +7066,23 @@ SfxVoidItem DeleteComment FN_DELETE_COMMENT
     GroupId = SfxGroupId::Edit;
 ]
 
+SfxVoidItem ResolveComment FN_RESOLVE_NOTE
+(SvxPostItIdItem Id SID_ATTR_POSTIT_ID)
+[
+    AutoUpdate = FALSE,
+    FastCall = FALSE,
+    ReadOnlyDoc = FALSE,
+    Toggle = FALSE,
+    Container = FALSE,
+    RecordAbsolute = FALSE,
+    RecordPerSet;
+
+    AccelConfig = TRUE,
+    MenuConfig = TRUE,
+    ToolBoxConfig = TRUE,
+    GroupId = SfxGroupId::Edit;
+]
+
 SfxStringItem DeleteAuthor FN_DELETE_NOTE_AUTHOR ( SfxStringItem Author FN_DELETE_NOTE_AUTHOR )
 [
     AutoUpdate = FALSE,
diff --git a/sw/source/uibase/docvw/AnnotationMenuButton.cxx b/sw/source/uibase/docvw/AnnotationMenuButton.cxx
index c8996bdc3554..cdea6eb327e1 100644
--- a/sw/source/uibase/docvw/AnnotationMenuButton.cxx
+++ b/sw/source/uibase/docvw/AnnotationMenuButton.cxx
@@ -71,6 +71,8 @@ void AnnotationMenuButton::Select()
     OString sIdent = GetCurItemIdent();
     if (sIdent == "reply")
         mrSidebarWin.ExecuteCommand(FN_REPLY);
+    if (sIdent == "resolve" || sIdent == "unresolve")
+        mrSidebarWin.ExecuteCommand(FN_RESOLVE_NOTE);
     else if (sIdent == "delete")
         mrSidebarWin.ExecuteCommand(FN_DELETE_COMMENT);
     else if (sIdent == "deleteby")
@@ -87,6 +89,8 @@ void AnnotationMenuButton::MouseButtonDown( const MouseEvent& rMEvt )
     if (mrSidebarWin.IsReadOnly())
     {
         pButtonPopup->EnableItem(pButtonPopup->GetItemId("reply"), false);
+        pButtonPopup->EnableItem(pButtonPopup->GetItemId("resolve"), false);
+        pButtonPopup->EnableItem(pButtonPopup->GetItemId("unresolve"), false);
         pButtonPopup->EnableItem(pButtonPopup->GetItemId("delete"), false );
         pButtonPopup->EnableItem(pButtonPopup->GetItemId("deleteby"), false );
         pButtonPopup->EnableItem(pButtonPopup->GetItemId("deleteall"), false );
@@ -94,6 +98,8 @@ void AnnotationMenuButton::MouseButtonDown( const MouseEvent& rMEvt )
     }
     else
     {
+        pButtonPopup->EnableItem(pButtonPopup->GetItemId("resolve"), !mrSidebarWin.IsResolved());
+        pButtonPopup->EnableItem(pButtonPopup->GetItemId("unresolve"), mrSidebarWin.IsResolved());
         pButtonPopup->EnableItem(pButtonPopup->GetItemId("delete"), !mrSidebarWin.IsProtected());
         pButtonPopup->EnableItem(pButtonPopup->GetItemId("deleteby"));
         pButtonPopup->EnableItem(pButtonPopup->GetItemId("deleteall"));
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx
index 33edbdfacc81..202512ab255d 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -1243,10 +1243,16 @@ void SwAnnotationWin::ExecuteCommand(sal_uInt16 nSlot)
             break;
         }
         case FN_DELETE_COMMENT:
-
             //Delete(); // do not kill the parent of our open popup menu
             mnEventId = Application::PostUserEvent( LINK( this, SwAnnotationWin, DeleteHdl), nullptr, true );
             break;
+        case FN_RESOLVE_NOTE:
+            GetTopReplyNote()->ToggleResolved();
+            mrMgr.UpdateResolvedStatus(GetTopReplyNote());
+            DoResize();
+            Invalidate();
+            mrMgr.LayoutPostIts();
+            break;
         case FN_FORMAT_ALL_NOTES:
         case FN_DELETE_ALL_NOTES:
         case FN_HIDE_ALL_NOTES:
diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx
index 59344fe7f2e1..0c5467c16075 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -1112,10 +1112,10 @@ void SwAnnotationShell::NoteExec(SfxRequest const &rReq)
         case FN_REPLY:
         case FN_POSTIT:
         case FN_DELETE_COMMENT:
+        case FN_RESOLVE_NOTE:
             if ( pPostItMgr->HasActiveSidebarWin() )
                 pPostItMgr->GetActiveSidebarWin()->ExecuteCommand(nSlot);
             break;
-
         case FN_DELETE_ALL_NOTES:
             pPostItMgr->Delete();
             break;
@@ -1171,6 +1171,20 @@ void SwAnnotationShell::GetNoteState(SfxItemSet &rSet)
                 }
                 break;
             }
+        case FN_RESOLVE_NOTE:
+            {
+                if( !pPostItMgr
+                    || !pPostItMgr->HasActiveAnnotationWin() )
+                {
+                    rSet.DisableItem(nWhich);
+                }
+                else
+                {
+                    SfxBoolItem aBool(nWhich, pPostItMgr->GetActiveSidebarWin()->IsResolved());
+                    rSet.Put( aBool );
+                }
+                break;
+            }
         case FN_DELETE_NOTE_AUTHOR:
         case FN_HIDE_NOTE_AUTHOR:
         {
diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx
index 8663229f4609..87d4a77bedfa 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -347,6 +347,15 @@ void SwTextShell::ExecField(SfxRequest &rReq)
                 }
             }
             break;
+            case FN_RESOLVE_NOTE:
+            {
+                const SvxPostItIdItem* pIdItem = rReq.GetArg<SvxPostItIdItem>(SID_ATTR_POSTIT_ID);
+                if (pIdItem && !pIdItem->GetValue().isEmpty() && GetView().GetPostItMgr())
+                {
+                    GetView().GetPostItMgr()->ToggleResolvedForThread(pIdItem->GetValue().toUInt32());
+                }
+            }
+            break;
             case FN_DELETE_ALL_NOTES:
                 if ( GetView().GetPostItMgr() )
                     GetView().GetPostItMgr()->Delete();
diff --git a/sw/uiconfig/sglobal/menubar/menubar.xml b/sw/uiconfig/sglobal/menubar/menubar.xml
index a07aea1118a2..75c79dd05940 100644
--- a/sw/uiconfig/sglobal/menubar/menubar.xml
+++ b/sw/uiconfig/sglobal/menubar/menubar.xml
@@ -144,6 +144,7 @@
       <menu:menu menu:id=".uno:EditCommentsMenu">
         <menu:menupopup>
           <menu:menuitem menu:id=".uno:ReplyComment" menu:style="text"/>
+          <menu:menuitem menu:id=".uno:ResolveComment" menu:style="text"/>
           <menu:menuitem menu:id=".uno:DeleteComment" menu:style="text"/>
           <menu:menuitem menu:id=".uno:DeleteAuthor" menu:style="text"/>
           <menu:menuitem menu:id=".uno:DeleteAllNotes" menu:style="text"/>
diff --git a/sw/uiconfig/sglobal/popupmenu/annotation.xml b/sw/uiconfig/sglobal/popupmenu/annotation.xml
index 2ddcf03e8591..4724bde64c89 100644
--- a/sw/uiconfig/sglobal/popupmenu/annotation.xml
+++ b/sw/uiconfig/sglobal/popupmenu/annotation.xml
@@ -19,6 +19,7 @@
   </menu:menu>
   <menu:menuseparator/>
   <menu:menuitem menu:id=".uno:ReplyComment"/>
+  <menu:menuitem menu:id=".uno:ResolveComment"/>
   <menu:menuseparator/>
   <menu:menuitem menu:id=".uno:DeleteComment"/>
   <menu:menuitem menu:id=".uno:DeleteAuthor"/>
diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml
index af3eee70c760..d9cfbf8f7f3a 100644
--- a/sw/uiconfig/swriter/menubar/menubar.xml
+++ b/sw/uiconfig/swriter/menubar/menubar.xml
@@ -144,6 +144,7 @@
       <menu:menu menu:id=".uno:EditCommentsMenu">
         <menu:menupopup>
           <menu:menuitem menu:id=".uno:ReplyComment" menu:style="text"/>
+          <menu:menuitem menu:id=".uno:ResolveComment" menu:style="text"/>
           <menu:menuitem menu:id=".uno:DeleteComment" menu:style="text"/>
           <menu:menuitem menu:id=".uno:DeleteAuthor" menu:style="text"/>
           <menu:menuitem menu:id=".uno:DeleteAllNotes" menu:style="text"/>
diff --git a/sw/uiconfig/swriter/popupmenu/annotation.xml b/sw/uiconfig/swriter/popupmenu/annotation.xml
index 2ddcf03e8591..e455091a41b1 100644
--- a/sw/uiconfig/swriter/popupmenu/annotation.xml
+++ b/sw/uiconfig/swriter/popupmenu/annotation.xml
@@ -20,6 +20,7 @@
   <menu:menuseparator/>
   <menu:menuitem menu:id=".uno:ReplyComment"/>
   <menu:menuseparator/>
+  <menu:menuitem menu:id=".uno:ResolveComment"/>
   <menu:menuitem menu:id=".uno:DeleteComment"/>
   <menu:menuitem menu:id=".uno:DeleteAuthor"/>
   <menu:menuitem menu:id=".uno:DeleteAllNotes"/>
diff --git a/sw/uiconfig/swriter/ui/annotationmenu.ui b/sw/uiconfig/swriter/ui/annotationmenu.ui
index edec7f13542a..c21c6bb555a5 100644
--- a/sw/uiconfig/swriter/ui/annotationmenu.ui
+++ b/sw/uiconfig/swriter/ui/annotationmenu.ui
@@ -20,6 +20,22 @@
       </object>
     </child>
     <child>
+      <object class="GtkMenuItem" id="resolve">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes" context="annotationmenu|resolve">Resolve</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="unresolve">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes" context="annotationmenu|unresolve">Unresolve</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
       <object class="GtkMenuItem" id="delete">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
diff --git a/sw/uiconfig/swriter/ui/notebookbar_groupedbar_full.ui b/sw/uiconfig/swriter/ui/notebookbar_groupedbar_full.ui
index ed968f364d14..023642de8d30 100644
--- a/sw/uiconfig/swriter/ui/notebookbar_groupedbar_full.ui
+++ b/sw/uiconfig/swriter/ui/notebookbar_groupedbar_full.ui
@@ -323,6 +323,13 @@
       </object>
     </child>
     <child>
+      <object class="GtkMenuItem" id="MenuComments-ResolveComment">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="action_name">.uno:ResolveComment</property>
+      </object>
+    </child>
+    <child>
       <object class="GtkMenuItem" id="MenuComments-DeleteAuthor">
         <property name="visible">True</property>
         <property name="can_focus">False</property>


More information about the Libreoffice-commits mailing list