Do not mangle angle brackets in value widgets

Authored by bruns on Nov 9 2019, 12:18 PM.

Description

Do not mangle angle brackets in value widgets

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.

Reviewers: Baloo, ngraham, astippich

Reviewed By: Baloo, ngraham

Tags: Baloo

Differential Revision: https://phabricator.kde.org/D25239

Details

Committed
brunsNov 11 2019, 1:24 AM
Reviewer
Baloo
Differential Revision
D25239: Do not mangle angle brackets in value widgets
Parents
R824:0dacef044c2f: Remove flawed noLinks handling for originUrls
Branches
Unknown
Tags
Unknown