sd/inc/app.hrc | 2 +- sd/sdi/sdraw.sdi | 2 +- sd/source/ui/view/viewshe3.cxx | 10 ++++++---- 3 files changed, 8 insertions(+), 6 deletions(-)
New commits: commit d7cf5429336ea4cf9a92b3338fe03ef7dc142dcd Author: Pranam Lashkari <lpra...@collabora.com> AuthorDate: Fri Jun 2 03:43:05 2023 +0700 Commit: Pranam Lashkari <lpra...@collabora.com> CommitDate: Wed Jun 7 11:14:05 2023 +0200 sd: introduced impress slide duplication to particular position Change-Id: I4931f92158c31506b765376639907d2d4f250deb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152512 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> Reviewed-by: Pranam Lashkari <lpra...@collabora.com> (cherry picked from commit dc007c18097143bdb192955dda730d696d8bcb31) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152656 Tested-by: Jenkins diff --git a/sd/inc/app.hrc b/sd/inc/app.hrc index ec0eed81d1f3..e275e4688258 100644 --- a/sd/inc/app.hrc +++ b/sd/inc/app.hrc @@ -246,7 +246,7 @@ #define ID_VAL_ISACTIVE (SID_SD_START+216) #define ID_VAL_WHATKIND (SID_SD_START+217) #define ID_VAL_PAGEWIDTH (SID_SD_START+218) - // FREE +#define ID_INSERT_POS (SID_SD_START+219) #define ID_VAL_PAGETOP (SID_SD_START+220) #define ID_VAL_PAGEBOTTOM (SID_SD_START+221) #define ID_VAL_PAGELEFT (SID_SD_START+222) diff --git a/sd/sdi/sdraw.sdi b/sd/sdi/sdraw.sdi index cf4d008f6cc8..7bb752c687ac 100644 --- a/sd/sdi/sdraw.sdi +++ b/sd/sdi/sdraw.sdi @@ -1337,7 +1337,7 @@ SfxBoolItem DrawingMode SID_DRAWINGMODE ] SfxVoidItem DuplicatePage SID_DUPLICATE_PAGE -(SfxStringItem PageName ID_VAL_PAGENAME,SfxUInt32Item WhatLayout ID_VAL_WHATLAYOUT,SfxBoolItem IsPageBack ID_VAL_ISPAGEBACK,SfxBoolItem IsPageObj ID_VAL_ISPAGEOBJ) +(SfxStringItem PageName ID_VAL_PAGENAME,SfxUInt32Item WhatLayout ID_VAL_WHATLAYOUT,SfxBoolItem IsPageBack ID_VAL_ISPAGEBACK,SfxBoolItem IsPageObj ID_VAL_ISPAGEOBJ,SfxUInt16Item InsertPos ID_INSERT_POS) [ AutoUpdate = FALSE, FastCall = FALSE, diff --git a/sd/source/ui/view/viewshe3.cxx b/sd/source/ui/view/viewshe3.cxx index a7d466f6d94b..cb76eaf99844 100644 --- a/sd/source/ui/view/viewshe3.cxx +++ b/sd/source/ui/view/viewshe3.cxx @@ -189,7 +189,9 @@ SdPage* ViewShell::CreateOrDuplicatePage ( // 1. Process the arguments. const SfxItemSet* pArgs = rRequest.GetArgs(); - if (! pArgs) + const SfxUInt16Item* pInsertPos = rRequest.GetArg<SfxUInt16Item>(ID_INSERT_POS); + + if (! pArgs || (pArgs->Count() == 1 && pInsertPos)) { // AutoLayouts must be ready pDocument->StopWorkStartupDelay(); @@ -206,7 +208,7 @@ SdPage* ViewShell::CreateOrDuplicatePage ( eNotesLayout = pNotesTemplatePage->GetAutoLayout(); } } - else if (pArgs->Count() == 1) + else if (pArgs->Count() == 1 || pArgs->Count() == 2) { pDocument->StopWorkStartupDelay(); const SfxUInt32Item* pLayout = rRequest.GetArg<SfxUInt32Item>(ID_VAL_WHATLAYOUT); @@ -222,7 +224,7 @@ SdPage* ViewShell::CreateOrDuplicatePage ( } } } - else if (pArgs->Count() == 4) + else if (pArgs->Count() == 4 || pArgs->Count() == 5) { // AutoLayouts must be ready pDocument->StopWorkStartupDelay(); @@ -354,7 +356,7 @@ SdPage* ViewShell::CreateOrDuplicatePage ( aNotesPageName, bIsPageBack, bIsPageObj, - nInsertPosition); + pInsertPos ? (pInsertPos->GetValue()*2)+1 : nInsertPosition); break; default: