Kaydet (Commit) 15f1555d authored tarafından Michael Stahl's avatar Michael Stahl

sw_redlinehide_2: prevent SetRedlineFlags from messing things up

Unfortunately it doesn't work to just let the content editing
functions that are called by the SwRangeRedline Show function
set up the frames because they can't do it correctly, as the redline
that is currently being Shown doesn't have a correct position;
the position is only patched up afterwards in MoveFromSection.

Change-Id: Ie94a2eea44befce55ad16db1f9349b1582a7f73e
üst 9091522a
......@@ -18,6 +18,7 @@
*/
#include <DocumentRedlineManager.hxx>
#include <frmfmt.hxx>
#include <rootfrm.hxx>
#include <doc.hxx>
#include <IDocumentUndoRedo.hxx>
#include <IDocumentState.hxx>
......@@ -665,6 +666,23 @@ void DocumentRedlineManager::SetRedlineFlags( RedlineFlags eMode )
CheckAnchoredFlyConsistency(m_rDoc);
CHECK_REDLINE( *this )
m_rDoc.SetInXMLImport( bSaveInXMLImportFlag );
if (eShowMode == (RedlineFlags::ShowInsert | RedlineFlags::ShowDelete))
{
// sw_redlinehide: the problem here is that MoveFromSection
// creates the frames wrongly (non-merged), because its own
// SwRangeRedline has wrong positions until after the nodes
// are all moved, so fix things up by force by re-creating
// all merged frames from scratch.
std::set<SwRootFrame *> const layouts(m_rDoc.GetAllLayouts());
for (SwRootFrame *const pLayout : layouts)
{
if (pLayout->IsHideRedlines())
{
pLayout->SetHideRedlines(false);
pLayout->SetHideRedlines(true);
}
}
}
}
meRedlineFlags = eMode;
m_rDoc.getIDocumentState().SetModified();
......
......@@ -76,7 +76,11 @@ CheckParaRedlineMerge(SwTextFrame & rFrame, SwTextNode & rTextNode,
SwPosition const*const pStart(pRed->Start());
SwPosition const*const pEnd(pRed->End());
assert(*pStart != *pEnd); // empty delete allowed if shown ???
if (*pStart == *pEnd)
{ // only allowed while moving
assert(IDocumentRedlineAccess::IsHideChanges(rIDRA.GetRedlineFlags()));
continue;
}
bHaveRedlines = true;
if (pStart->nContent != nLastEnd) // not 0 so we eliminate adjacent deletes
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment