summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2004-11-26 14:11:29 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2004-11-26 14:11:29 +0000
commit0671ae6709715b838d4af9359e145c22c1228886 (patch)
tree12f1951e8c73492ab83f2bf8f4e0fc6d421e3d8a /sd
parent848d8b6cbfdd54ba432ed58c4610cf7e9508ec88 (diff)
INTEGRATION: CWS impress19 (1.39.14); FILE MERGED
2004/11/12 09:34:52 af 1.39.14.1: #i32947# Return pointer to new page created by CreateOrDuplicatePage().
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/view/viewshe3.cxx43
1 files changed, 11 insertions, 32 deletions
diff --git a/sd/source/ui/view/viewshe3.cxx b/sd/source/ui/view/viewshe3.cxx
index 1a4c37c2efe9..497f837af747 100644
--- a/sd/source/ui/view/viewshe3.cxx
+++ b/sd/source/ui/view/viewshe3.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: viewshe3.cxx,v $
*
- * $Revision: 1.39 $
+ * $Revision: 1.40 $
*
- * last change: $Author: pjunck $ $Date: 2004-10-28 13:36:03 $
+ * last change: $Author: hr $ $Date: 2004-11-26 15:11:29 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1507,7 +1507,7 @@ void ViewShell::SetPreview( bool bVisible )
2. Use the model to create a new page or duplicate an existing one.
3. Update the tab control and switch to the new page.
*/
-void ViewShell::CreateOrDuplicatePage (
+SdPage* ViewShell::CreateOrDuplicatePage (
SfxRequest& rRequest,
PageKind ePageKind,
SdPage* pPage)
@@ -1584,7 +1584,7 @@ void ViewShell::CreateOrDuplicatePage (
delete pDlg;
rRequest.Ignore ();
- return;
+ return NULL;
}
else
{
@@ -1626,7 +1626,7 @@ void ViewShell::CreateOrDuplicatePage (
StarBASIC::FatalError (SbERR_WRONG_ARGS);
rRequest.Ignore ();
- return;
+ return NULL;
}
else
{
@@ -1663,7 +1663,7 @@ void ViewShell::CreateOrDuplicatePage (
StarBASIC::FatalError (SbERR_BAD_PROP_VALUE);
rRequest.Ignore ();
- return;
+ return NULL;
}
}
@@ -1747,37 +1747,16 @@ void ViewShell::CreateOrDuplicatePage (
// Try to handle another slot id gracefully.
nNewPageIndex = 0xffff;
}
+ SdPage* pNewPage = NULL;
if (nNewPageIndex != 0xffff)
{
- pDrView->AddUndo (new SdrUndoNewPage (
- *pDocument->GetSdPage (nNewPageIndex, PK_STANDARD)));
- pDrView->AddUndo (new SdrUndoNewPage (
- *pDocument->GetSdPage (nNewPageIndex, PK_NOTES)));
+ pNewPage = pDocument->GetSdPage (nNewPageIndex, PK_STANDARD);
+ pDrView->AddUndo (new SdrUndoNewPage (*pNewPage));
+ pDrView->AddUndo (new SdrUndoNewPage (*pDocument->GetSdPage (nNewPageIndex, PK_NOTES)));
}
-
pDrView->EndUndo();
-#if 0
- // 3. Update the tab control.
- aTabControl.Clear();
-
- SdPage* pPage;
- String aPageName;
- USHORT nPageCnt = pDocument->GetSdPageCount(ePageKind);
-
- for (USHORT i = 0; i < nPageCnt; i++)
- {
- pPage = pDocument->GetSdPage(i, ePageKind);
- aPageName = pPage->GetName();
- aTabControl.InsertPage(i + 1, aPageName);
- }
-
- aTabControl.SetCurPageId (nNewPageIndex + 1);
-
- GetViewFrame()->GetDispatcher()->Execute(SID_SWITCHPAGE,
- (rRequest.IsSynchronCall() ? SFX_CALLMODE_SYNCHRON : SFX_CALLMODE_ASYNCHRON)
- | SFX_CALLMODE_RECORD);
-#endif
+ return pNewPage;
}