ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/MacOSX/clip_macosx.cpp
(Generate patch)

Comparing BasiliskII/src/MacOSX/clip_macosx.cpp (file contents):
Revision 1.6 by asvitkine, 2007-02-18T21:11:41Z vs.
Revision 1.8 by asvitkine, 2009-10-18T01:22:33Z

# Line 1 | Line 1
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
# Line 160 | Line 160 | void GetScrap(void **handle, uint32 type
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;
# Line 179 | Line 184 | void PutScrap(uint32 type, void *scrap,
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   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines