summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--offapi/com/sun/star/text/ViewSettings.idl6
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu11
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Writer.xcs10
-rw-r--r--sw/inc/cmdid.h1
-rw-r--r--sw/inc/redline.hxx10
-rw-r--r--sw/inc/viewopt.hxx13
-rw-r--r--sw/sdi/_viewsh.sdi7
-rw-r--r--sw/sdi/swriter.sdi19
-rw-r--r--sw/source/core/doc/DocumentRedlineManager.cxx12
-rw-r--r--sw/source/core/doc/docredln.cxx63
-rw-r--r--sw/source/core/inc/UndoCore.hxx3
-rw-r--r--sw/source/core/layout/wsfrm.cxx4
-rw-r--r--sw/source/core/text/frmpaint.cxx57
-rw-r--r--sw/source/core/text/porlay.cxx13
-rw-r--r--sw/source/core/text/porlay.hxx4
-rw-r--r--sw/source/core/text/redlnitr.cxx12
-rw-r--r--sw/source/core/text/redlnitr.hxx3
-rw-r--r--sw/source/core/undo/undel.cxx12
-rw-r--r--sw/source/ui/config/optpage.cxx3
-rw-r--r--sw/source/uibase/config/cfgitems.cxx4
-rw-r--r--sw/source/uibase/config/usrpref.cxx5
-rw-r--r--sw/source/uibase/inc/cfgitems.hxx1
-rw-r--r--sw/source/uibase/inc/optpage.hxx1
-rw-r--r--sw/source/uibase/misc/redlndlg.cxx19
-rw-r--r--sw/source/uibase/uiview/view0.cxx10
-rw-r--r--sw/source/uibase/uno/unomod.cxx6
-rw-r--r--sw/uiconfig/swriter/ui/viewoptionspage.ui150
27 files changed, 376 insertions, 83 deletions
diff --git a/offapi/com/sun/star/text/ViewSettings.idl b/offapi/com/sun/star/text/ViewSettings.idl
index 656866a5a08a..8261ca1dc50f 100644
--- a/offapi/com/sun/star/text/ViewSettings.idl
+++ b/offapi/com/sun/star/text/ViewSettings.idl
@@ -290,6 +290,12 @@ published service ViewSettings
*/
[optional, property] boolean ShowOutlineContentVisibilityButton;
+ /** If this property is `TRUE`, tracked deletions are shown in margin.
+
+ @since LibreOffice 7.1
+ */
+ [optional, property] boolean ShowChangesInMargin;
+
};
}; }; }; };
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index f3e04aab39b6..d4f3f0c70b4b 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -412,6 +412,17 @@
<value>true</value>
</prop>
</node>
+ <node oor:name=".uno:ShowChangesInMargin" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Show tracked deletions in margin</value>
+ </prop>
+ <prop oor:name="TooltipLabel" oor:type="xs:string">
+ <value xml:lang="en-US">Show tracked deletions in margin</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
<node oor:name=".uno:GotoPage" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Go t~o Page...</value>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
index a50ac3e247cd..069b68aac076 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
@@ -1072,13 +1072,21 @@
<value>true</value>
</prop>
<prop oor:name="ShowOutlineContentVisibilityButton" oor:type="xs:boolean" oor:nillable="false">
- <!-- UIHints: Tools - Options - Writer - View - [Section] Display -->
+ <!-- UIHints: Tools - Options - Writer - View - [Section] Outline mode -->
<info>
<desc>Enables the writer to show the outline content visibility button.</desc>
<label>Show outline content visibility button</label>
</info>
<value>false</value>
</prop>
+ <prop oor:name="ShowChangesInMargin" oor:type="xs:boolean" oor:nillable="false">
+ <!-- UIHints: Tools - Options - Writer - View - [Section] Display tracked changes -->
+ <info>
+ <desc>Enables the writer to show tracked deletions in margin.</desc>
+ <label>Show tracked deletions in margin</label>
+ </info>
+ <value>false</value>
+ </prop>
</group>
<group oor:name="NonprintingCharacter">
<info>
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 ); }
diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi
index 8231265d4e21..61bd43768cf0 100644
--- a/sw/sdi/_viewsh.sdi
+++ b/sw/sdi/_viewsh.sdi
@@ -967,5 +967,12 @@ interface BaseTextEditView
StateMethod = StateViewOptions ;
]
+ FN_SHOW_CHANGES_IN_MARGIN
+ [
+ ExecMethod = ExecViewOptions ;
+ StateMethod = StateViewOptions ;
+ MenuConfig , AccelConfig , ToolBoxConfig ;
+ ]
+
}
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 3d29704f8f1b..ccfc2821c4dc 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -7930,7 +7930,7 @@ SfxVoidItem NavElement FN_NAV_ELEMENT
GroupId = SfxGroupId::Navigator;
]
-SfxBoolItem ShowInlineTooltips FN_SHOW_INLINETOOLTIPS
+SfxBoolItem ShowChangesInMargin FN_SHOW_CHANGES_IN_MARGIN
()
[
AutoUpdate = FALSE,
@@ -7981,6 +7981,23 @@ SfxBoolItem ShowOutlineContentVisibilityButton FN_SHOW_OUTLINECONTENTVISIBILITYB
GroupId = SfxGroupId::View;
]
+SfxBoolItem ShowInlineTooltips FN_SHOW_INLINETOOLTIPS
+()
+[
+ AutoUpdate = FALSE,
+ FastCall = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = TRUE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ ToolBoxConfig = TRUE,
+ GroupId = SfxGroupId::View;
+]
+
SfxVoidItem TextFormField FN_INSERT_TEXT_FORMFIELD
[
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx
index 3ab124787506..206a81a928b2 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -993,7 +993,7 @@ void DocumentRedlineManager::SetRedlineFlags( RedlineFlags eMode )
bool bSaveInXMLImportFlag = m_rDoc.IsInXMLImport();
m_rDoc.SetInXMLImport( false );
// and then hide/display everything
- void (SwRangeRedline::*pFnc)(sal_uInt16, size_t); // Allow compiler warn if use of
+ void (SwRangeRedline::*pFnc)(sal_uInt16, size_t, bool); // Allow compiler warn if use of
// uninitialized ptr is possible
RedlineFlags eShowMode = RedlineFlags::ShowMask & eMode;
@@ -1035,7 +1035,7 @@ void DocumentRedlineManager::SetRedlineFlags( RedlineFlags eMode )
for (size_t i = 0; i < mpRedlineTable->size(); ++i)
{
SwRangeRedline *const pRedline((*mpRedlineTable)[i]);
- (pRedline->*pFnc)(nLoop, i);
+ (pRedline->*pFnc)(nLoop, i, false);
while (mpRedlineTable->size() <= i
|| (*mpRedlineTable)[i] != pRedline)
{ // ensure current position
@@ -2273,7 +2273,7 @@ void DocumentRedlineManager::CompressRedlines()
{
CHECK_REDLINE( *this )
- void (SwRangeRedline::*pFnc)(sal_uInt16, size_t) = nullptr;
+ void (SwRangeRedline::*pFnc)(sal_uInt16, size_t, bool) = nullptr;
RedlineFlags eShow = RedlineFlags::ShowMask & meRedlineFlags;
if( eShow == (RedlineFlags::ShowInsert | RedlineFlags::ShowDelete))
pFnc = &SwRangeRedline::Show;
@@ -2305,7 +2305,7 @@ void DocumentRedlineManager::CompressRedlines()
mpRedlineTable->DeleteAndDestroy( n );
--n;
if( pFnc )
- (pPrev->*pFnc)(0, nPrevIndex);
+ (pPrev->*pFnc)(0, nPrevIndex, false);
}
}
CHECK_REDLINE( *this )
@@ -2603,6 +2603,8 @@ bool DocumentRedlineManager::AcceptRedline( SwRedlineTable::size_type nPos, bool
SetRedlineFlags( RedlineFlags::ShowInsert | RedlineFlags::ShowDelete | meRedlineFlags );
SwRangeRedline* pTmp = (*mpRedlineTable)[ nPos ];
+ pTmp->Show(0, mpRedlineTable->GetPos(pTmp), /*bForced=*/true);
+ pTmp->Show(1, mpRedlineTable->GetPos(pTmp), /*bForced=*/true);
if( pTmp->HasMark() && pTmp->IsVisible() )
{
if (m_rDoc.GetIDocumentUndoRedo().DoesUndo())
@@ -2745,6 +2747,8 @@ bool DocumentRedlineManager::RejectRedline( SwRedlineTable::size_type nPos, bool
SetRedlineFlags( RedlineFlags::ShowInsert | RedlineFlags::ShowDelete | meRedlineFlags );
SwRangeRedline* pTmp = (*mpRedlineTable)[ nPos ];
+ pTmp->Show(0, mpRedlineTable->GetPos(pTmp), /*bForced=*/true);
+ pTmp->Show(1, mpRedlineTable->GetPos(pTmp), /*bForced=*/true);
if( pTmp->HasMark() && pTmp->IsVisible() )
{
if (m_rDoc.GetIDocumentUndoRedo().DoesUndo())
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 9abe6b839423..23c4fa59d145 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -46,6 +46,8 @@
#include <pamtyp.hxx>
#include <poolfmt.hxx>
#include <view.hxx>
+#include <viewopt.hxx>
+#include <usrpref.hxx>
#include <viewsh.hxx>
#include <viscrs.hxx>
#include <rootfrm.hxx>
@@ -1105,12 +1107,23 @@ void SwRangeRedline::CallDisplayFunc(size_t nMyPos)
ShowOriginal(0, nMyPos);
}
-void SwRangeRedline::Show(sal_uInt16 nLoop, size_t nMyPos)
+void SwRangeRedline::Show(sal_uInt16 nLoop, size_t nMyPos, bool bForced)
{
- if( 1 > nLoop )
+ SwDoc& rDoc = GetDoc();
+
+ bool bIsShowChangesInMargin = false;
+ if ( !bForced )
+ {
+ SwViewShell* pSh = rDoc.getIDocumentLayoutAccess().GetCurrentViewShell();
+ if (pSh)
+ bIsShowChangesInMargin = pSh->GetViewOptions()->IsShowChangesInMargin();
+ else
+ bIsShowChangesInMargin = SW_MOD()->GetUsrPref(false)->IsShowChangesInMargin();
+ }
+
+ if( 1 > nLoop && !bIsShowChangesInMargin )
return;
- SwDoc& rDoc = GetDoc();
RedlineFlags eOld = rDoc.getIDocumentRedlineAccess().GetRedlineFlags();
rDoc.getIDocumentRedlineAccess().SetRedlineFlags_intern(eOld | RedlineFlags::Ignore);
::sw::UndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo());
@@ -1123,8 +1136,19 @@ void SwRangeRedline::Show(sal_uInt16 nLoop, size_t nMyPos)
break;
case RedlineType::Delete: // Content has been deleted
- m_bIsVisible = true;
- MoveFromSection(nMyPos);
+ m_bIsVisible = !bIsShowChangesInMargin;
+
+ if (m_bIsVisible)
+ MoveFromSection(nMyPos);
+ else
+ {
+ switch( nLoop )
+ {
+ case 0: MoveToSection(); break;
+ case 1: CopyToSection(); break;
+ case 2: DelCopyOfSection(nMyPos); break;
+ }
+ }
break;
case RedlineType::Format: // Attributes have been applied
@@ -1137,7 +1161,7 @@ void SwRangeRedline::Show(sal_uInt16 nLoop, size_t nMyPos)
rDoc.getIDocumentRedlineAccess().SetRedlineFlags_intern( eOld );
}
-void SwRangeRedline::Hide(sal_uInt16 nLoop, size_t nMyPos)
+void SwRangeRedline::Hide(sal_uInt16 nLoop, size_t nMyPos, bool /*bForced*/)
{
SwDoc& rDoc = GetDoc();
RedlineFlags eOld = rDoc.getIDocumentRedlineAccess().GetRedlineFlags();
@@ -1173,7 +1197,7 @@ void SwRangeRedline::Hide(sal_uInt16 nLoop, size_t nMyPos)
rDoc.getIDocumentRedlineAccess().SetRedlineFlags_intern( eOld );
}
-void SwRangeRedline::ShowOriginal(sal_uInt16 nLoop, size_t nMyPos)
+void SwRangeRedline::ShowOriginal(sal_uInt16 nLoop, size_t nMyPos, bool /*bForced*/)
{
SwDoc& rDoc = GetDoc();
RedlineFlags eOld = rDoc.getIDocumentRedlineAccess().GetRedlineFlags();
@@ -1766,7 +1790,7 @@ const SwRedlineData & SwRangeRedline::GetRedlineData(const sal_uInt16 nPos) cons
return *pCur;
}
-OUString SwRangeRedline::GetDescr()
+OUString SwRangeRedline::GetDescr(bool bSimplified)
{
// get description of redline data (e.g.: "insert $1")
OUString aResult = GetRedlineData().GetDescr();
@@ -1786,24 +1810,35 @@ OUString SwRangeRedline::GetDescr()
bDeletePaM = true;
}
- OUString sDescr = DenoteSpecialCharacters(pPaM->GetText());
+ OUString sDescr = DenoteSpecialCharacters(pPaM->GetText().replace('\n', ' '), /*bQuoted=*/!bSimplified);
if (const SwTextNode *pTextNode = pPaM->GetNode().GetTextNode())
{
if (const SwTextAttr* pTextAttr = pTextNode->GetFieldTextAttrAt(pPaM->GetPoint()->nContent.GetIndex() - 1, true ))
{
- sDescr = SwResId(STR_START_QUOTE)
+ sDescr = ( bSimplified ? "" : SwResId(STR_START_QUOTE) )
+ pTextAttr->GetFormatField().GetField()->GetFieldName()
- + SwResId(STR_END_QUOTE);
+ + ( bSimplified ? "" : SwResId(STR_END_QUOTE) );
}
}
// replace $1 in description by description of the redlines text
const OUString aTmpStr = ShortenString(sDescr, nUndoStringLength, SwResId(STR_LDOTS));
- SwRewriter aRewriter;
- aRewriter.AddRule(UndoArg1, aTmpStr);
+ if (!bSimplified)
+ {
+ SwRewriter aRewriter;
+ aRewriter.AddRule(UndoArg1, aTmpStr);
- aResult = aRewriter.Apply(aResult);
+ aResult = aRewriter.Apply(aResult);
+ }
+ else
+ {
+ aResult = aTmpStr;
+ // more shortening
+ sal_Int32 nPos = aTmpStr.indexOf(SwResId(STR_LDOTS));
+ if (nPos > 5)
+ aResult = aTmpStr.copy(0, nPos + SwResId(STR_LDOTS).getLength());
+ }
if (bDeletePaM)
delete pPaM;
diff --git a/sw/source/core/inc/UndoCore.hxx b/sw/source/core/inc/UndoCore.hxx
index b94f95b08601..8fb5e8dcf3f7 100644
--- a/sw/source/core/inc/UndoCore.hxx
+++ b/sw/source/core/inc/UndoCore.hxx
@@ -257,6 +257,7 @@ ShortenString(const OUString & rStr, sal_Int32 nLength, const OUString & rFillSt
maximal.
@param rStr the string to denote in
+ @param bQuoted add quotation marks to the text
The resulting string is generated by concatenating the found
parts. The parts without special characters are surrounded by
@@ -266,7 +267,7 @@ ShortenString(const OUString & rStr, sal_Int32 nLength, const OUString & rFillSt
@return the denoted string
*/
-OUString DenoteSpecialCharacters(const OUString & rStr);
+OUString DenoteSpecialCharacters(const OUString & rStr, bool bQuoted = true);
#endif // INCLUDED_SW_SOURCE_CORE_INC_UNDOCORE_HXX
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index 254c1640392a..67ec529a92a7 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -4554,10 +4554,12 @@ void SwRootFrame::SetHideRedlines(bool const bHideRedlines)
AppendAllObjs(rDoc.GetSpzFrameFormats(), this);
}
+ const bool bIsShowChangesInMargin = GetCurrShell()->GetViewOptions()->IsShowChangesInMargin();
for (auto const pRedline : rDoc.getIDocumentRedlineAccess().GetRedlineTable())
{ // DELETE are handled by the code above; for other types, need to
// trigger repaint of text frames to add/remove the redline color font
- if (pRedline->GetType() != RedlineType::Delete)
+ // (handle deletions showed in margin also here)
+ if (bIsShowChangesInMargin || pRedline->GetType() != RedlineType::Delete)
{
pRedline->InvalidateRange(SwRangeRedline::Invalidation::Add);
}
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index 4704b55044e4..77be33698d44 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -38,6 +38,7 @@
#include "txtcache.hxx"
#include <flyfrm.hxx>
#include "redlnitr.hxx"
+#include <redline.hxx>
#include <swmodule.hxx>
#include <tabfrm.hxx>
#include <numrule.hxx>
@@ -86,7 +87,7 @@ public:
return !(m_nLineNr % m_rLineInf.GetDividerCountBy());
}
- void PaintExtra( SwTwips nY, long nAsc, long nMax, bool bRed );
+ void PaintExtra( SwTwips nY, long nAsc, long nMax, bool bRed, const OUString* pRedlineText = nullptr );
void PaintRedline( SwTwips nY, long nMax );
};
@@ -113,7 +114,6 @@ SwExtraPainter::SwExtraPainter( const SwTextFrame *pFrame, SwViewShell *pVwSh,
m_aRect.Bottom( nBottom );
}
std::optional<bool> oIsRightPage;
- if( bLineNum )
{
/* Initializes the Members necessary for line numbering:
@@ -132,6 +132,10 @@ SwExtraPainter::SwExtraPainter( const SwTextFrame *pFrame, SwViewShell *pVwSh,
m_pFnt->Invalidate();
m_pFnt->ChgPhysFnt( m_pSh, *m_pSh->GetOut() );
m_pFnt->SetVertical( 0, pFrame->IsVertical() );
+ }
+
+ if( bLineNum )
+ {
m_nLineNr += pFrame->GetAllLines() - pFrame->GetThisLines();
LineNumberPosition ePos = m_rLineInf.GetPos();
if( ePos != LINENUMBER_POS_LEFT && ePos != LINENUMBER_POS_RIGHT )
@@ -179,15 +183,26 @@ SwExtraPainter::SwExtraPainter( const SwTextFrame *pFrame, SwViewShell *pVwSh,
pTmpFrame->getFrameArea().Right() + REDLINE_DISTANCE;
}
-void SwExtraPainter::PaintExtra( SwTwips nY, long nAsc, long nMax, bool bRed )
+void SwExtraPainter::PaintExtra( SwTwips nY, long nAsc, long nMax, bool bRed, const OUString* pRedlineText )
{
- // Line number is stronger than the divider
- const OUString aTmp( HasNumber() ? m_rLineInf.GetNumType().GetNumStr( m_nLineNr )
- : m_rLineInf.GetDivider() );
+ const OUString aTmp( pRedlineText
+ // Tracked change is stronger than the line number
+ ? *pRedlineText
+ : ( HasNumber()
+ // Line number is stronger than the divider
+ ? m_rLineInf.GetNumType().GetNumStr( m_nLineNr )
+ : m_rLineInf.GetDivider() ) );
// Get script type of line numbering:
m_pFnt->SetActual( SwScriptInfo::WhichFont(0, aTmp) );
+ if ( pRedlineText )
+ {
+ m_pFnt->SetColor(NON_PRINTING_CHARACTER_COLOR);
+ m_pFnt->SetStrikeout( STRIKEOUT_SINGLE );
+ m_pFnt->SetSize( Size( 0, 200), m_pFnt->GetActual() );
+ }
+
SwDrawTextInfo aDrawInf( m_pSh, *m_pSh->GetOut(), aTmp, 0, aTmp.getLength() );
aDrawInf.SetSpace( 0 );
aDrawInf.SetWrong( nullptr );
@@ -215,6 +230,11 @@ void SwExtraPainter::PaintExtra( SwTwips nY, long nAsc, long nMax, bool bRed )
pTmpFnt = GetFont();
Point aTmpPos( m_nX, nY );
aTmpPos.AdjustY(nAsc );
+ if ( pRedlineText )
+ {
+ Size aSize = pTmpFnt->GetTextSize_( aDrawInf );
+ aTmpPos.AdjustX( -(aSize.Width()) - 200 );
+ }
bool bPaint = true;
if( !IsClipChg() )
{
@@ -359,6 +379,7 @@ void SwTextFrame::PaintExtraData( const SwRect &rRect ) const
}
bNoPrtLine = aLine.Y() >= GetMinPrtLine();
}
+ const bool bIsShowChangesInMargin = pSh->GetViewOptions()->IsShowChangesInMargin();
if( bNoPrtLine )
{
do
@@ -368,14 +389,28 @@ void SwTextFrame::PaintExtraData( const SwRect &rRect ) const
bool bRed = bRedLine && aLine.GetCurr()->HasRedline();
if( rLineInf.IsCountBlankLines() || aLine.GetCurr()->HasContent() )
{
- if( bLineNum &&
- ( aExtra.HasNumber() || aExtra.HasDivider() ) )
+ bool bRedInMargin = bIsShowChangesInMargin && bRed;
+ bool bNum = bLineNum && ( aExtra.HasNumber() || aExtra.HasDivider() );
+ if( bRedInMargin || bNum )
{
sal_uInt16 nTmpHeight, nTmpAscent;
aLine.CalcAscentAndHeight( nTmpAscent, nTmpHeight );
- aExtra.PaintExtra( aLine.Y(), nTmpAscent,
- nTmpHeight, bRed );
- bRed = false;
+ if ( bRedInMargin )
+ {
+ const OUString* pRedlineText = aLine.GetCurr()->GetRedlineText();
+ if( !pRedlineText->isEmpty() )
+ {
+ aExtra.PaintExtra( aLine.Y(), nTmpAscent,
+ nTmpHeight, bRed, pRedlineText );
+ bRed = false;
+ bNum = false;
+ }
+ }
+ if ( bNum )
+ {
+ aExtra.PaintExtra( aLine.Y(), nTmpAscent, nTmpHeight, bRed );
+ bRed = false;
+ }
}
aExtra.IncLineNr();
}
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index e8d77ddbbc6a..4524751a1ddb 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -601,9 +601,16 @@ void SwLineLayout::CalcLine( SwTextFormatter &rLine, SwTextFormatInfo &rInf )
rInf.GetTextFrame()->MapViewToModel(rLine.GetStart()));
std::pair<SwTextNode const*, sal_Int32> const end(
rInf.GetTextFrame()->MapViewToModel(rLine.GetEnd()));
- SetRedline( rLine.GetRedln() &&
- rLine.GetRedln()->CheckLine(start.first->GetIndex(), start.second,
- end.first->GetIndex(), end.second) );
+ bool bHasRedline = rLine.GetRedln();
+ if( bHasRedline )
+ {
+ OUString sRedlineText;
+ bHasRedline = rLine.GetRedln()->CheckLine(start.first->GetIndex(), start.second,
+ end.first->GetIndex(), end.second, sRedlineText );
+ if( bHasRedline )
+ SetRedlineText( sRedlineText );
+ }
+ SetRedline( bHasRedline );
}
// #i47162# - add optional parameter <_bNoFlyCntPorAndLinePor>
diff --git a/sw/source/core/text/porlay.hxx b/sw/source/core/text/porlay.hxx
index 2836ffe991d3..56ed00e693e8 100644
--- a/sw/source/core/text/porlay.hxx
+++ b/sw/source/core/text/porlay.hxx
@@ -97,6 +97,8 @@ private:
bool m_bHanging : 1; // Contains a hanging portion in the margin
bool m_bUnderscore : 1;
+ OUString m_sRedlineText; // shortened text of (first) tracked deletion shown in margin
+
SwTwips GetHangingMargin_() const;
void DeleteNext();
@@ -128,6 +130,8 @@ public:
bool HasContent() const { return m_bContent; }
void SetRedline( const bool bNew ) { m_bRedline = bNew; }
bool HasRedline() const { return m_bRedline; }
+ void SetRedlineText ( const OUString& sText ) { m_sRedlineText = sText; }
+ const OUString* GetRedlineText() const { return &m_sRedlineText; }
void SetForcedLeftMargin() { m_bForcedLeftMargin = true; }
bool HasForcedLeftMargin() const { return m_bForcedLeftMargin; }
void SetHanging( const bool bNew ) { m_bHanging = bNew; }
diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index 11a2bfcee920..2bd0c2ccdc23 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -804,7 +804,7 @@ bool SwRedlineItr::ChkSpecialUnderline_() const
bool SwRedlineItr::CheckLine(
sal_uLong const nStartNode, sal_Int32 const nChkStart,
- sal_uLong const nEndNode, sal_Int32 nChkEnd)
+ sal_uLong const nEndNode, sal_Int32 nChkEnd, OUString& rRedlineText)
{
// note: previously this would return true in the (!m_bShow && m_pExt)
// case, but surely that was a bug?
@@ -820,13 +820,19 @@ bool SwRedlineItr::CheckLine(
for (m_nAct = m_nFirst; m_nAct < m_rDoc.getIDocumentRedlineAccess().GetRedlineTable().size(); ++m_nAct)
{
- m_rDoc.getIDocumentRedlineAccess().GetRedlineTable()[ m_nAct ]->CalcStartEnd( m_nNdIdx, m_nStart, m_nEnd );
+ SwRangeRedline const*const pRedline(
+ m_rDoc.getIDocumentRedlineAccess().GetRedlineTable()[ m_nAct ] );
+ pRedline->CalcStartEnd( m_nNdIdx, m_nStart, m_nEnd );
if (nChkEnd < m_nStart)
break;
if (nChkStart <= m_nEnd && (nChkEnd > m_nStart || COMPLETE_STRING == m_nEnd))
{
bRet = true;
- break;
+ if ( pRedline->GetType() == RedlineType::Delete )
+ {
+ rRedlineText = const_cast<SwRangeRedline*>(pRedline)->GetDescr(/*bSimplified=*/true);
+ break;
+ }
}
}
diff --git a/sw/source/core/text/redlnitr.hxx b/sw/source/core/text/redlnitr.hxx
index 6fc39e14f240..715fa9ed7e33 100644
--- a/sw/source/core/text/redlnitr.hxx
+++ b/sw/source/core/text/redlnitr.hxx
@@ -118,7 +118,8 @@ public:
sal_Int32 nNext, SwTextNode const* pNode, SwRedlineTable::size_type & rAct);
bool ChkSpecialUnderline() const
{ return IsOn() && ChkSpecialUnderline_(); }
- bool CheckLine(sal_uLong nStartNode, sal_Int32 nChkStart, sal_uLong nEndNode, sal_Int32 nChkEnd);
+ bool CheckLine(sal_uLong nStartNode, sal_Int32 nChkStart, sal_uLong nEndNode,
+ sal_Int32 nChkEnd, OUString& rRedlineText);
bool LeaveExtend(SwFont& rFnt, sal_uLong const nNode, sal_Int32 const nNew)
{ return m_pExt->Leave(rFnt, nNode, nNew); }
bool ExtOn() {
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index f86988496778..85cc49753de8 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -659,7 +659,7 @@ static bool lcl_IsSpecialCharacter(sal_Unicode nChar)
return false;
}
-static OUString lcl_DenotedPortion(const OUString& rStr, sal_Int32 nStart, sal_Int32 nEnd)
+static OUString lcl_DenotedPortion(const OUString& rStr, sal_Int32 nStart, sal_Int32 nEnd, bool bQuoted)
{
OUString aResult;
@@ -701,18 +701,20 @@ static OUString lcl_DenotedPortion(const OUString& rStr, sal_Int32 nStart, sal_I
aRewriter.AddRule(UndoArg1, OUString::number(nCount));
aResult = aRewriter.Apply(aResult);
}
- else
+ else if (bQuoted)
{
aResult = SwResId(STR_START_QUOTE) +
rStr.copy(nStart, nCount) +
SwResId(STR_END_QUOTE);
}
+ else
+ aResult = rStr.copy(nStart, nCount);
}
return aResult;
}
-OUString DenoteSpecialCharacters(const OUString & rStr)
+OUString DenoteSpecialCharacters(const OUString & rStr, bool bQuoted)
{
OUStringBuffer aResult;
@@ -738,7 +740,7 @@ OUString DenoteSpecialCharacters(const OUString & rStr)
if (bStart)
{
- aResult.append(lcl_DenotedPortion(rStr, nStart, i));
+ aResult.append(lcl_DenotedPortion(rStr, nStart, i, bQuoted));
nStart = i;
bStart = false;
@@ -747,7 +749,7 @@ OUString DenoteSpecialCharacters(const OUString & rStr)
cLast = rStr[i];
}
- aResult.append(lcl_DenotedPortion(rStr, nStart, rStr.getLength()));
+ aResult.append(lcl_DenotedPortion(rStr, nStart, rStr.getLength(), bQuoted));
}
else
aResult = SwRewriter::GetPlaceHolder(UndoArg2);
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 1fff3ebb657b..4cba683ec396 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -103,6 +103,7 @@ SwContentOptPage::SwContentOptPage(weld::Container* pPage, weld::DialogControlle
, m_xMetricLB(m_xBuilder->weld_combo_box("measureunit"))
, m_xShowInlineTooltips(m_xBuilder->weld_check_button("changestooltip"))
, m_xShowOutlineContentVisibilityButton(m_xBuilder->weld_check_button("outlinecontentvisibilitybutton"))
+ , m_xShowChangesInMargin(m_xBuilder->weld_check_button("changesinmargin"))
, m_xFieldHiddenCB(m_xBuilder->weld_check_button("hiddentextfield"))
, m_xFieldHiddenParaCB(m_xBuilder->weld_check_button("hiddenparafield"))
{
@@ -207,6 +208,7 @@ void SwContentOptPage::Reset(const SfxItemSet* rSet)
m_xSmoothCBox->set_active(pElemAttr->m_bSmoothScroll);
m_xShowInlineTooltips->set_active(pElemAttr->m_bShowInlineTooltips);
m_xShowOutlineContentVisibilityButton->set_active(pElemAttr->m_bShowOutlineContentVisibilityButton);
+ m_xShowChangesInMargin->set_active(pElemAttr->m_bShowChangesInMargin);
m_xFieldHiddenCB->set_active( pElemAttr->m_bFieldHiddenText );
m_xFieldHiddenParaCB->set_active( pElemAttr->m_bShowHiddenPara );
if (GetActiveWrtShell()->GetViewOptions()->IsShowOutlineContentVisibilityButton() != pElemAttr->m_bShowOutlineContentVisibilityButton)
@@ -234,6 +236,7 @@ bool SwContentOptPage::FillItemSet(SfxItemSet* rSet)
aElem.m_bSmoothScroll = m_xSmoothCBox->get_active();
aElem.m_bShowInlineTooltips = m_xShowInlineTooltips->get_active();
aElem.m_bShowOutlineContentVisibilityButton = m_xShowOutlineContentVisibilityButton->get_active();
+ aElem.m_bShowChangesInMargin = m_xShowChangesInMargin->get_active();
aElem.m_bFieldHiddenText = m_xFieldHiddenCB->get_active();
aElem.m_bShowHiddenPara = m_xFieldHiddenParaCB->get_active();
diff --git a/sw/source/uibase/config/cfgitems.cxx b/sw/source/uibase/config/cfgitems.cxx
index 457ced7d6320..fc163193547f 100644
--- a/sw/source/uibase/config/cfgitems.cxx
+++ b/sw/source/uibase/config/cfgitems.cxx
@@ -96,6 +96,7 @@ SwElemItem::SwElemItem() :
m_bNotes = false;
m_bShowInlineTooltips = true;
m_bShowOutlineContentVisibilityButton =
+ m_bShowChangesInMargin =
m_bFieldHiddenText =
m_bShowHiddenPara = false;
}
@@ -113,6 +114,7 @@ SwElemItem::SwElemItem(const SwViewOption& rVOpt) :
m_bNotes = rVOpt.IsPostIts();
m_bShowInlineTooltips = rVOpt.IsShowInlineTooltips();
m_bShowOutlineContentVisibilityButton = rVOpt.IsShowOutlineContentVisibilityButton();
+ m_bShowChangesInMargin = rVOpt.IsShowChangesInMargin();
m_bFieldHiddenText = rVOpt.IsShowHiddenField();
m_bShowHiddenPara = rVOpt.IsShowHiddenPara();
}
@@ -138,6 +140,7 @@ bool SwElemItem::operator==( const SfxPoolItem& rAttr ) const
m_bNotes == rItem.m_bNotes &&
m_bShowInlineTooltips == rItem.m_bShowInlineTooltips &&
m_bShowOutlineContentVisibilityButton == rItem.m_bShowOutlineContentVisibilityButton &&
+ m_bShowChangesInMargin == rItem.m_bShowChangesInMargin &&
m_bFieldHiddenText == rItem.m_bFieldHiddenText &&
m_bShowHiddenPara == rItem.m_bShowHiddenPara);
}
@@ -155,6 +158,7 @@ void SwElemItem::FillViewOptions( SwViewOption& rVOpt) const
rVOpt.SetPostIts (m_bNotes );
rVOpt.SetShowInlineTooltips( m_bShowInlineTooltips );
rVOpt.SetShowOutlineContentVisibilityButton(m_bShowOutlineContentVisibilityButton);
+ rVOpt.SetShowChangesInMargin( m_bShowChangesInMargin );
rVOpt.SetShowHiddenField(m_bFieldHiddenText );
rVOpt.SetShowHiddenPara(m_bShowHiddenPara );
}
diff --git a/sw/source/uibase/config/usrpref.cxx b/sw/source/uibase/config/usrpref.cxx
index 6d1394daed76..f4261a717998 100644
--- a/sw/source/uibase/config/usrpref.cxx
+++ b/sw/source/uibase/config/usrpref.cxx
@@ -104,7 +104,8 @@ Sequence<OUString> SwContentViewConfig::GetPropertyNames() const
"Update/Chart", // 19
"Display/ShowInlineTooltips", // 20
"Display/UseHeaderFooterMenu", // 21
- "Display/ShowOutlineContentVisibilityButton" // 22
+ "Display/ShowOutlineContentVisibilityButton", // 22
+ "Display/ShowChangesInMargin" // 23
};
#if defined(__GNUC__) && !defined(__clang__)
// clang 8.0.0 says strcmp isn't constexpr
@@ -173,6 +174,7 @@ void SwContentViewConfig::ImplCommit()
case 20: bVal = rParent.IsShowInlineTooltips(); break;// "Display/ShowInlineTooltips"
case 21: bVal = rParent.IsUseHeaderFooterMenu(); break;// "Display/UseHeaderFooterMenu"
case 22: bVal = rParent.IsShowOutlineContentVisibilityButton(); break;// "Display/ShowOutlineContentVisibilityButton"
+ case 23: bVal = rParent.IsShowChangesInMargin(); break;// "Display/ShowChangesInMargin"
}
if (nProp != g_UpdateLinkIndex)
pValues[nProp] <<= bVal;
@@ -225,6 +227,7 @@ void SwContentViewConfig::Load()
case 20: rParent.SetShowInlineTooltips(bSet); break;// "Display/ShowInlineTooltips"
case 21: rParent.SetUseHeaderFooterMenu(bSet); break;// "Display/UseHeaderFooterMenu"
case 22: rParent.SetShowOutlineContentVisibilityButton(bSet); break;// "Display/ShowOutlineContententVisibilityButton"
+ case 23: rParent.SetShowChangesInMargin(bSet); break;// "Display/ShowChangesInMargin"
}
}
}
diff --git a/sw/source/uibase/inc/cfgitems.hxx b/sw/source/uibase/inc/cfgitems.hxx
index d52880c69e3a..271fdf2a4715 100644
--- a/sw/source/uibase/inc/cfgitems.hxx
+++ b/sw/source/uibase/inc/cfgitems.hxx
@@ -78,6 +78,7 @@ class SW_DLLPUBLIC SwElemItem : public SfxPoolItem
bool m_bNotes :1;
bool m_bShowInlineTooltips :1;
bool m_bShowOutlineContentVisibilityButton :1;
+ bool m_bShowChangesInMargin :1;
bool m_bFieldHiddenText :1;
bool m_bShowHiddenPara :1;
diff --git a/sw/source/uibase/inc/optpage.hxx b/sw/source/uibase/inc/optpage.hxx
index 95f657320af8..4ea45d347687 100644
--- a/sw/source/uibase/inc/optpage.hxx
+++ b/sw/source/uibase/inc/optpage.hxx
@@ -54,6 +54,7 @@ class SwContentOptPage : public SfxTabPage
std::unique_ptr<weld::CheckButton> m_xShowInlineTooltips;
std::unique_ptr<weld::CheckButton> m_xShowOutlineContentVisibilityButton;
+ std::unique_ptr<weld::CheckButton> m_xShowChangesInMargin;
std::unique_ptr<weld::CheckButton> m_xFieldHiddenCB;
std::unique_ptr<weld::CheckButton> m_xFieldHiddenParaCB;
diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx
index 81f17f8bfd59..cb7990fcd1fc 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -50,6 +50,7 @@
#include <docsh.hxx>
#include <IDocumentRedlineAccess.hxx>
+#include <usrpref.hxx>
#include <memory>
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(SwRedlineAcceptChild, FN_REDLINE_ACCEPT)
@@ -414,6 +415,7 @@ void SwRedlineAcceptDlg::Activate()
// check comment
weld::TreeView& rTreeView = m_pTable->GetWidget();
+ bool bIsShowChangesInMargin = SW_MOD()->GetUsrPref(false)->IsShowChangesInMargin();
for (SwRedlineTable::size_type i = 0; i < nCount; i++)
{
const SwRangeRedline& rRedln = pSh->GetRedline(i);
@@ -421,13 +423,17 @@ void SwRedlineAcceptDlg::Activate()
if(rRedln.GetComment() != pParent->sComment)
{
+ bool bShowDeletedTextAsComment = bIsShowChangesInMargin &&
+ RedlineType::Delete == rRedln.GetType() && rRedln.GetComment().isEmpty();
+ const OUString sComment = bShowDeletedTextAsComment
+ ? const_cast<SwRangeRedline&>(rRedln).GetDescr()
+ : rRedln.GetComment();
if (pParent->xTLBParent)
{
// update only comment
- const OUString& sComment(rRedln.GetComment());
rTreeView.set_text(*pParent->xTLBParent, sComment.replace('\n', ' '), 3);
}
- pParent->sComment = rRedln.GetComment();
+ pParent->sComment = sComment;
}
}
@@ -719,6 +725,8 @@ void SwRedlineAcceptDlg::InsertParents(SwRedlineTable::size_type nStart, SwRedli
rTreeView.freeze();
if (m_pTable->IsSorted())
rTreeView.make_unsorted();
+
+ bool bIsShowChangesInMargin = SW_MOD()->GetUsrPref(false)->IsShowChangesInMargin();
for (SwRedlineTable::size_type i = nStart; i <= nEnd; i++)
{
const SwRangeRedline& rRedln = pSh->GetRedline(i);
@@ -727,7 +735,12 @@ void SwRedlineAcceptDlg::InsertParents(SwRedlineTable::size_type nStart, SwRedli
pRedlineParent = new SwRedlineDataParent;
pRedlineParent->pData = pRedlineData;
pRedlineParent->pNext = nullptr;
- const OUString& sComment(rRedln.GetComment());
+
+ bool bShowDeletedTextAsComment = bIsShowChangesInMargin &&
+ RedlineType::Delete == rRedln.GetType() && rRedln.GetComment().isEmpty();
+ const OUString& sComment = bShowDeletedTextAsComment
+ ? const_cast<SwRangeRedline&>(rRedln).GetDescr()
+ : rRedln.GetComment();
pRedlineParent->sComment = sComment.replace('\n', ' ');
m_RedlineParents.insert(m_RedlineParents.begin() + i,
std::unique_ptr<SwRedlineDataParent>(pRedlineParent));
diff --git a/sw/source/uibase/uiview/view0.cxx b/sw/source/uibase/uiview/view0.cxx
index c4c14d796182..5dc5bc316110 100644
--- a/sw/source/uibase/uiview/view0.cxx
+++ b/sw/source/uibase/uiview/view0.cxx
@@ -339,6 +339,9 @@ void SwView::StateViewOptions(SfxItemSet &rSet)
case FN_SHOW_OUTLINECONTENTVISIBILITYBUTTON:
aBool.SetValue( pOpt->IsShowOutlineContentVisibilityButton() );
break;
+ case FN_SHOW_CHANGES_IN_MARGIN:
+ aBool.SetValue( pOpt->IsShowChangesInMargin() );
+ break;
}
if( nWhich )
@@ -597,6 +600,13 @@ void SwView::ExecViewOptions(SfxRequest &rReq)
pOpt->SetShowOutlineContentVisibilityButton( bFlag );
break;
+ case FN_SHOW_CHANGES_IN_MARGIN:
+ if( STATE_TOGGLE == eState )
+ bFlag = !pOpt->IsShowChangesInMargin();
+
+ pOpt->SetShowChangesInMargin( bFlag );
+ break;
+
default:
OSL_FAIL("wrong request method");
return;
diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx
index c0c5f74bfc07..c17356610646 100644
--- a/sw/source/uibase/uno/unomod.cxx
+++ b/sw/source/uibase/uno/unomod.cxx
@@ -95,7 +95,8 @@ enum SwViewSettingsPropertyHandles
HANDLE_VIEWSET_HIDE_WHITESPACE,
HANDLE_VIEWSET_USE_HEADERFOOTERMENU,
HANDLE_VIEWSET_BOOKMARKS,
- HANDLE_VIEWSET_SHOW_OUTLINECONTENTVISIBILITYBUTTON
+ HANDLE_VIEWSET_SHOW_OUTLINECONTENTVISIBILITYBUTTON,
+ HANDLE_VIEWSET_CHANGES_IN_MARGIN
};
enum SwPrintSettingsPropertyHandles
@@ -135,6 +136,7 @@ static ChainablePropertySetInfo * lcl_createViewSettingsInfo()
{ OUString( "ShowInlineTooltips" ), HANDLE_VIEWSET_INLINECHANGES_TIPS , cppu::UnoType<bool>::get(), PROPERTY_NONE},
{ OUString( "UseHeaderFooterMenu" ), HANDLE_VIEWSET_USE_HEADERFOOTERMENU , cppu::UnoType<bool>::get(), PROPERTY_NONE},
{ OUString( "ShowOutlineContentVisibilityButton" ), HANDLE_VIEWSET_SHOW_OUTLINECONTENTVISIBILITYBUTTON , cppu::UnoType<bool>::get(), PROPERTY_NONE},
+ { OUString( "ShowChangesInMargin" ), HANDLE_VIEWSET_CHANGES_IN_MARGIN, cppu::UnoType<bool>::get(), PROPERTY_NONE},
{ OUString( "RasterResolutionX"), HANDLE_VIEWSET_RASTER_RESOLUTION_X, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE},
{ OUString( "RasterResolutionY"), HANDLE_VIEWSET_RASTER_RESOLUTION_Y, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE},
{ OUString( "RasterSubdivisionX"), HANDLE_VIEWSET_RASTER_SUBDIVISION_X, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE},
@@ -598,6 +600,7 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c
case HANDLE_VIEWSET_INLINECHANGES_TIPS : mpViewOption->SetShowInlineTooltips(*o3tl::doAccess<bool>(rValue)); break;
case HANDLE_VIEWSET_USE_HEADERFOOTERMENU : mpViewOption->SetUseHeaderFooterMenu(*o3tl::doAccess<bool>(rValue)); break;
case HANDLE_VIEWSET_SHOW_OUTLINECONTENTVISIBILITYBUTTON : mpViewOption->SetShowOutlineContentVisibilityButton(*o3tl::doAccess<bool>(rValue)); break;
+ case HANDLE_VIEWSET_CHANGES_IN_MARGIN : mpViewOption->SetShowChangesInMargin(*o3tl::doAccess<bool>(rValue)); break;
case HANDLE_VIEWSET_RASTER_RESOLUTION_X :
{
sal_Int32 nTmp = 0;
@@ -837,6 +840,7 @@ void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, u
case HANDLE_VIEWSET_SMOOTH_SCROLLING : bBoolVal = mpConstViewOption->IsSmoothScroll(); break;
case HANDLE_VIEWSET_SHOW_CONTENT_TIPS : bBoolVal = mpConstViewOption->IsShowContentTips(); break;
case HANDLE_VIEWSET_INLINECHANGES_TIPS : bBoolVal = mpConstViewOption->IsShowInlineTooltips(); break;
+ case HANDLE_VIEWSET_CHANGES_IN_MARGIN : bBoolVal = mpConstViewOption->IsShowChangesInMargin(); break;
case HANDLE_VIEWSET_IS_RASTER_VISIBLE : bBoolVal = mpConstViewOption->IsGridVisible(); break;
case HANDLE_VIEWSET_IS_SNAP_TO_RASTER : bBoolVal = mpConstViewOption->IsSnap(); break;
case HANDLE_VIEWSET_SCROLLBAR_TIPS : bBoolVal = mpConstViewOption->IsShowScrollBarTips(); break;
diff --git a/sw/uiconfig/swriter/ui/viewoptionspage.ui b/sw/uiconfig/swriter/ui/viewoptionspage.ui
index b7c453a5469f..294c8af643a1 100644
--- a/sw/uiconfig/swriter/ui/viewoptionspage.ui
+++ b/sw/uiconfig/swriter/ui/viewoptionspage.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.36.0 -->
+<!-- Generated with glade 3.22.1 -->
<interface domain="sw">
<requires lib="gtk+" version="3.18"/>
<object class="GtkBox" id="ViewOptionsPage">
@@ -192,34 +192,83 @@
<property name="top_attach">4</property>
</packing>
</child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="displaylabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="viewoptionspage|displaylabel">Display</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="fieldsframe">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="fieldsalignment">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">6</property>
<child>
- <object class="GtkCheckButton" id="changestooltip">
- <property name="label" translatable="yes" context="viewoptionspage|changestooltip">_Tooltips on tracked changes</property>
+ <object class="GtkCheckButton" id="hiddentextfield">
+ <property name="label" translatable="yes" context="viewoptionspage|hiddentextfield">Hidden te_xt</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>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="hiddentextfield-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="extended_tip|hiddentextfield">Displays text that is hidden by Conditional Text or Hidden Text fields.</property>
+ </object>
+ </child>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">5</property>
+ <property name="top_attach">0</property>
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="outlinecontentvisibilitybutton">
- <property name="label" translatable="yes" context="viewoptionspage|outlinecontentvisibilitybutton">_Show outline content visibility button</property>
+ <object class="GtkCheckButton" id="hiddenparafield">
+ <property name="label" translatable="yes" context="viewoptionspage|hiddenparafield">Hidden p_aragraphs</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>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="hiddenparafield-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="extended_tip|hiddenparafield">If you have inserted text using the Hidden Paragraph field, specifies whether to display the hidden paragraph.</property>
+ </object>
+ </child>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">6</property>
+ <property name="top_attach">1</property>
</packing>
</child>
</object>
@@ -227,10 +276,10 @@
</object>
</child>
<child type="label">
- <object class="GtkLabel" id="displaylabel">
+ <object class="GtkLabel" id="displayfl1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes" context="viewoptionspage|displaylabel">Display</property>
+ <property name="label" translatable="yes" context="viewoptionspage|fieldslabel">Display Fields</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
@@ -240,17 +289,17 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
- <object class="GtkFrame" id="fieldsframe">
+ <object class="GtkFrame" id="changesframe">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
- <object class="GtkAlignment" id="fieldsalignment">
+ <object class="GtkAlignment" id="fieldsalignment1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">6</property>
@@ -262,8 +311,8 @@
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child>
- <object class="GtkCheckButton" id="hiddentextfield">
- <property name="label" translatable="yes" context="viewoptionspage|hiddentextfield">Hidden te_xt</property>
+ <object class="GtkCheckButton" id="changesinmargin">
+ <property name="label" translatable="yes" context="viewoptionspage|changesinmargin">Tracked _deletions in margin</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
@@ -271,8 +320,8 @@
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<child internal-child="accessible">
- <object class="AtkObject" id="hiddentextfield-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="extended_tip|hiddentextfield">Displays text that is hidden by Conditional Text or Hidden Text fields.</property>
+ <object class="AtkObject" id="changesinmargin-atkobject">
+ <property name="AtkObject::accessible-description" translatable="yes" context="extended_tip|changesinmargin">Displays text that is hidden by Conditional Text or Hidden Text fields.</property>
</object>
</child>
</object>
@@ -282,19 +331,14 @@
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="hiddenparafield">
- <property name="label" translatable="yes" context="viewoptionspage|hiddenparafield">Hidden p_aragraphs</property>
+ <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="xalign">0</property>
<property name="draw_indicator">True</property>
- <child internal-child="accessible">
- <object class="AtkObject" id="hiddenparafield-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="extended_tip|hiddenparafield">If you have inserted text using the Hidden Paragraph field, specifies whether to display the hidden paragraph.</property>
- </object>
- </child>
</object>
<packing>
<property name="left_attach">0</property>
@@ -306,10 +350,10 @@
</object>
</child>
<child type="label">
- <object class="GtkLabel" id="displayfl1">
+ <object class="GtkLabel" id="changeslabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes" context="viewoptionspage|fieldslabel">Display Fields</property>
+ <property name="label" translatable="yes" context="viewoptionspage|changeslabel">Display tracked changes</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
@@ -319,7 +363,61 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">2</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="changesframe1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="fieldsalignment2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">6</property>
+ <child>
+ <object class="GtkCheckButton" id="outlinecontentvisibilitybutton">
+ <property name="label" translatable="yes" context="viewoptionspage|outlinecontentvisibilitybutton">_Show outline content visibility button</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">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="outlinelabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="viewoptionspage|outlinelabel">Outline mode</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
</packing>
</child>
</object>