empty the message before reusing it, otherwise the pictures will be archived multiple times. Should fix ticket #7035.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39981 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2010-12-28 13:05:23 +00:00
parent 8e165582f1
commit b2f1b918ed
+4 -2
View File
@@ -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 @@ BPictureButton::Archive(BMessage* data, bool deep) const
// 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)