diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-12-18 15:26:07 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-12-18 22:30:17 +0100 |
commit | 15328224ffabeb12a5c7741fe904a97e12787070 (patch) | |
tree | 9161aca614c0698e357d40f6453f58cd6423b460 /sw | |
parent | 94c1af65367dcbc7272455cf6d4940252a289b62 (diff) |
sw_redlinehide_4b: tdf#113479 SetRedlineFlags() calls no longer...
...able to be triggered by the UI, so the performance problem should be
gone.
The SwXTextDocument "ShowChanges" property allows API clients to call
SetRedlineFlags() and change the model; this API should be retained
as-is for now, because there is no way currently (outside of the rather
specialised a11y API) to get a "merged view" of the paragraphs in the
document, so API clients may want to (temporarily) toggle this property
to then retrieve properties from the model. In case we later find that
there are no API clients that want to do such things, the property can
be removed.
A run with assert() instead of SAL_WARN_IF() found only 2 tests that
explicitly call SetRedlineFlags() to clear ShowDelete.
Change-Id: I44aee90f7727948ca0bbaaff9d04f8dd6b97cbd1
Reviewed-on: https://gerrit.libreoffice.org/65350
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
(cherry picked from commit 09657e3166e875f280095bf7d2f1f2ca8e022803)
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/DocumentContentOperationsManager.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/doc/docnum.cxx | 7 |
2 files changed, 12 insertions, 11 deletions
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 45508b9ac8a7..e1e53411115a 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -3689,7 +3689,6 @@ bool DocumentContentOperationsManager::DeleteAndJoinWithRedlineImpl( SwPaM & rPa assert(m_rDoc.getIDocumentRedlineAccess().IsRedlineOn()); RedlineFlags eOld = m_rDoc.getIDocumentRedlineAccess().GetRedlineFlags(); - m_rDoc.GetDocumentRedlineManager().checkRedlining( eOld ); if (*rPam.GetPoint() == *rPam.GetMark()) { @@ -3750,9 +3749,10 @@ bool DocumentContentOperationsManager::DeleteAndJoinWithRedlineImpl( SwPaM & rPa std::vector<std::unique_ptr<SwUndoRedlineDelete>> undos; if (m_rDoc.GetIDocumentUndoRedo().DoesUndo()) { - /* please don't translate -- for cultural reasons this comment is protected - until the redline implementation is finally fixed some day */ - //JP 06.01.98: MUSS noch optimiert werden!!! + // this should no longer happen in calls from the UI but maybe via API + // (randomTest and testTdf54819 triggers it) + SAL_WARN_IF((eOld & RedlineFlags::ShowMask) != RedlineFlags::ShowMask, + "sw.core", "redlines will be moved in DeleteAndJoin"); m_rDoc.getIDocumentRedlineAccess().SetRedlineFlags( RedlineFlags::On | RedlineFlags::ShowInsert | RedlineFlags::ShowDelete); for (SwRangeRedline * pRedline : redlines) @@ -3811,7 +3811,6 @@ bool DocumentContentOperationsManager::DeleteAndJoinWithRedlineImpl( SwPaM & rPa { m_rDoc.GetIDocumentUndoRedo().EndUndo(SwUndoId::EMPTY, nullptr); } - //JP 06.01.98: MUSS noch optimiert werden!!! m_rDoc.getIDocumentRedlineAccess().SetRedlineFlags( eOld ); } return true; @@ -4075,9 +4074,12 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt if( m_rDoc.getIDocumentRedlineAccess().IsRedlineOn() ) { RedlineFlags eOld = m_rDoc.getIDocumentRedlineAccess().GetRedlineFlags(); - m_rDoc.GetDocumentRedlineManager().checkRedlining(eOld); if (m_rDoc.GetIDocumentUndoRedo().DoesUndo()) { + // this should no longer happen in calls from the UI but maybe via API + SAL_WARN_IF((eOld & RedlineFlags::ShowMask) != RedlineFlags::ShowMask, + "sw.core", "redlines will be moved in ReplaceRange"); + m_rDoc.GetIDocumentUndoRedo().StartUndo(SwUndoId::EMPTY, nullptr); // If any Redline will change (split!) the node @@ -4086,7 +4088,6 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt OUString(), IDocumentMarkAccess::MarkType::UNO_BOOKMARK, ::sw::mark::InsertMode::New); - //JP 06.01.98: MUSS noch optimiert werden!!! m_rDoc.getIDocumentRedlineAccess().SetRedlineFlags( RedlineFlags::On | RedlineFlags::ShowInsert | RedlineFlags::ShowDelete ); @@ -4185,7 +4186,6 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt rPam.GetPoint()->nNode = 0; rPam.GetPoint()->nContent = rIdx; *rPam.GetMark() = *rPam.GetPoint(); - //JP 06.01.98: MUSS noch optimiert werden!!! m_rDoc.getIDocumentRedlineAccess().SetRedlineFlags( eOld ); *rPam.GetPoint() = pBkmk->GetMarkPos(); diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index a6e1c267f0f1..e99195f85a75 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -2261,10 +2261,12 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, long const nOffset, } RedlineFlags eOld = getIDocumentRedlineAccess().GetRedlineFlags(); - GetDocumentRedlineManager().checkRedlining(eOld); if (GetIDocumentUndoRedo().DoesUndo()) { - // Still NEEDS to be optimized (even after 14 years) + // this should no longer happen in calls from the UI but maybe via API + SAL_WARN_IF((eOld & RedlineFlags::ShowMask) != RedlineFlags::ShowMask, + "sw.core", "redlines will be moved in DeleteAndJoin"); + getIDocumentRedlineAccess().SetRedlineFlags( RedlineFlags::On | RedlineFlags::ShowInsert | RedlineFlags::ShowDelete ); GetIDocumentUndoRedo().AppendUndo( @@ -2285,7 +2287,6 @@ bool SwDoc::MoveParagraphImpl(SwPaM& rPam, long const nOffset, aPam.GetBound(false).nContent.Assign(aPam.GetBound(false).nNode.GetNode().GetContentNode(), 0); sw::UpdateFramesForAddDeleteRedline(*this, aPam); - // Still NEEDS to be optimized! getIDocumentRedlineAccess().SetRedlineFlags( eOld ); GetIDocumentUndoRedo().EndUndo( SwUndoId::END, nullptr ); getIDocumentState().SetModified(); |