[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - 2 commits - desktop/source officecfg/registry sfx2/source sw/inc sw/sdi sw/source sw/uiconfig

Pranam Lashkari (via logerrit) logerrit at kemper.freedesktop.org
Tue Sep 15 20:04:45 UTC 2020


 desktop/source/lib/init.cxx                                          |    1 
 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/AnnotationWin.cxx                             |   19 ++++++-
 sw/source/uibase/docvw/AnnotationWin2.cxx                            |   18 ++++--
 sw/source/uibase/docvw/PostItMgr.cxx                                 |   27 +++++++++-
 sw/source/uibase/shells/annotsh.cxx                                  |   15 +++++
 sw/source/uibase/shells/textfld.cxx                                  |   11 +++-
 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 ++
 19 files changed, 152 insertions(+), 10 deletions(-)

New commits:
commit 047e40e0b1bf09c7fcc4d9b3ea83ed6011785802
Author:     Pranam Lashkari <lpranam at collabora.com>
AuthorDate: Mon Sep 14 12:56:21 2020 +0530
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Sep 15 22:04:25 2020 +0200

    Added new command to resolve the comment thread
    
    Change-Id: I8a4e5f63ee6ea5e560fae8a5d3602178f2b58b36
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102779
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index c5f19c23eb93..ca825da01637 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2664,6 +2664,7 @@ static void doc_iniUnoCommands ()
         OUString(".uno:DeleteAnnotation"),
         OUString(".uno:ReplyComment"),
         OUString(".uno:ResolveComment"),
+        OUString(".uno:ResolveCommentThread"),
         OUString(".uno:InsertRowsBefore"),
         OUString(".uno:InsertRowsAfter"),
         OUString(".uno:InsertColumnsBefore"),
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index c5d11c8206cc..e08845edb265 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -6293,6 +6293,14 @@
           <value>1</value>
         </prop>
       </node>
+      <node oor:name=".uno:ResolveCommentThread" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Resolved Thread</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 23e02481c120..ab10f33a5ca0 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1065,6 +1065,7 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, SfxViewFrame* pViewFra
              aEvent.FeatureURL.Path == "InsertAnnotation" ||
              aEvent.FeatureURL.Path == "DeleteAnnotation" ||
              aEvent.FeatureURL.Path == "ResolveAnnotation" ||
+             aEvent.FeatureURL.Path == "ResolveAnnotationThread" ||
              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 c901e8304506..2da785572f61 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -731,6 +731,7 @@
 #define FN_REPLY                    (FN_NOTES+7)
 #define FN_FORMAT_ALL_NOTES         (FN_NOTES+8)
 #define FN_RESOLVE_NOTE             (FN_NOTES+9)
+#define FN_RESOLVE_NOTE_THREAD      (FN_NOTES+10)
 
 // Region: Parameter
 #define FN_PARAM_MOVE_COUNT         (FN_PARAM+2)
diff --git a/sw/sdi/_annotsh.sdi b/sw/sdi/_annotsh.sdi
index 84f3aed0b007..fa1772a4c46e 100644
--- a/sw/sdi/_annotsh.sdi
+++ b/sw/sdi/_annotsh.sdi
@@ -66,6 +66,12 @@ interface _Annotation
         StateMethod = GetNoteState ;
     ]
 
+    FN_RESOLVE_NOTE_THREAD
+    [
+        ExecMethod = NoteExec ;
+        StateMethod = GetNoteState ;
+    ]
+
     FN_POSTIT
         [
                 ExecMethod = NoteExec ;
diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi
index 6171ffdc5a74..864fac076efc 100644
--- a/sw/sdi/_textsh.sdi
+++ b/sw/sdi/_textsh.sdi
@@ -951,6 +951,11 @@ interface BaseText
         ExecMethod = ExecField ;
         StateMethod = StateField;
     ]
+    FN_RESOLVE_NOTE_THREAD
+    [
+        ExecMethod = ExecField ;
+        StateMethod = StateField;
+    ]
     FN_DELETE_NOTE_AUTHOR
     [
         ExecMethod = ExecField ;
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 64e08b17725f..15000529d5f7 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -7086,6 +7086,23 @@ SfxVoidItem ResolveComment FN_RESOLVE_NOTE
     GroupId = SfxGroupId::Edit;
 ]
 
+SfxVoidItem ResolveCommentThread FN_RESOLVE_NOTE_THREAD
+(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 ad523ec5f822..e634496bb40b 100644
--- a/sw/source/uibase/docvw/AnnotationMenuButton.cxx
+++ b/sw/source/uibase/docvw/AnnotationMenuButton.cxx
@@ -72,6 +72,8 @@ void AnnotationMenuButton::Select()
         mrSidebarWin.ExecuteCommand(FN_REPLY);
     if (sIdent == "resolve" || sIdent == "unresolve")
         mrSidebarWin.ExecuteCommand(FN_RESOLVE_NOTE);
+    else if (sIdent == "resolvethread" || sIdent == "unresolvethread")
+        mrSidebarWin.ExecuteCommand(FN_RESOLVE_NOTE_THREAD);
     else if (sIdent == "delete")
         mrSidebarWin.ExecuteCommand(FN_DELETE_COMMENT);
     else if (sIdent == "deleteby")
@@ -90,6 +92,8 @@ void AnnotationMenuButton::MouseButtonDown( const MouseEvent& rMEvt )
         pButtonPopup->EnableItem(pButtonPopup->GetItemId("reply"), false);
         pButtonPopup->EnableItem(pButtonPopup->GetItemId("resolve"), false);
         pButtonPopup->EnableItem(pButtonPopup->GetItemId("unresolve"), false);
+        pButtonPopup->EnableItem(pButtonPopup->GetItemId("resolvethread"), false);
+        pButtonPopup->EnableItem(pButtonPopup->GetItemId("unresolvethread"), false);
         pButtonPopup->EnableItem(pButtonPopup->GetItemId("delete"), false );
         pButtonPopup->EnableItem(pButtonPopup->GetItemId("deleteby"), false );
         pButtonPopup->EnableItem(pButtonPopup->GetItemId("deleteall"), false );
@@ -99,6 +103,8 @@ void AnnotationMenuButton::MouseButtonDown( const MouseEvent& rMEvt )
     {
         pButtonPopup->EnableItem(pButtonPopup->GetItemId("resolve"), !mrSidebarWin.IsResolved());
         pButtonPopup->EnableItem(pButtonPopup->GetItemId("unresolve"), mrSidebarWin.IsResolved());
+        pButtonPopup->EnableItem(pButtonPopup->GetItemId("resolvethread"), !mrSidebarWin.IsThreadResolved());
+        pButtonPopup->EnableItem(pButtonPopup->GetItemId("unresolvethread"), mrSidebarWin.IsThreadResolved());
         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 ae3bf7ac5501..52af97f096a8 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -1267,6 +1267,13 @@ void SwAnnotationWin::ExecuteCommand(sal_uInt16 nSlot)
             Invalidate();
             mrMgr.LayoutPostIts();
             break;
+        case FN_RESOLVE_NOTE_THREAD:
+            GetTopReplyNote()->SetResolved(!IsThreadResolved());
+            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 31d71d98a23b..f112affe5c69 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -1109,6 +1109,7 @@ void SwAnnotationShell::NoteExec(SfxRequest const &rReq)
         case FN_POSTIT:
         case FN_DELETE_COMMENT:
         case FN_RESOLVE_NOTE:
+        case FN_RESOLVE_NOTE_THREAD:
             if ( pPostItMgr->HasActiveSidebarWin() )
                 pPostItMgr->GetActiveSidebarWin()->ExecuteCommand(nSlot);
             break;
@@ -1181,6 +1182,20 @@ void SwAnnotationShell::GetNoteState(SfxItemSet &rSet)
                 }
                 break;
             }
+        case FN_RESOLVE_NOTE_THREAD:
+            {
+                if( !pPostItMgr
+                    || !pPostItMgr->HasActiveAnnotationWin() )
+                {
+                    rSet.DisableItem(nWhich);
+                }
+                else
+                {
+                    SfxBoolItem aBool(nWhich, pPostItMgr->GetActiveSidebarWin()->IsThreadResolved());
+                    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 a06d7ecc6b02..5331ac1a5331 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -351,6 +351,15 @@ void SwTextShell::ExecField(SfxRequest &rReq)
                 }
                 break;
             }
+            case FN_RESOLVE_NOTE_THREAD:
+            {
+                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 bddfdf9ab9d7..696e9f29b4d3 100644
--- a/sw/uiconfig/sglobal/menubar/menubar.xml
+++ b/sw/uiconfig/sglobal/menubar/menubar.xml
@@ -148,6 +148,7 @@
         <menu:menupopup>
           <menu:menuitem menu:id=".uno:ReplyComment"/>
           <menu:menuitem menu:id=".uno:ResolveComment"/>
+          <menu:menuitem menu:id=".uno:ResolveCommentThread"/>
           <menu:menuitem menu:id=".uno:DeleteComment"/>
           <menu:menuitem menu:id=".uno:DeleteAuthor"/>
           <menu:menuitem menu:id=".uno:DeleteAllNotes"/>
diff --git a/sw/uiconfig/sglobal/popupmenu/annotation.xml b/sw/uiconfig/sglobal/popupmenu/annotation.xml
index 4724bde64c89..1805d2d62f7c 100644
--- a/sw/uiconfig/sglobal/popupmenu/annotation.xml
+++ b/sw/uiconfig/sglobal/popupmenu/annotation.xml
@@ -20,6 +20,7 @@
   <menu:menuseparator/>
   <menu:menuitem menu:id=".uno:ReplyComment"/>
   <menu:menuitem menu:id=".uno:ResolveComment"/>
+  <menu:menuitem menu:id=".uno:ResolveCommentThread"/>
   <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 45503d79573a..f16aa7bfd362 100644
--- a/sw/uiconfig/swriter/menubar/menubar.xml
+++ b/sw/uiconfig/swriter/menubar/menubar.xml
@@ -148,6 +148,7 @@
         <menu:menupopup>
           <menu:menuitem menu:id=".uno:ReplyComment"/>
           <menu:menuitem menu:id=".uno:ResolveComment"/>
+          <menu:menuitem menu:id=".uno:ResolveCommentThread"/>
           <menu:menuitem menu:id=".uno:DeleteComment"/>
           <menu:menuitem menu:id=".uno:DeleteAuthor"/>
           <menu:menuitem menu:id=".uno:DeleteAllNotes"/>
diff --git a/sw/uiconfig/swriter/popupmenu/annotation.xml b/sw/uiconfig/swriter/popupmenu/annotation.xml
index e455091a41b1..87a294bc50c0 100644
--- a/sw/uiconfig/swriter/popupmenu/annotation.xml
+++ b/sw/uiconfig/swriter/popupmenu/annotation.xml
@@ -21,6 +21,7 @@
   <menu:menuitem menu:id=".uno:ReplyComment"/>
   <menu:menuseparator/>
   <menu:menuitem menu:id=".uno:ResolveComment"/>
+  <menu:menuitem menu:id=".uno:ResolveCommentThread"/>
   <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 c21c6bb555a5..7e669fc13f4b 100644
--- a/sw/uiconfig/swriter/ui/annotationmenu.ui
+++ b/sw/uiconfig/swriter/ui/annotationmenu.ui
@@ -35,6 +35,22 @@
         <property name="use_underline">True</property>
       </object>
     </child>
+    <child>
+      <object class="GtkMenuItem" id="resolvethread">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes" context="annotationmenu|resolvethread">Resolve Thread</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="unresolvethread">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes" context="annotationmenu|unresolvethread">Unresolve Thread</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
     <child>
       <object class="GtkMenuItem" id="delete">
         <property name="visible">True</property>
diff --git a/sw/uiconfig/swriter/ui/notebookbar_groupedbar_full.ui b/sw/uiconfig/swriter/ui/notebookbar_groupedbar_full.ui
index bd6b2fa0ca72..8df69eec8aba 100644
--- a/sw/uiconfig/swriter/ui/notebookbar_groupedbar_full.ui
+++ b/sw/uiconfig/swriter/ui/notebookbar_groupedbar_full.ui
@@ -329,6 +329,13 @@
         <property name="action_name">.uno:ResolveComment</property>
       </object>
     </child>
+    <child>
+      <object class="GtkMenuItem" id="MenuComments-ResolveCommentThread">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="action_name">.uno:ResolveCommentThread</property>
+      </object>
+    </child>
     <child>
       <object class="GtkMenuItem" id="MenuComments-DeleteAuthor">
         <property name="visible">True</property>
commit 0b03e1898a32488e91cd6e0a947a13be1eb6d295
Author:     Pranam Lashkari <lpranam at collabora.com>
AuthorDate: Sun Sep 13 17:30:21 2020 +0530
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Sep 15 22:04:10 2020 +0200

    changed FN_RESOLVE_NOTE behaviour to resolve single note
    
    Earlier it used to resolve the entire thread
    and there was no way to resolve a single comment in thread
    
    Change-Id: I471c5b575dd365d52653835be5b0d40009bb5cfa
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102778
    Tested-by: Andras Timar <andras.timar at collabora.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx b/sw/source/uibase/docvw/AnnotationWin.cxx
index 51b30e542766..2701a46cca2e 100644
--- a/sw/source/uibase/docvw/AnnotationWin.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin.cxx
@@ -257,8 +257,23 @@ bool SwAnnotationWin::IsResolved() const
 
 bool SwAnnotationWin::IsThreadResolved()
 {
-    // Not const because GetTopReplyNote isn't.
-    return GetTopReplyNote()->IsResolved();
+    // First Get the top note
+    // then itereate downwards checking resolved status
+    SwAnnotationWin *pTopNote, *TopNote;
+    pTopNote = TopNote = GetTopReplyNote();
+    if (!pTopNote->IsResolved())
+        return false;
+
+    SwAnnotationWin* pSidebarWin = mrMgr.GetNextPostIt(KEY_PAGEDOWN, pTopNote);
+
+    while (pSidebarWin && pSidebarWin->GetTopReplyNote() == TopNote)
+    {
+        pTopNote = pSidebarWin;
+        if (!pTopNote->IsResolved())
+            return false;
+        pSidebarWin = mrMgr.GetNextPostIt(KEY_PAGEDOWN, pSidebarWin);
+    }
+    return true;
 }
 
 void SwAnnotationWin::UpdateData()
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx
index c9ba97fd5adc..ae3bf7ac5501 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -174,7 +174,7 @@ void SwAnnotationWin::Paint(vcl::RenderContext& rRenderContext, const tools::Rec
         }
 
         sal_uInt32 boxHeight = mpMetadataAuthor->GetSizePixel().Height() + mpMetadataDate->GetSizePixel().Height();
-        boxHeight += IsThreadResolved() ? mpMetadataResolved->GetSizePixel().Height() : 0;
+        boxHeight += IsResolved() ? mpMetadataResolved->GetSizePixel().Height() : 0;
 
         rRenderContext.SetLineColor();
         tools::Rectangle aRectangle(Point(mpMetadataAuthor->GetPosPixel().X() + mpMetadataAuthor->GetSizePixel().Width(),
@@ -578,7 +578,7 @@ void SwAnnotationWin::InitControls()
     mpSidebarTextControl->Show();
     mpMetadataAuthor->Show();
     mpMetadataDate->Show();
-    if(IsThreadResolved()) { mpMetadataResolved->Show(); }
+    if(IsResolved()) { mpMetadataResolved->Show(); }
     mpVScrollbar->Show();
 }
 
@@ -900,7 +900,7 @@ void SwAnnotationWin::DoResize()
 
     aHeight -= GetMetaHeight();
     mpMetadataAuthor->Show();
-    if(IsThreadResolved()) { mpMetadataResolved->Show(); }
+    if(IsResolved()) { mpMetadataResolved->Show(); }
     mpMetadataDate->Show();
     mpSidebarTextControl->SetQuickHelpText(OUString());
     unsigned int numFields = GetNumFields();
@@ -925,7 +925,7 @@ void SwAnnotationWin::DoResize()
                                          aHeight + aSizeOfMetadataControls.Height(),
                                          aSizeOfMetadataControls.Width(),
                                          aSizeOfMetadataControls.Height() );
-        if(IsThreadResolved()) {
+        if(IsResolved()) {
             mpMetadataResolved->setPosSizePixel( 0,
                                                  aHeight + aSizeOfMetadataControls.Height()*2,
                                                  aSizeOfMetadataControls.Width(),
@@ -1262,8 +1262,7 @@ void SwAnnotationWin::ExecuteCommand(sal_uInt16 nSlot)
             mnEventId = Application::PostUserEvent( LINK( this, SwAnnotationWin, DeleteHdl), nullptr, true );
             break;
         case FN_RESOLVE_NOTE:
-            GetTopReplyNote()->ToggleResolved();
-            mrMgr.UpdateResolvedStatus(GetTopReplyNote());
+            ToggleResolved();
             DoResize();
             Invalidate();
             mrMgr.LayoutPostIts();
@@ -1387,7 +1386,7 @@ sal_Int32 SwAnnotationWin::GetMetaHeight()
 
 sal_Int32 SwAnnotationWin::GetNumFields()
 {
-    return IsThreadResolved() ? 3 : 2;
+    return IsResolved() ? 3 : 2;
 }
 
 sal_Int32 SwAnnotationWin::GetMinimumSizeWithMeta()
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index 95e79f62cb67..22a62e07cc54 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -1583,6 +1583,31 @@ void SwPostItMgr::Delete(sal_uInt32 nPostItId)
     LayoutPostIts();
 }
 
+void SwPostItMgr::ToggleResolved(sal_uInt32 nPostItId)
+{
+    mpWrtShell->StartAllAction();
+
+    SwRewriter aRewriter;
+    aRewriter.AddRule(UndoArg1, SwResId(STR_CONTENT_TYPE_SINGLE_POSTIT));
+
+    // We have no undo ID at the moment.
+
+    IsPostitFieldWithPostitId aFilter(nPostItId);
+    FieldDocWatchingStack aStack(mvPostItFields, *mpView->GetDocShell(), aFilter);
+    const SwFormatField* pField = aStack.pop();
+    // pField now contains our AnnotationWin object
+    if (pField) {
+        SwAnnotationWin* pWin = GetSidebarWin(pField);
+        pWin->ToggleResolved();
+    }
+
+    PrepareView();
+    mpWrtShell->EndAllAction();
+    mbLayout = true;
+    CalcRects();
+    LayoutPostIts();
+}
+
 void SwPostItMgr::ToggleResolvedForThread(sal_uInt32 nPostItId)
 {
     mpWrtShell->StartAllAction();
@@ -2456,7 +2481,7 @@ void SwPostItMgr::ShowHideResolvedNotes(bool visible) {
     {
         for(auto b = pPage->mvSidebarItems.begin(); b!= pPage->mvSidebarItems.end(); ++b)
         {
-            if ((*b)->pPostIt->IsThreadResolved())
+            if ((*b)->pPostIt->IsResolved())
             {
                 (*b)->pPostIt->SetResolved(true);
                 (*b)->pPostIt->GetSidebarItem().bShow = visible;
diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx
index 1d61b0f95785..a06d7ecc6b02 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -347,10 +347,10 @@ void SwTextShell::ExecField(SfxRequest &rReq)
                 const SvxPostItIdItem* pIdItem = rReq.GetArg<SvxPostItIdItem>(SID_ATTR_POSTIT_ID);
                 if (pIdItem && !pIdItem->GetValue().isEmpty() && GetView().GetPostItMgr())
                 {
-                    GetView().GetPostItMgr()->ToggleResolvedForThread(pIdItem->GetValue().toUInt32());
+                    GetView().GetPostItMgr()->ToggleResolved(pIdItem->GetValue().toUInt32());
                 }
+                break;
             }
-            break;
             case FN_DELETE_ALL_NOTES:
                 if ( GetView().GetPostItMgr() )
                     GetView().GetPostItMgr()->Delete();


More information about the Libreoffice-commits mailing list