Closed Bug 358094 Opened 18 years ago Closed 17 years ago

share more code between cocoa drag service and clipboard

Categories

(Core :: Widget: Cocoa, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jaas, Assigned: cbarrett)

References

Details

Attachments

(1 file, 1 obsolete file)

There is a bunch of code that could be shared between the Cocoa drag service and the clipboard implementations (for example, image formatting code). Once some of the more serious drag service regressions and bugs are fixed we should figure out exactly what the drag service can share with the clipboard and do it.
Status: NEW → ASSIGNED
Assignee: joshmoz → cbarrett
Status: ASSIGNED → NEW
Stan, maybe you want to look at or think about this? I was going to originally but that was when the drag & drop bug were in my queue.
Assignee: cbarrett → nobody
I have been scowling at some of the duplication...
Assignee: nobody → stanshebs
We were waiting for Neil Deakin's big drag image patch to land before cleaning this up. Go for it! The big thing is the cairo image processing stuff.
Assignee: stanshebs → cbarrett
Attached patch fix v1.0 - first pass (obsolete) — Splinter Review
No functional changes.

Added two public static helper methods to nsClipboard, nsDragService calls them when needed.

I'm not sharing the pasteboard writing code because the wildcard behavior is non-obvious and very dragging specific.
Attachment #267758 - Flags: review?(joshmoz)
Comment on attachment 267758 [details] [diff] [review]
fix v1.0 - first pass

In nsDragService.h you can remove the following two lines and the space above them as well:

class nsILocalFile;
class nsIDOMDragEvent;

You added a couple spaces in the following code:

-  return NS_OK;
+  return NS_OK;  

It looks like you simply removed the following code and I don't think it should be removed:

-      // The DOM only wants LF, so convert from MacOS line endings to DOM line endings.
-      nsLinebreakHelpers::ConvertPlatformToDOMLinebreaks(flavorStr, (void**)&clipboardDataPtr, (PRInt32*)&dataLength);
Attachment #267758 - Flags: review?(joshmoz) → review-
Attached patch fix v1.1Splinter Review
This fixes my review comments, adds a little more cleanup, most significantly changing the static function names to be more clear about what they are doing.
Attachment #267758 - Attachment is obsolete: true
Attachment #269850 - Flags: review?(cbarrett)
Comment on attachment 269850 [details] [diff] [review]
fix v1.1

I agree, these are much better method names. r=me
Attachment #269850 - Flags: review?(cbarrett) → review+
Attachment #269850 - Flags: superreview?(pavlov)
Comment on attachment 269850 [details] [diff] [review]
fix v1.1

+nsClipboard::GetNativeClipboardData(nsITransferable * aTransferable, PRInt32 aWhichClipboard)

Please, no space between nsITransferable and * (similar comments apply in other places)

Also you have nsITransferable *aTransferable in new code in at least one place, please be consistent and put the * after the type
Attachment #269850 - Flags: superreview?(pavlov) → superreview+
landed on trunk
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: