From 9697e09a3021a86d974ee0ff182c6657abe17433 Mon Sep 17 00:00:00 2001 From: Russel Rillema Date: Thu, 30 May 2019 17:31:44 +0200 Subject: [PATCH] Updated a bug that caused an exception to be thrown when moving a slide to the first position, VB code needs to be checked as I am not as familiar with VB --- ...ove-a-slide-to-a-new-position-in-a-presentation.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/docs/how-to-move-a-slide-to-a-new-position-in-a-presentation.md b/docs/how-to-move-a-slide-to-a-new-position-in-a-presentation.md index caedfd5..f04c328 100644 --- a/docs/how-to-move-a-slide-to-a-new-position-in-a-presentation.md +++ b/docs/how-to-move-a-slide-to-a-new-position-in-a-presentation.md @@ -348,7 +348,7 @@ source slide) is identified. { targetSlide = null; } - if (from < to) + else if (from < to) { targetSlide = slideIdList.ChildElements[to] as SlideId; } @@ -374,8 +374,7 @@ source slide) is identified. ' Identify the position of the target slide after which to move the source slide. If to = 0 Then targetSlide = Nothing - End If - If From < to Then + ElseIf From < to Then targetSlide = TryCast(slideIdList.ChildElements(to), SlideId) Else targetSlide = TryCast(slideIdList.ChildElements(to - 1), SlideId) @@ -514,7 +513,7 @@ Following is the complete sample code in both C\# and Visual Basic. { targetSlide = null; } - if (from < to) + else if (from < to) { targetSlide = slideIdList.ChildElements[to] as SlideId; } @@ -616,9 +615,7 @@ Following is the complete sample code in both C\# and Visual Basic. ' Identify the position of the target slide after which to move the source slide. If (moveTo = 0) Then targetSlide = Nothing - End If - - If (from < moveTo) Then + ElseIf (from < moveTo) Then targetSlide = CType(slideIdList.ChildElements(moveTo), SlideId) Else targetSlide = CType(slideIdList.ChildElements((moveTo - 1)), SlideId)