summaryrefslogtreecommitdiff
path: root/sw/source/core/docnode/ndsect.cxx
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2019-03-04 13:12:09 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2019-03-05 12:12:58 +0100
commit405661a98f01416c596083262691cedd941733a1 (patch)
treea8f6d81a0f0ae4df03aca6cc6272e5dc91a709cb /sw/source/core/docnode/ndsect.cxx
parent191f85df5851473af270be486f95f940e3091fef (diff)
tdf#123446 sw_redlinehide: fix crash on Redo of ToX
The problem is that the ToX must be updated with the same layout redline setting as it was originally created, so that subsequent Redo actions see the expected node indexes. Unfortunately it's not enough to just pass a flag to the ToX update functions, because they check GetTextNodeForParaProps() so we need a layout corresponding to the layout setting; if there isn't one, the existing one is temporarily toggled. This could be much better if the MergedPara would be independent of the layout and always exist, but with the various SwModify design issues that looks tricky to do... (regression from 80cedb5dcb6a7dd6c01349b93fab49ecee5f6594) Change-Id: Ibdc5b4ace54ace27e5223a25ecaf39bb493fb69b Reviewed-on: https://gerrit.libreoffice.org/68704 Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> Tested-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'sw/source/core/docnode/ndsect.cxx')
-rw-r--r--sw/source/core/docnode/ndsect.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx
index e418d4ccbfb1..16c26f4befa1 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -152,7 +152,7 @@ static void lcl_CheckEmptyLayFrame( SwNodes const & rNds, SwSectionData& rSectio
SwSection *
SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData,
- SwTOXBase const*const pTOXBase,
+ std::pair<SwTOXBase const*, sw::RedlineMode> const*const pTOXBaseAndMode,
SfxItemSet const*const pAttr, bool const bUpdate)
{
const SwNode* pPrvNd = nullptr;
@@ -185,7 +185,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData,
bool const bUndo(GetIDocumentUndoRedo().DoesUndo());
if (bUndo)
{
- pUndoInsSect = new SwUndoInsSection(rRange, rNewData, pAttr, pTOXBase);
+ pUndoInsSect = new SwUndoInsSection(rRange, rNewData, pAttr, pTOXBaseAndMode);
GetIDocumentUndoRedo().AppendUndo( std::unique_ptr<SwUndo>(pUndoInsSect) );
GetIDocumentUndoRedo().DoUndo(false);
}
@@ -196,6 +196,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData,
pFormat->SetFormatAttr( *pAttr );
}
+ SwTOXBase const*const pTOXBase(pTOXBaseAndMode ? pTOXBaseAndMode->first : nullptr);
SwSectionNode* pNewSectNode = nullptr;
RedlineFlags eOld = getIDocumentRedlineAccess().GetRedlineFlags();