summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2020-10-14 15:29:08 +0200
committerLászló Németh <nemeth@numbertext.org>2020-10-15 15:11:12 +0200
commit1e383097aa929176bac33f46787e16d945a0a98b (patch)
tree2109021fecc8f1887d6609e390bc0e8711cf9f93 /sw/inc
parent464f872ea9b5d6d5090cad2ebf9d561e778f3f53 (diff)
tdf#34355 sw,offapi,officecfg: show track changes in margin
In ShowTrackedChanges mode, hide tracked deletions in text optionally and show their shortened text in margin next to the vertical "Changed line" mark (showing only the first deletion of the line). Add "Tracked deletions in margin" checkbox to Writer->View page. Add "Display tracked changes" and "Outline View" sections to View, too. Add property ShowChangesInMargin to com::sun::star::text::ViewSettings. Add config setting: org/openoffice/Office/Writer/Content/Display/ShowChangesInMargin Show more information in Manage Changes dialog window about the tracked deletions with restricted visibility in ShowChangesInMargin mode: show shortened text content of a deletion in its (otherwise empty) Comment field. Change-Id: I1d19a4bf8225f536a635c6dd5062344c51e03b79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104350 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/cmdid.h1
-rw-r--r--sw/inc/redline.hxx10
-rw-r--r--sw/inc/viewopt.hxx13
3 files changed, 17 insertions, 7 deletions
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index fd199598c949..49d6e607f943 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -188,6 +188,7 @@
#define FN_SHOW_OUTLINECONTENTVISIBILITYBUTTON (FN_VIEW + 63) /* Show outline content visibility toggle button */
#define FN_TOGGLE_OUTLINE_CONTENT_VISIBILITY (FN_VIEW + 64)
+#define FN_SHOW_CHANGES_IN_MARGIN (FN_VIEW + 65) /* Show tracked deletions in margin */
// Region: Insert
#define FN_INSERT_BOOKMARK (FN_INSERT + 2 ) /* Bookmark */
diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx
index 3019d6d8a302..95cab2924272 100644
--- a/sw/inc/redline.hxx
+++ b/sw/inc/redline.hxx
@@ -227,9 +227,9 @@ public:
// Otherwise at Move the attribution would be handled incorrectly.
// All other callers must always give 0.
void CallDisplayFunc(size_t nMyPos);
- void Show(sal_uInt16 nLoop , size_t nMyPos);
- void Hide(sal_uInt16 nLoop , size_t nMyPos);
- void ShowOriginal(sal_uInt16 nLoop, size_t nMyPos);
+ void Show(sal_uInt16 nLoop , size_t nMyPos, bool bForced = false);
+ void Hide(sal_uInt16 nLoop , size_t nMyPos, bool bForced = false);
+ void ShowOriginal(sal_uInt16 nLoop, size_t nMyPos, bool bForced = false);
/// Calculates the intersection with text node number nNdIdx.
void CalcStartEnd(sal_uLong nNdIdx, sal_Int32& rStart, sal_Int32& rEnd) const;
@@ -253,8 +253,10 @@ public:
kind of redline and the possibly shortened text of the redline.
@return textual description of the selected redline data element
+
+ bSimplified = simplified shortened text to show deletions on margin
*/
- OUString GetDescr();
+ OUString GetDescr(bool bSimplified = false);
bool operator<( const SwRangeRedline& ) const;
void dumpAsXml(xmlTextWriterPtr pWriter) const;
diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx
index cf501a9d181f..f1049e6b317d 100644
--- a/sw/inc/viewopt.hxx
+++ b/sw/inc/viewopt.hxx
@@ -37,7 +37,7 @@ class SwDocShell;
namespace svtools{ class ColorConfig;}
enum class SwFillMode;
-enum class ViewOptFlags1 : sal_uInt32 {
+enum class ViewOptFlags1 : sal_uInt64 {
UseHeaderFooterMenu = 0x00000001,
Tab = 0x00000002,
Blank = 0x00000004,
@@ -65,10 +65,11 @@ enum class ViewOptFlags1 : sal_uInt32 {
ShowInlineTooltips = 0x10000000, //tooltips on tracked changes
ViewMetachars = 0x20000000,
Pageback = 0x40000000,
- ShowOutlineContentVisibilityButton = 0x80000000
+ ShowOutlineContentVisibilityButton = 0x80000000,
+ ShowChangesInMargin = 0x100000000 //tracked deletions in margin
};
namespace o3tl {
- template<> struct typed_flags<ViewOptFlags1> : is_typed_flags<ViewOptFlags1, 0xF7dfcfff> {};
+ template<> struct typed_flags<ViewOptFlags1> : is_typed_flags<ViewOptFlags1, 0x1F7dfcfff> {};
}
enum class ViewOptCoreFlags2 {
@@ -288,6 +289,12 @@ public:
void SetShowInlineTooltips( bool b )
{ SetCoreOption(b, ViewOptFlags1::ShowInlineTooltips); }
+ //show/hide tracked deletions in text
+ bool IsShowChangesInMargin() const
+ { return bool(m_nCoreOptions & ViewOptFlags1::ShowChangesInMargin); }
+ void SetShowChangesInMargin( bool b )
+ { SetCoreOption(b, ViewOptFlags1::ShowChangesInMargin); }
+
//show/hide interactive header/footer on top/bottom of pages
bool IsUseHeaderFooterMenu() const
{ return bool(m_nCoreOptions & ViewOptFlags1::UseHeaderFooterMenu ); }