Bug 159289 - Libre Office Writer does not handle/render Watermark B for Legal Pleadings when opening WPD Files (FILEOPEN)
Summary: Libre Office Writer does not handle/render Watermark B for Legal Pleadings wh...
Status: NEW
Alias: None
Product: Document Liberation Project
Classification: Unclassified
Component: General (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-19 14:55 UTC by Zach Simmons
Modified: 2024-01-22 05:33 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
example wpd file containing legal pleadings style (34.88 KB, application/octet-stream)
2024-01-19 17:56 UTC, Zach Simmons
Details
WordPerfect Writer 2021 Screenshot (43.53 KB, image/png)
2024-01-21 00:00 UTC, Zach Simmons
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zach Simmons 2024-01-19 14:55:51 UTC
Description:
WP6 (2021) files with autobuilt "legal pleadings" vertical lines and line numbers in the left margin and single vertical line on the right margin generated by WordPerfect (tools>legal pleadings) do not appear when opening the .wpd file in LibreOffice.

libwpd sees the "Watermark B" style object the graphic lines and line numbers are nested in as a "HeaderFooter group" and doesn't appear to see anything nested therein. This appears to match the hex of the wpd file, but the Corel SDK documents seem to indicate that the object should actually be 

Steps to Reproduce:
1. Find or create a WP6 (2021) .wpd from Corel WordPerfect which has standard legal pleadings styling
2. Open the document in LibreOffice Writer
3. Note all the legal pleading styling is missing

Actual Results:
Legal pleading style elements of the wpd file were missing in LibreOFfice

Expected Results:
Rendered the legal pleading style elements the same as WordPerfect does, using librevenge, libwpd, and libwpg. Libwpd is almost certainly the source of the problem.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Libwpd doesn't appear to support the sort of style object hierarchy/nesting which is actually possible in WordPerfect and WP6 (2021) files. The actual style elements to be displayed are nested 2 levels deep. First they are within a global style object denoted by 0xDD 0x0A (global style "on") and then within what should be a 0xDD 0x0A 0x2C (global style "on" system type 44 "Watermark B"), followed by the text content, graphics, and closing tags. 

However, the "Watermark B" actually appears to be a 0xD6 0x05 Header/Footer element type 5 "Watermark B" which doesn't have closing or opening components/markers for nesting of styles in the same way as the global style object.
Comment 1 Zach Simmons 2024-01-19 15:00:41 UTC
WordPerfect is one of the leading softwares used by lawyers because of the legal pleadings style tool and how easy it is to use that tool. Many lawyers and law firms use WordPerfect and lack of full compatibility for WPD files in other other programs prevents them from changing to cheaper or more widely supported/integrated or open-source options.

OpenOffice also has this issue due to its dependece on libwpd.

I compiled libwpd 0.10.3 in debug mode to make my deeper observations. I am working on a project where a sharepoint based law office management system wants to preview WPD files in the browser. WPD2HTML was useful for this purpose but failed to translate the pleading style elements to HTML. Further digging revealed that LibreOffice and OpenOffice both have the same issue.
Comment 2 Zach Simmons 2024-01-19 17:56:02 UTC
Created attachment 192065 [details]
example wpd file containing legal pleadings style
Comment 3 Buovjaga 2024-01-19 18:55:48 UTC
Thanks for the file. Can you also take a screenshot from WordPerfect, so we have a reference for the correct result?
Comment 4 Zach Simmons 2024-01-21 00:00:31 UTC
Created attachment 192077 [details]
WordPerfect Writer 2021 Screenshot
Comment 5 Zach Simmons 2024-01-21 00:00:43 UTC
(In reply to Buovjaga from comment #3)
> Thanks for the file. Can you also take a screenshot from WordPerfect, so we
> have a reference for the correct result?

Added
Comment 6 Buovjaga 2024-01-21 06:46:23 UTC
Confirmed

Arch Linux 64-bit, X11
Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 18e579761cb622e8ff7e67f319ef80c61b3bd588
CPU threads: 8; OS: Linux 6.7; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 19 January 2024
Comment 7 Zach Simmons 2024-01-22 05:33:10 UTC
Versions I used are libwpd 0.10.3 and librevenge 0.0.5, since no version field is available for Document Liberation Project.