From 44045a4f2dc87733ac5369aa0b28c2a38940ee17 Mon Sep 17 00:00:00 2001
From: Rafael Dominguez <venccsralph@gmail.com>
Date: Sun, 25 Mar 2012 11:24:05 -0430
Subject: [PATCH 03/31] Overload SdInsertPagesObjsDlg::GetList.

To return selected entries to a vector instead to a deprecated List structure.
---
 sd/source/ui/dlg/inspagob.cxx |   20 ++++++++++++++++++++
 sd/source/ui/inc/inspagob.hxx |   11 +++++++++++
 2 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/sd/source/ui/dlg/inspagob.cxx b/sd/source/ui/dlg/inspagob.cxx
index 4387afe..f9770fd 100644
--- a/sd/source/ui/dlg/inspagob.cxx
+++ b/sd/source/ui/dlg/inspagob.cxx
@@ -142,6 +142,26 @@ List* SdInsertPagesObjsDlg::GetList( sal_uInt16 nType )
     return( aLbTree.GetSelectEntryList( nType ) );
 }
 
+void SdInsertPagesObjsDlg::GetList( const sal_uInt16 nType, std::vector<rtl::OUString> &rEntries )
+{
+    // Bei Draw-Dokumenten muss bei der Selektion des Dokumentes NULL
+    // zurueckgegeben werden
+    if( pMedium )
+    {
+        // Um zu gewaehrleisten, dass die Bookmarks geoeffnet sind
+        // (Wenn gesamtes Dokument ausgewaehlt wurde)
+        aLbTree.GetBookmarkDoc();
+
+        // Wenn das Dokument (mit-)selektiert oder nichst selektiert ist,
+        // wird das gesamte Dokument (und nicht mehr!) eingefuegt.
+        if( aLbTree.GetSelectionCount() == 0 ||
+            ( aLbTree.IsSelected( aLbTree.First() ) ) )
+            return;
+    }
+
+    aLbTree.GetSelectEntryList( nType,rEntries );
+}
+
 /*************************************************************************
 |*
 |*  Ist Verknuepfung gechecked
diff --git a/sd/source/ui/inc/inspagob.hxx b/sd/source/ui/inc/inspagob.hxx
index 7a112df..c6d2f49 100644
--- a/sd/source/ui/inc/inspagob.hxx
+++ b/sd/source/ui/inc/inspagob.hxx
@@ -62,6 +62,17 @@ public:
                 ~SdInsertPagesObjsDlg();
 
     List*       GetList( sal_uInt16 nType );
+
+    /*************************************************************************
+    |*
+    |*  Liefert die Liste zurueck
+    |*  nType == 0 -> Seiten
+    |*  nType == 1 -> Objekte
+    |*
+    \************************************************************************/
+
+    void GetList ( const sal_uInt16 nType, std::vector<rtl::OUString> &rEntries);
+
     sal_Bool        IsLink();
     sal_Bool        IsRemoveUnnessesaryMasterPages() const;
 };
-- 
1.7.3.4

