Kaydet (Commit) 0a846a81 authored tarafından Michael Stahl's avatar Michael Stahl

sw_redlinehide_3: CheckParaRedlineMerge maintains second list tree

... by calling AddToListRLHidden/RemoveFromListRLHidden.

Do this here because it has all the necessary information.

Change-Id: Iac2640b7493267b187e66b1d464c79fe90642afe
üst 6eebecf3
......@@ -62,7 +62,7 @@ CheckParaRedlineMerge(SwTextFrame & rFrame, SwTextNode & rTextNode,
std::vector<SwSectionNode *> sections;
std::vector<sw::Extent> extents;
OUStringBuffer mergedText;
SwTextNode const* pParaPropsNode(nullptr);
SwTextNode * pParaPropsNode(nullptr);
SwTextNode * pNode(&rTextNode);
sal_Int32 nLastEnd(0);
for (auto i = rIDRA.GetRedlinePos(rTextNode, USHRT_MAX);
......@@ -180,6 +180,10 @@ CheckParaRedlineMerge(SwTextFrame & rFrame, SwTextNode & rTextNode,
}
if (!bHaveRedlines)
{
if (rTextNode.IsInList() && !rTextNode.GetNum(rFrame.getRootFrame()))
{
rTextNode.AddToListRLHidden(); // try to add it...
}
return nullptr;
}
if (nLastEnd != pNode->Len())
......@@ -197,6 +201,18 @@ CheckParaRedlineMerge(SwTextFrame & rFrame, SwTextNode & rTextNode,
assert(!mergedText.isEmpty());
pParaPropsNode = extents.begin()->pNode; // para props from first node that isn't empty
}
// keep lists up to date with visible nodes
if (pParaPropsNode->IsInList() && !pParaPropsNode->GetNum(rFrame.getRootFrame()))
{
pParaPropsNode->AddToListRLHidden(); // try to add it...
}
for (auto const pTextNode : nodes)
{
if (pTextNode != pParaPropsNode)
{
pTextNode->RemoveFromListRLHidden();
}
}
if (eMode == FrameMode::Existing)
{
// remove existing footnote frames for first node;
......
......@@ -606,8 +606,6 @@ SwTextFrame::SwTextFrame(SwTextNode * const pNode, SwFrame* pSib )
, mnFootnoteLine( 0 )
, mnHeightOfLastLine( 0 )
, mnAdditionalFirstLineOffset( 0 )
// note: this may change this->pRegisteredIn to m_pMergedPara->listeners
, m_pMergedPara(CheckParaRedlineMerge(*this, *pNode, sw::FrameMode::New)) // ensure it is inited
, mnOffset( 0 )
, mnCacheIndex( USHRT_MAX )
, mbLocked( false )
......@@ -624,6 +622,9 @@ SwTextFrame::SwTextFrame(SwTextNode * const pNode, SwFrame* pSib )
, mbFollowFormatAllowed( true )
{
mnFrameType = SwFrameType::Txt;
// note: this may call SwClientNotify if it's in a list so do it last
// note: this may change this->pRegisteredIn to m_pMergedPara->listeners
m_pMergedPara = CheckParaRedlineMerge(*this, *pNode, sw::FrameMode::New);
}
namespace sw {
......
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