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

Scott Clarke (via logerrit) logerrit at kemper.freedesktop.org
Thu Aug 8 06:06:23 UTC 2019


 officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu |   11 ++++
 svx/sdi/svx.sdi                                                     |   16 ++++++
 sw/inc/PostItMgr.hxx                                                |    1 
 sw/inc/viewopt.hxx                                                  |   11 +++-
 sw/sdi/_viewsh.sdi                                                  |    8 +++
 sw/source/uibase/docvw/AnnotationWin.cxx                            |    6 ++
 sw/source/uibase/docvw/PostItMgr.cxx                                |   15 ++++++
 sw/source/uibase/uiview/view0.cxx                                   |   25 +++++++++-
 sw/uiconfig/swriter/menubar/menubar.xml                             |    1 
 sw/uiconfig/swriter/ui/viewoptionspage.ui                           |   22 ++++++++
 sw/uiconfig/swxform/menubar/menubar.xml                             |    1 
 11 files changed, 111 insertions(+), 6 deletions(-)

New commits:
commit fb3a0b084701ee1089a76568b3b110ac5b0df460
Author:     Scott Clarke <scott.clarke at codethink.co.uk>
AuthorDate: Tue Jun 11 13:07:20 2019 +0100
Commit:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Thu Aug 8 08:05:17 2019 +0200

    tdf#119228 Add 'Resolved Comments' option to the View menu.
    
    Change-Id: Ib4554b77857992959a386c71e99e424579196ded
    Co-authored-by: Jim MacArthur <jim.macarthur at codethink.co.uk>
    Reviewed-on: https://gerrit.libreoffice.org/75862
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index f17b8f122128..8d070ffcb6af 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -2554,6 +2554,17 @@
           <value>1</value>
         </prop>
       </node>
+      <node oor:name=".uno:ShowResolvedAnnotations" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Show resolved comme~nts</value>
+        </prop>
+        <prop oor:name="ContextLabel" oor:type="xs:string">
+          <value xml:lang="en-US">Resolved Comments</value>
+        </prop>
+        <prop oor:name="Properties" oor:type="xs:int">
+          <value>1</value>
+        </prop>
+      </node>
       <node oor:name=".uno:ShowGraphics" oor:op="replace">
         <prop oor:name="Label" oor:type="xs:string">
           <value xml:lang="en-US">View Images and Charts</value>
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 22912965caa5..787a0e237839 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -4531,6 +4531,22 @@ SfxVoidItem ShowAnnotations SID_TOGGLE_NOTES
     GroupId = SfxGroupId::View;
 ]
 
+SfxVoidItem ShowResolvedAnnotations SID_TOGGLE_RESOLVED_NOTES
+()
+[
+    AutoUpdate = FALSE,
+    FastCall = FALSE,
+    ReadOnlyDoc = TRUE,
+    Toggle = FALSE,
+    Container = FALSE,
+    RecordAbsolute = FALSE,
+    RecordPerSet;
+
+    AccelConfig = TRUE,
+    MenuConfig = TRUE,
+    ToolBoxConfig = TRUE,
+    GroupId = SfxGroupId::View;
+]
 
 
 SfxVoidItem ReplyToAnnotation SID_REPLYTO_POSTIT
diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx
index f51aa04723fc..89edc53e62f4 100644
--- a/sw/inc/PostItMgr.hxx
+++ b/sw/inc/PostItMgr.hxx
@@ -214,6 +214,7 @@ class SAL_DLLPUBLIC_RTTI SwPostItMgr: public SfxListener
         void Hide();
         void Show();
         void UpdateResolvedStatus(sw::annotation::SwAnnotationWin* topNote);
+        void ShowHideResolvedNotes(bool visible);
 
         void Rescale();
 
diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx
index 05f70f2d2aa6..19eb9d546595 100644
--- a/sw/inc/viewopt.hxx
+++ b/sw/inc/viewopt.hxx
@@ -91,10 +91,11 @@ enum class ViewOptFlags2 {
     ScrollbarTips   = 0x00400000,
     PrintFormat     = 0x00800000,
     ShadowCursor    = 0x01000000,
-    VRulerRight     = 0x02000000
+    VRulerRight     = 0x02000000,
+    ResolvedPostits = 0x04000000,
 };
 namespace o3tl {
-    template<> struct typed_flags<ViewOptFlags2> : is_typed_flags<ViewOptFlags2, 0x03d7dc00> {};
+    template<> struct typed_flags<ViewOptFlags2> : is_typed_flags<ViewOptFlags2, 0x07d7dc00> {};
 };
 
 // Table background.
@@ -256,6 +257,12 @@ public:
         { return bool(m_nCoreOptions & ViewOptFlags1::Postits); }
     void SetPostIts( bool b )
         { SetCoreOption(b, ViewOptFlags1::Postits); }
+
+    bool IsResolvedPostIts() const
+        { return bool(m_nUIOptions & ViewOptFlags2::ResolvedPostits); }
+    void SetResolvedPostIts( bool b )
+        { SetUIOption(b, ViewOptFlags2::ResolvedPostits); }
+
     static void PaintPostIts( OutputDevice *pOut, const SwRect &rRect,
                               bool bIsScript );
     static sal_uInt16 GetPostItsWidth( const OutputDevice *pOut );
diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi
index 43425fc9e6ca..5c4a6234efe9 100644
--- a/sw/sdi/_viewsh.sdi
+++ b/sw/sdi/_viewsh.sdi
@@ -801,6 +801,14 @@ interface BaseTextEditView
         StateMethod = StateViewOptions ;
         Export = FALSE;
     ]
+
+    SID_TOGGLE_RESOLVED_NOTES
+    [
+        ExecMethod = ExecViewOptions ;
+        StateMethod = StateViewOptions ;
+        Export = FALSE;
+    ]
+
      // Everything from here can be removed (Export = FALSE;), if the previous works
     FN_RULER // status()
     [
diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx b/sw/source/uibase/docvw/AnnotationWin.cxx
index 34854f4d421b..bbb08b24aacd 100644
--- a/sw/source/uibase/docvw/AnnotationWin.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin.cxx
@@ -51,6 +51,7 @@
 #include <txtfld.hxx>
 #include <ndtxt.hxx>
 #include <view.hxx>
+#include <viewopt.hxx>
 #include <wrtsh.hxx>
 #include <docsh.hxx>
 #include <doc.hxx>
@@ -225,7 +226,10 @@ void SwAnnotationWin::SetPostItText()
 void SwAnnotationWin::SetResolved(bool resolved)
 {
     static_cast<SwPostItField*>(mpFormatField->GetField())->SetResolved(resolved);
-    mrSidebarItem.bShow = !IsResolved();
+    const SwViewOption* pVOpt = mrView.GetWrtShellPtr()->GetViewOptions();
+    mrSidebarItem.bShow = !IsResolved() || (pVOpt->IsResolvedPostIts());
+
+    mpTextRangeOverlay.reset();
 
     if(IsResolved())
         mpMetadataResolved->Show();
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index 4dbf891781c1..5d47f59200ed 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -2432,6 +2432,21 @@ void SwPostItMgr::GetAllSidebarWinForFrame( const SwFrame& rFrame,
     }
 }
 
+void SwPostItMgr::ShowHideResolvedNotes(bool visible) {
+    for (auto const& pPage : mPages)
+    {
+        for(auto b = pPage->mvSidebarItems.begin(); b!= pPage->mvSidebarItems.end(); ++b)
+        {
+            if ((*b)->pPostIt->IsThreadResolved())
+            {
+                (*b)->pPostIt->SetResolved(true);
+                (*b)->pPostIt->GetSidebarItem().bShow = visible;
+            }
+        }
+    }
+    LayoutPostIts();
+}
+
 void SwPostItMgr::UpdateResolvedStatus(sw::annotation::SwAnnotationWin* topNote) {
     // Given the topmost note as an argument, scans over all notes and sets the
     // 'resolved' state of each descendant of the top notes to the resolved state
diff --git a/sw/source/uibase/uiview/view0.cxx b/sw/source/uibase/uiview/view0.cxx
index 20bf8c3927be..e02467a0e319 100644
--- a/sw/source/uibase/uiview/view0.cxx
+++ b/sw/source/uibase/uiview/view0.cxx
@@ -182,9 +182,10 @@ void SwView::RecheckBrowseMode()
             SID_RULER_BORDERS, SID_RULER_PAGE_POS,
             //SID_ATTR_LONG_LRSPACE,
             SID_HTML_MODE,
-            SID_RULER_PROTECT,
+            SID_RULER_PROTECT, /* 10915 */
             //SID_AUTOSPELL_CHECK,
             //SID_AUTOSPELL_MARKOFF,
+            SID_TOGGLE_RESOLVED_NOTES, /* 11672*/
             FN_RULER,       /*20211*/
             FN_VIEW_GRAPHIC,    /*20213*/
             FN_VIEW_BOUNDS,     /**/
@@ -276,6 +277,17 @@ void SwView::StateViewOptions(SfxItemSet &rSet)
                     aBool.SetValue( pOpt->IsPostIts());
                 break;
             }
+            case SID_TOGGLE_RESOLVED_NOTES:
+            {
+                if (!GetPostItMgr()->HasNotes())
+                {
+                    rSet.DisableItem(nWhich);
+                    nWhich = 0;
+                }
+                else
+                    aBool.SetValue( pOpt->IsResolvedPostIts());
+                break;
+            }
             case FN_VIEW_HIDDEN_PARA:
                 aBool.SetValue( pOpt->IsShowHiddenPara()); break;
             case FN_VIEW_HIDE_WHITESPACE:
@@ -424,6 +436,17 @@ void SwView::ExecViewOptions(SfxRequest &rReq)
             GetPostItMgr()->CheckMetaText();
         break;
 
+    case SID_TOGGLE_RESOLVED_NOTES:
+        if ( STATE_TOGGLE == eState )
+            bFlag = pOpt->IsResolvedPostIts();
+
+        GetPostItMgr()->ShowHideResolvedNotes(!bFlag);
+
+        GetPostItMgr()->SetLayout();
+        pOpt->SetResolvedPostIts( !bFlag );
+
+        break;
+
     case FN_VIEW_HIDDEN_PARA:
         if ( STATE_TOGGLE == eState )
             bFlag = !pOpt->IsShowHiddenPara();
diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml
index d9cfbf8f7f3a..90fce81ab199 100644
--- a/sw/uiconfig/swriter/menubar/menubar.xml
+++ b/sw/uiconfig/swriter/menubar/menubar.xml
@@ -205,6 +205,7 @@
       <menu:menuseparator/>
       <menu:menuitem menu:id=".uno:ViewTrackChanges"/>
       <menu:menuitem menu:id=".uno:ShowAnnotations" menu:style="text"/>
+      <menu:menuitem menu:id=".uno:ShowResolvedAnnotations" menu:style="text"/>
       <menu:menuseparator/>
       <menu:menuitem menu:id=".uno:Marks" menu:style="text"/>
       <menu:menuitem menu:id=".uno:Fieldnames" menu:style="text"/>
diff --git a/sw/uiconfig/swriter/ui/viewoptionspage.ui b/sw/uiconfig/swriter/ui/viewoptionspage.ui
index 5591d6640bfd..4605803f7a57 100644
--- a/sw/uiconfig/swriter/ui/viewoptionspage.ui
+++ b/sw/uiconfig/swriter/ui/viewoptionspage.ui
@@ -166,12 +166,13 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkCheckButton" id="changestooltip">
-                            <property name="label" translatable="yes" context="viewoptionspage|changestooltip">_Tooltips on tracked changes</property>
+                          <object class="GtkCheckButton" id="resolvedcomments">
+                            <property name="label" translatable="yes" context="viewoptionspage|resolvedcomments">_Resolved comments</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">False</property>
                             <property name="use_underline">True</property>
+                            <property name="xalign">0</property>
                             <property name="draw_indicator">True</property>
                           </object>
                           <packing>
@@ -179,6 +180,23 @@
                             <property name="top_attach">5</property>
                           </packing>
                         </child>
+                        <child>
+                          <object class="GtkCheckButton" id="changestooltip">
+                            <property name="label" translatable="yes" context="viewoptionspage|changestooltip">_Tooltips on tracked changes</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="use_underline">True</property>
+                            <property name="draw_indicator">True</property>
+                            </object>
+                          <packing>
+                            <property name="left_attach">0</property>
+                            <property name="top_attach">6</property>
+                            <property name="width">1</property>
+                            <property name="height">1</property>
+                            <property name="xalign">0</property>
+                          </packing>
+                        </child>
                       </object>
                     </child>
                   </object>
diff --git a/sw/uiconfig/swxform/menubar/menubar.xml b/sw/uiconfig/swxform/menubar/menubar.xml
index 74c56bd5ec11..443c70d29e61 100644
--- a/sw/uiconfig/swxform/menubar/menubar.xml
+++ b/sw/uiconfig/swxform/menubar/menubar.xml
@@ -203,6 +203,7 @@
       <menu:menuseparator/>
       <menu:menuitem menu:id=".uno:ViewTrackChanges"/>
       <menu:menuitem menu:id=".uno:ShowAnnotations" menu:style="text"/>
+      <menu:menuitem menu:id=".uno:ShowResolvedAnnotations" menu:style="text"/>
       <menu:menuseparator/>
       <menu:menuitem menu:id=".uno:Marks" menu:style="text"/>
       <menu:menuitem menu:id=".uno:Fieldnames" menu:style="text"/>


More information about the Libreoffice-commits mailing list