Bug 144922 - Navigator still shows items after paste to empty page & undo
Summary: Navigator still shows items after paste to empty page & undo
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Navigator Undo-Redo
  Show dependency treegraph
 
Reported: 2021-10-04 17:58 UTC by Telesto
Modified: 2023-11-05 01:09 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file (241.07 KB, application/vnd.oasis.opendocument.text)
2021-10-04 18:00 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2021-10-04 17:58:44 UTC
Description:
Navigator still shows items after paste to empty page & undo  

Steps to Reproduce:
1. Open the attached file
2. Sidebar -> Navigator
3. CTRL+A
4. CTRL+C
5. CTRL+N
6. CTRL+V
7. CTRL+Z
8. Look at content in the sidebar

Actual Results:
Table1 and Table5 & Image with URL still visible

Expected Results:
Not so


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: b60b6bfaafa1315e07108dba50f016975b619c59
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: en-US (nl_NL); UI: en-US
Calc: CL
Comment 1 Telesto 2021-10-04 18:00:13 UTC
Found in
4.4.7.2

and in
LibreOffice 3.5.0rc3 
Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735
Comment 2 Telesto 2021-10-04 18:00:37 UTC
Created attachment 175513 [details]
Example file
Comment 3 Dieter 2021-10-24 10:33:38 UTC
I confirm it with

Version: 7.2.2.2 (x64) / LibreOffice Community
Build ID: 02b2acce88a210515b4a5bb2e46cbfb63fe97d56
CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: threaded

Additional informations
Wordcount in empty document counts 574 words and 28982 characters. similar values, if you delete Table 1 and table 5 and image in original document and follow the steps (navigator is empty then after step 7)
Comment 4 Telesto 2021-10-24 10:42:20 UTC
@Jim,
A analysis would be informative. Is this a sidebar issue or exposing a problem with the undo-code?
Comment 5 Jim Raykowski 2021-11-03 03:52:00 UTC
(In reply to Telesto from comment #4)
> @Jim,
> A analysis would be informative. Is this a sidebar issue or exposing a
> problem with the undo-code?
Hi Telesto, I looked at this briefly after you posted but got sidetracked. Just got back to it today. Here is what I found:

I had to comment out a couple asserts to be able to test:
soffice.bin: /home/lo/Dev/LO1/core/sw/source/core/txtnode/ndtxt.cxx:5225: void SwTextNode::TriggerNodeUpdate(const sw::LegacyModifyHint&): Assertion `dynamic_cast<SwTextFormatColl const*>(static_cast<const SwFormatChg*>(pOldValue)->pChangedFormat)' failed.

For me, the gen backend locks up. I repro your results with gtk3 and qt5 backends. After the undo step the Navigator shows the Tables category to have 2 hidden tables, Tabelle1 and Tabelle2. The Images category has 1 hidden entry, HTTP://WWW.OPENOFFICE.ORG/DE/ and the Fields category has 1 hidden field, field-DocInformation:Title

On exit I get this assert:
soffice.bin: /home/lo/Dev/LO1/core/svl/source/items/itempool.cxx:686: void SfxItemPool::Remove(const SfxPoolItem&): Assertion `rItem.GetRefCount() && "RefCount == 0, Remove impossible"' failed.

Since I had to remove some inserts to test this using a debug build I would say the Navigator isn't the cause.

Do you have a less complex file that can be used to test that shows this behavior?

BTW, your steps involving copying and pasting to a new file have been helpful to show me something I missed in a patch I am doing to improve when the Navigator needs to be refreshed. Thanks!
Comment 6 QA Administrators 2023-11-04 03:14:54 UTC Comment hidden (obsolete)
Comment 7 Jim Raykowski 2023-11-05 01:09:30 UTC
The tables that still show in the Navigator after undo are located in a header/footer. It seems, in this case, tables located in a header/footer don't get deleted when undo is done which causes them to show in the Navigator as being in the document but not visible.

One solution is to not include in the Navigator Tables entries tables located in a header/footer. It would be consistent with fields located in a header/footer not being included in the Navigator Fields entries (bug 146490).