Closed Bug 301582 Opened 19 years ago Closed 19 years ago

Win32 HTML clipboard format broken by patch for Bug #244685 (StartFragment offset incorrect)

Categories

(Core :: Widget: Win32, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: daniel_atallah, Assigned: daniel_atallah)

Details

Attachments

(1 file)

The addition of the "SourceURL" element (Bug #244685) to the win32 HTML
clipboard format has introduced a new bug.

The header length (kTotalHeaderLen) is calculated assuming that
startSourceURLPrefix will not be included if kSourceURLLength is 0, however,
startSourceURLPrefix is always appended to the headers, even if kSourceURLLength
is 0.

This causes all of the offsets (StartHTML, EndHTML, StartFragment, EndFragment)
to be off ("early") by strlen(startSourceURLPrefix).

This can be replicated easily by copying one of the bookmarks (in that case the
SourceURL isn't present).

Solution: don't append startSourceURLPrefix if kSourceURLLength is 0.

Attaching trivial patch.
Assignee: nobody → daniel_atallah
Status: NEW → ASSIGNED
Component: OS Integration → Widget: Win32
Product: Firefox → Core
Flags: blocking1.8b4?
Attachment #190025 - Flags: review?(david.gardiner)
Flags: blocking1.8b4? → blocking1.8b4+
Whiteboard: [has patch, needs review (david.gardiner)]
Comment on attachment 190025 [details] [diff] [review]
Fix to prevent offsets from being incorrect

Looks good to me - i tested it out and it does fix this .

thanks for finding the bug!

-dave
Attachment #190025 - Flags: review?(david.gardiner) → review+
Attachment #190025 - Flags: superreview?
Attachment #190025 - Flags: approval1.8b4?
I could be wrong, but aren't you supposed to put someone's name in the
superreview box so it asks a specific person to super-review? 
(http://www.mozilla.org/hacking/reviewers.html)

-dave
Attachment #190025 - Flags: superreview? → superreview?(neil.parkwaycc.co.uk)
and if i'd waited another 10 seconds :-)
Attachment #190025 - Flags: superreview?(neil.parkwaycc.co.uk) → superreview+
Attachment #190025 - Flags: approval1.8b4? → approval1.8b4+
This was committed as revision 1.68 to nsDataObj.cpp.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Whiteboard: [has patch, needs review (david.gardiner)]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: