D13171: Add support for form text formatting
Andre Heinecke
noreply at phabricator.kde.org
Mon May 28 15:02:03 UTC 2018
aheinecke added a comment.
In D13171#269646 <https://phabricator.kde.org/D13171#269646>, @aacid wrote:
> I'm not very happy of the internalText method/storage in form, ideally, the text in core/form should always be the internal text, and if there's a formatted text that needs to be different that should only be as part of the widget itself. i.e. the FormLineEdit would do something like
>
> setText( formatText( form->text() ) );
>
> Do you think it could be implemented this way?
Sadly I don't think so. I would be happier with such a solution, too, but we need to have the formatted text as part of the real form data so that it is properly printed and shown even if the widget is not visible. Actually the "internalText" is kind of more a "UI" thing while the formatted text is the real thing.
INLINE COMMENTS
> aacid wrote in document.cpp:4297
> You can simplify the loop to p->formFields().contains(fft);
ack.
> aacid wrote in document.cpp:4341
> I don't understand this, can you elaborate why we need to update a form if the new and old text are the same?
If the field was calculated we need to update it anyway because we no longer refresh it in DocumentPrivate::recalculateForms. This avoids a double refresh in case the field is formatted.
Old text here is before formatting, but after calculate. New text is after formatting, but still after calculate. Even if the formatting did not change anything we have to update because of the calculate.
If I remember correctly this happened to me during development when the Format script raised an exception. I shall clarify the comment.
REPOSITORY
R223 Okular
REVISION DETAIL
https://phabricator.kde.org/D13171
To: aheinecke, aacid
Cc: okular-devel, ngraham, aacid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20180528/f8935bcf/attachment.html>
More information about the Okular-devel
mailing list