[haiku-commits] r39981 - haiku/trunk/src/kits/interface

  • From: stefano.ceccherini@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 28 Dec 2010 14:05:23 +0100 (CET)

Author: jackburton
Date: 2010-12-28 14:05:23 +0100 (Tue, 28 Dec 2010)
New Revision: 39981
Changeset: http://dev.haiku-os.org/changeset/39981
Ticket: http://dev.haiku-os.org/ticket/7035

Modified:
   haiku/trunk/src/kits/interface/PictureButton.cpp
Log:
empty the message before reusing it, otherwise the pictures will be archived 
multiple times. Should fix ticket #7035.

Modified: haiku/trunk/src/kits/interface/PictureButton.cpp
===================================================================
--- haiku/trunk/src/kits/interface/PictureButton.cpp    2010-12-28 13:04:43 UTC 
(rev 39980)
+++ haiku/trunk/src/kits/interface/PictureButton.cpp    2010-12-28 13:05:23 UTC 
(rev 39981)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2001-2009, Haiku, Inc.
+ * Copyright 2001-2010, Haiku, Inc.
  * Distributed under the terms of the MIT license.
  *
  * Authors:
@@ -88,25 +88,27 @@
        // Fill out message, depending on whether a deep copy is required or 
not.
        if (deep) {
                BMessage pictureArchive;
-
                if (fEnabledOn->Archive(&pictureArchive, deep) == B_OK) {
                        err = data->AddMessage("_e_on", &pictureArchive);
                        if (err != B_OK)
                                return err;
                }
 
+               pictureArchive.MakeEmpty();
                if (fEnabledOff->Archive(&pictureArchive, deep) == B_OK) {
                        err = data->AddMessage("_e_off", &pictureArchive);
                        if (err != B_OK)
                                return err;
                }
 
+               pictureArchive.MakeEmpty();
                if (fDisabledOn && fDisabledOn->Archive(&pictureArchive, deep) 
== B_OK) {
                        err = data->AddMessage("_d_on", &pictureArchive);
                        if (err != B_OK)
                                return err;
                }
 
+               pictureArchive.MakeEmpty();
                if (fDisabledOff && fDisabledOff->Archive(&pictureArchive, 
deep) == B_OK) {
                        err = data->AddMessage("_d_off", &pictureArchive);
                        if (err != B_OK)


Other related posts:

  • » [haiku-commits] r39981 - haiku/trunk/src/kits/interface - stefano . ceccherini