]> git.saurik.com Git - wxWidgets.git/commitdiff
The null byte at the end of the string should not be included in the
authorRobin Dunn <robin@alldunn.com>
Sat, 25 Mar 2006 00:06:25 +0000 (00:06 +0000)
committerRobin Dunn <robin@alldunn.com>
Sat, 25 Mar 2006 00:06:25 +0000 (00:06 +0000)
size of a text data object in the clipboard, otherwise we have to
subtract it when the data is requested and that results in truncating
one byte for other data formats.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38354 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/dobjcmn.cpp
src/gtk/clipbrd.cpp
src/gtk1/clipbrd.cpp

index dd27a6032d7f2d2b42d66786d55054fbb6b805ed..cbed32d72f9ba9c76ba6d303b6c71d540b8c6a7f 100644 (file)
@@ -238,7 +238,7 @@ size_t wxTextDataObject::GetDataSize(const wxDataFormat& format) const
 {
     wxCharBuffer buffer = GetConv(format).cWX2MB( GetText().c_str() );
 
-    return buffer ? strlen( buffer ) + 1 : 0;
+    return buffer ? strlen( buffer ) : 0;
 }
 
 bool wxTextDataObject::GetDataHere(const wxDataFormat& format, void *buf) const
index 3dabd926b419a8cd5bd5a078313a84f287c78e78..e5aec7830b4a85b0ae521afabffc8e28e872b3e6 100644 (file)
@@ -300,7 +300,7 @@ selection_handler( GtkWidget *WXUNUSED(widget),
         gtk_selection_data_set_text(
             selection_data,
             (const gchar*)d,
-            size-1 );
+            size );
     }
     else
     {
@@ -309,7 +309,7 @@ selection_handler( GtkWidget *WXUNUSED(widget),
             GDK_SELECTION_TYPE_STRING,
             8*sizeof(gchar),
             (unsigned char*) d,
-            size-1 );
+            size );
     }
 
     free(d);
index f9d56bf0f838ac9b83848cb06680c8d5c10eef8d..43b4ccea5e2e618f0c0af00d471d940b5826efa3 100644 (file)
@@ -298,7 +298,7 @@ selection_handler( GtkWidget *WXUNUSED(widget),
             GDK_SELECTION_TYPE_STRING,
             8 * sizeof(gchar),
             (unsigned char*) d,
-            size-1 );
+            size );
 
     free(d);
 }