From f19d0a42b139c5e3aca3a4bb7ed4e926247b729e Mon Sep 17 00:00:00 2001 From: "Sergey.Luzyanin" Date: Fri, 17 Jan 2025 23:08:43 +0300 Subject: [PATCH] [bug] for bug #72506 --- slide/Drawing/Transitions.js | 40 ++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/slide/Drawing/Transitions.js b/slide/Drawing/Transitions.js index 534964b23b..954c3e543d 100644 --- a/slide/Drawing/Transitions.js +++ b/slide/Drawing/Transitions.js @@ -2755,10 +2755,11 @@ function CDemonstrationManager(htmlpage) this.isMouseDown = false; this.StartSlideNum = -1; + this.StartSlideObject = null; this.TmpSlideVisible = -1; this.LastMoveTime = null; - this.GoToSlideShortcutStack = []; + this.GoToSlideShortcutStack = []; var oThis = this; @@ -2958,12 +2959,22 @@ function CDemonstrationManager(htmlpage) this.Start = function(main_div_id, start_slide_num, is_play_mode, is_no_fullscreen) { - this.StartSlideNum = start_slide_num; - if (-1 == start_slide_num) - start_slide_num = 0; + let nStartSlideNum = start_slide_num; + if(Asc.editor.isMasterMode()) + { + nStartSlideNum = 0; + this.StartSlideNum = nStartSlideNum; + this.StartSlideObject = this.HtmlPage.m_oApi.WordControl.m_oLogicDocument.GetCurrentSlide(); + } + else + { + this.StartSlideNum = nStartSlideNum; + if (-1 == nStartSlideNum) + nStartSlideNum = 0; + } this.DemonstrationDiv = document.getElementById(main_div_id); - if (this.DemonstrationDiv == null || start_slide_num < 0 || start_slide_num >= this.GetSlidesCount()) + if (this.DemonstrationDiv == null || nStartSlideNum < 0 || nStartSlideNum >= this.GetSlidesCount()) return; if (undefined !== window["AscDesktopEditor"] && (true !== is_no_fullscreen)) @@ -2985,7 +2996,7 @@ function CDemonstrationManager(htmlpage) this.Canvas.width = AscCommon.AscBrowser.convertToRetinaValue(_width, true); this.Canvas.height = AscCommon.AscBrowser.convertToRetinaValue(_height, true); - this.SlideNum = start_slide_num; + this.SlideNum = nStartSlideNum; this.HtmlPage.m_oApi.sync_DemonstrationSlideChanged(this.SlideNum); @@ -3429,6 +3440,23 @@ function CDemonstrationManager(htmlpage) } this.StartSlideNum = -1; + if(this.HtmlPage.m_oApi.isMasterMode()) + { + if(this.StartSlideObject) + { + let oPresentation = this.HtmlPage.m_oApi.WordControl.m_oLogicDocument; + let nIdx = oPresentation.GetSlideIndex(this.StartSlideObject); + if(nIdx > -1) + { + this.HtmlPage.GoToPage(nIdx); + } + else + { + this.HtmlPage.GoToPage(0); + } + } + } + this.StartSlideObject = null; this.StopAllAnimations(); };