Do not mangle angle brackets in value widgets
ClosedPublic

Authored by bruns on Nov 10 2019, 4:52 PM.

Details

Summary

When some value contains a opening angle bracket "<", any enclosed
text up to the closing ">" is removed from the value.

The mangling only happened for files which are readonly, making the
behavior even more awkward.

As any text properties a always plain text, remove the stripping
also for readonly files.

Depends on D25238

The stripping in the ValueWidget sizeHint is broken as well,
in case the value is PlainText, it would strip regular text from
the size calculation (creating a too narrow widget), for RichText
the sizeHint without stripping is too wide, but the layout
engine wraps the content correctly (it's a hint, after all).

As there are no users for the plainText function left, remove it.

Test Plan

To expose the broken behavior:

  1. Create a document (.odt, html) with a '<' in e.g. the Title
  2. Make the file readonly -> everything after '<' vanishes

With the fix, the content is fully kept.

Diff Detail

Repository
R824 Baloo Widgets
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bruns created this revision.Nov 10 2019, 4:52 PM
Restricted Application added a project: Baloo. · View Herald TranscriptNov 10 2019, 4:52 PM
bruns requested review of this revision.Nov 10 2019, 4:52 PM
This revision is now accepted and ready to land.Nov 10 2019, 11:18 PM
This revision was automatically updated to reflect the committed changes.