- if (i < 0)
- got_selection = wxCloseClipboard();
- } else
- got_selection = FALSE;
-
- got_selection = FALSE; // Assume another process takes over
-
- if (!got_selection) {
- clipOwner->BeingReplaced();
- clipOwner = NULL;
- }
-}
-
-wxClipboardClient *wxClipboard::GetClipboardClient()
-{
- return clipOwner;
-}
-
-void wxClipboard::SetClipboardString(char *str, long time)
-{
- bool got_selection;
-
- if (clipOwner) {
- clipOwner->BeingReplaced();
- clipOwner = NULL;
- }
- if (cbString)
- delete[] cbString;
-
- cbString = str;
-
- if (wxOpenClipboard()) {
- if (!wxSetClipboardData(wxDF_TEXT, (wxObject *)str))
- got_selection = FALSE;
- else
- got_selection = wxCloseClipboard();
- } else
- got_selection = FALSE;
-
- got_selection = FALSE; // Assume another process takes over
-
- if (!got_selection) {
- delete[] cbString;
- cbString = NULL;
- }
-}
-char *wxClipboard::GetClipboardString(long time)
-{
- char *str;
- long length;
-
- str = GetClipboardData("TEXT", &length, time);
- if (!str) {
- str = new char[1];
- *str = 0;
- }
-
- return str;
-}