Project

General

Profile

Actions

Bug #7447

closed

WAnchor::setTextFormat can be reset

Added by Emeric Poupon about 4 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
02/07/2020
Due date:
% Done:

0%

Estimated time:

Description

Hello,

I have the following:

Wt::WAnchor* anchor;
...
anchor->setTextFormat(Wt::TextFormat::Plain);
...
anchor->setText("Something"); // OK here
anchor->setLink(...);
assert(anchor->textFormat == Wt::TextFormat::Plain); // -> ok

Later:
achor->setText("");
anchor->setLink({});
assert(anchor->textFormat == Wt::TextFormat::Plain); // -> fails

To be sure, I have to call the setTextFormat each time I set a non empty text, which is questionable.

Actions #1

Updated by Roel Standaert about 4 years ago

Ah I see, it is implemented using a WText (which also contains the text format), and the WText is removed if the text is set to empty.

Actions #2

Updated by Roel Standaert about 4 years ago

  • Status changed from New to Resolved

I don't see a reason why it would have to delete the underlying WText, and neither does Koen, so I guess we'll just keep that underlying WText around. I pushed a fix.

Actions #3

Updated by Roel Standaert about 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF