Remove deprecated List usage in Clipboard::CreateSlideTransferable.

This commit is contained in:
Rafael Dominguez
2012-03-28 19:46:11 -04:30
committed by Luboš Luňák
parent cb5d50619d
commit a35bc3a357

View File

@@ -424,7 +424,7 @@ void Clipboard::CreateSlideTransferable (
::Window* pWindow, ::Window* pWindow,
bool bDrag) bool bDrag)
{ {
List aBookmarkList; std::vector<rtl::OUString> aBookmarkList;
// Insert all selected pages into a bookmark list and remember them in // Insert all selected pages into a bookmark list and remember them in
// maPagesToRemove for possible later removal. // maPagesToRemove for possible later removal.
@@ -434,9 +434,7 @@ void Clipboard::CreateSlideTransferable (
while (aSelectedPages.HasMoreElements()) while (aSelectedPages.HasMoreElements())
{ {
model::SharedPageDescriptor pDescriptor (aSelectedPages.GetNextElement()); model::SharedPageDescriptor pDescriptor (aSelectedPages.GetNextElement());
aBookmarkList.Insert ( aBookmarkList.push_back(pDescriptor->GetPage()->GetName());
new String(pDescriptor->GetPage()->GetName()),
LIST_APPEND);
maPagesToRemove.push_back (pDescriptor->GetPage()); maPagesToRemove.push_back (pDescriptor->GetPage());
} }
@@ -461,7 +459,7 @@ void Clipboard::CreateSlideTransferable (
break; break;
} }
if (aBookmarkList.Count() > 0) if (!aBookmarkList.empty())
{ {
mrSlideSorter.GetView().BrkAction(); mrSlideSorter.GetView().BrkAction();
SdDrawDocument* pDocument = mrSlideSorter.GetModel().GetDocument(); SdDrawDocument* pDocument = mrSlideSorter.GetModel().GetDocument();
@@ -505,16 +503,13 @@ void Clipboard::CreateSlideTransferable (
pTransferable->SetPageBookmarks (aBookmarkList, !bDrag); pTransferable->SetPageBookmarks (aBookmarkList, !bDrag);
} }
for (void* p=aBookmarkList.First(); p!=NULL; p=aBookmarkList.Next())
delete static_cast<String*>(p);
if (bDrag) if (bDrag)
{ {
pTransferable->SetView (&mrSlideSorter.GetView()); pTransferable->SetView (&mrSlideSorter.GetView());
sal_Int8 nDragSourceActions (DND_ACTION_COPY); sal_Int8 nDragSourceActions (DND_ACTION_COPY);
// The move action is available only when not all pages would be // The move action is available only when not all pages would be
// moved. Otherwise an empty document would remain. Crash. // moved. Otherwise an empty document would remain. Crash.
sal_Int32 nRemainingPages = mrSlideSorter.GetModel().GetPageCount() - aBookmarkList.Count(); sal_Int32 nRemainingPages = mrSlideSorter.GetModel().GetPageCount() - aBookmarkList.size();
if (nRemainingPages > 0) if (nRemainingPages > 0)
nDragSourceActions |= DND_ACTION_MOVE; nDragSourceActions |= DND_ACTION_MOVE;
pTransferable->StartDrag (pActionWindow, nDragSourceActions); pTransferable->StartDrag (pActionWindow, nDragSourceActions);