Added parameter so data can be passed in before drag for bookmarks flavor. Needed so Aurora can work.

This commit is contained in:
pinkerton%netscape.com 1998-07-20 16:05:38 +00:00
parent b360a22121
commit 720249039c
2 changed files with 19 additions and 4 deletions

View File

@ -42,12 +42,14 @@ CProxyDragTask::CProxyDragTask(
CProxyPane& inProxyPane,
LCaption& inPageProxyCaption,
const EventRecord& inEventRecord,
CExtraFlavorAdder* inExtraFlavorAdder)
CExtraFlavorAdder* inExtraFlavorAdder,
const char* inBookmarkFlavorData)
: mProxyView(inProxyView),
mProxyPane(inProxyPane),
mPageProxyCaption(inPageProxyCaption),
mExtraFlavorAdder(inExtraFlavorAdder),
mBookmarkFlavorData(inBookmarkFlavorData),
Inherited(inEventRecord)
{
@ -167,7 +169,18 @@ CProxyDragTask::DoTranslucentDrag()
void
CProxyDragTask::AddFlavors(DragReference inDragRef)
{
Inherited::AddFlavors(inDragRef);
// pass along any data with the bookmark flavor now so that it can be
// retreived before the drop is complete. If we pass null, no one can
// get to the data until the "drag send data" proc is called, which means
// that dropsites that need to see the data before accepting the drop
// will fail.
if ( mBookmarkFlavorData.length() )
AddFlavorBookmark(static_cast<ItemReference>(this), mBookmarkFlavorData.c_str());
else
AddFlavorBookmark(static_cast<ItemReference>(this), NULL);
AddFlavorBookmarkFile(static_cast<ItemReference>(this));
AddFlavorURL(static_cast<ItemReference>(this));
if (mExtraFlavorAdder)
mExtraFlavorAdder->AddExtraFlavorData(inDragRef, static_cast<ItemReference>(this));
}

View File

@ -26,7 +26,7 @@
// Includes
#include "CBrowserDragTask.h"
#include <string>
#include "CProxyPane.h"
// Forward declarations
@ -53,7 +53,8 @@ public:
CProxyPane& inProxyPane,
LCaption& inPageProxyCaption,
const EventRecord& inEventRecord,
CExtraFlavorAdder* inFlavorAdder = nil);
CExtraFlavorAdder* inFlavorAdder = nil,
const char* inBookmarkFlavorData = nil );
virtual ~CProxyDragTask();
virtual OSErr DoDrag();
@ -71,6 +72,7 @@ protected:
CProxyPane& mProxyPane;
LCaption& mPageProxyCaption;
CExtraFlavorAdder* mExtraFlavorAdder;
const string mBookmarkFlavorData; // data sent along with drag. Ok to be NULL
};