The default bug view has changed. See this FAQ.

Ampersands don't appear in the windows biff icon tooltip

RESOLVED FIXED in Thunderbird 16.0

Status

MailNews Core
Backend
--
minor
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: neil@parkwaycc.co.uk, Assigned: neil@parkwaycc.co.uk)

Tracking

Trunk
Thunderbird 16.0
x86_64
Windows 7

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
I happened to notice a feed in my biff icon tooltip. However the name of the account, "Blogs & News Feeds" had been corrupted - the ampersand was missing.

A search turned up the problem was a "feature" of tooltips - they delete ampersands because people writing for native Win32 use the same string for a control's label as for its tooltip, so they want the ampersand removed.

There is a way to disable this for a custom tooltip, but we're stuck with the default tooltip created by Windows Explorer.
(Assignee)

Comment 1

5 years ago
OK, so the rule is a little more complicated than that.

The tooltip code removes one & from any run of &s.
However the underlining code also affects the display.
It allows you to quote an & with another &.
So in all you need 2n+1 &s for each run of &s.

Input	Display*
&	
&&	_
&&&	&
&&&&	&_
&&&&&	&&
&&&&&&	&&_
&&&&&&&	&&&

*Only the last "single" & actually underlines the next character.
(Assignee)

Comment 2

5 years ago
To test biff, I open a folder (not an account) and evaluate (on one line):
top.opener.msgWindow.openFolder.server.performingBiff = true;
var Ci = Components.interfaces;
var mwi = Components.classes['@mozilla.org/messenger/osintegration;1']
                   .getService(Ci.nsIFolderListener);
mwi.OnItemIntPropertyChanged(top.opener.msgWindow.openFolder.parent,
                             "BiffState",
                             Ci.nsIMsgFolder.nsMsgBiffState_NewMail,
                             Ci.nsIMsgFolder.nsMsgBiffState_NoMail);
mwi.OnItemIntPropertyChanged(top.opener.msgWindow.openFolder.parent,
                             "BiffState",
                             Ci.nsIMsgFolder.nsMsgBiffState_NoMail,
                             Ci.nsIMsgFolder.nsMsgBiffState_NewMail);
(Assignee)

Comment 3

5 years ago
Created attachment 635699 [details] [diff] [review]
Proposed patch

I decided to fix the hard case with multiple ampersands, just in case ;-)

After replacing single ampersands with three, I then search for six ampersands, which must come from (part of) a run of ampersands. I delete one, then skip two, so that I delete one in every three as long as there are at least six.

2 -> 6 -> 5 (less than 6, so stop)
3 -> 9 -> 2 + 6 -> 2 + 5 (less than 6, so stop) -> 7
4 -> 12 -> 2 + 9 -> 2 + 2 + 6 -> 2 + 2 + 5 -> 9 etc.

Of course, only when we have properly escaped the string can we actually check whether it will fit in the notification buffer.
Assignee: nobody → neil
Attachment #635699 - Flags: review?(dbienvenu)

Comment 4

5 years ago
Comment on attachment 635699 [details] [diff] [review]
Proposed patch

you could make the function static, since it's fairly specific to this file...
Attachment #635699 - Flags: review?(dbienvenu) → review+

Updated

5 years ago
Severity: normal → minor
OS: Windows Server 2008 → Windows 7
Summary: Ampersands don't appear in the biff icon tooltip → Ampersands don't appear in the windows biff icon tooltip
(Assignee)

Comment 5

5 years ago
Pushed comm-central changeset 7198d5992627.
(Assignee)

Comment 6

5 years ago
Oops, why did I forgot to mark this as FIXED?
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 16.0
You need to log in before you can comment on or make changes to this bug.