summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorRafael Dominguez <venccsralph@gmail.com>2012-04-01 08:44:01 -0430
committerLuboš Luňák <l.lunak@suse.cz>2012-04-13 18:42:10 +0200
commitc639aba4a522452b194d2648206901660c1caa43 (patch)
treedb6646040b6b9b8fbb5aebad1c2be0313ce95d85 /sd
parent236ebc083a3b69e140b01e7688e4650cb7d19c6f (diff)
Remove deprecated and unused methods.
Diffstat (limited to 'sd')
-rw-r--r--sd/inc/drawdoc.hxx59
-rw-r--r--sd/inc/sdabstdlg.hxx1
-rw-r--r--sd/source/core/drawdoc3.cxx892
-rw-r--r--sd/source/ui/dlg/inspagob.cxx27
-rw-r--r--sd/source/ui/dlg/sddlgfact.cxx4
-rw-r--r--sd/source/ui/dlg/sddlgfact.hxx1
-rw-r--r--sd/source/ui/dlg/sdtreelb.cxx30
-rw-r--r--sd/source/ui/inc/inspagob.hxx2
-rw-r--r--sd/source/ui/inc/sdtreelb.hxx1
-rw-r--r--sd/source/ui/view/sdview2.cxx73
10 files changed, 3 insertions, 1087 deletions
diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
index fb6af150db44..c9f69c9ab40d 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 8a78929b0199..8e01fbc58cde 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 d75ef2075b4d..63ce713db394 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 f9770fd1bc14..90e41a996998 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 9837d70bcccd..fb08787f4ac9 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 db5c9c9c7c57..34d9a6cbfd77 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 492c44c596a0..f44032d26ecf 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 c6d2f49bcd70..deea96c87687 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 509fbbd5e199..5a26745b0d1e 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 4e192e698f4b..fc366db8357f 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)