[Libreoffice-commits] .: 14 commits - sd/inc sd/source

Lubos Lunak llunak at kemper.freedesktop.org
Fri Apr 13 09:42:31 PDT 2012


 sd/inc/drawdoc.hxx                                             |   29 -
 sd/inc/sdabstdlg.hxx                                           |    1 
 sd/source/core/drawdoc3.cxx                                    |  187 +++-------
 sd/source/core/pglink.cxx                                      |    7 
 sd/source/ui/app/sdxfer.cxx                                    |   16 
 sd/source/ui/dlg/inspagob.cxx                                  |   27 -
 sd/source/ui/dlg/sddlgfact.cxx                                 |    4 
 sd/source/ui/dlg/sddlgfact.hxx                                 |    1 
 sd/source/ui/dlg/sdtreelb.cxx                                  |   30 -
 sd/source/ui/func/fuinsfil.cxx                                 |   74 ---
 sd/source/ui/inc/inspagob.hxx                                  |    2 
 sd/source/ui/inc/sdtreelb.hxx                                  |    1 
 sd/source/ui/inc/sdxfer.hxx                                    |    8 
 sd/source/ui/slidesorter/controller/SlsClipboard.cxx           |   27 -
 sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx |    2 
 sd/source/ui/view/ViewClipboard.cxx                            |   25 -
 sd/source/ui/view/sdview2.cxx                                  |   94 -----
 17 files changed, 134 insertions(+), 401 deletions(-)

New commits:
commit c639aba4a522452b194d2648206901660c1caa43
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Sun Apr 1 08:44:01 2012 -0430

    Remove deprecated and unused methods.

diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
index fb6af15..c9f69c9 100644
--- a/sd/inc/drawdoc.hxx
+++ b/sd/inc/drawdoc.hxx
@@ -268,10 +268,6 @@ public:
 
     SD_DLLPUBLIC SdDrawDocument* OpenBookmarkDoc(const String& rBookmarkFile);
     SdDrawDocument*     OpenBookmarkDoc(SfxMedium& rMedium);
-    sal_Bool                InsertBookmark(List* pBookmarkList, List* pExchangeList, sal_Bool bLink,
-                                        sal_Bool bReplace, sal_uInt16 nPgPos, sal_Bool bNoDialogs,
-                                        ::sd::DrawDocShell* pBookmarkDocSh, sal_Bool bCopy,
-                                        Point* pObjPos);
 
     sal_Bool InsertBookmark(const std::vector<rtl::OUString> &rBookmarkList,
                             std::vector<rtl::OUString> &rExchangeList, sal_Bool bLink,
@@ -327,57 +323,6 @@ public:
         Whether the replace operation should take the name from the new
         page, or preserve the old name
      */
-    sal_Bool                InsertBookmarkAsPage(List* pBookmarkList, List* pExchangeList,
-                                              sal_Bool bLink, sal_Bool bReplace, sal_uInt16 nPgPos,
-                                              sal_Bool bNoDialogs, ::sd::DrawDocShell* pBookmarkDocSh,
-                                              sal_Bool bCopy, sal_Bool bMergeMasterPages,
-                                              sal_Bool bPreservePageNames);
-
-    /** Insert pages into this document
-
-        This method inserts whole pages into this document, either
-        selected ones (specified via pBookmarkList/pExchangeList), or
-        all from the source document.
-
-        @attention Beware! This method in it's current state does not
-        handle all combinations of their input parameters
-        correctly. For example, for pBookmarkList=NULL, bReplace=sal_True
-        is ignored (no replace happens).
-
-        @param pBookmarkList
-        A list of strings, denoting the names of the pages to be copied
-
-        @param pExchangeList
-        A list of strings, denoting the names of the pages to be renamed
-
-        @param bLink
-        Whether the inserted pages should be links to the bookmark document
-
-        @param bReplace
-        Whether the pages should not be inserted, but replace the pages in
-        the destination document
-
-        @param nPgPos
-        Insertion point/start of replacement
-
-        @param bNoDialogs
-        Whether query dialogs are allowed (e.g. for page scaling)
-
-        @param pBookmarkDocSh
-        DocShell of the source document (used e.g. to extract the filename
-        for linked pages)
-
-        @param bCopy
-        Whether the source document should be treated as immutable (i.e.
-        inserted pages are not removed from it, but cloned)
-
-        @param bMergeMasterPages
-        Whether the source document's master pages should be copied, too.
-
-        @param bPreservePageNames
-        Whether the replace operation should take the name from the new
-        page, or preserve the old name
-     */
 
     sal_Bool InsertBookmarkAsPage(const std::vector<rtl::OUString> &rBookmarkList, std::vector<rtl::OUString> &rExchangeList,
                               sal_Bool bLink, sal_Bool bReplace, sal_uInt16 nPgPos,
@@ -385,10 +330,6 @@ public:
                               sal_Bool bCopy, sal_Bool bMergeMasterPages,
                               sal_Bool bPreservePageNames);
 
-    sal_Bool                InsertBookmarkAsObject(List* pBookmarkList, List* pExchangeListL,
-                                                sal_Bool bLink, ::sd::DrawDocShell* pBookmarkDocSh,
-                                                Point* pObjPos);
-
     sal_Bool InsertBookmarkAsObject(const std::vector<rtl::OUString> &rBookmarkList,
                                     std::vector<rtl::OUString> &rExchangeList,
                                     sal_Bool bLink, ::sd::DrawDocShell* pBookmarkDocSh,
diff --git a/sd/inc/sdabstdlg.hxx b/sd/inc/sdabstdlg.hxx
index 8a78929..8e01fbc 100644
--- a/sd/inc/sdabstdlg.hxx
+++ b/sd/inc/sdabstdlg.hxx
@@ -139,7 +139,6 @@ class AbstractSdInsertPagesObjsDlg : public VclAbstractDialog  //add for SdInser
 {
 public:
     virtual ::Window*   GetWindow() = 0;  //this method is added for return a ::Window type pointer
-    virtual List*       GetList( sal_uInt16 nType ) = 0;
     virtual void GetList ( const sal_uInt16 nType, std::vector<rtl::OUString> &rEntries ) = 0;
     virtual sal_Bool        IsLink() = 0;
     virtual sal_Bool        IsRemoveUnnessesaryMasterPages() const = 0;
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index d75ef20..63ce713 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -129,79 +129,6 @@ void InsertBookmarkAsPage_FindDuplicateLayouts::operator()( SdDrawDocument& rDoc
 \************************************************************************/
 
 void lcl_IterateBookmarkPages( SdDrawDocument &rDoc, SdDrawDocument* pBookmarkDoc,
-                               List* pBookmarkList, sal_uInt16 nBMSdPageCount,
-                               InsertBookmarkAsPage_FindDuplicateLayouts& rPageIterator )
-{
-    //
-    // Refactored copy'n'pasted layout name collection from InsertBookmarkAsPage
-    //
-    int nPos, nEndPos;
-
-    if( !pBookmarkList )
-    {
-        // no list? whole source document
-        nEndPos = nBMSdPageCount;
-    }
-    else
-    {
-        // bookmark list? number of entries
-        nEndPos = pBookmarkList->Count();
-    }
-
-    SdPage* pBMPage;
-
-    // iterate over number of pages to insert
-    for (nPos = 0; nPos < nEndPos; ++nPos)
-    {
-        // the master page associated to the nPos'th page to insert
-        SdPage* pBMMPage = NULL;
-
-        if( !pBookmarkList )
-        {
-            // simply take master page of nPos'th page in source document
-            pBMMPage = (SdPage*)(&(pBookmarkDoc->GetSdPage((sal_uInt16)nPos, PK_STANDARD)->TRG_GetMasterPage()));
-        }
-        else
-        {
-            // fetch nPos'th entry from bookmark list, and determine master page
-            String  aBMPgName (*(String*) pBookmarkList->GetObject(nPos));
-            sal_Bool    bIsMasterPage;
-
-            sal_uInt16 nBMPage = pBookmarkDoc->GetPageByName( aBMPgName, bIsMasterPage );
-
-            if (nBMPage != SDRPAGE_NOTFOUND)
-            {
-                pBMPage = (SdPage*) pBookmarkDoc->GetPage(nBMPage);
-            }
-            else
-            {
-                pBMPage = NULL;
-            }
-
-            // enforce that bookmarked page is a standard page and not already a master page
-            if (pBMPage && pBMPage->GetPageKind()==PK_STANDARD && !pBMPage->IsMasterPage())
-            {
-                const sal_uInt16 nBMSdPage = (nBMPage - 1) / 2;
-                pBMMPage = (SdPage*) (&(pBookmarkDoc->GetSdPage(nBMSdPage, PK_STANDARD)->TRG_GetMasterPage()));
-            }
-        }
-
-        // successfully determined valid (bookmarked) page?
-        if( pBMMPage )
-        {
-            // yes, call functor
-            rPageIterator( rDoc, pBMMPage );
-        }
-    }
-}
-
-/*************************************************************************
-|*
-|* Fuegt ein Bookmark als Seite ein
-|*
-\************************************************************************/
-
-void lcl_IterateBookmarkPages( SdDrawDocument &rDoc, SdDrawDocument* pBookmarkDoc,
                                const std::vector<rtl::OUString> &rBookmarkList, sal_uInt16 nBMSdPageCount,
                                InsertBookmarkAsPage_FindDuplicateLayouts& rPageIterator )
 {
@@ -366,78 +293,6 @@ SdDrawDocument* SdDrawDocument::OpenBookmarkDoc(const String& rBookmarkFile)
 \************************************************************************/
 
 sal_Bool SdDrawDocument::InsertBookmark(
-    List* pBookmarkList,            // Liste der Namen der einzufuegenden Bookmarks
-    List* pExchangeList,            // Liste der zu verwendenen Namen
-    sal_Bool bLink,                     // Bookmarks sollen als Verknuepfung eingefuegt werden
-    sal_Bool bReplace,                  // Aktuellen Seiten (Standard&Notiz) werden ersetzt
-    sal_uInt16 nInsertPos,              // Einfuegeposition fuer Seiten
-    sal_Bool bNoDialogs,                // Keine Dialoge anzeigen
-    ::sd::DrawDocShell* pBookmarkDocSh, // Wenn gesetzt, so ist dieses das Source-Dokument
-    sal_Bool bCopy,                     // Seiten werden kopiert
-    Point* pObjPos)                 // Einfuegeposition fuer Objekte
-{
-    sal_Bool bOK = sal_True;
-    sal_Bool bInsertPages = sal_False;
-
-    if (!pBookmarkList)
-    {
-        /**********************************************************************
-        * Alle Seiten werden eingefuegt
-        **********************************************************************/
-        bInsertPages = sal_True;
-    }
-    else
-    {
-        SdDrawDocument* pBookmarkDoc = NULL;
-        String aBookmarkName;
-
-        if (pBookmarkDocSh)
-        {
-            pBookmarkDoc = pBookmarkDocSh->GetDoc();
-            aBookmarkName = pBookmarkDocSh->GetMedium()->GetName();
-        }
-        else if ( mxBookmarkDocShRef.Is() )
-        {
-            pBookmarkDoc = mxBookmarkDocShRef->GetDoc();
-            aBookmarkName = maBookmarkFile;
-        }
-        else
-            bOK = sal_False;
-
-        for (sal_uInt16 nPos = 0; bOK && ( nPos < pBookmarkList->Count() ) && !bInsertPages; nPos++)
-        {
-            /******************************************************************
-            * Gibt es in der Bookmark-Liste einen Seitennamen?
-            ******************************************************************/
-            String  aBMPgName (*(String*) pBookmarkList->GetObject(nPos));
-            sal_Bool    bIsMasterPage;
-
-            if( pBookmarkDoc->GetPageByName( aBMPgName, bIsMasterPage ) != SDRPAGE_NOTFOUND )
-            {
-                // Seite gefunden
-                bInsertPages = sal_True;
-            }
-        }
-    }
-
-    if ( bOK && bInsertPages )
-    {
-        // Zuerst werden alle Seiten-Bookmarks eingefuegt
-        bOK = InsertBookmarkAsPage(pBookmarkList, pExchangeList, bLink, bReplace,
-                                   nInsertPos, bNoDialogs, pBookmarkDocSh, bCopy, sal_True, sal_False);
-    }
-
-    if ( bOK && pBookmarkList )
-    {
-        // Es werden alle Objekt-Bookmarks eingefuegt
-        bOK = InsertBookmarkAsObject(pBookmarkList, pExchangeList, bLink,
-                                     pBookmarkDocSh, pObjPos);
-    }
-
-    return bOK;
-}
-
-sal_Bool SdDrawDocument::InsertBookmark(
     const std::vector<rtl::OUString> &rBookmarkList,    // Liste der Namen der einzufuegenden Bookmarks
     std::vector<rtl::OUString> &rExchangeList,          // Liste der zu verwendenen Namen
     sal_Bool bLink,                                     // Bookmarks sollen als Verknuepfung eingefuegt werden
@@ -513,560 +368,6 @@ sal_Bool SdDrawDocument::InsertBookmark(
 }
 
 sal_Bool SdDrawDocument::InsertBookmarkAsPage(
-    List* pBookmarkList,
-    List* pExchangeList,            // Liste der zu verwendenen Namen
-    sal_Bool bLink,
-    sal_Bool bReplace,
-    sal_uInt16 nInsertPos,
-    sal_Bool bNoDialogs,
-    ::sd::DrawDocShell* pBookmarkDocSh,
-    sal_Bool bCopy,
-    sal_Bool bMergeMasterPages,
-    sal_Bool bPreservePageNames)
-{
-    sal_Bool bOK = sal_True;
-    sal_Bool bContinue = sal_True;
-    sal_Bool bScaleObjects = sal_False;
-    sal_uInt16 nReplacedStandardPages = 0;
-
-    SdDrawDocument* pBookmarkDoc = NULL;
-    String aBookmarkName;
-
-    if (pBookmarkDocSh)
-    {
-        pBookmarkDoc = pBookmarkDocSh->GetDoc();
-
-        if (pBookmarkDocSh->GetMedium())
-        {
-            aBookmarkName = pBookmarkDocSh->GetMedium()->GetName();
-        }
-    }
-    else if ( mxBookmarkDocShRef.Is() )
-    {
-        pBookmarkDoc = mxBookmarkDocShRef->GetDoc();
-        aBookmarkName = maBookmarkFile;
-    }
-    else
-    {
-        return sal_False;
-    }
-
-    const sal_uInt16 nSdPageCount = GetSdPageCount(PK_STANDARD);
-    const sal_uInt16 nBMSdPageCount = pBookmarkDoc->GetSdPageCount(PK_STANDARD);
-    const sal_uInt16 nMPageCount = GetMasterPageCount();
-
-    if (nSdPageCount==0 || nBMSdPageCount==0 || nMPageCount==0)
-    {
-        bContinue = bOK = sal_False;
-        return(bContinue);
-    }
-
-    // Store the size and some other properties of the first page and notes
-    // page so that inserted pages can be properly scaled even when inserted
-    // before the first page.
-    // Note that the pointers are used later on as general page pointers.
-    SdPage* pRefPage = GetSdPage(0, PK_STANDARD);
-    Size  aSize(pRefPage->GetSize());
-    sal_Int32 nLeft  = pRefPage->GetLftBorder();
-    sal_Int32 nRight = pRefPage->GetRgtBorder();
-    sal_Int32 nUpper = pRefPage->GetUppBorder();
-    sal_Int32 nLower = pRefPage->GetLwrBorder();
-    Orientation eOrient = pRefPage->GetOrientation();
-
-    SdPage* pNPage = GetSdPage(0, PK_NOTES);
-    Size aNSize(GetSdPage(0, PK_NOTES)->GetSize());
-    sal_Int32 nNLeft  = pNPage->GetLftBorder();
-    sal_Int32 nNRight = pNPage->GetRgtBorder();
-    sal_Int32 nNUpper = pNPage->GetUppBorder();
-    sal_Int32 nNLower = pNPage->GetLwrBorder();
-    Orientation eNOrient = pRefPage->GetOrientation();
-
-    // Seitengroesse und -raender an die Werte der letzten
-    // Seiten anpassen?
-    pRefPage = GetSdPage(nSdPageCount - 1, PK_STANDARD);
-
-    if( bNoDialogs )
-    {
-        if( !pBookmarkList )
-            bScaleObjects = pRefPage->IsScaleObjects();
-        else
-            bScaleObjects = sal_True;
-    }
-    else
-    {
-        SdPage* pBMPage = pBookmarkDoc->GetSdPage(0,PK_STANDARD);
-
-        if (pBMPage->GetSize()        != pRefPage->GetSize()         ||
-            pBMPage->GetLftBorder()   != pRefPage->GetLftBorder()    ||
-            pBMPage->GetRgtBorder()   != pRefPage->GetRgtBorder()    ||
-            pBMPage->GetUppBorder()   != pRefPage->GetUppBorder()    ||
-            pBMPage->GetLwrBorder()   != pRefPage->GetLwrBorder())
-        {
-            String aStr(SdResId(STR_SCALE_OBJECTS));
-            sal_uInt16 nBut = QueryBox( NULL, WB_YES_NO_CANCEL, aStr).Execute();
-
-            bScaleObjects = nBut == RET_YES;
-            bContinue     = nBut != RET_CANCEL;
-
-            if (!bContinue)
-            {
-                return(bContinue);
-            }
-        }
-    }
-
-
-    /**************************************************************************
-    |* Die benoetigten Praesentations-StyleSheets ermitteln und vor
-    |* den Seiten transferieren, sonst verlieren die Textobjekte
-    |* beim Transfer den Bezug zur Vorlage
-    \*************************************************************************/
-    ::svl::IUndoManager* pUndoMgr = NULL;
-    if( mpDocSh )
-    {
-        pUndoMgr = mpDocSh->GetUndoManager();
-        pUndoMgr->EnterListAction(String(SdResId(STR_UNDO_INSERTPAGES)), String());
-    }
-
-    //
-    // Refactored copy'n'pasted layout name collection into IterateBookmarkPages
-    //
-    std::vector<rtl::OUString> aLayoutsToTransfer;
-    InsertBookmarkAsPage_FindDuplicateLayouts aSearchFunctor( aLayoutsToTransfer );
-    lcl_IterateBookmarkPages( *this, pBookmarkDoc, pBookmarkList, nBMSdPageCount, aSearchFunctor );
-
-
-    /**************************************************************************
-    * Die tatsaechlich benoetigten Vorlagen kopieren
-    **************************************************************************/
-    SdStyleSheetPool* pBookmarkStyleSheetPool =
-    (SdStyleSheetPool*) pBookmarkDoc->GetStyleSheetPool();
-
-    // Wenn Vorlagen kopiert werden muessen, dann muessen auch die
-    // MasterPages kopiert werden!
-    if( !aLayoutsToTransfer.empty() )
-        bMergeMasterPages = sal_True;
-
-    std::vector<rtl::OUString>::const_iterator pIter;
-    for ( pIter = aLayoutsToTransfer.begin(); pIter != aLayoutsToTransfer.end(); ++pIter )
-    {
-        SdStyleSheetVector aCreatedStyles;
-        String layoutName = *pIter;
-
-        ((SdStyleSheetPool*)GetStyleSheetPool())->CopyLayoutSheets(layoutName, *pBookmarkStyleSheetPool,aCreatedStyles);
-
-        if(!aCreatedStyles.empty())
-        {
-            if( pUndoMgr )
-            {
-                SdMoveStyleSheetsUndoAction* pMovStyles = new SdMoveStyleSheetsUndoAction(this, aCreatedStyles, sal_True);
-                pUndoMgr->AddUndoAction(pMovStyles);
-            }
-        }
-    }
-
-    /**************************************************************************
-    * Dokument einfuegen
-    **************************************************************************/
-
-    const bool bUndo = IsUndoEnabled();
-
-    if( bUndo )
-        BegUndo(String(SdResId(STR_UNDO_INSERTPAGES)));
-
-    if (!pBookmarkList)
-    {
-        if (nInsertPos >= GetPageCount())
-        {
-            // Seiten werden hinten angefuegt
-            nInsertPos = GetPageCount();
-        }
-
-        sal_uInt16 nActualInsertPos = nInsertPos;
-
-        sal_uInt16 nBMSdPage;
-        std::set<sal_uInt16> aRenameSet;
-        std::map<sal_uInt16,rtl::OUString> aNameMap;
-
-        for (nBMSdPage=0; nBMSdPage < nBMSdPageCount; nBMSdPage++)
-        {
-            SdPage* pBMPage = pBookmarkDoc->GetSdPage(nBMSdPage, PK_STANDARD);
-            String  sName( pBMPage->GetName() );
-            sal_Bool    bIsMasterPage;
-
-            if (bLink)
-            {
-                // Es werden sich die Namen aller Seiten gemerkt
-                aNameMap.insert(std::make_pair(nBMSdPage,sName));
-            }
-
-            // Have to check for duplicate names here, too
-            // don't change name if source and dest model are the same!
-            if( pBookmarkDoc != this &&
-                GetPageByName(sName, bIsMasterPage ) != SDRPAGE_NOTFOUND )
-            {
-                // delay renaming *after* pages are copied (might destroy source otherwise)
-                aRenameSet.insert(nBMSdPage);
-            }
-        }
-
-        Merge(*pBookmarkDoc,
-              1,                 // Nicht die Handzettelseite
-              0xFFFF,            // Aber alle anderen
-              nActualInsertPos,  // An Position einfuegen
-              bMergeMasterPages, // MasterPages mitnehmen
-              sal_False,             // Aber nur die benoetigten MasterPages
-              sal_True,              // Undo-Aktion erzeugen
-              bCopy);            // Seiten kopieren (oder mergen)
-
-        for (nBMSdPage=0; nBMSdPage < nBMSdPageCount; nBMSdPage++)
-        {
-            SdPage* pPage       = (SdPage*) GetPage(nActualInsertPos);
-            SdPage* pNotesPage  = (SdPage*) GetPage(nActualInsertPos+1);
-
-            // delay renaming *after* pages are copied (might destroy source otherwise)
-            if( aRenameSet.find(nBMSdPage) != aRenameSet.end() )
-            {
-                // Seitenname schon vorhanden -> Defaultname
-                // fuer Standard & Notizseite
-                pPage->SetName(String());
-                pNotesPage->SetName(String());
-            }
-
-            if (bLink)
-            {
-                String aName(aNameMap[nBMSdPage]);
-
-                // Nun werden die Link-Namen zusammengestellt
-                pPage->SetFileName(aBookmarkName);
-                pPage->SetBookmarkName(aName);
-                pPage->SetModel(this);
-            }
-
-            nActualInsertPos += 2;
-        }
-    }
-    else
-    {
-        /**********************************************************************
-        * Ausgewaehlte Seiten einfuegen
-        **********************************************************************/
-        SdPage* pBMPage;
-
-        if (nInsertPos >= GetPageCount())
-        {
-            // Seiten werden hinten angefuegt
-            bReplace = sal_False;
-            nInsertPos = GetPageCount();
-        }
-
-        sal_uInt16 nActualInsertPos = nInsertPos;
-
-        // Collect the bookmarked pages.
-        ::std::vector<SdPage*> aBookmarkedPages (pBookmarkList->Count(), NULL);
-        for (sal_uInt16 nPos = 0; nPos < pBookmarkList->Count(); nPos++)
-        {
-            String  aPgName(*(String*) pBookmarkList->GetObject(nPos));
-            sal_Bool    bIsMasterPage;
-            sal_uInt16  nBMPage = pBookmarkDoc->GetPageByName( aPgName, bIsMasterPage );
-
-            if (nBMPage != SDRPAGE_NOTFOUND)
-            {
-                aBookmarkedPages[nPos] =  dynamic_cast<SdPage*>(pBookmarkDoc->GetPage(nBMPage));
-            }
-        }
-
-        for (sal_uInt16 nPos = 0; nPos < pBookmarkList->Count(); nPos++)
-        {
-            pBMPage = aBookmarkedPages[nPos];
-            sal_uInt16 nBMPage = pBMPage!=NULL ? pBMPage->GetPageNum() : SDRPAGE_NOTFOUND;
-
-            if (pBMPage && pBMPage->GetPageKind()==PK_STANDARD && !pBMPage->IsMasterPage())
-            {
-                /**************************************************************
-                * Es muss eine StandardSeite sein
-                **************************************************************/
-                sal_Bool bMustRename = sal_False;
-
-                // delay renaming *after* pages are copied (might destroy source otherwise)
-                // don't change name if source and dest model are the same!
-                // avoid renaming if replacing the same page
-                String  aPgName(*(String*) pBookmarkList->GetObject(nPos));
-                sal_Bool    bIsMasterPage;
-                sal_uInt16 nPageSameName = GetPageByName(aPgName, bIsMasterPage);
-                if( pBookmarkDoc != this &&
-                    nPageSameName != SDRPAGE_NOTFOUND &&
-                    ( !bReplace ||
-                      nPageSameName != nActualInsertPos ) )
-                {
-                    bMustRename = sal_True;
-                }
-
-                SdPage* pBookmarkPage = pBMPage;
-                if (bReplace )
-                {
-                    ReplacePageInCustomShows( dynamic_cast< SdPage* >( GetPage( nActualInsertPos ) ), pBookmarkPage );
-                }
-
-                Merge(*pBookmarkDoc,
-                      nBMPage,           // Von Seite (Standard)
-                      nBMPage+1,         // Bis Seite (Notizen)
-                      nActualInsertPos,  // An Position einfuegen
-                      bMergeMasterPages, // MasterPages mitnehmen
-                      sal_False,             // Aber nur die benoetigten MasterPages
-                      sal_True,              // Undo-Aktion erzeugen
-                      bCopy);            // Seiten kopieren (oder mergen)
-
-                if( bReplace )
-                {
-                    if( GetPage( nActualInsertPos ) != pBookmarkPage )
-                    {
-                        // bookmark page was not moved but cloned, so update custom shows again
-                        ReplacePageInCustomShows( pBookmarkPage, dynamic_cast< SdPage* >( GetPage( nActualInsertPos ) ) );
-                    }
-                }
-
-                if( bMustRename )
-                {
-                    // Seitenname schon vorhanden -> Defaultname
-                    // fuer Standard & Notizseite
-                    SdPage* pPage = (SdPage*) GetPage(nActualInsertPos);
-                    pPage->SetName(String());
-                    SdPage* pNotesPage = (SdPage*) GetPage(nActualInsertPos+1);
-                    pNotesPage->SetName(String());
-                }
-
-                if (bLink)
-                {
-                    SdPage* pPage = (SdPage*) GetPage(nActualInsertPos);
-                    pPage->SetFileName(aBookmarkName);
-                    pPage->SetBookmarkName(aPgName);
-                    pPage->SetModel(this);
-                }
-
-                if (bReplace)
-                {
-                    // Seite & Notizseite ausfuegen
-                    const sal_uInt16 nDestPageNum(nActualInsertPos + 2);
-                    SdPage* pStandardPage = 0L;
-
-                    if(nDestPageNum < GetPageCount())
-                    {
-                        pStandardPage = (SdPage*)GetPage(nDestPageNum);
-                    }
-
-                    if (pStandardPage)
-                    {
-                        if( bPreservePageNames )
-                        {
-                            // Take old slide names for inserted pages
-                            SdPage* pPage = (SdPage*) GetPage(nActualInsertPos);
-                            pPage->SetName( pStandardPage->GetRealName() );
-                        }
-
-                        if( bUndo )
-                            AddUndo(GetSdrUndoFactory().CreateUndoDeletePage(*pStandardPage));
-
-                        RemovePage(nDestPageNum);
-
-                        if( !bUndo )
-                            delete pStandardPage;
-                    }
-
-                    SdPage* pNotesPage = 0L;
-
-                    if(nDestPageNum < GetPageCount())
-                    {
-                        pNotesPage = (SdPage*)GetPage(nDestPageNum);
-                    }
-
-                    if (pNotesPage)
-                    {
-                        if( bPreservePageNames )
-                        {
-                            // Take old slide names for inserted pages
-                            SdPage* pNewNotesPage = (SdPage*) GetPage(nActualInsertPos+1);
-                            if( pNewNotesPage )
-                                pNewNotesPage->SetName( pStandardPage->GetRealName() );
-                        }
-
-                        if( bUndo )
-                            AddUndo(GetSdrUndoFactory().CreateUndoDeletePage(*pNotesPage));
-
-                        RemovePage(nDestPageNum);
-
-                        if( !bUndo )
-                            delete pNotesPage;
-                    }
-
-                    nReplacedStandardPages++;
-                }
-
-                nActualInsertPos += 2;
-            }
-        }
-    }
-
-
-    /**************************************************************************
-    |* Dabei sind evtl. zu viele Masterpages ruebergekommen, da die
-    |* DrawingEngine gleiche Praesentationslayouts nicht erkennen kann.
-    |* Ueberzaehlige MasterPages entfernen.
-    \*************************************************************************/
-    sal_uInt16 nNewMPageCount = GetMasterPageCount();
-
-    // rueckwaerts, damit Nummern nicht durcheinander geraten
-    for (sal_uInt16 nPage = nNewMPageCount - 1; nPage >= nMPageCount; nPage--)
-    {
-        pRefPage = (SdPage*) GetMasterPage(nPage);
-        String aMPLayout(pRefPage->GetLayoutName());
-        PageKind eKind = pRefPage->GetPageKind();
-
-        // gibt's den schon?
-        for (sal_uInt16 nTest = 0; nTest < nMPageCount; nTest++)
-        {
-            SdPage* pTest = (SdPage*) GetMasterPage(nTest);
-            String aTest(pTest->GetLayoutName());
-
-            // nInsertPos > 2 is always true when inserting into non-empty models
-            if ( nInsertPos > 2 &&
-                 aTest == aMPLayout &&
-                 eKind == pTest->GetPageKind() )
-            {
-                if( bUndo )
-                    AddUndo(GetSdrUndoFactory().CreateUndoDeletePage(*pRefPage));
-
-                RemoveMasterPage(nPage);
-
-                if( !bUndo )
-                    delete pRefPage;
-                nNewMPageCount--;
-                break;
-            }
-        }
-    }
-
-    // nInsertPos > 2 is always true when inserting into non-empty models
-    if (nInsertPos > 0)
-    {
-        sal_uInt16 nSdPageStart = (nInsertPos - 1) / 2;
-        sal_uInt16 nSdPageEnd = GetSdPageCount(PK_STANDARD) - nSdPageCount +
-                            nSdPageStart - 1;
-        const bool bRemoveEmptyPresObj = pBookmarkDoc &&
-                (pBookmarkDoc->GetDocumentType() == DOCUMENT_TYPE_IMPRESS) &&
-                (GetDocumentType() == DOCUMENT_TYPE_DRAW);
-
-        if( bReplace )
-        {
-            nSdPageEnd = nSdPageStart + nReplacedStandardPages - 1;
-        }
-
-        for (sal_uInt16 nSdPage = nSdPageStart; nSdPage <= nSdPageEnd; nSdPage++)
-        {
-            pRefPage = GetSdPage(nSdPage, PK_STANDARD);
-
-            if (pExchangeList)
-            {
-                // Zuverwendener Name aus Exchange-Liste holen
-                if (pExchangeList->GetCurObject())
-                {
-                    String aExchangeName (*(String*) pExchangeList->GetCurObject());
-                    pRefPage->SetName(aExchangeName);
-                    SdrHint aHint(HINT_PAGEORDERCHG);
-                    aHint.SetPage(pRefPage);
-                    Broadcast(aHint);
-                    SdPage* pNewNotesPage = GetSdPage(nSdPage, PK_NOTES);
-                    pNewNotesPage->SetName(aExchangeName);
-                    aHint.SetPage(pNewNotesPage);
-                    Broadcast(aHint);
-                }
-
-                pExchangeList->Next();
-            }
-
-            String aLayout(pRefPage->GetLayoutName());
-            aLayout.Erase(aLayout.SearchAscii( SD_LT_SEPARATOR ));
-
-            // update layout and referred master page
-            pRefPage->SetPresentationLayout(aLayout);
-            if( bUndo )
-                AddUndo( GetSdrUndoFactory().CreateUndoPageChangeMasterPage( *pRefPage ) );
-
-            if (bScaleObjects)
-            {
-                Rectangle aBorderRect(nLeft, nUpper, nRight, nLower);
-                pRefPage->ScaleObjects(aSize, aBorderRect, sal_True);
-            }
-            pRefPage->SetSize(aSize);
-            pRefPage->SetBorder(nLeft, nUpper, nRight, nLower);
-            pRefPage->SetOrientation( eOrient );
-
-            if( bRemoveEmptyPresObj )
-                pRefPage->RemoveEmptyPresentationObjects();
-
-            pRefPage = GetSdPage(nSdPage, PK_NOTES);
-
-            // update layout and referred master page
-            pRefPage->SetPresentationLayout(aLayout);
-            if( bUndo )
-                AddUndo( GetSdrUndoFactory().CreateUndoPageChangeMasterPage( *pRefPage ) );
-
-            if (bScaleObjects)
-            {
-                Rectangle aBorderRect(nNLeft, nNUpper, nNRight, nNLower);
-                pRefPage->ScaleObjects(aNSize, aBorderRect, sal_True);
-            }
-
-            pRefPage->SetSize(aNSize);
-            pRefPage->SetBorder(nNLeft, nNUpper, nNRight, nNLower);
-            pRefPage->SetOrientation( eNOrient );
-
-            if( bRemoveEmptyPresObj )
-                pRefPage->RemoveEmptyPresentationObjects();
-        }
-
-        for (sal_uInt16 nPage = nMPageCount; nPage < nNewMPageCount; nPage++)
-        {
-            pRefPage = (SdPage*) GetMasterPage(nPage);
-            if (pRefPage->GetPageKind() == PK_STANDARD)
-            {
-                if (bScaleObjects)
-                {
-                    Rectangle aBorderRect(nLeft, nUpper, nRight, nLower);
-                    pRefPage->ScaleObjects(aSize, aBorderRect, sal_True);
-                }
-                pRefPage->SetSize(aSize);
-                pRefPage->SetBorder(nLeft, nUpper, nRight, nLower);
-                pRefPage->SetOrientation( eOrient );
-            }
-            else        // kann nur noch NOTES sein
-            {
-                if (bScaleObjects)
-                {
-                    Rectangle aBorderRect(nNLeft, nNUpper, nNRight, nNLower);
-                    pRefPage->ScaleObjects(aNSize, aBorderRect, sal_True);
-                }
-                pRefPage->SetSize(aNSize);
-                pRefPage->SetBorder(nNLeft, nNUpper, nNRight, nNLower);
-                pRefPage->SetOrientation( eNOrient );
-            }
-
-            if( bRemoveEmptyPresObj )
-                pRefPage->RemoveEmptyPresentationObjects();
-        }
-    }
-
-    // Make absolutely sure no double masterpages are there
-    RemoveUnnecessaryMasterPages(NULL, sal_True, sal_True);
-
-    if( bUndo )
-        EndUndo();
-    pUndoMgr->LeaveListAction();
-
-    return bContinue;
-}
-
-sal_Bool SdDrawDocument::InsertBookmarkAsPage(
     const std::vector<rtl::OUString> &rBookmarkList,
     std::vector<rtl::OUString> &rExchangeList,            // Liste der zu verwendenen Namen
     sal_Bool bLink,
@@ -1245,19 +546,19 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
         for (nBMSdPage=0; nBMSdPage < nBMSdPageCount; nBMSdPage++)
         {
             SdPage* pBMPage = pBookmarkDoc->GetSdPage(nBMSdPage, PK_STANDARD);
-            String  pName( pBMPage->GetName() );
+            String  sName( pBMPage->GetName() );
             sal_Bool    bIsMasterPage;
 
             if (bLink)
             {
                 // Es werden sich die Namen aller Seiten gemerkt
-                aNameMap.insert(std::make_pair(nBMSdPage,pName));
+                aNameMap.insert(std::make_pair(nBMSdPage,sName));
             }
 
             // Have to check for duplicate names here, too
             // don't change name if source and dest model are the same!
             if( pBookmarkDoc != this &&
-                GetPageByName(pName, bIsMasterPage ) != SDRPAGE_NOTFOUND )
+                GetPageByName(sName, bIsMasterPage ) != SDRPAGE_NOTFOUND )
             {
                 // delay renaming *after* pages are copied (might destroy source otherwise)
                 aRenameSet.insert(nBMSdPage);
@@ -1628,193 +929,6 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
 \************************************************************************/
 
 sal_Bool SdDrawDocument::InsertBookmarkAsObject(
-    List* pBookmarkList,
-    List* pExchangeList,            // Liste der zu verwendenen Namen
-    sal_Bool /* bLink */,
-    ::sd::DrawDocShell* pBookmarkDocSh,
-    Point* pObjPos)
-{
-    sal_Bool bOK = sal_True;
-    sal_Bool bOLEObjFound = sal_False;
-    ::sd::View* pBMView = NULL;
-
-    SdDrawDocument* pBookmarkDoc = NULL;
-    String aBookmarkName;
-
-    if (pBookmarkDocSh)
-    {
-        pBookmarkDoc = pBookmarkDocSh->GetDoc();
-
-        if (pBookmarkDocSh->GetMedium())
-        {
-            aBookmarkName = pBookmarkDocSh->GetMedium()->GetName();
-        }
-    }
-    else if ( mxBookmarkDocShRef.Is() )
-    {
-        pBookmarkDoc = mxBookmarkDocShRef->GetDoc();
-        aBookmarkName = maBookmarkFile;
-    }
-    else
-    {
-        return sal_False;
-    }
-
-    if (!pBookmarkList)
-    {
-        pBMView = new ::sd::View(*pBookmarkDoc, (OutputDevice*) NULL);
-        pBMView->EndListening(*pBookmarkDoc);
-        pBMView->MarkAll();
-    }
-    else
-    {
-        SdrPage* pPage;
-        SdrPageView* pPV;
-
-        for (sal_uInt16 nPos = 0; nPos < pBookmarkList->Count(); nPos++)
-        {
-            /******************************************************************
-            * Namen der Bookmarks aus Liste holen
-            ******************************************************************/
-            String aBMName (*(String*) pBookmarkList->GetObject(nPos));
-
-            SdrObject* pObj = pBookmarkDoc->GetObj(aBMName);
-
-            if (pObj)
-            {
-                // Objekt gefunden
-
-                if (pObj->GetObjInventor() == SdrInventor &&
-                    pObj->GetObjIdentifier() == OBJ_OLE2)
-                {
-                    bOLEObjFound = sal_True;
-                }
-
-                if (!pBMView)
-                {
-                    // View erstmalig erzeugen
-                    pBMView = new ::sd::View(*pBookmarkDoc, (OutputDevice*) NULL);
-                    pBMView->EndListening(*pBookmarkDoc);
-                }
-
-                pPage = pObj->GetPage();
-
-                if (pPage->IsMasterPage())
-                {
-                    pPV = pBMView->ShowSdrPage(pBMView->GetModel()->GetMasterPage(pPage->GetPageNum()));
-                }
-                else
-                {
-                    pPV = pBMView->GetSdrPageView();
-                    if( !pPV || (pPV->GetPage() != pPage))
-                        pPV = pBMView->ShowSdrPage(pPage);
-                }
-
-                pBMView->MarkObj(pObj, pPV, sal_False);
-            }
-        }
-    }
-
-    if (pBMView)
-    {
-        /**********************************************************************
-        * Selektierte Objekte einfuegen
-        **********************************************************************/
-        ::sd::View* pView = new ::sd::View(*this, (OutputDevice*) NULL);
-        pView->EndListening(*this);
-
-        // Seite bestimmen, auf der die Objekte eingefuegt werden sollen
-        SdrPage* pPage = GetSdPage(0, PK_STANDARD);
-
-        if (mpDocSh)
-        {
-            ::sd::ViewShell* pViewSh = mpDocSh->GetViewShell();
-
-            if (pViewSh)
-            {
-                // Welche Seite wird denn aktuell angezeigt?
-                SdrPageView* pPV = pViewSh->GetView()->GetSdrPageView();
-
-                if (pPV)
-                {
-                    pPage = pPV->GetPage();
-                }
-                else if (pViewSh->GetActualPage())
-                {
-                    pPage = pViewSh->GetActualPage();
-                }
-            }
-        }
-
-        Point aObjPos;
-
-        if (pObjPos)
-        {
-            aObjPos = *pObjPos;
-        }
-        else
-        {
-            aObjPos = Rectangle(Point(), pPage->GetSize()).Center();
-        }
-
-        sal_uLong nCountBefore = 0;
-
-        if (pExchangeList)
-        {
-            // OrdNums sortieren und Anzahl Objekte vor dem Einfuegen bestimmen
-            pPage->RecalcObjOrdNums();
-            nCountBefore = pPage->GetObjCount();
-        }
-
-        if (bOLEObjFound)
-            pBMView->GetDoc().SetAllocDocSh(sal_True);
-
-        SdDrawDocument* pTmpDoc = (SdDrawDocument*) pBMView->GetAllMarkedModel();
-        bOK = pView->Paste(*pTmpDoc, aObjPos, pPage);
-
-        if (bOLEObjFound)
-            pBMView->GetDoc().SetAllocDocSh(sal_False);
-
-        if (!bOLEObjFound)
-            delete pTmpDoc;             // Wird ansonsten von der DocShell zerstoert
-
-        delete pView;
-
-        if (pExchangeList)
-        {
-            // Anzahl Objekte nach dem Einfuegen bestimmen
-            sal_uLong nCount = pPage->GetObjCount();
-
-            for (sal_uLong nObj = nCountBefore; nObj < nCount; nObj++)
-            {
-                // Zuverwendener Name aus Exchange-Liste holen
-                if (pExchangeList->GetCurObject())
-                {
-                    String aExchangeName (*(String*) pExchangeList->GetCurObject());
-
-                    if (pPage->GetObj(nObj))
-                    {
-                        pPage->GetObj(nObj)->SetName(aExchangeName);
-                    }
-                }
-
-                pExchangeList->Next();
-            }
-        }
-    }
-
-    delete pBMView;
-
-    return bOK;
-}
-
-/*************************************************************************
-|*
-|* Fuegt ein Bookmark als Objekt ein
-|*
-\************************************************************************/
-
-sal_Bool SdDrawDocument::InsertBookmarkAsObject(
     const std::vector<rtl::OUString> &rBookmarkList,
     std::vector<rtl::OUString> &rExchangeList,            // Liste der zu verwendenen Namen
     sal_Bool /* bLink */,
diff --git a/sd/source/ui/dlg/inspagob.cxx b/sd/source/ui/dlg/inspagob.cxx
index f9770fd..90e41a9 100644
--- a/sd/source/ui/dlg/inspagob.cxx
+++ b/sd/source/ui/dlg/inspagob.cxx
@@ -115,33 +115,6 @@ void SdInsertPagesObjsDlg::Reset()
     aCbxMasters.Check( sal_True );
 }
 
-/*************************************************************************
-|*
-|*  Liefert die Liste zurueck
-|*  nType == 0 -> Seiten
-|*  nType == 1 -> Objekte
-|*
-\************************************************************************/
-
-List* SdInsertPagesObjsDlg::GetList( sal_uInt16 nType )
-{
-    // 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( NULL );
-    }
-    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
diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx
index 9837d70..fb08787 100644
--- a/sd/source/ui/dlg/sddlgfact.cxx
+++ b/sd/source/ui/dlg/sddlgfact.cxx
@@ -282,10 +282,6 @@ sal_Bool AbstractSdInsertPasteDlg_Impl::IsInsertBefore() const
 {
     return (::Window*)pDlg;
 }
-List* AbstractSdInsertPagesObjsDlg_Impl::GetList( sal_uInt16 nType )
-{
-    return pDlg->GetList( nType );
-}
 
 void AbstractSdInsertPagesObjsDlg_Impl::GetList (const sal_uInt16 nType, std::vector<rtl::OUString> &rEntries)
 {
diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx
index db5c9c9..34d9a6c 100644
--- a/sd/source/ui/dlg/sddlgfact.hxx
+++ b/sd/source/ui/dlg/sddlgfact.hxx
@@ -187,7 +187,6 @@ class AbstractSdInsertPagesObjsDlg_Impl : public AbstractSdInsertPagesObjsDlg
 {
     DECL_ABSTDLG_BASE(AbstractSdInsertPagesObjsDlg_Impl,SdInsertPagesObjsDlg)
     virtual ::Window *  GetWindow(); //this method is added for return a Window type pointer
-    virtual List*       GetList( sal_uInt16 nType );
     virtual void GetList ( const sal_uInt16 nType, std::vector<rtl::OUString> &rEntries);
     virtual sal_Bool        IsLink();
     virtual sal_Bool        IsRemoveUnnessesaryMasterPages() const;
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 492c44c..f44032d 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -663,36 +663,6 @@ String SdPageObjsTLB::GetSelectEntry()
     return( GetEntryText( GetCurEntry() ) );
 }
 
-/*************************************************************************
-|*
-|* Selektierte Eintrage zurueckgeben
-|* nDepth == 0 -> Seiten
-|* nDepth == 1 -> Objekte
-|*
-\************************************************************************/
-
-List* SdPageObjsTLB::GetSelectEntryList( sal_uInt16 nDepth )
-{
-    List*        pList  = NULL;
-    SvLBoxEntry* pEntry = FirstSelected();
-
-    while( pEntry )
-    {
-        sal_uInt16 nListDepth = GetModel()->GetDepth( pEntry );
-        if( nListDepth == nDepth )
-        {
-            if( !pList )
-                pList = new List();
-
-            const String aEntryText( GetEntryText( pEntry ) );
-            pList->Insert( new String( aEntryText ), LIST_APPEND );
-        }
-        pEntry = NextSelected( pEntry );
-    }
-
-    return( pList );
-}
-
 void SdPageObjsTLB::GetSelectEntryList( sal_uInt16 nDepth, std::vector<rtl::OUString> &rEntries ) const
 {
     SvLBoxEntry* pEntry = FirstSelected();
diff --git a/sd/source/ui/inc/inspagob.hxx b/sd/source/ui/inc/inspagob.hxx
index c6d2f49..deea96c 100644
--- a/sd/source/ui/inc/inspagob.hxx
+++ b/sd/source/ui/inc/inspagob.hxx
@@ -61,8 +61,6 @@ public:
                                 const String& rFileName );
                 ~SdInsertPagesObjsDlg();
 
-    List*       GetList( sal_uInt16 nType );
-
     /*************************************************************************
     |*
     |*  Liefert die Liste zurueck
diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx
index 509fbbd..5a26745 100644
--- a/sd/source/ui/inc/sdtreelb.hxx
+++ b/sd/source/ui/inc/sdtreelb.hxx
@@ -206,7 +206,6 @@ public:
     sal_Bool                    HasSelectedChildren( const String& rName );
     sal_Bool                    SelectEntry( const String& rName );
     String                  GetSelectEntry();
-    List*                   GetSelectEntryList( sal_uInt16 nDepth );
 
     /*************************************************************************
     |*
diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx
index 4e192e6..fc366db 100644
--- a/sd/source/ui/view/sdview2.cxx
+++ b/sd/source/ui/view/sdview2.cxx
@@ -919,79 +919,6 @@ IMPL_LINK( View, ExecuteNavigatorDrop, SdNavigatorDropEvent*, pSdNavigatorDropEv
 |*
 \************************************************************************/
 
-sal_Bool View::GetExchangeList( List*& rpExchangeList, List* pBookmarkList, sal_uInt16 nType )
-{
-    DBG_ASSERT( !rpExchangeList, "ExchangeList muss NULL sein!");
-
-    sal_Bool bListIdentical = sal_True; // BookmarkList und ExchangeList sind gleich
-    sal_Bool bNameOK = sal_True;        // Name ist eindeutig
-
-    rpExchangeList = new List();
-
-    if( pBookmarkList )
-    {
-        String* pString = (String*) pBookmarkList->First();
-
-        while( pString && bNameOK )
-        {
-            String* pNewName = new String( *pString );
-
-            if( nType == 0  || nType == 2 )
-                bNameOK = mpDocSh->CheckPageName (
-                    mpViewSh->GetActiveWindow(), *pNewName);
-
-            if( bNameOK && ( nType == 1  || nType == 2 ) )
-            {
-                if( mrDoc.GetObj( *pNewName ) )
-                {
-                    String          aTitle( SdResId( STR_TITLE_NAMEGROUP ) );
-                    String          aDesc( SdResId( STR_DESC_NAMEGROUP ) );
-                    SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-                    AbstractSvxNameDialog* pDlg = pFact ? pFact->CreateSvxNameDialog( mpViewSh->GetActiveWindow(), *pNewName, aDesc ) : 0;
-                    if( pDlg )
-                    {
-                        pDlg->SetEditHelpId( HID_SD_NAMEDIALOG_OBJECT );
-
-                        bNameOK = sal_False;
-                        pDlg->SetText( aTitle );
-
-                        while( !bNameOK && pDlg->Execute() == RET_OK )
-                        {
-                            pDlg->GetName( *pNewName );
-
-                            if( !mrDoc.GetObj( *pNewName ) )
-                                bNameOK = sal_True;
-                        }
-
-                        delete pDlg;
-                    }
-                }
-            }
-
-            if( bListIdentical )
-                bListIdentical = ( *pString == *pNewName );
-
-            rpExchangeList->Insert( pNewName, LIST_APPEND );
-            pString = (String*) pBookmarkList->Next();
-        }
-    }
-
-    // ExchangeList ist mit BookmarkList identisch
-    if( rpExchangeList && bListIdentical )
-    {
-        String* pString = (String*) rpExchangeList->First();
-        while( pString )
-        {
-            delete pString;
-            pString = (String*) rpExchangeList->Next();
-        }
-        delete rpExchangeList;
-        rpExchangeList = NULL;
-    }
-
-    return( bNameOK );
-}
-
 bool View::GetExchangeList (std::vector<rtl::OUString> &rExchangeList,
                             std::vector<rtl::OUString> &rBookmarkList,
                             const sal_uInt16 nType)
commit 236ebc083a3b69e140b01e7688e4650cb7d19c6f
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Sun Apr 1 08:22:34 2012 -0430

    Replace deprecated List for std::vector<rtl::OUString>.

diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx
index a30d114..4e192e6 100644
--- a/sd/source/ui/view/sdview2.cxx
+++ b/sd/source/ui/view/sdview2.cxx
@@ -861,8 +861,7 @@ IMPL_LINK( View, ExecuteNavigatorDrop, SdNavigatorDropEvent*, pSdNavigatorDropEv
     if( pPageObjsTransferable && aDataHelper.GetINetBookmark( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK, aINetBookmark ) )
     {
         Point   aPos;
-        List    aBookmarkList;
-        String  aBookmark;
+        rtl::OUString  aBookmark;
         SdPage* pPage = (SdPage*) GetSdrPageView()->GetPage();
         sal_uInt16  nPgPos = 0xFFFF;
 
@@ -873,7 +872,9 @@ IMPL_LINK( View, ExecuteNavigatorDrop, SdNavigatorDropEvent*, pSdNavigatorDropEv
         sal_Int32 nIndex = aURL.indexOf( (sal_Unicode)'#' );
         if( nIndex != -1 )
             aBookmark = aURL.copy( nIndex+1 );
-        aBookmarkList.Insert( &aBookmark );
+
+        std::vector<rtl::OUString> aExchangeList;
+        std::vector<rtl::OUString> aBookmarkList(1,aBookmark);
 
         if( !pPage->IsMasterPage() )
         {
@@ -886,9 +887,8 @@ IMPL_LINK( View, ExecuteNavigatorDrop, SdNavigatorDropEvent*, pSdNavigatorDropEv
         // Um zu gewaehrleisten, dass alle Seitennamen eindeutig sind, werden
         // die einzufuegenden geprueft und gegebenenfalls in einer Ersatzliste
         // aufgenommen (bNameOK == sal_False -> Benutzer hat abgebrochen)
-        List*   pExchangeList = NULL;
         sal_Bool    bLink = ( NAVIGATOR_DRAGTYPE_LINK == pPageObjsTransferable->GetDragType()  ? sal_True : sal_False );
-        sal_Bool    bNameOK = GetExchangeList( pExchangeList, &aBookmarkList, 2 );
+        sal_Bool    bNameOK = GetExchangeList( aExchangeList, aBookmarkList, 2 );
         sal_Bool    bReplace = sal_False;
 
         // Da man hier nicht weiss, ob es sich um eine Seite oder ein Objekt handelt,
@@ -896,20 +896,11 @@ IMPL_LINK( View, ExecuteNavigatorDrop, SdNavigatorDropEvent*, pSdNavigatorDropEv
         // Sollten Seitennamen und Objektnamen identisch sein gibt es hier natuerlich Probleme !!!
         if( bNameOK )
         {
-            mrDoc.InsertBookmark( &aBookmarkList, pExchangeList,
+            mrDoc.InsertBookmark( aBookmarkList, aExchangeList,
                                   bLink, bReplace, nPgPos, sal_False,
                                   &pPageObjsTransferable->GetDocShell(),
                                   sal_True, &aPos );
         }
-
-        // Delete the ExchangeList
-        if( pExchangeList )
-        {
-            for( void* p = pExchangeList->First(); p; p = pExchangeList->Next() )
-                delete (String*) p;
-
-            delete pExchangeList;
-        }
     }
 
     delete pSdNavigatorDropEvent;
commit c29542818295388db23652ec5a1c982496f66010
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Wed Mar 28 20:51:06 2012 -0430

    Remove deprecated List in ViewClipboard::InsertSlides.

diff --git a/sd/source/ui/view/ViewClipboard.cxx b/sd/source/ui/view/ViewClipboard.cxx
index d8cd5b2..2470adb 100644
--- a/sd/source/ui/view/ViewClipboard.cxx
+++ b/sd/source/ui/view/ViewClipboard.cxx
@@ -216,7 +216,7 @@ sal_uInt16 ViewClipboard::InsertSlides (
     sal_Bool bMergeMasterPages = !rTransferable.HasSourceDoc( &rDoc );
 
     // Prepare the insertion.
-    const List* pBookmarkList;
+    const std::vector<rtl::OUString> *pBookmarkList = NULL;
     DrawDocShell* pDataDocSh;
     if (rTransferable.HasPageBookmarks())
     {
@@ -224,7 +224,7 @@ sal_uInt16 ViewClipboard::InsertSlides (
         // pages are inserted.
         pBookmarkList = &rTransferable.GetPageBookmarks();
         pDataDocSh = rTransferable.GetPageDocShell();
-        nInsertPgCnt = (sal_uInt16)pBookmarkList->Count();
+        nInsertPgCnt = (sal_uInt16)pBookmarkList->size();
     }
     else
     {
@@ -233,7 +233,7 @@ sal_uInt16 ViewClipboard::InsertSlides (
         SfxObjectShell* pShell = rTransferable.GetDocShell();
         pDataDocSh = (DrawDocShell*) pShell;
         SdDrawDocument* pDataDoc = pDataDocSh->GetDoc();
-        pBookmarkList = NULL;
+
         if (pDataDoc!=NULL && pDataDoc->GetSdPageCount(PK_STANDARD))
             nInsertPgCnt = pDataDoc->GetSdPageCount(PK_STANDARD);
     }
@@ -246,9 +246,10 @@ sal_uInt16 ViewClipboard::InsertSlides (
         if( bWait )
             pWin->LeaveWait();
 
+        std::vector<rtl::OUString> aExchangeList;
         rDoc.InsertBookmarkAsPage(
-            const_cast<List*>(pBookmarkList),
-            NULL,
+            *pBookmarkList,
+            aExchangeList,
             sal_False,
             sal_False,
             nInsertPosition,
commit 8adf70b289476eb5c204d3f1e9cbcb259e019194
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Wed Mar 28 19:58:26 2012 -0430

    Remove deprecated List for vector in ViewClipboard::GetFirstMasterPage.

diff --git a/sd/source/ui/view/ViewClipboard.cxx b/sd/source/ui/view/ViewClipboard.cxx
index d535122..d8cd5b2 100644
--- a/sd/source/ui/view/ViewClipboard.cxx
+++ b/sd/source/ui/view/ViewClipboard.cxx
@@ -83,8 +83,9 @@ SdPage* ViewClipboard::GetFirstMasterPage (const SdTransferable& rTransferable)
     {
         do
         {
-            const List* pBookmarks = &rTransferable.GetPageBookmarks();
-            if (pBookmarks == NULL)
+            const std::vector<rtl::OUString> &rBookmarks = rTransferable.GetPageBookmarks();
+
+            if (rBookmarks.empty())
                 break;
 
             DrawDocShell* pDocShell = rTransferable.GetPageDocShell();
@@ -95,13 +96,10 @@ SdPage* ViewClipboard::GetFirstMasterPage (const SdTransferable& rTransferable)
             if (pDocument == NULL)
                 break;
 
-            if (pBookmarks->Count() <= 0)
-                break;
-
-            int nBookmarkCount = pBookmarks->Count();
-            for (int nIndex=0; nIndex<nBookmarkCount; nIndex++)
+            std::vector<rtl::OUString>::const_iterator pIter;
+            for ( pIter = rBookmarks.begin(); pIter != rBookmarks.end(); ++pIter )
             {
-                String sName (*(String*) pBookmarks->GetObject(nIndex));
+                String sName (*pIter);
                 sal_Bool bIsMasterPage;
 
                 // SdPage* GetMasterSdPage(sal_uInt16 nPgNum, PageKind ePgKind);
commit 5e0be5bd29ae0e592313de96df7b635549cf4e6c
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Wed Mar 28 19:54:56 2012 -0430

    Call size instead of count.

diff --git a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx
index b7d18c5..6bde044 100644
--- a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx
+++ b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx
@@ -110,7 +110,7 @@ void InsertionIndicatorOverlay::Create (const controller::Transferable* pTransfe
 
     sal_Int32 nSelectionCount (0);
     if (pTransferable->HasPageBookmarks())
-        nSelectionCount = pTransferable->GetPageBookmarks().Count();
+        nSelectionCount = pTransferable->GetPageBookmarks().size();
     else
     {
         DrawDocShell* pDataDocShell = dynamic_cast<DrawDocShell*>(&pTransferable->GetDocShell());
commit a35bc3a35701a55234b51c2c3bc04e7c0a1553b1
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Wed Mar 28 19:46:11 2012 -0430

    Remove deprecated List usage in Clipboard::CreateSlideTransferable.

diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
index 0369462..afdf133 100644
--- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
@@ -424,7 +424,7 @@ void Clipboard::CreateSlideTransferable (
     ::Window* pWindow,
     bool bDrag)
 {
-    List aBookmarkList;
+    std::vector<rtl::OUString> aBookmarkList;
 
     // Insert all selected pages into a bookmark list and remember them in
     // maPagesToRemove for possible later removal.
@@ -434,9 +434,7 @@ void Clipboard::CreateSlideTransferable (
     while (aSelectedPages.HasMoreElements())
     {
         model::SharedPageDescriptor pDescriptor (aSelectedPages.GetNextElement());
-        aBookmarkList.Insert (
-            new String(pDescriptor->GetPage()->GetName()),
-            LIST_APPEND);
+        aBookmarkList.push_back(pDescriptor->GetPage()->GetName());
         maPagesToRemove.push_back (pDescriptor->GetPage());
     }
 
@@ -461,7 +459,7 @@ void Clipboard::CreateSlideTransferable (
             break;
     }
 
-    if (aBookmarkList.Count() > 0)
+    if (!aBookmarkList.empty())
     {
         mrSlideSorter.GetView().BrkAction();
         SdDrawDocument* pDocument = mrSlideSorter.GetModel().GetDocument();
@@ -505,16 +503,13 @@ void Clipboard::CreateSlideTransferable (
             pTransferable->SetPageBookmarks (aBookmarkList, !bDrag);
         }
 
-        for (void* p=aBookmarkList.First(); p!=NULL; p=aBookmarkList.Next())
-            delete static_cast<String*>(p);
-
         if (bDrag)
         {
             pTransferable->SetView (&mrSlideSorter.GetView());
             sal_Int8 nDragSourceActions (DND_ACTION_COPY);
             // The move action is available only when not all pages would be
             // 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)
                 nDragSourceActions |= DND_ACTION_MOVE;
             pTransferable->StartDrag (pActionWindow, nDragSourceActions);
commit cb5d50619dea504c149d7c54918fad974896f4c9
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Wed Mar 28 19:43:00 2012 -0430

    Remove deprecated List usage in Clipboard::PasteTransferable.

diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
index f7f7922..0369462 100644
--- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
@@ -344,13 +344,14 @@ sal_Int32 Clipboard::PasteTransferable (sal_Int32 nInsertPosition)
     sal_Int32 nInsertPageCount (0);
     if (pClipTransferable->HasPageBookmarks())
     {
-        const List& rBookmarkList = pClipTransferable->GetPageBookmarks();
+        std::vector<rtl::OUString> aExchangeList;
+        const std::vector<rtl::OUString> &rBookmarkList = pClipTransferable->GetPageBookmarks();
         const SolarMutexGuard aGuard;
 
-        nInsertPageCount = (sal_uInt16) rBookmarkList.Count();
+        nInsertPageCount = (sal_uInt16) rBookmarkList.size();
         rModel.GetDocument()->InsertBookmarkAsPage(
-            const_cast<List*>(&rBookmarkList),
-            NULL,
+            rBookmarkList,
+            aExchangeList,
             sal_False,
             sal_False,
             nInsertIndex,
@@ -369,13 +370,14 @@ sal_Int32 Clipboard::PasteTransferable (sal_Int32 nInsertPosition)
         if (pDataDoc!=NULL
             && pDataDoc->GetSdPageCount(PK_STANDARD))
         {
+            std::vector<rtl::OUString> aBookmarkList, aExchangeList;
             const SolarMutexGuard aGuard;
 
             bMergeMasterPages = (pDataDoc != rModel.GetDocument());
             nInsertPageCount = pDataDoc->GetSdPageCount( PK_STANDARD );
             rModel.GetDocument()->InsertBookmarkAsPage(
-                NULL,
-                NULL,
+                aBookmarkList,
+                aExchangeList,
                 sal_False,
                 sal_False,
                 nInsertIndex,
commit b1b309c970d040a1907fd83030fe09260c386894
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Wed Mar 28 19:38:11 2012 -0430

    Replace deprecated List for vector in SdTransferable.

diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx
index 009a1b4..53c795d 100644
--- a/sd/source/ui/app/sdxfer.cxx
+++ b/sd/source/ui/app/sdxfer.cxx
@@ -142,9 +142,6 @@ SdTransferable::~SdTransferable()
 
     ObjectReleased();
 
-    for( void* p = maPageBookmarks.First(); p; p = maPageBookmarks.Next() )
-        delete static_cast< String* >( p );
-
     if( mbOwnView )
         delete mpSdViewIntern;
 
@@ -712,7 +709,7 @@ void SdTransferable::SetObjectDescriptor( const TransferableObjectDescriptor& rO
 
 // -----------------------------------------------------------------------------
 
-void SdTransferable::SetPageBookmarks( const List& rPageBookmarks, sal_Bool bPersistent )
+void SdTransferable::SetPageBookmarks( const std::vector<rtl::OUString> &rPageBookmarks, sal_Bool bPersistent )
 {
     if( mpSourceDoc )
     {
@@ -723,20 +720,19 @@ void SdTransferable::SetPageBookmarks( const List& rPageBookmarks, sal_Bool bPer
 
         mpPageDocShell = NULL;
 
-        for( void* p = maPageBookmarks.First(); p; p = maPageBookmarks.Next() )
-            delete static_cast< String* >( p );
+        maPageBookmarks.clear();
 
         if( bPersistent )
         {
+            std::vector<rtl::OUString> aExchangeList;
             mpSdDrawDocument->CreateFirstPages(mpSourceDoc);
-            mpSdDrawDocument->InsertBookmarkAsPage( const_cast< List* >( &rPageBookmarks ), NULL, sal_False, sal_True, 1, sal_True, mpSourceDoc->GetDocSh(), sal_True, sal_True, sal_False );
+            mpSdDrawDocument->InsertBookmarkAsPage( rPageBookmarks, aExchangeList, sal_False, sal_True, 1, sal_True,
+                                                    mpSourceDoc->GetDocSh(), sal_True, sal_True, sal_False );
         }
         else
         {
             mpPageDocShell = mpSourceDoc->GetDocSh();
-
-            for( sal_uLong i = 0; i < rPageBookmarks.Count(); i++ )
-                maPageBookmarks.Insert( new String( *static_cast< String* >( rPageBookmarks.GetObject( i ) ) ), LIST_APPEND );
+            maPageBookmarks = rPageBookmarks;
         }
 
         if( mpSdViewIntern && mpSdDrawDocument )
diff --git a/sd/source/ui/inc/sdxfer.hxx b/sd/source/ui/inc/sdxfer.hxx
index fdd2c94..82f231f 100644
--- a/sd/source/ui/inc/sdxfer.hxx
+++ b/sd/source/ui/inc/sdxfer.hxx
@@ -76,10 +76,10 @@ public:
 
     sal_Bool                            HasSourceDoc( const SdDrawDocument* pDoc ) const { return( mpSourceDoc == pDoc ); }
 
-    void                            SetPageBookmarks( const List& rPageBookmarks, sal_Bool bPersistent );
+    void                            SetPageBookmarks( const std::vector<rtl::OUString>& rPageBookmarks, sal_Bool bPersistent );
     sal_Bool                            IsPageTransferable() const { return mbPageTransferable; }
-    sal_Bool                            HasPageBookmarks() const { return( mpPageDocShell && ( maPageBookmarks.Count() > 0 ) ); }
-    const List&                     GetPageBookmarks() const { return maPageBookmarks; }
+    sal_Bool                            HasPageBookmarks() const { return( mpPageDocShell && ( !maPageBookmarks.empty() ) ); }
+    const std::vector<rtl::OUString>& GetPageBookmarks() const { return maPageBookmarks; }
     ::sd::DrawDocShell*                 GetPageDocShell() const { return mpPageDocShell; }
 
     sal_Bool                        SetTableRTF( SdDrawDocument*, const ::com::sun::star::datatransfer::DataFlavor& );
@@ -104,7 +104,7 @@ private:
 
     SfxObjectShellRef               maDocShellRef;
     ::sd::DrawDocShell*             mpPageDocShell;
-    List                            maPageBookmarks;
+    std::vector<rtl::OUString>      maPageBookmarks;
     TransferableDataHelper*         mpOLEDataHelper;
     TransferableObjectDescriptor*   mpObjDesc;
     const ::sd::View*               mpSdView;
commit 77f8397f989785d2623cfffc63a584bd3af894d6
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Tue Mar 27 21:35:48 2012 -0430

    Overload SdDrawDocument::InsertBookmark to use vector instead of List.

diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
index b1a3e6a..fb6af15 100644
--- a/sd/inc/drawdoc.hxx
+++ b/sd/inc/drawdoc.hxx
@@ -273,6 +273,12 @@ public:
                                         ::sd::DrawDocShell* pBookmarkDocSh, sal_Bool bCopy,
                                         Point* pObjPos);
 
+    sal_Bool InsertBookmark(const std::vector<rtl::OUString> &rBookmarkList,
+                            std::vector<rtl::OUString> &rExchangeList, sal_Bool bLink,
+                            sal_Bool bReplace, sal_uInt16 nPgPos, sal_Bool bNoDialogs,
+                            ::sd::DrawDocShell* pBookmarkDocSh, sal_Bool bCopy,
+                            Point* pObjPos);
+
     bool IsStartWithPresentation() const;
     void SetStartWithPresentation( bool bStartWithPresentation );
 
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 9db7af0..d75ef20 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -437,6 +437,81 @@ sal_Bool SdDrawDocument::InsertBookmark(
     return bOK;
 }
 
+sal_Bool SdDrawDocument::InsertBookmark(
+    const std::vector<rtl::OUString> &rBookmarkList,    // Liste der Namen der einzufuegenden Bookmarks
+    std::vector<rtl::OUString> &rExchangeList,          // Liste der zu verwendenen Namen
+    sal_Bool bLink,                                     // Bookmarks sollen als Verknuepfung eingefuegt werden
+    sal_Bool bReplace,                                  // Aktuellen Seiten (Standard&Notiz) werden ersetzt
+    sal_uInt16 nInsertPos,                              // Einfuegeposition fuer Seiten
+    sal_Bool bNoDialogs,                                // Keine Dialoge anzeigen
+    ::sd::DrawDocShell* pBookmarkDocSh,                 // Wenn gesetzt, so ist dieses das Source-Dokument
+    sal_Bool bCopy,                                     // Seiten werden kopiert
+    Point* pObjPos)                                     // Einfuegeposition fuer Objekte
+{
+    sal_Bool bOK = sal_True;
+    sal_Bool bInsertPages = sal_False;
+
+    if (rBookmarkList.empty())
+    {
+        /**********************************************************************
+        * Alle Seiten werden eingefuegt
+        **********************************************************************/
+        bInsertPages = sal_True;
+    }
+    else
+    {
+        SdDrawDocument* pBookmarkDoc = NULL;
+        String aBookmarkName;
+
+        if (pBookmarkDocSh)
+        {
+            pBookmarkDoc = pBookmarkDocSh->GetDoc();
+            aBookmarkName = pBookmarkDocSh->GetMedium()->GetName();
+        }
+        else if ( mxBookmarkDocShRef.Is() )
+        {
+            pBookmarkDoc = mxBookmarkDocShRef->GetDoc();
+            aBookmarkName = maBookmarkFile;
+        }
+        else
+            bOK = sal_False;
+
+        std::vector<rtl::OUString>::const_iterator pIter;
+        for ( pIter = rBookmarkList.begin(); bOK && pIter != rBookmarkList.end() && !bInsertPages; ++pIter )
+        {
+            /******************************************************************
+            * Gibt es in der Bookmark-Liste einen Seitennamen?
+            ******************************************************************/
+            String  aBMPgName(*pIter);
+            sal_Bool    bIsMasterPage;
+
+            if( pBookmarkDoc->GetPageByName( aBMPgName, bIsMasterPage ) != SDRPAGE_NOTFOUND )
+            {
+                // Seite gefunden
+                bInsertPages = sal_True;
+            }
+        }
+    }
+
+    sal_Bool bCalcObjCount = !rExchangeList.empty();
+
+    if ( bOK && bInsertPages )
+    {
+        // Zuerst werden alle Seiten-Bookmarks eingefuegt
+        bOK = InsertBookmarkAsPage(rBookmarkList, rExchangeList, bLink, bReplace,
+                                   nInsertPos, bNoDialogs, pBookmarkDocSh, bCopy, sal_True, sal_False);
+    }
+
+    if ( bOK && !rBookmarkList.empty() )
+    {
+        // Es werden alle Objekt-Bookmarks eingefuegt
+        bOK = InsertBookmarkAsObject(rBookmarkList, rExchangeList, bLink,
+                                     pBookmarkDocSh, pObjPos, bCalcObjCount);
+    }
+
+    return bOK;
+}
+
 sal_Bool SdDrawDocument::InsertBookmarkAsPage(
     List* pBookmarkList,
     List* pExchangeList,            // Liste der zu verwendenen Namen
commit 6a0ca287e99a4f7262294c57b9bea0c5968edb41
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Tue Mar 27 20:52:02 2012 -0430

    Replace deprecated List class for std::vector<rtl::OUString>.

diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx
index 96ecec2..bc9d9dd 100644
--- a/sd/source/ui/func/fuinsfil.cxx
+++ b/sd/source/ui/func/fuinsfil.cxx
@@ -334,9 +334,6 @@ sal_Bool FuInsertFile::InsSDDinDrMode(SfxMedium* pMedium)
 {
     sal_Bool bOK = sal_False;
 
-    // Liste mit Seitennamen (wenn NULL, dann alle Seiten)
-    List* pBookmarkList = NULL;
-
     mpDocSh->SetWaitCursor( sal_False );
     SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
     AbstractSdInsertPagesObjsDlg* pDlg = pFact ? pFact->CreateSdInsertPagesObjsDlg( NULL, mpDoc, pMedium, aFile ) : 0;
@@ -357,8 +354,10 @@ sal_Bool FuInsertFile::InsSDDinDrMode(SfxMedium* pMedium)
 
     if( nRet == RET_OK )
     {
+        std::vector<rtl::OUString> aBookmarkList;       // Liste mit Seitennamen (wenn NULL, dann alle Seiten)
+
         // Zuerst Seiten einfuegen
-        pBookmarkList = pDlg->GetList( 1 ); // Seiten
+        pDlg->GetList( 1, aBookmarkList ); // Seiten
         sal_Bool bLink = pDlg->IsLink();
         sal_Bool bReplace = sal_False;
         SdPage* pPage = NULL;
@@ -388,84 +387,35 @@ sal_Bool FuInsertFile::InsSDDinDrMode(SfxMedium* pMedium)
         }
 
         sal_Bool  bNameOK;
-        List* pObjectBookmarkList = pDlg->GetList( 2 ); // Objekte
-        List* pExchangeList = NULL;
+        std::vector<rtl::OUString> aObjectBookmarkList, aExchangeList;
+        pDlg->GetList( 2, aObjectBookmarkList ); // Objekte
 
         // Es werden ausgewaehlte Seiten und/oder ausgewaehlte Objekte oder
         // alles eingefuegt, wenn pBookmarkList NULL ist!
-        if( pBookmarkList || !pObjectBookmarkList )
+        if( !aBookmarkList.empty() || aObjectBookmarkList.empty() )
         {
             // Um zu gewaehrleisten, dass alle Seitennamen eindeutig sind, werden
             // die einzufuegenden geprueft und gegebenenfalls in einer Ersatzliste
             // aufgenommen
             // bNameOK == sal_False -> Benutzer hat abgebrochen
-            bNameOK = mpView->GetExchangeList( pExchangeList, pBookmarkList, 0 );
+            bNameOK = mpView->GetExchangeList( aExchangeList, aBookmarkList, 0 );
 
             if( bNameOK )
-                bOK = mpDoc->InsertBookmarkAsPage( pBookmarkList, pExchangeList,
+                bOK = mpDoc->InsertBookmarkAsPage( aBookmarkList, aExchangeList,
                                     bLink, bReplace, nPos,
                                     sal_False, NULL, sal_True, sal_True, sal_False );
 
-            // delete the BookmarkList
-            if( pBookmarkList )
-            {
-                String* pString = (String*) pBookmarkList->First();
-                while( pString )
-                {
-                    delete pString;
-                    pString = (String*) pBookmarkList->Next();
-                }
-                delete pBookmarkList;
-                pBookmarkList = NULL;
-            }
-            // delete the ExchangeList
-            if( pExchangeList )
-            {
-                String* pString = (String*) pExchangeList->First();
-                while( pString )
-                {
-                    delete pString;
-                    pString = (String*) pExchangeList->Next();
-                }
-                delete pExchangeList;
-                pExchangeList = NULL;
-            }
+            aBookmarkList.clear();
+            aExchangeList.clear();
         }
-        // Dann Objekte einfuegen
-        pBookmarkList = pObjectBookmarkList;
 
         // Um zu gewaehrleisten... (s.o.)
-        bNameOK = mpView->GetExchangeList( pExchangeList, pBookmarkList, 1 );
+        bNameOK = mpView->GetExchangeList( aExchangeList, aObjectBookmarkList, 1 );
 
         if( bNameOK )
-            bOK = mpDoc->InsertBookmarkAsObject( pBookmarkList, pExchangeList,
+            bOK = mpDoc->InsertBookmarkAsObject( aObjectBookmarkList, aExchangeList,
                                 bLink, NULL, NULL);
 
-        // delete the BookmarkList
-        if( pBookmarkList )
-        {
-            String* pString = (String*) pBookmarkList->First();
-            while( pString )
-            {
-                delete pString;
-                pString = (String*) pBookmarkList->Next();
-            }
-            delete pBookmarkList;
-            pBookmarkList = NULL;
-        }
-        // delete the ExchangeList
-        if( pExchangeList )
-        {
-            String* pString = (String*) pExchangeList->First();
-            while( pString )
-            {
-                delete pString;
-                pString = (String*) pExchangeList->Next();
-            }
-            delete pExchangeList;
-            pExchangeList = NULL;
-        }
-
         if( pDlg->IsRemoveUnnessesaryMasterPages() )
             mpDoc->RemoveUnnecessaryMasterPages();
     }
commit 89195fdd25533deda8f371cfa2983ec35c057c98
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Tue Mar 27 20:36:45 2012 -0430

    Replace deprecated List with std::vector<rtl::OUString>.

diff --git a/sd/source/core/pglink.cxx b/sd/source/core/pglink.cxx
index 27ff85e..f40dfdb 100644
--- a/sd/source/core/pglink.cxx
+++ b/sd/source/core/pglink.cxx
@@ -101,8 +101,8 @@ SdPageLink::~SdPageLink()
                 pPage->SetBookmarkName(aBookmarkName);
             }
 
-            List aBookmarkList;
-            aBookmarkList.Insert(&aBookmarkName);
+            std::vector<rtl::OUString> aBookmarkList;
+            aBookmarkList.push_back(aBookmarkName);
             sal_uInt16 nInsertPos = pPage->GetPageNum();
             sal_Bool bLink = sal_True;
             sal_Bool bReplace = sal_True;
@@ -116,7 +116,8 @@ SdPageLink::~SdPageLink()
                 bCopy = sal_True;
             }
 
-            pDoc->InsertBookmarkAsPage(&aBookmarkList, NULL, bLink, bReplace,
+            std::vector<rtl::OUString> aExchangeList;
+            pDoc->InsertBookmarkAsPage(aBookmarkList, aExchangeList, bLink, bReplace,
                                        nInsertPos, bNoDialogs, NULL, bCopy, sal_True, sal_True);
 
             if( !pDoc->pDocLockedInsertingLinks )
commit de47936fb8af9ad052687ac68d56a20820a96fdf
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Tue Mar 27 20:32:02 2012 -0430

    Make some inmutable parameters constant.

diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
index 35816d0..b1a3e6a 100644
--- a/sd/inc/drawdoc.hxx
+++ b/sd/inc/drawdoc.hxx
@@ -373,7 +373,7 @@ public:
         page, or preserve the old name
      */
 
-    sal_Bool InsertBookmarkAsPage(std::vector<rtl::OUString> &rBookmarkList, std::vector<rtl::OUString> &rExchangeList,
+    sal_Bool InsertBookmarkAsPage(const std::vector<rtl::OUString> &rBookmarkList, std::vector<rtl::OUString> &rExchangeList,
                               sal_Bool bLink, sal_Bool bReplace, sal_uInt16 nPgPos,
                               sal_Bool bNoDialogs, ::sd::DrawDocShell* pBookmarkDocSh,
                               sal_Bool bCopy, sal_Bool bMergeMasterPages,
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 595561b..9db7af0 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -202,7 +202,7 @@ void lcl_IterateBookmarkPages( SdDrawDocument &rDoc, SdDrawDocument* pBookmarkDo
 \************************************************************************/
 
 void lcl_IterateBookmarkPages( SdDrawDocument &rDoc, SdDrawDocument* pBookmarkDoc,
-                               std::vector<rtl::OUString> &rBookmarkList, sal_uInt16 nBMSdPageCount,
+                               const std::vector<rtl::OUString> &rBookmarkList, sal_uInt16 nBMSdPageCount,
                                InsertBookmarkAsPage_FindDuplicateLayouts& rPageIterator )
 {
     //
@@ -992,7 +992,7 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
 }
 
 sal_Bool SdDrawDocument::InsertBookmarkAsPage(
-    std::vector<rtl::OUString> &rBookmarkList,
+    const std::vector<rtl::OUString> &rBookmarkList,
     std::vector<rtl::OUString> &rExchangeList,            // Liste der zu verwendenen Namen
     sal_Bool bLink,
     sal_Bool bReplace,
commit 5d8ce0db822414df88530e58560eee0a46485737
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Tue Mar 27 19:56:19 2012 -0430

    Overload InsertBookmarkAsObject to use std::vector instead of List.
    
    This are the hardest ones to port, since the rExchangeList parameter uses
    the last position from InsertBookmarkAsPage in InsertBookmarkAsObject, so
    the best idea i came up with to avoid doing nasty stuffs was erase procesed
    objects in InsertBookmarkAsPage and add an extra parameter to
    InsertBookmarkAsObject that recalculates object count when rExchangeList
    has items but its manipulated by InsertBookmarkAsPage first like it occurs
    in function SdDrawDocument::InsertBookmark.

diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
index 9146e34..35816d0 100644
--- a/sd/inc/drawdoc.hxx
+++ b/sd/inc/drawdoc.hxx
@@ -383,6 +383,11 @@ public:
                                                 sal_Bool bLink, ::sd::DrawDocShell* pBookmarkDocSh,
                                                 Point* pObjPos);
 
+    sal_Bool InsertBookmarkAsObject(const std::vector<rtl::OUString> &rBookmarkList,
+                                    std::vector<rtl::OUString> &rExchangeList,
+                                    sal_Bool bLink, ::sd::DrawDocShell* pBookmarkDocSh,
+                                    Point* pObjPos, bool bCalcObjCount = false);
+
     SD_DLLPUBLIC void   CloseBookmarkDoc();
 
     SdrObject*          GetObj(const String& rObjName) const;
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 5cb6918..595561b 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -1735,6 +1735,195 @@ sal_Bool SdDrawDocument::InsertBookmarkAsObject(
 
 /*************************************************************************
 |*
+|* Fuegt ein Bookmark als Objekt ein
+|*
+\************************************************************************/
+
+sal_Bool SdDrawDocument::InsertBookmarkAsObject(
+    const std::vector<rtl::OUString> &rBookmarkList,
+    std::vector<rtl::OUString> &rExchangeList,            // Liste der zu verwendenen Namen
+    sal_Bool /* bLink */,
+    ::sd::DrawDocShell* pBookmarkDocSh,
+    Point* pObjPos, bool bCalcObjCount)
+{
+    sal_Bool bOK = sal_True;
+    sal_Bool bOLEObjFound = sal_False;
+    ::sd::View* pBMView = NULL;
+
+    SdDrawDocument* pBookmarkDoc = NULL;
+    String aBookmarkName;
+
+    if (pBookmarkDocSh)
+    {
+        pBookmarkDoc = pBookmarkDocSh->GetDoc();
+
+        if (pBookmarkDocSh->GetMedium())
+        {
+            aBookmarkName = pBookmarkDocSh->GetMedium()->GetName();
+        }
+    }
+    else if ( mxBookmarkDocShRef.Is() )
+    {
+        pBookmarkDoc = mxBookmarkDocShRef->GetDoc();
+        aBookmarkName = maBookmarkFile;
+    }
+    else
+    {
+        return sal_False;
+    }
+
+    if (rBookmarkList.empty())
+    {
+        pBMView = new ::sd::View(*pBookmarkDoc, (OutputDevice*) NULL);
+        pBMView->EndListening(*pBookmarkDoc);
+        pBMView->MarkAll();
+    }
+    else
+    {
+        SdrPage* pPage;
+        SdrPageView* pPV;
+
+        std::vector<rtl::OUString>::const_iterator pIter;
+        for ( pIter = rBookmarkList.begin(); pIter != rBookmarkList.end(); ++pIter )
+        {
+            /******************************************************************
+            * Namen der Bookmarks aus Liste holen
+            ******************************************************************/
+            String aBMName (*pIter);
+
+            SdrObject* pObj = pBookmarkDoc->GetObj(aBMName);
+
+            if (pObj)
+            {
+                // Objekt gefunden
+
+                if (pObj->GetObjInventor() == SdrInventor &&
+                    pObj->GetObjIdentifier() == OBJ_OLE2)
+                {
+                    bOLEObjFound = sal_True;
+                }
+
+                if (!pBMView)
+                {
+                    // View erstmalig erzeugen
+                    pBMView = new ::sd::View(*pBookmarkDoc, (OutputDevice*) NULL);
+                    pBMView->EndListening(*pBookmarkDoc);
+                }
+
+                pPage = pObj->GetPage();
+
+                if (pPage->IsMasterPage())
+                {
+                    pPV = pBMView->ShowSdrPage(pBMView->GetModel()->GetMasterPage(pPage->GetPageNum()));
+                }
+                else
+                {
+                    pPV = pBMView->GetSdrPageView();
+                    if( !pPV || (pPV->GetPage() != pPage))
+                        pPV = pBMView->ShowSdrPage(pPage);
+                }
+
+                pBMView->MarkObj(pObj, pPV, sal_False);
+            }
+        }
+    }
+
+    if (pBMView)
+    {
+        /**********************************************************************
+        * Selektierte Objekte einfuegen
+        **********************************************************************/
+        ::sd::View* pView = new ::sd::View(*this, (OutputDevice*) NULL);
+        pView->EndListening(*this);
+
+        // Seite bestimmen, auf der die Objekte eingefuegt werden sollen
+        SdrPage* pPage = GetSdPage(0, PK_STANDARD);
+
+        if (mpDocSh)
+        {
+            ::sd::ViewShell* pViewSh = mpDocSh->GetViewShell();
+
+            if (pViewSh)
+            {
+                // Welche Seite wird denn aktuell angezeigt?
+                SdrPageView* pPV = pViewSh->GetView()->GetSdrPageView();
+
+                if (pPV)
+                {
+                    pPage = pPV->GetPage();
+                }
+                else if (pViewSh->GetActualPage())
+                {
+                    pPage = pViewSh->GetActualPage();
+                }
+            }
+        }
+
+        Point aObjPos;
+
+        if (pObjPos)
+        {
+            aObjPos = *pObjPos;
+        }
+        else
+        {
+            aObjPos = Rectangle(Point(), pPage->GetSize()).Center();
+        }
+
+        sal_uLong nCountBefore = 0;
+
+        if (!rExchangeList.empty() || bCalcObjCount)
+        {
+            // OrdNums sortieren und Anzahl Objekte vor dem Einfuegen bestimmen
+            pPage->RecalcObjOrdNums();
+            nCountBefore = pPage->GetObjCount();
+        }
+
+        if (bOLEObjFound)
+            pBMView->GetDoc().SetAllocDocSh(sal_True);
+
+        SdDrawDocument* pTmpDoc = (SdDrawDocument*) pBMView->GetAllMarkedModel();
+        bOK = pView->Paste(*pTmpDoc, aObjPos, pPage);
+
+        if (bOLEObjFound)
+            pBMView->GetDoc().SetAllocDocSh(sal_False);
+
+        if (!bOLEObjFound)
+            delete pTmpDoc;             // Wird ansonsten von der DocShell zerstoert
+
+        delete pView;
+
+        if (!rExchangeList.empty())
+        {
+            // Anzahl Objekte nach dem Einfuegen bestimmen
+            sal_uLong nCount = pPage->GetObjCount();
+
+            std::vector<rtl::OUString>::const_iterator pIter = rExchangeList.begin();
+            for (sal_uLong nObj = nCountBefore; nObj < nCount; nObj++)
+            {
+                // Zuverwendener Name aus Exchange-Liste holen
+                if (pIter != rExchangeList.end())
+                {
+                    String aExchangeName (*pIter);
+
+                    if (pPage->GetObj(nObj))
+                    {
+                        pPage->GetObj(nObj)->SetName(aExchangeName);
+                    }
+
+                    ++pIter;
+                }
+            }
+        }
+    }
+
+    delete pBMView;
+
+    return bOK;
+}
+
+/*************************************************************************
+|*
 |* Beendet das Einfuegen von Bookmarks
 |*
 \************************************************************************/
commit a8daf5ff0a825777af0438b5605c5796acb6dd72
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Tue Mar 27 18:48:54 2012 -0430

    Overload InsertBookmarkAsPage to use std::vector instead of List.
    
    This are the hardest ones to port, since the rExchangeList parameter uses
    the last position from InsertBookmarkAsPage in InsertBookmarkAsObject, so
    the best idea i came up with to avoid doing nasty stuffs was erase procesed
    objects in InsertBookmarkAsPage and add an extra parameter to
    InsertBookmarkAsObject that recalculates object count when rExchangeList
    has items but its manipulated by InsertBookmarkAsPage first like it occurs
    in function SdDrawDocument::InsertBookmark.

diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
index b5dd3e2..9146e34 100644
--- a/sd/inc/drawdoc.hxx
+++ b/sd/inc/drawdoc.hxx
@@ -326,6 +326,59 @@ public:
                                               sal_Bool bNoDialogs, ::sd::DrawDocShell* pBookmarkDocSh,
                                               sal_Bool bCopy, sal_Bool bMergeMasterPages,
                                               sal_Bool bPreservePageNames);
+
+    /** Insert pages into this document
+
+        This method inserts whole pages into this document, either
+        selected ones (specified via pBookmarkList/pExchangeList), or
+        all from the source document.
+
+        @attention Beware! This method in it's current state does not
+        handle all combinations of their input parameters
+        correctly. For example, for pBookmarkList=NULL, bReplace=sal_True
+        is ignored (no replace happens).
+
+        @param pBookmarkList
+        A list of strings, denoting the names of the pages to be copied
+
+        @param pExchangeList
+        A list of strings, denoting the names of the pages to be renamed
+
+        @param bLink
+        Whether the inserted pages should be links to the bookmark document
+
+        @param bReplace
+        Whether the pages should not be inserted, but replace the pages in
+        the destination document
+
+        @param nPgPos
+        Insertion point/start of replacement
+
+        @param bNoDialogs
+        Whether query dialogs are allowed (e.g. for page scaling)
+
+        @param pBookmarkDocSh
+        DocShell of the source document (used e.g. to extract the filename
+        for linked pages)
+
+        @param bCopy
+        Whether the source document should be treated as immutable (i.e.
+        inserted pages are not removed from it, but cloned)
+
+        @param bMergeMasterPages
+        Whether the source document's master pages should be copied, too.
+
+        @param bPreservePageNames
+        Whether the replace operation should take the name from the new
+        page, or preserve the old name
+     */
+
+    sal_Bool InsertBookmarkAsPage(std::vector<rtl::OUString> &rBookmarkList, std::vector<rtl::OUString> &rExchangeList,
+                              sal_Bool bLink, sal_Bool bReplace, sal_uInt16 nPgPos,
+                              sal_Bool bNoDialogs, ::sd::DrawDocShell* pBookmarkDocSh,
+                              sal_Bool bCopy, sal_Bool bMergeMasterPages,
+                              sal_Bool bPreservePageNames);
+
     sal_Bool                InsertBookmarkAsObject(List* pBookmarkList, List* pExchangeListL,
                                                 sal_Bool bLink, ::sd::DrawDocShell* pBookmarkDocSh,
                                                 Point* pObjPos);
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 6342aa8..5cb6918 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -991,6 +991,561 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
     return bContinue;
 }
 
+sal_Bool SdDrawDocument::InsertBookmarkAsPage(
+    std::vector<rtl::OUString> &rBookmarkList,
+    std::vector<rtl::OUString> &rExchangeList,            // Liste der zu verwendenen Namen
+    sal_Bool bLink,
+    sal_Bool bReplace,
+    sal_uInt16 nInsertPos,
+    sal_Bool bNoDialogs,
+    ::sd::DrawDocShell* pBookmarkDocSh,
+    sal_Bool bCopy,
+    sal_Bool bMergeMasterPages,
+    sal_Bool bPreservePageNames)
+{
+    sal_Bool bOK = sal_True;
+    sal_Bool bContinue = sal_True;
+    sal_Bool bScaleObjects = sal_False;
+    sal_uInt16 nReplacedStandardPages = 0;
+
+    SdDrawDocument* pBookmarkDoc = NULL;
+    String aBookmarkName;
+
+    if (pBookmarkDocSh)
+    {
+        pBookmarkDoc = pBookmarkDocSh->GetDoc();
+
+        if (pBookmarkDocSh->GetMedium())
+        {
+            aBookmarkName = pBookmarkDocSh->GetMedium()->GetName();
+        }
+    }
+    else if ( mxBookmarkDocShRef.Is() )
+    {
+        pBookmarkDoc = mxBookmarkDocShRef->GetDoc();
+        aBookmarkName = maBookmarkFile;
+    }
+    else
+    {
+        return sal_False;
+    }
+
+    const sal_uInt16 nSdPageCount = GetSdPageCount(PK_STANDARD);
+    const sal_uInt16 nBMSdPageCount = pBookmarkDoc->GetSdPageCount(PK_STANDARD);
+    const sal_uInt16 nMPageCount = GetMasterPageCount();
+
+    if (nSdPageCount==0 || nBMSdPageCount==0 || nMPageCount==0)
+    {
+        bContinue = bOK = sal_False;
+        return(bContinue);
+    }
+
+    // Store the size and some other properties of the first page and notes
+    // page so that inserted pages can be properly scaled even when inserted
+    // before the first page.
+    // Note that the pointers are used later on as general page pointers.
+    SdPage* pRefPage = GetSdPage(0, PK_STANDARD);
+    Size  aSize(pRefPage->GetSize());
+    sal_Int32 nLeft  = pRefPage->GetLftBorder();
+    sal_Int32 nRight = pRefPage->GetRgtBorder();
+    sal_Int32 nUpper = pRefPage->GetUppBorder();
+    sal_Int32 nLower = pRefPage->GetLwrBorder();
+    Orientation eOrient = pRefPage->GetOrientation();
+
+    SdPage* pNPage = GetSdPage(0, PK_NOTES);
+    Size aNSize(GetSdPage(0, PK_NOTES)->GetSize());
+    sal_Int32 nNLeft  = pNPage->GetLftBorder();
+    sal_Int32 nNRight = pNPage->GetRgtBorder();
+    sal_Int32 nNUpper = pNPage->GetUppBorder();
+    sal_Int32 nNLower = pNPage->GetLwrBorder();
+    Orientation eNOrient = pRefPage->GetOrientation();
+
+    // Seitengroesse und -raender an die Werte der letzten
+    // Seiten anpassen?
+    pRefPage = GetSdPage(nSdPageCount - 1, PK_STANDARD);
+
+    if( bNoDialogs )
+    {
+        if( rBookmarkList.empty() )
+            bScaleObjects = pRefPage->IsScaleObjects();
+        else
+            bScaleObjects = sal_True;
+    }
+    else
+    {
+        SdPage* pBMPage = pBookmarkDoc->GetSdPage(0,PK_STANDARD);
+
+        if (pBMPage->GetSize()        != pRefPage->GetSize()         ||
+            pBMPage->GetLftBorder()   != pRefPage->GetLftBorder()    ||
+            pBMPage->GetRgtBorder()   != pRefPage->GetRgtBorder()    ||
+            pBMPage->GetUppBorder()   != pRefPage->GetUppBorder()    ||
+            pBMPage->GetLwrBorder()   != pRefPage->GetLwrBorder())
+        {
+            String aStr(SdResId(STR_SCALE_OBJECTS));
+            sal_uInt16 nBut = QueryBox( NULL, WB_YES_NO_CANCEL, aStr).Execute();
+
+            bScaleObjects = nBut == RET_YES;
+            bContinue     = nBut != RET_CANCEL;
+
+            if (!bContinue)
+            {
+                return(bContinue);
+            }
+        }
+    }
+
+
+    /**************************************************************************
+    |* Die benoetigten Praesentations-StyleSheets ermitteln und vor
+    |* den Seiten transferieren, sonst verlieren die Textobjekte
+    |* beim Transfer den Bezug zur Vorlage
+    \*************************************************************************/
+    ::svl::IUndoManager* pUndoMgr = NULL;
+    if( mpDocSh )
+    {
+        pUndoMgr = mpDocSh->GetUndoManager();
+        pUndoMgr->EnterListAction(String(SdResId(STR_UNDO_INSERTPAGES)), String());
+    }
+
+    //
+    // Refactored copy'n'pasted layout name collection into IterateBookmarkPages
+    //
+    std::vector<rtl::OUString> aLayoutsToTransfer;
+    InsertBookmarkAsPage_FindDuplicateLayouts aSearchFunctor( aLayoutsToTransfer );
+    lcl_IterateBookmarkPages( *this, pBookmarkDoc, rBookmarkList, nBMSdPageCount, aSearchFunctor );
+
+
+    /**************************************************************************
+    * Die tatsaechlich benoetigten Vorlagen kopieren
+    **************************************************************************/
+    SdStyleSheetPool* pBookmarkStyleSheetPool =
+    (SdStyleSheetPool*) pBookmarkDoc->GetStyleSheetPool();
+
+    // Wenn Vorlagen kopiert werden muessen, dann muessen auch die
+    // MasterPages kopiert werden!
+    if( !aLayoutsToTransfer.empty() )
+        bMergeMasterPages = sal_True;
+
+    std::vector<rtl::OUString>::const_iterator pIter;
+    for ( pIter = aLayoutsToTransfer.begin(); pIter != aLayoutsToTransfer.end(); ++pIter )
+    {
+        SdStyleSheetVector aCreatedStyles;
+        String layoutName = *pIter;
+
+        ((SdStyleSheetPool*)GetStyleSheetPool())->CopyLayoutSheets(layoutName, *pBookmarkStyleSheetPool,aCreatedStyles);
+
+        if(!aCreatedStyles.empty())
+        {
+            if( pUndoMgr )
+            {
+                SdMoveStyleSheetsUndoAction* pMovStyles = new SdMoveStyleSheetsUndoAction(this, aCreatedStyles, sal_True);
+                pUndoMgr->AddUndoAction(pMovStyles);
+            }
+        }
+    }
+
+    /**************************************************************************
+    * Dokument einfuegen
+    **************************************************************************/
+
+    const bool bUndo = IsUndoEnabled();
+
+    if( bUndo )
+        BegUndo(String(SdResId(STR_UNDO_INSERTPAGES)));
+
+    if (rBookmarkList.empty())
+    {
+        if (nInsertPos >= GetPageCount())
+        {
+            // Seiten werden hinten angefuegt
+            nInsertPos = GetPageCount();
+        }
+
+        sal_uInt16 nActualInsertPos = nInsertPos;
+
+        sal_uInt16 nBMSdPage;
+        std::set<sal_uInt16> aRenameSet;
+        std::map<sal_uInt16,rtl::OUString> aNameMap;
+
+        for (nBMSdPage=0; nBMSdPage < nBMSdPageCount; nBMSdPage++)
+        {
+            SdPage* pBMPage = pBookmarkDoc->GetSdPage(nBMSdPage, PK_STANDARD);
+            String  pName( pBMPage->GetName() );
+            sal_Bool    bIsMasterPage;
+
+            if (bLink)
+            {
+                // Es werden sich die Namen aller Seiten gemerkt
+                aNameMap.insert(std::make_pair(nBMSdPage,pName));
+            }
+
+            // Have to check for duplicate names here, too
+            // don't change name if source and dest model are the same!
+            if( pBookmarkDoc != this &&
+                GetPageByName(pName, bIsMasterPage ) != SDRPAGE_NOTFOUND )
+            {
+                // delay renaming *after* pages are copied (might destroy source otherwise)
+                aRenameSet.insert(nBMSdPage);
+            }
+        }
+
+        Merge(*pBookmarkDoc,
+              1,                 // Nicht die Handzettelseite
+              0xFFFF,            // Aber alle anderen
+              nActualInsertPos,  // An Position einfuegen
+              bMergeMasterPages, // MasterPages mitnehmen
+              sal_False,             // Aber nur die benoetigten MasterPages
+              sal_True,              // Undo-Aktion erzeugen
+              bCopy);            // Seiten kopieren (oder mergen)
+
+        for (nBMSdPage=0; nBMSdPage < nBMSdPageCount; nBMSdPage++)
+        {
+            SdPage* pPage       = (SdPage*) GetPage(nActualInsertPos);
+            SdPage* pNotesPage  = (SdPage*) GetPage(nActualInsertPos+1);
+
+            // delay renaming *after* pages are copied (might destroy source otherwise)
+            if( aRenameSet.find(nBMSdPage) != aRenameSet.end() )
+            {
+                // Seitenname schon vorhanden -> Defaultname
+                // fuer Standard & Notizseite
+                pPage->SetName(String());
+                pNotesPage->SetName(String());
+            }
+
+            if (bLink)
+            {
+                String aName(aNameMap[nBMSdPage]);
+
+                // Nun werden die Link-Namen zusammengestellt
+                pPage->SetFileName(aBookmarkName);
+                pPage->SetBookmarkName(aName);
+                pPage->SetModel(this);
+            }
+
+            nActualInsertPos += 2;
+        }
+    }
+    else
+    {
+        /**********************************************************************
+        * Ausgewaehlte Seiten einfuegen
+        **********************************************************************/
+        SdPage* pBMPage;
+
+        if (nInsertPos >= GetPageCount())
+        {
+            // Seiten werden hinten angefuegt
+            bReplace = sal_False;
+            nInsertPos = GetPageCount();
+        }
+
+        sal_uInt16 nActualInsertPos = nInsertPos;
+
+        // Collect the bookmarked pages.
+        ::std::vector<SdPage*> aBookmarkedPages (rBookmarkList.size(), NULL);
+        for ( size_t nPos = 0, n = rBookmarkList.size(); nPos < n; ++nPos)
+        {
+            String  aPgName(rBookmarkList[nPos]);
+            sal_Bool    bIsMasterPage;
+            sal_uInt16  nBMPage = pBookmarkDoc->GetPageByName( aPgName, bIsMasterPage );
+
+            if (nBMPage != SDRPAGE_NOTFOUND)
+            {
+                aBookmarkedPages[nPos] =  dynamic_cast<SdPage*>(pBookmarkDoc->GetPage(nBMPage));
+            }
+        }
+
+        for ( size_t nPos = 0, n = rBookmarkList.size(); nPos < n; ++nPos)
+        {
+            pBMPage = aBookmarkedPages[nPos];
+            sal_uInt16 nBMPage = pBMPage!=NULL ? pBMPage->GetPageNum() : SDRPAGE_NOTFOUND;
+
+            if (pBMPage && pBMPage->GetPageKind()==PK_STANDARD && !pBMPage->IsMasterPage())
+            {
+                /**************************************************************
+                * Es muss eine StandardSeite sein
+                **************************************************************/
+                sal_Bool bMustRename = sal_False;
+
+                // delay renaming *after* pages are copied (might destroy source otherwise)
+                // don't change name if source and dest model are the same!
+                // avoid renaming if replacing the same page
+                String  aPgName(rBookmarkList[nPos]);
+                sal_Bool    bIsMasterPage;
+                sal_uInt16 nPageSameName = GetPageByName(aPgName, bIsMasterPage);
+                if( pBookmarkDoc != this &&
+                    nPageSameName != SDRPAGE_NOTFOUND &&
+                    ( !bReplace ||
+                      nPageSameName != nActualInsertPos ) )
+                {
+                    bMustRename = sal_True;
+                }
+
+                SdPage* pBookmarkPage = pBMPage;
+                if (bReplace )
+                {
+                    ReplacePageInCustomShows( dynamic_cast< SdPage* >( GetPage( nActualInsertPos ) ), pBookmarkPage );
+                }
+
+                Merge(*pBookmarkDoc,
+                      nBMPage,           // Von Seite (Standard)
+                      nBMPage+1,         // Bis Seite (Notizen)
+                      nActualInsertPos,  // An Position einfuegen
+                      bMergeMasterPages, // MasterPages mitnehmen
+                      sal_False,             // Aber nur die benoetigten MasterPages
+                      sal_True,              // Undo-Aktion erzeugen
+                      bCopy);            // Seiten kopieren (oder mergen)
+
+                if( bReplace )
+                {
+                    if( GetPage( nActualInsertPos ) != pBookmarkPage )
+                    {
+                        // bookmark page was not moved but cloned, so update custom shows again

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list