summaryrefslogtreecommitdiff
path: root/sw/source/uibase/misc/redlndlg.cxx
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2023-06-22 17:33:16 +0200
committerLászló Németh <nemeth@numbertext.org>2023-06-23 10:29:33 +0200
commit952fb2a4386a6ae2187b646e372131a5345f59fe (patch)
tree9600775ff0219aed8348d2c1b8e571ec70b8232a /sw/source/uibase/misc/redlndlg.cxx
parentbbb104ea2b8f3e48273f316cfad406e904a2f331 (diff)
tdf#155847 sw tracked table column: fix crash in Manage Changes
In Manage Changes dialog window, accept/Reject multiple tracked table columns need major tree list update because of not continuous redline ranges in the child lists of the multiple tree list parents, otherwise assert/crash could occur. Follow-up to commit 4a40a42afc3ba551e6e58947fc2e44689979b629 "tdf#155847 sw tracked table column: manage multiple changes". Change-Id: I3c7f61d35cbb433067c1f4fd28b80ad7da8ba12e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153464 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source/uibase/misc/redlndlg.cxx')
-rw-r--r--sw/source/uibase/misc/redlndlg.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx
index 35a15fa940e3..1a9d168bee61 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -153,6 +153,7 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(std::shared_ptr<weld::Window> xParent, we
, m_bOnlyFormatedRedlines(false)
, m_bRedlnAutoFormat(bAutoFormat)
, m_bInhibitActivate(false)
+ , m_bHasTrackedColumn(false)
, m_xTabPagesCTRL(new SvxAcceptChgCtr(pContentArea))
, m_xPopup(pBuilder->weld_menu("writermenu"))
, m_xSortMenu(pBuilder->weld_menu("writersortmenu"))
@@ -489,7 +490,7 @@ void SwRedlineAcceptDlg::Activate()
SwRedlineTable::size_type SwRedlineAcceptDlg::CalcDiff(SwRedlineTable::size_type nStart, bool bChild)
{
- if (!nStart)
+ if (!nStart || m_bHasTrackedColumn)
{
Init();
return SwRedlineTable::npos;
@@ -767,6 +768,10 @@ void SwRedlineAcceptDlg::InsertParents(SwRedlineTable::size_type nStart, SwRedli
SwRedlineTable::size_type nCount = pSh->GetRedlineCount();
nEnd = std::min(nEnd, (nCount - 1)); // also treats nEnd=SwRedlineTable::npos (until the end)
+ // reset m_bHasTrackedColumn before searching tracked column again
+ if ( m_bHasTrackedColumn && nStart == 0 )
+ m_bHasTrackedColumn = false;
+
if (nEnd == SwRedlineTable::npos)
return; // no redlines in the document
@@ -872,6 +877,12 @@ void SwRedlineAcceptDlg::InsertParents(SwRedlineTable::size_type nStart, SwRedli
// table redline didn't fit in the stored ones, create new parent
aTableParents.push_back(i);
}
+
+ // it needs major tree update later because of tracked table columns
+ if ( !m_bHasTrackedColumn && !bRowChange )
+ {
+ m_bHasTrackedColumn = true;
+ }
}
else
{