summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim MacArthur <jim.macarthur@codethink.co.uk>2019-05-07 18:03:13 +0100
committerMichael Meeks <michael.meeks@collabora.com>2019-05-10 15:18:07 +0100
commitbd7c445c94776e0f5feec34a039be484a35039c1 (patch)
treebf93dbaf44c6e55516106d056c99d21950b86666
parent3a8db5bcfb667353c11f87acc0ad7ec8cf19e651 (diff)
Add 'Resolved comments' option on View menufeature/resolve-comments
Change-Id: Ie13f5abf94e10780116359b77feb7d2db614ea19
-rw-r--r--include/svx/svxids.hrc5
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu11
-rw-r--r--svx/sdi/svx.sdi16
-rw-r--r--sw/inc/PostItMgr.hxx3
-rw-r--r--sw/inc/viewopt.hxx9
-rw-r--r--sw/sdi/_viewsh.sdi8
-rw-r--r--sw/source/uibase/docvw/AnnotationWin.cxx4
-rw-r--r--sw/source/uibase/docvw/PostItMgr.cxx19
-rw-r--r--sw/source/uibase/uiview/view0.cxx22
-rw-r--r--sw/uiconfig/swriter/menubar/menubar.xml1
-rw-r--r--sw/uiconfig/swriter/ui/viewoptionspage.ui30
-rw-r--r--sw/uiconfig/swxform/menubar/menubar.xml1
12 files changed, 125 insertions, 4 deletions
diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index b3ed3911ac36..1bbc4a4f9057 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -979,8 +979,11 @@
#define SID_PARAGRAPH_SIGN_CLASSIFY_DLG ( SID_SVX_START + 1170 )
#define SID_CLASSIFICATION_DIALOG ( SID_SVX_START + 1171 )
+#define SID_TOGGLE_RESOLVED_NOTES ( SID_SVX_START + 1172 )
+
+
// IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id
-#define SID_SVX_FIRSTFREE ( SID_CLASSIFICATION_DIALOG + 1 )
+#define SID_SVX_FIRSTFREE ( SID_TOGGLE_RESOLVED_NOTES + 1 )
// Overflow check for slot IDs
#if SID_SVX_FIRSTFREE > SID_SVX_END
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index f9d0a6a25587..d0c922aba8e2 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -39,6 +39,17 @@
<value>9</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>9</value>
+ </prop>
+ </node>
<node oor:name=".uno:ChangeControlType" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Replace with</value>
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index f929e6625276..fb4a7117dfcb 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -4516,6 +4516,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 d45b277a69f3..c408169628d6 100644
--- a/sw/inc/PostItMgr.hxx
+++ b/sw/inc/PostItMgr.hxx
@@ -229,6 +229,7 @@ class SwPostItMgr: public SfxListener
void Hide( const OUString& rAuthor );
void Hide();
void Show();
+ void ShowHideResolvedNotes(bool visible);
void UpdateResolvedStatus(sw::annotation::SwAnnotationWin* topNote);
void Rescale();
@@ -258,6 +259,8 @@ class SwPostItMgr: public SfxListener
void HideActiveSidebarWin();
void ToggleInsModeOnActiveSidebarWin();
+ bool ResolvedPostItsVisible();
+
sal_Int32 GetMinimumSizeWithMeta() const;
sal_Int32 GetSidebarScrollerHeight() const;
diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx
index 2f51b526cfb2..7cbb50601155 100644
--- a/sw/inc/viewopt.hxx
+++ b/sw/inc/viewopt.hxx
@@ -92,7 +92,8 @@ 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> {};
@@ -259,6 +260,12 @@ public:
{ return bool(m_nCoreOptions & ViewOptFlags1::Postits); }
void SetPostIts( bool b )
{ b ? (m_nCoreOptions |= ViewOptFlags1::Postits ) : ( m_nCoreOptions &= ~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 099033a1a278..28f43d648c96 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 9b895dfc9a3e..b6734889eb21 100644
--- a/sw/source/uibase/docvw/AnnotationWin.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin.cxx
@@ -231,14 +231,14 @@ void SwAnnotationWin::SetPostItText()
void SwAnnotationWin::SetResolved(bool resolved)
{
static_cast<SwPostItField*>(mpFormatField->GetField())->SetResolved(resolved);
- mrSidebarItem.bShow = !resolved;
+ mrSidebarItem.bShow = !resolved || mrMgr.ResolvedPostItsVisible();
Invalidate();
}
void SwAnnotationWin::ToggleResolved()
{
static_cast<SwPostItField*>(mpFormatField->GetField())->ToggleResolved();
- mrSidebarItem.bShow = !IsResolved();
+ mrSidebarItem.bShow = !IsResolved() || mrMgr.ResolvedPostItsVisible();
Invalidate();
}
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index d3bbd5890a18..d36598f64d01 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -2366,6 +2366,25 @@ 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->GetSidebarItem().bShow=visible;
+ }
+ }
+
+ }
+ LayoutPostIts();
+}
+
+bool SwPostItMgr::ResolvedPostItsVisible() {
+ return !mpWrtShell->GetViewOptions()->IsResolvedPostIts();
+}
+
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 235ecc9b532c..d063fcda2a1a 100644
--- a/sw/source/uibase/uiview/view0.cxx
+++ b/sw/source/uibase/uiview/view0.cxx
@@ -275,6 +275,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:
@@ -418,6 +429,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 11633bb51a3a..8a9f701d7a26 100644
--- a/sw/uiconfig/swriter/menubar/menubar.xml
+++ b/sw/uiconfig/swriter/menubar/menubar.xml
@@ -190,6 +190,7 @@
<menu:menuitem menu:id=".uno:TableBoundaries"/>
<menu:menuitem menu:id=".uno:ShowGraphics"/>
<menu:menuitem menu:id=".uno:ShowAnnotations"/>
+ <menu:menuitem menu:id=".uno:ShowResolvedAnnotations"/>
<menu:menuitem menu:id=".uno:ControlCodes"/>
<menu:menu menu:id=".uno:GridMenu">
<menu:menupopup>
diff --git a/sw/uiconfig/swriter/ui/viewoptionspage.ui b/sw/uiconfig/swriter/ui/viewoptionspage.ui
index f63f7428c3e5..c43c33609e9c 100644
--- a/sw/uiconfig/swriter/ui/viewoptionspage.ui
+++ b/sw/uiconfig/swriter/ui/viewoptionspage.ui
@@ -177,6 +177,36 @@
<property name="height">1</property>
</packing>
</child>
+ <child>
+ <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>
+ <property name="left_attach">0</property>
+ <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>
+ </packing>
+ </child>
</object>
</child>
</object>
diff --git a/sw/uiconfig/swxform/menubar/menubar.xml b/sw/uiconfig/swxform/menubar/menubar.xml
index 65f9a5ed0848..3f25e80b4885 100644
--- a/sw/uiconfig/swxform/menubar/menubar.xml
+++ b/sw/uiconfig/swxform/menubar/menubar.xml
@@ -145,6 +145,7 @@
<menu:menuitem menu:id=".uno:ControlCodes"/>
<menu:menuitem menu:id=".uno:ShowHiddenParagraphs"/>
<menu:menuitem menu:id=".uno:ShowAnnotations"/>
+ <menu:menuitem menu:id=".uno:ShowResolvedAnnotations"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:ViewDataSourceBrowser"/>
<menu:menuitem menu:id=".uno:Navigator"/>