summaryrefslogtreecommitdiff
path: root/sw/source/core/edit
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2022-06-16 19:38:43 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2022-06-22 18:01:36 +0200
commit81273c65dd9cec5acd9464b9041f452a5481e10e (patch)
treeb01eefaa0a8154da4ed1efe3fb89bdea9be80bd2 /sw/source/core/edit
parent575cfa6aebbea714f08e303a3e78d1ac8d99a7e0 (diff)
tdf#134759 sw: do CopyToModify() for both start and end node
... in SwNodes::MoveRange(). SwRangeRedline::Hide() does CopyToSection()/DelCopyOfSection() so the previous commit fixed it, and SwRangeRedline::Show() does MoveFromSection() so hopefully this should fix it to restore the situation before hiding. This caused several tests to fail, and the reason appears to be that they pretty much tested exactly the problem that's being fixed with this commit, but the pre-existing fixes and the new one cancel each other out. In all cases the pre-exising fix moves all redlines and moves them back again, which is the sort of thing that sw_redlinehide wanted to get rid of; not sure why i didn't notice this earlier. The check for the 3rd paragraph where the style was applied still succeeds with the new bugfix, but the one for the 1st paragraph fails; it is unclear why applying a style to the 3rd paragraph should have an effect on the 1st one. Hence: Revert code changes of commit 1d65ffc5a37be21e0316019b1c96eb9a1c871ac0 "tdf#105413 track changes: keep paragraph styles" Revert code changes of commit d97fc64a819f834302e384792668507df4cc412c "tdf#122893 track changes: keep paragraph alignment" Revert code changes of commit 6a54dd844d1821165642bbcc16bd12a01a23393d "tdf#122901 track changes: keep paragraph top and bottom borders" Change-Id: I0b70134902a7993c7bb11a3c619e45742764c8ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136056 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw/source/core/edit')
-rw-r--r--sw/source/core/edit/edatmisc.cxx34
-rw-r--r--sw/source/core/edit/edfcol.cxx15
2 files changed, 2 insertions, 47 deletions
diff --git a/sw/source/core/edit/edatmisc.cxx b/sw/source/core/edit/edatmisc.cxx
index b3556a0494e2..12abec2503db 100644
--- a/sw/source/core/edit/edatmisc.cxx
+++ b/sw/source/core/edit/edatmisc.cxx
@@ -95,25 +95,10 @@ const SfxPoolItem& SwEditShell::GetDefault( sal_uInt16 nFormatHint ) const
return GetDoc()->GetDefault( nFormatHint );
}
-// tdf#122893 turn off ShowChanges mode to apply paragraph formatting permanently with redlining
-// ie. in all directly preceding deleted paragraphs at the actual cursor positions
-static void lcl_disableShowChangesIfNeeded( SwDoc *const pDoc, const SwNode& rNode, RedlineFlags &eRedlMode )
-{
- if ( IDocumentRedlineAccess::IsShowChanges(eRedlMode) &&
- // is there redlining at beginning of the position (possible redline block before the modified node)
- pDoc->getIDocumentRedlineAccess().GetRedlinePos( rNode, RedlineType::Any ) <
- pDoc->getIDocumentRedlineAccess().GetRedlineTable().size() )
- {
- eRedlMode = RedlineFlags::ShowInsert | RedlineFlags::Ignore;
- pDoc->getIDocumentRedlineAccess().SetRedlineFlags( eRedlMode );
- }
-}
-
-void SwEditShell::SetAttrItem( const SfxPoolItem& rHint, SetAttrMode nFlags, const bool bParagraphSetting )
+void SwEditShell::SetAttrItem( const SfxPoolItem& rHint, SetAttrMode nFlags, const bool /*bParagraphSetting*/ )
{
CurrShell aCurr( this );
StartAllAction();
- RedlineFlags eRedlMode = GetDoc()->getIDocumentRedlineAccess().GetRedlineFlags(), eOldMode = eRedlMode;
SwPaM* pCursor = GetCursor();
if( pCursor->GetNext() != pCursor ) // Ring of Cursors
{
@@ -125,9 +110,6 @@ void SwEditShell::SetAttrItem( const SfxPoolItem& rHint, SetAttrMode nFlags, con
if( rPaM.HasMark() && ( bIsTableMode ||
*rPaM.GetPoint() != *rPaM.GetMark() ))
{
- if (bParagraphSetting)
- lcl_disableShowChangesIfNeeded( GetDoc(), (*rPaM.Start()).nNode.GetNode(), eRedlMode);
-
GetDoc()->getIDocumentContentOperations().InsertPoolItem(rPaM, rHint, nFlags, GetLayout());
}
}
@@ -139,21 +121,16 @@ void SwEditShell::SetAttrItem( const SfxPoolItem& rHint, SetAttrMode nFlags, con
if( !HasSelection() )
UpdateAttr();
- if (bParagraphSetting)
- lcl_disableShowChangesIfNeeded( GetDoc(), (*pCursor->Start()).nNode.GetNode(), eRedlMode);
-
GetDoc()->getIDocumentContentOperations().InsertPoolItem(*pCursor, rHint, nFlags, GetLayout());
}
EndAllAction();
- GetDoc()->getIDocumentRedlineAccess().SetRedlineFlags( eOldMode );
}
-void SwEditShell::SetAttrSet( const SfxItemSet& rSet, SetAttrMode nFlags, SwPaM* pPaM, const bool bParagraphSetting )
+void SwEditShell::SetAttrSet( const SfxItemSet& rSet, SetAttrMode nFlags, SwPaM* pPaM, const bool /*bParagraphSetting*/ )
{
CurrShell aCurr( this );
SwPaM* pCursor = pPaM ? pPaM : GetCursor();
StartAllAction();
- RedlineFlags eRedlMode = GetDoc()->getIDocumentRedlineAccess().GetRedlineFlags(), eOldMode = eRedlMode;
if( pCursor->GetNext() != pCursor ) // Ring of Cursors
{
bool bIsTableMode = IsTableMode();
@@ -164,9 +141,6 @@ void SwEditShell::SetAttrSet( const SfxItemSet& rSet, SetAttrMode nFlags, SwPaM*
if( rTmpCursor.HasMark() && ( bIsTableMode ||
*rTmpCursor.GetPoint() != *rTmpCursor.GetMark() ))
{
- if (bParagraphSetting)
- lcl_disableShowChangesIfNeeded( GetDoc(), (*rTmpCursor.Start()).nNode.GetNode(), eRedlMode);
-
GetDoc()->getIDocumentContentOperations().InsertItemSet(rTmpCursor, rSet, nFlags, GetLayout());
}
}
@@ -178,12 +152,8 @@ void SwEditShell::SetAttrSet( const SfxItemSet& rSet, SetAttrMode nFlags, SwPaM*
if( !HasSelection() )
UpdateAttr();
- if (bParagraphSetting)
- lcl_disableShowChangesIfNeeded( GetDoc(), (*pCursor->Start()).nNode.GetNode(), eRedlMode);
-
GetDoc()->getIDocumentContentOperations().InsertItemSet(*pCursor, rSet, nFlags, GetLayout());
}
- GetDoc()->getIDocumentRedlineAccess().SetRedlineFlags( eOldMode );
EndAllAction();
}
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index ff29c1f10c83..1d480f293fc5 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -2192,8 +2192,6 @@ void SwEditShell::SetTextFormatColl(SwTextFormatColl *pFormat,
SwTextFormatColl *pLocal = pFormat? pFormat: (*GetDoc()->GetTextFormatColls())[0];
StartAllAction();
- RedlineFlags eRedlMode = GetDoc()->getIDocumentRedlineAccess().GetRedlineFlags(), eOldMode = eRedlMode;
-
SwRewriter aRewriter;
aRewriter.AddRule(UndoArg1, pLocal->GetName());
@@ -2207,17 +2205,6 @@ void SwEditShell::SetTextFormatColl(SwTextFormatColl *pFormat,
if ( !rPaM.HasReadonlySel( GetViewOptions()->IsFormView() ) )
{
- // tdf#105413 turn off ShowChanges mode for the next loops to apply styles permanently with redlining,
- // ie. in all directly preceding deleted paragraphs at the actual cursor positions
- if ( IDocumentRedlineAccess::IsShowChanges(eRedlMode) &&
- // is there redlining at beginning of the position (possible redline block before the modified node)
- GetDoc()->getIDocumentRedlineAccess().GetRedlinePos( (*rPaM.Start()).nNode.GetNode(), RedlineType::Any ) <
- GetDoc()->getIDocumentRedlineAccess().GetRedlineTable().size() )
- {
- eRedlMode = RedlineFlags::ShowInsert | RedlineFlags::Ignore;
- GetDoc()->getIDocumentRedlineAccess().SetRedlineFlags( eRedlMode );
- }
-
// store previous paragraph style for track changes
OUString sParaStyleName;
sal_uInt16 nPoolId = USHRT_MAX;
@@ -2270,8 +2257,6 @@ void SwEditShell::SetTextFormatColl(SwTextFormatColl *pFormat,
}
GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::SETFMTCOLL, &aRewriter);
EndAllAction();
-
- GetDoc()->getIDocumentRedlineAccess().SetRedlineFlags( eOldMode );
}
SwTextFormatColl* SwEditShell::MakeTextFormatColl(const OUString& rFormatCollName,