Re[2]: Bug 83260

2018-01-11 Thread Yemelyanenko Fyodor
Sadly removing call to CompresRedlines is not good solution…
AppendRedlines still calls CompresRedlines and CompresRedlines does it dirty 
job by invalidating indexes…

I prefer to modify CompresRedlines so it only compresses Redlines if they are 
inside same node and disable cross-node compressions. As only same-minute 
redlines can be compressed this viewed as allowable solution.

With these modification LO is stable when autocreecting and Undo/Redo
Patch is here https://gerrit.libreoffice.org/47686

Anyone (especially those with commit rights)are welcomed to review this patch.

-- Исходное сообщение --
От: "Miklos Vajna" >
Кому: "libreoffice@lists.freedesktop.org" 
>
Отправлено: 10.01.2018 19:26:27
Тема: Re: Bug 83260

Hi,

On Tue, Jan 09, 2018 at 05:10:00AM +, Yemelyanenko Fyodor 
> wrote:
 I think that the best solution for bug in question is to remove call to 
CompresRedlines from Undo/Redo. So Undo/Redo won't compress redlines and change 
indexes.
 I don't like to change CompresRedlines as it called by AppendRedline and from 
several other places.
 For me such solution can be safest.

That sounds like a good approach, I was also confused how redlining and
undo compresses the events.

This would also ensure that the behavior of how to compress redline in
saved documents is not changing, which is probably a good thing.

 PS Its funny, that if you type some text in single paragraph with
 change tracking = ON, you'll get new redline every single minute, even
 if you type continuously :-) This is by design, as AppendRedline calls
 CanCombine which only allows combining those text, which has been
 typed during single minute
 
(https://opengrok.libreoffice.org/xref/core/sw/source/core/doc/DocumentRedlineManager.cxx#861)

Yes, that's a known behavior, in the past I broke it and it created a
new redline every second, that was not funny. ;-)

Regards,

Miklos
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re[2]: Bug 83260

2018-01-09 Thread Yemelyanenko Fyodor
I tried, and got single redline with all my text.
Such case like typing new text is cared by 
sw::DocumentRedlineManager::AppendRedline, which has lengthy code for any 
possible situation (like typing inside deleted text, adding to existing 
redline, etc.) It also calls CompresRedlines at the end, but many 
"compressions" are done by sw::DocumentRedlineManager::AppendRedline, so 
CompresRedlines doesn't do much

I think that the best solution for bug in question is to remove call to 
CompresRedlines from Undo/Redo. So Undo/Redo won't compress redlines and change 
indexes.
I don't like to change CompresRedlines as it called by AppendRedline and from 
several other places.
For me such solution can be safest.

PS Its funny, that if you type some text in single paragraph with change 
tracking = ON, you'll get new redline every single minute, even if you type 
continuously :-) This is by design, as AppendRedline calls CanCombine which 
only allows combining those text, which has been typed during single minute 
(https://opengrok.libreoffice.org/xref/core/sw/source/core/doc/DocumentRedlineManager.cxx#861)

-- Исходное сообщение --
От: "Miklos Vajna" >
Кому: "libreoffice@lists.freedesktop.org" 
>
Отправлено: 08.01.2018 19:22:13
Тема: Re: Bug 83260

Hi,

On Sat, Jan 06, 2018 at 01:20:05AM +, Yemelyanenko Fyodor 
> wrote:
 Now I’m investigating CompresRedlines further. I think it can be
 changed so it merges only two neighbor redlines in the same node and
 not merge cross-node. Or maybe it should be completely removed, as it
 only merges redlines if they’ve been created in the same minute!
 
(https://opengrok.libreoffice.org/xref/core/sw/source/core/doc/docredln.cxx#946)
 So chances that two redlines will be merged are very low.

Did you try typing "asdf" into a document without that merging enabled?
I think 4 redlines are created without this "merge changes from the same
minute" mechanism.

Regards,

Miklos
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re[2]: Bug 83260

2018-01-07 Thread Yemelyanenko Fyodor
I gone deeper in this issue, and it not depends on Track changes Show/Hide.
Undo has RedlinesGuard, which sets show/hide to value, that been when Undo 
action created. So Undo works fine and I not going to purge Undo stack.

I think the problem is created by sw::DocumentRedlineManager::CompressRedlines 
(https://opengrok.libreoffice.org/xref/core/sw/source/core/doc/DocumentRedlineManager.cxx#1792).
 As name states it compress redlines (merges two neighbor redlines if they have 
same author, type, second redline starts where first ends 
second.mark==first.point and so on). During compression it modifies indexes and 
Undo crushes LO.

Now I’m investigating CompresRedlines further. I think it can be changed so it 
merges only two neighbor redlines in the same node and not merge cross-node. Or 
maybe it should be completely removed, as it only merges redlines if they’ve 
been created in the same minute! 
(https://opengrok.libreoffice.org/xref/core/sw/source/core/doc/docredln.cxx#946)
So chances that two redlines will be merged are very low.


-- Исходное сообщение --
От: "Miklos Vajna" >
Кому: 
libreoffice@lists.freedesktop.org
Отправлено: 05.01.2018 18:35:12
Тема: Re: Bug 83260

Hi,

On Thu, Jan 04, 2018 at 09:45:14AM +0800, "Matthew J. Francis" 
> wrote:
 I use tracked changes on a regular basis, and would much rather this be
 treated as "maybe difficult but important to get right" than "too hard, so
 don't bother"

Perhaps a middle ground is to give up undo/redo only for the subset when
we know we would crash anyway? And sure, if somebody has the
time/motivation to look at the root cause of the crash (currently I
don't), that's even better.

Regards,

Miklos
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice