1 |
|
/* |
2 |
|
* clip_macosx.cpp - Clipboard handling, MacOS X (Carbon) implementation |
3 |
|
* |
4 |
< |
* Basilisk II (C) 1997-2005 Christian Bauer |
4 |
> |
* Basilisk II (C) 1997-2008 Christian Bauer |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
160 |
|
|
161 |
|
void PutScrap(uint32 type, void *scrap, int32 length) |
162 |
|
{ |
163 |
< |
D(bug("PutScrap type %08lx, data %08lx, length %ld\n", type, scrap, length)); |
163 |
> |
static bool clear = true; |
164 |
> |
D(bug("PutScrap type %4.4s, data %08lx, length %ld\n", &type, scrap, length)); |
165 |
|
ScrapRef theScrap; |
166 |
|
|
167 |
|
if (we_put_this_data) { |
168 |
|
we_put_this_data = false; |
169 |
+ |
clear = true; |
170 |
|
return; |
171 |
|
} |
172 |
|
if (length <= 0) |
173 |
|
return; |
174 |
|
|
175 |
< |
ClearCurrentScrap(); |
175 |
> |
if (clear) { |
176 |
> |
D(bug(" calling ClearCurrentScrap\n")); |
177 |
> |
ClearCurrentScrap(); |
178 |
> |
} |
179 |
|
if (GetCurrentScrap(&theScrap) != noErr) { |
180 |
|
D(bug(" could not open scrap\n")); |
181 |
|
return; |
184 |
|
SwapScrapData(type, scrap, length, TRUE); |
185 |
|
if (PutScrapFlavor(theScrap, type, kScrapFlavorMaskNone, length, scrap) != noErr) { |
186 |
|
D(bug(" could not put to scrap\n")); |
187 |
< |
return; |
187 |
> |
//return; |
188 |
|
} |
189 |
+ |
SwapScrapData(type, scrap, length, FALSE); // swap it back |
190 |
|
} |