summaryrefslogtreecommitdiff
path: root/sw/source/core/text
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2021-01-19 15:55:21 +0100
committerLászló Németh <nemeth@numbertext.org>2021-01-20 19:08:05 +0100
commit6aeeef8807fef36295b65d0a300a21466bfbeda0 (patch)
treeee0ee40bb146c641b8984def9a83188f29c8ba76 /sw/source/core/text
parentea610df36842305ef7e26d964ad0a1677be5f553 (diff)
tdf#116757 sw ChangesInMargin: add "Show Insertions in Margin"
layout mode to allow to show the original text inline, i.e. only deletions, while insertions are showed in margin (opposite of the Show Deletions in Margin mode). Add a menu to the Show Changes icon on the Changes toolbar with menu items for the 3 layout modes "All Changes Inline", "Deletions in Margin" and "Insertions in Margin" with the following behavior: – Selecting a menu item turns on also the Show Changes mode to show the result immediately; – Disabling Show Changes mode always show the final text, i.e. only insertions. Enabling Show Changes mode again shows the changes according to the last Show Changes mode selected in the menu. – The new "Insertions in Margin" mode is intended to be only a run-time option, i.e. it's not possible to set it as a default Show Changes mode in Options, unlike "Deletions in Margin". Change-Id: Ie4dc9fe3b4b201fa9976ef04877af649e242ab46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109649 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source/core/text')
-rw-r--r--sw/source/core/text/frmpaint.cxx4
-rw-r--r--sw/source/core/text/redlnitr.cxx7
2 files changed, 7 insertions, 4 deletions
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index 1a402d842030..1b77a6f7a711 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -200,7 +200,9 @@ void SwExtraPainter::PaintExtra( SwTwips nY, tools::Long nAsc, tools::Long nMax,
if ( pRedlineText )
{
m_pFnt->SetColor(NON_PRINTING_CHARACTER_COLOR);
- m_pFnt->SetStrikeout( STRIKEOUT_SINGLE );
+ // don't strike out text in Insertions In Margin mode
+ if ( !m_pSh->GetViewOptions()->IsShowChangesInMargin2() )
+ m_pFnt->SetStrikeout( STRIKEOUT_SINGLE );
m_pFnt->SetSize( Size( 0, 200), m_pFnt->GetActual() );
}
diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index cb19a17648ed..b6cbb86bbeb3 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -984,15 +984,16 @@ bool SwRedlineItr::CheckLine(
case SwComparePosition::Inside:
{
bRet = true;
- if (rRedlineText.isEmpty() && pRedline->GetType() == RedlineType::Delete)
+ // start to collect text of invisible redlines for ChangesInMargin layout
+ if (rRedlineText.isEmpty() && !pRedline->IsVisible())
{
rRedlineText = const_cast<SwRangeRedline*>(pRedline)->GetDescr(/*bSimplified=*/true);
pPrevRedline = pRedline;
isExtendText = true;
}
- // join the text of the next short delete redlines in the same position
+ // join the text of the next invisible redlines in the same position
// i.e. characters deleted by pressing backspace or delete
- else if (pPrevRedline && pRedline->GetType() == RedlineType::Delete &&
+ else if (pPrevRedline && !pRedline->IsVisible() &&
*pRedline->Start() == *pPrevRedline->Start() && *pRedline->End() == *pPrevRedline->End() )
{
OUString sExtendText(const_cast<SwRangeRedline*>(pRedline)->GetDescr(/*bSimplified=*/true));