aboutsummaryrefslogtreecommitdiff
path: root/guilib
diff options
context:
space:
mode:
authorjmarshallnz <jmarshallnz@svn>2010-01-17 02:52:13 +0000
committerjmarshallnz <jmarshallnz@svn>2010-01-17 02:52:13 +0000
commit151582d45ab0ff8c21fdefd6f5cf95409b15ee06 (patch)
tree59db2bcd6051fcc57d272812e11fc0d5cde1b5ca /guilib
parentd4438bf0be84732eac89be17702baba2af0c8b4f (diff)
changed: use a Clone() routine for duplicating fileitems
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@26933 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib')
-rw-r--r--guilib/GUIListItem.h2
-rw-r--r--guilib/GUIWrappingListContainer.cpp5
2 files changed, 2 insertions, 5 deletions
diff --git a/guilib/GUIListItem.h b/guilib/GUIListItem.h
index 15ad4e9ff5..4509ecfa9f 100644
--- a/guilib/GUIListItem.h
+++ b/guilib/GUIListItem.h
@@ -59,7 +59,7 @@ public:
CGUIListItem(const CGUIListItem& item);
CGUIListItem(const CStdString& strLabel);
virtual ~CGUIListItem(void);
-
+ virtual CGUIListItem *Clone() const { return new CGUIListItem(*this); };
const CGUIListItem& operator =(const CGUIListItem& item);
diff --git a/guilib/GUIWrappingListContainer.cpp b/guilib/GUIWrappingListContainer.cpp
index 80170ca5b6..87a2a5b375 100644
--- a/guilib/GUIWrappingListContainer.cpp
+++ b/guilib/GUIWrappingListContainer.cpp
@@ -141,10 +141,7 @@ void CGUIWrappingListContainer::ValidateOffset()
// add additional copies of items, as we require extras at render time
for (unsigned int i = 0; i < numItems; i++)
{
- if (m_items[i]->IsFileItem())
- m_items.push_back(CFileItemPtr(new CFileItem(*(CFileItem *)m_items[i].get())));
- else
- m_items.push_back(CGUIListItemPtr(new CGUIListItem(*m_items[i])));
+ m_items.push_back(CGUIListItemPtr(m_items[i]->Clone()));
m_extraItems++;
}
}